R – What’s the ‘static void Main’ equivalent in Flash

actionscriptactionscript-3fdtflash

I am trying the FDT editor on a project that previously ran successfully in Flash CS3.

FDT builds and runs it successfully but the SWF is blank (white). I've tried a few viewers on the output file and it is actually blank.

One difference is that now my project doesn't seem to include my entry .fla file. I'm new to Flash/ActionScript and am wondering whether that FLA file included some magic akin to a public static void Main method in other languages.

So, if I'm building an application purely in ActionScript 3 (no .fla files) how do I specify the entrypoint, canvas size, etcetera?

Of course, it's possible that I have set up FDT incorrectly 🙂

EDIT: Newbie alert!

Turns out that the white stage I was seeing via FDT was because my FLA was running in a different folder and I couldn't load any of my resources, so nothing was ready to display. I also had FDT configured in such a way that I wasn't seeing the error via the debugger.

This question is a bit dumb. Is it normal to delete questions like this?

For anyone else coming at Flash/ActionScript from a solid programming background, I found this to be a pretty good overview of the display model:

http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_02.html#152593

Best Answer

The equivalent would be the constructor of the main class. That's the class that you specify for compiling (in principle, the rest of the classes are compiled only if they are referenced in code being compiled, be it the main class or any class reference by it).

In the Flash IDE, it would be the constructor of the Document class (if you happen to use one, it's not mandatory) or just the first keyframe in the main timeline.

Related Topic