Movie Clip更改XML中的坐标

时间:2014-12-12 17:44:24

标签: xml actionscript-3 flash animation movieclip

我从时间轴中复制了这个xml:

private function move(function_mc:MovieClip, cx:Number, cy:Number){
        var move_xml:XML = <Motion duration="40" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
                <source>
                    <Source frameRate="24" x="0" y="0" scaleX="1" scaleY="1" rotation="0" >
                        <dimensions>
                            <geom:Rectangle left="0" top="0" width="23" height="23"/>
                        </dimensions>
                        <transformationPoint>
                            <geom:Point x="0" y="0"/>
                        </transformationPoint>
                    </Source>
                </source>

                <Keyframe index="0" tweenSnap="true">
                    <tweens>
                        <CustomEase>
                            <geom:Point x="0.2308" y="1"/>
                            <geom:Point x="0.9524" y="0.9524"/>
                        </CustomEase>
                    </tweens>
                </Keyframe>

                <Keyframe index="39" x={cx} y={cy} />
            </Motion>;

            move_animator = new Animator(move_xml, function_mc);
            move_animator.play();
}

当我点击特定按钮时,我想要将此功能用于更多影片剪辑。但是每个影片剪辑都有不同的开始和结束坐标。我尝试发送cxcy,例如cx = 20, cy = 0,但每次点击按钮时,它只会在x轴上移动影片剪辑。但我想在坐标x=20y=0上发送影片剪辑。当我再次点击相同的按钮时,它将保持在x=20y=0。有什么方法可以做到吗? 或者任何其他解决方案,如何重用不同影片剪辑的动画并将它们发送到不同的坐标? 谢谢你的帮助。

0 个答案:

没有答案