The same way you add a Canvas, you should be able to add an Image to the Canvas.
Assuming you have a canvas "c": var i:Image = new Image(); i.source = <whatever your XML says is the path to the image> c.addChild(i). ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of genius_gen2k Sent: Monday, December 04, 2006 10:27 PM To: [email protected] Subject: [flexcomponents] Re: Embedding an icon... Hello people, I am coding in an .as file and during the runtime I am adding a Canvas on the stage. In this way I am adding many canvas depending on the data from the XML file. Each Canvas created on the runtime needs to have a icon on it i.e. an image icon. All these canvas created on runtime needs to be arranged with respect to the height / width of the previous created canvas element. In this scenario, i wanted to know as to how do I add icon to a canvas, the data/path for which comes from an external XML file. Amol. 55--- In [email protected] <mailto:flexcomponents%40yahoogroups.com> , "genius_gen2k" <[EMAIL PROTECTED]> wrote: > > How do we dynamically use an image as icon for Canvas component, > writing the code in the .as file. > > Amol. >
