I am trying to do the same thing.

I have this xml for example:
<item icon="myIcon.gif"/>

for every <item> I will add a TitleWindow to the Application, and I
need to set the titleIcon property. I tried it this way:

 var iconSource:String = 'url("' + [EMAIL PROTECTED] + '")';
 myTitleWindow.setStyle("titleIcon", iconSource);

even if I try to set it manually :
 myTitleWindow.setStyle("titleIcon", 'url("myIcon.gif")' );
it doesn't work..

What's the problem? and more important how can I solve it? (is it
because myIcon.gif is not loaded when I set the style?

thank you

--- In [email protected], "genius_gen2k"
<[EMAIL PROTECTED]> wrote:
>
> 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], "genius_gen2k"
> <genius_gen2k@> wrote:
> >
> > How do we dynamically use an image as icon for Canvas component,
> > writing the code in the .as file. 
> > 
> > Amol.
> >
>


Reply via email to