XML/SWF Gauge  1.6 | XML/SWF Charts | SlickBoard(New)

 next > 

 

Basics

 

1. Type the following text in a text document, name the document sample.xml, and place it on your web server:


<gauge>
</gauge>

 


2. Using another document, create a web page on the same server, and insert the gauge.swf flash file into it like this (copy and paste the code in your web page):

<HTML>
<BODY bgcolor="#FFFFFF">

<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="400"
	HEIGHT="250"
	id="gauge">
<PARAM NAME="movie" VALUE="gauge.swf" />
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME="bgcolor" VALUE="#666666" />
<param name="allowScriptAccess" value="sameDomain" />

<EMBED src="gauge.swf" 
	quality="high" 
	bgcolor="#666666" 
	WIDTH="400" 
	HEIGHT="250" 
	NAME="gauge" 
	allowScriptAccess="sameDomain" 
	swLiveConnect="true" 
	TYPE="application/x-shockwave-flash" 
	PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>

</BODY>
</HTML>

Notice that the gauge.swf URL is in two different places to work on all browsers.

If gauge.swf isn't in the same directory as your web page file, this URL must contain the appropriate relative or absolute file paths. Examples: "/graphics/gauge.swf", "http://yourserver/graphics/gauge.swf".

 


3. Pass the URL of sample.xml to gauge.swf like this:

<HTML>
<BODY bgcolor="#FFFFFF">

<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="400" 
	HEIGHT="250" 
	id="gauge">
<PARAM NAME="movie" VALUE="gauge.swf?xml_source=sample.xml" />
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME="bgcolor" VALUE="#666666" />
<param name="allowScriptAccess" value="sameDomain" />

<EMBED src="gauge.swf?xml_source=sample.xml" 
	quality="high" 
	bgcolor="#666666" 
	WIDTH="400" 
	HEIGHT="250" 
	NAME="gauge" 
	allowScriptAccess="sameDomain" 
	swLiveConnect="true" 
	TYPE="application/x-shockwave-flash" 
	PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>

</BODY>
</HTML>

This tells gauge.swf to get the gauge's data from sample.xml created in the first step.

If sample.xml isn't in the same directory as gauge.swf, the sample.xml URL must contain the appropriate relative or absolute file paths. Examples: "/xml/sample.xml", "http://yourserver/xml/sample.xml".

 


4. Preview the web page in a browser. Because the XML code in sample.xml doesn't yet describe a gauge, this example generates a basic, default gauge like this:

 

 

 next > 


Copyright 2005-2018, maani.us