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
Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified
Accepted Solution

in playbook how to handle navigate next and previous screen

in my application i have 3 to 4 screen now i want to navigate next and previous screen using actionScript how to achive this

 

when i click on one button it move to next screen and from that screen i want to go back to previous screen

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

Re: in playbook how to handle navigate next and previous screen

[ Edited ]

hey,

 

you can acheive this using the addChild() and removeChild() methods in AS3. this will add "views" on to screen and remove them, respectively. here are a few threads dealing with the subject indepth:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Do-we-have-any-documentation-for-...

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/How-to-navigate-to-other-page/m-p...

 

i highly recommend you use the search feature of the forums. its full of valuable information previously posted to helps new and old users alike. 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: 1,155
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: in playbook how to handle navigate next and previous screen

See also this post:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Community-Library-Released-for-cl...

 

for a link to a later version of PageViewStack.as hosted on Google Code; it's part of a larger contributed package by jtegen.

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: in playbook how to handle navigate next and previous screen

thanks for your reply 

 i am a new to Actionscript devlopment that's way i am asking 

basically i am a  JAVA developer from long time

 

 

Developer
Posts: 157
Registered: ‎12-16-2010
My Device: Torch 9800, PlayBook
My Carrier: I carry it myself

Re: in playbook how to handle navigate next and previous screen

[ Edited ]

The approach I took with my application (pure Action Script 3 app) is as follows:

 

 

  1. I have a single "master" AS class which loads at start (MainPage.as) - this page is the master controller that controls the flow of the application but it  DOES NOT have any UI elements or functionality in itself
  2. Each screen is a separate AS class which inherits from PageTemplate (which has bunch of functionality which I want to make sure is available to all screens) and the PageTemplate inherits from Sprite
  3. In the MainPage i declare and instantiate all screens involved as class variables
  4. I also have Array called pageStack which has collection of screens in order they were navigated to
  5. variable currentPage is always referencing to the last screen in the pageStack
  6. I have then control fucntions which add, remove, slide or do whatever to the screens
  7. the actual transitions are implemented in each screen - if the MainPage wants to slide the screen it just calls SlideIn function in the screen as needed
  8. I use static class to pass events from all other pages back to theevent handlers which are implemented in MainPage only. Meaning: all events (button clicks, touch events, etc) which are LOCAL to the screen are handled within the screen, but all events which require going outside of the current screen (ex: switching to the other screen, or inquiring on the status of some other non visible screens) are firing an event which is registered in the MainPage which then takes appropriate action. I also have custom Event objects for various situations which pass the data around..
this keeps my design clean and works quite well
also another benefit of the pageStack array is that it is used to display a "breadcrumb" control where user can see all the pages that were navigated in the order -- i then trim it to display last 10 pages. - and remove everything above 10 from the array
Once I am done with development and submit the app I will probably document my approach as a walkthrough.
Oh, and this is not really "my" approach - it is based on all the great suggestions and tips from this forum as I am new to AS myself ;-)

 

----------
If you find this post helpful please "like" it and accept as a solution.
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: in playbook how to handle navigate next and previous screen

You might want to look at some code a posted about a week ago and discussed here:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Community-Library-Released-for-cl...

 

It might save you some time in regards to the PageViewStack class that is in the library.  It might save you some time.

 

Like the breadcrumb idea.  You could could grab the bitmap of the page before you leave it, resize it and then add it to the list of previously visited pages so the user can jump to later.

Developer
Posts: 157
Registered: ‎12-16-2010
My Device: Torch 9800, PlayBook
My Carrier: I carry it myself

Re: in playbook how to handle navigate next and previous screen

 


jtegen wrote:

Like the breadcrumb idea.  You could could grab the bitmap of the page before you leave it, resize it and then add it to the list of previously visited pages so the user can jump to later.


Awesome idea - adding to my "features for 1.5 version" list ... oh my ... hundreds of items on that list already.. ;-0

 

----------
If you find this post helpful please "like" it and accept as a solution.
Highlighted
Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: in playbook how to handle navigate next and previous screen

i find the solution of how to navigate nexxt and previous screen

 

next and Previous can be achived using addChild() and removeChild() method