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








Selection.setFocus ----- BUG?


Hello,

Can anyone tell me if I am doing something wrong?

In frame 1 odf my movie I do a Selection.setFocus on an Input text field. This works fine, the user can start typeing into the field as expected.

BUT......

Using Selection.setFocus kills the BACKSPACE key on the key board!!

EXAMPLE:

Selection.setFocus(myTextfield);

This set the focus to the field as soon as the frame is loaded(the cursor is in there flashing),and the user can start typing away, but the BACKSPACE key is DEAD!!!

can anyone suggest a work-around to allow focus to be set and the keyboard to behave?

thanks,




FlashKit > Flash Help > Flash MX
Posted on: 10-30-2002, 04:41 PM


View Complete Forum Thread with Replies

Sponsored Links:

Selection.setFocus Selection.getFocus Inputting From Mc
i am attaching a number of _mc (my_mc) with a for loop. Inside each my_mc is an input textfield (my_txt)

I want to click on my_mc.my_txt and select the textfield .the following code allow this and i can enter text from the keyboard however I want to add text from a _mc keybooard on screen (here called myBtn_mc).

As soon as I click on myBtn_mc of course I lose focus ... i have tried to use a variable (select) to keep scope&focus ... I keep focus but can not add text via screen _mc

many thanks Neil

View Replies !    View Related
Selection.setFocus() FocusManager.setFocus()
Why do I have a focusManager included in my movie by default? Does it come from the components TextInput, Label, Button etc...? Second I cannot set focus to any components by using the focusManager or the Selection.setFocus() methods. Can anyone point me in the right direction. This is driving me nuts.

View Replies !    View Related
Selection.setSelection || Selection.setFocus Help?
I have text fields I want to run with a tab key in a certian order, and miss one that it seems to go to automatically.
Does anyone know how I can do this with selection.setFocus and Selection.setSelection?
heres the order and what I want it to do,
0 username (if the username has it in there already then go to password instead)
1 password (if the password is there already then go to topic instead)
2 topic (selection.setFocus to topic if the the other two are filled already, then the next selection I want it to go to message after topic)
3 message
If anyone can help me out with this I would appreciate it.
Thanks in advance
Deadsam

View Replies !    View Related
Selection.setFocus...?
I'm interested in knowing if it's at all possible (keeping in mind I'm using V5) to have a FLASH mail form open with:


Code:
//Text Field Label//
CompanyName = "Company Name";
//Make sure cursor opens in first text field//
Selection.setFocus("_level0.ContainerMC3.Form.CompanyName");


But to somehow have the "Company Name" text field label highlighted within the CompanyName text field.

As would occur when tabbing to a text field whose variable is equal to
"something"?

Does this make sense?

View Replies !    View Related
Selection.setFocus
Here is the link:
http://www.pyroblue.com/test/marcomm/stage.html

Click the different menu "things"
I want to be able to (when clicked) bring that piece of paper to the front. I thought something like Selection.setFocus would get me going. But no.
Am I going in the right direction with that? Or most likely am I way off.

Thank you for your time and help!!

View Replies !    View Related
Selection.setFocus(help) ?
Is ther some method that should be used to implement Selection.setFocus?

Check the fla

MX

cheers
paul

View Replies !    View Related
Selection.setFocus ?
I have an input text field on my stage called 'searchString_txt'

I have this code in my movie:

Selection.setFocus(searchString_txt);

Why doesn't this text field receive focus (with flashing pipe "|") when I run my movie.

Thanks,
Stephen.

View Replies !    View Related
Help Using Selection.setFocus
hi-

i've got a slight problem i'm trying to get a flash projector to automatically focus on a text input box

so i've put this code in the frame that contains the input box:


Quote:




selection.setFocus("promptInput");






and named the input text box instance "promptInput" but alas its not working do you have any ideas?

many thanks in advance,

dom

View Replies !    View Related
Selection.setFocus
Why doesn't this piece of code set the focus of my textfield named "testInput"?

Selection.setFocus("_root.testInput");

(The var property of the textfield is not set)

View Replies !    View Related
Selection.setFocus
Hello,

The code below once executed will not cause the cursor to blink inside the textfield. I'm trying to get the cursor to blink when the movie loads.

I read other posts, but the code does not seem to work for me.

onClipEvent(load){
ffocus();
function ffocus(){
if(iusername_txt.length==0){
trace(iusername_txt.length);//0
status_txt= "fill in username_txt";//ok
//username_txt= "username_txt"; //ok
Selection.setFocus("username_txt");//no flashing cursor
}
}
}

View Replies !    View Related
Selection.setFocus
Hi

Does anyone no how to get the curser into a textbox when a movie loads.
Because the only way of starting the tabbing order at one is to put the curser into the first field by hand.

I have tried Selection.setFocus("company_txt"); but this does not work.

Thanks for any help.

View Replies !    View Related
Using Selection.setFocus
I’ve been struggling with Selection.setFocus and can’t find an existing post that fit my question.

One piece of my app is a flash movie that prompts its operator through a bunch of questions. That operator only has a couple of buttons and an “input text” box to interact with. In making this as simple as possible for the operator I want to keep the input focus on that input text field as much as possible. In other words, if the user clicks some other part of the screen, or presses one of the buttons, I’d still like to return focus to that one input text field. (Of course, I don’t expect to handle the window itself losing focus)

I thought I could do this with Selection.setFocus(“myTextBox”) I thought that if I used either a Selection.onSetFocus event or a myTextBox.onKillFocus() event, then I could just Selection.setFocus back to myTextBox.

While I see the events, and can even see the event of me setting focus back to myTextBox, I don’t get the behavior I was expecting. I’d expected that when focus was set back to myTextBox that any input would be directed right into that text field. Instead, I sill need to move the mouse into that text field and click it.

Were my expectations wrong? Or am I going about it incorrectly? The behavior is the same whether I run it in the authoring environment, as a stand-alone .swf, or in a browser window. I am using Flash MX.

An example below is an elaboration of a sample from the Actionscript.org board. (Its purpose is to show tabbing - there are two input text boxes on the canvas). This example properly works when it first comes up. The Name field contents are selected and you can just type. But if you click somewhere else and force the focus to change (and then get reset) the Name field contents get highlighted (as though selected) but you cannot just type into it. You have to click into the field.

stop();

theName.text = "Name Here";
thePass.text = "password";

theName.tabIndex = 1;
thePass.tabIndex = 2;

Selection.setFocus(theName);

focusTracking = new Object();
focusTracking.onSetFocus = function(oldFocus, newFocus) {
trace("focus changed from " + oldFocus + " to " + newFocus);
Selection.setFocus(theName);
}

Selection.addListener(focusTracking);

--

Thanks in advance for any help,

View Replies !    View Related
Selection.setFocus ?
I have an input text field on my stage called 'searchString_txt'

I have this code in my movie:

Selection.setFocus(searchString_txt);

Why doesn't this text field receive focus (with flashing pipe "|") when I run my movie.

Thanks,
Stephen.

View Replies !    View Related
Help With Selection.setFocus
Hi Guys

I am using selection.setfocus so that my input for can be controlled by the keyboard but I have a slight problem. When you tab to a textfield it will have a green border so that you can see it has the focus but when you use the setfocus method it does not. Does anyone know why and how to fix this?

Thanks
Shane

View Replies !    View Related
Selection.SetFocus();
I am trying to get Selection.SetFocus to work for a text box.

It works when I open just the SWF (test.swf) but when I try to use (test.html) it does not focus.

Anyone know of a way around this?

View Replies !    View Related
Selection.setFocus()
is there a way to add a condition that reacts depending on what text field is in focus, ie (if the user selects the "from field" then do...)

example:

if (Selection.getFocus() == _root.from) {
tellTarget ("_root.bubble") {
gotoAndStop(153);
}
} else if (Selection.getFocus() == _root.to) {
tellTarget ("_root.bubble") {
gotoAndStop(154);
}
}

this is what ive got at the moment but NOTHING happens

View Replies !    View Related
Selection.setFocus ?
I have an input text field on my stage called 'searchString_txt'

I have this code in my movie:

Selection.setFocus(searchString_txt);

Why doesn't this text field receive focus (with flashing pipe "|") when I run my movie.

Thanks,
Stephen.

View Replies !    View Related
Selection.setFocus
Code:

selection.setFocus("ctaScene");
selection.setSelection(nIndex, nIndex + sSearchString.length);

This code finds a word in a document. Only trouble is it wont work.
I can
Code:

trace(nIndex)
And it traces to the output panel but I can't get the texts to setFocus or highlight. Even if I just go.
Code:

selection.setFocus("ctaScene");
selection.setSelection(0 , 90);

View Replies !    View Related
Problem With Selection.setFocus()
Ive done an editable text field called "entrada", and ive written the following script in frame 1:

Selection.setFocus(entrada);

IT DOESNT WORK!!! How is it possible??

View Replies !    View Related
Selection.setFocus == .notWorking
sibilance,

I've read a bunch of posts, and this is ever so slightly grating on me now, because everyone else can get it to work...

in Flash 5, I want an input field to be active when you enter the frame, so in the action for the frame, I have


Code:
Selection.setFocus(_root.inputword)
where inputword is the variable name of the input text field. On this same frame I have a dynamic text field that loads variable randomword, and a couple of other dynamic fields that count down backwards.

I'm assuming that the other dynamic fields should have zero effect on the input field I'm trying to setFocus, but I can't think of anything else, and it's driving me crackers.

As always, any help most gratiously received

View Replies !    View Related
Selection.setFocus(); Question
I use Selection.setFocus(inputField);, but I am unable to backspace unless/until I um select the field with my mouse. Doesn't that kind of defeat the purpose?

Anyway, what to do about this?

Thank you kindly.

View Replies !    View Related
Selection.setfocus .......problem
Hi FK..

I have a text input box which i have set so that the curser is flashing inside it when the movie is loaded from the server, however im unable to type into the input box unless i click my mouse inside the box...very strange...the cursor is flashing inside but i cant type!

my script is this...

Selection.setFocus("mytext1");
mytext1.tabIndex = 1;
mytext2.tabIndex = 2;
mytext2.password = true;

any ideas how to solve this would be great...thanx!

View Replies !    View Related
LoadMovie - Selection.setFocus
Help!

As I'm building a complex on-line exames with audio help files I split most of input fields into separate .swf. Problem is how to get "Carret" blinking when a new movie loads. First two work great, but when I load a third one focus is on the third one but carret within a input field of the second .swf !!
here is the code I'm using........but

//set focus on input field

onClipEvent(load){
Selection.setFocus("_parent.text1")
}

// when user hits enter, next input field loads

onClipEvent (enterFrame) {
if (Key.isDown(Key.ENTER)) {
loadMovieNum("text2MC.swf", 2);
}else{
gotoAndPlay(1)}
}

Now, the same code within "text2MC.swf" loads "text3MC.swf" but carret remains in input field of "text2MC.swf" !!! WHY!

Help!

Alek

View Replies !    View Related
Selection.setFocus Problem
Hi All,

I am having a strange problem. I have an e-mail form, and as soon as this mail form loads, I am setting a Selection.setFocus on the first field, ie the name and everything is working fine till now. I can type in the textfield and also delete and stuff like that. However when I press the submit button, I am doing some validation and if the user did not enter a surname for example, I want to set focus on that field, and it is not working here. I am applying the same code, ie Selection.setFocus("surname");

Why is this happening?

Thanks for your help

View Replies !    View Related
Problem With Selection.SetFocus
I have a major problem with Selection.SetFocus().

The textfield selected with this method don't seem to intercept the Backspace key and the enter key.

Anyone know how to solve this ?

View Replies !    View Related
Selection.setFocus Concatenate
Hi All,

I have textfields named 'strText' inside 10 movieclips named 'field0', 'field1', 'field2' .... and so on!


I'm trying to chech whether a field is empty or not and then set the selection to the first empty textfield.

But this doesn't work?


PHP Code:




function setFocus () {
    for(i=0;i<10;i++) {
        if(["field"+i].strText.text eq "") {
            Selection.setFocus(["field"+i].strtext);
            break;
        }
    }
}





Give it up ...
//pod

View Replies !    View Related
Selection.setFocus() *** Question
On the root of my swf i have a input text named "info". I want to let the cursor pink in that textfield with following code:
Selection.setFocus("info")
The textfield is pinking BUT i can't type into it. I have to click the textfield first, before i can type in it.
Anyone knows how to avoid this. (so the textfield is immediately retypable without clicking first?)

thanks

View Replies !    View Related
Selection.setFocus And Tab Ordering
I was wondering if it is possible to display both a tab set focus and tab enabled feature on the first text field of a form. I can get one or the other to work but not both at the same time in a browser window.

Here is the code I have used:

firstName.tabEnabled = true;
firstName.tabIndex = 1;
surName.tabEnabled = true;
surName.tabIndex = 2;
payNumber.tabEnabled = true;
payNumber.tabIndex = 3;
Selection.setFocus(firstName);

Any suggestions welcome. Thanks in advance.

View Replies !    View Related
Selection.setFocus Issue
I have a mail form with drop downs - Located in the "QUOTE" section. The form is set up to allow tab indexing from one text filed to the next. In each drop down, I have placed on each selection the following:

Code:
on(release){
Selection.setFocus("_level0.ContainerMC3.Form.ProjectScope");
// Set tab at ProjectScope text field, and so on//
}

This is to reset the Tab back to the text field the user has just made his/her selection in. and to allow the indexing function to continue working after a selection has been made.

OK, thats the back ground for this problem...hope it makes sense.

What's occurring is that on(release), when the Selection.setFocus is performed on any multi word selection the text field highlight (that is then placed in the corresponding text field) does not encompass the entire selection.

This is an esthetic issue. The indexing does continue to function. Wondering if anybody might have an idea have to rectify?

Thanks

View Replies !    View Related
Selection.setFocus Issue
Probably should've posted here!

Just posted in the General Forum

I have a mail form which is set to allow tab indexing. In several of the forms fields there are drop-downs. When the user makes their selection from each drop-down I have the

Code:

on(release){
Selection.setFocus("_level0.ContainerMC3.Form.ProjectScope");
// Set tab at ProjectScope text field, and so on//
}
to reset the Tab back to the text field the user has just made his/her selection in, and to allow the indexing function to continue working after a selection has been made.


What's occurring is that on(release), when the Selection.setFocus action is performed on any multi word selection (of my drop-down items) the text field highlight (that is then placed in the corresponding text field) does not encompass the entire selection.

This is an esthetic issue. The indexing does continue to function. Wondering if anybody might have an idea have to rectify?

Thanks

View Replies !    View Related
Selection.setFocus() Problem
hey all -

i'm trying to set up functionality that will allow a user to TAB between input fields that exist as content in a scroll pane window. I have it working to the point where if they select one field, they can tab and the next field will be selected, but i cannot enter text into that field unless i click again on it (which kind of defeats the purpose).

so far, this is how it is working:
within my content_mc (where the input fields are created dynamically), each field has an onChanged function, that when activated, kills the Key Listener on the main timeline that listens for the TAB key, does some autoformatting, and then begins the Key Listener again to listen for the next tab. This allows a different listener to be in effect while the user is inputting data.

when TAB is clicked, there is a function on the main timeline that grabs the current focus as a reference, then does some figuring to find the next field. for instance, if i have field1_txt selected, press tab, the function knows that the next field should be field2_txt. then the function sets the selection to field2_txt.

this all works, except that field2_txt does NOT get a cursor and text cannot be inputted without actually clicking on it.

any ideas?

flash mx on os x.

View Replies !    View Related
Selection.SetFocus Issue - Please Help
Hello!

I wish to set focus on a specific input textfield on load. I use:

Selection.setFocus ("myText"); // Text not var but instance name

But as I do - the delete button and backspace buttons are disabled? Why is that??

And another thing:

When the "." (dot) is pressed in this textfield at runtime the _root.movie starts to play??

What am I missing (I'm using Flash MX)

View Replies !    View Related
Selection.setFocus(); Components
Has anyone ever experienced problems with using Selection.setFocus() on components? Sometimes it seems to work fine and other times it doesn't work at all.

View Replies !    View Related
Selection.setFocus() Does Not Work.
I have a flash file embedded in html page which has got two textfields namely "txtLoginName" and "txtPassword". I have set the cursor focus to Login Name on load using the code written below. But it is not working. It works when I test the movie using "Ctl + Enter".

ifFrameLoaded(1){
Selection.setFocus(txtName);
}

View Replies !    View Related
Selection SetFocus Problems
I am trying to use the Selection.setFocus to set the focus to an input text field when a certain button is clicked. I used the following script:

myButton.onPress = function(){
Selection.setFocus("myTextField");
};

On testing I am able to set the focus if I don't put the script inside the button function, but I need the set focus to activate only when the button is pressed.

Is this a bug with Flash MX 2004 pro?

How can I get around this?

Thanks

View Replies !    View Related
Selection.setFocus Problem
I'm trying to set focus to a text box as soon as the flash movie starts. I've found no other way to do this other than the Selection.setFocus command, the only problem with this is, that when I use it, rather than manually clicking on the text box to type into it, I can't backspace what I've written unless I highlight it or hold down shift. Any way to solve this problem other than making users have to click on the box to give it focus?

View Replies !    View Related
FontList And Selection.setFocus
Hi,

I have this code that sets the whole field to a font selected from a fontList combobox. But I would like to change only the selected piece of text.

The code is:

Code:
fontList.setDataProvider(TextField.getFontList());
fontList.sortItemsBy("label", "asc");
tf = new TextFormat();

this.onEnterFrame = function() {
fontList.onKillFocus = function() {
selecting = false;
};
fontList.onSetFocus = function() {
selecting = true;
};
if (selecting) {

tf.font = fontList.getValue();
field.setTextFormat(tf);
}
}
But how can I integrate something like this code in it?


Code:
tf.font= "Arial";
currentFormat = field.getTextFormat(begin, end);
Selection.setFocus(field);
Selection.setSelection(begin, end);
field.setTextFormat(begin, end, tf);
I've done several attempts, but no luck (or wisdom).

thank you,

Jerryj.

View Replies !    View Related
Selection.setfocus Dynamically?
Greetings all

Is it possible to convert this:

r10_9.onChanged = function() {
this.text = this.text.toLowerCase();
Selection.setFocus(r10_10);
};

to something more easier to code rather than hand coding each item. I have tried various things, all with no success. I have over a hundred of these items hand coded already....fingers are getting tired....

Any ideas or tips would be greatly appreciated.

View Replies !    View Related
Selection.setFocus , Borked?
Hopefully this is quick and simple.. I am new to this function but it should set the focus to the selected text field correct?

my code is simple... I have an input textfield called "tf" in the main movie timeline.

The actionscript reads:

Selection.setFocus(_root.tf);

When I type text appears in the text field but not the flashing cursor... if I make a mistake and try to delete it dosn't work. The focus may be on the text field BUT the flashing cursor is not available, and non alpha numeric keys do not work.

How can I fix this?

Thanks...

Kiliaan

View Replies !    View Related
Selection.setFocus Problem
Dear all

Am an instructional designer creating interactive online learning for novice computer users currently working on a training session in the use of search engines, in this instance Google.

As you will know, when opened. Google has the search field input box in focus so that the user can begin typing immediately without clicking. To simulate this I have used a screen capture of Google overlaid with an input text box in the search area. To simulate the focus (see above) I used the following code.

Selection.setFocus(search_txt);

This works fine when tested from within Flash (MX) and the user can begin typing immediately. However when embedded in an html page, even though the focus is evident from the flashing I-Beam, typing immediately has no effect. The user must click into the input text box (search field) before typing their query words.

Any ideas??

Gruffy

View Replies !    View Related
Selection.setFocus Problem
Hi, I'm trying to set the focus on a textfield, but for some reason it
doesn't seem to work...

In the following script, _swf is a reference to the MovieClip that contains
the textfield, and txtFldAr is an Array that contains all the textfield
instance names:

for (var i = 0; i<txtFldAr.length; i++) {
_swf[txtFldAr].text = "";
_swf[txtFldAr].type = "input";
}
_swf[txtFldAr[0]].text = "1";
Selection.setFocus(_swf[txtFldAr[0]]);
trace("Focus: "+Selection.getFocus());

Setting the text to "1" works, only the getFocus returns 'null' ... why is
that?

Eric

View Replies !    View Related
Selection.setFocus(null)
I have a movie clip that holds a text field that can be changed either by typing in to it or clicking buttons (also contained in the movieclip). Once the text field has focus there seems to be no way of getting rid of it other than clicking in another field. I have tried using Selection.setFocus(null) and this appears to kill the focus but it is returned straight away and while the field has focus the button input fails.

I am stuck, any thought welcome

Cheers all

View Replies !    View Related
Selection.setFocus Listener
Hi there!

How do I write a listener which can trigger the opening of a MovieClip ( myMc.gotoAndStop(2) ) when Tab Selection occurs on a given TextField ?

Many thanks in advance for your help!

Regards,
Gerry

View Replies !    View Related
What's Going On With Selection.setFocus(); In FlashMX2004 ?
In Flash MX it works just fine, I copy/paste code to MX2004 and it doesen't work ?

this.createTextField ("txtUpis_txt", 1, 0, 0, 300, 30);
txtUpis_txt.type = "input";
txtUpis_txt.tabEnabled = true;
txtUpis_txt.selectable = true;
txtUpis_txt.border = true;
Selection.setFocus ("txtUpis_txt");



Anyone know reason??

thanx

View Replies !    View Related
Selection.setfocus() Problem
I am using Selection.setfocus("inputBox") to set the focus of an input textbox onLoad. It works, but I can only enter letter characters. I can't use the backspace or arrow keys. Anyone care to explain why or offer a fix?

Also, some punctuation such as commas don't work.

View Replies !    View Related
Selection.setFocus Problem
hi,
can anyone confirm that this particular method works in flash mx 2004 as i am attempting to apply focus to a textfield but with no success at all. i have even tried an absolute path from the root eg.

fldName.tabIndex = 0;
fldEmail.tabIndex = 1;
fldURL.tabIndex = 2;
fldMessage.tabIndex = 3;
Selection.setFocus("_root.content_mc.contact_mc.fo rm_mc.fldName");

any help is greatly appreciated.
Thanks,
coLin

View Replies !    View Related
Problem With Selection.setFocus
Hey all,

I'm working on a chat application which works with smilies. The smilies themselves work great, and I'm now at the point of adding a field with the 20 most popular smilies. When a user clicks them, the code (":-)" or ":p" for instance) gets added to the textfield. The problem is that after adding this code, I can't seem to get the focus back on the input field, resulting in the user having to click it again.

Currently I have the following:

Code:
on(release) {
_root.Application.msg.text += " :-)";
Selection.setFocus("_root.Application.msg");
Selection.setSelection(_root.Application.msg.length, _root.Application.msg.length);
Selection.setFocus("_root.Application.msg");
}
I use the setSelection to get the cursor on the final position of the input field. The second setFocus doesn't seem to put the focus back though..

Any help would be highly appreciated.

View Replies !    View Related
Problems With Selection.setFocus
I am working on a Flash form with this action script in the first frame.

var holder=_root.createEmptyMovieClip("holder_mc",500) ;
var myAreaVar=holder.createClassObject(mx.controls.Tex tArea,"myArea",1);
myAreaVar.text="fooooooo";

Why is it that I have to place the below code in a second keyframe for it to work?

Selection.setFocus(holder_mc.myArea);

If I place it in the starting keyframe with the rest of the script it does not work.
I can work with this but I would really like to understand why this happens and
if there is a way to get it to work in a movie where there is only one frame.

View Replies !    View Related
Selection.setFocus(); Problem
Can anyone help. In Flash 5 I have an input text box on my main timeline. I have a button on the main timeline also that on roll over I want the cursor to start flashing in the input box.

I have tried Selection.setFocus(q); either as q being a variable or an instance name, but no luck.

Can anyone help please!

Kev

View Replies !    View Related
What's Going On With Selection.setFocus(); In FlashMX2004 ?
In Flash MX it works just fine, I copy/paste code to MX2004 and it doesen't work ?

this.createTextField ("txtUpis_txt", 1, 0, 0, 300, 30);
txtUpis_txt.type = "input";
txtUpis_txt.tabEnabled = true;
txtUpis_txt.selectable = true;
txtUpis_txt.border = true;
Selection.setFocus ("txtUpis_txt");



Anyone know reason??

thanx

View Replies !    View Related
Selection.setfocus() Problem
I am using Selection.setfocus("inputBox") to set the focus of an input textbox onLoad. It works, but I can only enter letter characters. I can't use the backspace or arrow keys. Anyone care to explain why or offer a fix?

Also, some punctuation such as commas don't work.

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