Touch Events in iOS Browser
Posted: Tue Apr 05, 2011 12:48 pm
Hi.
Hopefully someone can help me with a problem I'm having. I have started to create an iPad app to display a local PDF file. I can't seem to trap touch events on the browser object. I have the following script at the card level and have a label to display the points so I can try to figure out what's happening. In the iOS Simulator, labelTouchPoint tracks mouse events, but when I try the same thing on the PDF file image (in the browser object), I get nothing. The PDF file pans, scrolls and scales properly using the mouse & option key, but I'm trying to trap a simple mouseDown or touchStart event and can't seem to do that. What am I doing wrong?
global sBrowserId
on touchStart pTouchId, pX, pY # Sent each time a new touch is startedend touchStart
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
end touchStart
on touchEnd pTouchId, pX, pY # Sent each time a touch endsend touchEnd
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
// cmdShowMainTools
end touchEnd
on touchMove pTouchId, pX, pY # Sent when any touch moves set the loc of the target to pX,pYend touchMove
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
end touchMove
Thanks,
Joel
Hopefully someone can help me with a problem I'm having. I have started to create an iPad app to display a local PDF file. I can't seem to trap touch events on the browser object. I have the following script at the card level and have a label to display the points so I can try to figure out what's happening. In the iOS Simulator, labelTouchPoint tracks mouse events, but when I try the same thing on the PDF file image (in the browser object), I get nothing. The PDF file pans, scrolls and scales properly using the mouse & option key, but I'm trying to trap a simple mouseDown or touchStart event and can't seem to do that. What am I doing wrong?
global sBrowserId
on touchStart pTouchId, pX, pY # Sent each time a new touch is startedend touchStart
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
end touchStart
on touchEnd pTouchId, pX, pY # Sent each time a touch endsend touchEnd
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
// cmdShowMainTools
end touchEnd
on touchMove pTouchId, pX, pY # Sent when any touch moves set the loc of the target to pX,pYend touchMove
global sBrowserId
put (pX & comma & pY) into field "labelTouchPoint"
end touchMove
Thanks,
Joel