开发者

bitmap data as movie clip

开发者 https://www.devze.com 2022-12-26 23:05 出处:网络
I import my images with imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(imageRequest);

I import my images with

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

and then try and cast as a moviecl开发者_如何学Pythonip:

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

i keep getting errors, is this possible?

Thanks,

Ross


Don't cast it as a MovieClip. Just add the loader to the stage, like this:

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号