How can I load XML in flash with Dynamic ID?

I’ve a simple PHP file which creates XML based on the id passed to the url like gallery.php?id=5 id can be anything based on what user has selected. I want to load it in Flash something like loaded_xml.load(“gallery.php?id=$id”); (where loaded_xml is new XML() object). I was wondering how can I get id from url and pass it on to flash action script. thanks in advance.