Gestouch icon indicating copy to clipboard operation
Gestouch copied to clipboard

air error

Open bluelemonade opened this issue 10 years ago • 6 comments

hello,

I swtich a project from an exe to an air desktop app.

now I get this error:

if (!target && !altTarget) { throw new Error("Not touch target found (hit test)." + "Something is wrong, at least flash.display::Stage should be found." + "See Gestouch#addTouchHitTester() and Gestouch#inputAdapter."); }

where's my fault. I added nativeInputAdapture(this.stage, true,true) without this everything ist fine, but I want to use the mousevents to move things...

regards

bluelemonade avatar May 28 '15 15:05 bluelemonade

Seems like you use it with Starling? Add also

Gestouch.addTouchHitTester(new NativeTouchHitTester(stage));

Strange though, why did it appear only when switching from exe to air.

Ehhh I should remove that semi-automatic initialization and specify that you (user) should initialize everything explicitly, manually...

fljot avatar May 28 '15 20:05 fljot

hello,

my information was a bit confusing. I didn't use starling. I have normal MOUSE_DOWN events on a few buttons. I get the errors on these buttons. I also have a MOUSE_DOWN event on the stage, to do some things for logging.

I got the error only on these events, I could move the clips with the Gestouch event with the mouse, whene using the gestures the scaling and rotation is working but not the right way.

thanks...

bluelemonade avatar May 29 '15 08:05 bluelemonade

So, didn't my advice help??

fljot avatar May 29 '15 08:05 fljot

when using the TouchHitTester I get this

throw new Error("Display list adapter not found for target of type '" + getQualifiedClassName(target) + "'.");

bluelemonade avatar May 29 '15 08:05 bluelemonade

Okay.. just to make it clear for you and to anyone who could read this:

  1. (Entry point – when mouse/touch event happened) Input adapter was not able to find any touch target. It happened because there was no entity specified to do that (touch hit tester). I had some semi-intelligent automatic way to initialize those when working with old good DisplayObjects, but apparently it's more of confusing situation, when something is done manually (you created input adapter yourself).
  2. Now that you've added touch hit tester – touch object has target now. But it couldn't find suitable display list adapter to get the hierarchy of objects (think of regular old good Display List) to analyze stuff. Again, if we talk about automatic stuff – it would be registered-initialized when you create a gesture for some DisplayObject. Again, semi-intelligent-semi-stupid = apparently confusing when things don't go well automatically.

So to fix this just write

// flash.display.DisplayObject
Gestouch.addDisplayListAdapter(DisplayObject, new NativeDisplayListAdapter());

Sorry for confusion and thank you for bringing attention to this. I should remove that semi-automatic-"helpful" stuff.

fljot avatar May 29 '15 15:05 fljot

Or I could simply do nothing, if touch target is not found – what's the point anyway, if you haven't added anything for Stage – you're probably not interested in that anyway... Ah yeah, total amount of touches might be useful. So yes, I should remove semi-automatic stuff and explain that everything must be initialized manually (it's not hard anyway).

fljot avatar May 29 '15 15:05 fljot