I am trying to import a SWF file into a custom loader and then treat the loaded SWF file as a MovieClip object. The code for the functionality can be seen below.
public function loadMyMovie(movie:String)
{
var now:Date = new Date();
var rnd:String = "?randomize=" + now.time;
var request:URLRequest = new URLRequest(movie);
request.data = getObjectURLVariables(this.loaderInfo.parameters)
var loading:Loader = new Loader();
loading.load(request);
loading.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadComplete(event:Event):void {
var movie:MovieClip = addChild(loading.content);
movie.gotoAndStop(0);
}
}
When I do this I get the following error.
"Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip."