Ovo je AS
import fl.transitions.Tween;
import fl.transitions.easing.*;
var homeX:Number = 0;
var homeY:Number = 0;
var newsX:Number = -1154;
var newsY:Number = 0;
var aboutX:Number = -2250;
var aboutY:Number = 0;
var new1X:Number = -3380;
var new1Y:Number = 0;
var new2X:Number = 0;
var new2Y:Number = 0;
var new3X:Number = 4850;
var new3Y:Number = 0;
var xTween:Tween;
var yTween:Tween;
xTween = new Tween(main_mc,"x",Strong.easeInOut,main_mc.x,homeX,2,true);
yTween = new Tween(main_mc,"y",Strong.easeInOut,main_mc.y,homeY,2,true);
button1_bt.addEventListener(MouseEvent.MOUSE_OVER, navigate);
button2_bt.addEventListener(MouseEvent.MOUSE_OVER, navigate);
button3_bt.addEventListener(MouseEvent.MOUSE_OVER, navigate);
button4_bt.addEventListener(MouseEvent.MOUSE_OVER, navigate);
function navigate(event:MouseEvent):void
{
if(event.target == button1_bt)
{
setTween(homeX,homeY);
}
else if(event.target == button2_bt)
{
setTween(newsX,newsY);
}
else if(event.target == button4_bt)
{
setTween(new1X,new1Y);
}
else
{
setTween(aboutX,aboutY);
}
}
function setTween(tweenX:Number,tweenY:Number):void
{
xTween.begin = main_mc.x;
yTween.begin = main_mc.y;
xTween.finish = tweenX;
yTween.finish = tweenY;
xTween.start();
yTween.start();
}
xTween.stop();
yTween.stop();
medjutim to nije ono shto sam hteo da uradim,.... hocu da na kraju izgleda kao da ide u krug... da moze da ide konstantno u krug..
|