View Full Version : Making the cursor appear automatically in an input text field
comixgal
11-17-2005, 01:19 AM
I'm wondering if there is a way to make the cursor appear automatically within an input text field instead of having to click within the field first before typing.
I don't know if this should be an actionscript question or not.
Any help would be appreciated.
Thanks
comixgal
11-17-2005, 01:20 AM
Is there a way to control the cursor in an input text box through actionscripting?
I need the text cursor to appear immediately when I enter the frame.
oldnewbie
11-17-2005, 02:35 AM
setFocus in the AS dictionary.
If this opens your movie, movie and keyboard must also already have focus.
m00gzilla
11-17-2005, 03:49 AM
setFocus in the AS dictionary.
If this opens your movie, movie and keyboard must also already have focus.
i have this same question. I assumed its a setFocus script, but I have a few questions about it. Do I just add the script to a frame in the movieclip? And what exactly do you mean the keyboard must have setFocus?
I have tried a few different setFocus scripts so that when the inputbox appears, the cursor is already there, but nothing has worked yet.
m00gzilla
11-17-2005, 04:56 AM
I got it figured out
Selection.setFocus("name of inputbox");
comixgal
11-17-2005, 03:10 PM
This is great!
Is there a way to make the cursor blink within the box? Otherwise it's not clear that the focus is the textbox.
CyanBlue
11-17-2005, 06:03 PM
Howdy and Welcome... :)
You cannot really control the shape of the cursor, but you can set the focus to the specific textField so that the cursor will blink in that textField when you get into the frame...
Check out the Selection.setFocus() function for more information... ;)
Oh, for the best result, test your SWF file in the web browser... Sometimes this function does not work well within the Flash IDE...
m00gzilla
11-17-2005, 06:48 PM
This is great!
Is there a way to make the cursor blink within the box? Otherwise it's not clear that the focus is the textbox.
Based on my results, the cursor did blink in the inputbox when the focus was set. If it isn't, I'm assuming the focus still isn't being set to the inputbox correctly.
Make sure you have an instance name of the inputbox and that it is indeed an inputbox (not a dynamic textbox or static textbox). Then do your Selection.setFocus("inputboxname");
If this is for the web, it may be a little different in setting the focus, as my project was a projector file, not web so it worked as I explained.
Rossman
11-17-2005, 08:28 PM
Anyone know how to get the focus OFF a textbox once it's been set?
I tried doing something like Selection.setFocus("ButtonName") to set the focus onto a button that lives on the same frame, but no dice :-/
CyanBlue
11-17-2005, 08:36 PM
How about creating a dummy textField off the stage area and put the focus to that textField??? Just a thought... ;)
Rossman
11-18-2005, 05:24 PM
Sneaky idea, but I guess that would work!
You are supposed to be able to setFocus on things like buttons though, I thought...?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.