here is my code, i draw two ciricle on the stage. Each circle can controlled by another circle on the stage. That’s mean if i click circle1, then some action will be taken on circle 2. but the following code doesnt work, how can i control any other object using addEventListener ??
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class testing extends Sprtie {
public function testing() {
var cir1:Sprite = new Sprite();
cir1.graphics.beginFill(0x000000);
cir1.graphics.drawCircle(0,0,100);
cir1.graphics.endFill();
addChild(cir1);
var cir2:Sprite = new Sprite();
cir2.graphics.beginFill(0x000000);
cir2.graphics.drawCircle(200,200,100);
cir2.graphics.endFill();
addChild(cir2);
cir1.addEventListener(MouseEvent.MOUSE_DOWN, dnHandler);
}
private function dnHandler(event:MouseEvent):void {
cir2.x = 500;
}
}
}