I want to detect touchBegin event in Image component in Flex mobile but when I set <...touchBegin="myMethod()" /> , but its doesn't trigger when I touch that image.
Any ideas?
I want to detect touchBegin event in Image component in Flex mobile but when I set <...touchBegin="myMethod()" /> , but its doesn't trigger when I touch that image.
Any ideas?
The reason you might not be seeing any event triggered is that depending on the device, touchBegin might not be the event that gets triggered on the beginning of the touch, there seems to be some discrepancy on what devices use touchBegin and which ones use mouseDown.
For example to test this I used the put the following properties in an Image:
touchBegin = "touchBeginHandler(event)"
mouseDown = "mouseDownHandler(event)"
And the following code:
protected function touchBeginHandler(event:TouchEvent):void
{
trace("Touched");
}
protected function mouseDownHandler(event:MouseEvent):void
{
trace("Moused");
}
On both the phone emulator and my actual phone the result was a trace statement of "Moused". So long story short, try using the mouse down event to see if you get your desired results.
I think you have to actually enable the multi touch gestures mode on mobile to get the touch events instead of mouse events.