A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: gotoAndPlay function

  1. #1
    Junior Member
    Join Date
    Jul 2004
    Location
    Orlando, FL
    Posts
    4

    gotoAndPlay function

    Ok, I do very little actionscript writing, I'm trying to make a simple flash webpage with cool animation and I'm using scenes to seperate the different pages.

    It's pretty simple, main page is Scene 1, next page off that is Scene 2, etc, etc. To keep things simple, I put each individual animation in it's own movie symbol so I can reuse it at any time. This includes an animation where the main navigation buttons pop in and out.

    Alright, I set 2 scenes so far, each with using different symbols, etc. In the first scene, I set one of the buttons to call frame 1 of scene 2 using the following code:
    on (release) {
    gotoAndPlay("Scene 2", 1);
    }

    Unfortunately, the buttons have their own local timeline and when I click the button, It just reloads the button animation from frame 1. I need to make it so it calls scene 2 of the root timeline.

    Thanks
    Last edited by Ninety-9 SE-L; 05-07-2006 at 05:25 PM.

  2. #2
    Junior Member
    Join Date
    Apr 2003
    Posts
    13
    this should work -
    the action from the button triggers a "play" function from the root timeline.

    on the button put this -

    on (release) {
    _root.go_func();
    }

    and at the root time line this -

    function go_func(){
    gotoAndPlay("Scene 2", 1);
    }

  3. #3
    Junior Member
    Join Date
    Jul 2004
    Location
    Orlando, FL
    Posts
    4
    thanks. I was trying _root.gotoAndPlay("Scene2", 1) with no luck. I think it only works for frames, not scenes.

    I think I may also change to using frames with the stop(); command, then I can refrain from using scenes.

  4. #4
    Junior Member
    Join Date
    Apr 2003
    Posts
    13
    frames and stop(); isn't bad at all..
    however the function above works with scenes if still want them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center