I can't run Flash PHP files?

Jane

New member
I'm trying to run an action Script that calls a php file. Everytime I run it I get a popup window asking if I want to save it, open it, or cancel. The file is in my localhost folder 'flashPHPBible". To run it I type in the URL (local) localhost/flashPHPBible/connFlashPHP.fla

THE connFlashPHP.fla ...// do i save this file with a .fla or .as extension. I tried both doesn't work

var phpFile:String = http://localhost/'flashPHPBible/exampleConn.…
//string dbl quoted. not an active path
//I also tried-> var phpFile:String = exampleConn.php


function callServer(e:MouseEvent):void{
var urlRequest:URLRequest = new URLRequest(phpFile);
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE… serverResponse);
loader.load(urlRequest);
}

function serverResponse(e:Event):void{
var loader:URLLoader = URLLoader(e.target);
var variables:URLVariables = new URLVariables(loader.data);
timeTxt.text = variables.returnValue;
}

callBtn.addEventListener(MouseEvent.CL… callServer);


exampleConn.php ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
print "returnValue=Hello from PHP, time is: " . time();
?>
</body>
</html>
 
Back
Top