A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: accessing variables from multiple movies

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    2
    hello. i've created a movie within a movie, and i'm trying to be able to access the same variables from either movie. i'd be happy with having a variable at the root of my main movie, and from what i've read i should be able to access it from the pop-up movie simply using :/varname (as it seems movies within movies are treated as movie clips), but this doesn't seem to work. instead it seems to create a separate variable. i'm pretty new to this, so probably missing some simple concept. thanks very much for your time.
    nathanial

  2. #2
    Member
    Join Date
    Mar 2001
    Location
    Venice, CA
    Posts
    88
    It depends on whether you're using movie clips in a movie, or whether you're using Load Movie to load movies into level 1, 2, etc.

    If you're only working with 1 swf, and using movie clips in that, you can indeed store variables in the root with the following syntax:

    /:varName

    If you're using load movie, try calling it with _level0:varName (I think - I don't use Load Movie much)...

    Note on the syntax:
    The ":" denotes that it's a variable and therefore goes before a variable name. The path goes before the name and the ":", to form ROOT + ":" + VARNAME. Hence the "/" in example 1 (/:varName) for root, and the "_level0" in example 2 (_level0:varName) - this is also for root, but lets loaded movies access the root variables.

    Hope that helps

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