• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 19. ActionScript: Add Interactiv... > Add navigation to return to Scene 1

Add navigation to return to Scene 1

The function that you’ll add to the button in Scene 2, to return the user to Scene 1, is similar to the function that you wrote to take the user to Scene 2.

1.
In the Scene panel, select Scene 2.

In the Timeline, create a new layer and name it Actions.

2.
Select Frame 1 of the Actions layer.

In the Actions panel, enter the following in the Script pane:

// function takes user to Scene 1 when back_btn instance
// is released
back_btn.onRelease = function (){
  gotoAndStop("Scene 1", 1);
  };

The only differences between this function and the function in Scene 1 are the name of the button and the name of the scene.

3.
In the Scene panel, select Scene 1.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint