Friday, January 18, 2008

flash drag code

snow
amount = 300;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; ithisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*5+.5;
thisFlake.increment = -0.035+Math.random()*0.07;
thisFlake.radian = 0; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y += this.yspeed;
if (this._y>=mHeight) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
};
}


begin drag drop

dragMovie = new Object();
dragMovie.onMouseDown = function() {
if(movie.hitTest(_root._xmouse, _root._ymouse)) {
movie.startDrag();
}
};
Mouse.addListener(dragMovie);
dropMovie = new Object();
dropMovie.onMouseUp = function() {
movie.stopDrag();
};
Mouse.addListener(dropMovie);

drag droppy advanced

http://flash-forum.flashdevils.com/showthread.php?threadid=188583/MovieClip.dropOnTargets()%20prototype.html

effects
http://www.kirupa.com/forum/forumdisplay.php?f=51

Labels: , , ,

0 Comments:

Post a Comment