PDA

View Full Version : [AS2] an input text without clicking on with the mouse?


ri13
02-02-2009, 05:06 PM
I defined an area for an input text and I want to be able to input it without click on with my mouse. I wish the cursor was ready to write the text without forcing the user to click on in the text area.
Thank you for your help.

CyanBlue
02-02-2009, 05:35 PM
Howdy and Welcome... :)

Check out the Selection.setFocus() to set the focus to the textField of your choice...

xxneon
02-02-2009, 06:03 PM
and if this is in a browser .. to be able to select the textfield .. you need to make sure that the flash movie has global focus in the browser too.. which i think javascript can set focus to the flash movie object in the html after the page is finished loading ..

having Selection.setFocus(myText) for example as like your first line of actionscript will not be enough.. because more then likely this will execute before your flash movie has focus .. and when setFocus can not set focus to a specific item .. it returns false.

atomic
02-02-2009, 06:25 PM
http://www.artifactinteractive.com.au/dev/focus.html

eddiewireless
02-02-2009, 06:29 PM
and if this is in a browser .. to be able to select the textfield .. you need to make sure that the flash movie has global focus in the browser too.. which i think javascript can set focus to the flash movie object in the html after the page is finished loading ..

having Selection.setFocus(myText) for example as like your first line of actionscript will not be enough.. because more then likely this will execute before your flash movie has focus .. and when setFocus can not set focus to a specific item .. it returns false.

I encountered that problem too and was not sre why it was happening, instead of using javascript can one set up a onEnterFrame function that sets focus until true is returned!

xxneon
02-02-2009, 06:30 PM
yes you can.. but it would still require the user to click on the flash movie for it to return true.. ( or have javascript do it for you :p )

ri13
02-02-2009, 08:53 PM
Sorry, I don't understand what I must do...
In fact I have 2 lines on my time line :
- the first line corresponds to the input text called "text"
- the second one corresponds to a programm (typed in the panel action "F9") in which I use "text" as a variable
So, when I launch the application (with CTRL+ENTR), there is a window that appears and I'm forced to click on this window to be able to enter my input text.
How can I do to activate directly this window without clicking on? Please what should I write and where? in the panel action of the first line of my time line or in the second one and how?
Thank you very much to be as accurate as possible because I'm not an expert in flash and actionscript ;-)

atomic
02-03-2009, 01:58 AM
The movie must first have focus...

Check the link I provided above.

xxneon
02-03-2009, 03:00 AM
with ctrl+enter then only way to make the flash movie have focus is to click on the flash movie.

atomic
02-03-2009, 03:03 AM
You can't really test this within the application.
Test it out of flash through an .html.

ri13
02-03-2009, 08:10 AM
but I don't want to make a .html, I want to have a .exe to use with my PC.
So I'm going to make a .exe and I'll see but what should I insert as code? and where? Thank you very much.

xxneon
02-03-2009, 01:05 PM
the only thing i can think of is that you would need to use a 3rd party projector that would have the capability of giving the flash movie focus.. the standard flash projector does not have this ability I don't think.

opening the exe would technically give the flash player focus.. but it still does not give the inner flash movie focus until you click on it.. but its been awhile since i have done anything like that.. so i guess i can test it quick too. :p