这两天也算是心血来潮吧,因为了解了Flash与asp的通讯,既然接触了php,所有也想把Flash与php的通讯也完全搞清楚,好像跟asp差不多,感兴趣的看代码,这是xml方式的:
Flash里:
//第一桢
var self = this;
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
trace(success);
if (success) {
self.my_onLoad(this);
}
};
my_xml.load("../php/xml.php");
//my_xml.load("http://localhost/Flash&PHP/php/xml.php");
function my_onLoad(xml:XML) {
var temp_xml = xml;
var myText = _root.createTextField("Billows", 0, 100, 100, 200, 200);
myText.multiline = true;
myText.autoSize = true;
myText.text = temp_xml.firstChild;
}
//PHP代码:
<?php
echo "<?xml version=\"1.0\" encoding=\"gb2312\" ?>
<list nowpage=\"1\" maxpage=\"5\">
<item>ddddddd</item>
</list>";
?>
Flash里:
//第一桢
var self = this;
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
trace(success);
if (success) {
self.my_onLoad(this);
}
};
my_xml.load("../php/xml.php");
//my_xml.load("http://localhost/Flash&PHP/php/xml.php");
function my_onLoad(xml:XML) {
var temp_xml = xml;
var myText = _root.createTextField("Billows", 0, 100, 100, 200, 200);
myText.multiline = true;
myText.autoSize = true;
myText.text = temp_xml.firstChild;
}
//PHP代码:
<?php
echo "<?xml version=\"1.0\" encoding=\"gb2312\" ?>
<list nowpage=\"1\" maxpage=\"5\">
<item>ddddddd</item>
</list>";
?>
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}