import fl.transitions.Tween;
import fl.transitions.easing.*;
var inTween:Tween;
var outTween:Tween;
in_btn.addEventListener(MouseEvent.CLICK, animIn);
out_btn.addEventListener(MouseEvent.CLICK, animOut);
function animIn(event:MouseEvent):void
{
inTween = new Tween(kampret,"y",Back.easeOut,250,30,1,true);
}
function animOut(event:MouseEvent):void
{
outTween = new Tween(kampret,"y",Back.easeOut,30,250,1,true);
}
kiri_btn.addEventListener(MouseEvent.CLICK, kekiri);
function kekiri (e:Event):void
{
kampret.removeEventListener(Event.ENTER_FRAME, kekanann);
kampret.removeEventListener(Event.ENTER_FRAME, keatass);
kampret.removeEventListener(Event.ENTER_FRAME, kebawahh);
kampret.addEventListener(Event.ENTER_FRAME, kekirii);
}
function kekirii (e:Event):void
{
kampret.x -=3;
}
stop_btn.addEventListener(MouseEvent.CLICK, ccc);
function ccc (e:Event):void
{
kampret.removeEventListener(Event.ENTER_FRAME, ptr);
kampret.removeEventListener(Event.ENTER_FRAME, kekirii);
kampret.removeEventListener(Event.ENTER_FRAME, keatass);
kampret.removeEventListener(Event.ENTER_FRAME, kebawahh);
kampret.removeEventListener(Event.ENTER_FRAME, kekanann);
}
atas_btn.addEventListener(MouseEvent.CLICK, keatas);
function keatas (e:Event):void
{
kampret.removeEventListener(Event.ENTER_FRAME, kekirii);
kampret.removeEventListener(Event.ENTER_FRAME, kekanann);
kampret.removeEventListener(Event.ENTER_FRAME, kebawahh);
kampret.addEventListener(Event.ENTER_FRAME, keatass);
}
function keatass (e:Event):void
{
kampret.y+=3;
}
kanan_btn.addEventListener(MouseEvent.CLICK, kekanan);
function kekanan (e:Event):void
{
kampret.addEventListener(Event.ENTER_FRAME, kekanann);
kampret.removeEventListener(Event.ENTER_FRAME, kekirii);
kampret.removeEventListener(Event.ENTER_FRAME, keatass);
kampret.removeEventListener(Event.ENTER_FRAME, kebawahh);
}
function kekanann (e:Event)
{
kampret.x+=3;
}
bawah_btn.addEventListener(MouseEvent.CLICK, kebawah);
function kebawah (e:Event):void
{
kampret.removeEventListener(Event.ENTER_FRAME, kekirii);
kampret.removeEventListener(Event.ENTER_FRAME, keatass);
kampret.removeEventListener(Event.ENTER_FRAME, kekanann);
kampret.addEventListener(Event.ENTER_FRAME, kebawahh);
}
function kebawahh (e:Event)
{
kampret.y-=3;
}
muter_btn.addEventListener(MouseEvent.CLICK, putar)
function putar (event:Event):void
{
kampret.addEventListener(Event.ENTER_FRAME, ptr);
}
function ptr (event:Event):void
{
kampret.rotation -=7;
}
stop();
0 Response to "Cara Membuat Animasi pada Flash AS3"
Post a Comment