all groups > flash actionscript > april 2007 >
You're in the

flash actionscript

group:

Loading External Images



Loading External Images ewon15
4/9/2007 11:05:13 PM
flash actionscript: I have a website that I am creating and the secondary pages have a swf file in
them. The pages are located in a sub folder and the swf file is in a separate
sub folder. The swf should be loading in external images (from another separate
folder) however, it does not. i have tried giving everything an absolute path
and i've tried moving the files around...

the only thing that works is if the file the swf is in, and the swf, are not
in any folders...

my files structure is this:

images (folder from which swf loads images)
[quoted text, click to view]


anyone have any ideas?
Re: Loading External Images kglad
4/9/2007 11:39:29 PM
Re: Loading External Images ewon15
4/9/2007 11:45:12 PM
my code is correct...

it is this:

_global.filePath = "../images/";
_global.fileExt = ".jpg";

imgHolder.loadMovie(filePath + "image" + fileExt, 1);

...i don't think it is the code that is the issue... i think it has to do with
the flash player... because i could make the file path a absolute location
(i.e. http://www.mydomain.com/images/myimage.jpg") and it still would not work.
Re: Loading External Images kglad
4/9/2007 11:59:22 PM
Re: Loading External Images Evoken
4/10/2007 12:06:53 AM
I think you will be better off by building your gallery using XML. See this tutorial for an example:

http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm


Re: Loading External Images guinness_stout
4/10/2007 2:14:33 AM
The folder to where the main SWF resides overrides the folder to where the sub
SWF loaded via LoadMovie.

Take for example;
main SWF resides in folder "mainFolder",
sub SWF resides in folder "mainFolder/subFolder"
images in "mainFolder/subFolder/imageFolder".

When you try to run sub SWF alone, everything works fine because the path to
the image is correct which is "mainFolder/subFolder/imageFolder".

But when you try to run main SWF which uses LoadMovie to load sub SWF (no
_lockroot), the folder of the image now become "mainFolder/imageFolder" and
there isn't such image exists in such folder, so your image isn't loaded.
Re: Loading External Images ewon15
4/10/2007 3:21:07 PM
I think I have miss represented how my files are set up...

I am not building a gallery and I am not going to use XML because it is
unnecessary and I am not loading a SWF file into another.

I have one SWF file in a folder titled "media", and images in a separate
folder (not a sub folder) titled "images". My html page is also in a separate,
non-subfolder titled "pages". I am publishing in Flash 8 or higher and my JPEGs
are all just optimized for the web... they are not progressive to my
knowledge...

I thought my issue was that since the SWF file is being embedded into my HTML
file, it would change where the file path is to the images...however, it
doesn't matter because the location is still "../images/"

I appreciate all of your thoughts and am sorry I did not clarify how things
were set up...

Here is the website I am building...The only link that works right now is the
Computer Services one in the middle of the page (the flash nav isn't set up
yet).

http://www.rainnetworks.com/betasites/rn/
Re: Loading External Images ewon15
4/10/2007 3:21:48 PM
AddThis Social Bookmark Button