Solved

# Flash Sparkle Effect

Posted on 2010-01-07
1,606 Views
Last Modified: 2012-05-08
I'm trying to build a sparkle effect in Flash 8. I need something similar to the sparkles in the header at this page: http://dailyholidays.net/month.php?month=2. I will have some objects falling vertically, and I need the sparkles to come off the objects just like http://dailyholidays.net/month.php?month=2.

Is there any freeware to do this? If not, are there any simple tutorials that I can follow quickly? Thanks guys.
0
Question by:isaacr25
2 Comments

LVL 14

Accepted Solution

First draw a star. Then convert it to a movie clip.  In the library, right click the properties of the movie clip of the star and export for actionscript. Also export for frame 1. Make sure the identifier is called star.

Create another shape, the shape you want the stars to follow, for example , you draw a circle and convert it to a movie clip. Give it an instance name of obj. Tween the circle.

Then add this code in frame 1

var maxNegativePosition:Number = 20;
var maxPositivePosition:Number = 80;
var scaleNum:Number = 5;
var scaleRotation:Number = 4;

var star:MovieClip;

function moveStar(starInstance:MovieClip) {
starInstance._xscale -= scaleNum;
starInstance._yscale -= scaleNum;
starInstance._rotation += scaleRotation;

if (starInstance._xscale <= 1) {
starInstance.removeMovieClip();
}
}

function createStars():Void {
star = attachMovie("star", "star"+this.getNextHighestDepth(), this.getNextHighestDepth());
star._x = obj._x - Math.floor(Math.random() * maxNegativePosition);
star._y = obj._y - Math.floor(Math.random() * maxNegativePosition);
star.onEnterFrame = function() {
moveStar(this);
};

star = attachMovie("star", "star"+this.getNextHighestDepth(), this.getNextHighestDepth());
star._x = obj._x + Math.floor(Math.random() * maxPositivePosition);
star._y = obj._y + Math.floor(Math.random() * maxPositivePosition);
star.onEnterFrame = function() {
moveStar(this);
};
numInstances++;
}

onEnterFrame = function() {
createStars();
};

Stars will then be created at runtime and follow your circle or whatever object you created.
0

LVL 19

Assisted Solution

0

## Join & Write a Comment Already a member? Login.

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
HOW TO CREATE A WEB 2.0 IMAGE WITH A REFLECTION I would like to start by saying I know Web 2.0 isn't a style. It is actually the practice of information sharing or  collaboration on the Web. It is also associated with the technology that is used …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

#### 731 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!