I am trying to develop some sort of localToGlobal _rotation method, much like getting localToGlobal coordinates. For instance, let’s say you have a particular clip with the following scope:
_root.group_mc.subGroup_mc.item_mc
I want to find the total _rotation of item_mc using something like this:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]**function**[/COLOR] totalRotation [COLOR=#000000]([/COLOR]target_mc:[COLOR=#0000FF]MovieClip[/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#0000FF]Number[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#000000]** var**[/COLOR] _tRotation:[COLOR=#0000FF]Number[/COLOR] = target_mc.[COLOR=#0000FF]_rotation[/COLOR];
[COLOR=#808080]* //so then somehow I access the following and add it to the above var*[/COLOR]
_tRotation += target_mc.[COLOR=#0000FF]_parent[/COLOR].[COLOR=#0000FF]_rotation[/COLOR] [COLOR=#808080]//ie. subGroup_mc._rotation;[/COLOR]
_tRotation += target_mc.[COLOR=#0000FF]_parent[/COLOR].[COLOR=#0000FF]_parent[/COLOR].[COLOR=#0000FF]_rotation[/COLOR] [COLOR=#808080]//group_mc._rotation;[/COLOR]
[COLOR=#808080]* // and so on and so on till you get to _root*[/COLOR]
[COLOR=#0000FF] return[/COLOR] _tRotation;
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
I guess the next issue after writing that would be how do you heirachically target the _parent of each mc through some loop?
Thanks for any help