# PHP Array into Flash

**URL:** <https://forum.kirupa.com/t/php-array-into-flash/307711>\
**Category:** Uncategorized\
**Created:** [April 8, 2010, 8:09pm UTC](https://forum.kirupa.com/t/php-array-into-flash/307711 "2010-04-08T20:09:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Custergrant](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@Custergrant](https://forum.kirupa.com/u/Custergrant)\
**Post date:** [April 8, 2010, 8:09pm UTC](https://forum.kirupa.com/t/php-array-into-flash/307711/1 "2010-04-08T20:09:40Z")

</div>

Ok, I’ve search the forum up and down, and I’m afraid that I just need to have it explained to me. I am trying to create a dynamic image viewer. I have a MySQL table set up that holds all of the urls of the images. I have a simple PHP file that selects all of the urls out of the database and then shuffles the array they’re in to make it random.

```auto
$result = mysql_query("SELECT url FROM images");
        while($row=mysql_fetch_array($result)){
   $array[] = $row['url'];
  }
  shuffle($array);
$thestring=implode($array,'|'); //makes: item0|item1|item2|item3 
echo "&thestring=$thestring"; 

```

Now in Flash, I have a frame set up, and a rectangle I’ve converted to a movie clip which is where I want to view the images. Now I am just struggling to load the array into Flash, and I really am not sure how to have Flash resize the images to fit inside the rectangle, or even how to have them go in there. Here is what I have for the AS right now:

```auto
var thearray=new Array();
var recvars=new LoadVars();
recvars.onLoad=function(success){
     if(success){
          thearray=this.thestring.split("|");
     }
};
recvars.load("images.php");[

```

Any help? 🙂
