# Touch events slowing display in air android

**URL:** <https://forum.kirupa.com/t/touch-events-slowing-display-in-air-android/320874>\
**Category:** Uncategorized\
**Created:** [April 4, 2011, 2:40pm UTC](https://forum.kirupa.com/t/touch-events-slowing-display-in-air-android/320874 "2011-04-04T14:40:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinyflea](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@tinyflea](https://forum.kirupa.com/u/tinyflea)\
**Post date:** [April 4, 2011, 2:40pm UTC](https://forum.kirupa.com/t/touch-events-slowing-display-in-air-android/320874/1 "2011-04-04T14:40:02Z")

</div>

I’m still having some problems understanding these touch events…or maybe something else…can anyone enlighten me as to what i’m doing wrong in this code?? Only left as1&2 to go to 3 recently so I’m sure I have bad habits and misconceptions but…

In the IDE i have a button on the stage called: “touchBtn”  
and a textfield called “timer”

the problem i have is that if i touch the button fast / lots, the display rate really slows down…I know this is down to something I’m doing totally wrong but not sure what…

all help and ridicule appreciated.

tinyflea

package {

```
import flash.display.MovieClip;
import flash.events.TouchEvent;
import flash.events.Event;    
import flash.utils.*;

public class dotty extends MovieClip {

```

public function dotty() {  
touchBtn.addEventListener(TouchEvent.TOUCH\_BEGIN, TouchBegin);  
touchBtn.addEventListener(TouchEvent.TOUCH\_END, TouchEnd);

```
        var theTime:int = 0;
        var Ypos:int=0;

```

function TouchBegin(event:TouchEvent):void{  
Ypos=mouseY;  
}  
function TouchEnd(event:TouchEvent):void{  
Ypos=mouseY;  
}

addEventListener(Event.ENTER\_FRAME,myFunction);

function myFunction(event:Event) {

```
theTime=getTimer();
timer.text=String(theTime);

```

}  
}  
}

}
