Ok… now my code is really really crappy and can be optimized a million times over, but its a point in the right direction I guess.
For some reason I could not get the setInterval function work correctly with this, I don’t see why I would have had problems, but I did, so that just made it worse, but this will be a point in the right direction at least.
Ok, I created a 3x3 white circle on the stage and made it a movie clip. Then I gave it the instance name “star” (no quotes).
Then I opened the actions panel for the movie clip and applied these actions.
Now this creates the blinking effect so that you don’t have to do the frames way, because with the frames, since it isn’t random they will all blink at the same time. This is where setInterval was giving me problem… I am a bit off today obviously…lol.
Now, this will first make your original clip invisible (we want that), then it will duplicate your clip 100 times (the i<100 part defines how much). Then then it random scatters each clip within your movies stage area (where the viewer can see) and randomly sets the alpha between 10 and 70.
Well, I don’t see a very short way to use setInterval here, but here’s what I’ve come up with. Create a clip called star. On one layer of that clip, draw your star, then create another layer and add that code in it:
function blink(){
clearInterval(this.interval);
this._visible=1;
this.interval=setInterval(this,"invisible",randomInterval);
}
function invisible(){
clearInterval(this.interval);
this._visible=0;
this.interval=setInterval(this,"blink",randomInterval);
}
randomInterval=random(2000)+1000;
this.interval=setInterval(this,"invisible",randomInterval);