Dynamically creating movie clips using loaded variables

Hello all,

I’m still a noob with flash. But I’m attempting to make my website using it.
Any help you can offer is very much appreciated.

So far I have several swf files that are all loaded into a “index” swf file.

So all the code needs to work with that chain of MC’s:
_root.LoadedContent_mc.LoadedContent2_mc.Page1_mc

Thats the path to where I am working…

Page1:

I’m attempting to create a downloads list here. I have a php file already worked out that scans the directories “downloads” and “imgs”, and generates a list of file names. It then formats each file name into a path to that file. And turns each path into a variable that can be loaded into flash.

So basically after php does its thing we are left with this:

File1=Pages/PageData/Page1/Downloads/SomeTextFile.rar&File2=Pages/PageData/Page1/Downloads/SomeTextFile1.rar&File3=Pages/PageData/Page1/Downloads/SomeTextFile10.rar&File4=Pages/PageData/Page1/Downloads/SomeTextFile11.rar&File5=Pages/PageData/Page1/Downloads/SomeTextFile2.zip&File6=Pages/PageData/Page1/Downloads/SomeTextFile3.rar&File7=Pages/PageData/Page1/Downloads/SomeTextFile4.rar&File8=Pages/PageData/Page1/Downloads/SomeTextFile5.rar&File9=Pages/PageData/Page1/Downloads/SomeTextFile6.rar&File10=Pages/PageData/Page1/Downloads/SomeTextFile7.rar&File11=Pages/PageData/Page1/Downloads/SomeTextFile8.rar&File12=Pages/PageData/Page1/Downloads/SomeTextFile9.rar&Img1=Pages/PageData/Page1/Imgs/objectBack.png&NumFiles=13

In the downloads folder i have various files to download. In the imgs folder is where I am keeping the imgs for each of the files… (thumbnails if you will).

Now I can get the variables into flash just fine. Its working with them thats created my problem.

Heres my Actionscript so far.

//Import list of file names to create into links
MyFiles = new LoadVars();
MyFiles.load("http://www.mysite.com/Pages/PageData/Page1/downloadlist.php");
MyFiles.onLoad = function(success)
{
 if(success)
 {
  trace(_root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.MyFiles.NumFiles);
  _root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.FileListTxt = "testing";
 }
 else
 {
  trace("Error Loading Variables for Page1");
 }
 //Configure loaded variables
 var vn:Number = _root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.MyFiles.NumFiles;
 var y:Number = 0;
 for(x in _root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.MyFiles)
 {
  if(x=="NumFiles" || x=="onLoad")
  {
   trace("Skipped Crap");
   y++;
  }
  else
  {
   if(y==2)
   {
    var FileArray:Array = Array();
    FileArray.push(_root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.MyFiles.x);
    y++;
   }
   else
   {
    FileArray.push(_root.LoadedContent_mc.LoadedContent2_mc.Page1_mc.MyFiles.x);
   }   
  }
 }
 trace(FileArray);
}
stop();

What I’m trying to do here is create an Array variable to hold the object target so we can put the value of that object into a global variable so I can load them into Movie Clips along with the img for it. And then place them on stage.

But Like I said I can’t seem to get it to work.

Thanks again for any help/suggestions.