I am trying to use the Loader class to load an swf animation. If I do addChild(ldr); the animation is displayed and perma-looped, but if I try it as below, the animation doesn't display.
public var ldr:Loader;
public var explosion:MovieClip;
public var req:URLRequest;
ldr = new Loader();
req = new URLRequest("../graphics/explosion1.swf");
ldr.load(req);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
and
public function onCompleteHandler(loadEvent:Event):void {
explosion = ldr.content as MovieClip; addChild(explosion); }
Any ideas? Thanks!