close

最近學因為要幫社團做網頁,把flash的action script書拿出來啃了一下

發現action script3 跟 action script2 不相容

語法也不一樣了,我還是比較熟悉ac2的說

 

這是我在做按鈕的時候遇到的問題,把 ac3 的語法改成 ac2 來表示

=========================================

Action script3

this.addEventListener(MouseEvent.CLICK, disableButton);
this.addEventListener(MouseEvent.ROLL_OVER, over);
this.addEventListener(MouseEvent.ROLL_OUT, out);


function disableButton(event:MouseEvent):void{
  this.gotoAndPlay("disable");
}

function over(event:MouseEvent):void{
  this.gotoAndPlay("over");
}

function out(event:MouseEvent):void{
  this.gotoAndPlay("out");
}

 

=========================================

Action script2 :

this.onRelease = disableButton;
this.onRollOver = over;
this.onRollOut = out;

function disableButton():Void {
this.gotoAndPlay("disable");
}

function over():Void {
this.gotoAndPlay("over");
}

function out():Void {
this.gotoAndPlay("out");
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 toyangel 的頭像
    toyangel

    好同學的部落格

    toyangel 發表在 痞客邦 留言(0) 人氣()