some actionscript
import fl.transitions.*;
import fl.transitions.easing.*;
fadeBtn.addEventListener(MouseEvent.CLICK, fadeMyObject);
flyBtn.addEventListener(MouseEvent.CLICK, flyMyObject);
// And here are all of the corresponding functions
function fadeMyObject(event:MouseEvent) {
TransitionManager.start(myStar, {type:Fade, direction:Transition.IN, duration:9, easing:Strong.easeOut});
}
function flyMyObject(event:MouseEvent) {
TransitionManager.start(myStar, {type:Fly, direction:Transition.IN, duration:3, easing:Elastic.easeOut, startPoint:9});
}
Thursday, December 30, 2010
Wednesday, December 15, 2010
Actionscript (cont..)
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);
}
}
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);
}
}
Subscribe to:
Posts (Atom)