Found it. Needs to be:

 

[Embed(source="images/pic2.gif")]

var _img:String;

this.imgPic1.source = _img;

 

 

 

Ralf Rottmann | Director Sales & Marketing | VoicInt Telecommunications GmbH
m:+49-(0)170-914-5495 | f: +49-(0)231-557402-99 | e:
[EMAIL PROTECTED]
-------------------------------------------------------------------------------------------------------


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ralf Rottmann
Sent: Freitag, 9. Dezember 2005 18:47
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Change an image dynamically

 

I have included an image control in my app:

 

<mx:Image id=”imgPic1” source=”@Embed(“images/pic1.gif”)” />

 

Next I am trying to programmatically change the image (in an event handler):

 

[Embed(source="images/pic2.gif")]

var _img:String;

this.imgPic1 = _img as Image;

 

 

However, nothing happens. Any idea?




--
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




Reply via email to