Re: Not appending my inputs in textfields
Hi,
try
_level0.message = _level0.message add "D"
Selection.getFocus() returns the currently selected text field.
Your text fields can be within two movieclips and on mouseup you can store to a temp variable the value returned by Selection.getFocus().
Now instead of hard coding which text field to add characters you can use your temp variable to point to the appropriate text field to add.
(I have detailed it in an earlier post)
But this is needed only if you have two textfields.
Quote:
Originally posted by ananta2002
Example of button action(message is textbox):
on (release) {
_level0.message = message add "D";
}
How I will use here Selection.getFocus() for typing in both textfields.
[Edited by Viswanath Parameswaran on 01-10-2002 at 10:54 AM]
It is appending after last character of textfields
Hi Viswanath
This action is working but it is adding "D" character after last character of the textfield not in other place.
_level0.message = _level0.message add "D"
Ananta
Re: It is appending after last character of textfields
Hi,
Could you explain further. I can't seem to get the exact issue. Because this would keep on adding the letter "D". If you use another button with letter "E", it will add "E" etc.
Quote:
[i]Originally posted by ananta2002 [/i
Hi Viswanath
This action is working but it is adding "D" character after last character of the textfield not in other place.
_level0.message = _level0.message add "D"
Ananta
Re: Re: It is appending after last character of textfields
Hi Viswanath
If I am typing "D" character using my visual keyboard in the textfield in anywhere than this "D" is coming after last character of the textfield. This "D" character should come after the curser. For example:
This is a |visual keyboard.
(Suppose I want to write "new" before "visual" word than see the problem ... it is coming after "keyboard.")
Combination of conjuncts in flash is possible??
Ananta
Re: Re: Re: It is appending after last character of textfields
Hi,
Use Selection.getCaretIndex() to find the cursor position and then add the letter at
that position. ie.,
For the controller movie clip
-----------------------------
onClipEvent (mouseUp) {
// gets activated only if you click in the text box
if (Selection.getFocus() == "_level0.message") {
// assigns the cursor position (index) to myVariable
_root.myVariable = Selection.getCaretIndex();
}
}
When you press the button we have to split the message display into two parts. One is from
the begining till the cursor position and the other from the cursor position to the
end. ie.,
For the button
--------------
on(press){
part1 = _level0.message.substring(0,_root.myVariable);
part2 = _level0.message.substring(_root.myVariable,_level0 .message.length);
_level0.message = part1 add "D" add part2
_root.myVariable++;
}
Re: Re: Re: Re: It is appending after last character of textfields
Hi Viswanath
Thanks for your help
Now please solve my last question of 01-10-2002, I mean how to make dynamic conjunct combination making for Indian language in flash.
Ananta
Re: Re: Re: Re: Re: It is appending after last character of textfields
Hi,
I have made a sample application which uses conjunct characters. It is done in latin character set. The principle can be same for indian languages as well, if we are using ISCII character set.
You can view and download it at:
http://www.info-designers.com/flash/...l/conjunct.htm
(Try in IE)