PDA

Click to See Complete Forum and Search --> : level0?



gamist
12-08-2002, 07:09 PM
I am having problems with using relative terms and shared objects. For example:

whatever = _parent._parent.partOfMC;
cube_so.data.morph.whatever = whatever;

This doesn't seem to work because (I think) flash reads the relative path as level0. How can I use a relative path and make the shared object work? This was hard to explain, so if you don't understand, I will try explain better. Thanks,

gamist:confused:

damo
12-09-2002, 12:31 AM
judging by the code example you provided:

whatever = _parent._parent.partOfMC;
cube_so.data.morph.whatever = whatever;

i am assuming that 'partOfMC' is some value that you are assingning to the var 'whatever'.


then:'cube_so.data.morph.whatever = whatever'

is 'morph' expicitly defined as an object?

such as
cube_so.data.morph = new Object();
(or however you are getting the data in there...)
??

the object has to be created before you can assign a property to it.

hope this helps

damo

gamist
12-09-2002, 06:30 PM
Thanks for your reply.

It was the level0 that was causing the problem. I just changed it to:

whatever = _parent._parent._name+".partOfMC";
cube_so.data.morph.whatever = whatever;

This gets rid of the level0 and the shared object is created. I don't know why the level0 thing makes it mess up, but I guess this is an easy way around it.

gamist

damo
12-10-2002, 12:54 AM
i would need to see your code to help provide more context for the reasons behind this behaviour.

damo