Page 4
this._x = Math.random() * 400;
this._y = Math.random() * 10 - 10;var speed = Math.random() * 5 + 2var Xspeed = (Math.random() * 2) * _root.dirIf dir is positive the speed will be positive, if it's negative the speed will always be negative and if its 0 the speed will always be 0.
this.onEnterFrame = function()
{
var myPoint = new Object();
myPoint.x = this._x;
myPoint.y = this._y;if (_root.hitBitmap.hitTest(_root.hitPoint, 0, myPoint))
{hitTest(point to hit, alpha, point to check if hits);var drawMatrix:Matrix = new Matrix ();drawMatrix.translate(this._x, this._y);We want it to draw in the current _x and _y so we tell that to the Matrix object using the function "translate".
translate(_x, _y);_root.hitBitmap.draw(this, drawMatrix);
_root.visibleBitmap.draw (this, drawMatrix);Parameters for the draw function:
draw(object to be draw, matrix object); this.removeMovieClip();
}this._y += speed;this._x += Xspeed; if (this._y > 500)
{
this.removeMovieClip();
}
}snow effect. Posted on 07/31/2008
Couldnt get it to work even when I copied your code. Obviously I am missing some information. The instructions were not clear enough for me and could not get it to work.






help
and feedback
latest
news
latest
forum entries