Hi,
Im struggling with the maths for this...
basically if you use this...
Code:
function moveit(e:Event){
BTN.x = this.mouseX
}
BTN.addEventListener(MouseEvent.MOUSE_MOVE, moveit);
"BTN"'s x will snap to the position of the mousex
But I dont want it to snap to mouseX pos. I want it to move but offset from where the mousex is
So I was thinking something along the lines of this...
Code:
import flash.events.Event;
function moveit(e:Event){
var offset = BTN.x -this.mouseX;
trace(offset)
BTN.x = this.mouseX + offset
}
BTN.addEventListener(MouseEvent.MOUSE_MOVE, moveit);
OffSet is the diffrence between the btn.x and the mousex and then I add that to that mouseX. But that doesnt work. Can some one tell me what Im doing wrong?