Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

air error #86

Open
bluelemonade opened this issue May 28, 2015 · 6 comments
Open

air error #86

bluelemonade opened this issue May 28, 2015 · 6 comments

Comments

@bluelemonade
Copy link

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

@fljot
Copy link
Owner

fljot commented May 28, 2015

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...

@bluelemonade
Copy link
Author

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...

@fljot
Copy link
Owner

fljot commented May 29, 2015

So, didn't my advice help??

@bluelemonade
Copy link
Author

when using the TouchHitTester I get this

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

@fljot
Copy link
Owner

fljot commented May 29, 2015

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
Copy link
Owner

fljot commented May 29, 2015

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants