我很努力使我的動畫工作在屏幕的單獨區域引起狀態在懸停時出現/消失並在其他位置如果點擊則轉到其他位置,但是,如果您點擊一秒鐘就會出現該標籤,然後返回到開始。有什麼建議麼?mouseEnabled + MOUSE_OVER衝突
//mouse overs (i've only left 1 instance of each event listener here)
comic.addEventListener(MouseEvent.MOUSE_OVER,BubbleHover);
//mouse outs
comic.addEventListener(MouseEvent.MOUSE_OUT,BubbleOut);
//mouse down
comic.addEventListener(MouseEvent.CLICK,BubbleClick);
//
// Take the playhead to where the user hovers.
//
function BubbleHover(evtObj:MouseEvent) {
var LabelName:String = evtObj.target.name + "Bubble";
trace(evtObj.target.name +" bubble appeared"); //state which bubble appears
//go to the section clicked on...
gotoAndStop(LabelName);
}
//
// Return to the beginning bubble
//
function BubbleOut(evtObj:Event):void{
gotoAndStop("lookBubble");
}
//
// Go to the Label Page
//
function BubbleClick(evtObj:Event){
var MovieClipPage = evtObj.target.name +"_page";
if (mouseEnabled) {
mouseEnabled=false;
trace(mouseEnabled); // returns false but then returns to "lookBubble"
}
gotoAndStop(MovieClipPage);
mouseEnabled(true);
}
據我瞭解正在發生的事情,當播放頭轉到BubbleClick標籤時,MouseEvent.MOUSE_OUT
發生。任何想法我怎麼能繞過這個?
我現在已經解決了這個問題:'BubbleOut()'函數中的if(this.currentLabel!=「comic_page」){}'但是它只運行一次。有任何想法嗎? – Neilisin 2012-08-14 11:31:18