it doesn't have to be wired to clientside code.  You should be able to call the function..  What I'm guessing is that its a scoping issue.  I think that your socket handler is scoped outside your call.  Place a debug breakpoint and open up into debug mode.  You should be able to see if that function is even getting called.
 


 
On 2/8/06, Jonas Windey <[EMAIL PROTECTED]> wrote:
Yea, that example works too for me, I think the problem is somewhere else.

private function setLogVPosition():void
{
       txtLog.vPosition = txtLog.maxVPosition;
}

If I trigger this function on a button click, it works

<mx:Button click="setLogVPosition()" x="29" y="105" label="Button"/>

But I want to use it in a function that changes the txtLog's text, like
this:

private function socketDataHandler(event:ProgressEvent):void
{
       txtLog.text += "\n" + oSocket.readUTFBytes (oSocket.bytesAvailable);
       setLogVPosition();
}

And this one doesn't work. It sets the text with the correct data, but it
can't set the VPosition. It seems it has to be wired to some clientside
event, and can't be triggered from code. Is that correct?


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of Manish Jethani
Sent: dinsdag 7 februari 2006 19:29
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex 2.0 beta TextArea question

On 2/7/06, Jonas Windey < [EMAIL PROTECTED]> wrote:
>

> How would I set the scrollPosition of a textarea to it's maximum position?
I'm trying to create an msn-like socket application, and need to have my
textArea scrolled to the lowest position.

>
> I tried txtLog.vPosition = txtLog.maxVPosition; and txtLog.vPosition =
txtLog.textField.height, but no luck.

This seems to work for me in Beta 1.

<mx:TextArea id="textArea">
       <mx:text>
               <![CDATA[
This is some text.

And I love the way I can write code so quickly
in Flex Builder 2.0!

Woohoo!!!
               ]]>
       </mx:text>
</mx:TextArea>
<mx:Button click="textArea.vPosition = textArea.maxVPosition" />


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links












--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
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/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to