Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 11
Registered: ‎04-01-2008
My Device: Not Specified

TouchEvent

Has anyone had any success with TouchEvents?

 

I'm trying this sort of thing off of the main sprite from the HelloWorld demo app:

 

{

...

   addEventListener(TouchEvent.TOUCH_MOVE,_touchMove);
   addEventListener(TouchEvent.TOUCH_BEGIN,_touchBegin);
   addEventListener(TouchEvent.TOUCH_END,_touchEnd);

...

}

 

        private function _touchBegin(event:TouchEvent):void
        {
             // Handle it
        }

        private function _touchMove(event:TouchEvent):void
        {
            // Handle it
        }

        private function _touchEnd(event:TouchEvent):void
        {
            // Handle it           
        }

 

But my touch handlers never seem to get invoked.  MousEvent.CLICK does seem to work okay.

 

Any help is appreciated.  Thanks.

 

 

Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: TouchEvent

If you don't need multi-touch, you should stick with regular mouse events. They're easier on the CPU.

 

But, if you do want multi-touch, do this:

 

Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT;

New Contributor
Posts: 2
Registered: ‎11-12-2010
My Device: Not Specified

Re: TouchEvent

This doesn't work. Touch events don't work for me either. Only mouse events. You can't do multi-touch with a mouse.

 

This is worse than android development.

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: TouchEvent

they haven't released a way to perform multi touch gestures on the simulator yet. its still in the beta stages. so for now just stick to single mouse movements. if you were to incorporate the multi touch APIs they may or may not work because you cant properly test them out yet to know for sure.

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
New Developer
Posts: 24
Registered: ‎10-25-2010
My Device: Not Specified

Re: TouchEvent

[ Edited ]

I'm trying to build a PivotView Custom Control (Similar to WinPhone7 UI) using Flex/AS3 for use on Android and the Playbook - but I'm having similar issues. IT appears that the TouchEvent.TOUCH_END event is not being fired on my Scroller. am I doing something wrong? I would like to capture the instant that the user releases the screen.

 

Example Code -- 

 

 

viewScroller.addEventListener(TouchEvent.TOUCH_END, onViewContainerUserScrollEnd);

..
<s:Scroller id="viewScroller" height="100%" width="100%">
    <s:HGroup id="viewContainer" gap="0" height="100%"/>
</s:Scroller>

 

 

 

Any help would be appreciated.

 

New Developer
Posts: 14
Registered: ‎12-01-2010
My Device: Not Specified

Re: TouchEvent

When do you expect TouchEvents to be supported?  I'm planning to add a Multi-touch app to App World for the initial Playbook release.  I will need to be able to test it in some way prior to release.  It works fine on my Android device, but I would like to test it on Playbook as soon as possible.

 

I assuming we will not receive our Playbook hardware early enough to test much prior to release.

 

Thanks,

Don

 

Don Kerr
Manager, Space City Adobe User Group
www.spacecityaug.com
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: TouchEvent

I would plan on being conservative in what will be available in a month.  We're getting close to a critical point of time where final features and testing is pushing up against Early January availability of App World for PB.  We also have to assume that initial submissions will probably be rejected because of criteria that is still being formed.  Then we all will need to scramble to make adjustments to re-submit to be eligible for the free PB.

 

If you can get away with multi-touch, since that is untestable in the current simulator, I would either assume your code will work on a PB or pullback and not have it in your first release.

 

If you get your app accepted early in the App World process, and the PB has not been officially released yet, then you will have time for improvements when new updates to the simulator are available.  I really doubt any PB will be sent out prior the official release, so we are depended on simulator updates which have yet to occur.

New Developer
Posts: 38
Registered: ‎12-01-2010
My Device: Playbook

Re: TouchEvent

It would be nice if there was a list of features to be added to the Simulator in December? e.g. orientation, touch, etc.  But, my guess is multi-touch simulation would not be high on their priority list for the beta.

 

I have one app that is all multi-touch and must have multi-touch.  I can test using Android, since I'm using Flex Mobile Framework, since I'm told Flex Mobile will be supported.

 

I do have other Android apps I could port over as backup, but a 30-60 roadmap for the simulator would be nice to see.

 

Don

 

Don Kerr
Manager, Space City Adobe User Group
Houston, Tx
www.spacecityaug.com
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: TouchEvent

I am certain BB has such a roadmap, but they have been very tight lip about anything regarding schedule, features, API support, on this forum.  I am certain their premier partners have access to this information.  With the lack of information, you're probably going to have to wing it.

 

If I had to guess, we would see a simulator update mid-month to allow anyone to have any kind of chance to get multi-touch (+ fill in the blank) tested in time for a mid-January release onto App World.

 

Now that all we know that PB will be commercially released "early 2011", that would typically mean in the first quarter (no later than March 2011).  So if you're not in App World by mid to late January, then you're rolling the dice (for the free PB).

Developer
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)
My Carrier: Rogers

Re: TouchEvent

As touch events are not currently supported, I have been setting all my event listeners as MouseEvent.CLICK or ListEvent.ITEM_CLICKED, but am curious if this will translate to the playbook as there won't be any mouse input...

 

Will all click events needed to be changed to TouchEvent.TOUCH_TAP so they will work on the device?

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -