Flex Gumbo中如何检测文本布局框架版本的例子

By Minidxer | August 30, 2009

接下来的例子演示了Flex Gumbo中如何通过静态常量flashx.textLayout.BuildInfo,检测文本布局框架版本。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):
下面是main.mxml:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application name="Spark_TLF_BuildInfo_test"
  3.         xmlns:fx="http://ns.adobe.com/mxml/2009"
  4.         xmlns:s="library://ns.adobe.com/flex/spark"
  5.         initialize="init();">
  6.  
  7.     <fx:Script>
  8.         <![CDATA[
  9.             import flashx.textLayout.BuildInfo;
  10.  
  11.             private function init():void {
  12.                 var str:String = "";
  13.                 str += "Flex SDK version: " + mx_internal::VERSION + "\n";
  14.                 str += "Flash Player version: " + Capabilities.version + "\n";
  15.                 str += "TLF version: " + BuildInfo.VERSION + "\n";
  16.                 str += "TLF Build number: " + BuildInfo.kBuildNumber + "\n";
  17.                 debug.text = str;
  18.             }
  19.         ]]>
  20.     </fx:Script>
  21.  
  22.     <s:Panel id="panel"
  23.             title="SDK/Flash Player/TLF"
  24.             horizontalCenter="0" verticalCenter="0">
  25.         <s:SimpleText id="debug"
  26.                 left="20" right="20"
  27.                 top="20" bottom="20" />
  28.     </s:Panel>
  29.  
  30. </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, Other | No Comments » | Tags: ,

Search Posts