Php controlling flash

Ok, I’ve posted this on the other thread, but it was kind of off topic so I figured I should post it as it’s own thread.

Here’s the idea: a link, either in flash or in the html document defines a variable via php and sets its value. (for example, lets say $movie = play)

The flash movie embedded in the html document checks to see if that variable is equal to play. If it is, it starts playing, or does something. But ONLY if the php variable is set.

SO, here’s the question: How do you set php variables from flash? and how could flash check to see if the variable was defined?

The idea here was to have one flash movie controlling another inside the same html document. This would allow smooth transitions while not having to design the whole site with flash making for easy updating via a database.
Just a thought, I’m a noob to php.