08-20-2012 10:37 PM
I have been trying to load an image, and I keep getting URL Not Found error.
I am using background.setImage("image.png");
I have the image under the project folder, and under the src folder.
Is there something I am missing?
Thanks,
Chris S
Solved! Go to Solution.
08-20-2012 10:55 PM
Can you post a code snippet, if your code is not so proprietary as to preclude publically posting it?
For loading an image file from a local app directory using a URLRequest object the typical usage is e.g.:
myURLRequest = new URLRequest("app:///<relative path to image file>");
Some folks like to segregate their assets into separate dirs so you might have a path like
app:///assets/images/image.png.
You would create a URLRequest object as above and then use the load() method of a Loader object to
load the URL, and once it loaded successfully, access the ContentLoaderInfo.content property of the
Loader object.
08-21-2012 11:37 AM
08-21-2012 07:57 PM
While this wasn't the answer to my question, I have deciced to use this method instead.
Thanks,
Chris