easing

import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
import flash.events.Event;

var prevX:int = 0;
var curX:int = 0;


var dirX:String = "";
function Start()
{

stage.addEventListener(MouseEvent.MOUSE_MOVE, CheckDirection);

}
Start();



function CheckDirection(e:MouseEvent)
{
var xDirection:String = GetHorizontalDirection();
e.updateAfterEvent();
}


function GetHorizontalDirection():String
{
var myTween:Tween;
curX = mouseX;

if (600 >= curX)
{
myTween = new Tween(buttoni,"x",None.easeOut,buttoni.x,-240,3,true);
}
if (300 <= curX) { myTween = new Tween(buttoni,"x",None.easeIn,buttoni.x,300,3,true); } return dirX; }

0 comments:

Post a Comment