0

我导入我的图像

imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(imageRequest);

然后尝试将其投射为影片剪辑:

var newImage:MovieClip = imageLoader.content as MovieClip; addChild(newImage);

我不断收到错误,这可能吗?

谢谢,

罗斯

4

2 回答 2

1

不要将其投射为影片剪辑。只需将加载器添加到舞台,如下所示:

addChild(imageLoader);
于 2010-04-13T17:40:53.273 回答
0

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?

于 2010-04-13T19:34:37.320 回答