Flex Gumbo中如何通过调用export()函数从FxTextArea导出内容的例子

By Minidxer | June 24, 2009

接下来的例子演示了Flex Gumbo中如何通过调用export()函数,从FxTextArea导出内容。

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


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

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Application name="FxTextArea_export_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009"
  4.         layout="vertical"
  5.         verticalAlign="middle"
  6.         backgroundColor="white">
  7.  
  8.     <Script>
  9.         <![CDATA[
  10.             private function btn_click(evt:Event):void {
  11.                 debug.text = textArea.export().toXMLString();
  12.             }
  13.         ]]>
  14.     </Script>
  15.  
  16.     <ApplicationControlBar dock="true">
  17.         <Form styleName="plain">
  18.             <FormItem label="text:">
  19.                 <FxTextArea id="textArea"
  20.                         text="The quick brown fox jumps over the lazy dog." />
  21.             </FormItem>
  22.             <FormItem>
  23.                 <FxButton id="btn"
  24.                         label="export()"
  25.                         click="btn_click(event);" />
  26.             </FormItem>
  27.         </Form>
  28.     </ApplicationControlBar>
  29.  
  30.     <FxTextArea id="debug"
  31.             editable="false"
  32.             width="100%"
  33.             height="100%" />
  34.  
  35. </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

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

Search Posts