# Movie clip alpha trail

**URL:** https://forum.kirupa.com/t/movie-clip-alpha-trail/106539
**Category:** Uncategorized
**Created:** [April 6, 2004, 8:15pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539 "2004-04-06T20:15:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![massive3215](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/massive3215/32/253_2.png) [@massive3215](https://forum.kirupa.com/u/massive3215)
#### Post date: [April 6, 2004, 8:15pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/1 "2004-04-06T20:15:06Z")

</div>

I’m having trouble getting my movieclips to have trails that fade behind it. I’m having the dupilcate movieclips delete themselves once their alpha reaches a certain point. Any idea what’s wrong with my code? I’m pretty sure it has something to do with the counters.

You can view my fla here: [http://www.immeldesign.com/help/helpMe!.fla](http://www.immeldesign.com/help/helpMe!.fla)

Thanks!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 10:28pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/2 "2004-04-06T22:28:36Z")

</div>

So, basically you want each dollar bill to be followed by a motion-blur trail (made of duplicates that alpha fade) right?

- Jim

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 11:15pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/3 "2004-04-06T23:15:30Z")

</div>

Here’s a link to a modified version which puts trails on the dollar bills.

[Alpha Trails](http://www.krazydad.com/bestiary/alphatrails.zip)

Saved in Flash MX format.

Changes:

- Removed scripts attached to each dollar bill, in favor of a single unified  
function (billFly).

- Changed variables attached to root (such as moveX1 and myRot2) to variables attached to each dollarbill and referenced using this.varname from billFly().

- Changed method for creating trails - no removeClip necessary. The trails are a collection of movies each of which follows the one before it using a short onEnterFrame handler.

- Jim

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2004, 2:44pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/4 "2004-04-07T14:44:01Z")

</div>

Thanks for your help Jim. I appreciate you taking the time to describe everything in the file so I understand it, too.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2004, 7:19pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/5 "2004-04-07T19:19:26Z")

</div>

Hi Jim,

I was going through the file and testing it, and if you click on bush’s head a few times the dollar bills disappear. I didn’t want that to happen? Do you know what the problem might be?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2004, 9:20pm UTC](https://forum.kirupa.com/t/movie-clip-alpha-trail/106539/6 "2004-04-07T21:20:44Z")

</div>

Ah, here it is:

setupTrails(bill1\_mc,50);  
setupTrails(bill2\_mc,50+kNbrTrailClips+1);  
setupTrails(bill3\_mc,50+2\*(kNbrTrailClips+1));

I’m assigning layers 50 thru 50+kNbrTrailClips\*3 to the dollar bills. The bombs you are generating are using myCounter which increments each time you  
generate a bomb. After you generate 50 bombs, the layers start to overlap. When a bomb uses the same layer as a bill, it obliterates the bill.

There are three ways, to fix it. You can start ‘myCounter’ (which is the layer number for the bombs) at a higher value than the bills use:

myCounter = kNbrTrailClips\*4

OR you can decrement myCounter back to 0 after the bombs disappear

OR you can initialize myCounter to a low value (significantly below 50) before the loop that generates the bombs.

- Jim
