-
Member
X and Y of a nested Rotated Clip
I need to 'lock on' one Movieclip to a fixed point on another. BUT the other is inside of another clip that can be rotated. When the clip is rotated, the X and Y of the clip inside the rotated clip isn't changing so Local to Global or anything like that doesn't want to work. I've tried some basic Trig to workout where the point is but My math skills don't seam to be up to it.. Basiclly, lets refer to the lock-on clip as 'Lock', the rotating clip as 'Target' and the clip inside that which I need to lock onto 'TargetPoint', so we have _root.Lock, _root.Target and _root.Target.TargetPoint
Any ideas?
-
Code:
Target.onMouseDown = function() {
Target.onEnterFrame = function() {
Target._rotation++;
upDate();
};
onMouseUp = function () {
Target.onEnterFrame = null;
};
};
function upDate() {
var myPoint = {x:Target.TargetPoint._x, y:Target.TargetPoint._y};
Target.localToGlobal(myPoint);
Lock._x = myPoint.x;
Lock._y = myPoint.y;
}
-
Member
stupid question but have you tried that and have it work? as I said, when the parent clip is rotated, the X and Y doesn't change for the internal clip, of course, and localtoglobal didn't take rotation into account..
I'll try it again but i'm not sure.. if it works, thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|