Forums / Setup & design / Flash and xml problem

Flash and xml problem

Author Message

Christophe DEMOIRE

Thursday 10 August 2006 3:40:05 am

Hello,

I have a flash file based on a xml file (Menu.xml) which creates a menu. Without ezpublish that works very well.
In the .tpl I put:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="830" height="40" id="Menu" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value={"images/menu.swf"|ezdesign} />
<param name="quality" value="high" /><param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src={"images/menu.swf"|ezdesign} quality="high" wmode="transparent" bgcolor="#ffffff" width="830" height="40" name="Menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

But nothing made there, it wants to take into account the xml...
I have already put the xml file in different place:
- the ezpublish root directory
- the images directory
- the design directory
- etc...

A desperate man.

I already cleared the cache!

Patrick Kaiser

Thursday 10 August 2006 5:15:13 am

you most probably have to alter your apache rewrite rule in order to allow access to .xml documents. to do so add a line like this in your vhost configuration:

RewriteEngine On
RewriteRule ^/(.*)(\.)xml - [L]
.. further rules here ..

In case you want to use information that is available within ez publish (e.g. node-names, text, images) in flash the better solution would be if you create a flash specific template, that fetches the relevant content and than outputs the plain xml. you could also define a new xml layout template in layout.ini.append.php und call it via http://[yourhost]/layout/set/[yourxmllayout]/content/view/full/[node_id].

regards, patrick


Best regards,

Patrick

Christophe DEMOIRE

Thursday 10 August 2006 5:58:55 am

Hi Patrick,

I dont't understand why use rewrite rules. The flash menu works in a html file. But, when I put it in my eZ templates, it doesn't work anyway.
The flash file require a xml file called "Menu.xml" wich is in the same directory. I cannot specify the path to the Menu.xml.

I think eZ publish don't load the xml file, or in a inccorect place.

I already cleared the cache!

Patrick Kaiser

Thursday 10 August 2006 9:57:28 am

If you installed ez publish according to the manual you have either created a dedicated virtual host for your ez publish site that contains some rewrite rules or you use an .htaccess file that contains theese rewrite rules. the standard rules prevent apache to deliver certain types of documents as for example .xml-files. if you request for example http://yoursite/menu.xml the rewrite rule prevent apache from delivering it, instead the request /menu.xml will be rewritten to the index.php which will cause ez publish to lookup menu.xml what will result in a 'module not found' error.

You see, the reason why flash cant use your xml-file is a rewrite rule.

if you use the standard .htaccess file you have to add 'xml' somewhere between the first '()'-group:

RewriteEngine On
RewriteRule !\.(gif|jpe?g|png|css|js|html|xml)|var(.+)storage.pdf(.+)\.pdf$ index.php

if you have a virtual host based setup you can add the rewrite rule from my previous post..

best regards, patrick


Best regards,

Patrick

Brian Gambill

Thursday 10 August 2006 5:29:58 pm

I had a similar problem trying to pull in external swf files. I was able to solve it using the "base" parameter.

See http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157.

<PARAM NAME="BASE" VALUE="http://www.domainname.com/software">