Share Posted April 12, 2013 Hey guys so im having a little trouble here. So i have a textField that updates after each hitTest which is called levelText. So what im trying to accomplish is the levelText field to fade out after 1 second at the start of each new level. It works fine for the first level but when i go to level 2 or 3 the text field doesnt appear at all. I believe i have to destroy it and re add somehow? Here is the code im using. private function startNextLevel():void{ TweenLite.to(levelText, 1, {autoAlpha:0}); } Please any information would help. Thank you. Link to comment Share on other sites More sharing options...
Share Posted April 12, 2013 Hi If you are using the same text field for each level it sounds like you just need to set its autoAlpha back to 1 before you tween to 0. levelText.visible=true; levelText.alpha=1; Or use set() TweenLite.set(levelText, {autoAlpha:1}); Or use a tween TweenLite.to(levelText, 1, {autoAlpha:1}); Or use a fromTo() tween. TweenLite.fromTo(levelText, 1, {autoAlpha:1},{autoAlpha:0}); Link to comment Share on other sites More sharing options...
Author Share Posted April 12, 2013 Interesting. Yeah i figured it out last night by setting it to 0 then 1 in the next function. But im confused what does set(); or fromto(); do? Link to comment Share on other sites More sharing options...
Share Posted April 12, 2013 set() is just a shortcut for a tween with a 0-second duration. It happens instantly. A fromTo() tween allows you to specify the starting (from) and end (to) values of the tween. For instance you could have an mc at x:0. Perhaps when someone clicks a button that mc should jump and tween from x:100 to x:200 TweenLite.fromTo(mc, 1, {x:100}, {x:200}); http://api.greensock.com/as/com/greensock/TweenLite.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now