# Functions and doing things per frame

**URL:** <https://forum.kirupa.com/t/functions-and-doing-things-per-frame/133550>\
**Category:** Uncategorized\
**Created:** [January 9, 2005, 10:30pm UTC](https://forum.kirupa.com/t/functions-and-doing-things-per-frame/133550 "2005-01-09T22:30:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlashman](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Phlashman](https://forum.kirupa.com/u/Phlashman)\
**Post date:** [January 9, 2005, 10:30pm UTC](https://forum.kirupa.com/t/functions-and-doing-things-per-frame/133550/1 "2005-01-09T22:30:52Z")

</div>

Okay… I have this actionscript:

```auto
 onClipEvent(enterFrame){
 var select = function(number) {
  var goto = number * 28 + 70
  if(this._y != goto){
  this._y += (goto-this._y)/3 + 1}}
}
on (release){
 select(3)} 

```

It is to make this button go down quickly and the go slower until it stops. However, my problem is that when I press it, it does just one frame of what I want it to do, and I must click it many more times to get it to work… so how do I get it to do it each time a frame goes by?
