Codice PHP:
// reset alpha
function reset(IDactive){
for(I=1;I<10;I++){
this["img"+I]._alpha=50
this["img"+I].stato=false
}
this["im"+IDactive]._alpha=100
this["im"+IDactive].stato=true
}
// prototipo clip img
MovieClip.prototype.gestIMG=function(){
this.onRollOver=function(){
if(!this.stato){
this._alpha=100
}
}
this.onRollOut=function(){
if(!this.stato){
this._alpha=50
}
}
this.onPress=function(){
if(!this.stato){
reset(this.ID)
// altre azioni
}
}
}
// assegnazione prototipo
for(I=1;I<10;I++){
this["img"+I].ID=I
this["img"+I].gestIMG()
}