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?
精彩评论