
02.01.2003, 22:59
|
|
Регистрация: May 2002
Адрес: Израиль
Сообщений: 561
|
можно и без звука и т.д.
accel=.8;
convert=.2;
Movieclip.prototype.sticky_load=function(menunumber){
_parent.released=0;
iterations=5;
xstart=_x;
drag=0;
ystart=_y;
targetx=xstart;
targety=ystart;
r=5;
x=(2*Math.PI)*(number/iterations);
t=Math.tan(x);
_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++;
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){
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);
};
}
}
|