請看底下程式代碼:
myMC1_mc, myMC1_mc , 都是MovieClip
//--------as3.0---------------------------------------------------------------------------------------
myMC1_mc.addEventListener(MouseEvent.CLICK,traceMC);
myMC2_mc.addEventListener(MouseEvent.CLICK,traceMC);
myMC2_mc.buttonMode=true;
myMC2_mc.useHandCursor = false;
function traceMC(e:MouseEvent):void {
trace("you clicked: "+this.name);
};
//注意到了嗎,紅色那行告訴你,要先開起button模式,才能使用Cursor=false;
//--------as2.0----------------------------------------------------------------------------------------
myMC1_mc.onRelease = traceMC;
myMC2_mc.onRelease = traceMC;
myMC2_mc.useHandCursor = false;
function traceMC() {
trace("you clicked: "+this._name);
};
//as2.0就不必這麼做,因為本來在2.0的MovieClip設release就會出現手指圖示
- 留言者: ㄎㄎㄎ
- Email:
- 網址:
- 日期: 2012-09-05 17:30:13
沒有留言:
張貼留言