Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
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
2  
... 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. :) –  Ruud Lenders Jan 24 '13 at 22:29

1 Answer 1

up vote 2 down vote accepted

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...

share|improve this answer
    
Don't forget to accept your answer! –  Laurent Couvidou Jan 25 '13 at 11:37
    
"You can accept your own answer tomorrow" :) –  Ruud Lenders Jan 25 '13 at 11:38
    
Ah, right. This is in case somebody finds a better answer, to keep some appeal for the question. In this case, well, I doubt this will happen ;) –  Laurent Couvidou Jan 25 '13 at 11:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.