I'm working on a Flash as3 project and need to detect a pinch (move two fingers toward each other )
does this gesture supported in as3 ?
how can i make something similar to it ?
it isn't supported in ِAS 3 but you can use drag and drop with animation of your object
ob.stop(); // at beginning
ob.play(); // when start drag
Related
I am using Forge viewer on mobile device.
Default Forge viewer is rolling on mobile device when moving to a position using pinch gesture.I research how to fix the roll (reference to Fixing pinch-zoom in Forge viewer applications - Through the Interface, GitHub - wallabyway/forge-pinch-zoom: customized iPad/IPhone/Android pinch zoom touch controls for ForgeViewer), but it is missing default 3D control. For example, it's missing pan motion when I use two-finger gesture. I want to fix the roll without missing the default 3d control. How do I do it?
I have tried to disable to rotate gesture in GestureHandler. (gestureHandler.setGestureParameter(); )
I have checked to invalidate pinch gesture correctly; gestureHandler.setGestureParameter('pinch', 'enable', false)
But I have checked that it is still valid to roll, regardless if the enable is false; gestureHandler.setGestureParameter('rotate', 'enable', false).
let orbit = viewer.impl.controls.getActiveTool()
let gestureHandler = orbit.controller.getActiveTools()[2]
gestureHandler.setGestureParameter('rotate', 'enable', false)
I have another question.
It emits the pinch event after I pinch gesture. I understand this behavior.
It is not emitting the roll event after I do the roll gesture while doing the pinching gesture. I can't understand this behavior.
Maybe there are the multiple methods controlling the camera roll. I can't figure out the method to control the roll on mobile device anywhere.
I am working on a Drag and Drop game in AS3.
How to reset its positions when a new game starts?
I am not good at English T T
well its highly depended on how you're game is developed but an easy way is to have an array on the document class that contains all the positions and initialize the position when beginning a new game
I want to disable the swipe gesture for my android flash based game so it doesn't cause you to jump to the next or previous frame.
Thanks.
Set the Multitouch.inputMode = MultitouchInputMode.NONE at the point in your program where you want it disabed.
If I set Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; will there still be dispatched a MouseEvent.CLICK when the users tabs? or will there ONLY be dispatched a TouchEvent.TOUCH_TAP event ?
(on a multitouch supported device)
Actually, mouse events are dispatched in this case for the first point of contact. That's how UI elements not suited for touch input continue to work on touch devices.
At least MOUSE_DOWN and MOUSE_UP are dispatched right after TOUCH_BEGIN and TOUCH_END which is very annoying sometimes.
Finally found the answer to this, sorry Stackoverflow, wasn't trying to spam!
MultitouchInputMode.TOUCH_POINT: Use this mode if you are interested only in touch events and no mouse or gesture events. You can use this mode to synthesize your own gestures if you want to support gestures that are not supported by the runtime, or if you need to support both multitouch and gestures. (http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html)
In case anyone else finds the native touch implementation falls short there is also the following which may be worth looking into:
Gestouch: NUI gestures detection framework for mouse, touch and multitouch AS3 development.
Gestouch is a ActionScript library/framework that helps you to deal with single- and multitouch gestures for building better NUI (Natural User Interface).
https://github.com/fljot/Gestouch
Today I wanted to add mouse-driven zoom and pan functionality to a pure AS3 project - something like the Google Maps interface. I was surprised that I couldn't find a good package or library to do this already - I'm using FlashDevelop rather than Flash CS3, so the nice VCam tool available as an FLA is no use.
There's nothing very complicated involved in implementing zoom/pan, although it can be fiddly and time-consuming to get right, but since zooming and panning are pretty common things to want to do I wondered if anyone could suggest a 'correct' way to do this in the Flash world, or a good library available that I haven't been able to find.
I found exactly what I was looking for in the flare library's PanZoomControl:
Interactive control for panning and
zooming a "camera". Any sprite can be
treated as a camera onto its drawing
content and display list children. To pan and zoom
over a collection of objects, simply
add a PanZoomControl for the sprite
holding the collection.
var s:Sprite; // a sprite holding a collection of items
new PanZoomControl().attach(s); // attach pan and zoom controls to the sprite
The mouse controls are also implemented as you'd expect:
Once a PanZoomControl has been
created, panning is performed by
clicking and dragging. Zooming is
performed either by scrolling the
mouse wheel or by clicking and
dragging vertically while the control
key is pressed.
You could use a 3D library such as Papervision3D or FIVe3D. Then just move your camera based on different mouse events/gestures. Or use the built in z-axis in FlashPlayer 10 to get the zoom effect.