# How can we make a mouse Down event Repeat?

**URL:** <https://forum.kirupa.com/t/how-can-we-make-a-mouse-down-event-repeat/326234>\
**Category:** flash\
**Created:** [November 30, 2011, 10:36pm UTC](https://forum.kirupa.com/t/how-can-we-make-a-mouse-down-event-repeat/326234 "2011-11-30T22:36:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TalonStart](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@TalonStart](https://forum.kirupa.com/u/TalonStart)\
**Post date:** [November 30, 2011, 10:36pm UTC](https://forum.kirupa.com/t/how-can-we-make-a-mouse-down-event-repeat/326234/1 "2011-11-30T22:36:26Z")

</div>

As the title says…

Lets think about this, i seen some tutorials, but lil confused upon them.

Lets take example, We want to move the our player Upwards.

(“here’s a working code”)… But you gotta continue to click click click, or roll off roll on  
and the player will move, i promise…

the deal is, who the hell wants to do that???  
so heres the code…

Button.as

```auto

package {
    
    
    import Engine;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import Ship;
    import flash.display.Stage;
    import flash.events.TouchEvent;
    
    
    public class button2 extends MovieClip {
        
        private var stageRef:Stage;
        private var ship:Ship;
        
        
        
        public function button2(stageRef:Stage,shipmc:Ship) 
        {
            ship = shipmc;
            btn3.addEventListener(MouseEvent.CLICK,move1);
        }
        
        private function move1(ent:MouseEvent):void
        {

            ship.moveUp();
        }
        
    }
    
}

```

Player.as

```auto

package 
{
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.display.Stage;
    import Engine;
    import buttons;
    import Missile;

    public class Ship extends MovieClip
    {

        //Set our Var.

        private var stageRef:Stage;
        private var speed:Number = 5;

        public function Ship(stageRef:Stage)
        {
            // constructor code

            this.stageRef = stageRef;
        }

        public function Shoot()
        {
            trace("shoot");
            stageRef.addChild(new Missile(stageRef, x+ 1, y - 10));

        }

        public function moveUp()
        {
          trace ("moving upward");
          this.y -=speed;
        }

    }

}

```

[COLOR=#ff0000]Note this is just my practice engine, where i test things, and try new things. (not an actual game or play).

Now, lets think… What can we do, to continue this mouse down / click… (doubtfully use click). .roll over maybe… … but we want that player to continue to move with out moves up 1 …click again moves up 1… yuck… thats pathetic… so any takers or ideas

Thanks,  
TalonStart

[/COLOR][COLOR=#000000][/COLOR]
