Forums / Setup & design / Problem with a flash image

Problem with a flash image

Author Message

christian bencivenni

Tuesday 13 November 2007 12:35:02 am

Hi to you all.
I have a problem overriding the pagelayou.tpl template in a fesh installation of ez 3.10.
I override correctly the home page pagelayout.tpl file but in the HTML code I have to put some code like this:

<div id="container">
...
<div id="lunario">Questo testo e' sostituito dal filmato Flash.</div>
<script type="text/javascript">
		// <![CDATA[
		var so = new SWFObject("lunario.swf", "mymovie", "760", "38", "7", "#000000");
		so.useExpressInstall('expressinstall.swf');
		so.write("lunario");
		// ]]>
	</script>
...
</div>

The problem is: nothing happens. I put the swf files both in images and javascript directory:
/design/name_site/images
/design/name_site/javascript
but nothing.
In a static HTML page instead all works correctly.
I tried to put the direct URL of www.domain.com//design/name_site/images/lunario.swf in a browser and the flash animation opened correctly too.
Where is my error?
Thank you a lot.

André R.

Tuesday 13 November 2007 2:02:21 am

With that code, your browser will look for the swf file in the 'folder you are currently in'.
As in, when you go to domain.com/folder/folder2/content1, your browser will look for the swf files in domain.com/folder/folder2/lunario.swf.

So basically you need to look into the ezimage and ezdesign template operators, I leave it to you to find them in the doc..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

christian bencivenni

Tuesday 13 November 2007 2:19:38 am

thank you.
but... mmm... I don't think so.
I also try changing the url into:

var so = new SWFObject("/images/lunario.swf", "mymovie", "760", "38", "7", "#000000");

or

var so = new SWFObject("/name_site/images/lunario.swf", "mymovie", "760", "38", "7", "#000000");

or even
var so = new SWFObject("http://www.domain.com/design/name_site/images/lunario.swf", "/name_site/images/mymovie", "760", "38", "7", "#000000");

but without success.
I cannot use ez teplate path like {'lunario.swf'|ezimage} into a CDATA section isn't it?

André R.

Tuesday 13 November 2007 2:31:51 am

ez template code should not care about CDATA sections.

try something like:

<script type="text/javascript">
                // <![CDATA[
                var so = new SWFObject({"lunario.swf"|ezimage}, "mymovie", "760", "38", "7", "#000000");
                so.useExpressInstall({"expressinstall.swf"|ezimage});
                so.write("lunario");
                // ]]>
        </script>

And be sure that your apache rewrite rules allows swf files from the images directory

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

christian bencivenni

Wednesday 14 November 2007 12:24:52 am

Sigh...
No way.
I also use IIS server so I don'texactly know how to search a rewrite file.

André R.

Wednesday 14 November 2007 4:47:19 am

Look in the generated source code ('view source') and try to paste the generated url for the swf's directly in you browser to see if it's a url / rewrite rule problem or something else..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

christian bencivenni

Saturday 17 November 2007 8:24:50 am

All work now!
With many tries i find the correct path to find the image.
thank you.