# Mouse Problem

**URL:** <https://forum.kirupa.com/t/mouse-problem/194147>\
**Category:** programming\
**Created:** [July 20, 2006, 8:34pm UTC](https://forum.kirupa.com/t/mouse-problem/194147 "2006-07-20T20:34:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)\
**Post date:** [July 20, 2006, 8:34pm UTC](https://forum.kirupa.com/t/mouse-problem/194147/1 "2006-07-20T20:34:41Z")

</div>

Hey I’m trying to get a mouse function working, but it doesn’t seem to work… It’s a bit messy coding, but it’s a straight foward goal. I’m trying to make it so that the animation responds to a “onMouseDown” function. However, I want it so that while the mouse is down the animation will run. Yet, if the mouse is down only until it reaches say 3 it stops and goes back to frame 1 of the animation w/o reaching 4. So basically it continues the animation until the user releases the mouse btn.

I have this code…

```php
clickme.onMouseDown = function(){
        clickme.gotoAndPlay("click");
        trace("clicked");
    }

```

Here’s a preview of what I reached so far.  
[http://img291.imageshack.us/my.php?image=helpmepw9.swf](http://img291.imageshack.us/my.php?image=helpmepw9.swf)
