# Loading an animation created in actionscript in a target MC

**URL:** <https://forum.kirupa.com/t/loading-an-animation-created-in-actionscript-in-a-target-mc/258734>\
**Category:** flash\
**Created:** [April 27, 2008, 7:01pm UTC](https://forum.kirupa.com/t/loading-an-animation-created-in-actionscript-in-a-target-mc/258734 "2008-04-27T19:01:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamiegrp](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jamiegrp](https://forum.kirupa.com/u/jamiegrp)\
**Post date:** [April 27, 2008, 7:01pm UTC](https://forum.kirupa.com/t/loading-an-animation-created-in-actionscript-in-a-target-mc/258734/1 "2008-04-27T19:01:25Z")

</div>

Hi there,

I don’t really have a clue about actionscript and I’m working on a bit of flash that has some actionscript in it the randomly generates different snowflakes that move upwards on the stage. Problem is I need them to load into a target mc rather than on the top level of the main timeline and I don’t know how to amend the code.

The code I’m using is:

snowNumber = 60;  
var flakes:Array = new Array(“flake1”, “flake2”, “flake3”,“flake4”,“flake5”,“flake6”)  
for (i=0; i\<snowNumber; i++) {  
newSnow = \_root[flakes[random(flakes.length)]].duplicateMovieClip(“snow”+i, i);  
newSnow.\_x = Math.random()\*Stage.width;  
newSnow.\_y = Stage.height+Math.random()\*300;  
newSnow.maxSnowSpeed = Math.random()\*4;  
newSnow.wind = Math.random()\*6;  
newSnow.\_xscale = newSnow.\_yscale = Math.random()\*60+40  
newSnow.swapDepths(newSnow.\_xscale)  
prevSnow = newSnow;  
newSnow.onEnterFrame = function() {  
//this.\_rotation -= this.maxSnowSpeed+1;  
if(this.\_y\<-50 || this.\_x\>Stage.width+50 || this.\_x\<-50){  
this.\_y = Stage.height+Math.random()\*300;  
this.\_x = Math.random()\*Stage.width;  
} else {  
this.\_y -= this.maxSnowSpeed+1;  
this.\_x += this.wind-4;  
}

```
	//this._alpha = this.alpha;
};

```

}

Can anyone help?

Jamie
