问题
I am trying for a while now to display correctly a SWF project in a HTML file with good integration in all browser.
The SWF is there : http://bitbucket.org/natim/cip-qcu-editor/raw/4746bbb86427/qcu/swf/quiz.swf And I tried using this method : http://latrine.dgx.cz/how-to-correctly-insert-a-flash-into-xhtml and this one : http://www.bobbyvandersluis.com/swfobject/generator/index.html without success.
Actually it works but not with Firefox 3.6 that doesn't start the animation.
Do you have any idea of how I can make it works ?
Thanks
回答1:
I finaly used the SWFObject like this :
<html>
<head>
<title>Qcu - CIP UTBM © 2010</title>
<meta name="author" content="Rémy HUBSCHER"/>
<style type="text/css">
* { margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background-color: #3f3fFF; }
div, object { width: 100%; height: 100% }
</style>
<script type="text/javascript" src="js/swfobject.js"></script>
</head>
<body>
<div id="quiz_content">
<object type="application/x-shockwave-flash" name="quiz" id="quiz" data="swf/quiz.swf">
<param value="swf/quiz.swf" name="movie"/>
<param value="true" name="play"/>
<param value="true" name="loop"/>
<param value="true" name="allowfullscreen"/>
<param value="always" name="allowscriptaccess"/>
<param value="high" name="quality"/>
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="flashvars" value="xml_file=XML/quiz.xml"/>
</object>
</div>
<script type="text/javascript">
var flashvars = {
xml_file: "XML/quiz.xml"
};
var params = {
wmode: "window",
play: "true",
loop: "true",
allowfullscreen: "true",
scale: "showall",
allowscriptaccess: "always",
};
var attributes = {
id: "quiz"
};
swfobject.embedSWF("swf/quiz.swf", "quiz_content", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
</script>
</body>
</html>
来源:https://stackoverflow.com/questions/4322864/how-to-embded-a-swf-on-a-html-page