Solution
It appears Director1.4 doesn’t like tap events, specifically when using PAGES. So as a workaround, I removed the tap event listener and replaced it with a touch event listener.
I modified the touch event listener so it would check if the x position at the start of the event didn’t change ie. was it a tap or not?
eg.
local function imageListener( event )
if event.phase == "ended" then
-- this is another way of checking for a TAP event
-- director1.4 doesn't handle the tap event well
-- so we compare x value at start of touch, to it at the end eg. a tap
if event.xStart == event.x then
-- change from pages to scenes mode
-- and change scene
director:turnToScenes();
director:changeScene("menu");
end
end
end
Notes:
I simply compare the x position values, which is fine for my particular use. However to detect a proper tap, perhaps it’s prudent to check if both x and y positions had changed.
Hope this is of some help to someone.
Update:
This runs fine on the simulator 2011.704, but when I just tested it on my iPhone 3Gs, it’s not responding properly. I have to touch the screen half a dozen times before it responds and does the turnToScenes() code. Will look into this further. May be a loading issue as I’m loading 52 playing card images into pagelist.
Added some simple jitter correction when comparing xStart with x and this did the trick…
[code]
if (event.xStart >= event.x -10) and (event.xStart <= event.x+10) then
– change from pages to scenes mode
– and change scene
director:turnToScenes();
director:changeScene(“menu”);
end
[/code] [import]uid: 97524 topic_id: 21673 reply_id: 105866[/import]