【发布时间】:2012-04-01 04:34:50
【问题描述】:
我想在 Flex mobile 的 Image 组件中检测 touchBegin 事件,但是当我设置 <...touchbegin> 时,当我触摸该图像时它不会触发。
有什么想法吗?
【问题讨论】:
-
为什么不能尝试添加鼠标按下事件?
标签: apache-flex flex4 flex-mobile
我想在 Flex mobile 的 Image 组件中检测 touchBegin 事件,但是当我设置 <...touchbegin> 时,当我触摸该图像时它不会触发。
有什么想法吗?
【问题讨论】:
标签: apache-flex flex4 flex-mobile
您可能看不到任何触发事件的原因是,根据设备的不同,touchBegin 可能不是在触摸开始时触发的事件,似乎在哪些设备使用 touchBegin 和哪些设备方面存在一些差异使用 mouseDown。
例如,为了测试这一点,我使用了将以下属性放入图像中:
touchBegin = "touchBeginHandler(event)"
mouseDown = "mouseDownHandler(event)"
还有如下代码:
protected function touchBeginHandler(event:TouchEvent):void
{
trace("Touched");
}
protected function mouseDownHandler(event:MouseEvent):void
{
trace("Moused");
}
在手机模拟器和我的实际手机上,结果都是“鼠标”的跟踪语句。长话短说,尝试使用鼠标按下事件,看看你是否得到了你想要的结果。
【讨论】:
【讨论】: