Flash无法在浏览器中加载xml [英] Flash not loading xml in browser
问题描述
我有一个Flash电影,它读取与.swf相同目录中的xml文件。当我只是尝试运行.swf文件时,此方法非常有效,但是当我将其添加到我的网站时,它似乎无法加载xml文件。 swf和xml位于网站上的同一目录中,我还尝试过从如下网址加载xml:test.load(’http://www.mysite.com/flash/doors.xml’);
但是,这还是行不通的:(有什么想法吗?我使用的是ActionScript2。谢谢。
I have a flash movie that reads an xml file in the same directory as the .swf. This works perfectly when I just try running the .swf file, but when I add it to my website it cant seem to load the xml file. The swf and xml are in the same directory on the site and I have also tried loading the xml from a url like this: test.load('http://www.mysite.com/flash/doors.xml'); But this wouldnt work either :( any ideas? I'm using Actionscript 2.Thanks.
var test:XML = new XML();
test.ignoreWhite = true;
test.load('doors.xml');
test.onLoad = function(success:Boolean){
if(success){
gotoAndPlay(2);
}
}
推荐答案
也许您在安全方面遇到问题,请在加载前尝试添加行
Hi maybe you have problems with security, try adding line before loading
System.security.allowDomain("http://www.mysite.com");
I希望这会有所帮助。
I hope this helps.
这篇关于Flash无法在浏览器中加载xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!