[SOLVED] URLRequest vs image loading

Hello.

Can URLRequest be used for image loading (like in old good AS3 days)?

I try to use the following but with no luck:

openFL:

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest( “assets/my_image.jpg” ));

xml:

assets path=“Assets” rename=“assets”

I end up with the error:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

hi klinek.

Looks like it’s missing your ‘assets’ folder.
In your project folder copy:
myProject/assets/*
to
myProject/bin/flash/bin/assets/*

Yes, but use <assets path="Assets" rename="assets" embed="false" /> in order to copy the files separately instead of embedding in the SWF file (which is our default)

Thank you for the responses.

The solution from ‘singmajesty’ works fine in my situation.

Obscure’s suggestion also may be useful in similar cases.

Regards.