private function thumb_dragStart(e:TouchEvent):void
{
StartstageX = mouseX;
prevX = mouseX;
addEventListener(Event.ENTER_FRAME,checkMouseDir);
addEventListener(TouchEvent.MOUSE_UP, dragStop);
function checkMouseDir(e:Event):void
{
curX = e.currentTarget.mouseX;
trace(e.currentTarget.mouseX);
if (e.currentTarget.mouseX < 0)
{
removeEventListener(Event.ENTER_FRAME,checkMouseDir);
}
if (e.currentTarget.mouseX > 1024)
{
removeEventListener(Event.ENTER_FRAME,checkMouseDir);
}
if (e.currentTarget.mouseY < 0)
{
removeEventListener(Event.ENTER_FRAME,checkMouseDir);
}
if (e.currentTarget.mouseY > 600)
{
removeEventListener(Event.ENTER_FRAME,checkMouseDir);
}
if (prevX > curX)
{
if(coordinate_NO > 0)
{
//left//
coordinate_NO = coordinate_NO - 0.02;
Tweener.addTween(photoContainer,{x:(coordinate_NO*(photoContainer.width-thumb_holder.width)),time:1});
scroll_BAR.x = coordinate_NO*maxScroll;
}
}
else if (prevX < curX)
{
if(coordinate_NO < 1)
{
coordinate_NO = coordinate_NO + 0.02;
Tweener.addTween(photoContainer,{x:(coordinate_NO*(photoContainer.width-thumb_holder.width)),time:1});
scroll_BAR.x = coordinate_NO*maxScroll;
}
}
prevX = curX;
}
function dragStop(e:TouchEvent)
{
removeEventListener(Event.ENTER_FRAME,checkMouseDir);
}
}
I’m trying to use the ENTER_FRAME to update the coordinate of my mouse when the mouse click is DOWN… but when i extend to touch, the enter frame doesn’t seems to work, because my mouse is no more on that stage, the enter frame cannot locate the movement of my mouse on the SimTouch neither on CCV…
can anyone tell me what other method i should use so that i can check the coordinate of my mouse’s or finger’s movement on the flash platform???