Re: [Flashcoders] Selection.setFocus()

2005-12-02 Thread Judah Frangipane

Hi Manuel,

We are needing something like this as well. We set the tab order in code 
or use the accessability window. When we tab to a v2 button then the 
tabbing breaks. If it makes you feel any better I could not get this to 
work either.


A thing to note is the help docs have qoutes around the setFocus parameter.

Selection.setFocus(this.dataPanel.titleMc.input1.iField);

Also be aware of scope issues with this code. Be sure to trace out your 
dot notation paths.


trace(this.dataPanel.titleMc.input1.iField=+this.dataPanel.titleMc.input1.iField)

to make sure you do not get undefined. When writing code like this break 
it down and get it to work by itself and move up from there. Listener 
objects are notoriously issue prone.


Judah

Manuel Gonzalez wrote:


Hi,
Has anyone had any luck with Selection.setFocus()...?

For some reason I haven't had any luck getting the tabIndex to work in a 
project I'm working on so I have resorted to a hack, but now the hack isn't 
working either.  All I'm trying to do is gain focus on input fields in my movie 
clip.
The first time I call Selection.setFocus() it works but after tabbing it 
doesn't visually focus on the next input field.


Here's my code :

function setUpTabIndex():Void {

//automaticaly focus on first input field
Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);
//
tabKeyListener = new Object();
tabKeyListener.onKeyDown = function() {
if (Key.getCode() == Key.TAB) {
//trace(Selection.getFocus())
if (Selection.getFocus() == null) {

Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.titleMc.input1.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.createdByMc.input2.iField);
Selection.setSelection(0, 0);
//trace(Selection.getFocus())

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.createdByMc.input2.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.starringMC.input3.iField);
Selection.setSelection(0, 0);

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.starringMC.input3.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);
}
}
};
Key.addListener(tabKeyListener);
}

Any thoughts?



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Selection.setFocus()

2005-12-01 Thread Manuel Gonzalez
Hi,
Has anyone had any luck with Selection.setFocus()...?

For some reason I haven't had any luck getting the tabIndex to work in a 
project I'm working on so I have resorted to a hack, but now the hack isn't 
working either.  All I'm trying to do is gain focus on input fields in my movie 
clip.
The first time I call Selection.setFocus() it works but after tabbing it 
doesn't visually focus on the next input field.


Here's my code :

function setUpTabIndex():Void {

//automaticaly focus on first input field
Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);
//
tabKeyListener = new Object();
tabKeyListener.onKeyDown = function() {
if (Key.getCode() == Key.TAB) {
//trace(Selection.getFocus())
if (Selection.getFocus() == null) {

Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.titleMc.input1.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.createdByMc.input2.iField);
Selection.setSelection(0, 0);
//trace(Selection.getFocus())

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.createdByMc.input2.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.starringMC.input3.iField);
Selection.setSelection(0, 0);

} else if (Selection.getFocus() == 
_level0.tab_forms.tab2.dataPanel.starringMC.input3.iField) {
Selection.setFocus(null);

Selection.setFocus(this.dataPanel.titleMc.input1.iField);
Selection.setSelection(0, 0);
}
}
};
Key.addListener(tabKeyListener);
}

Any thoughts?



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders