loadMovie() : "_root" problem

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  10 October 2003
Question loadMovie() : "_root" problem


Flash problem : I loadMovie() a *.swf using "_root" variable in its scripts... But on loading "_root" as changed to the main variable of the receiving movie and the *.swf included does not work right. How to?

1001 thanks
  10 October 2003
Nobody to help me?
Is "_root" a base layer declaration, a base scene declaration, something else?
  10 October 2003
don't know your problem but _root is a base *scene* node. all your scenes are attached to this baby.You can see this in the "movie explorer" (advice: make extensive use of that one)
  10 October 2003
first things first. you have to understand that "_root" is a virtual path.

in flash you have levels. _level0 is "_root". always. (well, not anymore however we dont need to go into that)

if you then load a movie into a new level using loadMovieNum it sits on "_leveln" (where n is the level number you chose), so any reference to "_root", because it is a virtual path will still lock to "_level0"

ways to get round this are:

use "_level" references for everything. not the best answer
use a global namespace to store things in...this is only available in flashMX and above and involves setting an object to store data in...along the lines of

_global.dataStore = {};

then you can use it like anything else

dataStore.arrays = {}
dataStore.arrays.timerArray = [];

this again is not an ideal solution...because it is accessible anywhere, if the object becomes bloated with data, it will take up alot or memory.

the best solution is the simplest. use "_parent" to get to where you want to store the info for each level. so if you are 3 movieClips down in _level1, the "root" or _level 1 is found at "_parent._parent._parent".

that will allow you always to load one movie into another and it be interoperable with no recoding required
  10 October 2003
Thanks a lot... I'll study it :|
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
  share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:46 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.