Our Swish tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website.  Home Flash & Swish Swish Tutorials Falling Star Field
Your Ad Here

Falling Star Field


Example:

Open swishmax and add the following code to Scene_1.

onFrame (1) {
for (k=0; k<50; k++) {
fall.duplicateSprite("fall"+k,k);
}
}

Now create 4 seperate squares 4 x 4 pixels, and align them the width of the movie

Group together as a sprite, name the sprite fall and place at the top of the movie outside the work area, Add the following code to the sprite.

onLoad () {
movieWidth = 200;
movieHeight = 250;
i = 1+Math.random()*7;
this._x = Math.random()*movieWidth;
this._y = -5;
}
onEnterFrame() {
this._y += i;
if (this._y>=movieHeight) {
this._y = -5;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._y = -5;
}
}

That's it you have created a falling star field.

Press Ctrl+T to test your movie in player.



Author's URL: Craig Lowe
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Internet & computing Flash is a vector-based moving graphics format created by Macromedia for the publication of animations on the World Wide Web. More Flash & Swish: Most Popular Materials | Fresh Materials | More Swish Tutorials at FlashPerfection.com

Add comments to "Falling Star Field"

Only registered users can write comment

No comments yet...