Are Mouse Events Equivalent to the Touch Events in Adobe AIR for Android
I mean can i use use CLICK instead of TAP .
MOUSE_DOWN and MOUSE_UP for SWIPE.
I am building an Android App in Flash(cs6) . Is it necessary to use TOUCH events
No is not necessary, if you need only to track 1 "input/finger" at time you can use MouseEvents.
TouchEvents have been created to handle multiple "input" at the same time.
Related
I was wondering if I could use several events on one display table, like several custom events, touch events and enterFrame events.
If so, what are the restrictions? can I trigger an event inside an event response function?
As far as I know you can use an event inside event response function but it depends on what do you want to achieve for example an enterFrame can be trigger by a touch eventListener but some eventListener will need to complete it's function in order to trigger another eventListener like targeted events or collision event.
I haven't personally used all the events and listener so a may not cover all the restriction of it but you can refer to this link to know event and listener.
I achieved that in one of my projects. I used collision and touch event together and it worked great. So I assume that you can use events togetger. And also because of event structure its possible to triger one or more events together. ( Touching and colliding in the same time ). But I dont recommend to use enterFrame event with other events, because of performance issues
I needed to send a simulated touch event when a user pressed the menu button on an android device, and I was able to use dispatchEvent within the touch event handler
http://docs.coronalabs.com/api/type/EventListener/dispatchEvent.html
I have submit button. When I do click or tap below a submit button, it should be able to recognize the gesture by programmatically in android. How could I do this?
Do I need to download anything based on Gestures? Else what should I do for this Gestures?
And, like a Gesture point- If I draw a line using Gesture concept or anything, gesture should perform its actions . After I draw a line, it should be able to open another screen. It must be able to display the last page.
maybe you need this android gestures.
To get information with regard to creating Gesture application at http://androidresearch.wordpress.com/2012/01/10/working-with-gesture-api-in-android/
What is the best way to touch two buttons at the same time? I am working on an app that has buttons, like a D-pad and a jump button, to move your character around. Right now I am just using normal buttons and handling them with an OnClickListener. I am having problems when I am running and need to jump at the same time, or if I am running to the right, then want to go left without having to pick my finger up. I know this is possible because it works greats on game like Sonic CD and some others. Any help would be greatly appreciated.
OnClick fires only on release. Instead use the touch event handlers so that when they touch occurs, you get the events. However, note that not all devices have multitouch, and thus not all of them will be able to handle the double-touch case correctly. They will provide touch events, but not two of them. Also note that you may receive multiple "pointers" within a touch event, and will have to decide which is "yours" for each button if that matters.
Hello i make appliction like Drum Studio. I need make support for touch more one button at once. For example: User touch button1(AND HOLD IT!) it play sound, but user still hold its, user click another button and it play sound too. How make it programmatically? By default onTouch or onClick use, if 1 button pressed, another buttons not react before button isn't released.
Use the onKeyDown() events to trigger each response and onKeyUp() events to finish them.
http://developer.android.com/reference/android/view/KeyEvent.html
http://developer.android.com/reference/android/view/KeyEvent.Callback.html
For touchs, you can use the OnTouchListener
http://developer.android.com/reference/android/view/View.OnTouchListener.html
and determine the kind of touch by the MotionEvent:
http://developer.android.com/reference/android/view/MotionEvent.html
To clarify my response: To make a sound while holding one button, you can start the sound when the ACTION_DOWN action in the MotionEvent event is triggered and stop it with the ACTION_UP action of the same event.
Create a class extending View where you're holding all your buttons.
Override the onTouchEvent vor that class.
Switch between the different actions.
Use event.getX() and event.getY() to figure out where the touch event was originated.
Check which button is located at that position
Play the sound accordingly.
You cannot touch two separate Views at the same time, even if multi-touch is supported on your device. If you touch Button1 first, all subsequent MotionEvents (including ones with separate pointer IDs) are bound to that View.
Unless you're using a dedicated game engine like AndEngine that has this sort of functionality built in, your only option is to capture all the MotionEvents yourself (most easily with an empty ImageView covering your entire screen) and route them to the appropriate Views based on their screen coordinates. This can get tricky, especially with multiple touch pointers, but the Android UI framework does not natively support the kind of multi-touch you require.
You definitely want to be using Android 2.0 or higher - previous versions don't support multitouch.
Check the pid in your onTouch - 0 is a single touch, 1 is the second.
Hi Here i want to solve the problem regarding multitouch in android. Is this possible to fire events of 2 buttons together if this is possible then how can i do this. please help regarding this. In my game application i want to do something after pressing two buttons together. How can i do this.
I don't think that it is possible to aggregate two events to a single one oob. But it shouldn't be to hard to determine if two buttons were pressed simultaneously by using a OnTouchListener you bind to the parent element of the two buttons.
When an event is thrown and the onTouch() method is called. You got a bunch of arguments related to the event, like what kind of event it was (Action_Down, Action_Move, Action_Up etc.). You also get the information if the action was performed by the first oder by the second finger so this should give you the option to decide whether both buttons were touched.
Here you can find a nice tutorial about multi touch support on Android.