flex embed dynamic source
the EMBED tag is for compile time only... not runtime loading....
It will assign the source to the class and
it can't be changed later.
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;
}

浙公网安备 33010602011771号