开发者

Appending a textarea text field on Flex

Is there a spark TextArea decleration in actio开发者_如何学JAVAnscript3 file since private var ta:TextArea is a mx component?


Yes there is:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">

    <s:TextArea id="textArea">This is a spark TextArea component</s:TextArea>

</s:Application>

or:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               creationComplete="init(event)">

    <fx:Script>
        <![CDATA[

        import mx.events.FlexEvent;
        import spark.components.TextArea;

        private var _textArea:TextArea;

        private function init(e:FlexEvent):void
        {
            _textArea = new TextArea();
            _textArea.text = "This is a spark TextArea component";
            addElement(_textArea);

        }// end function

        ]]>
    </fx:Script>

</s:Application>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜