"copy to as3 script" question

Hi everyone,

This is my first post but it’s been a while since the making of my website drives me crazy.

Here’s one of my 1000 problems :

I made a motion on my timeline with a movie clip.
The animation begins when a button is clicked. (bacically playing to the next page)

In order to re-use it, and to reduce my fla size, i used the “copy tween to as3 script” function.
I put it in my actions panel.
It works fine except that the animation begins right away and not on click

What should I add to the code, in order to make the animation begins only when the button is clicked, like it was back then ?

It seems that I should make my animator listen to the button click so it knows when to start.
Or something like “if the button isn’t clicked you don’t play the motion” or “else you play it”

But i’m a newbie and a dumby one…

Thanks for your help.


Here’s my code :


reel_mc.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void {

import fl.motion.Animator;
var central_mc_xml:XML = <Motion duration="65" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
        <Source frameRate="25" x="511.55" y="376.3" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="typomc">
                <geom:Rectangle left="0" top="0" width="338.4" height="67.6"/>
                <geom:Point x="0.4992612293144208" y="0.5096153846153847"/>

    <Keyframe index="0" tweenSnap="true" tweenSync="true">
            <SimpleEase ease="0"/>

    <Keyframe index="64" x="0.25" y="-300.65"/>

var central_mc_animator:Animator = new Animator(central_mc_xml, central_mc);