# Hello World with FlashDevelop, Flixel, AS3: uneffective SWF macro

I just started with FlashDevelop and Flixel, and I already have a question. I created this basic hello world:

package
{
import org.flixel.*;
[SWF(width = "640", height = "480", backgroundColor = "#000000")]; //Set the size and color of the Flash file

public class HelloWorld extends FlxGame
{
//...
}
}


When I run this "game", using Flash Player, I get a 800x600 window with a white background, even though I specified it's 640x480 with a black background. Am I doing anything wrong?

I am using Flex 4.6.0, and the target platform is Flash Player 10.1. I have the debugger version of Flash Player 11 installed (WIN 11,5,502,146 to be exact).

In the .xml file (found in the obj folder) I found the following:

<default-size>
<width>800</width>
<height>600</height>
</default-size>


Changing the size/color through the properties window of my FlashDevelop project does work fine...

It seems to ignore the [SWF(...)] macro entirely: what's going on?

• This looks correct. I compared it to some code from when I used Flixel in 2011, and although Game (my version) became FlxGame (your version), everything else looks fine. – ashes999 Jan 24 '13 at 22:11
• Not sure, but usually the meta information [SWF(... should be directly above the class definition. Try removing that blank line in between and retry? – bummzack Jan 24 '13 at 22:19
• ... also try to remove the spaces between your equal signs (eg. width="640" instead of width = "640"). Not sure how nitpicky the compiler is when it comes to these meta-tags, but it seems to ignore yours. – bummzack Jan 24 '13 at 22:26
• @bummzack, hi again ^_^ you're right, the compiler is really annoying with these tags. I've found my answer, posted it below. :) – Rudey Jan 24 '13 at 22:29

Found it. It was the semicolon (;) after the [SWF(...)] that killed it. Got it rocking now :) I believe the FLEX compiler is to blame here, since tutorials also have this semicolon, they'll probably used the Flash IDE...