Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-29-2004, 09:30 PM   #1
TylerNZ
Registered User
 
Join Date: Nov 2003
Posts: 20
Default focus and tab on Component TextInput & TextArea

Ok, I know you can do this with TEXT FIELDS ... but could someone tell me how to accomplish this with the component items!?

I've got a listener to listen for the reset button, so on the timeline I have this script:

ActionScript Code:
clippy2Listener = new Object(); clippy2Listener.click = function (evt){     form.nameC.text = "";     form.emailC.text = "";     form.commentsC.text = "";     form.Selection.setFocus("nameC"); } resetB.addEventListener("click", clippy2Listener);

The form does clear, so the code is working, however, the focus isn't setting.

Any ideas? And also with the tab indexing, can this be done with components.

THANKS TO ANYONE WHO CAN ANSWER!!!
TylerNZ is offline   Reply With Quote
Old 01-30-2004, 09:59 PM   #2
TylerNZ
Registered User
 
Join Date: Nov 2003
Posts: 20
Default

Creating a tab order index for keyboard navigation in the Accessibility panel (Flash Professional only)
You can create a tab order index in the Accessibility panel for keyboard navigation. You can create a custom tab order for the following objects:

Dynamic text
Input text
Buttons
Movie clips, including compiled movie clips
Components
Screens
Note: You can also use ActionScript to create a keyboard navigation tab order index. See Using ActionScript to create a tab order for accessible objects.

Tab focus occurs in numerical order, starting from the lowest index number. Once tab focus reaches the highest tab index, focus returns to the lowest index number.

When you move user-set tab indexed objects around in your document, or to another document, Flash retains the index attributes. You should then check for and resolve index conflicts, such as two different objects on the Stage which have the same tab index number.

Caution: If two or more objects have the same tab index in any given frame, Flash follows the order in which the objects were placed on the Stage. It is therefore recommended that you resolve all tab index conflicts to be sure the desired tab order index is achieved.

To create a tab order index:
Select the object in which to assign a tab order and do one of the following:
Select Window > Property inspector if the inspector is not visible. In the Property inspector, click the Accessibility button.
Select Window > Other Panels > Accessibility.
If you're providing an index for the selected object only, in the Tab Index text box, enter a positive integer (up to 65535) that reflects the order in which the selected object should receive focus.
Note: For information about creating a tab order using ActionScript, see Using ActionScript to create a tab order for accessible objects. Tab indexes created in ActionScript do not appear on Stage when the Show Tab Order option is enabled.
TylerNZ is offline   Reply With Quote
Old 04-20-2004, 06:11 PM   #3
jnorthway
Registered User
 
Join Date: Apr 2004
Posts: 3
Default tab order with nested components

I'm having trouble setting the tab order with nested components. I have some components on the root level. I have more components nested inside of movie clips, but I need all of them to tab in a specific order. For some reason, the components that are nested inside of movie clips are left out of the tab order completely. I have tried setting the tabIndex of each component, as follows, to no avail:

this.first_name_text.tabIndex=1;
this.last_name_text.tabIndex=2;
this.email_mc.email_text.tabIndex=3;

The email field gets left out. The reason this is a movie clip is that the email field is required, and I want to perform validation and have the text appear red if there is an error.

I've found some tutorials that work in MX, but don't seem to work in MX 2004. Does anyone have any ideas as to what I might be doing wrong?

I appreciate any input!
jnorthway is offline   Reply With Quote
Old 04-21-2004, 01:39 AM   #4
TheBuzz
Registered User
 
Join Date: Nov 2003
Location: Fresno, Ca
Posts: 119
Send a message via ICQ to TheBuzz Send a message via AIM to TheBuzz Send a message via Yahoo to TheBuzz
Default

why not just have all of them on one level. Then you just need to put
instancename.tabIndex = 1;
instancename.tabIndex = 2;
TheBuzz is offline   Reply With Quote
Old 04-21-2004, 01:41 AM   #5
TheBuzz
Registered User
 
Join Date: Nov 2003
Location: Fresno, Ca
Posts: 119
Send a message via ICQ to TheBuzz Send a message via AIM to TheBuzz Send a message via Yahoo to TheBuzz
Default

oh just noticed you put this.name.tabIndex = 1;

don't put the tabIndex's on top of the component, put them on a frame action.
TheBuzz is offline   Reply With Quote
Old 04-21-2004, 09:12 AM   #6
jnorthway
Registered User
 
Join Date: Apr 2004
Posts: 3
Default

Thanks for your response TheBuzz. The reason they are not all on the same level is that some of the fields need validation, and I put them each in a movie clip so they would change appearance if there is an error. I guess there are other ways I could show an error, but it seems like I should be able to make it work as is.

I do have the tabIndex's in a frame action, and tried naming the target without 'this', tried it with '_root', tried everything I could think of. But it just doesn't want to recognize the components inside the movie clips.
jnorthway is offline   Reply With Quote
Old 04-21-2004, 02:51 PM   #7
jnorthway
Registered User
 
Join Date: Apr 2004
Posts: 3
Default

I figured it out - had to enable the children of the movie clips, as follows:

email_mc.tabChildren = true;
jnorthway is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:59 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.