Search code examples
macosactionscript-3flashpathrelative-path

Flash AS 3.0 Relative path to file in Mac OS X


I have a SWF which loads images and displays it.

Path to images is relative. It looks like this:

../../../images/thumbnail1.png

On Windows it works fine.

On MAC OS X SWF file cannot load images. So is there any differences between relative path on Windows and MAC OS?

previewImagePath is ../../../images/thumbnail1.png

previewLoader = new Loader();
previewLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, previewLoaded);
previewLoader.load(new URLRequest(previewImagePath));

public function previewLoaded(e:Event):void
{
    previewImageBtm = Bitmap(previewLoader.content);
    previewImageBtm.smoothing=true;
    addChild(previewImageBtm);  
}//previewLoaded

Solution

  • There is no any limitation on OSX to load an image on previous folders. Your code is correct. Ensure that you have sufficient privileges in the previous folders and test your file in a local server.

    Here you have an example and works perfectly on my Mac.

    https://docs.google.com/file/d/0Bw9pbLM_BascdWs2d2lCZFVRdWM/edit?usp=sharing