Same problem with the MenuBar icon as Tracy and Dough.

However, I'd really need to use an xml as a dataProvider.

Any ideeas?
Iuliu b.



--- In flexcoders@yahoogroups.com, wendel <[EMAIL PROTECTED]> wrote:
>
>  > I never could get this to work.  I'd like to see a simple 
working sample
>  > app myself.
>  >
>  >
>  >
>  > Tracy
> 
> hello Tracy and Doug,
> 
> Here is using actionscript, I use it with amfphp to fetch the menu 
from 
> database:
> 
> The secret is: don't use string in icon field, use a class name in 
the 
> icon field and it work for Panel, MenuBar and anything more that 
use icons.
> 
> Get the source here:
> http://www.wendelmaques.com.br/MenuBar_icons.zip
> 
> 
> Here is the code (for list archive):
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> xmlns="*"
> layout="vertical"
> horizontalAlign="left"
> creationComplete="initApp();"
> pageTitle="MenuBar with icons using ActionScript">
> 
> <mx:Script>
> <![CDATA[
> 
> // for icons visit: http://www.famfamfam.com/
> // get and save inside source dir
> 
> [Embed(source="www.famfamfam.com/lab/icons/asterisk_orange.png")]
> [Bindable] public var asterisk_orange:Class;                  
> 
> [Embed(source="www.famfamfam.com/lab/icons/page_red.png")]
> [Bindable] public var page_red:Class;                 
> 
> [Embed(source="www.famfamfam.com/lab/icons/folder_page.png")]
> [Bindable] public var folder_page:Class;                      
> 
> [Bindable] public var main_menu:Object =
> {label:"mx", children: [
> {icon:asterisk_orange,label:"Containers", children: [
>       {icon:page_red,label:"Accordian", children:[]},
>       {icon:page_red,label:"DividedBox", children: [
>               {icon:folder_page,label:"BoxDivider.as", 
data:"BoxDivider.as"},
>               {icon:folder_page,label:"BoxUniter.as", 
data:"BoxUniter.as"}]},
>       {icon:page_red,label: "Grid", children:[]}]},
> {icon:asterisk_orange,label: "Controls", children: [
>       {icon:page_red,label: "Alert", data: "Alert.as"},
>       {icon:page_red,label: "Styles", children: [
>               {icon:folder_page,label: "AlertForm.as", 
data:"AlertForm.as"}]},
>       {icon:page_red,label: "Tree", data: "Tree.as"},
>       {icon:page_red,label: "Button", data: "Button.as"}]},
> {icon:asterisk_orange,label: "Core", children:[]}
> ]};
> private function initApp():void {
> menu.dataProvider=main_menu;                          
> }
> 
> ]]>
> </mx:Script>
> <mx:MenuBar iconField="icon" id="menu"/>
> </mx:Application>
> 
> --
>   wendel, msn: [EMAIL PROTECTED]
>   http://www.wendelmaques.com.br/
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to