云自無(wú)心水自閑

          天平山上白云泉,云自無(wú)心水自閑。何必奔沖山下去,更添波浪向人間!
          posts - 288, comments - 524, trackbacks - 0, articles - 6
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          創(chuàng)建庫(kù)

          可以使用Flex Builder或者Compc命令行來(lái)創(chuàng)建庫(kù). 庫(kù)可以是一個(gè)SWC文件, 或者是包含了library.swf和catalog.xml文件的目錄. 一個(gè)庫(kù)通常包含自定義組件和類. 然后就可以在RSL中使用這些庫(kù)了.

          在Flex Bulder中, 通過(guò)使用Flex Library Build Path對(duì)話框來(lái)添加資源到庫(kù)中.

          在命令行中, 使用include-classes和include-namespaces選項(xiàng)來(lái)添加文件到庫(kù)中.

          下面的命令行示例說(shuō)明了如何創(chuàng)建一個(gè)名字叫CustomCellRenderer的庫(kù):

          compc -source-path ../mycomponents/components/local
          -include-classes CustomCellRendererComponent -directory=true -debug=false
          -output ../libraries/CustomCellRenderer

          所有包含的組件必須是靜態(tài)鏈接的文件. 使用compc編譯器創(chuàng)建庫(kù)時(shí), 不能使用include-file選項(xiàng), 因?yàn)檫@個(gè)選項(xiàng)不是將library.swf文件靜態(tài)鏈接到庫(kù)中的.

          可以使用directory選項(xiàng)指定輸出到一個(gè)目錄而不是到一個(gè)SWC文件中:

          <?xml version="1.0">
          <flex-config>
          ??? <compiler>
          ??????? <source-path>
          ??????????? <path-element>mycomponents/components/local</path-element>
          ??????? </source-path>
          ??? </compiler>
          ??? <output>libraries/CustomCellRenderer</output>
          ??? <directory>true</directory>
          ??? <debug>false</false>
          ??? <include-classes>
          ??????? <class>CustomCellRendererComponent</class>
          ??? </include-classes>
          </flex-config>

          輸出會(huì)是一個(gè)目錄,目錄里包含兩個(gè)文件
          ??? * catalog.xml
          ??? * library.swf

          創(chuàng)建library.swf文件后, 你可以編譯應(yīng)用并且指定文件的位置.



          主站蜘蛛池模板: 同仁县| 江华| 娄底市| 会宁县| 米泉市| 准格尔旗| 吉林市| 什邡市| 大洼县| 长汀县| 阿拉尔市| 桦甸市| 汨罗市| 神农架林区| 馆陶县| 阿克陶县| 开封县| 宜阳县| 虹口区| 运城市| 温泉县| 麻江县| 洪湖市| 新巴尔虎左旗| 融水| 阳新县| 邳州市| 扶风县| 林甸县| 白银市| 方正县| 汝阳县| 体育| 黑龙江省| 合山市| 历史| 汾西县| 乾安县| 鄱阳县| 洛阳市| 丹阳市|