A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Change Scenes on release ... yada yada

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    4
    Help...

    I have a series of buttons in a movie clip with actions like this:
    Code:
    on (release) {
        gotoAndPlay("SceneName", 20);
    }
    I'm trying to make a navbar in a movie clip, and place instances of the movie clip in different scenes.

    But it no work. no bueno.

    Any suggestions?


  2. #2
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    What's not working, the buttons ? or Putting instances of the movie clip in other scenes ?


  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    4
    Hey,

    The buttons themselves aren't working... They won't switch scenes.

  4. #4
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    Code:
    on (release) {
        _root.gotoAndPlay("framelabel");
    }

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Posts
    4
    Hey,

    No that didn't work, I did:
    Code:
    on (release) {
        _root.gotoAndPlay("allProducts","framelabel");
    }
    because I needed the scene name. But that didn't work. What does _root refer to, and do I need to set it somehow in a different scene to indicate it as the root? I have three other scenes - preload, intro1 and intro 2 before my main scene. I want to just skip those...

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    See what you get ES when only handing out the cookie but with no explications!

    For the 1000th time at least!!!!!!!!

    When targeting the main timeline, the _root level, from within movie clips or from loaded external movies on other levels (in which case, you would have to replace _root by _level0), you cannot refer to scene names. They're totally useless.
    Estudioworks' suggestion is really the best answer!

    Label the targeted frame of the targeted scene with an unique label such as my_test_label and use that in addition to _root (which indicates you're targeting the main timeline) in your button script without the scene name:

    on (release) {
    _root.gotoAndPlay("my_test_label");
    }

  7. #7
    Junior Member
    Join Date
    Jul 2002
    Posts
    4
    Ahh! Brilliant.

    I didn't realize that if you name a frame, that you don't have to reference a scene name.

    cookies with explications rule.

    much obliged!

  8. #8
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    Thanks oldnewbie !!

    I think I'll put togehter a tutorial that explains targeting the root timeline and then targeting a mc on the root from another mc.

  9. #9
    Junior Member
    Join Date
    Aug 2002
    Posts
    4
    hey i've been having the same problems... but i can't get it to go to the frame although i've specially named it, how did you by pass chosing a scene?


    this is what my code looks like after trying to copy yours...

    on (release) {
    _root;
    gotoAndStop("About Us", "CPC");
    }

    i can't get it to just go to "CPC" without specifing the scene "About Us"

    i'm quite new to flash but any help would be great. thanks so much.

  10. #10
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by cpcannie
    this is what my code looks like after trying to copy yours...

    on (release) {
    _root;
    gotoAndStop("About Us", "CPC");
    }
    your computer must have a problem with it's copy and paste functionality

    Code:
    on (release) {
         _root.gotoAndStop("CPC");
    }

  11. #11
    Junior Member
    Join Date
    Aug 2002
    Posts
    4

    Smile

    thank you so much. i was literally jumping up and down after this worked. and you saved my cowroker like 12 hours of work on his homepage too.

  12. #12
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    What's a cowroker ? Is it related to Al Roker ?

  13. #13
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by estudioworks
    What's a cowroker ? Is it related to Al Roker ?
    I think it's a person, that when they push a cow, it dosent' fall over. It gets so close to tipping but then it just rocks back.

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