A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: input field moving selection point

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    996

    input field moving selection point

    I have a situation where a user types .5 into an input textfield. What I'm trying to do is change that to 0.5 after they type the .5
    In my textfield onChange event I have
    Code:
    		var firstCharacter:String = text.charAt(0);
    		if( firstCharacter=='.' ){
    			trace("text = "+text);
    			text = '0' + '.';
    			Selection.setSelection(  1, 1  )
    		}
    What I'm trying to do up here is when the user types "." it changes to 0. then I need to move the cursor 1 place passed the the decimal so the user can type in there after the decimal numbers.

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    996
    Ok the answer to this one is flash is stupid.
    How about this flash has a slight delay in updating its textfields so I had to add a delay before I called the Selection.setSelection( 2, 3 )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center