note! to make this code work it must be running on a webserver! (localhost is ok) the flash URLRequest will fail if cannot find a server address.