dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: help a newbie plz

  1. #1
    Member
    Join Date
    Jun 2002
    Posts
    72

    Thumbs up

    can you set a variable which is in the _root from a clip ? i tried like this :
    (my variable is "okidoki")

    _root.okidoki = "whatever";

    but it doesn't work...

    What do i have to do ?
    Thanx,
    hacook

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    682
    It sounds like you are trying to set a variable in one movieclip and make it available in another? If so, use:

    _global.myVariable=whatever

  3. #3
    Member
    Join Date
    Jun 2002
    Posts
    72

    it is !

    that's what i'm trying to do, but it doesn't work :
    In "demo" clip i have written :
    _global.essai = "yes";

    In another clip :
    if (_global.essai == "yes") {
    play();
    }

    But it doesn't work maybe coz i can't see my variable in the variable list while debugging ?
    What can i do ?

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    682
    You don't need to specifiy the _global in the "if". Try removing the quotes.

    Try this:

    if (essai==yes) {
    trace("essai equals yes");
    play();
    }


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