Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Set Focus On Text Field ?


How can I set / change focus on or between text fields?




Ultrashock Forums > Flash > ActionScript
Posted on: 2004-11-02


View Complete Forum Thread with Replies

Sponsored Links:

Focus Text Field
anybody know if it's possible to focus an input text field through actionscript?

View Replies !    View Related
Set Focus To Text Field
I there a way to have the blinking curser live in a text field when the swf is launched ?

View Replies !    View Related
How To Set Focus To A Text Field?
Now that setFocus() is gone, how do you tell the player to set focus to a specific input text field. I've searched thru the reference docs and haven't had any luck.

View Replies !    View Related
Text Field Focus
Hi, I was wondering if there was a way that you can determine which text field is in focus. I have 6 input text fields on the stage and in 5 of them I want it so that they can only contain numbers, meaning that you cant even type in letters at all. Is the only way to do this by setting the focus onto one of the text fields then tracking each change or is there an easier way?

If someone could help point me in the right direction it would be much appreciated thanks.

View Replies !    View Related
(MX 04 Pro) Focus A Text Field
This should be easy enough. I need to select an input text box on keypress, as the mouse will be busy. Ive had a look and found setfocus, but everything i try tells me There is no method with the name 'setfocus'. So somethin along the lines of

on (keyPress "<Left>"){
myinputbox.setFocus();
}

or whatever. Thanks in advance.

View Replies !    View Related
Set Focus To A Text Field
Flashers, does anyone know how to set focus to a text field when the MC is pulled up?

Basically, I have a button that loads an MC onto the stage (so within an MC in the base MC). When the new MC loads it contains a text field. I want the user to be able to start typing without having to click in the text field first. Any ideas?!

View Replies !    View Related
Focus On Text Field?
Hi there,

I have an input text field for a password with the ;

selction.setFocus(mytextField);

action. My problem is that although the cusor appears blinking away in the text field when the page opens, when I type nothing happens. I think that maybe even though the focus in the flash movie is set to the text field, the browser's focus isn't on the movie. Any ideas would be cool.

see it in action;

http://www.tokusgroup.com

View Replies !    View Related
(MX 04 Pro) Focus A Text Field
This should be easy enough. I need to select an input text box on keypress, as the mouse will be busy. Ive had a look and found setfocus, but everything i try tells me There is no method with the name 'setfocus'. So somethin along the lines of

on (keyPress "<Left>"){
myinputbox.setFocus();
}

or whatever. Thanks in advance.

View Replies !    View Related
Text Field On Focus
How can I make a text fields text dissappear on focus? I have an email sign up form that has "enter email" and when someone clicks on that field I want it to go blank. Thanks.

View Replies !    View Related
Set Focus On Text Field
We have a project wherein we need to have the blinking cursor on a certain text field once the movie loads. Is this possible on Flash?

I was thinking of creating a Javascript function on the page, and have the text field inside a movie clip. This movie clip in turn calls the Javascript function. The question again is, is this possible?

View Replies !    View Related
Focus On Dynamic Text Field.?
I have a dynamic text field for user input. I also have a button that clears the input (sets the textfields value to "")

great! now, is there a way to set "focus" on that field after the delete button is pushed, instead of the user havng to re-click in the text field to enter more text ?

thanks
Darin

View Replies !    View Related
Focus On A Text Field With Using Variables?
I have tried all the code below, but none of them work. Does anyone else have any ideas?

1
fFocus = "LastName";
Selection.setFocus(_root[fFocus]);

2
fFocus = "LastName";
Selection.setFocus("_root"[fFocus]);

fFocus = "LastName";
Selection.setFocus("_root[fFocus]");

Thanks

View Replies !    View Related
How Can I Change The Focus To A Text Field?
How can I change the focus to a text field?

View Replies !    View Related
Focus Input Text Field
Hello,

In the attached movie I've got a simple input Text Field
I need that when the movie loads I will see the blinking cursur
inside the text filed and won't have to press it in order to write.
It will be focused.

Any help is needed

View Replies !    View Related
[HELP] How Do I Force A Text Field To Be On Focus, With AS2?
I need to set focus of an input text box, how would I do this?

View Replies !    View Related
Getting Text Field To Focus On Keypress
Work on a standalone flash app in Flash 8. Here is what I want to do.

When (for example) F2 is pressed, I want a dynamic text field inside a movie file to come into focus so that any keyboard input will be loaded into an array and when F3 is pressed that text will dump into the text field for display. Text is not to show UNTIL F3 is depressed, but ALL keyboard input is to be captured after F2 has been pressed.

Now I could have it fill an array and when F3 is pressed the array is pointed to the text field.

Or have the text field nonvisible and type away filling the now focused dynamic box and made visible when F3 is pressed.

Lemme ghost code what I'm trying to accomplish. Ignore the fact that this won't compile, I'm doing it in psuedo-english/code to illustrate what I'm getting at

Assume:
movie file name 'textBox'; its instance name is 'textBoxInstance'
inside movie 'textBoxInstance' is a dynamic text field, var name 'displayText'
'keyCapture' is string array to capture keyboard input

//version 1


key.isDown(F2){
while(key.isDown != F3){
keyCapture[] = crapImtypingrightnow
}
else{ //oh look I hit F3, dump that stuff into the text box!
_root["textBoxInstance"].displayText = keyCapture[];
}

ver 2

key.isDown(F2){
//text box is hidden till I hit F3
while(key.isDown != F3){
_root["textBoxInstance"].displayText.visible = nein
_root["textBoxInstance"].displayText = crapImtypingrightnow
}

else{
//oh look I hit F3, all that text I just typed that was invisible is now visible
_root["theBoxInstance"].displayText.visible = damnstraight
}

all of this will be in a function so onLoad is not going to cut it. F2 will call the function, essentiall F3 will complete and break

help me out out wise ones of flash.

tanx.

View Replies !    View Related
Click The Text Field Before The Focus
Code:
stage.focus = myTestField;
This code focuses the cursor but how do I made some code click the text field before the focus?

Regards,

Glen Charles Rowell

View Replies !    View Related
Changing Text Field Focus
I have created a simple contact form in flash CS3..
But am having difficulty changing the focus of the text boxes.. from one to the other and back..Mouse clicks do not work..
Any help..?
Thanks

View Replies !    View Related
Lose The Text Field Focus
I have read tons of post in various forums and blogs about this bug...

http://www.actionscript.org/forums/s...d.php3?t=88476
http://www.actionscript.org/forums/s...d.php3?t=67855
http://www.philterdesign.com/blog/archives/000031.html
http://flashmx2004.com/forums/lofive...php/t5171.html
http://www.flashkit.com/board/archiv.../t-652323.html

It seems the focus of a textfield can't be lost as soon as one uses other components inside a movie in AS 2.0...

This causes serious headaches when working with onKillFocus and Key listeners, and it completly messes up my app...

I really need to find a workaround. I'm not so much concerned about buttons not recieving my clicks onPress but rather want Selection.getFocus() to display NULL after clicking anywhere outside of the text field so my key listeners can work again...

please help...

zillion42


>>>>THIS WORKS<<<<

>>>>THIS DOESN'T WORK<<<<

View Replies !    View Related
Text Field - Lost Focus
I have few input text fields on my Scene. Can I manage to lost focus from any text filed by clicking anywhere on Scene beside on text fields?

Now if I click anywhere on the Scene, last text field lost and again gets focus…

How to avoid that???

Thanks,

Bojan

View Replies !    View Related
Text Field - Lost Focus
I have few input text fields on my Scene. Can I manage to lost focus from any text filed by clicking anywhere on Scene beside on text fields?

Now if I click anywhere on the Scene, last text field lost and again gets focus…

How to avoid that???

Thanks,

Bojan

View Replies !    View Related
Text Field Not Losing Focus
i have a few text fields (input) on the stage but when you click outside of them they dont lose focus, why isnt it losing focus? i just tried sticking atext field on an empty movie and it did.

View Replies !    View Related
Detecting Text Field Focus
Hi all..

I already posted this in the flash forum... thought Id stick it in here too for a better chance of getting spotted...

Is there a way to to detect which text field is focused? I've got a scrolling form and I'd like it so that when the user focuses a text field (by either clicking in it or using tab) the form will scroll to where the user is at... Should be easy enough if there is some way to detect whether or not an field is focused right? Im a little worried cuz I cant find any reference to such a function in my Moock.

Any ideas?

Thanks!

View Replies !    View Related
Focus Input Text Field
I'm trying to set up an email form within a flash movie. I want to have example text in teh input fields, but don't want the text to have to be deleted when someone clicks inside of the text field. I just need the text to disappear and the box to be emptied out.

Is there a way to do this in flash?

View Replies !    View Related
Text Field Set Focus Problem Download.
This is driving me totally insane. I have done this before but cannot replicate it! Check this file out to see what I mean:
http://www.3dart.co.za/cgtalk/ahhhh.fla

I have placed this on frame 10 of the mc "holding" the textfield:

Code:
Selection.setFocus("name");
What's the problem I don't see one!? Any help please cause i'm gonna start crying

View Replies !    View Related
Changing Text Field Color On Focus
Hi there,

Is there a way to change the border and background color of a text field when it is focused on?

I know:
txtField.borderColor = 0x999999;
txtField.backgroundColor = 0xE3E3E3;

But how do I trigger it to change the color when the user clicks on the field?


Thanks!

View Replies !    View Related
Cant Remove Focus From Input Text Field
Hi,
I have a swf that is having problems only when I load a movie.

someButton.onRelease = function(){
empty_mc.loadMovie("C://maps/"+jpgName_txt.text+".jpg");
}

I noticed that the movie does not run right only when the cursor is still bliking in the input text field. I will input text in the input field but the cursor continues to remain in the field even after clicking the "someButton".

I tried to change the function to

loadMovie("c://maps/"+jpgName_txt.text+".jpg",empty_mc);

but is still has a problem. The problem being that when I click another button in the program, sometimes it will not work and othertimes it will.
When I remove the input field and hard code the import the loadmovie it works fine.

Any idea???? I'm loosing my hair..........

Thanks in advance.....[

View Replies !    View Related
Selecting All Text In An Input Field On Focus
Hello,

I am wondering how I can make actionscript highlight all the text in a text input field when I click in it. I have been able to accomplish this if I manually change the focus in actionscript, but I can't get it to work if I use the onSetFocus function for that text box.

Thanks for the help
Tim


Code:
this.createTextField("txtTest", this.getNextHighestDepth(), 10, 20, 100, 20);
txtTest.text = "My name is Barbara";
txtTest.onSetFocus = function() {
trace("I got focus");
Selection.setSelection(0,10);
};

View Replies !    View Related
Text Field Selection After Mouse Focus
In a test file, I have two input text fields on the stage, one_txt and two_txt. I want the default text to become selected when the text field gains focus. I have the following code in frame 1:
one_txt.border = two_txt.border = true;
one_txt.maxChars = two_txt.maxChars = 3;
one_txt.text = "360"; // Default values
two_txt.text = "100";
one_txt.onSetFocus = function() {
trace("onSetFocus in one_txt");
};
two_txt.onSetFocus = function() {
trace("onSetFocus in two_txt");
};
This works fine if you give focus with the Tab key. But if you focus the field by clicking in it, the correct focus trace message is shown, but the text isn't selected. I tried Selection.setSelection (0,3), but it didn't work. (It sets the selection in the OTHER text field apparently the oldFocus object.) Why does this happen and how can I get my current text field text selected when a user clicks in it?
Thanks in advance for any enlightenment and help.

View Replies !    View Related
Shifting Cursor Focus To Next Text Field
hi ,

i am doing a crossword game. i am having a problem in shifting cursor focus to one text field to another text field. is there anyone to help me to solve my problem?

cheers
anoop





























Edited: 11/24/2007 at 04:38:23 AM by Anoob Ambatt

View Replies !    View Related
Shifting Cursor Focus To Next Text Field
hi ,

i am doing a crossword game. i am having a problem in shifting cursor focus to one text field to another text field. is there anyone to help me to solve my problem?

cheers
anoop

View Replies !    View Related
On(focus){ Change Input Text Field Bg Color?
www.richcastillo.com
his contact page has this effect... can someone show me how?

thanks

View Replies !    View Related
Detecting A KeyUp While The Focus Is On An Input Text Field
^^pretty much what that said^^

When an input text-box is selected "onKeyUp" is never called..

I'm trying to create a live-search thing where it searches while you type, a bit like the spotlight feature on Mac OS X.

Is there a way to get around that like use a listener or something.

I have thought of one way: get javascript to detect a key release then tell flash about it but I'm trying to contain flash related stuff in the flash file...

can anyone help?
-Jacob

View Replies !    View Related
Setting Focus To First Text Field In Flash Form
I have some text fields and when the movie is exported or loaded I need the
cursor to be focused to the first textfield in the form

Please Reply soon Its urgent

Thank U,
S. Rajasingh Samuel

View Replies !    View Related
Calc In Dynamic Text Field When It Looses Its Focus
flash actionscript
i ve created 9 dynamic text fields in one row & this is named as fname0,fname1 .... fname8 & another 9 dynamic text fields in another row & this is named as chipsname0,chipsname1....chipsname8 ,I created these fields in an array. Based on the user entry in one of the text field i should calculate & display it in the corresponding text field in the other row, this should be done when the user types a number & when that text field looses its focus.

Kindly help me out in solving this problem immediately .

View Replies !    View Related
Unable To Set Focus To Login Text Field AUTOMATICALLY On Page Load
Hi,
I'm trying to have my flash (AS 2) login page have the username field start blinking right away after the page is loaded but so far, no success.

I've added the following Javascript to the HTML wrapper:

But it still doesnt work. Can anyone help?

See whats happening by clicking here.







Attach Code

<script language="javascript">
<!--
function flashFocus(){
clientArea.focus();
}
//-->
</script>

<body bgcolor="#ffffff" onLoad="window.document.flashFocus();">

View Replies !    View Related
Text Field Focus... MAYDAY, MAYDAY
Someone please help... I have no idea how to do this.
I have some text fields on a registration form, and I am trying to set the focus, so when one uses the tab key, the focus shifts from last name to first name, to address, to telephone... How do I do this. I have tried the following code, and it does not work: Is there a central place to put the code, or does each text field have to have a portion of the code? What is the best way to accomplish this?

Thanks


on (keyPress "<TAB>") {
if (selection.getFocus == "SSN") {
selection.setFocus = "Password";
} else if (selection.getFocus == "Password") {
selection.setFocus = "CPassword";
}
else if (selection.getFocus == "CPassword") {
selection.setFocus = "FirstName";
}
else if (selection.getFocus == "FirstName") {
selection.setFocus = "LastName";
}
else if (selection.getFocus == "LastName") {
selection.setFocus = "MiddleInitial";
}
else if (selection.getFocus == "MiddleInitial") {
selection.setFocus = "Street";
}
else if (selection.getFocus == "Street") {
selection.setFocus = "AptNumber";
}
else if (selection.getFocus == "AptNumber") {
selection.setFocus = "City";
}
}

View Replies !    View Related
Set Focus To A Input Field
Hi,
I just want to set focus to a input field with variable name "n" with the following script. But fail.
What's wrong about it?


Selection.setFocus( n );


pls help
thanks

denis

View Replies !    View Related
Field Focus In A Form
Hello, I have a form that contains a back button, when you click the back button the movie goes to frame one where data can be input again. What I am trying to do is get the form to focus on a certain field when it goes to frame one again. I have tried Selection.setFocus and it doesnt seem to be working. the form clip is a movie placed on _level0. This is the code I am using for the back button. What am I doing wrong?

on (release, keyPress "<Left>") {
gotoAndStop (1);
Selection.setFocus("_level0.fname");

Searcher

View Replies !    View Related
How Do You Set Field Focus Order?
The tab order I mean. Can this be done?

View Replies !    View Related
Form Field Focus?
Hi, I was wondering how to make a form field in flash that has text already in it when the form loads, and when the user clicks the field that text dissapears so they can enter their text.

I've also seen these forms that will put the initial text back if no text is entered and the user clicks a different text field.

Can anyone point me in the right direction? Thanks.

View Replies !    View Related
Form Field Out Of FOCUS
I made a form in flash with focus to change the highlight color but i can't set to multiples field

texto=new Array (ncto,cidade)
texto.onSetFocus = function(oldFocus) {
texto.background = true;
texto.backgroundColor = 0x9DCECC;
text.border = true;
texto.borderColor = 0x336699;
texto.textColor = 0x336699;
};
texto.onKillFocus = function(newFocus) {
texto.background = true;
texto.backgroundColor = 0xffffcc;
text.border = true;
texto.borderColor = 0x336699;
texto.textColor = 0x336699;
};

what should be worng?


thanks
molotophy

View Replies !    View Related
Input Field Stealing Focus
I have a problem with a project that I can't show, and I wasn't able to duplicate it in a simple example, so I understand if it's too vague to answer. But here goes...

What might cause a text input field to continually steal back focus? I have an input field that, once it has been clicked on, when you click anywhere else, it loses focus until you release the mouse, and it takes the focus back. Actually multiple input fields are behaving this way.

The biggest problem that it is causing is that when I click on a button, it works like it should, but then on button release, then button acts as if I am no longer hovering over the button, because the text field has stolen the focus.

Any Ideas? sorry I can't post the file

View Replies !    View Related
Events Happening When A Field Loses Focus?...
If I have a field called , say, "text_txt" - is there a way to make it so that something happens (like a goto action or whatever) as soon as the focus goes OFF of that text field?...

Thanks!...

View Replies !    View Related
TabIndex Problem - Focus Jumps In Browsers URL-field
hi,
i defined a tab-index order within a feedback form.
the strange thing is: with every second tab the focus jumps on the browsers URL-field !!!!

somebody who ever had the same effekt

View Replies !    View Related
Prevent Field Losing Focus On Button Click
I've been experimenting with capturing user selected text in an input text field and my starting point has been the following code from the macromedia site:

Code:
this.createTextField("output_txt", this.getNextHighestDepth(), 0, 0, 300, 200);
output_txt.multiline = true;
output_txt.wordWrap = true;
output_txt.border = true;
output_txt.type = "input";
output_txt.text = "Enter your text here";
var my_cm:ContextMenu = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Uppercase...", doUppercase));
function doUppercase():Void {
var startIndex:Number = Selection.getBeginIndex();
var endIndex:Number = Selection.getEndIndex();
var stringToUppercase:String = output_txt.text.substring(startIndex, endIndex);
output_txt.replaceText(startIndex, endIndex, stringToUppercase.toUpperCase());
}
output_txt.menu = my_cm;


However I want the doUppercase() function to be called from a button, not the right click context menu. When I click the button the field loses focus and therefore Selection.getBeginIndex returns -1. I've tried to use setfocus() to retain focus on the text field when the button is clicked, but so far no joy, Selection.getBeginIndex and EndIndex still return -1. Can anyone tell me where I'm going wrong?

Thanks

View Replies !    View Related
Setting Focus On An Input Field When It Enters The Frame
I can set the focus to a input field via a button using:

PHP Code:



on (release) {
    Selection.setFocus("Name");





but how can envoke this without a button press? My animation plays and the text fields appear in the final frame and this is where I want it to setFocus. I tried Selection.setFocus("Name"); on the main timeline but that dont seem to work.

Cheers.

View Replies !    View Related
Setting Focus On An Input Field When It Enters The Frame
I can set the focus to a input field via a button using:

PHP Code:



on (release) {
    Selection.setFocus("Name");





but how can envoke this without a button press? My animation plays and the text fields appear in the final frame and this is where I want it to setFocus. I tried Selection.setFocus("Name"); on the main timeline but that dont seem to work.

Cheers.

View Replies !    View Related
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...

Currently I'm using javascript which works fine to pass text from textfield A to textfield B:


Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.

Your help/advice would be greatly appreciated,

-Scott

View Replies !    View Related
Get A Text Field To Mirror The Contents Of Another Text Field [renamed]
hi guys. When i type the numbers in the box A.i want the number also appears in box B without typiing it, how to do this? Hope to hear ur replies soon.

( This is my link to my to the picture )
http://download.yousendit.com/ADA616D00C698A56

View Replies !    View Related
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.

using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.

here's the fla if i haven't been clear.

thanks for any/all help,
josh

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved