AS3 Particle Explosion Crash

49 Views Asked by At

Hellooooo, hope y'all are doing great.

A while ago, I asked a question about how to do particle explosions in AS3 when I was coming from AS2. Luckily, I got help from Organis (thank you so much btw), but every time I try export the animation in SWF, it keeps crashing my file and I'm not sure why?

I should probably preface that what I'm doing is specifically for animation. I'm not trying to make a game, just a simple script where the movieclip I created can explode into different objects in its timeline...if that made any sense.

In case anyone needs the actual file itself, you can download it right here: https://sta.sh/018lqswjfmp2

Here is the AS2 version in case anyone needs it: https://sta.sh/02fzsqon3ohw

Here is the code given to me by Organis:

// Allows the script to interact with the Particle class.
import Particle;

// Number of particles.
var maxparticles:int = 200;

// I imagine you will need to access the particles somehow
// in order to manipulate them, you'd better put them into
// an Array to do so rather then address them by their names.
var Plist:Array = new Array;

// Counter, for "while" loop.
var i:int = 0;

// The loop.
while (i < maxparticles)
{
    // Let's create a new particle.
    // That's how it is done in AS3.
    var P:Particle = new Particle;
    
    // The unique name for the new particle. Whatever you want it for.
    P.name = "particle" + i;
    
    // Enlist the newly created particle.
    Plist.push(P);
    
    // At the moment, the P exists but is not yet attached to the display list
    //  (or to anything). It's a new concept, there wasn't  such thing in AS2.
    // Let's make it a part of the display list so that we can see it.
    addChild(P);
    
    i++;
}

And in case anyone needs it, here is the code I used for AS2:

maxparticles = 200; //number of particles

i = 0; //counter, for "while" loop
while(i < maxparticles){
    newparticlename = "particle" + i; //creates a new name for a new particle instance
    particle.duplicateMovieClip(newparticlename, i); //duplicates our particle mc
    i++;
}
0

There are 0 best solutions below