tags:

views:

194

answers:

2

Hi,

I need to do a motion tween in Flash CS4 that leaves a trail. Something like spraying. I created a circle that represents spray dot and I'm trying to move that dot with motion tween but I need it to leave a trail (color spray).

Is that possible?

Tnx

+1  A: 

Here's a flash tutorial how to do this.

Ólafur Waage
+1  A: 

Yes, in the Olafur's example the trick is not in the motion tween, what you need to do is to duplicate the instance of your movie clip every frame or every time the user moves the mouse.

If you want to make the trail fade you can add an onEnterFrame() function to the clips and inside this function decrease the _alpha (lower decreasing causes longer trail), if the value drops to 0 then remove the clip, this to avoid performance problems (Thanks Johan Öbrink for the note).

Sorry for don't post an example but I don't longer use Flash so I can't test it here. Anyway I hope this helps you.

victor hugo
An easier way of fading the trail is to put the code in the clip that is being duplicated. In an enterframe listener or interval call, decrease this.alpha and if alpha==0, call parent.remove(this);
Johan Öbrink
Yes, but also you must remove it from the collection so you'll check _alpha property anyway ;)
victor hugo
Remove it from what collection? If you let the clip fade and remove itself, you don't need a collection which makes everything easier and more manageable.
Johan Öbrink
Yes, you're right! I fixed my answer ;)
victor hugo