# Dynamic clickable mc with php

**URL:** https://forum.kirupa.com/t/dynamic-clickable-mc-with-php/222505
**Category:** Uncategorized
**Created:** [April 14, 2007, 12:16am UTC](https://forum.kirupa.com/t/dynamic-clickable-mc-with-php/222505 "2007-04-14T00:16:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BigSerb](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@BigSerb](https://forum.kirupa.com/u/BigSerb)
#### Post date: [April 14, 2007, 12:16am UTC](https://forum.kirupa.com/t/dynamic-clickable-mc-with-php/222505/1 "2007-04-14T00:16:53Z")

</div>

The PHP script below basically returns variables myImage0, myImage1, and so on. I know how to get the variables (URL’s) into flash, and I know how to load the jpegs associated with each URL. What I don’t know how to do is make each movie clip clickable, and be able to use geturl so that when they are clicked they can go to whatever. I’m not very good with AS, so any help would be appreciated. Thanks in advance.

```php

 <?php 

$userids = array('12345678', '87654321', '98765432'); // all userids go in here 
for($i=0; $i<sizeof($userids); $i++){ 
  displayImage($userids[$i], $i); 
} 

function displayImage($id, $img_count){ 
  $u= "http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$id"; 

  $t = join("",file("$u")); 

  $r = '/ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" .*?"><img src="(.*?)"/'; 

  $t = ereg_replace("
", "", $t); 

  preg_match_all($r, $t, $m); 

  $img=$m[1][0]; 

  echo ("&myImage".$img_count."=".$img);   
}   

?>  

```
