[FLMX] utilizo esta programaci�n pero no la entiendo...
buenas,
he utilizado esta programaci�n varias veces sobre un movieclip para hacer
que aparezca con aceleraci�n, pero no la entiendo... bueno, lo que no
entiendo es la diferencia entre las propiedades _y, _targety y _ypos.
_y es la posici�n actual del movieclip, �pero las otras dos? mirado en la
ayuda de flash pero me da error y no encuentra nada... quiz�s es una
pregunta est�pida, pero ya llevo rato d�ndole vueltas.
onclipevent (load) {
t = 0;
this._x = 0;
this._y = -10;
this.accel = .3;
this.convert = .2;
this.targetx = 0;
this.targety = -14;
}
onclipevent (enterframe) {
t = t+1;
this.xpos = this.xpos*this.accel+(this.targetx-this._x)*this.convert;
this._x += this.xpos;
this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
this._y += this.ypos;
trace ("la t: " + t);
trace ("la y: " + this._y);
trace ("la ypos: " + this.ypos);
trace ("el targety: " + this.targety);
if ((t>15) && (t<17)) {
this.targety = 26;
this.pastill.gotoandstop(2);
this.gotoandstop(2);
}
if ((t>50) && (t<52)) {
_root.menucomm.fletcher1.targetx = 12;
}
}
saludos,
rosa
he utilizado esta programaci�n varias veces sobre un movieclip para hacer
que aparezca con aceleraci�n, pero no la entiendo... bueno, lo que no
entiendo es la diferencia entre las propiedades _y, _targety y _ypos.
_y es la posici�n actual del movieclip, �pero las otras dos? mirado en la
ayuda de flash pero me da error y no encuentra nada... quiz�s es una
pregunta est�pida, pero ya llevo rato d�ndole vueltas.
onclipevent (load) {
t = 0;
this._x = 0;
this._y = -10;
this.accel = .3;
this.convert = .2;
this.targetx = 0;
this.targety = -14;
}
onclipevent (enterframe) {
t = t+1;
this.xpos = this.xpos*this.accel+(this.targetx-this._x)*this.convert;
this._x += this.xpos;
this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
this._y += this.ypos;
trace ("la t: " + t);
trace ("la y: " + this._y);
trace ("la ypos: " + this.ypos);
trace ("el targety: " + this.targety);
if ((t>15) && (t<17)) {
this.targety = 26;
this.pastill.gotoandstop(2);
this.gotoandstop(2);
}
if ((t>50) && (t<52)) {
_root.menucomm.fletcher1.targetx = 12;
}
}
saludos,
rosa
hola rosa, como bien dices _y es la posici�n _y del mc (movieclip) respecto
al origen, en cambio las otras no son propiedades sino variables cuyos
valores son el resultado de las operaciones del segundo miembro; si bien en
este caso est� un poco complicado, ver�s que en el primer rengl�n se
establece el valor de "this.ypos", y en el segundo rengl�n se atribuye este
valor resultante this._y sum�ndolo:
this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
this._y += this.ypos;
podr�as cambiar los nombres de las variables y el resultado ser�a el mismo
(has de notar que antes has asignado valores esas variables).
saludos.gusmania
"rosa" <rosa@loncis.com> escribi� en el mensaje
news:e5p9n6$fai$1@forums.macromedia.com...
> buenas,
>
> utilizado esta programaci�n varias veces sobre un movieclip para hacer
> que aparezca con aceleraci�n, pero no la entiendo... bueno, lo que no
> entiendo es la diferencia entre las propiedades _y, _targety y _ypos.
>
> _y es la posici�n actual del movieclip, �pero las otras dos? mirado en
> la ayuda de flash pero me da error y no encuentra nada... quiz�s es una
> pregunta est�pida, pero ya llevo rato d�ndole vueltas.
>
> onclipevent (load) {
> t = 0;
> this._x = 0;
> this._y = -10;
> this.accel = .3;
> this.convert = .2;
> this.targetx = 0;
> this.targety = -14;
> }
> onclipevent (enterframe) {
> t = t+1;
> this.xpos = this.xpos*this.accel+(this.targetx-this._x)*this.convert;
> this._x += this.xpos;
> this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
> this._y += this.ypos;
> trace ("la t: " + t);
> trace ("la y: " + this._y);
> trace ("la ypos: " + this.ypos);
> trace ("el targety: " + this.targety);
> if ((t>15) && (t<17)) {
> this.targety = 26;
> this.pastill.gotoandstop(2);
> this.gotoandstop(2);
> }
> if ((t>50) && (t<52)) {
> _root.menucomm.fletcher1.targetx = 12;
> }
> }
>
> saludos,
> rosa
>
al origen, en cambio las otras no son propiedades sino variables cuyos
valores son el resultado de las operaciones del segundo miembro; si bien en
este caso est� un poco complicado, ver�s que en el primer rengl�n se
establece el valor de "this.ypos", y en el segundo rengl�n se atribuye este
valor resultante this._y sum�ndolo:
this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
this._y += this.ypos;
podr�as cambiar los nombres de las variables y el resultado ser�a el mismo
(has de notar que antes has asignado valores esas variables).
saludos.gusmania
"rosa" <rosa@loncis.com> escribi� en el mensaje
news:e5p9n6$fai$1@forums.macromedia.com...
> buenas,
>
> utilizado esta programaci�n varias veces sobre un movieclip para hacer
> que aparezca con aceleraci�n, pero no la entiendo... bueno, lo que no
> entiendo es la diferencia entre las propiedades _y, _targety y _ypos.
>
> _y es la posici�n actual del movieclip, �pero las otras dos? mirado en
> la ayuda de flash pero me da error y no encuentra nada... quiz�s es una
> pregunta est�pida, pero ya llevo rato d�ndole vueltas.
>
> onclipevent (load) {
> t = 0;
> this._x = 0;
> this._y = -10;
> this.accel = .3;
> this.convert = .2;
> this.targetx = 0;
> this.targety = -14;
> }
> onclipevent (enterframe) {
> t = t+1;
> this.xpos = this.xpos*this.accel+(this.targetx-this._x)*this.convert;
> this._x += this.xpos;
> this.ypos = this.ypos*this.accel+(this.targety-this._y)*this.convert;
> this._y += this.ypos;
> trace ("la t: " + t);
> trace ("la y: " + this._y);
> trace ("la ypos: " + this.ypos);
> trace ("el targety: " + this.targety);
> if ((t>15) && (t<17)) {
> this.targety = 26;
> this.pastill.gotoandstop(2);
> this.gotoandstop(2);
> }
> if ((t>50) && (t<52)) {
> _root.menucomm.fletcher1.targetx = 12;
> }
> }
>
> saludos,
> rosa
>
More discussions in Foro en español
adobe
Comments
Post a Comment