大家不防试一下以下的例子:
----------------------------------------------------------------------------------------------------------------------
Asp部份:Output.asp
<%
response.Clear()
response.contentType = "text/xml"
response.write("<?xml version='1.0' encoding='gb2312'?>" )
response.write(request.QueryString)
response.end()
%>
Flash部份:第一帧Action
var login_str:String = "<highscore><name>Ernie</name><score>13045</score></highscore>";
var my_xml:XML = new XML(login_str);
var myLoginReply_xml:XML = new XML();
myLoginReply_xml.ignoreWhite = true;
myLoginReply_xml.onLoad = myOnLoad;
my_xml.sendAndLoad("http://localhost/output.asp", myLoginReply_xml);
function myOnLoad(success:Boolean) {
if (success) {
trace(myLoginReply_xml);
} else {
trace("false" );
}
}
----------------------------------------------------------------------------------------------------------------------
如果直接在网页里打进以下地址:
localhost/output.asp?<highscore><name>Ernie</name><score>13045</score></highscore>
网页就可以显示以下结果:
<?xml version="1.0" encoding="gb2312" ?>
- <highscore>
<name>Ernie</name>
<score>13045</score>
</highscore>
但在FLASH里面的结果就只有:
<?xml version="1.0" encoding="gb2312" ?>
请大家想办法,能想出来对大家都有益处的。