[openfl.Assets] There is no BitmapData asset with an ID of ...

133 views
Skip to first unread message

Valentin D.

unread,
Jan 6, 2016, 9:18:24 AM1/6/16
to HaxeFlixel
Hello everyone,

when i try to load an image with this code :

class Player extends FlxSprite
{
   
public function new(X:Float=0, Y:Float=0)
   
{
       
super(X, Y);
        loadGraphic
("assets/images/player.png", true, 128, 256);
        animation
.add("walk", [1, 2], 10, true);
        animation
.play("walk");
   
}
   
}

I get this issue :

Build succeeded
Done(0)
haxelib run lime run "Project.xml" neko -debug
Running process: C:\HaxeToolkit\haxe\haxelib.exe run lime run "Project.xml" neko -debug
Assets.hx:149: [openfl.Assets] There is no BitmapData asset with an ID of "assets/images/player.png"
AL lib: (EE) alc_cleanup: 1 device not closed
Invalid field access : get_width
Called from flixel.FlxSprite::loadGraphic line 324
Called from Player::new line 16
Called from Player::$init line 11
Called from PlayState::create line 21
Called from flixel.FlxGame::switchState line 583
Called from flixel.FlxGame::update line 668
Called from flixel.FlxGame::step line 648
Called from flixel.FlxGame::onEnterFrame line 493
Called from openfl._egacy.events.EventDispatcher::dispatchEvent line 98
Called from openfl._legacy.display.DisplayObject::__dispatchEvent line 182
Called from openfl._legacy.display.DisplayObject::__broadcast line 161
Called from openfl._legacy.display.DisplayObjectContainer::__broadcast line 286
Called from openfl._legacy.display.Stage::__render line 1103
Called from openfl._legacy.display.Stage::__checkRender line 351
Called from openfl._legacy.display.Stage::__pollTimers line 1084
Called from openfl._legacy.display.Stage::__doProcessStageEvent line 430
Done(1)


It seem that it can't find "player.png". I don't understand why because this image is place in the right folder :

Thank you !

Jeru Sanders

unread,
Jan 7, 2016, 3:31:06 PM1/7/16
to HaxeFlixel
Post your project.xml contents.
Reply all
Reply to author
Forward
0 new messages