スプライトにボタンにする画像(またはテキスト)を入れて、インスタンス名をmcにして_rootに配置。
★方法1(ジャンプ先が_rootにあるラベルaの場合)
「ボタンにする」でボタンを作らない
_rootのフレームアクションで
mc.onMouseDown=function(){
if(this.hitTest(_root._xmouse,_root._ymouse,true)){
this.pressflg=true;
}
};
mc.onMouseUp=function(){
if(this.pressflg==true && this.hitTest(_root._xmouse,_root._ymouse,true)){
this._parent.gotoAndPlay("a"); //ボタンを押したときの処理
}
this.pressflg=false;
};
|
あるいはクリップアクションで
on(MouseDown){
if(this.hitTest(_root._xmouse,_root._ymouse,true)){
this.pressflg=true;
}
}
-
on(MouseUp){
if(this.pressflg==true && this.hitTest(_root._xmouse,_root._ymouse,true)){
this._parent.gotoAndPlay("a"); //ボタンを押したときの処理
}
this.pressflg=false;
}
|
★方法2
スプライト内の画像(またはテキスト)を「ボタンにする」でボタンを作る
_rootのフレームアクションで
for (test in this.mc) {
this.mc[test].tabEnabled=false;
this.mc[test].useHandCursor=false;
}
|
あるいは_root.mcのフレームアクションで
for (test in this) {
this[test].tabEnabled=false;
this[test].useHandCursor=false;
}
|
|