传递XML数据的SWF对象 [英] Pass xml data to a swf object
问题描述
我工作的闪光灯转子的旗帜。我使用一个外部XML文件来传递横幅信息(如信息,文字,链接,图片路径,优先级等)。一切都很顺利,到目前为止。我在加载XML是这样的:
I'm working on a rotator banner in flash. I use an external xml file to pass the banners info (like info-text, link, image-path, priority, etc). Everything is going well so far. I'm loading the xml something like this:
var bannersXML:XML = new XML();
bannersXML.ignoreWhite = true;
bannersXML.load("myBanners.xml");
本身的问题
现在我需要建立在即时在PHP和该XML的不知它传递给我的Flash对象。因此,而不是读取外部文件我想我的Flash脚本接收XML参数是可以工作。
The Problem itself
Now I need to construct this xml on-the-fly in php and somehow pass it to my flash object. So instead of read the external file I want my flash script receive an xml parameter it can work with.
你知道,如果可以做到这一点?
Do you know if this can be done?
推荐答案
回声出适当的标题XML文件的结构,并告诉Flash加载你的PHP文件:
Echo out the structure of the XML file with appropriate headers and tell Flash to load your PHP file:
<?
header("Content-type: text/xml");
$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "whatever other xml tags";
$xml_output .= "whatever other xml tags";
$xml_output .= "whatever other xml tags";
$xml_output .= "whatever other xml tags";
echo $xml_output;
?>
这是一个有点简单,但是这是这个想法。然后,只需拨打:
This is a bit simplified, but that's the idea. Then just call:
bannersXML.load("myBannersPHPfile.php");
这篇关于传递XML数据的SWF对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!