[wp-hackers] XML controlled SWF files

Vinicius Massuchetto viniciusandre at gmail.com
Tue Mar 23 12:50:47 UTC 2010


On Tue, Mar 23, 2010 at 1:44 AM, Jeremy Visser <jeremy at visser.name> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 23/03/10 11:39, Vinicius Massuchetto wrote:
>> I'm parsing a page for every local MP3 URL on it, and building a XML
>> file to be read by a SWF player. The player works nice out of
>> Wordpress on any host, but once we put it on the theme directory with
>> the XML, it doesn't work.
>
> Read your web server log files. I also highly recommend Wireshark [0]
> for diagnosing issues such as this. It's important that you figure out
> the differences between the static and dynamic XML files by comparing
> them directly.
>
> Can you load the dynamic XML file in a web browser? What HTTP headers
> are different? Are they both being served as text/xml, or is one
> text/plain or even *shudder* text/html?
>
>> I imagine this XML entries always need to be in a relative path from
>> the SWF file, so maybe it has something to do with Wordpress blocking
>> relative paths inside themes.
>
> First I've heard of that. Flash won't fetch stuff from an alternative
> domain unless it is whitelisted in that domain's crossdomain.xml file,
> but there are no subdirectory restrictions that I'm aware of.
>
> [0] http://www.wireshark.org/

Thanks for your attention.

The solution I found:

1) The path SWF looks for the XML is the page URL, not the folder the
SWF file is. So it is needed to give the full XML path to the load
function into its action:
xmlobject.load("http://path/to/the/xml/file.xml")

2) The same with paths inside the XML. It is needed to always fill
references with the full path;

3) It is recommended to use Kimili Flash Embed Plugin [1], once it
will use all the JavaScript needed to load flash files. The syntax is
very easy:
e.g.: [kml_flashembed movie="<?php bloginfo('template_directory');
?>/swf/file.swf" wmode="transparent" width="300" height="300"]

Well.. that's it. I also posted this on the forum topic I just pasted above.
--
Vinicius Massuchetto
http://vinicius.soylocoporti.org.br

[1] http://kimili.com/plugins/kml_flashembed


More information about the wp-hackers mailing list