A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: button to work through levels

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

    button to work through levels

    confusing lil problem here:

    i have a movie that has a loading scene, then the "main" scene named "scene one." on scene one, there are four buttons: a, b, c, and d. each button leads to its own scene.

    realizing how large and complex scenes a, b, c, and d had become, i decided to convert them to their own swf movies, and have them load in a level (say level 100).

    thus, in the main movie, on "scene one," if you click button A, you go to scene A (brief transition animation) which then loads up movie A in level 100.

    with me so far?

    now what i'm looking for is a HOME button.

    once i have movie A loaded, i'd like to have the ability to click on a HOME button, which will not only unload movie A, it will take you back to a specific, labeled frame in scene one of the main movie.

    *phew*

    is. it. possible?
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    using _root will always target the main movie timeline:

    //unload the movie that is in level1
    unloadMovieNum(1);
    //go to your framelabel in the main timeline
    _root.gotoAndPlay("framelabelhome");

  3. #3
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    heya sofiebel -- thanks for the response!

    using that code, im able to close the top level like i want to, however... i then just return to the main movie and stop. i cant seem to get the timeline to go to the specific scene & frame label i want it to.



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

  4. #4
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    just incase, lemme see if i can better clarify my current problem....

    in my main timeline, i have an action that loads up another SWF in a higher level. i have the action to load up the higher level in frame 5 of the main timeline. i then tell the main movie to stop in frame 7, so it doesn't keep going on, underneath everything.

    sofiebel helped me to set up a "close" button on the top level which, when pressed, closes that entire swf, revealing the original main timeline, levels below.

    however, even with the above "_root" code, the playhead is stuck on that frame 7 STOP action in the main timeline.

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

  5. #5
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    maybe upload your fla or an exapmle so I can take a look at it.

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

  7. #7
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    sorry, bottom link was a lil screwy. should work fine now!
    i'm not new to action scripting. i'm just bad at it.

  8. #8
    Senior Member sofiebel's Avatar
    Join Date
    Feb 2001
    Posts
    1,044
    _level0.gotoAndPlay("start");
    unloadMovieNum(50);

    This seems to be the code that works.

  9. #9
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    bah! i even tried level1 once ... never thought of 0!

    thanks so much, sofiebel!! works like a charm!
    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