Dynamically creating MCs to load external JPGs into


I’m trying to create a slideshow that loads pics (jpg) from an external folder (“pics/”) into dynamically created MCs.

What I want is for the script to detect how many pics are in the folder (for future changes), create as many instances of the MC, and load the pics into each one. The MCs will need to take the W and H of the pics, and line up next to each other. This last part is not as important, I’m just wondering how to determine the number of pics in the folder. Do I need XML or will AS 1.0 or 2.0 do this?