index.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onInit()" xmlns="*" layout="absolute" fontSize="50" color="#000000">
<mx:Script>
<![CDATA[
public function onInit():void
{
userRequest.send();
}
]]>
</mx:Script>
<mx:HTTPService id="userRequest" url="list.php" useProxy="false" method="POST">
</mx:HTTPService>
<mx:Dissolve id="Dissolve" alphaFrom="0.0" alphaTo="1.0" duration="5000"/>
<mx:WipeDown id="WipeDown" duration="5000" />
<mx:WipeLeft id="WipeLeft" duration="5000" />
<mx:WipeUp id="WipeUp" duration="5000" />
<mx:WipeRight id="WipeRight" duration="5000" />
<mx:Blur id="Blur" blurXFrom="100" blurXTo="0" duration="5000" />
<mx:Panel x="304" y="33" width="580" height="744" layout="absolute">
<mx:Label id="label6" text="Flex Dissolve 效果" creationCompleteEffect="Dissolve" x="44.5" y="407" height="76"/>
<mx:Label id="label1" text="Flex WipeDown 效果" creationCompleteEffect="WipeDown" x="10" y="333" height="66"/>
<mx:Label id="label2" text="Flex WipeLeft 效果" creationCompleteEffect="WipeLeft" x="34.5" y="249" height="76"/>
<mx:Label id="label3" text="Flex Wipeup 效果" creationCompleteEffect="WipeUp" x="41" y="158"/>
<mx:Label id="label4" text="Flex WipeRight 效果" creationCompleteEffect="WipeRight" x="22" y="84"/>
<mx:Label id="label5" text="Flex Blur 效果" creationCompleteEffect="Blur" x="41" y="10"/>
<mx:Image id="img1" width="600" height="400" source="{userRequest.lastResult.users.user.preface}" x="10" y="73" creationCompleteEffect="WipeDown" />
</mx:Panel>
<mx:Label id="username" text="{userRequest.lastResult.users.user.username}" creationCompleteEffect="Blur" />
</mx:Application>
list.php
<?php
header("content-type:text/html;charset=utf-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$cn=mysql_connect("localhost","root","");
$db=mysql_select_db("test");
mysql_query("SET NAMES utf8");
$sql="select * from login where id=119";
$result=mysql_query($sql);
$xml_return = "<users>";
while ($user = mysql_fetch_array($result)){
$xml_return .="<user><userid>".$user['id']."</userid><username>".$user['name']."</username><preface>".$user[preface]."</preface></user> ";
}
$xml_return.= "</users>";
echo $xml_return;
?>