PHP -> Flash Loading Bar: Where to Start?

I currently have a PHP script that takes a while to run, and have made a Javascript loading bar so that users can tell how long it will be until it’s finished.

However, I would like to use Flash instead, as I’m really more comfortable with using Flash to create good looking loading bars.

However, I don’t know where to begin, to find out about passing variables from PHP to AS3, and AS3 recognizing them as they are passed.

So, any ideas where to start with this project? A tutorial or function? Thanks!