A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Variable control through levels

  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    9

    Smile

    How do I do this?:

    I have buttons on _level0 with Set variables on each button
    ie: land = 1;

    I want these variables to control an mc on an external swf
    that loads on level 1
    //the actions are on _root.mc
    if (land == 1){
    play();
    else {
    stop();
    }

    Can someone please help? I'm very confused


  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    You can either set the variables on the loaded mc:

    _level1.land = 1;

    or you can have the loaded mc look for the variables in the main timeline:

    if (_root.land == 1){
    play();
    else {
    stop();
    }




  3. #3
    Junior Member
    Join Date
    Mar 2001
    Posts
    9
    Yes I see but would'nt
    _root.land becomes the main timeline for that particular _level. So _root.land is actually a varible in the _level1 timeline?
    how do I make sure it gets it from the MAIN timeline _level0
    I tried
    _level0._root.land==1
    but that did'nt seem to work.. maybe i got the syntax wrong?

    I still can't get it to work..!!! Someone please help me and REALLY dumb it down for me.. I'm so confused this has worked before without external files on levels..
    thanks



    [Edited by tagkng on 04-15-2001 at 01:36 AM]

  4. #4
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    Yes, you're right, I'm sorry.

    if (_level0.land==1) {

    would 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