This method uses object/embed tags to insert open-flash-chart.swf on the page.
This is a simple setup using a query string to let the Flash player know where the data is. It only works if the url to the page has this appended to the end, for example: some-page.html?ofc=data-files/bar-2.txt If it’s not included, it won’t load the data. The open-flash-chart.swf automatically looks for certain things, in order to load the data. In this case, it’s “ofc” and the path to the data. No attributes needs to be specified, like an id or name, within the embeded player for it to know what “ofc” is. If you don’t want to the page to have the query string visible, then you would have to set up a separate page with the chart, and use an iFrame to insert it into the designated page. With the object/embed method, no javascript libraries are needed.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=8,0,0,0"
width="500" height="250" id="graph-2" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="open-flash-chart.swf" />
<param name="quality" value="high" />
<embed src="open-flash-chart.swf"
quality="high"
bgcolor="#FFFFFF"
width="500"
height="250"
name="open-flash-chart"
align="middle"
allowscriptaccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
This method uses SWFobject to insert the open-flash-chart.swf on the page
Using a query string and SWFobject works the same way as using the object//embed method. SWFobject is a light weight unobtrusive javascript file that simplifies the insertion of the file onto the page. It allows you to use alternate content in the case that the user doesn’t have javascript or flash installed. In this case, using a screenshot of the chart would be the simplest. It depends on the data being presented. If you want to go the long route for accessibility and SEO purposes, having the equivalent data in an html table would work.
CODE:
<script type="text/javascript" src="scripts/swfobject2.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {allowScriptAccess:"sameDomain"};
var attributes = {name:"open-flash-chart"};
attributes.id = "my-graph";
swfobject.embedSWF("open-flash-chart.swf", "my-chart",
"500", "250", "8.0.0", "/expressinstall.swf",
flashvars, params, attributes);
</script>
<div id="my-chart">
<p>Alternate data or chart image goes here if flash not found, or if javascript turned off</p>
</div>