Select to view content in your preferred language

embedding icon in spark button bar

609
1
05-04-2011 10:55 AM
PeteVitt
Frequent Contributor
I'm tryng to embed icons in a button bar, but the actual icons dont get embedded, the objects do -so that my buttons show as [Object] when the app runs.

I've tried this
<s:ButtonBar id="ButBar" change="ChangeHandler(event);" width="310" x="222" y="35">
  <s:dataProvider>
  <s:ArrayList>
   <fx:Object icon="@Embed(source='images/identify_1.png')"/>
   <fx:Object icon="@Embed(source='images/zoomin_1.png')"/>
   <fx:Object icon="@Embed(source='images/zoomout_1.png')"/>
   <fx:Object icon="@Embed(source='images/pan_1.png')"/>
   <fx:Object icon="@Embed(source='images/FullExtent.png')"/>
  </s:ArrayList>
  </s:dataProvider>
</s:ButtonBar>

and also  this:
[Bindable]
[Embed(source="images/identify_1.png")]
public var identifyMap:Class;

<s:ButtonBar id="ButBar" change="ChangeHandler(event);" width="310" x="222" y="35">
  <s:dataProvider>
  <s:ArrayList>
   <fx:Object icon="{identifyMap}"/>
     </s:ArrayList>
  </s:dataProvider>
</s:ButtonBar>

Both approaches do the same -- is it because of the arrayList data provider maybe?  cant use any array dataprovider with the spark button bar.  Any ideas

Thanks

Pete
Tags (2)
0 Kudos
1 Reply
PeteVitt
Frequent Contributor
I changed from spark buttonbar to mx togglebuttonbar and spark data provider to mx dataprovider and it worked -- no idea why
0 Kudos