8 Replies Latest reply on Sep 16, 2008 1:10 PM by kglad

    Button link to another Scene, need code.  I apologize

    devidas
      I am just stumped over doing something really simple and I need the code and the understanding to do this in Actionscript 2.0 . I hope someone can help !! I am authoring with Flash CS3, but need to do the following for one file in Actionscript 2.0. I have searched this forum and tried many solutions offered by experts, but they do not seem to help. Perhaps I am missing something.

      I need to enable a button on the main timeline that when clicked, brings the user to Scene 2, frame 1. By the way this particular frame is named M1

      I have created a button properly. The instance name on the timeline in Scene 1 is skipintro_btn


      >>>Scenario 1 that I tried unsuccessfully
      In the main timeline, I created an Actionscript layer and in it, on the same frame as the skipintro_btn, I add this AS 2.0 code:

      skipintro_btn.onPress = function():Void {
      gotoAndPlay("Scene 2",1)
      }

      and I tried this:

      skipintro_btn.onPress = function():Void {
      gotoAndPlay("Scene 2",1)
      }

      But the above does not work. The cursor turns into a hand when rolled over the button, but upon clicking there is no action.


      >>>Scenario 2 that I tried unsuccessfully
      On the main timeline, I added this code to the object itself, instead of relying on the actionscript in a separate layer:

      on(release){
      gotoAndPlay("M1")
      }