Particle

Hi there
I am currently working on particle systems. To start with, I make a system with only 1 particle. Yes… only 1. You will see what the problem is when you run the script. I put a smoke particle on the stage and use duplicateMovieClip() to get it to place. I’ve put the following codes to it:


onClipEvent (enterFrame) {
  if (_name != "smoke") {
    this._x += Math.floor(Math.random()*10-5)
    this._y -= Math.floor(Math.random()*10-5)
    this._xscale += 2
    this._yscale += 2
    this._alpha -= 2
    if (this._alpha <= 0) {
      this.removeMovieClip()
    }
  }
}

As simple as that… and I put:


count = 0
onEnterFrame = function() {
  count++
  _root.duplicateMovieClip("smoke"+count,getNextHighestDepth(),{_x:100+Math.floor(Math.random()*10-5),_y:100+Math.floor(Math.random()*10-5)})
}

to the first frame. And you see the effect… It’s hard to describe. It’s… just not working as expected. It is supposed to be a smoke from top-down view. But it seems that there is only one particle vibrating… What’s the problem…