在 html 中嵌入 swf 文件时如何检查 flash 上的旧版本

发布于 2024-11-15 23:28:00 字数 6598 浏览 0 评论 0原文

我的 html 页面中嵌入了一个 swf 文件。如何检查闪存版本上的旧版本,如果是旧版本,我想提示用户安装新版本。

我的html页面代码如下,它嵌入了两个swf文件(login.swf和whats_new.swf)

<!DOCTYPE html>

Cloud.cm - 连接.协作.共享

    Cloud brings online collaboration to your documents, music, video, calendar, email and chat in a lightweight easy to use readily available solution."> 
    <meta name="keywords" content="free online storage, online storage, file sharing, online file storage, share files online, store documents online, online collaboration, collaboration tools, ftp replacement, sharepoint alternative, file storage, mobile data access, share files online, asset management, online workspace, workspace, project management software, online collaboration, document sharing, document management, document editing, music sharing, video sharing, video chat, chat, email, calendar, calendar sharing">

    <!-- external style sheet -->
    <link href="assets/index_main/css/cloudstyle.css" rel="stylesheet" type="text/css">

    <!-- non-HTML5 browsers -->
    <script>
      document.createElement('header');
      document.createElement('footer');
      document.createElement('section');
      document.createElement('aside');
      document.createElement('nav');
      document.createElement('article');
    </script>

    <!-- swfobject -->
    <script type="text/javascript" src="lib/swfobject/swfobject.js"></script>

    <!-- jquery -->
    <script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script>          
    <script type="text/javascript">
    // we will add our javascript code here
        $(document).ready(function(){
            var lopen = false;
            $('#login').hide();
            $("#b_login").click(function(){

                if (!lopen) {
                    $('#login').show();
                    lopen = true;
                } else {
                    $('#login').hide();
                    lopen = false;

                }

            });

            $("#login header img#b_close").click(function(){

                if (lopen) {
                    $('#login').hide();
                    lopen = false;

                }

            });


        });

        function MM_preloadImages() { //v3.0
          var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
            var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        }

        function MM_swapImgRestore() { //v3.0
          var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
        }

        function MM_findObj(n, d) { //v4.01
          var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
            d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
          if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
          for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
          if(!x && d.getElementById) x=d.getElementById(n); return x;
        }

        function MM_swapImage() { //v3.0
          var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
           if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
        }
    </script>
</head>

<body onLoad="MM_preloadImages('assets/index_main/images/rol_login.jpg','assets/index_main/images/rol_signup.jpg', 'login.swf','assets/index_main/images/rol_close.jpg')">      
    <!-- LOG IN -->
    <div id="login">
        <header>
            <img src="assets/index_main/images/hd_login.jpg" alt="Cloud LOG IN" width="68" height="34" align="left">
            <img src="assets/index_main/images/btn_close.jpg" alt="Close" name="b_close" width="34" height="34" align="right" id="b_close" onMouseOver="MM_swapImage('b_close','','assets/index_main/images/rol_close.jpg',1)" onMouseOut="MM_swapImgRestore()"></header>
        <div id="flashlogindiv">
        <!-- FLASH Log in Movie -->         
        <object id="flashlogin" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="160">
        <param name="movie" value="login.swf" />
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="login.swf" width="400" height="160">
          <!--<![endif]-->
          <p>Alternative content</p>
          <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>           
        </div>
    </div>

    <!-- HEADER -->
    <header>
        <nav>
            <ul>
                <li><img src="assets/index_main/images/btn_login.jpg" alt="Log In" name="b_login" width="204" height="50" id="b_login" onMouseOver="MM_swapImage('b_login','','assets/index_main/images/rol_login.jpg',1)" onMouseOut="MM_swapImgRestore()"></li>
                <li><a href="signup.html"><img src="assets/index_main/images/btn_signup.jpg" alt="Sign Up" name="b_signup" width="154" height="50" id="b_signup" onMouseOver="MM_swapImage('b_signup','','assets/index_main/images/rol_signup.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></li>
            </ul>
        </nav>
        <a href="index_main.html"><img src="assets/index_main/images/logo_cloud_horizontal.jpg" width="350" height="110" alt="Cloud.CM"></a>
    </header>

    <!-- SECTION -->
    <section>
        <div class="alignC">
        <object id="features" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="815" height="325">
        <param name="movie" value="whats_new.swf" />
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="whats_new.swf" width="815" height="325">
          <!--<![endif]-->
          <p>Alternative content</p>
          <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>
        </div>

    </section>             

</body>

谢谢问候 ~Z~

I have a swf file embedded in my html page. How do I have a check for the older version on flash version, and if its an older version, I want to prompt the user to install a new version.

My html page code is below, and it has two swf files embedded (login.swf and whats_new.swf)

<!DOCTYPE html>

Cloud.cm - Connect.Collaborate.Share

    Cloud brings online collaboration to your documents, music, video, calendar, email and chat in a lightweight easy to use readily available solution."> 
    <meta name="keywords" content="free online storage, online storage, file sharing, online file storage, share files online, store documents online, online collaboration, collaboration tools, ftp replacement, sharepoint alternative, file storage, mobile data access, share files online, asset management, online workspace, workspace, project management software, online collaboration, document sharing, document management, document editing, music sharing, video sharing, video chat, chat, email, calendar, calendar sharing">

    <!-- external style sheet -->
    <link href="assets/index_main/css/cloudstyle.css" rel="stylesheet" type="text/css">

    <!-- non-HTML5 browsers -->
    <script>
      document.createElement('header');
      document.createElement('footer');
      document.createElement('section');
      document.createElement('aside');
      document.createElement('nav');
      document.createElement('article');
    </script>

    <!-- swfobject -->
    <script type="text/javascript" src="lib/swfobject/swfobject.js"></script>

    <!-- jquery -->
    <script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script>          
    <script type="text/javascript">
    // we will add our javascript code here
        $(document).ready(function(){
            var lopen = false;
            $('#login').hide();
            $("#b_login").click(function(){

                if (!lopen) {
                    $('#login').show();
                    lopen = true;
                } else {
                    $('#login').hide();
                    lopen = false;

                }

            });

            $("#login header img#b_close").click(function(){

                if (lopen) {
                    $('#login').hide();
                    lopen = false;

                }

            });


        });

        function MM_preloadImages() { //v3.0
          var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
            var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        }

        function MM_swapImgRestore() { //v3.0
          var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
        }

        function MM_findObj(n, d) { //v4.01
          var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
            d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
          if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
          for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
          if(!x && d.getElementById) x=d.getElementById(n); return x;
        }

        function MM_swapImage() { //v3.0
          var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
           if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
        }
    </script>
</head>

<body onLoad="MM_preloadImages('assets/index_main/images/rol_login.jpg','assets/index_main/images/rol_signup.jpg', 'login.swf','assets/index_main/images/rol_close.jpg')">      
    <!-- LOG IN -->
    <div id="login">
        <header>
            <img src="assets/index_main/images/hd_login.jpg" alt="Cloud LOG IN" width="68" height="34" align="left">
            <img src="assets/index_main/images/btn_close.jpg" alt="Close" name="b_close" width="34" height="34" align="right" id="b_close" onMouseOver="MM_swapImage('b_close','','assets/index_main/images/rol_close.jpg',1)" onMouseOut="MM_swapImgRestore()"></header>
        <div id="flashlogindiv">
        <!-- FLASH Log in Movie -->         
        <object id="flashlogin" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="160">
        <param name="movie" value="login.swf" />
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="login.swf" width="400" height="160">
          <!--<![endif]-->
          <p>Alternative content</p>
          <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>           
        </div>
    </div>

    <!-- HEADER -->
    <header>
        <nav>
            <ul>
                <li><img src="assets/index_main/images/btn_login.jpg" alt="Log In" name="b_login" width="204" height="50" id="b_login" onMouseOver="MM_swapImage('b_login','','assets/index_main/images/rol_login.jpg',1)" onMouseOut="MM_swapImgRestore()"></li>
                <li><a href="signup.html"><img src="assets/index_main/images/btn_signup.jpg" alt="Sign Up" name="b_signup" width="154" height="50" id="b_signup" onMouseOver="MM_swapImage('b_signup','','assets/index_main/images/rol_signup.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></li>
            </ul>
        </nav>
        <a href="index_main.html"><img src="assets/index_main/images/logo_cloud_horizontal.jpg" width="350" height="110" alt="Cloud.CM"></a>
    </header>

    <!-- SECTION -->
    <section>
        <div class="alignC">
        <object id="features" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="815" height="325">
        <param name="movie" value="whats_new.swf" />
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="whats_new.swf" width="815" height="325">
          <!--<![endif]-->
          <p>Alternative content</p>
          <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>
        </div>

    </section>             

</body>

Thanks regards
~Z~

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的往事 2024-11-22 23:28:00

我会使用 SWFObject。只需使用它,您就可以设置您的 SWF 所需的版本。这可能有用:检测 Flash Player 版本并使用 SWFObject 2 嵌入 SWF 文件

I would make use of SWFObject. Just by making use of it you can set a version required for your SWF. This might be useful: Detecting Flash Player versions and embedding SWF files with SWFObject 2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文