fljot / Gestouch

Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.
MIT License
355 stars 85 forks source link

How can I use gestouch in starling2 and normal swf file with together ? #104

Open yooni126 opened 6 years ago

yooni126 commented 6 years ago

I used gestouch in a normal swf file. also I used gestoch in my starling 2 app with these codes:

Gestouch.inputAdapter = new NativeInputAdapter(stage); _starling2TouchHitTester = new Starling2TouchHitTester(); Gestouch.addTouchHitTester(_starling2TouchHitTester, -1); Gestouch.addDisplayListAdapter(DisplayObject, new StarlingDisplayListAdapter());

Now I want to load my swf file with nativeOverlay in starling2 with this code:

_mLoader = new Loader(); var mRequest:URLRequest = new URLRequest("drawer.swf" + "?nf=" + getTimer()); _mLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, onCompleteHandler); _mLoader.load(mRequest); private function onCompleteHandler(loadEvent:flash.events.Event):void { var _designMain:object = loadEvent.target.loader.content; }

but when i load it , I have this error:

ReferenceError: Error #1065: Variable NativeDisplayListAdapter is not defined. at org.gestouch.core::Gestouch$/org.gestouch.core::gestouch_internal::createGestureTargetAdapter() at org.gestouch.gestures::Gesture/set target() at org.gestouch.gestures::Gesture() at org.gestouch.gestures::AbstractContinuousGesture() at org.gestouch.gestures::TransformGesture() at Main()[E:\Flash\Drawer_Mobile\Main.as:277]

Now this is my question : How can I use gestouch in starling and normal swf file with together ?

fljot commented 6 years ago

I'm not really dealing with Flash much anymore, so can't really investigate much, sorry... But here's what's on top: Seems like you're working with some master branch version. There's nothing complicated inside, look https://github.com/fljot/Gestouch/blob/master/src/org/gestouch/core/Gestouch.as it somehow can't find that class in runtime, so maybe it's something with the way you build those swfs. Are you sure you're using same version of Gestouch in both swfs?

Can you maybe switch to using code from develop branch with a small configuration change (https://github.com/fljot/Gestouch/blob/develop/CHANGELOG.md)