0

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++;
}
mahmad1018
  • 13
  • 2
  • Hello yet again. Please, elaborate on "*keeps crashing my file*" because it is unclear what the problem is. Flash IDE crashes when you try to publish SWF? The SWF exports just fine but then it crashes browser/projector once you try to open it? – Organis Dec 01 '22 at 22:19
  • Sorry, I should have made it clear. When I try to export the file as a SWF, Animate CC does not respond and closes the program itself. I'm not sure if it's within the code or if it's a hardware issue. Hope this helps. – mahmad1018 Dec 02 '22 at 22:35
  • Not really sure, what the problem is (does it export normally with the other projects? with the clean new project?), but "publishing" is a move to create SWF + HTML + JS, in terms of compiling SWF it is not any different from testing movie (Ctrl+Enter). Thus, if you can test your movie, you can just compose HTML + JS and don't resort to "publishing". Well, that's unless you are publishing to AIR, could be a different story there. – Organis Dec 04 '22 at 20:53
  • Sorry if I'm being unclear. I guess what I'm saying is I have no way of testing the code you provided because when I publish the movie to an SWF (includes testing with Ctrl + Enter) or even an HTLM, first off Animate CC doesn't respond, nor does the the .swf and .html published files respond either, I just get timed out and they close themselves. I'm not sure whether the code is the reason for this or if it's something else. I provided the .fla files on top if you want to take a closer look, otherwise I hope this helps. – mahmad1018 Dec 05 '22 at 21:57
  • Ok. I can't really help you with the FLA, because I am, like, retired Flash veteran: I have 15+ years of doing the thing, just don't do it anymore. So, that's what I'd do. Reboot your system. Start with the clean AS3 project. Test/publish it — normally you should be able to. If it works, start adding things to it, like library items, scripts, etc., while testing if it still runs after each action (that's how you catch the exact moment it breaks along the way). Please do not copy things (unless it is just text) from the old project, because they **might** be broken. – Organis Dec 06 '22 at 15:06

0 Answers0