7yue's Weblog

Thinking in RIA Solutions...2470,8514,1020的生活演绎

« Flex4你更希望看到哪些新功能奥运来了 »

FST的AIR Badge改为SWF Object 2.0

很多朋友反映AIR Badge出现一些问题,我刚刚将我的Flash Streaming Tool 1.1的AIR Badge内置的SWF Object从1.5升级为最新的2.1,希望能够解决一些问题。同时,我这里给出针对SWF Object使用在AIR Badge上的更新变动。SO1.5的AIR Badge的html代码是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Flash Streaming Tool Installer via AIR Badge</title>
  
  
  <!-- SWFObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/swfobject/ -->
  <script type="text/javascript" src="swfobject.js"></script>
  
</head>
<body color="#FFFFFF">


<!-- BEGIN EMBED CODE -->
  
  <!-- IMPORTANT: Make sure you also copy the swfobject script tag from the head above -->
  
  <div id="flashcontent" style="width:215px; height:180px;">
    <strong>Please upgrade your Flash Player</strong>
    This is the content that would be shown if the user does not have Flash Player 9.0.115.0 or higher installed.
  </div>

  <script type="text/javascript">
    // <![CDATA[
    
    // version 9.0.115 or greater is required for launching AIR apps.
    var so = new SWFObject("AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
    so.useExpressInstall('expressinstall.swf');
    
    // these parameters are required for badge install:
    so.addVariable("airversion", "1.1"); // version of AIR runtime required
    so.addVariable("appname", "Flash Streaming Tool"); // application name to display to the user
    so.addVariable("appurl", "http://www.7yue.com/FST/fms7yue.air"); // absolute URL (beginning with http or https) of the application ".air" file
    
    // these parameters are required to support launching apps from the badge (but optional for install):
    so.addVariable("appid", "fms7yue"); // the qualified application ID (ex. com.gskinner.air.MyApplication)
    so.addVariable("pubid", ""); // publisher id
    
    // this parameter is required in addition to the above to support upgrading from the badge:
    so.addVariable("appversion", "1.1"); // AIR application version
    
    // these parameters are optional:
    so.addVariable("imageurl", "fms7yue.jpg"); // URL for an image (JPG, PNG, GIF) or SWF to display in the badge (205px wide, 170px high)
    so.addVariable("appinstallarg", "installed from web"); // passed to the application when it is installed from the badge
    so.addVariable("applauncharg", "launched from web"); // passed to the application when it is launched from the badge
    so.addVariable("helpurl", "help.html"); // optional url to a page containing additional help, displayed in the badge's help screen
    so.addVariable("hidehelp", "false"); // hides the help icon if "true"
    so.addVariable("skiptransition", "false"); // skips the initial transition if "true"
    so.addVariable("titlecolor", "#00AAFF"); // changes the color of titles
    so.addVariable("buttonlabelcolor", "#00AAFF"); // changes the color of the button label
    so.addVariable("appnamecolor", "#00AAFF"); // changes the color of the application name if the image is not specified or loaded
    
    // these parameters allow you to override the default text in the badge:
    // supported strings: str_error, str_err_params, str_err_airunavailable, str_err_airswf, str_loading, str_install, str_launch, str_upgrade, str_close, str_launching, str_launchingtext, str_installing, str_installingtext, str_tryagain, str_beta3, str_beta3text, str_help, str_helptext
    so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this demo is run from the local file system."); // overrides the error text when the AIR proxy swf fails to load
    
    so.write("flashcontent");
    
    // ]]>
  </script>

<!-- END EMBED CODE -->

  
</body>
</html>

SO2.0的AIR badge html代码是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
      swfobject.registerObject("fms7yue", "9.0.0", "expressInstall.swf");
    </script>
  </head>
  <body>
    <div>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="215" height="180" id="fms7yue">
        <param name="movie" value="AIRInstallBadge.swf" />
        <param name="flashvars" value="airversion=1.1&appname=Flash Streaming Tool&appurl=http://www.7yue.com/FST/fms7yue.air&appid=fms7yue&appversion=1.1&imageurl=fms7yue.jpg&appinstallarg=installed from web&applauncharg=launched from web&helpurl=help.html&hidehelp=false&skiptransition=false&titlecolor=#00AAFF&buttonlabelcolor=#00AAFF&appnamecolor=#00AAFF&str_err_airswf=<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this demo is run from the local file system." />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="AIRInstallBadge.swf" width="215" height="180">
          <param name="flashvars" value="airversion=1.1&appname=Flash Streaming Tool&appurl=http://www.7yue.com/FST/fms7yue.air&appid=fms7yue&appversion=1.1&imageurl=fms7yue.jpg&appinstallarg=installed from web&applauncharg=launched from web&helpurl=help.html&hidehelp=false&skiptransition=false&titlecolor=#00AAFF&buttonlabelcolor=#00AAFF&appnamecolor=#00AAFF&str_err_airswf=<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this demo is run from the local file system." />
        <!--<![endif]-->
          <a href="http://www.adobe.com/go/getflashplayer">
            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
          </a>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </body>
</html>

两者在注册SWF和添加flashvars上有很大的不同。从1.5更新到2.0除了要更换html内的代码外,还要更新swfobject.js和expressintall.swf两个文件。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Walle Build 91204

Copyright 2007 www.7yue.com. Some Rights Reserved.
京ICP备05064035号