Since TextEvents are cancellable, you can also look at using 
event.preventDefault(); in the TEXT_INPUT event handler to stop the 
Flash Player from automatically moving the cursor when the up key is 
pressed.

-d

Daniel Freiman wrote:
>
> What you're looking for is setSelection() to set the cursor position.  
> Simply put the same value in for the start and end value to place the 
> caret instead of the selection.  However I'm not sure this is going to 
> be as responsive as you like.  You may want to consider using a 
> different design such as having the history in a textarea and having 
> the user input in a textinput to simplify this problem.
>
> - Dan
>
> On 12/7/06, *chuvakgu* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Hi all,
>
>     How does one control position of the cursor inside a mx:TextArea?
>
>     What I am really trying to do is create a console
>     out of a TextArea. A user would enter commands at a
>     prompt, and at some point they would be sent to
>     the server for evaluation. I looked for something like this
>     but didn't find...
>
>     So, control of cursor will come in a case such as:
>     I want to use up-arrow as history, for example, but while
>     I can intercept the up-arrow on a keyDown or keyUp event
>     and show the item from history, the cursor still moves.
>     In this case, maybe intercepting the arrow's
>     defautl behavior is good enough, but in another case
>     (e.g., if a line ends with \, the next line is indented -
>     but the cursor by default is in the first column, but whne
>     I mouse click on the area, it ends up in the proper place).
>
>     Thanks.
>
>
>  

Reply via email to