Author Topic: Gestures in Flare  (Read 174 times)

Fello Muz   «   on: May 25, 2012, 07:52:01 PM »
Hello,
do gesture events like TransformGestureEvent.GESTURE_ROTATE work in Flare3D when on mobile?

Delnatte Julien   «   Reply #1 on: May 26, 2012, 07:13:49 AM »
Yes. 
I made a test on an iPhone and an IPad with this gesture and it works very well. 
I don't know why that couldn't work with flare3d. It's independant but you have to code the relation between the gesture and the action on the stage

Fello Muz   «   Reply #2 on: May 27, 2012, 06:12:26 AM »
Thx for reply.
And how to code that?
On the one hand I have for the gesture:

Multitouch.inputMode = MultitouchInputMode.GESTURE;
addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate);
function onRotate(){
...
}

On the other hand, in Flare3D code examples I found:
if ( Input3D.keyDown( Input3D.LEFT ) ) car.rotateY( -3 );
if ( Input3D.keyDown( Input3D.RIGHT ) ) car.rotateY( 3 );

Whats the solution for the code? What to use instead of Input3D?


Delnatte Julien   «   Reply #3 on: May 27, 2012, 06:35:33 PM »
use the AS3 Reference from Adobe for TransformGestureEvent and you'll found that the transformGestureEvent return the rotation :
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/events/TransformGestureEvent.html

So :








stage.addEventListener(TransformGestureEvent.GESTURE_ROTATE,onRotation);







private function onRotation( event:TransformGestureEvent ):void
{
     car.rotateY( event.rotation );
}

Fello Muz   «   Reply #4 on: May 28, 2012, 07:35:03 AM »
Ok, I will try.
Thank you :)

Fello Muz   «   Reply #5 on: May 31, 2012, 06:16:52 AM »
Hi there,
now I tried, well it works, but the rotation is not very smooth. The cam jumps to another view because the rotation is to fast.
How can the rotation be smoothend?

Delnatte Julien   «   Reply #6 on: May 31, 2012, 12:02:45 PM »
Just scale the rotation returned by the transformGestureEvent:

stage.addEventListener(TransformGestureEvent.GESTURE_ROTATE,onRotation); private function onRotation( event:TransformGestureEvent ):void
{
     car.rotateY( event.rotation/10 );