;

PDA

Click to See Complete Forum and Search --> : Selection.setFocus() - not showing cursor


imdumb
12-10-2007, 02:10 PM
Hello,
Need to understand how the cycle of events occur on a single frame movie clip. Could someone give me a brief summary of what happens when I have a movie clip with two text boxs and two buttons.
The first button clears the boxes and second button sets focus to first text box, and set the text to 'home'.

The text in the first box is briefly selected and then the highlighted selected text disappears, but the text 'home' remain in the box and my focus says I'm in the first box, but I don't see a cursor in the first box. I understand the movie clip is cycling through it's events. But what events I'm not clear on.
If anyone can expand on the events occuring it would be a great help.

Simple action script:
btn1.onPress=function(){
txt1.text='';
txt2.text='';
};
btn2.onPress=function(){
Selection.setFocus("_root.txt1");
txt1.text='home';
}

blanius
12-14-2007, 02:48 PM
Not ignoring you, just haven't figured it out.

kutyamutya
01-06-2008, 06:23 PM
Hi,
if you want to see the cursor at the end of the word 'home' try this:

btn1.onRelease = function() {
txt1.text = '';
txt2.text = '';
}
btn2.onRelease = function() {
txt1.text = 'home';
Selection.setFocus("_root.txt1");
Selection.setSelection(_root.txt1.text.length,_roo t.txt1.text.length);
}