Dirk- That worked fabulously. Thanks. --- In [email protected], "Dirk Eismann" <[EMAIL PROTECTED]> wrote: > > Another option would be to write a custom ItemRenderer for the List and > dynamically load the icon from within the ItemRenderer. E.g. the > ItemRenderer could be a simple HBox subclass: > > <!-- IconRenderer.mxml --> > <mx:HBox> > <mx:Image source="{data.icon}"/> > <mx:Label text="{data.label}"/> > </mx:HBox> > > If you set the itemRenderer property of the List to IconRenderer then it > should display the items and load the image (the above example assumes > that every item in the List's dataProvider has an icon property and a > label property) > > Dirk. > > > > ________________________________ > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Frias, Roberto > Sent: Friday, September 01, 2006 10:13 AM > To: [email protected] > Subject: AW: [flexcoders] How to load an Image dynamically as > for icon (of type Class)?? > > > > Yes indeed, the only way to use this iconField is embeding an > Image. There is a workaround using a normal image component and loading > dynamically, but you will have to build your own popup window in some > cases ( try setting the image component with a negative y ), otherwise > its not to hard thought, you just have to start from a Canvas and design > the layout of your popup. > > > > Best Regards > > > > Roberto Frias > > > > > ________________________________ > > > Von: [email protected] > [mailto:[EMAIL PROTECTED] Im Auftrag von e_baggg > Gesendet: Donnerstag, 31. August 2006 22:53 > An: [email protected] > Betreff: [flexcoders] How to load an Image dynamically as for > icon (of type Class)?? > > > > I have an application that has a popup window that users will > popup > very rarely. This popup window has a <mx:List> with a dozen > different > icons for each row in the List. > > For this reason I do not want to embed the images, but rather, > load > them at runtime when the wndow is popped. > > I am having trouble displaying the icons because the iconField > and > funtions require an Object of type "Class". Using the Loader() > class, > a DisplayObject is returned: > > var pictLdr:Loader = new Loader(); > var pictURL:String = "banana.jpg" > var pictURLReq:URLRequest = new URLRequest(pictURL); > pictLdr.load(pictURLReq); > this.addChild(pictLdr); > > How do I load a image dynamically and assign it to an icon? > > Thanks. >
-- 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/

