# Add particles from an Array inside to a MovieClip

**URL:** <https://forum.kirupa.com/t/add-particles-from-an-array-inside-to-a-movieclip/304667>\
**Category:** flash\
**Created:** [February 11, 2010, 3:22pm UTC](https://forum.kirupa.com/t/add-particles-from-an-array-inside-to-a-movieclip/304667 "2010-02-11T15:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [February 11, 2010, 3:22pm UTC](https://forum.kirupa.com/t/add-particles-from-an-array-inside-to-a-movieclip/304667/1 "2010-02-11T15:22:55Z")

</div>

```auto

var myArray:Array = new Array();

for(var i=0; i<10; i++){

var p:Particle = new Particle();

p.x = Math.random() * 250;
p.y = Math.random() * 250;
addChild(p);

myArray.push(p);
}

```

Hi,

I have this array of particles and I was wondering how can I add this particles inside a movieClip, in other  
words I would like to add particle “p” to a movieClip that I have on the stage with an instance name of “mainMC”.

Also, is it possible to display the number of particles § inside mainMC in a text field? On this case I know it will be 10, but this will change.

Can some be so kind and show me how to do this?

Thanks a lot!
