Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/MultitouchInputMode.html
Copy link to clipboard
Copied
Can someone plse Simplify a whole bunch of things for me?
my question: I heard from an Adobe page that you can use MouseDown on a bb Tablet. Can you use MouseDown for separate functions two buttons touched on the screen??? ?thnx, in advance
Copy link to clipboard
Copied
what's a "bb tablet"?
and your question is unclear. are you asking if two different buttons can use two different mousedown listener functions? (if yes, the answer is yes).
Copy link to clipboard
Copied
I really appr. your answer ! To this fragmented question lurking in the midst of these cyberseas. It got to me be4 the end of the second night! to clarify, I heard you can use MouseDown on (Blackberry Playbook, is bb tablet) as opposed to having to change all listeners on the actionscript file you can just keep your MouseDown listeners for screen touches. Presuming this is true, can the Blackberry Playbook handle two normal buttonobjects simultenously listeninging for just 'finger on button' events using only the mousedown methodiology?
Copy link to clipboard
Copied
yes, touch devices work well with MouseEvent.MOUSE_DOWN.
and yes, you can have multiple buttons listening for mousedown events. and yes, those buttons can check for simultaneous mousedown events.
one way to check for simultaneous mousedown events (and there are better ways especially if there might be more than 2 simultaneous events to check) is to use:
var btnsDownA:Array = [];
btn1.addEventListener(MouseEvent.MOUSE_DOWN,btnDownF);
btn1.addEventListener(MouseEvent.MOUSE_UP,btnUpF);
btn2.addEventListener(MouseEvent.MOUSE_DOWN,btnDownF);
btn2.addEventListener(MouseEvent.MOUSE_UP,btnUpF);
function btnDownF(e:MouseEvent):void}
if(btnsDownA.indexOf(e.currentTarget.name)==-1){
btnsDownA.push(e.currentTarget.name);
if(btnsDownA.length==2){
// do whatever - simultaneous mousedown events.
}
}
}
function btnUpF(e:MouseEvent):void}
if(btnsDownA.indexOf(e.currentTarget.name)>-1){
btnsDownA.splice(btnsDownA.indexOf(e.currentTarget.name),1);
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now