[問題] 含有讀入文字的 MC開啟 buttonMode有問題
場景上只有兩個物件
一個 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
推
01/12 06:15, , 1F
01/12 06:15, 1F
→
01/12 06:16, , 2F
01/12 06:16, 2F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章