On 6/1/05, loveewind <[EMAIL PROTECTED]> wrote: > Function: > User inputs the word in textarea,enter the key "Enter", > the head of next line need display the character "*",
Do it in the 'change' event handler: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ function addBullet(event){ var s:String = meetingObjective.text; if (s.slice(s.length - 1) == "\r") { meetingObjective.text += "*"; doLater(this, "setCaret"); } } function setCaret():Void { Selection.setSelection(meetingObjective.text.length, meetingObjective.text.length); } ]]> </mx:Script> <mx:HBox width="98%" > <mx:Text text="input:" width="110" textAlign="right" /> <mx:TextArea id="meetingObjective" height="70" width="100%" text="*" borderStyle="inset" maxChars="500" change="addBullet(event)"/> </mx:HBox> </mx:Application> You have to also set the caret at the last position after entering the extra '*' character, and it has to be done in the next frame because the TextArea's internal TextField does not seem to be updated before then. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/