Variable declaration and use


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

example of a Variable declaration and use


Copy this code and paste it in your HTML
  1. //Declare my variables;
  2. var photoCounter:Number = 1;
  3. var totalPhotos:Number = 11;
  4.  
  5. function nextPhoto(e:MouseEvent)
  6. {
  7. if (photoCounter != totalPhotos)
  8. {
  9. trace(photoCounter);
  10. Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext});
  11. photoCounter = photoCounter + 1;
  12. }
  13. else
  14. {
  15. Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext});
  16. photoCounter = 1;
  17. }
  18. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.