# openfl.events.TouchEvent has no field getTouch

**URL:** https://community.haxe.org/t/openfl-events-touchevent-has-no-field-gettouch/4589
**Category:** Haxe
**Created:** [April 3, 2025, 9:10am UTC](https://community.haxe.org/t/openfl-events-touchevent-has-no-field-gettouch/4589 "2025-04-03T09:10:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![den256](https://avatars.discourse-cdn.com/v2/letter/d/35a633/32.png) [@den256](https://community.haxe.org/u/den256)
#### Post date: [April 3, 2025, 9:10am UTC](https://community.haxe.org/t/openfl-events-touchevent-has-no-field-gettouch/4589/1 "2025-04-03T09:10:16Z")

</div>

I am using openfl 9.4.1 Lime 8.2.2.

I wrote  
“private function onTouchMove(e:TouchEvent):Void {”  
“var touch:Touch = e.getTouch(stage);”

But when I compile it with openfl test neko, I get an error at the part

“var touch:Touch = e.getTouch(stage);”  
—openfl.events.TouchEvent has no field getTouch—

What do I need to do to resolve this error?

I would appreciate any wisdom you can give me.

---

<div class="post-metadata">

### Author: ![joshtynjala](https://community.haxe.org/user_avatar/community.haxe.org/joshtynjala/32/792_2.png) [@joshtynjala](https://community.haxe.org/u/joshtynjala)
#### Post date: [April 3, 2025, 4:00pm UTC](https://community.haxe.org/t/openfl-events-touchevent-has-no-field-gettouch/4589/2 "2025-04-03T16:00:54Z")

</div>

I looks like you may be mixing up OpenFL APIs and Starling APIs. Starling’s `TouchEvent` class has a `getTouch()` method that works that way. However, OpenFL’s `TouchEvent` class does not. While many parts of OpenFL and Starling have identical or very similar APIs, this is one place where the difference is a bit more pronounced.

This chapter from the OpenFL Developer’s Guide might help:

> **[Chapter 32: Touch, multitouch and gesture input · OpenFL Developer's Guide](https://books.openfl.org/openfl-developers-guide/touch-multitouch-and-gesture-input/)**

And the TouchEvent class in the OpenFL API Reference:

> **[openfl.events.TouchEvent - OpenFL API Reference](https://api.openfl.org/openfl/events/TouchEvent.html)**
>
> The TouchEvent class lets you handle events on devices that detect user
> contact with the device (such as a finger on a touch screen). When a user
> interacts with a device such as a mobile phone or tablet with a touch
> screen, the user typically touches...
