In order to change the image source dynamically instead of creating multiple image instances, we could make use of [Embed] tag as follows:
[Embed(source="a.png")]
private var _src_a:Class;
[Embed(source="b.png")]
private var _src_b:Class;
_img = new Image ();
if ( ... ) {
_img.source = _src_a;
} else {
_img.source = _src_b;
}
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000968.html
Sunday, August 24, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment