Flex: Load images and swf's dynamically

Posted by Lizzan on Stack Overflow See other posts from Stack Overflow or by Lizzan
Published on 2010-05-27T08:17:56Z Indexed on 2010/05/27 8:21 UTC
Read the original article Hit count: 191

Filed under:

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?

© Stack Overflow or respective owner

Related posts about flex