Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/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 Flex多点触控路径缩放动态注册问题_Actionscript 3_Apache Flex_Charts_Flex4.5_Multi Touch - Fatal编程技术网

Actionscript 3 Flex多点触控路径缩放动态注册问题

Actionscript 3 Flex多点触控路径缩放动态注册问题,actionscript-3,apache-flex,charts,flex4.5,multi-touch,Actionscript 3,Apache Flex,Charts,Flex4.5,Multi Touch,在flex中有没有(直接的)方法来解决多点触摸缩放事件的动态注册问题?我就是受不了这件事 我得到的是(在一些行和标签中)一个组中的路径,它本身被包装在一个滚动条中 <s:Scroller id="scroller"> <s:Group id="scrollerContent"> <s:Path id="path"> <s:stroke> <s:SolidColorStroke colo

在flex中有没有(直接的)方法来解决多点触摸缩放事件的动态注册问题?我就是受不了这件事

我得到的是(在一些行和标签中)一个组中的路径,它本身被包装在一个滚动条中

<s:Scroller id="scroller">
    <s:Group id="scrollerContent">

    <s:Path id="path">
        <s:stroke>
            <s:SolidColorStroke color="#ffffff" weight="2"/>
        </s:stroke>
        </s:Path>
    </s:Group>
</s:Scroller>
下面是Christophe Coenraets为其图表示例提供的代码(事实上,它根据x=0缩放路径

private function zoomEvent(e:TransformGestureEvent):void
{
    zoom(e.scaleX, e.scaleY);
}
protected function zoom(scaleX:Number):void
{
     var w:Number = path.width * scaleX;
     if (scaleX>1)
        path.width = w > width*5 ? width*5 : w;
     else
     {
          path.width = w < width ? width : w;
          if (path.x + path.width < width) path.x = width - path.width;
      }
}

如果您对此有任何帮助,我们将不胜感激!

我使用了DynamicRegistration类,并使其像这样工作,如果您仍然感兴趣:

protected function onZoom(e:TransformGestureEvent, img:Image):void
{
    DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleY);
}
或者使用本机flex方法:

protected function onZoom(e:TransformGestureEvent, img:Image):void
    {
    img.transformAround(new Vector3D(e.localX, e.localY, 0), new Vector3D(img.scaleX*e.scaleX, img.scaleY*e.scaleY, 0));
    }

我使用了DynamicRegistration类,如果您仍然感兴趣,可以这样工作:

protected function onZoom(e:TransformGestureEvent, img:Image):void
{
    DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleY);
}
或者使用本机flex方法:

protected function onZoom(e:TransformGestureEvent, img:Image):void
    {
    img.transformAround(new Vector3D(e.localX, e.localY, 0), new Vector3D(img.scaleX*e.scaleX, img.scaleY*e.scaleY, 0));
    }

没有人遇到过这个问题吗?或者有没有更简单的方法在任何给定点缩放图表?我知道GestureWorks对此有一个可用的API,但是如果可能的话,我想避免购买许可证,因为我认为这个注册对于有经验的Flex/AS3开发人员来说不会有太大的影响。没有人遇到过这个问题吗?或者是有一种更简单的方法可以在任何给定点缩放图表吗?我知道GestureWorks对此有一个可用的API,但如果可能的话,我希望避免购买许可证,因为我认为这种注册对于经验丰富的Flex/AS3开发人员来说并不是什么大事。