作者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
1F:推 cassatte:useHandCursor 也要变成 true 01/12 06:15
2F:→ cassatte:一般来说按钮不会有手,只有连结有手 01/12 06:16