Monday, July 29, 2013

Intellesense Recognizes imports but FlashDevelop compiler does not

After about an hour of trouble shooting why my AS3 game project compiles on my old computer, but NOT on my new computer... I finally figured it out. The older version of FlashDevelop let me get away with this: A file named: Inside the class: [...] public class FlxTilemapEXT extends FlxTilemap [...] When I imported and used the class: import FlxTilemapEXT Everything worked... But on my new computer it kept saying that the definition "FlxTilemapEXT" could not be found. See the problem? Answer: Case sensitivity. My file name is FlxTileMapEXT, but it defines a class FlxTilemapEXT. FlxTileMapEXT != FlxTilemapEXT However, the old version of FlashDevelop let me get away with this. SIDE NOTE RELATED TO HAXE: NOTE: Haxe compiling in flash develop is even stricter. Avoid underscores in your file names. Also, avoid folders that start with CAPITOL letters, as it will short-circuit import statements. The compiler will think the folder is a class.

Thursday, July 18, 2013

Hide Flixel Mouse and Show System Cursor

I combine my Flixel games with a UI layer on TOP of the Flixel Game Sprite. Because of this, it is necessary to use the system cursor, so that the UI layer is not drawn on top of my cursor. One way to do it: myFlxGameInstance.useSystemCursor = true; //set to true to make sure FlxG does not undo your changes when you switch states. FlxG.mouse.hide(); //Hide the Flixel mouse.; //Show the standard system cursor Or: You can specify to use the system cursor in the constructor of your FlxGame instance. But if for some reason you want to change things later. The above is how you would do it.