Hi.

Now that Ive solved the textarea linebreak problem (with Josh's help, thanks 
Josh), my 
next problem arises...

How do I capture a line break in flex.

I capture the text that's been put in the textarea with linebreaks and all, but 
now I want 
to replace the linebreaks..

Ive tried this:


<mx:Script>
        <![CDATA[
                private function saveThis():void {
                                var s1:String = foo.text;
                                var myp:RegExp = /\n/g;
                                s1 = s1.replace(myp,"FA");
                                if (s1.indexOf("\n") > -1) {
                                        bar.text = "yes" + s1;                  
                
                                } else {
                                        bar.text = "no" + s1;
                                }
                }
        ]]>
</mx:Script>

        <mx:TextArea id="bar" width="100" height="100"/>
        <mx:TextArea id="foo" width="200" height="200" wordWrap="true"/>
        <mx:Button label="GO" horizontalCenter="0" top="10" click="saveThis()"/>

Thanks in advance.

Kr.
Luke.


-- 
Luke Vanderfluit
Analyst / Web Programmer
e3Learning.com.au
08 8221 6422

Reply via email to