Receive variable from url string

Hi.

If i have a url string such as www.domain.com/file.html?foo=123 and a text field in the flash file in file.html called getfoo, how can I populate the contents of getfoo with the variable foo?

I cannot seem to make it work with loadVars.

Thank you for your attention.