Php image url to flash movie

How would I pass the image url from the php script below, so that I can have the image load into a movie clip in Flash? I’m not that great with AS, so please be as detailed if possible.

<?php

$id=“12345678”; //member id

$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 “<img src =”$img">";

?>