Need help with duplicating clip & scripted movement

I’m making a banner ad for work and have a part where I want to basically rain our logo for like 15 frames or so. I’ve started doing this manually but as you can imagine, it’s a bit tedious and time consuming. I looked at Kirupa’s tutorials on snow and continual motion but I’m wondering how I would go about scripting it so it does the following within mc_logorain (which is sitting on the root) on enter:

  1. duplicates mc_logo many times, randomizing size.
  2. Rains for a set amount of time or frames and unloads.

I think I understand the logic of what’s supposed to happen, just not sure of the syntax. Would there be two loops? One for the duplicate/random size and one to say basically “while i < 100, keep duplicating and raining”? If someone could set me on the right track, I’d appreciate it.

Pete

maybe this may help u…hehehe :wink:

Thanks, bud. I’ll take a look.

Ok, For the project I ended up doing it manually but have since had the chance to look at your file…very nice but a quick question. What part of the script is causing the slowdown? Like when it first starts raining, it starts fast then slows down to a crawl while next batch of rain streaks past. It’s only the first sequence of rain that seems to slow down that much so I’m wondering which part of the script would be causing it? I like how it tries to emulate parallax…I’d just like to make it so the effect is more even as it falls. Any idea?

The difference in speed appears to be randomized throughout the movie. Some start off fast and continue to move fast. It’s others whose slower speed just continue to creep at that slow speed. I don’t think any of the balls actually change speed as they’re falling. Correct me if I’m wrong.

balls.vy = Math.random () * 10+2;

I’m pretty sure this line sets the random speed for each ball. If you set it to a fixed value, they all fall together in the position from which they start.

Yeah, I figured as much when I started changing numbers around and really that’s the only bit of code that made sense for altering the speed. Thanks for confirming.

Actually had a couple more questions:

How do I script it to load another movie or go to another frame after the functions complete running in the loop? Like, for example, if after the raining finishes fading and I want to fade another MC in? Do I have to unload this, then load another clip?

Also, How would I write it if I wanted the rain to loop infinitely?

if (time >= 5000)

The code in here is based on that timer. The movie continues to loop endlessly, you just can’t see it because the _alpha property gets faded to 0. Comment out the following code to see that:

    if (time &gt;= 5000) {  //the time u want to keep the logo raining
	
	this.onEnterFrame = function () {
	this._alpha +=(0-this._alpha)/5;
	}
}

You could use that timer to load another movie or something if you wanted I suppose. What exactly are you trying to do?

I just want to make it so the raining either repeats for a certain amount of time (or certain amt of frames) and ends off screen, wherein I can fade another clip in afterwards or have something else fade in after this one fades out. For example, here’s a banner ad I animated manually for the same effect:

Banner Example

That method works but I’d like to be able to use this kind of effect modularly for future projects so I can just pop the MC in and be able to integrate it easily with the rest of the animation.

bump