Código ActionScript :
var botspri:Sprite = new Sprite();
var coyot:Sprite = new Sprite();
botspri.graphics.beginFill(0xFFCC00);
botspri.graphics.drawCircle(275,200,20);
botspri.buttonMode =true;
coyot.addChild(botspri);
this.addChild(coyot);
var ete:Number=2;
botspri.addEventListener(MouseEvent.CLICK, functio, false, 0, false);
function functio (e:MouseEvent){
ete++
trace (ete);
}
coyot.addEventListener(MouseEvent.CLICK, functio1, false, 1, false);
function functio1 (e:MouseEvent){
ete++
trace (ete);
}
var botspric:Sprite = new Sprite();
botspric.graphics.beginFill(0xFFCC00);
botspric.graphics.drawCircle(400,200,20);
botspric.buttonMode =true;
botspric.addEventListener(MouseEvent.CLICK, functioni, false, 0, false);
function functioni (e:MouseEvent){
this.removeChild (coyot);
this.removeChild (botspric);
coyot.removeEventListener(MouseEvent.CLICK, functio1);
botspri.removeEventListener(MouseEvent.CLICK, functio);
}
var botsprico:Sprite = new Sprite();
botsprico.graphics.beginFill(0xFFCC00);
botsprico.graphics.drawCircle(400,400,20);
botsprico.buttonMode =true;
botsprico.addEventListener(MouseEvent.CLICK, functionis, false, 0, false);
function functionis (e:MouseEvent){
coyot.addChild(botspri);
this.addChild(coyot);
this.addChild(botspric);
coyot.addEventListener(MouseEvent.CLICK, functio1);
botspri.addEventListener(MouseEvent.CLICK, functio);
ete=2;
}
this.addChild (botsprico);
this.addChild (botspric); 