Page 1 of 1

PHP code with Flash MX

Posted: Sat Oct 25, 2003 9:17 am
by jeffcravener
Can anyone tell me if there is anything wrong with the PHP code:

Here is the code in the PHP file:

Code: Select all

<? 
$handle=opendir("\images"); 
$counter = 0; 
while ($file = readdir($handle)) &#123; 

$the_type = strrchr($file, "."); 
$is_picture = eregi("jpg",$the_type); 

if ($file != "." and $file != ".." and $is_picture) &#123; 
$pics&#1111;$counter] = $file; 
$counter++; 
&#125; 
&#125; 
closedir($handle);
for ($i = 0; $i < count($pics); $i++)&#123;
    $PicsList .= $mypics&#1111;$i] . "|";
&#125;
$PicsList = substr ($PicsList, 0, -1);

echo ("&PicsList=$PicsList&"); 
?>
Here is what I have on a frame:

Code: Select all

varPics = new Array();
varReceiver = new LoadVars();
varReceiver.load("\\findpics.php");
varReceiver.onLoad = function()&#123;  
	tmp = this.PicsList;
	varPics = tmp.split("|");
	PicTitle.text = varPics&#1111;0];
&#125;;

This is whats happeneing:

In the variable 'PicTitle.text', the varaible name from echo is showing up: $PicsList

what am i doing wrong

Posted: Sun Oct 26, 2003 5:12 am
by igoy
Check this Out....

Code: Select all

echo "&PicsList=".$PicsList;
and post back if it doesn't work..