Note that there are some explanatory texts on larger screens.

plurals
  1. POxml file as flashvars in SWFobject
    primarykey
    data
    text
    <p>I have a flash file with an xml file as flashvars. when I use this code it works in every browser, but not in IE 7 or higher. </p> <pre><code>OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="530" HEIGHT="410" id="usa_locator" ALIGN=""&gt; PARAM NAME=movie VALUE="app_themes/theme1/usa_locator_demo.swf"&gt; PARAM NAME=FlashVars VALUE="app_themes/theme1/usa_locator.xml"&gt; PARAM NAME=quality VALUE=high&gt; param name="wmode" value="transparent"&gt; PARAM NAME=bgcolor VALUE=#F5F5F5&gt; EMBED src="app_themes/theme1/usa_locator_demo.swf?xmlfile1=app_themes/theme1/usa_locator.xml" quality=high wmode="transparent" bgcolor=#F5F5F5 WIDTH="530" HEIGHT="410" NAME="usa_locator" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"&gt; EMBED&gt; /OBJECT&gt; </code></pre> <p>After reading a lot, SWFObject seem to be a good option. All u need to do is:</p> <p>1- Include swfobject.js in header 2- Create an empty div for the flash object to be included</p> <pre><code>&lt;div id="myContent"&gt; &lt;p&gt;Alternative content&lt;/p&gt; &lt;/div&gt; </code></pre> <p>3- Embed the flash in the div via javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; swfobject.embedSWF("app_themes/theme1/usa_locator_demo.swf", "myContent", "530", "410", "6", false, **flashvars**); &lt;/script&gt; </code></pre> <p>The only problem I have is: I don't know how to pass the flashvars via a url for an xml file. It seems to me that SWFObject does not support this. Instead, you need to create a list of flashvars as </p> <pre><code>var flashvars = { name1: "hello", name2: "world", name3: "foobar" }; </code></pre> <p>and pass the variable to the javascript. The xml file i have is very large, and has many variables, I don't know how to do this. Please help. </p> <p>My XML file is something like:</p> <pre><code>usa_map_locator&gt; config&gt; color_state_name&gt;0xffffff&lt;/color_state_name&gt; color_state_name_over&gt;0xffffff&lt;/color_state_name_over&gt; type_of_gradient&gt;1&lt;/type_of_gradient&gt; background_color&gt;0xffffff&lt;/background_color&gt; show_links&gt;0&lt;/show_links&gt; light_effect&gt;1&lt;/light_effect&gt; border_color&gt;0xffffff&lt;/border_color&gt; sound&gt;on&lt;/sound&gt; /config&gt; map_data&gt; state&gt; id&gt;1&lt;/id&gt; name&gt;Washington&lt;/name&gt; link&gt;#&lt;/link&gt; comment&gt;Address: Phone: E-mail: /comment&gt; color_map&gt;0x7798BA&lt;/color_map&gt; color_map_over&gt;0x0054A6&lt;/color_map_over&gt; frame&gt;_top&lt;/frame&gt; image&gt;photo.jpg&lt;/image&gt; /state&gt; state&gt; id&gt;2&lt;/id&gt; </code></pre> <p>..... for all 50 states</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload