AS Paths and stuff (MX)

Ok im having troubles with my paths to things.

I am using relative path, im trying to set a variable from one MC to another…

Heres how i have it structured…

MainMC –
|
----- MC1
|
----- MC2

Now i want to set a variable from MC1 to MC2

But for whatever reason its not working.

And yes i have the instance named, and its on the same layer…

hmm… any ideas?

wow either, i Make no sense, or i post some pretty advanced stuff that no one knows of lol =)

I think i make no sense lol.

Did u try this:

_parent.MC2.h88 = 12

When u test the movie, and list the variables, the output would be:

Level #0:
Variable _level0.$version = “WIN 6,0,21,0”
Movie Clip: Target=“_level0.MC1”
Movie Clip: Target=“_level0.MC2”
Variable _level0.MC2.h88 = 12

Notice that h88 variable had been succesfully declared and set to 12. And offcourse it was set in MC1 by the code above.

yours,
h88

ok, a little further…

Now this is a movie that will be loaded in…

now _root is the Main movie, and not the movie loaded in.

does _parent. Refers to the movie loaded in the main movie?

_parent Property specifies or returns a reference to the movie clip or object that contains the current movie clip or object. The current object is the object containing the ActionScript code that references _parent. Use _parent to specify a relative path to movie clips or objects that are above the current movie clip or object.

ok…

I understand that a little better now…

Ok, now what if you want to access or set information from a movie clip above that one (in the hierarchy structure.)

ex:

_root.thisMc.insideMc
thats the one i want to give info to… (in a variable)

and its comming from

_root.thisMc.insideMc.myMc;

so i want to do something like this…

thisMc.newVar = myMc.SomeVar;

i can do that only if i use… _root.

But i need those paths to be relatvie… is that possible?

the reason i ask is im creating a flash thing that dynamically loads movies into it, and i need to reference stuff correctly in order to work… i need the loaded mc to be pretty much indepentant and relative. =)

Umm, can u rephrase that, i really can’t get what your trying to achieve, anyways, this should work, _parent should be used when u try to access relative path, or accessing an absoulute, like:

_root.MCParent.MCChiled.MCSubChiled.h88 = 23123

Try experimenting with the above code and the last post too, and tell me how it goes!

yours,
h88

im looking for something more like…

…/…/myMc.My2mc

…/ meaning go up one level in the hierarcy… just not sure how to do that.

…/…/myMc.My2mc

_parent._parent.myMC.My2mc

oh ok cool =)
thanks alot ! =)

No problem. :slight_smile:

PS. What a no. of posts u got Raydrad, 784392011.983, i wish i got the same number.