-
[F8] Limit number of copies within a script?
Hi everyone.
I'm using the following script to generate snow, bubbles, falling hearts for valentinesday, or stuff like that.
function onEnterFrame() {
var mydepth = getNextHighestDepth();
var copy = heart.duplicateMovieClip('sne'+mydepth,mydepth);
copy._x = random(900);
copy._xscale = random(100);
copy._yscale = copy._xscale;
copy._alpha = copy._xscale;
copy._rotation = random(15);
}
The problem is that it just keeps going on and on, and if you wait long enough, it starts skipping frames, and eventually it'll jam up the entire computer.
Is there any way to limit the number of copies, or the available depth-levels?
As you might guess I'm not really an ActionScript-buff... ;-)
Cheers
-
Flashmatics
welcome to FK ... u need to remove the movieclips when no longer needed (for example when they are not on stage any longer)
to see an example download :: Letter/Number Rain :: from my library and see how that has been scripted..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|