A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: scene\MC\button -->> next scene??

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18
    Problem:

    - Scene1 contains a movie clip.
    - The MC contains a button.
    - The button is supposed to advance the whole movie to the next scene, but it causes the MC to start over at frame 1.


    the action attached to the button is as follows:
    ---------------------------------------------------
    on (press) {
    gotoAndPlay ("Scene2", 1);
    }
    ---------------------------------------------------
    what action should I attach to the button, to make the movie advance to Scene2?

    Many thanks, in advance, to whomever takes the time to answer my question.

    e v e

  2. #2
    Senior Member
    Join Date
    Dec 2001
    Posts
    151
    does it start playing from the begining when the button is click or it just keeps on repeating, look carefully into it, make be u have forgot to put a stop action when the movie needs to stop.

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18
    Originally posted by amarkoli
    does it start playing from the begining when the button is click or it just keeps on repeating, look carefully into it, make be u have forgot to put a stop action when the movie needs to stop.
    hi Amarkoli...

    I put the Stop action at the end of the MC. So, the movie clip DOES stop at the end and waits for the user to click the button.

    When the user clicks the button, the MC starts over, instead of making Scene2 start.

    ???

  4. #4
    Senior Member
    Join Date
    Dec 2001
    Posts
    151
    ??? really strange problem, just check for the spells, it should not happen normally, i said normally. may be name the scene and then try.

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    101
    yeah, that seems to happen.Just put a label on the first frame of the scene you want to jump to, and link to button to _root.label.gotoAndPlay
    I think thats it. Or something along those lines.
    Re-post if it doesn't work.

  6. #6
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18
    ....i'm officially confused.

    OK, I uploaded the problem file. Check it here and post your reply.

    http://www.monkeybrains.net/~eve/NRflash_v3_020512.html

    The MC contains another MC which glides across the screen. On a separate layer, I put an invisible button, which glides along with the second MC. When you click the button, it's supposed to go to Scene2.

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Posts
    101
    Yup, reason it doesn't work (i think) is because Flash thinks that the MC is the current timeline, and therefor can't see any other scenes from there. The way i did it once, was to label a frame on Scene 2, and tell the movie clip button to go to that particular labeled frame.
    I think the code is something like
    _root.label.gotoAndPlay
    where "label" is the name you give to the frame on Scene 2.
    Try that. If you're still confused, i'll try to hunt down the flash movie where i used it, and check the code.

  8. #8
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18
    duh... like this??

    on (press) {
    gotoAndPlay ("Scene2", "firstframe_Scene2");
    }


    --------------------------------------------
    err... i'm not sure how to implement:
    _root.firstframe_Scene2.gotoAndPlay



    I'm writing the AScript in Normal (not Expert) mode. Do I have to start with a TellTarget command or something?

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Posts
    101
    start it with an "evaluate", which will give you the "expression" box.
    Of course it needs on (Click) or whatever first.
    In the expression box just type in:
    _root.firstframe_Scene2.gotoAndPlay
    Hope that works.

  10. #10
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18
    First off.... THANKS for your help. I feel like I'm getting closer to making this work. Although, I attached the following script to the button, but it didn't work:

    on (press) {
    _root.firstframe_Scene2.gotoAndPlay ;
    }

    ...the result, the movie didn't go anywhere.

    I think you are definitely right, when you say, "...Flash thinks that the MC is the current timeline, and therefore can't see any other scenes from there". Adding the "_root" part, seems to make sense. Maybe it's not working, b/c I'm not specifying that that the label "firstframe_Scene2" is in the next scene, "Scene2".

    How can we add that piece of info into the script, I wonder? Perhaps this tutorial may steer us in the right direction. This guy is using the same technique as you recommend:

    http://www.flashkit.com/tutorials/Ti...87/index.shtml
    [Edited by tekromantik on 05-13-2002 at 08:49 AM]

  11. #11
    Senior Member
    Join Date
    Nov 2001
    Posts
    101
    Ok, erm.. so try it like this...
    _root.gotoAndPlay("firstframe_Scene2")
    Think that'll work... phew.

  12. #12
    Junior Member
    Join Date
    Feb 2001
    Location
    San Frandisco
    Posts
    18

    SUCCESS!!!

    ....like, oh m'gawd!!

    that did it, weaponkiller. you rawk!! i guess the lesson learned here is, Flash views all the scenes as one big timeline, so a Frame Label can guide it from one scene to another. the issue we had before was just bad syntax??

    thanks, wk. hopefully, with this script, i'll be able to launch this SWF within the week.

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