[問題] mouseover
又來煩大家啦 這個範例照理說不是在滑鼠移到shape2的時候會讓shape1消失嗎?
可是程式碼也對,也有顯示圖片,就是移到shape2的時候shape1不會消失。
請問有知道原因嗎?謝謝。
var shape1:Shape = new Shape();
var shape2:Shape = new Shape();
shape1.graphics.beginFill(0xff0000);
shape1.graphics.drawRect(0,0,200,100);
shape1.graphics.endFill();
shape2.graphics.beginFill(0x00ff00);
shape2.graphics.drawRect(100,100,200,100);
shape2.graphics.endFill();
addChild(shape1);
addChild(shape2);
shape2.addEventListener(MouseEvent.MOUSE_OVER,over);
shape2.addEventListener(MouseEvent.MOUSE_OVER,out);
function over(e:MouseEvent)
{
removeChild(shape1);
}
function out (e:MouseEvent)
{
addChild(shape1);
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.131.162
推
07/15 12:07, , 1F
07/15 12:07, 1F
→
07/15 12:10, , 2F
07/15 12:10, 2F
→
07/15 12:10, , 3F
07/15 12:10, 3F
→
07/15 12:11, , 4F
07/15 12:11, 4F
→
07/15 12:11, , 5F
07/15 12:11, 5F
→
07/15 12:23, , 6F
07/15 12:23, 6F
→
07/15 12:25, , 7F
07/15 12:25, 7F
→
07/15 12:27, , 8F
07/15 12:27, 8F
→
07/15 12:27, , 9F
07/15 12:27, 9F
→
07/15 12:28, , 10F
07/15 12:28, 10F
※ 編輯: skylight68 來自: 61.228.131.162 (07/15 12:28)
討論串 (同標題文章)
Flash 近期熱門文章
PTT數位生活區 即時熱門文章