A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Easy ActionScript Q - Nested button navigation

  1. #1
    Member
    Join Date
    Apr 2004
    Location
    IA, USA
    Posts
    57

    Easy ActionScript Q - Nested button navigation

    I am trying to make this button point to a new scene.

    Here is how the button is put together:
    NavGigs (button) inside links (graphic) --> navLinks (movie clip) --> News (scene)

    So down in the library, I opened up links, clicked on NavGigs, and assigned an action to it.

    Here is the action:
    on (release) {
    gotoAndPlay("Gigs", 1);
    }
    on (rollOver) {
    tellTarget ("movingTicket") {
    play();
    }
    }
    on (press, rollOut) {
    tellTarget ("movingTicket") {
    gotoAndPlay(14);
    }
    }



    Now, the thing is, everything works except that first on (release). I'm trying to get it to go to scene "Gigs" and play frame 1, but it doesn't move at all.

    To double check things, I dragged a new instance of the button onto the stage (not inside navLinks --> links) and assigned the appropriate action, and it worked perfect. So I'm guessing this has to do with the fact that this button has been nested far into the movie. How can I ActionScript my way out of this?

  2. #2
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    Code:
    on(release){
    _root.gotoAndPlay("gigs");
    };
    _root.refers to the main time line .
    gigs should be a frame label on the first frame of that scene =gigs.
    label the frame and flash wont have to guess what to do ..
    cheers
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  3. #3
    Member
    Join Date
    Apr 2004
    Location
    IA, USA
    Posts
    57
    Awesome! That did it (though I had to remove that last semi-colon at the end of the last bracket).

    Thanks for your help.

  4. #4
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    yes his is the better way to do it .. not targeting scens blank and the frame as 1 example of a wrong way . ("gigs",1);
    correct way ,("gigs"); gigs being the frame label on the first frame on the scene you are targeting ..also dont FORGET the path _root
    so _root.gotoAndPlay("frmaelabel");
    best way ..
    cheers
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

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