作者wind50321 (小順)
看板Flash
標題[問題] 含有讀入文字的 MC開啟 buttonMode有問題
時間Tue Jan 12 01:27:58 2010
場景上只有兩個物件
一個 text_mc的 MovieClip
包著一個 text1的 Dynamic Text
text1用 URLLoader讀入了外部 text1.txt的純文字內容
接著把 text_mc加了偵聽程式
讓每次滑鼠點了之後
text_mc.text1的背景顏色會自動切換
但是我把 text_mc加上了 buttonMode
可是滑鼠移上去並不會變成手型圖案
到底為什麼呢?
------------------------------程式碼-------------------------------
text_mc.x=stage.stageWidth/2;
text_mc.y=stage.stageHeight/2;
var ldr2:URLLoader=new URLLoader();
ldr2.load(new URLRequest("text1.txt"));
ldr2.addEventListener(Event.COMPLETE,displayTxt);
function displayTxt(e:Event):void {
text_mc.text1.text=e.target.data;
text_mc.text1.background=true;
text_mc.text1.backgroundColor=0xEECCCC;
text_mc.addEventListener(MouseEvent.CLICK,changeColor);
text_mc.buttonMode=true;
//這行沒用
}
function changeColor(e:MouseEvent):void {
text_mc.text1.backgroundColor=Math.random()*0xFFFFFF;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.176.74
推 cassatte:useHandCursor 也要變成 true 01/12 06:15
→ cassatte:一般來說按鈕不會有手,只有連結有手 01/12 06:16