I have the follow declaration :
[Embed(source="i/6.png")]
private var img6 : Class;
- How开发者_如何学Go can i determine "img6" width and height ?
You can determine size of embed image only on instantiation. Something like:
<s:BitmapImage source="{img6}" complete="completeHandler(event)" />
…
private function completeHandler(event:Event):void
{
var image:BitmapImage = BitmapImage(event.currentTarget);
trace (image.sourceWidth);
trace (image.sourceHeight);
}
精彩评论