Re: [flexcoders] Icons are not displayed in menuItem
Hi Alex Thank you very much. It worked for both cases TestComponent.as and TestComponent.mxml. I added statement myMenu.document = this refers to TestComponent in which icons class are declared Thanks Rajan this; - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, September 15, 2008 8:03:38 PM Subject: RE: [flexcoders] Icons are not displayed in menuItem I’m surprised it picked up the icon in systemManager. getDefinitionByN ame. It should have picked it up from document[icon] , which is what I mentioned several replies ago. If you used TestComponent. mxml instead of TestComponent. as, the document pointer would be correct. You can try setting the menu’s document to your TestComponent instance. From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Rajan Jain Sent: Monday, September 15, 2008 1:49 PM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I looked into function itemToIcon in ListBase.as if(data is XML) { try { if(data[iconField] .length() != 0) { icon = String(data[ iconField] ); if(icon != null) { iconClass = Class(systemManager .getDefinitionBy Name(icon) ); if(iconClass) returniconClass; returndocument[icon] ; } } } catch(e:Error) { } } In this systemManager points to TestCodeBehind. mxml. If i declare variables in TestCodeBehind. mxml it works. mx:Script ![CDATA[ [Embed(source=assets/icon_ help.gif)] publicvar imgdeleteClass: Class; [Embed(source=assets/button_ edit.gif)] publicvar imgeditClass: Class; ]] /mx:Script but i cannot do this as these varibles need to be defined in TestComponent. as but i can change icon attribute in xml. So if reference can be made to TestComponent from systemManager then it will work. Please help me out. Thanks Rajan - Original Message From: Alex Harui [EMAIL PROTECTED] com To: [EMAIL PROTECTED] ups.com [EMAIL PROTECTED] ups..com Sent: Monday, September 15, 2008 2:06:26 PM Subject: RE: [flexcoders] Icons are not displayed in menuItem Object is a different code path. In XML, everything is strings and we have to convert them to classes. The key function is probably itemToIcon in ListBase.as From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Haykel BEN JEMIA Sent: Monday, September 15, 2008 2:06 AM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I think the problem is else where, because when I use an array of objects to define the menu, the icons get displayed. I also displayed both menus at the same time and only the one defined from the array of objects shows the icons, so the icons are definitely in the document. Here is the code I used: public var myMenu2:Menu; public var myMD:Array = [ {label: Edit, eventName: copy, icon: imgeditClass} , {label: Delete, eventName: delete, icon: imgdeleteClass} ]; and in showMenufunction( ) : myMenu2=Menu. createMenu( this, myMD,false); myMenu2.show( 400, 200); Haykel On Mon, Sep 15, 2008 at 7:34 AM, Alex Harui [EMAIL PROTECTED] com wrote: I think the icons are not on the document. Try defining TestComponent in mxml and see if that makes a differenc.e From:[EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of Rajan Jain Sent: Sunday, September 14, 2008 9:52 PM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan - - - - - - - - - - - - - - - - ?xml version=1.0 encoding=utf-8? mx:Applicationxmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute xmlns:local=* local:TestComponentwidth=100% height=100% /local:TestComponen t /mx:Application - - - - - - - - - - - - - - - - package { importflash.events. Event; importmx.containers. Panel; importmx.controls. Menu; importmx.events.FlexEvent ; publicclass TestComponent extends Panel { publicvar myMenu:Menu; [Embed(source=assets/icon_ help.gif)] publicvar imgdeleteClass: Class; [Embed(source=assets/button_ edit.gif)] publicvar imgeditClass: Class; publicvar myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; publicfunction TestComponent( ) { super(); addEventListener( FlexEvent. CREATION_ COMPLETE, showMenufunction
Re: [flexcoders] Icons are not displayed in menuItem
Dia menilai orang yang ahli di bidang TI pun juga lebih menyukai pekerjaan yang fleksibel tidak terikat pada satu perusahaan, sehingga mereka lebih memilih bergabung dengan perusahaan jasa alih daya. Mereka bisa mengerjakan beberapa proyek sekaligus dan dari berbagai penyewa. Gampang banget mengambil penilaian seperti itu. Orang IT juga kan manusia emang berhubungan ama komputer sama tetek bengeknya bikin orang IT jadi robot gitu. Ya ngga begitulah orang IT juga pengen donk kerja kantoran di satu perusahaan kayak orang2 lain yang kerjanya rutin. Ini kembali ke masing2 individu orang IT ada yang senang tidak terikat ada yang lebih merasa nyaman kalau terikat. Dia beropini begitu karena memang punya perusahaan outsourcing. Coba kalau dia jadi orang IT kayak kita2 disini, mungkin pendapatnya lain. Justru gara2 makin banyaknya perusahaan2 outsourcing seperti ini orang2 IT yg menginginkan pekerjaan full time jadi lebih sulit dibanding dulu. Hidup tergantung kontrak kerja, kalau masa kontrak udah mo abis belum ada kejelasan bikin stress, blm kalau udah berkeluarga. Mungkin berbeda dengan perusahaan yg bergerak sebagai Konsultan IT, karena mereka mempekerjakan tenaga IT untuk ditugaskan apabila ada proare not displayed in menuItem Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=* local:TestComponent width=100% height=100% /local:TestComponent /mx:Application *package* { *import* flash.events.Event; *import* mx.containers.Panel; *import* mx.controls.Menu; *import* mx.events.FlexEvent; *public* *class* *TestComponent* *extends* Panel { *public* *var* myMenu:Menu; [*Embed*(source=*assets/icon_help.gif*)] *public* *var* imgdeleteClass:Class; [*Embed*(source=*assets/button_edit.gif*)] *public* *var* imgeditClass:Class; *public* *var* myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; *public* *function* TestComponent() { *super*(); addEventListener(FlexEvent.CREATION_COMPLETE,showMenufunction); } *public* *function* showMenufunction(event:Event=*null*):*void* { *if*(myMenu == *null*) { myMenu=Menu.createMenu(*this*, myMenuData,*false*); myMenu.iconField=*@icon*; myMenu.labelField=*@eventName*; myMenu.show(200,200); } } } } - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Sunday, September 14, 2008 1:09:59 AM Subject: RE: [flexcoders] Icons are not displayed in menuItem I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML *From:* [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] *On Behalf Of *Rajan Jain *Sent:* Saturday, September 13, 2008 8:55 PM *To:* [EMAIL PROTECTED] ups.com *Subject:* [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons are not displayed. Any pointers are highly appreciated. Thanks Rajan - - - - - - - - - - - - - - - - Complete Source Code- ?xml version=1.0? !-- Simple example to demonstrate the Menu control. -- mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml mx:Script ![CDATA[ import mx.controls. Menu; import mx.events.MenuEvent ; import mx.controls. Alert; impo! rt flash.geom.Point; [Bindable] [Embed(source=assets/icon_ help.gif)] public var imgdeleteClass: Class; [Bindable] [Embed(source=assets/button_ edit.gif)] public var imgeditClass: Class; private var point1:Point = new Point(); private var myMenu:Menu; // Create and display the Menu control. private
RE: [flexcoders] Icons are not displayed in menuItem
Object is a different code path. In XML, everything is strings and we have to convert them to classes. The key function is probably itemToIcon in ListBase.as From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Haykel BEN JEMIA Sent: Monday, September 15, 2008 2:06 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I think the problem is else where, because when I use an array of objects to define the menu, the icons get displayed. I also displayed both menus at the same time and only the one defined from the array of objects shows the icons, so the icons are definitely in the document. Here is the code I used: public var myMenu2:Menu; public var myMD:Array = [ {label: Edit, eventName: copy, icon: imgeditClass} , {label: Delete, eventName: delete, icon: imgdeleteClass}]; and in showMenufunction() : myMenu2=Menu.createMenu(this, myMD,false); myMenu2.show(400, 200); Haykel On Mon, Sep 15, 2008 at 7:34 AM, Alex Harui [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: I think the icons are not on the document. Try defining TestComponent in mxml and see if that makes a differenc.e From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Rajan Jain Sent: Sunday, September 14, 2008 9:52 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=* local:TestComponent width=100% height=100% /local:TestComponent /mx:Application package { import flash.events.Event; import mx.containers.Panel; import mx.controls.Menu; import mx.events.FlexEvent; public class TestComponent extends Panel { public var myMenu:Menu; [Embed(source=assets/icon_help.gif)] public var imgdeleteClass:Class; [Embed(source=assets/button_edit.gif)] public var imgeditClass:Class; public var myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; public function TestComponent() { super(); addEventListener(FlexEvent.CREATION_COMPLETE,showMenufunction); } public function showMenufunction(event:Event=null):void { if(myMenu == null) { myMenu=Menu.createMenu(this, myMenuData,false); myMenu.iconField=@icon; myMenu.labelField=@eventName; myMenu.show(200,200); } } } } - Original Message From: Alex Harui [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Sent: Sunday, September 14, 2008 1:09:59 AM Subject: RE: [flexcoders] Icons are not displayed in menuItem I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML From: [EMAIL PROTECTED] ups.comhttp://ups.com/ [mailto:flexcoders@mailto:flexcoders@ yahoogroups. com] On Behalf Of Rajan Jain Sent: Saturday, September 13, 2008 8:55 PM To: [EMAIL PROTECTED] ups.comhttp://ups.com Subject: [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons are not displayed. Any pointers are highly appreciated. Thanks Rajan - - - - - - - - - - - - - - - - Complete Source Code- ?xml version=1.0? !-- Simple example to demonstrate the Menu control. -- mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml mx:Script ![CDATA[ import mx.controls. Menu; import mx.events.MenuEvent ; import mx.controls. Alert; impo! rt flash.geom.Point; [Bindable] [Embed(source=assets/icon_ help.gif)] public var imgdeleteClass: Class; [Bindable
Re: [flexcoders] Icons are not displayed in menuItem
I looked into function itemToIcon in ListBase.as if { }(data isXML)try{ { icon = String(data[iconField]); { iconClass = Class(systemManager.getDefinitionByName(icon)); if(iconClass)returniconClass; returndocument[icon];catch(e:Error) In this systemManager points to TestCodeBehind.mxml. If i declare variables in TestCodeBehind.mxml it works. mx:Script![CDATA[ [ [ ]]Embed(source=assets/icon_help..gif)]publicvarimgdeleteClass:Class;Embed(source=assets/button_edit.gif)]publicvarimgeditClass:Class;/mx:Script but i cannot do this as these varibles need to be defined in TestComponent.as but i can change icon attribute in xml. So if reference can be made to TestComponent from systemManager then it will work. Please help me out. Thanks Rajan - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, September 15, 2008 2:06:26 PM Subject: RE: [flexcoders] Icons are not displayed in menuItem Object is a different code path. In XML, everything is strings and we have to convert them to classes.. The key function is probably itemToIcon in ListBase.as From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Haykel BEN JEMIA Sent: Monday, September 15, 2008 2:06 AM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I think the problem is else where, because when I use an array of objects to define the menu, the icons get displayed. I also displayed both menus at the same time and only the one defined from the array of objects shows the icons, so the icons are definitely in the document. Here is the code I used: public var myMenu2:Menu; public var myMD:Array = [ {label: Edit, eventName: copy, icon: imgeditClass} , {label: Delete, eventName: delete, icon: imgdeleteClass} ]; and in showMenufunction( ) : myMenu2=Menu. createMenu( this, myMD,false); myMenu2.show( 400, 200); Haykel On Mon, Sep 15, 2008 at 7:34 AM, Alex Harui [EMAIL PROTECTED] com wrote: I think the icons are not on the document. Try defining TestComponent in mxml and see if that makes a differenc.e From:[EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of Rajan Jain Sent: Sunday, September 14, 2008 9:52 PM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan - - - - - - - - - - - - - - - - ?xml version=1.0 encoding=utf-8? mx:Applicationxmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute xmlns:local=* local:TestComponentwidth=100% height=100% /local:TestComponen t /mx:Application - - - - - - - - - - - - - - - - package { importflash.events. Event; importmx.containers. Panel; importmx.controls. Menu; importmx.events.FlexEvent ; publicclass TestComponent extends Panel { publicvar myMenu:Menu; [Embed(source=assets/icon_ help.gif)] publicvar imgdeleteClass: Class; [Embed(source=assets/button_ edit.gif)] publicvar imgeditClass: Class; publicvar myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; publicfunction TestComponent( ) { super(); addEventListener( FlexEvent. CREATION_ COMPLETE, showMenufunction ); } publicfunction showMenufunction( event:Event=null):void { if(myMenu == null) { myMenu=Menu. createMenu(this, myMenuData,false); myMenu.iconField=@icon; myMenu.labelField=@eventName; myMenu.show( 200,200); } } } } - Original Message From: Alex Harui [EMAIL PROTECTED] com To: [EMAIL PROTECTED] ups.com [EMAIL PROTECTED] ups.com Sent: Sunday, September 14, 2008 1:09:59 AM Subject: RE: [flexcoders] Icons are not displayed in menuItem I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Rajan Jain Sent: Saturday, September 13, 2008 8:55 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons
RE: [flexcoders] Icons are not displayed in menuItem
I'm surprised it picked up the icon in systemManager.getDefinitionByName. It should have picked it up from document[icon], which is what I mentioned several replies ago. If you used TestComponent.mxml instead of TestComponent.as, the document pointer would be correct. You can try setting the menu's document to your TestComponent instance. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rajan Jain Sent: Monday, September 15, 2008 1:49 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I looked into function itemToIcon in ListBase.as if (data is XML) { try { if (data[iconField].length() != 0) { icon = String(data[iconField]); if (icon != null) { iconClass = Class(systemManager.getDefinitionByName(icon)); if (iconClass) return iconClass; return document[icon]; } } } catch(e:Error) { } } In this systemManager points to TestCodeBehind.mxml. If i declare variables in TestCodeBehind.mxml it works. mx:Script ![CDATA[ [Embed(source=assets/icon_help.gif)] public var imgdeleteClass:Class; [Embed(source=assets/button_edit.gif)] public var imgeditClass:Class; ]] /mx:Script but i cannot do this as these varibles need to be defined in TestComponent.as but i can change icon attribute in xml. So if reference can be made to TestComponent from systemManager then it will work. Please help me out. Thanks Rajan - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, September 15, 2008 2:06:26 PM Subject: RE: [flexcoders] Icons are not displayed in menuItem Object is a different code path. In XML, everything is strings and we have to convert them to classes. The key function is probably itemToIcon in ListBase.ashttp://listbase.as/ From: [EMAIL PROTECTED] ups.comhttp://ups.com/ [mailto:flexcoders@ yahoogroups. com] On Behalf Of Haykel BEN JEMIA Sent: Monday, September 15, 2008 2:06 AM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem I think the problem is else where, because when I use an array of objects to define the menu, the icons get displayed. I also displayed both menus at the same time and only the one defined from the array of objects shows the icons, so the icons are definitely in the document. Here is the code I used: public var myMenu2:Menu; public var myMD:Array = [ {label: Edit, eventName: copy, icon: imgeditClass} , {label: Delete, eventName: delete, icon: imgdeleteClass} ]; and in showMenufunction( ) : myMenu2=Menu. createMenu( this, myMD,false); myMenu2.show( 400, 200); Haykel On Mon, Sep 15, 2008 at 7:34 AM, Alex Harui [EMAIL PROTECTED] commailto:[EMAIL PROTECTED] wrote: I think the icons are not on the document. Try defining TestComponent in mxml and see if that makes a differenc.e From: [EMAIL PROTECTED] ups.commailto:flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] ups.commailto:flexcoders@yahoogroups.com] On Behalf Of Rajan Jain Sent: Sunday, September 14, 2008 9:52 PM To: [EMAIL PROTECTED] ups.commailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Icons are not displayed in menuItem Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan - - - - - - - - - - - - - - - - ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute xmlns:local=* local:TestComponent width=100% height=100% /local:TestComponen t /mx:Application - - - - - - - - - - - - - - - - package { import flash.events. Event; import mx.containers. Panel; import mx.controls. Menu; import mx.events.FlexEvent ; public class TestComponent extends Panel { public var myMenu:Menu; [Embed(source=assets/icon_ help.gif)] public var imgdeleteClass: Class; [Embed(source=assets/button_ edit.gif)] public var imgeditClass: Class; public var myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; public function TestComponent( ) { super(); addEventListener( FlexEvent. CREATION_ COMPLETE, showMenufunction ); } public function showMenufunction( event:Event=null):void { if(myMenu == null) { myMenu=Menu. createMenu(this, myMenuData,false); myMenu.iconField=@icon; myMenu.labelField=@eventName; myMenu.show( 200,200
Re: [flexcoders] Icons are not displayed in menuItem
Hi All I am made custom component(TestComponent) which extends Panel and shown menu at start up. Code is very very simple but i do not know why the menu icons are not displayed. Any pointers are highly appreciated. See the code below and i have also attached code files as attachement. Thanks Rajan ?xml version=1.0 encoding=utf-8?mx:Applicationxmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=*local:TestComponentwidth=100% height=100%/mx:Application/local:TestComponent package{ { [ [ menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; { addEventListener(FlexEvent.CREATION_COMPLETE,showMenufunction); }importflash.events.Event;importmx.containers.Panel;importmx.controls.Menu;importmx.events.FlexEvent;publicclassTestComponent extendsPanelpublicvarmyMenu:Menu;Embed(source=assets/icon_help.gif)]publicvarimgdeleteClass:Class;Embed(source=assets/button_edit.gif)]publicvarimgeditClass:Class;publicvarmyMenuData:XML=menupublicfunctionTestComponent() super();publicfunctionshowMenufunction(event:Event=null):void{ { myMenu=Menu..createMenu( myMenu.iconField= myMenu.labelField= myMenu.show(200,200); } } } }if(myMenu == null)this, myMenuData,false);@icon;@eventName; - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Sunday, September 14, 2008 1:09:59 AM Subject: RE: [flexcoders] Icons are not displayed in menuItem I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Rajan Jain Sent: Saturday, September 13, 2008 8:55 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons are not displayed. Any pointers are highly appreciated. Thanks Rajan - - - - - - - - - - - - - - - - Complete Source Code- ?xml version=1..0? !-- Simple example to demonstrate the Menu control. -- mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml mx:Script ![CDATA[ import mx.controls. Menu; import mx.events.MenuEvent ; import mx.controls. Alert; impo! rt flash.geom.Point; [Bindable] [Embed(source=assets/icon_ help.gif)] public var imgdeleteClass: Class; [Bindable] [Embed(source=assets/button_ edit.gif)] public var imgeditClass: Class; private var point1:Point = new Point(); private var myMenu:Menu; // Create and display the Menu control. private function showMenu():void { myMenu= Menu.createMenu( panel, myMenuData, false); myMenu.labelField=@label myMenu.iconField=@icon; myMenu.addEventList ener(itemClick, menuHandler) ; // Calculate position of Menu in Application' s coordinates. point1.x=mybutton. x; point1.y=mybutton. y; point1=mybutton. localToGlobal( point1); myMenu.show( point1.x + 25, point1.y + 25); } // Event handler for the Menu control's change event. private function menuHandler( event:MenuEvent) :void { Alert.show(Label: + event.item.@ label, Clicked menu item); } ]] /mx:Script mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon={imgdeleteClass}/ menuitem label=MenuItem 2 eventName=paste icon={imgeditClass}/ /root /mx:XML mx:Panel id=panel title=Menu Control Example height=75% width=75% paddingTop=10 paddingLeft=10 mx:Label width=100% color=blue text=Click the button to open the Menu control./ mx:Button id=mybutton label=Open Menu click=showMenu
RE: [flexcoders] Icons are not displayed in menuItem
Check out just a handful of the key features that make Forex Auto Pilot - the world's number 1 Work At Home opportunity online... Automated Forex Robots that analyze the market - giving you an 'unfair advantage' by placing the odds in your favor. After all, there's no fun in gambling if you can't win. Remember 'trend is your friend' - Forex Auto Pilot knows EXACTLY when to trade in order to maximize your profits. If you don't feel completely secure about 'live' trading, simply shape and sharpen your skills on our demo account. Forex Auto Pilot looks at the bigger picture and so helps clearly define the trend. Hidden trends are now a thing of the past! State-of-the-art money management programming that allows the individual trader to turn a profit even under unfavorable conditions on the market. The system never gets angry or greedy allowing trader investment to operate at 100% efficiency. Let your profits run! FAPS allows your position to be open for as long as the market wishes to reward you. Keep it simple stupid and that's exactly what our automatic cash formula does! A simple and effective method of trading Forex maintains profits over HUGE amounts of time. Monitoring high amounts of trades duringon package { import flash.events.Event; import mx.containers.Panel; import mx.controls.Menu; import mx.events.FlexEvent; public class TestComponent extends Panel { public var myMenu:Menu; [Embed(source=assets/icon_help.gif)] public var imgdeleteClass:Class; [Embed(source=assets/button_edit.gif)] public var imgeditClass:Class; public var myMenuData:XML=menu menuitem label=Edit eventName=copy icon=imgdeleteClass / menuitem label=Delete eventName=paste icon=imgdeleteClass/ /menu; public function TestComponent() { super(); addEventListener(FlexEvent.CREATION_COMPLETE,showMenufunction); } public function showMenufunction(event:Event=null):void { if(myMenu == null) { myMenu=Menu.createMenu(this, myMenuData,false); myMenu.iconField=@icon; myMenu.labelField=@eventName; myMenu.show(200,200); } } } } - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Sunday, September 14, 2008 1:09:59 AM Subject: RE: [flexcoders] Icons are not displayed in menuItem I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML From: [EMAIL PROTECTED] ups.comhttp://ups.com/ [mailto:flexcoders@ yahoogroups. com] On Behalf Of Rajan Jain Sent: Saturday, September 13, 2008 8:55 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons are not displayed. Any pointers are highly appreciated. Thanks Rajan - - - - - - - - - - - - - - - - Complete Source Code- ?xml version=1.0? !-- Simple example to demonstrate the Menu control. -- mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml mx:Script ![CDATA[ import mx.controls. Menu; import mx.events.MenuEvent ; import mx.controls. Alert; impo! rt flash.geom.Point; [Bindable] [Embed(source=assets/icon_ help.gif)] public var imgdeleteClass: Class; [Bindable] [Embed(source=assets/button_ edit.gif)] public var imgeditClass: Class; private var point1:Point = new Point(); private var myMenu:Menu; // Create and display the Menu control. private function showMenu():void { myMenu= Menu.createMenu( panel, myMenuData, false); myMenu.labelField=@label myMenu.iconField=@icon; myMenu.addEventList ener(itemClick, menuHandler) ; // Calculate position of Menu in Application' s coordinates. point1.x=mybutton. x; point1.y=mybutton. y; point1=mybutton. localToGlobal( point1); myMenu.show( point1.x + 25, point1.y + 25); } // Event handler for the Menu control's change event. private function menuHandler( event:MenuEvent) :void { Alert.show(Label: + event.item.@ label, Clicked menu item); } ]] /mx:Script mx:XML id=myMenuData root menuitem label=MenuItem 1
RE: [flexcoders] Icons are not displayed in menuItem
I think it should just be ( no curlys ): mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon=imgdeleteClass/ menuitem label=MenuItem 2 eventName=paste icon=imgeditClass/ /root /mx:XML From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rajan Jain Sent: Saturday, September 13, 2008 8:55 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons are not displayed in menuItem Hi All I am trying to display icon in the menu. I am using example from livedocs language reference. I have added icon attribute to dataprovider myMenu.iconField=@icon but icons are not displayed. Any pointers are highly appreciated. Thanks Rajan Complete Source Code- ?xml version=1.0? !-- Simple example to demonstrate the Menu control. -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;http://www.adobe.com/2006/mxml mx:Script ![CDATA[ import mx.controls.Menu; import mx.events.MenuEvent; import mx.controls.Alert; impo! rt flash.geom.Point; [Bindable] [Embed(source=assets/icon_help.gif)] public var imgdeleteClass:Class; [Bindable] [Embed(source=assets/button_edit.gif)] public var imgeditClass:Class; private var point1:Point = new Point(); private var myMenu:Menu; // Create and display the Menu control. private function showMenu():void { myMenu= Menu.createMenu(panel, myMenuData, false); myMenu.labelField=@label myMenu.iconField=@icon; myMenu.addEventListener(itemClick, menuHandler); // Calculate position of Menu in Application's coordinates. point1.x=mybutton.x; point1.y=mybutton.y; point1=mybutton.localToGlobal(point1); myMenu.show(point1.x + 25, point1.y + 25); } // Event handler for the Menu control's change event. private function menuHandler(event:MenuEvent):void { Alert.show(Label: + [EMAIL PROTECTED], Clicked menu item); } ]] /mx:Script mx:XML id=myMenuData root menuitem label=MenuItem 1 eventName=copy icon={imgdeleteClass}/ menuitem label=MenuItem 2 eventName=paste icon={imgeditClass}/ /root /mx:XML mx:Panel id=panel title=Menu Control Example height=75% width=75% paddingTop=10 paddingLeft=10 mx:Label width=100% color=blue text=Click the button to open the Menu control./ mx:Button id=mybutton label=Open Menu click=showMenu();/ /mx:Panel /mx:Application
Re: [flexcoders] icons
http://www.iconbase.com/ There are many others... you can purchase icon libraries from places like this. -Steve Kevin wrote: Where do people go to get small icons for use in Flex apps? I need the little things like arrows check marks. For example I would like to display a check mark when an address has been validated. Is there a library of these little symbols somewhere? OR does everyone just design their own. Thanks, Kevin No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM
Re: [flexcoders] icons
http://famfamfam.com/ On 24 Mar 2007 13:54:27 -0700, Steve Hagenlock [EMAIL PROTECTED] wrote: http://www.iconbase.com/ There are many others... you can purchase icon libraries from places like this. -Steve Kevin wrote: Where do people go to get small icons for use in Flex apps? I need the little things like arrows check marks. For example I would like to display a check mark when an address has been validated. Is there a library of these little symbols somewhere? OR does everyone just design their own. Thanks, Kevin -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM
RE: [flexcoders] Icons disappear from Menu at Compile Time
It's not a bug. It has to do with variable scoping. I'll assume you have data like { label: foo, icon : myTopIcon } The icon property is a string, not a class. The menu renderer wants a class. You could set up your data like: { label: foo, icon: myTopIcon } Then icon is a class, but that's almost impossible to do when data is coming from a server. So, as a convenience, the menu renderer says that if it gets a String value as the icon, it will assume it is the name of a variable in the current document that holds a class. Every MXML file is a document and variables are scoped within. Popups assume the scope of the application document. So the menu renderer is looking for a variable called myTopIcon in the application's MXML file and you moved it elsewhere. I think the solution will be to set the Menu's document property after it is put on the displaylist and before it creates renderers (or force it to re-create renderers). I'd start with MENU_SHOW event. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of missgiggygirl Sent: Thursday, March 22, 2007 9:30 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons disappear from Menu at Compile Time When I use the same code for making a menu is the main app, it works, when I move it into its own component and call it from the main app, the icons disappear. And no, it is not a path problem, the code compiles fine with no warnings. Here are more details: I am using a menu that has labels and icons. The icons are attached using snips like this, in an actionscript fragment: [Bindable] [Embed(source=icon_revised.gif)] public var myTopIcon:Class; As I said, it works fine until I move it into a component, and then it runs but with missing icons. I did a search and did find this issue, but did not see any solution. I am guessing it is a bug, but hope to find a workaround. Thanks, Ann
RE: [flexcoders] Icons on TabBar or ToggleButton Bar
You should use the icon property of the containers in your ViewStack (in your example, Canvas). That should do the trick. If you wanted, you can also set the iconField property of your ToggleButtonBar or TabBar to use a custom property value (instead of icon). Phil -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Behalf Of forrestmaready Sent: Monday, March 19, 2007 8:58 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons on TabBar or ToggleButton Bar Could someone let me know how they've succesfully populated the tabs on a TabBar or the buttons on a ToggleButtonBar with icons? I've tried putting the styleName tag on everything to no avail. Thanks! ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=horizontal width=470 height=100 horizontalAlign=center verticalAlign=middle mx:Style .myIcon { upSkin: Embed(assets/upIcon.jpg); overSkin: Embed(assets/overIcon.jpg); downSkin: Embed(assets/downIcon.jpg); } /mx:Style mx:ToggleButtonBar dataProvider=viewstack1 width=223 height=44/ mx:ViewStack id=viewstack1 width=18 height=24 selectedIndex=1 styleName=myIcon mx:Canvas label=Fred width=100% height=100% /mx:Canvas mx:Canvas label=Fred1 width=100% height=100% /mx:Canvas mx:Canvas label=Fred2 width=100% height=100% /mx:Canvas /mx:ViewStack /mx:Application
RE: [flexcoders] Icons formerly included in Flex SDK (Beta)
I think the icons were only in 1.5, Im not sure of any icons we included in Flex 2 unless it was by mistake. If you have the icons you are probably welcome to use them though, I dont remember there being restrictions. Matt From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of dougmccune Sent: Friday, October 06, 2006 11:16 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons formerly included in Flex SDK (Beta) An older version of the Flex SDK had a folder called Icons that contained a series of various UI icons. I think I read in some readme that the idea was to provide some basic GUI elements to help standardize the look and feel of Flex apps. So a few questions for someone from Adobe: 1. I have the icons from the beta install, can I still use them? 2. Is an icon set going to be included in future versions of the SDK? 3. Why was the icon set removed? __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] Icons in menu - not working
Can someone please send me this same file as an example? Thanks! - Doug On 6/28/06, Kelly Birr [EMAIL PROTECTED] wrote: Thank you, that is the solution I cam up with also. It's nice to know that this is not the intended behavior, and that hopefully some day I can go back to static embedded images. I use them very successfully for button icons. - Kelly From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Deepa SubramaniamSent: Wednesday, June 28, 2006 4:46 PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Icons in menu - not working Hmmm – well our Embed expert says that you can make the variable for the embedded asset static, but that seems to be your problem. I'll file a bug on your behalf, but for now, don't make exitOn static and the icon should show up. Let me know if it doesn't – Deepa Flex SDK From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Kelly BirrSent: Wednesday, June 28, 2006 4:26 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Icons in menu - not working I've been racking my brain trying to get icons in themenu bar. I think I'm doing exactly what the docs say but I cannot get any icon to render. Thelabel and actions work perfectly but the icondoes not show up. The icon is embedding properly as I can see it in the icon property of a button in the same file. I've also tried putting the path to the icon file in the xml, no joy. My Menu XML Is: menu menuitem label=File menuitem label=Open data="" / menuitem type=separator / menuitem label=Exit data="" icon=exitOn / /menuitem /menu MyMXML is: mx:Script ![CDATA[[Embed(source=images/icons/iconExitOn.gif)] public static const exitOn:Class; ]]/mx:Script mx:MenuBar id=menu width=100% x=0 y=0 height=27 dataProvider={menuXml} showRoot=false cornerRadius=3 itemClick=menuHandler(event) labelField=@label iconField=@icon / I cannot find any samples anywhere with icons in the menu, Is this still supported? Can anyone tell me what i'm doing wrong? I am using Flex 2.0 RTM - Kelly __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] Icons in Datagrid
On Wednesday 19 July 2006 23:37, Josh Johnson wrote: In re-creating the application, one of the issues I'm stumped on is how to get icons in a data grid cell. Ideally, I want to key off an You'll need to create what is known as an itemRenderer: http://livedocs.macromedia.com/flex/2/docs/0840.html -- Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. Yahoo! Groups Sponsor ~-- Great things are happening at Yahoo! Groups. See the new email design. http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/nhFolB/TM ~- -- 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/
RE: [flexcoders] Icons in menu - not working
Hmmm well our Embed expert says that you can make the variable for the embedded asset static, but that seems to be your problem. Ill file a bug on your behalf, but for now, dont make exitOn static and the icon should show up. Let me know if it doesnt Deepa Flex SDK From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr Sent: Wednesday, June 28, 2006 4:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons in menu - not working I've been racking my brain trying to get icons in themenu bar. I think I'm doing exactly what the docs say but I cannot get any icon to render. Thelabel and actions work perfectly but the icondoes not show up. The icon is embedding properly as I can see it in the icon property of a button in the same file. I've also tried putting the path to the icon file in the xml, no joy. My Menu XML Is: menu menuitem label=File menuitem label=Open data="" / menuitem type=separator / menuitem label=Exit data="" icon=exitOn / /menuitem /menu MyMXML is: mx:Script ![CDATA[ [Embed(source=images/icons/iconExitOn.gif)] public static const exitOn:Class; ]] /mx:Script mx:MenuBar id=menu width=100% x=0 y=0 height=27 dataProvider={menuXml} showRoot=false cornerRadius=3 itemClick=menuHandler(event) labelField=@label iconField=@icon / I cannot find any samples anywhere with icons in the menu, Is this still supported? Can anyone tell me what i'm doing wrong? I am using Flex 2.0 RTM - Kelly __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Icons in menu - not working
I found my problem. It appears that the menu cannot bind to static vars for images. I solved the problem by specifying { public const myMenuIcon:Class = GlobalIcons.MyCoolIcon; } where GlobalIcons.MyCoolIcon is declared exactly as below. Then pout the local name "myMenuIcon" in the @icon field of the xml. - Kelly From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly BirrSent: Wednesday, June 28, 2006 4:26 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Icons in menu - not working I've been racking my brain trying to get icons in themenu bar. I think I'm doing exactly what the docs say but I cannot get any icon to render. Thelabel and actions work perfectly but the icondoes not show up. The icon is embedding properly as I can see it in the "icon" property of a button in the same file. I've also tried putting the path to the icon file in the xml, no joy. My Menu XML Is: menu menuitem label="File" menuitem label="Open" data="" / menuitem type="separator" / menuitem label="Exit" data="" icon="exitOn" / /menuitem /menu MyMXML is: mx:Script ![CDATA[[Embed(source="images/icons/iconExitOn.gif")] public static const exitOn:Class; ]]/mx:Script mx:MenuBar id="menu" width="100%" x="0" y="0" height="27" dataProvider="{menuXml}" showRoot="false"cornerRadius="3" itemClick="menuHandler(event)" labelField="@label" iconField="@icon" / I cannot find any samples anywhere with icons in the menu, Is this still supported? Can anyone tell me what i'm doing wrong? I am using Flex 2.0 RTM - Kelly __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Icons in menu - not working
Yup, you are correct. I just talked to Roger about this. What is happening is that MenuBar checks to see if an iconField is set. In your case it is, and the MenuBar looks to see if a Class, exitOn, exists with that name in the application or a property on the document with that same name exists. It does, however you cannot access a static var off an instance, only off the class. So, the lookup in the MenuBar code fails. Your workaround of making the embedded asset var non-staic is correct. HTH, deepa From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr Sent: Wednesday, June 28, 2006 4:48 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Icons in menu - not working I found my problem. It appears that the menu cannot bind to static vars for images. I solved the problem by specifying { public const myMenuIcon:Class = GlobalIcons.MyCoolIcon; } where GlobalIcons.MyCoolIcon is declared exactly as below. Then pout the local name myMenuIcon in the @icon field of the xml. - Kelly From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr Sent: Wednesday, June 28, 2006 4:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons in menu - not working I've been racking my brain trying to get icons in themenu bar. I think I'm doing exactly what the docs say but I cannot get any icon to render. Thelabel and actions work perfectly but the icondoes not show up. The icon is embedding properly as I can see it in the icon property of a button in the same file. I've also tried putting the path to the icon file in the xml, no joy. My Menu XML Is: menu menuitem label=File menuitem label=Open data="" / menuitem type=separator / menuitem label=Exit data="" icon=exitOn / /menuitem /menu MyMXML is: mx:Script ![CDATA[ [Embed(source=images/icons/iconExitOn.gif)] public static const exitOn:Class; ]] /mx:Script mx:MenuBar id=menu width=100% x=0 y=0 height=27 dataProvider={menuXml} showRoot=false cornerRadius=3 itemClick=menuHandler(event) labelField=@label iconField=@icon / I cannot find any samples anywhere with icons in the menu, Is this still supported? Can anyone tell me what i'm doing wrong? I am using Flex 2.0 RTM - Kelly __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Icons in menu - not working
Just to be clear, this is not a bug. This is just a fact of life since were using some sort of indirection of specifying an icon attribute in the dataProvider and then using an iconField property to look up that reference. So, in cases like that the embedded asset needs to not be a static variable. Other cases without this indirection, like a Button icon, will work correctly. -deepa From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Deepa Subramaniam Sent: Wednesday, June 28, 2006 4:59 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Icons in menu - not working Yup, you are correct. I just talked to Roger about this. What is happening is that MenuBar checks to see if an iconField is set. In your case it is, and the MenuBar looks to see if a Class, exitOn, exists with that name in the application or a property on the document with that same name exists. It does, however you cannot access a static var off an instance, only off the class. So, the lookup in the MenuBar code fails. Your workaround of making the embedded asset var non-staic is correct. HTH, deepa From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr Sent: Wednesday, June 28, 2006 4:48 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Icons in menu - not working I found my problem. It appears that the menu cannot bind to static vars for images. I solved the problem by specifying { public const myMenuIcon:Class = GlobalIcons.MyCoolIcon; } where GlobalIcons.MyCoolIcon is declared exactly as below. Then pout the local name myMenuIcon in the @icon field of the xml. - Kelly From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr Sent: Wednesday, June 28, 2006 4:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Icons in menu - not working I've been racking my brain trying to get icons in themenu bar. I think I'm doing exactly what the docs say but I cannot get any icon to render. Thelabel and actions work perfectly but the icondoes not show up. The icon is embedding properly as I can see it in the icon property of a button in the same file. I've also tried putting the path to the icon file in the xml, no joy. My Menu XML Is: menu menuitem label=File menuitem label=Open data="" / menuitem type=separator / menuitem label=Exit data="" icon=exitOn / /menuitem /menu MyMXML is: mx:Script ![CDATA[ [Embed(source=images/icons/iconExitOn.gif)] public static const exitOn:Class; ]] /mx:Script mx:MenuBar id=menu width=100% x=0 y=0 height=27 dataProvider={menuXml} showRoot=false cornerRadius=3 itemClick=menuHandler(event) labelField=@label iconField=@icon / I cannot find any samples anywhere with icons in the menu, Is this still supported? Can anyone tell me what i'm doing wrong? I am using Flex 2.0 RTM - Kelly __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] Icons Buttons
Hi, You just need to create a Skin class that has no graphics for the upSkin style. Set labelPlacement to 'bottom' Adjust padding and you are set. See the docs Skinning programatically section for more info on how to create the ButtonSkin class. Peace, MikeOn 5/12/06, s_hernandez01 [EMAIL PROTECTED] wrote: Would anybody know how to create an icon button in Flex simiilar to the way MSN Messenger created theirs? Where the icon is above the text label and blended in to the background, but has a rollover effect that shows the border of the button. Here's an example: http://join.msn.com/messenger/features Thanks Sal -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- What goes up, does come down. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Icons Buttons
Not to mention, This is a perfect example of where an MXML component is perfect. Peace, MikeOn 5/12/06, Michael Schmalle [EMAIL PROTECTED] wrote: Hi, You just need to create a Skin class that has no graphics for the upSkin style. Set labelPlacement to 'bottom' Adjust padding and you are set. See the docs Skinning programatically section for more info on how to create the ButtonSkin class. Peace, MikeOn 5/12/06, s_hernandez01 [EMAIL PROTECTED] wrote: Would anybody know how to create an icon button in Flex simiilar to the way MSN Messenger created theirs? Where the icon is above the text label and blended in to the background, but has a rollover effect that shows the border of the button. Here's an example: http://join.msn.com/messenger/features Thanks Sal -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- What goes up, does come down. -- What goes up, does come down. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.