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
Developer
Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers
Accepted Solution

Swipe down is lower in z-index

So I may be just missing something simple, but I loosely followed some code from @jtegen on using transitions between pages ...PageViewStack I'm sure... Anywhoo, It all works great and stuff, but My swipe down menu appears to be lower in the z-index than the page! Help?
CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Swipe down is lower in z-index

hey nick,

 

to solve that wherever you are adding your navigation bar, make sure to add it after the page view stack via the addChild() method. so bascially, at the end of your main application, do the addChild(navigationBar); and that should put it on top of anything else you add in your application. hope that helps. 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
Developer
Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Re: Swipe down is lower in z-index

OH MAN! HAHAHA

 

Told you I must have been missing something simple!

Thanks! It shows I've only had about 8 hours sleep in 2 days! and it's 7am! Nick >= FAIL

CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Swipe down is lower in z-index

In my own app, any time I get swipe_start and am about to start showing the menu, I do addChild(menu) to make sure it's on top.  (This always puts it last on the list, or on top in terms of z order.)

 

There are probably many alternatives, but that worked for me.

 

I haven't checked if doing addChild() with something that's already in the parent and the display list will fire EVENT_REMOVED and EVENT_ADDED or EVENT_ADDED_TO_STAGE), which could be a problem if you listened for those.  As I did not it wasn't a concern.


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!
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Swipe down is lower in z-index

@nick: even prodigies need their sleep Smiley Wink go get some!

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
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Swipe down is lower in z-index

The other thing you have to keep in mind if you are having some kind of app bar with PageViewStack is that each time a page is swapped, it adds the page back to the stage.  So even if you initially added the app bar after the initial stack of pages, any new swipes will place the page on top of the app bar.  To work around this, you will need to:

 

/////////////////////////////////////////////////////////////////////////
private function ShowPref( event : Event ) : void
{		
	this.page_stack.setPageIndex( 1, PageViewStack.RIGHT_LEFT );
	this.setChildIndex( this.app_bar, this.numChildren-1 );
}

 

Developer
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: Swipe down is lower in z-index

@jtegen, that is great information, I didn't realize that, though it makes sense.

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Swipe down is lower in z-index

Honestly, I just found this out on a new app.

Developer
Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Re: Swipe down is lower in z-index

Yes! I was working on my own solution this morning because I instantly noticed in my test that when changing pages the swipe would no longer be on top.

Yours is cleaner than my fix! Thanks!
CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Swipe down is lower in z-index

Glad I could help someone today.