(AS3) How do I specify the path(s) to my assets?

669 Views Asked by At

My directory structure is basically this:

    Project Name (folder)
        documentClass.as
        class1.as
        class2.as
        bin (folder)
            main.swf (default Output Location for flashdevelop)
        lib (folder)
            sounds (folder)
                music.mp3
                soundFX1.mp3
                soundFX2.mp3
            images (folder)
                pic1.png
                pic2.png

I am able to load the assets in lib/sounds and lib/images at runtime using

loader.load(new URLRequest( "../lib/images/pic1.png"));

and

music.load(new URLRequest("../lib/sounds/music.mp3"));

but cannot load them if I move my compiled .swf from its default location inside 'bin' up one level so that it's inside the Project Name folder next to the classes. I believe this structure is necessary when using additional files on Kongregate. (Am I wrong? I'm sending a zip file of the folder "lib")

I've tried various combinations: "../lib/images/pic1.png", "./lib/images/pic1.png", "/lib/images/pic1.png", "lib/images/pic1.png", etc., but I feel like a caveman poking a computer with a stick. I cannot find a definitive guide to how the "dot slash" navigation works.

Obviously, using the full path (c:/blah/blah...) is unacceptable.

Any help for me?

0

There are 0 best solutions below