1

I have this xml copied from timeline:

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();
}

What I want is to use this function for more movie clips, when I click specific button. But every movie clip has different start and end coordinates. I was trying send cx and cy, for example cx = 20, cy = 0, but every time I clicked on button, it only moves the movie clip in the x-axis. But I want to send the movie clip on coordinates x=20 and y=0. And when I click the same button again, it will stay on x=20 and y=0. Is there any way how to do it? Or any other solution, how to reuse animation for different movie clips and send them to different coordinates? Thank you for your help.

Vsevolod Goloviznin
  • 12,074
  • 1
  • 49
  • 50
barbaresco
  • 11
  • 1

0 Answers0