# Displaying a lot of movie clips, fast

**URL:** <https://forum.kirupa.com/t/displaying-a-lot-of-movie-clips-fast/260814>\
**Category:** flash\
**Created:** [May 20, 2008, 5:27am UTC](https://forum.kirupa.com/t/displaying-a-lot-of-movie-clips-fast/260814 "2008-05-20T05:27:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanaeda](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kanaeda](https://forum.kirupa.com/u/kanaeda)\
**Post date:** [May 20, 2008, 5:27am UTC](https://forum.kirupa.com/t/displaying-a-lot-of-movie-clips-fast/260814/1 "2008-05-20T05:27:00Z")

</div>

I’ve got like a little “particle” effect, but it runs slowly. It’s my first time trying something like this, so don’t hate me for being dumb. I’ve drawn a little symbol and attached this class to it: (I’m also new to classes, so if you could critique that too, that’d be great!)

> 

package gameplay{

```
import flash.display.MovieClip;

import gs.TweenLite;
import flash.geom.ColorTransform;
import flash.geom.Transform;

public class ember extends MovieClip{        

    var hdir:Number;
    var vdir:Number;
    
    var hvel:Number;
    var vvel:Number;
    
    var sizeTo:Number;
    var lifeTime:Number;
    
    var cl:ColorTransform;
    
    public function ember(x1:Number, y1:Number, type:Boolean) { 
    
    x = x1; 
    y = y1;
    
    cl = new ColorTransform(2,0.5, 0, 1);
    
    this.transform.colorTransform = cl;
    
    if (Math.round(Math.random() * 1) == 0) {
        hdir = -1;
    } else {
        hdir = 1;
    }
    
    if (type == false) //center one
    {
    if (Math.round(Math.random() * 1) == 0) {
        vdir = -1;
    } else {
        vdir = 1;
    }
        
    } else if (type == true) //ground one
    {
        vdir = -1;
    }
    
    scaleX = scaleY = (Math.random()*0.8);
    
    sizeTo = (Math.random()*0.4)+0.1;
    lifeTime = (Math.random()*0.8)+0.1;
    
    hvel = (Math.random()*0.5)+0.1;
    vvel = (Math.random()*0.5)+0.1;
    
    
    TweenLite.to(this, lifeTime*3, {rotation:(vvel)*355, scaleX: sizeTo, scaleY: sizeTo,y:this.y+(vvel*vdir)*215, x:this.x+(hvel*hdir)*215});
    
    TweenLite.to(cl, lifeTime*4, {alphaMultiplier: 0, greenMultiplier:2, redMultiplier:2, onComplete:die, onUpdate:colorUpdate});
    
    
    }
    
   function colorUpdate():void {
        this.transform.colorTransform = cl;
    }
    
    function die():void {
        this.parent.removeChild(this);
    }
}

```

}

And then I call to it later

> 

for(var i:int = 0; i\< 7; i++) {

```
        var emb:ember = new ember(this.x,this.y,false);
        addChild(emb);

```

}

Or whatever… What am I doing wrong? It’s very simple code (it’s meant to be) The actual symbol itself is very simple… And CONSTRUCTIVE help would be appreciated… I’m still new to as3.

---

<div class="post-metadata">

**Author:** ![kanaeda](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kanaeda](https://forum.kirupa.com/u/kanaeda)\
**Post date:** [May 23, 2008, 11:14am UTC](https://forum.kirupa.com/t/displaying-a-lot-of-movie-clips-fast/260814/2 "2008-05-23T11:14:00Z")

</div>

Can anyone help? What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [May 23, 2008, 11:56am UTC](https://forum.kirupa.com/t/displaying-a-lot-of-movie-clips-fast/260814/3 "2008-05-23T11:56:31Z")

</div>

how many frames per second is your movie?

Try using 24 like cinema, or 30 like NTSC tv. You can even push it faster like 90 fps, but depending on the animation not all cpus will be able to go that fast and you could have sync problems with audio.
