A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: finish the scene, THEN gotoandplay

  1. #1
    Junior Member
    Join Date
    Sep 2003
    Posts
    6

    finish the scene, THEN gotoandplay

    i have a scene that i want to go to the end of before it goes to the next user-chosen scene. so, i have a scene, Home, with this actionscript on the Music button:

    on(release){
    Play;
    }

    but when it gets to the last frame, it needs to go to the scene called Music. is there some kind of if(frame==#) statement, or something along those lines, that i could use? i'm just not sure if that will work.

    thanks guys, i really appreciate it.

    -- Cm

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    In the last frame of the scene, why can't you just add the script to goto the next scene you want them to go to?

  3. #3
    Junior Member
    Join Date
    Sep 2003
    Posts
    6
    there are three buttons total, and i need to make them all go to different places.

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    so can you program the buttons to go where they need and put a stop action on the last frame of the scene?

  5. #5
    Junior Member
    Join Date
    Sep 2003
    Posts
    6
    Originally posted by Chieffan
    so can you program the buttons to go where they need and put a stop action on the last frame of the scene?
    i don't follow.

  6. #6
    Junior Member
    Join Date
    Sep 2003
    Posts
    6
    okay, here's a thought. i've got:

    - @ frame 30 -

    on Music button

    on (release) {
    play ();
    scene = Music;
    }

    on Media button

    on (release) {
    play ();
    scene = Media;
    }

    on Contact button

    on (release) {
    play ();
    scene = Contact;
    }

    - @ frame 45 -

    if (scene==Music) {
    gotoAndPlay ("Music", 1);
    } else if (scene==Media) {
    gotoAndPlay ("Media", 1);
    } else if (scene==Contact) {
    gotoAndPlay ("Contact", 1);
    } else if (scene==Home) {
    gotoAndPlay ("Home", 1);
    } else {
    stop ();
    }

    i'm pretty sure variables in flash don't need to be defined, so i don't have it defined as anything anywhere in the scene. i went ahead and tried it just for kicks, but it didn't change anything. Every button leads to Music, which is the variable in the first if statement.

    should you have any clue what's going wrong, i'd be thrilled to find out so i can get past this step. thanks a lot!

    -- Cm

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