Skip to main content
lauraa51823306
Participant
November 16, 2015
Answered

FLASH AS2 Controlling main swf plaback from loaded swf

  • November 16, 2015
  • 1 reply
  • 842 views

Hello,

I have two swf files. The main swf (main.swf) that loads another swf (external.swf).

Current code in my main swf that loads the external swf is:

stop();

this.createEmptyMovieClip ("holder", 1);

holder.loadMovie ("content/swf/M01/disclaimer.swf");

Then the loaded swf should unload on a click event and the main swf movie should resume play.

The code in that swf file is:

on (release) {

_level0.gotoAndPlay("hideMSG");

_parent.unloadMovie("content/swf/M01/disclaimer.swf",1);

}

The external swf loads and unloads perfectly, but the main movie does not seem to resume.

When I try to use _level0.play, it seems to reload and restart the main.swf file.

Any help would be greatly appreciated.

Laura

This topic has been closed for replies.
Correct answer lauraa51823306

No, there is no stop in that frame, there's actually a play(); which is exactly what I want.

I managed to get it working using variables instead.

Thanks,

Laura

1 reply

Inspiring
November 16, 2015

I am not sure but maybe there's a stop() method on the frame "hideMSG" try to go to the next frame and play.

lauraa51823306
lauraa51823306AuthorCorrect answer
Participant
November 17, 2015

No, there is no stop in that frame, there's actually a play(); which is exactly what I want.

I managed to get it working using variables instead.

Thanks,

Laura

kglad
Community Expert
Community Expert
November 17, 2015

if holder is on the main timeline of your level0 swf, in the loaded swf you would use:

on (release) {

_level0.gotoAndPlay("hideMSG");

_level0.holder.unloadMovie();

}