Search code examples
actionscript-3

ActionScript 3 FlxG.keys error


So I have more errors like these:

Player.as(21): col: 25 Error: Access of undefined property FlxG.

on this code:

    override public function update():void
    {
        super.update();
        velocity.x = 0;

        var right:Boolean = (FlxG.keys.RIGHT || FlxG.keys.D);
        var left:Boolean = (FlxG.keys.LEFT || FlxG.keys.A);
        var up:Boolean = (FlxG.keys.UP || FlxG.keys.W);

how can I fix it?

also I am begginer to actionscript3 and I don't know too many terms. Thanks for helping!


Solution

  • FlxG it is a Flixel Class. To fix this issue you should download Flixel library and place org folder near your FLA file.