# Create actionscript movieclip at the back of a layer

**URL:** <https://forum.kirupa.com/t/create-actionscript-movieclip-at-the-back-of-a-layer/288207>\
**Category:** Uncategorized\
**Created:** [May 12, 2009, 7:47pm UTC](https://forum.kirupa.com/t/create-actionscript-movieclip-at-the-back-of-a-layer/288207 "2009-05-12T19:47:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fishb0n3](https://avatars.discourse-cdn.com/v4/letter/f/c4cdca/32.png) [@fishb0n3](https://forum.kirupa.com/u/fishb0n3)\
**Post date:** [May 12, 2009, 7:47pm UTC](https://forum.kirupa.com/t/create-actionscript-movieclip-at-the-back-of-a-layer/288207/1 "2009-05-12T19:47:47Z")

</div>

I wanted to create a rain movieclip with the actionscript below, but i wanted the rain to appear at the back of a layer. How do i change the script?

Someone please help me!! im short of time… ![](http://www.flashmove.com/forum/images/smilies/sad.gif)

//Creating an empty movieclip to attach the clip from library  
\_root.spring\_mc.rain\_mc.createEmptyMovieClip(“hold er”,this.getNextHighestDepth(0));  
//settig variables  
holder.maxdrops=100;//no of drops  
var downspeed=60;//speed of the drops  
var dropslop=10;//slop of the drops  
//Part 1 attaching the clips with loop  
for(i=0;i\<holder.maxdrops;i++){  
holder.attachMovie(“circleclip”,“drop”+i,i+5);  
focuseddrop=holder[“drop”+i]  
focuseddrop.cacheAsBitmap=true;  
focuseddrop.\_x=random(Stage.width);  
focuseddrop.\_y=random(Stage.height);  
focuseddrop.\_yscale=random(100);  
focuseddrop.\_rotation=-dropslop;  
}

//part 2 setting an interval for motion of drops  
var dropup=setInterval(movedrop,1)  
//function to repeat in the interval  
function movedrop(){  
for(i=0;i\<holder.maxdrops;i++){  
focuseddrop=holder[“drop”+i]  
focuseddrop.\_rotation=-dropslop;  
focuseddrop.\_y+=25+downspeed/focuseddrop.\_yscale;  
focuseddrop.x+=Math.tan(dropslop);  
if(focuseddrop.\_y\>=Stage.height+20){  
focuseddrop.\_y=random(30);  
focuseddrop.\_x=random(Stage.width);  
}  
}  
}

stop();
