Comunidad de diseño web y desarrollo en internet online

Duda Codigo Actions Script

Citar            
MensajeEscrito el 25 Jul 2008 04:24 pm
Hoal A todos necesito que alguien me ayude, y me explique que significa este
codigo porfavor
onClipEvent (load) {
origX = this._x;
origY = this._y;
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.startDrag();
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.stopDrag();
}
if (_parent.s4.hitTest(this._x, this._y, true)) {
this._x = this._parent.s4._x;
this._y = this._parent.s4._y;
} else {
this._x = origX ;
this._y = origY;
}
}


Este es otro porfa si alguien me puede ayudar gracias y explicarme en consiste cada linea de codigo:

onClipEvent (load) {
origX = this._x;
origY = this._y;
ok = false;
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.startDrag();
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.stopDrag();
ok = true
} else {
ok = false;
}
if (ok) {
if (_parent.s4.hitTest(this._x, this._y, true)) {
this._x = this._parent.s4._x;
this._y = this._parent.s4._y;
} else {
this._x = origX;
this._y = origY;
}
}
}

Por mker

20 de clabLevel



 

msie7
Citar            
MensajeEscrito el 25 Jul 2008 08:35 pm
Bueno el primero lo que hace es que cuando presiones encima de el movie comienza a hacer drag sobre el y cuando lo sueltas deja de hacer drag y chequea si este movie está haciendo hit con otro llamado s4, de ser así coloca el movie en las mismas coordenadas que s4, si no está haciendo hit regresa a el movie a su lugar de inicio.

El segundo lo que hace es lo mismo pero se complica un poco con una variable ok que parece que la han situado por si el usuario mueve el mouse muy rápido y lo suelta, pero se ha complicado un poco la persona que lo ha hecho.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.