
Код AS1/AS2:
var arr:Array = [circle1, circle2, circle3, circle4, circle5, circle6]
for(var i:Number = 0;i<arr.length;i++){
var but:MovieClip = this["rec"+(i+1)];
but.id = i
but.onRelease = function() {
arr[this.id].tube.play();
for(var j:Number = 0;j<arr.length;j++){
if(j!=this.id){
var circle:MovieClip = arr[j].tube;
if(circle._currentframe >49){
circle.onEnterFrame = function() {
if(this._currentframe!=50){
this.prevFrame()
} else {
delete this.onEnterFrame;
}
}
}
}
}
}
}