Skip to main content
June 7, 2012
Answered

Load external swf and stop at 1st frame.

  • June 7, 2012
  • 1 reply
  • 468 views

Hello Everyone

I am using following code to display an external swf file on iPad.

var request:URLRequest = new URLRequest("http://<server ip>/test.swf");

loader = new Loader();

loader.load(request);

The file loads and goes through every frame and closes the app.

Is there a way to stop at 1st frame after the file is loaded and move between frames at will?

Thanks

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Colin Holgate

If you listen for when the loader is complete you can stop the swf:

var mc:MovieClip;

loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfloaded);

function swfloaded(e:Event){

mc = e.target.content as MovieClip;

mc.stop();

}

Now you can do what you like to that movie clip. Like:

mc.gotoAndStop("some label");

or:

mc.gotoAndStop(10);

1 reply

Colin Holgate
Colin HolgateCorrect answer
Inspiring
June 7, 2012

If you listen for when the loader is complete you can stop the swf:

var mc:MovieClip;

loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfloaded);

function swfloaded(e:Event){

mc = e.target.content as MovieClip;

mc.stop();

}

Now you can do what you like to that movie clip. Like:

mc.gotoAndStop("some label");

or:

mc.gotoAndStop(10);