some actionscript
import fl.transitions.easing.*;
import fl.transitions.*;
var myTween:Tween;
homeButton.mouseChildren = false;
aboutButton.mouseChildren = false;
mediaButton.mouseChildren = false;
actionButton.mouseChildren = false;
homeButton.buttonMode = true;
aboutButton.buttonMode = true;
mediaButton.buttonMode = true;
actionButton.buttonMode = true;
homeButton.addEventListener (MouseEvent.CLICK, clicked);
aboutButton.addEventListener (MouseEvent.CLICK, clicked);
mediaButton.addEventListener (MouseEvent.CLICK, clicked);
actionButton.addEventListener (MouseEvent.CLICK, clicked);
function clicked (e:Event):void {
var buttonClicked:MovieClip = (MovieClip)(e.target);
if (buttonClicked == homeButton) {
myTween = new Tween(mainPage, "y", Back.easeIn, mainPage.y, 0, 1, true);
myTween = new Tween(mainPage, "x", Back.easeIn, mainPage.x, 0, 1, true);
}
//Tween to the about text
else if (buttonClicked == aboutButton) {
myTween = new Tween(mainPage, "y", Back.easeIn, mainPage.y, 0, 1, true);
myTween = new Tween(mainPage, "x", Back.easeIn, mainPage.x, 0, 1, true);
}
//Tween to the media text
else if (buttonClicked == mediaButton) {
myTween = new Tween(mainPage, "y", Back.easeIn, mainPage.y, 0, 1, true);
myTween = new Tween(mainPage, "x", Back.easeIn, mainPage.x, 0, 1, true);
}
//Tween to the action text
else {
myTween = new Tween(mainPage, "y", Back.easeIn, mainPage.y, 0, 1, true);
myTween = new Tween(mainPage, "x", Back.easeIn, mainPage.x, 0, 1, true);
}
}
No comments:
Post a Comment