hey all, i am teaching myself how to use localToGlobal(), and i seem to be running into a scoping snag, at least i THINK it is a scoping snag.
So when i use
onClipEvent(mouseUp){
pnt=new Object()
pnt.x = _x
pnt.y = _y
_parent.localToGlobal(pnt)
trace ("dragSq,x : "+pnt.x);
}
i get the desired effect, yippee. That is to say, the output says 299, which is what the global coordinate of the movie is.
However when i try use the same code in the main time line like this
x_map.x_3.onRelease = dragSQ;
function dragSQ(){
dragSq=new Object()
dragSq.x = _x
dragSq.y = _y
_parent.localToGlobal(dragSq)
trace ("dragSq.x from ROOT is : "+dragSq.x);
}
i get 0 as an output. This tells me something is broke!
What is broke? Any suggestions would be great. Thanks.