open flash chart使用备忘录

open flash chart使用备忘录
2008-09-14 16:20

源代码

<head>

<script type=/"text/javascript/" src=/"swfobject.js/"></script>
<script type=/"text/javascript/">
var data=/'{/"title/":{/"text/":/"时实网速/"}, /"x_axis/":{/"max/":6},/"elements/":[{/"type/":/"line/",/"text/":/"eth0/",/"font-size/":10,/"values/":[5,8,9,4,7,8,20]}]}/';
function load()
{
tmp = findSWF(/"ofc/");
x = tmp.load(data);
}

function onrollout2()
{
tmp = findSWF(/"ofc/");
x = tmp.rollout();
}

function findSWF(movieName)
{
if (navigator.appName.indexOf(/"Microsoft/")!= -1) {
return window[movieName];
} else {
return document[movieName];
}
}

</script>
</head>
<body>
   <div id=/"ofc/">
   <p>Alternative content</p>
   <script type=/"text/javascript/">
swfobject.embedSWF(/"open-flash-chart.swf/", /"ofc/", /"500/", /"220/", /"9.0.0/",/"expressInstall.swf/",{/"data-file/":/"/data-3.txt/"});
   </script>
   </div>

   <input type=/"submit/" onclick=/"javascript:load()/" value=/"go/">
</body>

</html>

1. 引入<script type=/"text/javascript/" src=/"swfobject.js/"></script> js脚本文件.

2.用swfobject建立一个动态flash.放的位置就在<div id="ofc">处.

   <div id=/"ofc/">

   <p>Alternative content</p>

   <script type=/"text/javascript/">

swfobject.embedSWF(/"open-flash-chart.swf/", /"ofc/", /"500/", /"220/", /"9.0.0/",/"expressInstall.swf/",{/"data-file/":/"/data-3.txt/"});

   </script>

</div>

3.用

function findSWF(movieName)
{
if (navigator.appName.indexOf(/"Microsoft/")!= -1) {
return window[movieName];
} else {
return document[movieName];
}

}

函数找到flash后做操作.

 

你可能感兴趣的:(open flash chart使用备忘录)