Passing variables from Flash to PHP?

Hi

Ive, just finished the excellent Photo Gallery using XML and Flash tutorial.
I am having a problem implementing it into my site though.

I have a projects page which is dynamically generated using php mysql. I want to have just one photogallery flash file on this page which dynamically draws in the correct images for any given project.

At the moment Im half way there. So far I have passed a variable (the ID of a project ) to the flash movie using the following code in the HTML:
[COLOR=Blue]
<object type=“application/x-shockwave-flash” data=“gallery.swf” height=“400” width=“300”>
<param name=“movie” value=“gallery.swf” />
<param name=“FlashVars” VALUE="[COLOR=Red]<?php echo $projectid ?>[/COLOR]">
</object>
[/COLOR]
I want Flash to then pass this variable to a php file that will then produce the correct xml for the flash file.

Basically what I want it to do in the AS is this:
[COLOR=Blue]
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images_xml.php?projectid=[COLOR=Red]VARIABLE-HERE[/COLOR]”);
[/COLOR]

the php file will then output correct xml for that project

Im not sure how the passing of the variable is done in this instance.
Can anyone help?

Cheers
Jimmy