tags:

views:

53

answers:

1

I'm building a slide-show like application in Flex and I'm trying to load images dynamically. The images are in a folder outside the application folder. This is the folder structure:

/Bildvisare-debug/
        Bildvisare.html
        Bildvisare.swf
/Images/
        01_02_01_01_B.jpg
        01_02_01_01_T.JPG

I'm reading the image names from an XML file and get them with a path of ../Images/01_03_01_01_B.jpg. In my mxml-file I've got an SWFLoader named picture and I try to load the images with the following code:

this.picture.source = images[currentImg];   //E.g. ../Images/01_03_01_01_B.jpg
this.picture.load();

The problem is that the images never show up, I only get the icon for a missing image. Can anyone help?

Edit to add: I've tried this both with and without the use-network flag set to false when compiling.

+1  A: 

I believe this is relevant to your case.

A SWF file can access one type of external resource only, either local or over a network; it cannot access both types. You determine the type of access allowed by the SWF file using the use-network flag when you compile your application. When the use-network flag is set to false, you can access resources in the local file system, but not over the network. The default value is true, which allows you to access resources over the network, but not in the local file system.

From Flex Image Control

Markus
Thanks. Yeah, I forgot to add that I've tried it both with and without the use-network flag set to false. I'll add that to my question.
Lizzan
Finally got it, the problem was me previewing the whole thing from localhost instead of just allowing the swf to run directly from the folder with use-network=false. (I never could make it work on the server, though, perhaps there's some rule about going outside the parent folder, I don't know. Doesn't matter to me, since this .swf will be embedded into a desktop app.)
Lizzan