Removing particles in AS3

Out of context: Reply #3

  • Started
  • Last post
  • 7 Responses
  • fyoucher10

    I would add the particles to a new sprite, and then whenever you need to delete all of the particles, just delete the sprite. This is like nesting the particles in its own container.

    Or if you don't want to do that, you can give the particles generated an instance name (i.e. dot1, dot2), then loop through all of the objects in the display list and search for clips with the characters "dot" in the instance name and then remove them.

    • you also need to remove the event listeners on each particle and stop/remove the timer.Milan
    • Yep, if you use the 2nd option.fyoucher1

View thread