AS2 Object movement and alpha tween

  • amiecutietoes
  • Newbie
  • Newbie
  • User avatar
  • Posts: 10
  • Loc: Los Angeles, CA

Post 3+ Months Ago

So I have so parts of actionscript which I am figuring out on how to make them one. What I am wanting to do is move an object to the right and fadeout.
Here is my code to animate right 10 pixels, this works perfectly.
Code: [ Select ]
(__root.galleryThumbs.length <= 1) ? __root.navigation.button_info._x = 0 : __root.navigation.button_info._x = Math.round((__root.navigation.controls._x + __root.navigation.controls._width) + 10);


As you can see, I am moving "button_info" when the gallery thumbs only has one image in it. Now the code below I wrote up quikly to tween the "button_info" to an alpha of 0.

Code: [ Select ]
Tweener.addTween(__root.navigation.button_info, {_alpha:0, time:0.8, transition:"easeOutExpo"});


My problem is I'm not sure on how to combine the codes :(
Any help is greatly appreciated!
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1827
  • Loc: In the Great White North

Post 3+ Months Ago

Why don't you just use Tweener for both? I don't think Tweener will allow you to animate multiple properties in the same call but you can stack them...
ACTIONSCRIPT Code: [ Select ]
Tweener.addTween(__root.navigation.button_info, {_alpha:0, time:0.8, transition:"easeOutExpo"});
Tweener.addTween(__root.navigation.button_info, {_x:10, time:0.8, transition:"easeOutExpo"});
 
  1. Tweener.addTween(__root.navigation.button_info, {_alpha:0, time:0.8, transition:"easeOutExpo"});
  2. Tweener.addTween(__root.navigation.button_info, {_x:10, time:0.8, transition:"easeOutExpo"});
  3.  
basically your just changing the tweened property to be position instead of alpha.

Not that you need one more thing to learn but I find the TweenLite library (http://www.greensock.com/tweenlite/) but be a bit more efficient and easier to use than Tweener. It might be worth looking into since you can tween multiple properties at the same time.
  • amiecutietoes
  • Newbie
  • Newbie
  • User avatar
  • Posts: 10
  • Loc: Los Angeles, CA

Post 3+ Months Ago

Thanks :)

I ended up using something called TweenMax

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.