Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flash混合鼠标和手势事件_Actionscript 3_Flash_Mouseevent_Multi Touch_Gesture - Fatal编程技术网

Actionscript 3 Flash混合鼠标和手势事件

Actionscript 3 Flash混合鼠标和手势事件,actionscript-3,flash,mouseevent,multi-touch,gesture,Actionscript 3,Flash,Mouseevent,Multi Touch,Gesture,我有一个flash应用程序,它只处理鼠标事件,因为它首先是为PC机使用,所以有一个鼠标和键盘。现在我想添加手势事件,更准确地说,多点触摸可用于平板电脑上的zoom。我查看并在代码中添加了以下内容: import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; import flash.events.GestureEvent; import flash.events.TransformGestureEvent; import fl

我有一个flash应用程序,它只处理鼠标事件,因为它首先是为PC机使用,所以有一个鼠标和键盘。现在我想添加手势事件,更准确地说,多点触摸可用于平板电脑上的zoom。我查看并在代码中添加了以下内容:

import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.GestureEvent;
import flash.events.TransformGestureEvent;
import flash.events.GesturePhase;
在my init函数中:

Multitouch.inputMode=MultitouchInputMode.GESTURE;
addEventListener(TransformGestureEvent.GESTURE_ZOOM,onZoom);
最后:

protected function onZoom(e:TransformGestureEvent):void{
    //I tried both but no one works         
    //stage.scaleX *= e.scaleX;
    //stage.scaleY *= e.scaleY;
    stage.width *= e.scaleX;
    stage.height *= e.scaleY;
}

但它不起作用。当我尝试使用多点触摸进行缩放时,它只需第一次触摸并执行鼠标下移和鼠标移动事件功能。所以,我想知道是否有可能混合鼠标事件和手势事件,或者我是否必须重做我的应用程序,用手势事件替换所有鼠标事件?谢谢。

检查有多少输入点可以处理您的设备,Multitouch.maxTouchPoints必须至少为2。无论如何,我建议你使用这个:最后,我使用MultitouchInputMode.TOUCH_POINT使它工作起来;而不是多点触控输入模式。手势;然后触摸你开始。我有一些小错误,因为我必须将所有鼠标向下事件更改为鼠标向上(不理解为什么),所以我无法真正获得某些功能所需的功能,但appli总体上运行良好。