Foros del Web » Creando para Internet » Flash y Actionscript »

explicacion?

Estas en el tema de explicacion? en el foro de Flash y Actionscript en Foros del Web. alguien puede explicarme como funciona este codigo? gracias en movieclip: onClipEvent (load) { sticky_load(1); internal.gotoAndStop(2); } onClipEvent (enterFrame) { sticky_update(); } onClipEvent (mouseDown) { sticky_press(); ...
  #1 (permalink)  
Antiguo 06/08/2007, 11:32
 
Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 16 años, 8 meses
Puntos: 0
explicacion?

alguien puede explicarme como funciona este codigo? gracias


en movieclip:

onClipEvent (load) {
sticky_load(1);
internal.gotoAndStop(2);
}
onClipEvent (enterFrame) {
sticky_update();
}
onClipEvent (mouseDown) {
sticky_press();
}
onClipEvent (mouseUp) {
sticky_release("interactive");
}



en frame capa acciones:

accel=.8;
convert=.2;
Movieclip.prototype.sticky_load=function(menuNumbe r){
mysound=new Sound(this);
_parent.released=0;
number=menuNumber;
iterations=5;
xstart=_x;
drag=0;
ystart=_y;
targetx=xstart;
targety=ystart;
r=5;
x=(2*Math.PI)*(number/iterations);
t=Math.tan(x);
mycol=new Color(internal);
_parent.drag=0;
}
Movieclip.prototype.sticky_update=function(){
if(this.hitTest(_root._xmouse,_root._ymouse,true) and _parent.drag<2 and _parent.released==0){
if(random(5)==0){
counter++;
addcol=random(151);mycol.setTransform({rb:addcol,g b:addcol,bb:addcol})
duplicateMovieClip ("line0", "line"+counter, counter );};deltax=_parent._xmouse-xstart;deltay=_parent._ymouse-ystart;targetx=(_parent._xmouse-deltax/r);targety=(_parent._ymouse-deltay/r);if(drag==0){mysound.attachSound("sound7");mysou nd.start();this.swapDepths(2);drag=1;_parent.drag+ +}} else if(_parent.released==0){_parent["inhead"+(number+1)]._visible=1;mycol.setTransform({ra:100,ga:100,ba:1 00,rb:0,gb:0,bb:0});targetx=xstart;targety=ystart; if(drag==1){this.swapDepths(0);drag=0;_parent.drag--}} else {targety=-170;targetx =(t*85)-56;if(_parent.trigger==1){this.removeMovieClip();} };
xpos = xpos * _parent.accel + (targetx - this._x) * _parent.convert
this._x += xpos
ypos = ypos * _parent.accel + (targety - this._y) * _parent.convert
this._y += ypos
}
Movieclip.prototype.sticky_press=function(){
if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
r=10;
}
}
Movieclip.prototype.sticky_release=function(subnam e){
if(_root.pause==0){
if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
_parent.atext = subname.toUpperCase();
_parent.released=1;
_parent.label=subname;
_parent.atext = subname.toUpperCase();
_parent.gotoAndPlay(_parent._currentframe+1);
};
}
}
  #2 (permalink)  
Antiguo 06/08/2007, 11:33
 
Fecha de Ingreso: septiembre-2006
Mensajes: 1.193
Antigüedad: 17 años, 6 meses
Puntos: 30
Re: explicacion?

coloca el codigo en las etiquetas code, no se puede leer bien.
  #3 (permalink)  
Antiguo 06/08/2007, 11:45
 
Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 16 años, 8 meses
Puntos: 0
Re: explicacion?

asi mejor?

Código:
en movieclip:

onClipEvent (load) {
sticky_load(1);
internal.gotoAndStop(2);
}
onClipEvent (enterFrame) {
sticky_update();
}
onClipEvent (mouseDown) {
    sticky_press();
}
onClipEvent (mouseUp) {
    sticky_release("interactive");
}



en frame capa acciones:

accel=.8;
convert=.2;
Movieclip.prototype.sticky_load=function(menuNumber){
mysound=new Sound(this);
_parent.released=0;
number=menuNumber;
iterations=5;
xstart=_x;
drag=0;
ystart=_y;
targetx=xstart;
targety=ystart;
r=5;
x=(2*Math.PI)*(number/iterations);
t=Math.tan(x);
mycol=new Color(internal);
_parent.drag=0;
}
Movieclip.prototype.sticky_update=function(){
	if(this.hitTest(_root._xmouse,_root._ymouse,true) and _parent.drag<2 and _parent.released==0){
	if(random(5)==0){
	counter++;
	addcol=random(151);mycol.setTransform({rb:addcol,gb:addcol,bb:addcol})
	duplicateMovieClip ("line0", "line"+counter, counter );};deltax=_parent._xmouse-xstart;deltay=_parent._ymouse-ystart;targetx=(_parent._xmouse-deltax/r);targety=(_parent._ymouse-deltay/r);if(drag==0){mysound.attachSound("sound7");mysound.start();this.swapDepths(2);drag=1;_parent.drag++}} else if(_parent.released==0){_parent["inhead"+(number+1)]._visible=1;mycol.setTransform({ra:100,ga:100,ba:100,rb:0,gb:0,bb:0});targetx=xstart;targety=ystart;if(drag==1){this.swapDepths(0);drag=0;_parent.drag--}} else {targety=-170;targetx =(t*85)-56;if(_parent.trigger==1){this.removeMovieClip();}};
	xpos = xpos * _parent.accel + (targetx - this._x) * _parent.convert 
	this._x += xpos
	ypos = ypos * _parent.accel + (targety - this._y) * _parent.convert 
	this._y += ypos
}
Movieclip.prototype.sticky_press=function(){
	if(this.hitTest(_root._xmouse,_root._ymouse,true)){
	r=10;
	}
}
Movieclip.prototype.sticky_release=function(subname){
	if(_root.pause==0){
	if(this.hitTest(_root._xmouse,_root._ymouse,true)){
	_parent.atext = subname.toUpperCase();
	_parent.released=1;
	_parent.label=subname;
	_parent.atext = subname.toUpperCase();
	_parent.gotoAndPlay(_parent._currentframe+1);
	};
	}
}
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:33.