A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: 4 buttons that lead to the same place, then separate

  1. #1
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159

    4 buttons that lead to the same place, then separate

    confusing subject for a confusing problem!

    i have one scene with 4 buttons. what i WANT to have happen is, no matter which of the buttons you click, A, B, C, or D, you automatically go to frame, say, 500 of the scene.

    at frame 500, a little animation plays.

    when the animation is complete, you're sent to a different scene, depending upon what button you originally clicked. button A would send you to scene A, button B to scene B, etc.

    but all of those buttons must first pass through the same frame 500 of scene 1.

    its annoying and ridiculous, and sounds like it could be avoided or duplicated, but because of fluid animation in this case, it cant

    any help?
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    Junior Member
    Join Date
    Apr 2003
    Posts
    1

    me too!

    I'm actually looking for something very similar.

    Hopefully someone can help!

  3. #3
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    is it even possible?
    i'm not new to action scripting. i'm just bad at it.

  4. #4
    primate with a keyboard
    Join Date
    Mar 2001
    Location
    The Netherlands Mood: happy monkey :-D Likes: you know... |:-) Dislikes: stupid stuff
    Posts
    72
    sure it is

    Create a variable when you press any of the buttons.
    When you reach the end of the animation on frame 500 you use a little check to see what's in the variable and then decide to which frame to go next to.

    example

    frame 1:
    buttonClicked = "A"

    frame 500:
    if (buttonClicked == "A") {
    gotoAndPlay(100);
    } else if (buttonClicked == "B") {
    gotoAndPlay(200);
    } else if (buttonClicked == "C") {
    gotoAndPlay(300);
    } else if (buttonClicked == "D") {
    gotoAndPlay(400);
    }
    sig? I don't have a sig. euhm.. no wait! this is IT!

  5. #5
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    heya mediamonkey!

    im not exactly sure i understand that, but lemme detail what i tried in an attempt:

    in frame 1 where the 4 buttons are, i gave each an instance name, A,B,C,D.

    then, in frame 500 i entered this code into a frame:

    if (buttonClicked == "A") {
    gotoAndPlay("scene3", 1);
    } else if (buttonClicked == "B") {
    gotoAndPlay("scene4", 1);
    } else if (buttonClicked == "C") {
    gotoAndPlay(300);
    } else if (buttonClicked == "D") {
    gotoAndPlay(400);
    }


    buuuut... that still doesnt work. what'd i mess up here?
    i'm not new to action scripting. i'm just bad at it.

  6. #6
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    doh!

    waitaminute, i got it!

    the buttons cant just have instance names, they gotta have the variable put into the release action. phew!

    i'm up and running now -- thanks for the help mediamonkey!
    i'm not new to action scripting. i'm just bad at it.

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