mte01
asked on
i like to append a text into a text area where the mouse caret is...
Hi,
i like to append a text into a text area where the mouse caret is,
and then set the mouse caret at the end of the text area.
can this be done in flash 7??
thanks
i like to append a text into a text area where the mouse caret is,
and then set the mouse caret at the end of the text area.
can this be done in flash 7??
thanks
a texbox component allows that, but Im not sure if that is what you mean. Just make sure the "editable" parameter is set to true.
Hi, also not sure what you mean.
Do you want the user to simply insert the cursor into the text field and type.
Or are you thinking along other lines?
Do you want the user to simply insert the cursor into the text field and type.
Or are you thinking along other lines?
ASKER
Hi guys,
i have this button, that the user can click
if the original text was: 1234
and the mouse caret was after the 2,
and if the user clicked on this button: the text will become 12~34
it's like inserting text at a specific position, not at the end, i was looking now at the function Selection.getCaretIndex()
this will return the caret index. but i cant set the caret index of the text area, like after adding the character "~" i want the mouse caret to be at the end of the text so that when the user start typing the text will be appended at the end.. dont know if this is clear, plz tell me if it's not and ill try to make it clearer...
Kind regards
i have this button, that the user can click
if the original text was: 1234
and the mouse caret was after the 2,
and if the user clicked on this button: the text will become 12~34
it's like inserting text at a specific position, not at the end, i was looking now at the function Selection.getCaretIndex()
this will return the caret index. but i cant set the caret index of the text area, like after adding the character "~" i want the mouse caret to be at the end of the text so that when the user start typing the text will be appended at the end.. dont know if this is clear, plz tell me if it's not and ill try to make it clearer...
Kind regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
past the following code in a new FLA's first frame and compile the swf
----------
this.createTextField("pos_ txt", this.getNextHighestDepth() , 50, 20, 100, 22);
this.createTextField("cont ent_txt", this.getNextHighestDepth() , 50, 50, 400, 300);
content_txt.border = true;
content_txt.type = "input";
content_txt.wordWrap = true;
content_txt.multiline = true;
content_txt.onChanged = getCaretPos;
var keyListener:Object = new Object();
keyListener.onKeyUp = getCaretPos;
Key.addListener(keyListene r);
var mouseListener:Object = new Object();
mouseListener.onMouseUp = getCaretPos;
Mouse.addListener(mouseLis tener);
function getCaretPos() {
pos_txt.text = Selection.getCaretIndex();
}
--------------
Rgds
Aneesh
----------
this.createTextField("pos_
this.createTextField("cont
content_txt.border = true;
content_txt.type = "input";
content_txt.wordWrap = true;
content_txt.multiline = true;
content_txt.onChanged = getCaretPos;
var keyListener:Object = new Object();
keyListener.onKeyUp = getCaretPos;
Key.addListener(keyListene
var mouseListener:Object = new Object();
mouseListener.onMouseUp = getCaretPos;
Mouse.addListener(mouseLis
function getCaretPos() {
pos_txt.text = Selection.getCaretIndex();
}
--------------
Rgds
Aneesh
ASKER
thanks aneeshchopra
i can see the caret pos, the problem is that i need to set the caret pos, like i want when i click on a button to set the caret to the position 0 (or any number).
one more time thanks guys for the help for a big part of the problem is fixed.
Best regards,
i can see the caret pos, the problem is that i need to set the caret pos, like i want when i click on a button to set the caret to the position 0 (or any number).
one more time thanks guys for the help for a big part of the problem is fixed.
Best regards,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
***bowing to Aneesh***** thanks for saving me some time. I was about to try this. :)
ASKER
:) thanks Aneesh it's perfect.
Welcome,
but you still haven't accepted the comments...
but you still haven't accepted the comments...