cancel
Showing results for 
Search instead for 
Did you mean: 

Pass the XML path to the swf

Former Member
0 Kudos
136

I understand how to create and pass XML data to my dashboard. Is it possible to pass the XML path so that I can control which XML data set is read?

For example, I could have an individual edit an existing dashboard with local XML test data (file:
C:/temp/test.xml)

which I can provide. When finished, they could load the dashboard to the web where a different XML path (pointing to production data) is used.

Can this be done?

Many thanks,

Jim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi James,

Yes, it can. In the XML Data connection there is a binding button at the far right of the "XML Data URL:" field. You can bind this to a cell and dynamically enter the .xml file path at SWF runtime.

Former Member
0 Kudos

Hi,

How would I pass it as a varable at runtime? I saw an example online but have been unable to implement this properly. I think it is a sytax error on my part. My xml file is c:\Xcelsius\example.xml and looks like this:

<data>
<variable name="ExampleRange">
  <row>
    <column> 29 </column>
    <column> 22 </column>
    <column> 18 </column>
    <column> 59 </column>	
  </row>
</variable> 
<variable name="ExampleRange2">
  <row>
    <column> 39 </column>
    <column> 29 </column>
    <column> 38 </column>
    <column> 53 </column>	
  </row>
</variable> 
</data>

I believe it correct syntax. When I hardcode the path and name into my data connection, the data is displayed in the dashboard and I can edit the xml and see real time changes.

When I create the .swf and the .html code, it looks like this:


<HTML>
<HEAD>
<TITLE>test3.swf</TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" 
WIDTH="607" HEIGHT="418" id="myMovieName">
<PARAM NAME=FlashVars VALUE="_xmlUrl=%3Cdata%3E%3Crow%3E%3Ccolumn%3E%3C%2Fcolumn%3E%3C%2Frow%3E%3C%2Fdata%3E">
<PARAM NAME="movie" VALUE="test3.swf"> 
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<PARAM NAME="play" VALUE="true">
<PARAM NAME="loop" VALUE="true">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="test3.swf" quality=high bgcolor=#FFFFFF WIDTH="607" HEIGHT="418" 
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" 
play="true" loop="true" 
FlashVars="_xmlUrl=%3Cdata%3E%3Crow%3E%3Ccolumn%3E%3C%2Fcolumn%3E%3C%2Frow%3E%3C%2Fdata%3E" 
PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</BODY>
</HTML>

I changed the value of _xmlUrl to:

  <HTML>
<HEAD>
<TITLE>test3.swf</TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" 
WIDTH="607" HEIGHT="418" id="myMovieName">
<PARAM NAME=FlashVars VALUE="_xmlUrl=file://C:\Xcelsius\example.xml">
<PARAM NAME="movie" VALUE="test3.swf"> 
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<PARAM NAME="play" VALUE="true">
<PARAM NAME="loop" VALUE="true">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="test3.swf" quality=high bgcolor=#FFFFFF WIDTH="607" HEIGHT="418" 
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" 
play="true" loop="true" 
FlashVars="_xmlUrl=file://C:\Xcelsius\example.xml" 
PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</BODY>
</HTML> 

When viewing in IE, I receive a error #2148

Can you tell where I have gone wrong?

Many Thanks,

Jim

Former Member
0 Kudos

Try changing your Flash Security Settings:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

In Global Security Settings, give Flash access to the folder where the XML files are located.

Former Member
0 Kudos

I changed the value of _xmlUrl to:

Ah, and maybe try changing the url with a binding, as described in post #2.

It seems you're currently using Flash Vars:

<PARAM NAME=FlashVars VALUE="_xmlUrl=%3Cdata%3E%3Crow%3E%3Ccolumn%3E%3C%2Fcolumn%3E%3C%2Frow%3E%3C%2Fdata%3E">

This string describes the cell structure of the Flash Vars binding. When you completely replace it, that may cause the error. Instead, if you're wanting to somehow use Flash Vars to pass the XML string, you'll need to insert the path into the structure somewhere (between the two column tags, if I'm not mistaken).

Edited by: Javier Jimenez on Nov 17, 2008 7:32 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

and yes, I was able to bind in the data connection.

Thanks again...

Former Member
0 Kudos

Excellent! It was the Flash security settings that needed to be changed.

The final version of the .html is :

<HTML>
<HEAD>
<TITLE>test3.swf</TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" 
WIDTH="607" HEIGHT="418" id="myMovieName">
<PARAM NAME=FlashVars VALUE="_xmlUrl=file://C:\Xcelsius\example.xml">
<PARAM NAME="movie" VALUE="test3.swf"> 
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<PARAM NAME="play" VALUE="true">
<PARAM NAME="loop" VALUE="true">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="test3.swf" quality=high bgcolor=#FFFFFF WIDTH="607" HEIGHT="418" 
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" 
play="true" loop="true" 
FlashVars="_xmlUrl=file://C:\Xcelsius\example.xml" 
PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</BODY>
</HTML>

Former Member
0 Kudos

Glad it worked!

Also, thanks for the info. I didn't know it could be changed like that.