FLASH中用loadMovie()函数载入图片,如何获取图片的真是尺寸呢(长、宽等~)?
这个就是用来检测并获取属性的代码噢~
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip, status:Number):Void {
// if this event is fired (onLoadInit) it means the clip has 100% loaded
trace(“Clip loaded, image dimentions: ” + target_mc._width + ” x ” + target_mc._height);
}
// start the loadClip process
mcLoader.loadClip(“test.png”, _root.ContainerMovieclip);
