Salve a tutti, ho scritto la mia prima classe in AS
con un metodo che mi funziona correttamente. Non riesco a capire perché se aggiungo un secondo metodo, questo no riesco piú a richiamarlo.
Da cosa puķ dipendere?
Questa č la classe coi 2 metodi:
codice:class Movimento{ //Funciķn publica (Accesible desde el nombre de instancia de la clase) que nos servira public function muovescala(target, x,y,a,sx,sy,steps) { target.onEnterFrame=function () { this._rot=(Number(a)-this._rotation)/Number(steps); this._xstep=(Number(x)-this._x)/Number(steps); this._ystep=(Number(y)-this._y)/Number(steps); this._xsca=(Number(sx)-this._xscale)/Number(steps); this._ysca=(Number(sy)-this._yscale)/Number(steps); this._steps=steps; if (this._steps) { this._rotation+=this._rot; this._x+=this._xstep; this._y+=this._ystep; this._xscale+=this._xsca; this._yscale+=this._ysca; this._steps--; } else { delete this._xstep; delete this._ystep; delete this._xsca; delete this._ysca; delete this._steps; delete this.onEnterFrame; } } } public function scala(target,sx,sy,steps) { target.onEnterFrame=function () { this._xsca=(Number(sx)-this._xscale)/Number(steps); this._ysca=(Number(sy)-this._yscale)/Number(steps); this._steps=steps; if (this._steps) { this._xscale+=this._xsca; this._yscale+=this._ysca; this._steps--; } else { delete this._xsca; delete this._ysca; delete this._steps; delete this.onEnterFrame; } } } }

Rispondi quotando