Skip to main content
Known Participant
October 3, 2007
Question

Opening an external .swf file and making it go to a certain frame??

  • October 3, 2007
  • 4 replies
  • 429 views
Hi all.

This is probably really simple I just can't think of the code right this second. I have a button and when I click it I want it to load a .swf at level 0 and I want it to go to frame 5 in the .swf that is being opened.

I know the code

on (release) {
loadMovieNum("home_screen.swf",0);
}

but how do i get it to go to frame 5 in home_screen.swf?

thanks in advance.
This topic has been closed for replies.

4 replies

Inspiring
October 4, 2007
the quickest method is to store the button instance names inside of an array and use a for loop (inside your on(release) ) that will cycle through the array and set it's enabled property to false;

You'll have to make sure to set this same property to true after the user clicks to return to the main navigation.
RineAuthor
Known Participant
October 3, 2007
ok that worked but now I have home_screen.swf on level 0 under movie1.swf which is on level 1.

Even though I'm looking at movie1.swf I am still able to click the buttons underneath movie1.swf on the home_screen.swf which is on level 0.

How do I make it so I cannot click those buttons underneath? And what is the code to do so?

Thanks
Inspiring
October 3, 2007
The best method is to load the new .swf file into level 1 or higher and not level 0. Have this swf cover the screen until they click on the necessary button in the new .swf that will unload the movie and take it back to frame 5 (which level 0 is already on).
Inspiring
October 3, 2007
When you load something into _level0, you are overwriting the contents of the root timeline and therefore, you AS that makes the movie go to a given frame which you may be including in the on(release) above, isn't going to fire because the AS after the loadMovieNum will no longer be present to fire. You'll need to put your code for the gotoAndPlay(5) into the home_screen.swf file on it's first frame.
RineAuthor
Known Participant
October 3, 2007
I can't put it on the first frame because I don't always want it to go to frame 5.

When I first open home_screen.swf I want it to play on frame 1 because it is a little screensaver animation that goes on until the user clicks a button. Then the user will click on a button in frame one which will play a little tween that leads to four more buttons on frame 5. If a user clicks on one of these buttons it will open a new .swf on level 0. This new .swf will then have a button to take you back to the main timeline which is on frame 5 of home_screen.swf.

So what is my easiest and fastest solution to this problem?