PDA

View Full Version : loading filenames into an array


arcanine
05-23-2008, 01:35 PM
hi there I'm using a application called coverflow within flex builder 3

<Array id="dataSet">
<String>img/11.jpg</String>
<String>img/12.jpg</String>
</Array>


<local:DisplayShelf id="shelf" horizontalCenter="0" verticalCenter="0"
borderThickness="5" borderColor="#FFFFFF" dataProvider="{dataSet}" enableHistory="false" width="100%"/>

as you can see the images in the array are displayed and look very nice etc
http://dinogod.adrianhosting.com/smf/index.php?action=showcase
here is what I have so far


okay on to the problem, the problem is I don't want to have to recompile my flex application every time I add a file to the img folder as the image paths are hard coded. I want it to be added to my "image shelf" automatically how can I go about doing this I'm hoping flex has a function that can read a web directory and output the filenames to my array if not maybe I could use a loop to try and guess new file names?

you'll have to walk me through it a bit as I'm very new to flex and programming in general :confused:

drkstr
05-23-2008, 04:44 PM
I don't think it has that ability. I would use a PHP script to read in the file names and output it as XML. You can use the URLLoader class to load the XML data into your app.

Best Regards,
~Aaron