Copy link to clipboard
Copied
Has anyone else noticed that the GesTouch library is broken in AIR 16?
Touch seems to be completely unresponsive. Works fine in AIR 15.
I need to update my app for the 64 Bit support and Gestouch is broken
Copy link to clipboard
Copied
AIR 16 defaults to uselegacyaot = no. Not even sure if it can use the old compiler. See this discussion, maybe there's something in there that could help:
Doesn't work with '-useLegacyAOT no' · Issue #75 · fljot/Gestouch · GitHub
Copy link to clipboard
Copied
I noticed someone said.. but I only have a GesTouch.swc .. how can I make these changes ?
My solution:
in org.gestouch.core.GestureState i changed:
"public static const POSSIBLE:GestureState = new GestureState("POSSIBLE");
public static const RECOGNIZED:GestureState = new GestureState("RECOGNIZED", true);
public static const BEGAN:GestureState = new GestureState("BEGAN");
public static const CHANGED:GestureState = new GestureState("CHANGED");
public static const ENDED:GestureState = new GestureState("ENDED", true);
public static const CANCELLED:GestureState = new GestureState("CANCELLED", true);
public static const FAILED:GestureState = new GestureState("FAILED", true);"
to:
"private static var cls:Class = GestureState;
public static const POSSIBLE:GestureState = new cls("POSSIBLE") as GestureState;
public static const RECOGNIZED:GestureState = new cls("RECOGNIZED", true) as GestureState;
public static const BEGAN:GestureState = new cls("BEGAN") as GestureState;
public static const CHANGED:GestureState = new cls("CHANGED") as GestureState;
public static const ENDED:GestureState = new cls("ENDED", true) as GestureState;
public static const CANCELLED:GestureState = new cls("CANCELLED", true) as GestureState;
public static const FAILED:GestureState = new cls("FAILED", true) as GestureState;"
Copy link to clipboard
Copied
A swc is just zip file, you could uncompress it and then decompile the swf. But that then just gives you the source code that is on github anyway. And in there I can't find the lines that they are referring to. Perhaps they are lines that the poster created himself? If that's the case, the implication is that anywhere in your code where you say:
var whatever:GestureState = new GestureState("something");
you would change to:
var myclass:Class = GestureState;
var whatever:GestureState = new myclass("whatever") as GestureState;
I think the idea is to fool the compiler into giving you a the GestureState by pretending for a moment to be a generic Class.
Copy link to clipboard
Copied
I don't have anything like that in my code
I have this...
function createGestouch():void{
trace("New GesTouch Created");
transformGesture = new TransformGesture(mcHolder.mcImg);
matrix = mcHolder.mcImg.transform.matrix;
transformGesture.addEventListener(org.gestouch.events.GestureEvent.GESTURE_BEGAN, onGesture);
transformGesture.addEventListener(org.gestouch.events.GestureEvent.GESTURE_CHANGED, onGesture);
}
and this...
var imgInitialX:Number = 0;
var imgInitialY:Number = 0;
var imgInitialscaleX:Number = 0;
var imgInitialcaleY:Number = 0;
var imgInitialRotation:Number = 0;
var transformGesture:TransformGesture;
var matrix:Matrix;
function onGesture(event: org.gestouch.events.GestureEvent): void {
const gesture:TransformGesture = event.target as TransformGesture;
matrix = mcHolder.mcImg.transform.matrix;
// Panning
matrix.translate(gesture.offsetX, gesture.offsetY);
mcHolder.mcImg.transform.matrix = matrix;
if (gesture.scale != 1 || gesture.rotation != 0)
{
// Scale and rotation.
var transformPoint:Point = matrix.transformPoint(mcHolder.mcImg.globalToLocal(gesture.location));
matrix.translate(-transformPoint.x, -transformPoint.y);
matrix.rotate(gesture.rotation);
matrix.scale(gesture.scale, gesture.scale);
matrix.translate(transformPoint.x, transformPoint.y);
mcHolder.mcImg.transform.matrix = matrix;
////trace("Rotation = " + gesture.rotation);
}
}
Copy link to clipboard
Copied
Should have read his post more closely, he does say which class he change (org.gestouch.core.GestureState). That's where those lines exist.
When you're using a library that you have as a swc, I think you have the option of including the source AS files instead. You could remove the swc and put the org/gestouch files into your com folder, then make the changes to the lines in org.gestouch.GestureState.as.
Copy link to clipboard
Copied
I made those same changes already to the .as file. It didnt fix the problem.
Copy link to clipboard
Copied
Did you remove the swc?
Copy link to clipboard
Copied
yup.. removed and deleted completely.
Copy link to clipboard
Copied
I made some errors in the AS of the GestureState.as file as well to ensure that it's reading that file.
Copy link to clipboard
Copied
Could be worth joining in the github discussion, or raise a new issue about it failing with AIR 16.
Copy link to clipboard
Copied
By the way, does it also fail on Android?
Copy link to clipboard
Copied
Not sure .. this is an iOS only app
Copy link to clipboard
Copied
Grrr.. This is terrible. I was more concerned with the 4 Milkman Games ANE's that I updated and an Instagram ANE .. Everything else worked seamlessly with AIR 16 .. Looks like I'm stuck. Boo.
Copy link to clipboard
Copied
You have until June to be 64 bit for updates.
Copy link to clipboard
Copied
Ya .. I also have a new app that needs to be submitted though that uses GesTouch
Copy link to clipboard
Copied
Hi Applauz78,
Thanks to bring this to our notice. However I could not reproduce the issue on AIR16. I made 2 sample apps, one using text object, and another with an image, on the basis of code provided above. (Dropbox link of the flash builder project is attached).
Kindly give more information and try to run the same on your setup. It will be great if you provide a sample app for the same, with which you are able to reproduce the issue.
Thanks
Tushar