Can anyone tell me if any of these are correct? I am using Senocular
TransformTool (e.g.
http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php)
I have a Flex that has the following layers:
Flex Project Layers (top to bottom):
-Application
--main sprite
---visualization sprite
----holder layer - where TARG and TOOL are located.
What I need is for TOOL's X & Y to be TARG's X & Y at all times. So if I drag
TARG then TOOL needs to stay with it in the same spot (And no I can't put TOOL
inside TARG). So I tried the following which doesn't work:
tool.x = targ.x; (in debug it shows this before assignment tool.x=289 and
targ.x=0)
tool.y = targ.y; (in debug it shows this before assignment
tool.y=200 and targ.y=0)
So, I tried each of the following (substituting in each var), but none of which
works.
tool.x = gtlpt.x;
tool.y = gtlpt.y;
var gtlpt:Point = tool.globalToLocal( new Point( targ.x, targ.y ) );
var ltgpt:Point = tool.localToGlobal( new Point( targ.x, targ.y ) );
var toolgtlpt:Point = targ.globalToLocal( new Point(
tool.x, tool.y ) );
var toolltgpt:Point = targ.localToGlobal( new Point(
tool.x, tool.y ) );
var mgtlpt:Point = _vis.marks.globalToLocal( new Point(
tool.x, tool.y ) );
var mltgpt:Point = _vis.marks.localToGlobal( new Point(
tool.x, tool.y ) );
var mmgtlpt:Point = _vis.marks.globalToLocal( new Point(
targ.x, targ.y ) );
var mmltgpt:Point = _vis.marks.localToGlobal( new Point(
targ.x, targ.y ) );