I need major help in Haxeflixel with creating a simple button. My code is not working, "13: characters 2-5: Missing : ;"
package;
import flixel.FlxState;
import flixel.ui.FlxButton;
import flixel.FlxG;
class MenuState extends FlxState
{
override public function create()
{
var hairOne:FlxButton;
hairOne = new FlxButton(0, 0, "Hair #1", clickedHairOne)
add(hairOne);
super.create();
}
function clickedHairOne()
{
FlxG.switchState(new PlayState());
}
override public function update(elapsed:Float)
{
super.update(elapsed);
}
}
I have spent over 30 minutes, help
The error means that on the end of the line 13 you are missing a semicolon (;).
That is:
hairOne = new FlxButton(0, 0, "Hair #1", clickedHairOne)
should be
hairOne = new FlxButton(0, 0, "Hair #1", clickedHairOne);