/ Published in: ActionScript 3
This shows Mouse Event code and an example of use
Expand |
Embed | Plain Text
//nextButton functionality; nextButton.buttonMode = true; nextButton.useHandCursor = true; nextButton.mouseChildren = false; nextButton.addEventListener(MouseEvent.MOUSE_DOWN,nextPhoto); nextButton.addEventListener(MouseEvent.MOUSE_OVER, nextTextVisible); nextButton.addEventListener(MouseEvent.MOUSE_OUT, nextTextInvisible); //Tweener.addTween(nextButton, {_color:0x0000ff, time:.5, transition:"easeOutQuart"; //Tweener.addTween(nextButton, {_color:null, time:1, transition:"easeOutQuart" function nextTextVisible(e:MouseEvent):void { Tweener.addTween(nextTextText, {alpha:1, time:.5, transition:"easeOutQuart"}); } function nextTextInvisible(e:MouseEvent):void { Tweener.addTween(nextTextText, {alpha:0, time:.5, transition:"easeOutQuart"}); } 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; } }
Comments
Subscribe to comments
You need to login to post a comment.

I always preffer to use MouseEvent.CLICK instead of MouseEvent.MOUSE_DOWN, just to bring the standard browser-like experience.