PDA

View Full Version : Can a variable be pointed to an absolute movie clip path?


7year
09-30-2005, 07:48 PM
I was wondering if it is possible to make a pointer variable that when referenced will point to a physical path in the movie clip. Heres an example:

I have a movie clip in my fla that is _root.myClip1_mc.myClip2_mc.myClip3_mc. Is it possible to make a variable such as _global.myClip3Pointer that when referenced in AS code will affect the actual movie clip. So if i type the following lines it will do the actions to the movie clip, not the variable.


_global.myClipPointer._y = 100;
_global.myClipPointer._x = 150;
_global.myClipPointer.anotherClipInside_mc._y = 10;
_global.myClipPointer.anotherClipInside_mc._x = 10;


If this is possible please let me know. The paths too movie clips are sometimes extremely verbose and functions could be made more modular if this is possible.

TIA for any help you can offer

Ryan

MichaelxxOA
09-30-2005, 07:56 PM
sure if I understand the question right you can have...

var mc : MovieClip = _root.aMovieCLip.myMovieClip;

mc._x = 400;
mc._y = 0;
mc.anotherMC._x = 40;


take care.
-Michael

7year
09-30-2005, 08:58 PM
so in the prev example, the line mc.anotherMC._x = 40; would change the x coord of _root.aMovieCLip.myMovieClip.anotherMC, correct?

MichaelxxOA
10-01-2005, 02:31 AM
I'm not sure I cannot see what you are setting mc to..
-Michael