2008年10月1日 星期三

使用AS3與PHP讀取、傳送資料

ActionScript 3.0



var
request:URLRequest = new URLRequest( "http://www.freeapi.tw/submit.php" );
var variables:URLVariables = new URLVariables();
variables.email = emailSubmitText;
request.data = variables;
request.method = URLRequestMethod.POST;
sendToURL(request);



PHP部分
<?php
$emailAddress = $_POST['email'];
$to = "AA@BB.CC";
$subject = "You have a new subscriber";
$body = $emailAddress;
if (mail($to, $subject, $body)) {
echo("Your message was sent");
} else {
echo("There was a problem.");
}
?>

本站使用http://tohtml.com/高亮度語法

參考來源:
http://eddieoleary.com/2008/01/08/sending-form-data-with-actionscript-3/
http://tush.wordpress.com/2007/07/20/actionscript-3-using-urlloader-to-send-and-load-server-variables/

2008年5月8日 星期四

用Eclipse寫ActionScript(FDT)

安裝FDT

1.打開 Eclipse.

2.選 "Help"->"Software Updates"->"Find and install...".

3.選 "Search for new features to install" and choose "Next".

4.選 "New Remote Site".

5.輸入"FDT"當名稱 and the URL http://fdt.powerflasher.com/update.

6.Confirm with "OK".

7.Mark "FDT" and choose "Finish".