# How to make a tree button sequence

**URL:** <https://forum.kirupa.com/t/how-to-make-a-tree-button-sequence/266237>\
**Category:** flash\
**Created:** [July 17, 2008, 3:03pm UTC](https://forum.kirupa.com/t/how-to-make-a-tree-button-sequence/266237 "2008-07-17T15:03:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![armen\_shlang](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@armen\_shlang](https://forum.kirupa.com/u/armen_shlang)\
**Post date:** [July 17, 2008, 3:03pm UTC](https://forum.kirupa.com/t/how-to-make-a-tree-button-sequence/266237/1 "2008-07-17T15:03:47Z")

</div>

Hey all,  
Im a newbee, and im trying to make a single button that when the mouse is hovering over it, it will play and loop. And when mouse is away ot will stop.  
The i have setup is in my mouse movieclip I included the stop(); script.  
I make a button class with this code

```auto

package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    
    public class CircleButton extends MovieClip
    {
        public function CircleButton()
        {
            this.buttonMode = true;
            this.addEventListener(MouseEvent.MOUSE_OVER, onHover);
        }
        
        private function onHover(event:MouseEvent):void
        {
            this.play();
        }
    }
}

```

and linked it to my button. Now the problem is, i want it to keep looping while the mouse is on it. How Can i doo that?  
Thank you.
