OK commetto sempre il solito errore
Prima devo fargli leggere le funzioni e poi le richiamo dal FOR
così adesso va
codice:_root.assegna=function(nome){ // inizializzazione Variabili _root[nome].mov=false _root[nome].giu=false _root[nome].mystop=false _root[nome].myparent="txt"+substring(_root[nome]._name,5,1); // controllo Movimento _root[nome].onMouseMove=function(){ if(this.hitTest(_root._xmouse,_root._ymouse,false)){ _root[nome].mov=true; _root[_root[nome].myparent].nextFrame() }else{ _root[nome].mov=false; } } // Controllo Click _root[nome].onMouseDown=function(){ if(this.hitTest(_root._xmouse,_root._ymouse,false)){ _root[nome].click=true; }else{ _root[nome].click=false; } } // Enter Frame _root[nome].onEnterFrame=function(){ if(this.mov){ if(this.giu){ if(this._xscale>10){this._yscale=this._xscale-=5;this._rotation+=10;this._y-=5;this._x-=5} else{this.giu=false} } if(!this.giu){ if(this._xscale<50){this._yscale=this._xscale+=5;this._rotation-=10;this._y+=5;this._x+=5} else{this.giu=true} } } if(this.mystop){ if(this._xscale>10){this._yscale=this._xscale-=5;this._rotation+=10;this._y-=5;this._x-=5} else{this.mystop=false;_root[_root[nome].myparent].prevFrame()} } } }// end function Assegna // distribuzione Funzioni con For for(i=1; i<=3; i++){ nome="cubo"+i _root[nome].mov=false _root[nome].giu=false _root[nome].mystop=false _root[nome].myparent="txt"+substring(_name,5,1); // richiamo assegnazione _root.assegna(nome) }//end For
Grazie comunque.
Ciao

Rispondi quotando