Variables lost somewhere

Hi,

I have a main MC which calls an external MC (a picture slider).
This pic slider uses variables to work.
However, I’m experiencing problems with these variables when it’s loaded from the main MC.
It’s really strange, the pic slider MC works perfectly in these 2 situations:

1- When it’s played itself all alone (double-clicking the .swf file)
2- From the main MC and using a blank_MC (holder) to call it from. AS code is: loadMovie(“pictureslider.swf”,1);

But with this 2nd option, I can’t place the MC in the needed position on screen. So I decided to use this piece of AS instead: loadMovie(“pictureslider.swf”,“target_blankMC”);
Now, for a reason I can’t understand, all the variables are “lost”. (By doing ctrl-alt-v when the main MC is running, I can see all the variables which values in this pic slider clip are the following: undefined, 0 or #ERROR#”)

Why is this so?
I’ve been trying to fix this for hours without success.

Please, a bit of help.
Thank you.

hmm. well, my guess is you used _root in some calls in the pic slider. so, that would work great in the SWF itself, and would even work if you load it into a different level, as _root in both cases would refer to the root of the picslider movie. but, if you load it into a target mc, _root refers to the timeline of the loader movie, which probably messes up your variable scopes. so, i’d suggest using relative references instead, with _parent, etc.

Ave brainy…
You’re ABSOLUTELY right!

Thanks for this piece of masterclass…great explanation.

I’ve refered the variables in the external pic slider MC to _root.target_blankMC.variables and that was it!

but, if you load it into a target mc, _root refers to the timeline of the loader movie,

…I didn’t know that and it was really puzzling me.

Thank you very much!