Search code examples
actionscript-3flashflash-cs6

Stop flash slides on mouse click


EDIT:

I'm creating a flash banner where I have several objects that come and go. In the end of my banner a contact form appears. I need the animation to stop when the users clicks on any of the input fields. How do I achieve this in Actionscript 3?


Solution

  • For each of your input fields add the following:

    _inputField.addEventListener(MouseEvent.CLICK clickHandler);
    

    Then add the following function:

    public function clickHandler(e:MouseEvent):void {
    stop();
    }
    

    The 'stop' assumes you're using the timeline as your animation. If the animation is contained in a MovieClip do something like the following:

    _containingMovieClip.stop();