Has anyone else experienced this problem with Flash Node mod.

When I try to display a swf that is pulling & displaying info from a separate xml file, the swf just does not show up on the flash node.

The swf and xml file are in the same directory.

Any hep would be appreciated.

Comments

ismcdonald’s picture

I can get this to work by passing the path to the xml to the swf via flashvars.

Otherwise the first thing to check is that the path to the xml is relative to the uri of the page, not the swf.

Hope this helps

Ian

rolandk’s picture

Thanks for the reply Ian. Can you show me a code sample of what you mean "the path to the xml is relative to the uri of the page, not the swf."

How would I pass path to the xml to the swf via flashvars ?

The funny thing is that when I put up a html page with the object embedded, it displays fine.

When I put the same embed code into the drupal flash node - nothing happens.

ismcdonald’s picture

I'm guessing, but it's worth checking how the swf loads the xml. If it's a relative path - ie "./myXML.xml" then this will only work if the swf is embedded in an html page that's in the same directory as the xml.

When you upload a swf via flashnode, the page in which your swf in embedded is no longer in the same directory as the xml.

How I get around this in actionscript is using flashvars

So you give your flashnode a flashvars field something like: "path=/path_to_my_xml_file"

Then in the swf (using Actionscript 2 in this case) you retrieve the path variable from _level0.path like this

if (_level0.path == undefined) {
	xmlPath = "./myXML.xml"
} else {
	xmlPath = _level0.path + "/myXML.xml";
}

when you subsequently load your xml, you use the variable xmlPath.

Hope this works,
Ian

dman’s picture

Yeah. Pretty sure it will be A flash swf - XML relative path problem
Check out your 404 log and you will see the incorrect requests.
From there you must figure out what the right path should be and find a way to fix it.

If you have the fla - it'll be straightforward once you see the problem. If not, you'll have to get tricky.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Stuart Greenfield’s picture

The swf and xml file are in the same directory.

If you haven't coded an absolute path in to your script then Flash will, by default, look in the site root since the path is taken relative to the page that is loading (index.php).

Flash node supports the base parameter so you can resolve paths to other locations. When you create a flash node it defaults to the /files directory (because the assumption is you will upload other content with the upload module).

Refer to this handbook page for more details. There's also a documented example of an swf pulling in files via an xml list on my website.

Hopefully this will help you get things working!
________

Just five more minutes...

www.stuartandnicola.com