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
New Developer
Posts: 47
Registered: ‎11-25-2010
My Device: Not Specified

Re: Effects in Playbook

Excellent !! Wonderful job, Thank you .. Thank you soo much, this is what i want exactly. Smiley Very Happy

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

Re: Effects in Playbook

glad i could help! good luck with the rest of your journey!

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: 229
Registered: ‎08-14-2009
My Device: Bold 9900, DevAlpha A
My Carrier: Vodafone DE

Re: Effects in Playbook

Gee thanks for the code Joynal, it works great. Will have to use this somehow. Would be cool to use this with a swipe so the transition follows your finger...  

Willy R.
-
If my post solved your problem, make it easier for others to find by Accepting it as a solution or provide a Kudo if it was helpful for you. Thanks.
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Effects in Playbook

Hey willy,

 

i agree the if we were to take this up to the next level it'd be listening for the swipe acting of the finger instead of a button click. From there we could customize how fast and how long the transition to match the swipe speed. Should be a pretty cool approach!

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: 47
Registered: ‎11-25-2010
My Device: Not Specified

Re: Effects in Playbook

Hi JRab,

 

If i want to add third , fourth sprite, how to set the values for third sprite and fourth ? I have given like this,

myThrdSprite= new Sprite();
myThrdSprite.graphics.beginFill(0xF9F9F9, 1);
myThrdSprite.graphics.drawRect(0,0,700,450);
myThrdSprite.graphics.endFill();

myThrdSprite.scrollRect = new Rectangle(0,0,700,450);
myThrdSprite.addChild(payment_form);
addChild(myThrdSprite);

myThrdSprite.x = 900;
myThrdSprite.y = 80;
myThrdSprite.width = 0;

But the entire rectangel went to top left corner, if i comment the above code, the rectangle came correctly and effects also fine, i did not understand how to code this sprirte.x, can you help me on this please ?

 

 

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

Re: Effects in Playbook

[ Edited ]

hey ramesh,

 

what does the function that is called to bring out the third sprite after the user clicks on the button look like? the one that has the Tweener.addTween() function inside of it.

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: 47
Registered: ‎11-25-2010
My Device: Not Specified

Re: Effects in Playbook

Yes i got the problem and solution, but for the first two buttons the navigation is working correctly, for the last two buttons not working correctly, after i click all the buttons one by one navigation is working fine , but  if i click frist button after all clicks  it is not navgiating.

 

	public function showPersonalPage(e:MouseEvent):void {
			Tweener.addTween(myPersonalSprite,{x:200,width:700, time:1});
		}
		public function hidePersonalPage(e:MouseEvent):void {
			Tweener.addTween(myPersonalSprite,{x:900, width:0, time:1});
		}
		public function showSettingsPage(e:MouseEvent):void {
			Tweener.addTween(mySettingsSprite,{x:200,width:700, time:1});
		}
		public function showConfirmPage(e:MouseEvent):void {
			Tweener.addTween(myConfirmSprite,{x:200,width:700, time:1});
		}
		public function showPaymentPage(e:MouseEvent):void {
			Tweener.addTween(myPaymentSprite,{x:200,width:700, time:1});
		}

 

This is what i have done. Do we need to pass x parameter dynamically ?

 

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

Re: Effects in Playbook

hey ramesh,

 

yes you got the basic conept down. now all you have to do is add another Tweener.addTween() function to get rid of the other sprites. so that way you only have on sprite showing and all the others are gone. here's what you'd do:

 

 

		public function showAccountPage(e:MouseEvent):void
		{	
			/*
			* hides the personal page if visible
			*/
			Tweener.addTween(myPersonalSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the settings page if visible
			*/
			Tweener.addTween(mySettingsSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the confirm page if visible
			*/
			Tweener.addTween(myConfirmSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the payment page if visible
			*/
			Tweener.addTween(myPaymentSprite, {x:900, width:0, time:.3});
		}
		public function showPersonalPage(e:MouseEvent):void
		{
			
			/*
			* hides the settings page if visible
			*/
			Tweener.addTween(mySettingsSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the confirm page if visible
			*/
			Tweener.addTween(myConfirmSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the payment page if visible
			*/
			Tweener.addTween(myPaymentSprite, {x:900, width:0, time:.3});
			
			/*
			* Create the transition to bring the new screen in from x:900 (off screen)
			* to x:200 (onscreen) and the width of the sprite from 0 to 700 in .3
			* seconds in a straight line (linear)
			*/
			
			Tweener.addTween(myPersonalSprite, {x:200, width:700, time:.3});
		}
		public function showSettingsPage(e:MouseEvent):void
		{
			/*
			* hides the personal page if visible
			*/
			Tweener.addTween(myPersonalSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the confirm page if visible
			*/
			Tweener.addTween(myConfirmSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the payment page if visible
			*/
			Tweener.addTween(myPaymentSprite, {x:900, width:0, time:.3});
			
			/*
			* Create the transition to bring the new screen in from x:900 (off screen)
			* to x:200 (onscreen) and the width of the sprite from 0 to 700 in .3
			* seconds in a straight line (linear)
			*/
			
			Tweener.addTween(mySettingsSprite, {x:200, width:700, time:.3});
		}
		public function showConfirmPage(e:MouseEvent):void
		{
			/*
			* hides the personal page if visible
			*/
			Tweener.addTween(myPersonalSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the settings page if visible
			*/
			Tweener.addTween(mySettingsSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the payment page if visible
			*/
			Tweener.addTween(myPaymentSprite, {x:900, width:0, time:.3});
			
			/*
			* Create the transition to bring the new screen in from x:900 (off screen)
			* to x:200 (onscreen) and the width of the sprite from 0 to 700 in .3
			* seconds in a straight line (linear)
			*/
			
			Tweener.addTween(myConfirmSprite, {x:200, width:700, time:.3});
		}
		public function showPersonalPage(e:MouseEvent):void
		{
			/*
			* hides the personal page if visible
			*/
			Tweener.addTween(myPersonalSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the settings page if visible
			*/
			Tweener.addTween(mySettingsSprite, {x:900, width:0, time:.3});
			
			/*
			* hides the confirm page if visible
			*/
			Tweener.addTween(myConfirmSprite, {x:900, width:0, time:.3});
			
			/*
			* Create the transition to bring the new screen in from x:900 (off screen)
			* to x:200 (onscreen) and the width of the sprite from 0 to 700 in .3
			* seconds in a straight line (linear)
			*/
			
			Tweener.addTween(myPaymentSprite, {x:200, width:700, time:.3});
		}

 

so your adding what you want to show up using the tweener and removing what you dont want to show up in the tweener. now you dont need a hide funciton for each individual sprite because the show funcitons do the hiding for you. 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
New Developer
Posts: 47
Registered: ‎11-25-2010
My Device: Not Specified

Re: Effects in Playbook

Thanks alot, sorry to trouble you much... Thanks again...

New Developer
Posts: 47
Registered: ‎11-25-2010
My Device: Not Specified

Re: Effects in Playbook

Hey Small query,

 

How to reset the Tweener 'x' value, i have navigated the first screen from left to right and the Tweener value of x is 200, Now if i want to tween again like how the first screen tweened  (From right to left), how to do that.