I have a test html file on my site that the following embed code works on. I'm trying to recreate it with a filter syntax. I see a lot of examples using php snippets I don't see anything in the documentation as an example with the filter syntax for multiple flashvars. I've spent a couple of hours test out different filter syntax combination's trying to get it to work.

Can this be done with the filter syntax? Or do I need to enable the php snippets module and use php code to embed this. Any help would be greatly appreciated I feel like I'm banging my head against a wall trying to get this to work.

var flashvars = {}; flashvars.preview = "/files/panoramas/preview.jpg"; flashvars.movie = "/files/panoramas/pano.swf?xml_file=/files/panoramas/pano.xml"; flashvars.redirect = "window.location"; var params = {}; params.scale = "noscale"; params.allowfullscreen = "true"; params.allowscriptaccess = "sameDomain"; var attributes = {}; swfobject.embedSWF("/files/panoramas/preview_pano.swf", "content", "640", "345", "6.0.65", false, flashvars, params, attributes);

Comments

Stuart Greenfield’s picture

You can build up multiple flashvars using the filter by assigning a string to flashvars. The only "trick" is to separate each flashvar with double ampersands (&&).

You can pass the other parameters by writing them straight in to the filter. However, in answering your query I realise that SWF Tools doesn't pass the allowscriptaccess parameter through so I'll need to fix that.

In any case, your filter would look something like

<swf file="/files/panoramas/preview_pano.swf" flashvars="preview=/files/panoramas/preview.jpg&&movie=/files/panoramas/pano.swf?xml_file=/files/panoramas/pano.xm&&redirect=window.location" scale="noscale" allowfullscreen="true" allowscriptaccess="sameDomain">

That would build the appropriate string. Test it out and see if it works, but bear in mind that the allowscriptaccess parameter isn't working yet. I'll build that in along with the latest fixes for SWF Tools.

KrisBulman’s picture

I have a similar problem, and need to find out the correct syntax.

My original code is:

	  var so = new SWFObject("files/pano.swf", "pano", "780", "340", "9", "#ffffff"); 
	  so.addVariable("xml_file","pano.xml");
	  so.addParam("allowFullScreen","true");
	  so.addParam("allowScriptAccess","sameDomain");
	  so.write("flashcontent");
	  window.document["pano"].focus();

I have the input filter enabled, and have swfobject2 enabled and installed correctly.

I tried this:

<swf file="sites/sitename.com/files/panoramas/files/pano.swf"  flashvars="pano=sites/sitename.com/files/panoramas/files/pano.swf?xml_file=sites/sitename.com/files/panoramas/pano.xml" params="width=780&&height=340">

pano.swf file loads, but I am unable to get it to reference the xml file. can someone assist?

KrisBulman’s picture

ok, got it working..

used:

<swf file="sites/sitename.com/files/panoramas/files/pano.swf" id="pano" name="pano" bgcolor="#000000" flashvars="xml_file=panoramas/pano.xml" params="width=780&&height=340">

disabled looping and play immediately in the default embed options, and updated paths in xml file