PDA

View Full Version : Communicating with a loaded SWF



nemoBejingler
July 28th, 2007, 11:07 PM
I'm trying to load a SWF and then tell it to play. I can't seem to communicate with the loaded SWF to tell it to play. I'm probably not referencing it correctly. Any help is appreciated. Thx


import flash.display.*;
import flash.net.*;
import flash.events.*;

var myLoader:Loader = new Loader();
var myRequest:URLRequest = new URLRequest("home.swf");

myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, loadComplete);

function loadComplete(event:Event):void {
addChild(myLoader);
myLoader.content.gotoAndPlay(2);
}

myLoader.load(myRequest);

fluid_tw0
July 29th, 2007, 04:20 AM
try

function loadComplete(event:Event):void {
var _mc = addChild(myLoader);
_mc.content.gotoAndPlay(2);
}
or

function loadComplete(event:Event):void {
addChild(myLoader);
MovieClip(myLoader.content).gotoAndPlay(2);
}