使用 ActionScript 3 的触摸事件与鼠标单击事件

发布于 2024-12-26 06:04:08 字数 156 浏览 0 评论 0原文

只是想问一下,在为手机或平板电脑(尤其是 iPhone)编写应用程序时,使用鼠标单击事件或触摸点击事件是否有任何优势?

我知道他们都应该工作得很好,但是就性能而言,谁更好?选择时有什么需要注意的吗?

顺便说一句,我使用 actionscript3 来实现该应用程序。

Just wanted to ask if there is any advantage for either using mouse click event or touch tap events, when writing apps for mobiles or tablets (for the iphone especially)?

I know that both of them should work fine, but in term of performance, is anyone better? Are there any things I should be aware of when choosing either?

By the way am using actionscript3 to implement the app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

差↓一点笑了 2025-01-02 06:04:09

很好的问题!点击事件“技术上”较慢,因为它们监视多个输入点。如果您只关心单点触摸输入,那么标准鼠标事件系统就可以了。对于触摸事件,每个侦听器都会创建几个对象,以帮助处理多点触摸功能(但这接近性能的微小分数毫秒损失)。

Excellent question! Tap events are "technically" slower as they monitor multiple input points. If your only concerned with a single touch input, the standard mouse event system is just fine. For touch events, there's a couple objects being created per listener to assist in handling the multitouch functionality (however this is close to a tiny fractional ms loss in performance).

好菇凉咱不稀罕他 2025-01-02 06:04:09

我认为在平板电脑上实现应用程序时,touchEvent比mouseevent更好!我尝试了很多次!你可以测试一下

i think that the touchEvent is better than mouseevent when implement the app on tablets!i try it many times!you can have a test

微暖i 2025-01-02 06:04:08

这可能是有关 Adob​​e AIR 触摸支持的最佳文档:

http://help.adobe.com/en_US/as3/dev/WSb2ba3b1aad8a27b0-6ffb37601221e58cc29-8000.html

该页面中途指出:

注意:监听触摸和手势事件可能会消耗大量处理资源(相当于每秒渲染几帧),具体取决于计算设备和操作系统。当您实际上不需要触摸或手势提供的额外功能时,通常最好使用鼠标事件。

我认为触摸的唯一好处是多点触摸。 TouchEvent 有一个 touchPointID,可让您跟踪每个触摸点的移动。如果您不关心多点触控,听起来鼠标事件将是最佳选择。

This is probably the best documentation on Adobe AIR touch support:

http://help.adobe.com/en_US/as3/dev/WSb2ba3b1aad8a27b0-6ffb37601221e58cc29-8000.html

Midway through that page it states:

Note: Listening for touch and gesture events can consume a significant amount of processing resources (equivalent to rendering several frames per second), depending on the computing device and operating system. It is often better to use mouse events when you do not actually need the extra functionality provided by touch or gestures.

The only benefit of touch, I would think, would be multi-touch. The TouchEvent has a touchPointID which allows you to track the movement of each touch point. If you don't care about multi-touch, it sounds like Mouse Events would be the way to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文