2
我想實現一個非常簡單的方法來存儲包含我單擊的最後一個特定「CustomObject」的變量。我想點擊其他對象被忽略。就拿下面的示例代碼,給出CustomObject擴展影片剪輯:使對象像AS3中的單選按鈕一樣
//Code within the Document Class:
var square1:CustomObject = new CustomObject();
var square2:CustomObject = new CustomObject();
var square3:CustomObject = new CustomObject();
var triangle1:DifferentObject= new DifferentObject();
square1.x=100; square2.x=200; square3.x=300;
addChild(square1);
addChild(square2);
addChild(square3);
addChild(triangle1);
//Code within the CustomObject Class:
this.addEventListener(MouseEvent.CLICK,radioButtonGlow);
public function radioButtonGlow(e:MouseEvent):void
{
var myGlow:GlowFilter = new GlowFilter();
myGlow.color = 0xFF0000;
myGlow.blurX = 25;
myGlow.blurY = 25;
this.filters = [myGlow];
}
這個偉大的工程每當我點擊squares-他們正好亮起預期。不過,我想實現一個功能: 1)存儲方形的楦我點擊進入文檔類 2)一個變量從所有其他方塊刪除光暈當我點擊另一個
任何反饋非常感謝!
您先生是紳士和學者。這是一個讓班級管理自定義對象的天才想法。非常感謝! – Gigazelle