2
votes

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

4

4 Answers

4
votes

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.

1
votes

You can ONLY publish fla based content from the Flash IDE, so if you're not going to use that anymore you'll need to publish an assets swf of your graphics, etc.

I presume you're using the MXML compiler? If so check adobe live docs on how to set the stage size etc.

1
votes

So in what context are you using FDT? Assuming this is running in Eclipse you would just need to specify some arguments to the mxmlc compiler as part of your build process. For example...

$ mxmlc Main.as -default-size 100 200

Where 'Main.as' is your entry point AS3 file, '100' is the width, '200' is the height. MXMLC defaults the output SWF to the same name as your input class. So in this example it would publish as SWF called 'Main.swf', but that is configurable as well. Here is a good Adobe resource for the mxmlc command line arguments: Adobe MXMLC docs

HTH

1
votes

You can use the SWF metadata to set a few things in your main class For example -

[SWF(width='455', height='200', backgroundColor='#123456', frameRate='25')]