トップ 差分 一覧 Farm ソース プレゼンテーション 検索 ヘルプ PDF RSS ログイン

event

クリックイベント


my_mc.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void {
trace("ありがとう。");
}



stop();
beer_btn.addEventListener(MouseEvent.CLICK, goBeer);
cake_btn.addEventListener(MouseEvent.CLICK, goCake);
function goBeer(event:MouseEvent):void{
gotoAndStop("beer");
}
function goCake(event:MouseEvent):void{
gotoAndStop("cake");
}



counter_mc.stop();
start_btn.addEventListener(MouseEvent.CLICK, startMC);
stop_btn.addEventListener(MouseEvent.CLICK, stopMC);
function startMC(event:MouseEvent):void {
counter_mc.play();
}
function stopMC(event:MouseEvent):void {
counter_mc.stop();
}


エンターフレームイベント


box1_mc.addEventListener(Event.ENTER_FRAME, onRotaMe);
box2_mc.addEventListener(Event.ENTER_FRAME, onRotaMe);
function onRotaMe(event:Event):void {
var targetMC:MovieClip = event.target as MovieClip;
targetMC.rotation += 10;
}


[Flash,ActionScript3.0,event]