# (Probably Simple) AS3 Mouse Clicks

**URL:** https://forum.kirupa.com/t/probably-simple-as3-mouse-clicks/289018
**Category:** Uncategorized
**Created:** [May 25, 2009, 8:34am UTC](https://forum.kirupa.com/t/probably-simple-as3-mouse-clicks/289018 "2009-05-25T08:34:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![FightThePurple](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@FightThePurple](https://forum.kirupa.com/u/FightThePurple)
#### Post date: [May 25, 2009, 8:34am UTC](https://forum.kirupa.com/t/probably-simple-as3-mouse-clicks/289018/1 "2009-05-25T08:34:25Z")

</div>

Hi, I have this code written for a game im making, but the problem is that the function ‘jump’ is only run when the mouse is clicked over the movie clip “grape1”

I cant work out for the life of me why. Please help!

```auto
var MyArray = new Array

this.addEventListener(Event.ENTER_FRAME, keepRunning);
this.addEventListener(MouseEvent.CLICK, jump);

function keepRunning(event: Event) {
    moveCurrent();
}

function moveCurrent() {
    var speed = 12
    var DiffY = mouseY - grape1.y 
    var DiffX = mouseX - grape1.x
    
    var myRadians = Math.atan2(DiffY,DiffX);
    var myDegrees = Math.round((myRadians * 180) / Math.PI)
    
    var yMove = DiffY / speed
    var xMove = DiffX / speed

    grape1.y += yMove;
    grape1.x += xMove
    grape1.rotation = myDegrees+90; 

}

function jump(event: Event) {
    trace("F2")
}

```
