A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: passing variables between loaded movies with both of them on level0

  1. #1
    I have two movies, moviepart1 and moviepart2. when moviepart1 gets done playing and the user clicks on the "next" button it loads moviepart2 onto level0. I need to be able to have a back button on the first scene of moviepart2 to take the user to the last scene of moviepart1. Here is the actionscripting I am using:

    This is on the back button on moviepart2:
    Code:
    on (release) {
      jump=1;
      loadMovieNum ("moviepart1.swf", 0, "GET");
    }
    and I have a wait scene at the beginning of moviepart1 to use a conditional to figure out if that variable has been sent or not. hereis that conditional:
    Code:
    if (_level0.jump == 1) {
      gotoAndPlay ("scene3", 1);
    } else {
    gotoAndPlay ("scene1", 1);
    }
    I hope that this is enough information to get some help and I would greatly appreciate any help.

    Thanks,
    Justin
    [Edited by therealsyko on 12-18-2001 at 11:20 AM]

  2. #2
    Master Poo Flinger
    Join Date
    Sep 2000
    Posts
    318
    what you should do is load those movies into a blank movieclip or into _level1. because, when you load any movie into _level0, the new movie takes over the whole thing, even if you've loaded something into _level1, it will be gone along with all of its variables.

    hope it helps

  3. #3
    curmudgeon swampy's Avatar
    Join Date
    Jan 2001
    Location
    [wakey]
    Posts
    2,775
    because you are loading the second movie into the same level as the first and it is level 0 you will not be able to store the variables on that level.
    why not load the movies into two seperate container clips.

    the first clip loads the first movie, sscript at the end tells the second movie to load in the second container, sets the first containers _visible property to false.

    the back button canm then just set the second containers _visible property to zero, tell the first container clip to go to a certain frame and set it's _visible property to true

  4. #4
    what if I used a little logic movie and loaded it onto level_1 just for the purpose of passing the variable and then when the variable is received I can unload that movie? Would that work?

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