To navigate from one movieclip to other by pressing TAB in as3 - actionscript-3

In a registration page,i want to move to next field,when i click tab from keyboard.I have implemented ENTER key for submnission,but i cant move to next field when pressing TAB

Setting the tabIndex to sequential values should be enough, maybe tabEnabled too.....
textfieldOne.tabIndex=1;
textfieldTwo.tabIndex=2;
textfieldOne.tabEnabled=true;
textfieldTwo.tabEnabled=true;

Related

MS Access 2016: When TabControl tab regains focus, requery listbox

I have a Tab Control element containing 2 tabs: Tab1 and Tab2. Tab2 contains a ListBox element whose RowSource queries the data that gets submitted in Tab1.
Say the user opens this form containing these 2 tabs. They are originally on Tab1. in the Form_Load event for Tab2, it queries the data it needs to populate its ListBox. Now they switch tabs to Tab1. They enter some data and submit a new record to the corresponding table (the same table that the Tab2 ListBox uses as its RowSource). When the user switches back to Tab2, they don't see this newly added record.
What I have done so far is that when the user clicks anywhere in the ListBox, it calls Requery, and then the record will show up. This isn't enough as it's not intuitive for the user to have to click on the listbox to update its contents.
I have tried putting this Requery code in a Form_Load, Form_Activate, GotFocus, but nothing works. I know you can detect the TabControl clicks, but how can I access the forms and the elements that they contain?
Any ideas on how to requery this listbox whenever the tab gains control?
If you want to add code for a specific tab on a tabcontrol, the most convenient way to do that is to write code in the TabCtl_Change event. That occurs when the tab control is changed. E.g.:
Private Sub MyTabCtl_Change()
If MyTabCtl.Pages(MyTabCtl.Value).Name = "Tab2" Then 'The tab control just changed to your page
'Requery that list box
End If
End Sub
Note that, if you're not using a tab control at all, but a navigation control (which it does sound like, tab controls don't necessarily have subforms on them, and don't have Form_Load events, forms do)
You're most likely looking for the On Activate trigger.
Then, in the code just use Form.Requery or Form.Recalc depending on which you're actually looking to do.
Alternatively, you could use the same control the user is using to submit records to trigger a requery. Although, that would require a specific Form to be called into focus.

Unexpected Tab key behavior in Datasheet form subdatasheet

When I tab through records in my (datasheet) form, the tab key behavior is as expected; Focus moves to the next field, and then at the end of the fields moves to the next record. In forms where I have master-child subdatasheets, when the subdatasheet isn't expanded and the user tabs past the end of a record, focus moves to the next record. This is good / what I want. When a subdatasheet is expanded and the user tabs past the end of the master record, focus moves to the first field in the child subdatasheet. Again this is good / what I want.
What happens on the next tab key press is my issue. Rather than moving focus to the next field in the subdatasheet, focus goes straight to the next record in the master datasheet. I expect and want focus to go to the next field in the subdatasheet.
I have been playing with the tabstops and cycle properties on both the main form, subform, and subform control within the main form, and cannot come to a configuration where I get the behavior I desire.
Solved this now and thought I should log it here. Was a pretty stupid problem caused by an oversight on my part.
Basically, all of the controls on my subdatasheet were being set to locked and tabstop = false, in a procedure I have to apply control settings by control name. So I'd actually made those settings a while ago, forgotten, and then assumed that the user should be able to tab through them.
Obviously Access was hitting the subdatasheet control, going "no controls available to tab through here", and so immediately exiting the subdatasheet control.
When I was trying in code to set focus to any of the controls, the reserved error 2950 must've been because the controls weren't tab-stoppable.

Not running the lost focus event in a text box if another button is clicked

I have a data entry form and have code in the 'Lost Focus" event in each one of them. But I also have other buttons that are not tab stop. Example-Clear button, Check Input Button,and Exit Data Entry button as well as an Update Button ( I save all the entry in an access table then do a mass update to SQL Server, why I do that is a function of the requirement). But, if I click one of the buttons the lost focus event takes place, and I have to click the button again for it's code to run. Is there a way around this, where I click the button and it negates the Lost Focus event from the field where the cursor is located?
Thanks
jpl

How to block fields from being available when pressing the tab key

I have transformed some fields on my data entry form using code so that the user needs to update them by clicking them with the mouse. Unfortunately, I do not understand how to remove them from the tab order field so that the user with the tab key toggles only through the fields which are not updated by mouse point and clicking.
You can adjust the Tab Stop property of the various controls. For details see
Remove a control from the tab order

Flex Spark List LabelItemRenderer remove selection when other list item enters down state

The Spark List with a mobile theme has kind of a weird behavior that I need to disable in favor of a context menu.
The default behavior of that list is that an item only loses it's selection color when another item has entered the selected state. That means that for the moment the user remains in the down state on an item (either by mouse down or tap and hold), two items show the selection color, the one that is still selected, and the current one with the down state.
What I need is that selected items lose their selection color/state as soon as another items enters the down state, so basically the selection state needs to be set as soon as the down state is entered.
Why do I need this you may ask, let me explain;
My lists need a context menu which will be opened on long press. And since long press doesn't include a mouse up event before the long press event is triggered, the item won't get selected, thus other items won't lose their selection color.
My itemRenderer is a standard LabelItemRenderer written in AS and it would be great to change this functionality in the ItemRenderer, not the parent component.
Has anyone got a clue how to accomplish this?
Since you're using the LabelItemRenderer, I assume you're building a mobile app. This is kind of a guess; but...
Can you add a Long Press event handler to the itemRenderer, and change the selected property of the itemRenderer in the event handler?
I'm not sure if such a change in the itemRenderer will also change the actual List, though. In theory it should not.
Aside from that, if your Long Press event bubbles up from the itemRenderer, you can listen to it on the List class and change the selectedItem that way, before popping up your new menu.