开发者

How to have a check for older version on flash when embedding a swf file in html

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 sr开发者_JAVA百科c="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~


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜