views:

28

answers:

2

Hi,

I'm trying to load images from a relative folder /media/one.jpg but it never loads, I use the same script to load from my local folder and it does.

The absolute path e.g c:/mydir/one.jpg does not work either. Earlier I used to throw things at my server and get jpegs from there. But for testing purposes I need these images locally available.

Any Idea?

+1  A: 

Just solved it Use loadImage("media\ears.jpg"); double slash instead to single and it works :)

Fahim Akhter
You should use '/' (forward-slash) instead of '\' because if you put it on a linux server maybe it will have problems.
Biroka
But be aware that paths like that will only work locally on a Windows system, not on the web and not on Mac or Linux. Using / in paths is recommended in ActionScript, since it will work in all environments.
Lars
+1  A: 

For security reasons flash files can access only web or only local files, with can be set in the project properties. If you want to build a web application like a webpage or just a part of a webpage, than you should choose network only, but this way you can test your work only on a webserver (that can be localhost too ). If you want to build a desktop application, witch has no relation to web, then select the "local only" option in your project properties.

Biroka