我导入我的图像
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(imageRequest);
然后尝试将其投射为影片剪辑:
var newImage:MovieClip = imageLoader.content as MovieClip; addChild(newImage);
我不断收到错误,这可能吗?
谢谢,
罗斯
我导入我的图像
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(imageRequest);
然后尝试将其投射为影片剪辑:
var newImage:MovieClip = imageLoader.content as MovieClip; addChild(newImage);
我不断收到错误,这可能吗?
谢谢,
罗斯
不要将其投射为影片剪辑。只需将加载器添加到舞台,如下所示:
addChild(imageLoader);
you can only do that when the loader has completed loading.
so if that bit of code is in the onComplete function, and you're doing var newImage:MovieClip = e.content as MovieClip;
, that should work.
What specific errors are you getting?