A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Jump to a different scene from within a movie clip! Aaaaarrggghhhh!!

  1. #1
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    I have 2 scenes.

    Scene 1 has a button inside a movie clip. How the hell do I jump to Scene 2 by clicking on this button?

    Sounds easy right? Well the normal script of:

    on (release) {
    gotoAndStop ("Scene 2", 1);
    }


    DOES NOT WORK!!!!!!!!!

    This is driving me mad! Somebody please help!

  2. #2
    If the button is inside a movie clip, it's trying to jump to scene 2 within that MC, unless you tell it otherwise, I'm thinking.

    I'd think you'd have to access it via _root somehow, but I avoid scenes at all costs, so I'm not sure of the exact code. Seems like it would be this:

    on (release) {
    _root.gotoAndStop ("Scene 2", 1);
    }

    Hope that works.

    Best,
    Tom

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Posts
    112
    Hi,

    bin the "scene 2" bit. Give you first frame in Scene 2 a label and inside the button put the code

    gotoAndPlay("new_label");

    That should do it.

    Keef

  4. #4
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Neither work!!! This is such a simple thing - it's driving me mad!

    Does anybody know???

  5. #5
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    If your Scene 1 has 23 frames, you want go to the Scene 2 first frame, then that is 24th frame.


    _root.gotoAndStop(24);

    It is bad to use absolute number of frame.
    But, at least it works.

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi...the easiest way to do this is....

    Go to the frame you want to go to...in the scene you want to go to...and put a "label".
    Then on your button in your movieClip, put this action:

    on (release) {
    _root.gotoAndStop("yourLabel");
    }


    You can enter this action in the Expert Mode in the Actions Panel............. or to enter this in the Normal Mode in the Actions Panel, scroll down to Objects>MovieClip>gotoAndStop (or gotoAndPlay)......... DoubleClick and it automatically puts the on(release) part of the code.

    Then in the Expression box, type the path in front of the dot (in this case, _root). Where it asks for the frame, put in your "label".............be sure to put quotes around it.

    Hope this helps...

    -pigghost-


  7. #7
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    Wow, that is great. Now I learned. I have been confused by "Scene" thing for long.

    In Scene 1

    gotoAndStop("Scene2_label") - no
    gotoAndStop("Scene 2","Scene2_label") - yes

    _root.gotoAndStop("Scene2_label") - yes
    _root.gotoAndStop("Scene 2","Scene2_label") - no

    Thanx

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