-
1 Attachment(s)
localToGlobal problems
i posted a few days ago about relative positions inside movieclips.
then i remembered localToGlobal.
duh.
apparently i'm implementing it wrong, as when i move the box anywhere else, it still repositions the box to the clip's x and y.
the code is in the 2nd box from the top on the far left.
2nd frame.
thanks for any help.
nolen
-
looked at the file was kinda messy so i didnt really understand.. but i think i can help
point = new Object();
point.x = this._x;
point.y = this._y;
localToGlobal(point);
box.beginx = point.x;
box.beginy = point.y;
is how you use the localtoglobal... it only works with objects formated object.x object.y (not sure if it can have more paramters or not, but i know it works this way).. so create a object tell it your local coordinate.. localtoglobal.. then it returns global posistions in object.x object.y
NOTE: need to recaculate if object is moved
something like
point.x = this._x;
point.y = this._y;
localToGlobal(point);
box.currentx = point.x;
box.currenty = point.y;