FadeIn, FadeOut


/ Published in: ActionScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function fadeOut(obj:MovieClip,target) {
  2. onEnterFrame = function () {
  3. obj._alpha -= 3;
  4. if (obj._alpha <= target) {
  5. obj._alpha = target;
  6. delete onEnterFrame;
  7. }
  8. };
  9. }
  10.  
  11. function fadeIn(obj:MovieClip,target) {
  12. onEnterFrame = function () {
  13. obj._alpha += 3;
  14. if (obj._alpha >= target) {
  15. obj._alpha = target;
  16. delete onEnterFrame;
  17. }
  18. };
  19. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.