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

Re: Going back to main page

In your root Sprite (UnitConverter), you need to add an instance of your singleton class and then add the listeners:

 

public class UnitConverter extends Sprite
	{
		private var mainWindow:MainWindow = new MainWindow();
		private var distancePage:distance = new distance();
                  private var shared_data : SharedData;
		
		public function UnitConverter()
		{	
                           this.shared_data = SharedData.instance;
                           this.shared_data.addEventListener( 'showMainPage', showMainPage );
                           this.shared_data.addEventListner( 'showDistancePage', ShowDistancePage );
			this.addChild(this.mainWindow);
			this.stage.nativeWindow.visible = true;
		}
...

 I might have the event id and function mixed up.

Contributor
Posts: 31
Registered: ‎01-27-2011
My Device: Tablet

Re: Going back to main page

[ Edited ]

hi m new to this forums and also for action script can u please give me complete code to go next page or previous page.

 

thank in advance


 

Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Going back to main page

Going from one page to another is dependent on your application.  Changing pages can come from some user interaction (swipe down, buttons, lists, dropdowns, page swipes).  All you have to do is define how you want to move from one page to another, add an event listener to that object and in its callback function, call the page view stack to switch to the desired page.