如何在HTML页面上嵌入SWF文件? [英] How to embded a SWF on a HTML page?

查看:183
本文介绍了如何在HTML页面上嵌入SWF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



SWF在那里: http://bitbucket.org/natim/cip-qcu- editor / raw / 4746bbb86427 / qcu / swf / quiz.swf
我试过使用这个方法: http://latrine.dgx.cz/how-to-correctly-insert-a-flash-into-xhtml 和这一个: http://www.bobbyvandersluis.com/swfobject/generator/index.html 没有成功。

其实它可以工作,但是Firefox 3.6不能启动动画。



任何想法,我怎么可以使它工作?

谢谢

解决方案

我最终使用这样的SWFObject :

 < html> 
< head>
< title> Qcu - CIP UTBM& copy; 2010< /标题>
< meta name =authorcontent =RémyHUBSCHER/>
< style type =text / css>
* {margin:0;填充:0; }
html,body {width:100%;身高:100% background-color:#3f3fFF; }
div,object {width:100%;身高:100%}
< / style>
< script type =text / javascriptsrc =js / swfobject.js>< / script>
< / head>
< body>
< div id =quiz_content>
< object type =application / x-shockwave-flashname =quizid =quizdata =swf / quiz.swf>
< param value =swf / quiz.swfname =movie/>
< param value =truename =play/>
< param value =truename =loop/>
< param value =truename =allowfullscreen/>
< param value =alwaysname =allowscriptaccess/>
< param value =highname =quality/>
< param name =wmodevalue =window/>
< param name =scalevalue =showall/>
< param name =flashvarsvalue =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 ,
比例:showall,
allowcriptaccess:always,
};

var attributes = {
id:quiz
};
swfobject.embedSWF(swf / quiz.swf,quiz_content,100%,100%,9.0.0,false,flashvars,params,attributes);
< / script>


< / body>
< / html>


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

解决方案

I finaly used the SWFObject like this :

<html>
  <head>
    <title>Qcu - CIP UTBM &copy; 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>

这篇关于如何在HTML页面上嵌入SWF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆