Error: No Image asset


#1

I’m targeting html5 and when I do:-

var atlasBitmapData : BitmapData = Assets.getBitmapData(ATLAS_BITMAP);

where ATLAS_BITMAP is assets/images/metalworks_mobile.png I get:-

[lime.utils.Assets] ERROR: There is no IMAGE asset with an ID of "assets/images/metalworks_mobile.png"

My IDE is using the following command to launch the server:-

/usr/local/lib/haxe/lib/lime/7,1,1/templates/bin/node/node-mac /usr/local/lib/haxe/lib/lime/7,1,1/templates/bin/node/http-server/bin/http-server Export/html5/bin -p 3000 -c-1 --cors -o

where my assets directory is in the bin directory.

What I don’t understand is what is the starting directory for searching for the assets directory?


#2

you have to add the folder in your project.xml

<assets path="assets/images" rename="images"/>

and then use the following path images/metalworks_mobile.png.


#3

I tried that and I’m getting:-

Error: Could not find asset path "asset/images"

#4

should be assets right ?


#5

Yes, it is in the project.xml file, but I just typed in wrong in the reply.


#6

Make sure the path you choose exists relative to the project.xml file