AS3 GESTURE_SWIPE 配备 N-Trig 供电触摸屏
我目前正在使用 AS3 开发原型并尝试一些触摸屏手势。
我正在使用 AIR 2.0 进行编译,目前 GESTURE_ZOOM 和 GESTURE_ROTATE 可以正常工作,但由于某种原因,GESTURE_SWIPE 给我带来了一些头痛。我知道这是可能的,因为我已经看到它在这里工作,使用与我测试相同的笔记本电脑(DELL LATITUDE XT2 和 N-TRIG)。
http://www.youtube.com/watch?v=6u8ynaCPIoY
这是我的代码。
stage.addEventListener(TransformGestureEvent.GESTURE_SWIPE, onStageSwipe);
function onStageSwipe(e:TransformGestureEvent):void
{
if (e.offsetX == 1)
{
//User swiped towards right
swipe.text = "swipped right";
}
if (e.offsetX == -1)
{
//User swiped towards left
swipe.text = "swipped left";
}
}
我也尝试过使用Movieclip而不是舞台,但仍然没有用。
I'm currently developing a prototype using AS3 and trying out some touchscreen gestures.
I'm compiling using AIR 2.0 and currently have GESTURE_ZOOM and GESTURE_ROTATE working but for some reason GESTURE_SWIPE is giving me a few headaches. I know It's possible as I've seen it working here, using the same laptop (DELL LATITUDE XT2 & N-TRIG) as I'm testing on.
http://www.youtube.com/watch?v=6u8ynaCPIoY
Here is my code.
stage.addEventListener(TransformGestureEvent.GESTURE_SWIPE, onStageSwipe);
function onStageSwipe(e:TransformGestureEvent):void
{
if (e.offsetX == 1)
{
//User swiped towards right
swipe.text = "swipped right";
}
if (e.offsetX == -1)
{
//User swiped towards left
swipe.text = "swipped left";
}
}
I've also tried this using a Movieclip
rather than the stage and still no use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题的答案是你不能。 GESTURE_SWIPE 不是 XT2 上的有效命令。
The answer to this question is you can't. GESTURE_SWIPE isn't a valid command on the XT2.