I'm pretty sure you need url address to post any values to any server from swf object. But then if you have your swf object inside of the <a></a> tags as was your previous button then you wouldn't probably need a single line of any code in your Flash. But I haven't been testing that so much so there may be some other ways to do the job that I'm not aware of.
* * *
Anyway if you need to reuse your button, maybe you should give the address to the flash dynamically via flashvars, which you can define at the same time you define the swf object on your html page, which should look with older implementations something like this:
Code:
<?php $address = "../../public/computers/computers_publicaccess.php"; ?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400" title="ReadingFlashVars">
<param name="movie" value="ReadingFlashVars.swf" />
<param name="quality" value="high" />
<param name="FlashVars" value="url=<?php echo $address; ?>" />
<embed src="ReadingFlashVars.swf" width="550" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" FlashVars="url=<?php echo $address; ?>"></embed>
</object>
Then in the actionscript file something like this may work:
ActionScript Code:
import flash.events.MouseEvent;
import flash.net.URLLoader;
var fileName:String = LoaderInfo(this.root.loaderInfo).parameters.url;
var post:URLVariables = new URLVariables();
logOutBtn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
post.logout = "laksfslvs";
var ureq:URLRequest = new URLRequest(fileName);
ureq.data = post;
ureq.method = URLRequestMethod.POST;
navigateToURL( ureq, "_self");
}