0
votes

Attempting to load up an swf inside my file and I'm getting the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@32264f91 to flash.display.Loader.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at ComicBook_003_fla::MainTimeline()

Here is my code:

var loader:Loader = new Loader();
loader.load(new URLRequest("Avoider.swf"));

loader.x = 100;
loader.y = 100;

addChild(loader);
2
Is this inside a swf that is already being loaded into another swf? Do you have your own Class named Loader that could possibly be colliding? - Amy Blankenship
Yes, and I did, but I changed it all - cameronjonesweb
Ok, I must have missed something because I decided to change the loader I provided and it worked - cameronjonesweb

2 Answers

0
votes

It seems you have an error in Avoider.swf and not in your current code. You seem to be using loader functions on a movieclip.

0
votes

You're trying to use addChild method passing Loader as argument. Try to use loader's "content" property (whic is DisplayObject). Also, wait until loading is finished before doing any actions with your content.