Tema: explicacion?
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/08/2007, 11:45
kaquna
 
Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 17 años, 3 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);
	};
	}
}