Photo gallery help

i read the tutorial about building the photo gallery with and xml file, i’m trying to make it where you can upload photos and and it will create gallery for you to embed on sites and such, and I am having real troubles trying to call the xml file from the url, here is the code i changed
before

xmlData.load("images.xml");

after

xmlData.load(_root.xmlname);

and here i am trying to call it from the url

mygallery.php?xmlnam=images2.xml

I have also tried to encode the url and no luck,
and here is my parameters I am calling it from

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://macromedia.com/cabs/swflash.cab#version=6,0,0,0"
  ID=flaMovie WIDTH=250 HEIGHT=250>
  <PARAM NAME=movie VALUE="test.swf">
  <PARAM NAME=**[COLOR=#cc0000]FlashVars[/COLOR]** VALUE="xmlname=**[COLOR=#cc0000]<?php echo(urlencode($xmlname));?>[/COLOR]**">
  <PARAM NAME=quality VALUE=medium>
  <PARAM NAME=bgcolor VALUE=#99CC33>
  <EMBED src="test.swf" **[COLOR=#cc0000]FlashVars[/COLOR]**="xmlname=**[COLOR=#cc0000]<?php echo(urlencode($xmlname));?>[/COLOR]**"
    bgcolor=#99CC33 WIDTH=250 HEIGHT=250 
    TYPE="application/x-shockwave-flash">
  </EMBED>
</OBJECT>