/ Published in: ActionScript 3
example of a Variable declaration and use
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Declare my variables; var photoCounter:Number = 1; var totalPhotos:Number = 11; function nextPhoto(e:MouseEvent) { if (photoCounter != totalPhotos) { trace(photoCounter); Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext}); photoCounter = photoCounter + 1; } else { Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext}); photoCounter = 1; } }