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
Regular Contributor
Vemilyus
Posts: 54
Registered: ‎03-21-2011
My Carrier: WiFi
Accepted Solution

SWIPE_DOWN doesn't work

Hello again,

I want to create a top bezel menu for my app.

To achieve that I want to listen for the the QNXApplicationEvent.SWIPE_DOWN. Unfortunatelly that isn't dispatched. If I test the same code listening to a SWIPE_START event instead, it works perfectly.

Please help, I hope it's just a bug of the simulator.

 

Greetings

V

This is a signature. Don't expect anything fancy, for I would use an image if I could. But I can't, so cope with it...
Please use plain text.
Regular Contributor
renaun
Posts: 86
Registered: ‎10-25-2010

Re: SWIPE_DOWN doesn't work

In the simulator do you start the swipe in the middle top black part of the simulator and swipe down into the Tablet OS's screen?

blog: http://renaun.com
twitter: @renaun
Please use plain text.
Developer
peter9477
Posts: 6,447
Registered: ‎12-08-2010
My Carrier: none

Re: SWIPE_DOWN doesn't work

As @navikun originally noted, if you listen for both SWIPE_START and SWIPE_DOWN, you will not get the SWIPE_DOWN event.

 

His code shows a simple example to prove the point.  If you comment out the addEventListener() line for the SWIPE_START, it will get the SWIPE_DOWN event once you do the proper gesture (starting in the top bezel, not within 50 pixels of the edges, pressing the left mouse button down, and travelling into the screen area until the mouseY value is greater than 20).

 

If you are no longer listening for both but still think you aren't getting the SWIPE_DOWN event, please reduce your code down to a postable size that still demonstrates the problem and share it here.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
Vemilyus
Posts: 54
Registered: ‎03-21-2011
My Carrier: WiFi

Re: SWIPE_DOWN doesn't work

Firstly, let me answer your questions:

1) Yes, I do start at the middle of the top bezel area and I swipe down at least 30 - 40 px.

2) I do only listen for the SWIPE_DOWN event.

 

Here the code I use to toggle visibility of my bezel menu (does not work):

 

QNXApplication.qnxApplication.addEventListener(QNXApplicationEvent.SWIPE_DOWN, function (e:QNXApplicationEvent):void
			{
				_vertBezelMenu.toggleState();
			});

 

But this works:

 

QNXApplication.qnxApplication.addEventListener(QNXApplicationEvent.SWIPE_START, function (e:QNXApplicationEvent):void
			{
				_vertBezelMenu.toggleState();
			});

 

I'm really going nuts over this, I hope that's just a bug of the simulator.

 

 

V

 

This is a signature. Don't expect anything fancy, for I would use an image if I could. But I can't, so cope with it...
Please use plain text.
Developer
peter9477
Posts: 6,447
Registered: ‎12-08-2010
My Carrier: none

Re: SWIPE_DOWN doesn't work

When you say the SWIPE_START version works, does it do this "toggleState" stuff as soon as you even click the mouse in the top bezel region?  SWIPE_START is issued before you even begin to drag.

 

I'm asking just to confirm that in fact what you're seeing is really the SWIPE_START and not something else.

 

Can you add a trace() call to the SWIPE_DOWN handler, just before the toggleState(), to prove conclusively that it is really not being dispatched?  I don't see anything wrong with what you've posted.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
Vemilyus
Posts: 54
Registered: ‎03-21-2011
My Carrier: WiFi

Re: SWIPE_DOWN doesn't work

[ Edited ]

I added trace("toggle attempt") in the event handler and in the toggleState() method. The toggleState() method just tweens a background image in and out.

I'm not getting trace messages from either the event listener or the toggleState() method.

And I used the SWIPE_START just to see whether or not the other code worked.

This is a signature. Don't expect anything fancy, for I would use an image if I could. But I can't, so cope with it...
Please use plain text.
Developer
peter9477
Posts: 6,447
Registered: ‎12-08-2010
My Carrier: none

Re: SWIPE_DOWN doesn't work

@Vemilyus, are you dead certain you don't have some code in another module, or earlier or later in this one, which does an addEventListener() for SWIPE_START?  That would be the only way I know of to suppress SWIPE_DOWN.

 

If you don't see that, I think your only option at the moment, unless someone else has an idea, is to make a new app with nothing in it except the basic Sprite (main class), addEventListener for swipe event, and a handler routine with a trace() in it.  Run it with SWIPE_START to verify it works, then change to SWIPE_DOWN, and if you don't get that, post the whole thing along with anything else you can think of that might be involved.  Version of SDK, platform used, ... not sure what else.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
Vemilyus
Posts: 54
Registered: ‎03-21-2011
My Carrier: WiFi

Re: SWIPE_DOWN doesn't work

Thanks Peter!

I checked my base application class and found out, that it had listeners registered for both, SWIPE_DOWN and SWIPE_START.

I dropped SWIPE_START and now it works perfectly!

 

*Sigh* Was my incompetence then, I guess :smileywink:

This is a signature. Don't expect anything fancy, for I would use an image if I could. But I can't, so cope with it...
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010

Re: SWIPE_DOWN doesn't work

hey Vemilyus,

 

thats really strange. it should work. i take the swipe down approach as well vs the swipe start. it works for my apps. what you shud do to confirm that its a full blown bug is create another project and just do a swipe down event in it to clear any doubt. if it works then there is another part of your code interfering. if it does not then we know its a sim bug. let me know how it works out. good luck!

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
Please use plain text.