I have been experimenting with the accelerometer inputs to control an object in my game. I found I could only get the accelerometer event listener to work if I also included an enterFrame listener. Can someone explain why this is? By the way I am using Cider (ultimote) to apply the accel inputs.
In the code below, the “accel” statement is only printed to the terminal if the enterFrame listener and onFrame function are uncommented.
Code:
_____________________________________________________
system.setAccelerometerInterval( 100 )
local function onTilt( event )
print(“accel”)
end
–local function onFrame()
–end
Runtime:addEventListener(“accelerometer”, onTilt)
–Runtime:addEventListener (“enterFrame”, onFrame)
_______________________________________________________
Thanks in advance,
Chris [import]uid: 146966 topic_id: 28408 reply_id: 328408[/import]