开发者

Embedding flash files

I have the strangest problem I can't seem to figure out.

I have created a simple flash image gallery. Like every other gallery it gets photo information from an XML file. It works fine, I have had no issues working on the flash file locally.

However once I uploaded the .swf and .xml (and all the images) I ran into some trouble. The .swf simply does not read the XML file. I'll lay down what I've done so far, hopefully this will expose my error.

I read XML data by doing the following in ActionScript 2

xml_parser = new XML ();
xml_parser.ignoreWhite = true;
xml_parser.onLoad = xml_loaded;
xml_parser.load ('http://full/path/to/gallery.xml');

My XML file is done up like so

<item>
<title>Photo Title</title>
<info>Here is some info</info>
<picture>http://开发者_如何学Pythonfull/path/to/image.jpg</picture>
<thumb>http://full/path/to/thumbnail.jpg</thumb>
</item>

I embed the .swf the old fashion way

<object>
   <param name="movie" value="http://full/path/to/gallery.swf" />
   <embed src="http://full/path/to/gallery.swf" />
</object>

Now when I access the html file that I have embedded the gallery into, I get a lot of undefineds and no pictures. However when I access http://path/to/gallery.swf (standalone swf) it works fine I see all the pictures and their descriptions.

My question is simply WHY IS THIS. How come the .swf doesn't read the XML when it is embedded into a page of html?

I am testing this on Internet Explorer 8


Download Charles http debugger, you will see what flash is requesting and where it is looking for your xml and assets, its invaluable for this kind of debugging.

Charles downloads

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜