Attach line of PHP to flash (as2)

Hi,

I’ve used a php script to password protect my pages which requires me to add a line of php in the head of each page that my flash is embedded in.

Here’s the problem… People can still type in a direct link in the address bar to the swf and access the file. I can’t allow this as access to the site is paid for - so basically, I need to add the line of php which activates my protection to the swf itself:

       <?php
$groupswithaccess="en";
require_once("../../slpw/protect.php");
?>

This is something I’ve not done before. Is it possible using loadvars? Would I need an external file?

Sorry if this is a silly question!

Thanks!