ࡱ>  Root Entryp|YrRASHvM!@Contents1Page 1Symbol 3#"$% &'()*+,-./023456789:Root Entryp|YrRASH B1!@ContentsPage 1Symbol 3 # $ Symbol 1JSymbol 4>CPicPage CPicLayer CPicFrameCPicText{$kD@.Arialm}"nextFocus=currentFocus-1 == -1? tabOrder.len f$0@Arial"custom tab order CPicShape!&{U`"0`8 Zh8@<0U< Symbol 1JSymbol 4>Hd6;00hH0H0 1'l@Arial"event handlers on an empty movie clip dictate the order in which this movie's text fields are accessed via the tab key. the clip's load handler defines an array called Arial"tabOrdertArial", whose elements specify text fields to be included in the tab order. in the example below, the tab order is set to Arial"form1.field1Arial", Arial"form2.field3Arial", Arial"_level0.field4Arial", and Arial"form2.field2^Arial". press the tab and shift+tab keys to try it out. notice that text fields not included in the Arial"tabOrder'Arial" array are excluded from the tab order.W H@mArial"this button is *very* important. it traps the tab key in web browsers, allowing our keyUp event to handle it. $@Arial"empty clip with event handlers  SY'*4AM5sPF0  SY'*4AM5s)F0 (8RH0U8X?bg3 CPicSpriteOCPicPage CPicLayer CPicFrame CPicShape <=AA?4J]|>4JA4"};p4ΙÝ4v4A^>}4V,r| 3{bsNd000d?Layer 1O // moock custom tab order // version 1.1.0 // Note that the code here has been revised since it was // included in ActionScript: The Definitive Guide. // The changes in this version are: // 1) when tab is pressed and no field from // the tabOrder array has focus, focus returns // to the last focussed tabOrder field. // 2) the tab order applies to all text fields in the movie, // not just a specific clip. onClipEvent (load) { // send all keystrokes to the standalone player. fscommand("trapallkeys", "true"); // Create an array with the full paths to our text fields, supplied // in the desired tab order. First field listed is the default. tabOrder = ["_level0.form1.field1", "_level0.form2.field3", "_level0.field4", "_level0.form2.field2"]; } onClipEvent (keyUp) { // If the Tab key was pressed... if (Key.getCode() == Key.TAB) { // ...then we need to determine // which (if any) field from the tabOrder array has focus. // We start by retrieving the path to the focussed field. var focussed = Selection.getFocus(); // Now we check each element of tabOrder to see if it // matches the focussed field. If no match is found, we // let currentFocus remain the same. This lets a user // unfocus a field by, say, clicking away, and then // refocus it with tab. for (var i = 0; i < tabOrder.length; i++) { if (tabOrder[i] == focussed) { // Stop when we find a match, and note which element has focus. currentFocus = i; break; } } // If no field from tabOrder has ever had focus, currentFocus // will be undefined, in which case... if (typeof(currentFocus) == "undefined") { // ...we focus the first field in the array of fields. Selection.setFocus(tabOrder[0]); } else { // Otherwise, we set the new focus to either the next // field or the previous field in tabOrder, // depending on whether the Shift key is down. // If the Shift key is down... if (Key.isDown(Key.SHIFT)) { // ...go to the previous field, // unless we're already at the beginning, in which case // wrap around to the end. nextFocus = currentFocus-1 == -1 ? tabOrder.length-1 : currentFocus-1; } else { // Shift key is not down, so go to the next field, // unless we're already at the end, in which case, // wrap around to the beginning. nextFocus = currentFocus+1 == tabOrder.length ? 0 : currentFocus+1; } // Finally, assign the new focus. Selection.setFocus(tabOrder[nextFocus]); } } } ?text field empty clipO^C^Cform1 #C #Cform2U@ TextField4Arialm}form1u @ TextField4Arialm}form2? form clipsO  q&70(0L0ee Afield4Arialfield4 on _root?text field on _rootOO CPicButtonMon (keyPress "") { var x = 0; // Dummy button to trap Tab key } ?tabcatcher buttonOO?text field on _rootOO CPicButton  CDocumentPage Page 1Scene 1/A:7; Symbol 4 empty clip;8; Symbol 3 tabCatcherx;6x; Symbol 1tabOrderA:;*@hhhhh333 Vector::Template"PublishFormatProperties::generator CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3f{"m}vf`zf*]PW|hm}vCPicPage CPicLayer CPicFrameCPicText{$kD@.Arialm}"nextFocus=currentFocus-1 == -1? tabOrder.len f$0@Arial"custom tab order CPicShape!&{U`"0`8 Zh8@<0U<  CPicPage CPicLayer CPicFrame CPicShape&ӡosn:x0'00?bgOOCPicText[]_ Afield1Arial"field1 [_ AfiHd6;00hH0H0 1'l@Arial"event handlers on an empty movie clip dictate the order in which this movie's text fields are accessed via the tab key. the clip's load handler defines an array called Arial"tabOrdertArial", whose elements specify text fields to be included in the tCPicPage CPicLayer CPicFramem}f+++g<f++*+g<f*?Layer 1Oeld2Arial"field2 Z_ Afield3Arial"field3?fieldsOfield5Arial"field5?fieldsab order. in the example below, the tab order is set to Arial"form1.field1Arial", Arial"form2.field3Arial", Arial"_level0.field4Arial", and Arial"form2.field2^Arial". press the tab and shift+tab keys to try it out. notice that text fields not included in the Arial"tabOrder'Arial" array are excluded from the tab order.W H@mArial"this button is *very* important. it traps the tab key in web browsers, allowing our keyUp event to handle it. $@Arial"empty clip with event handlers  SY'*4AM5sPF0  SY'*4AM5s)F0 (8RH0U8X?bg3 CPicSprite // moock custom tab order // version 1.1.0 // Note that the code here has been revised since it was // included in ActionScript: The Definitive Guide. // The changes in this version are: // 1) when tab is pressed and no field from // the tabOrder array has focus, focus returns // to the last focussed tabOrder field. // 2) the tab order applies to all text fields in the movie, // not just a specific clip. onClipEvent (load) { // send all keystrokes to the standalone player. fscommand("trapallkeys", "true"); // Create an array with the full paths to our text fields, supplied // in the desired tab order. First field listed is the default. tabOrder = ["_level0.form1.field1", "_level0.form2.field3", "_level0.field4", "_level0.form2.field2"]; } onClipEvent (keyUp) { // If the Tab key was pressed... if (Key.getCode() == Key.TAB) { // ...then we need to determine // which (if any) field from the tabOrder array has focus. // We start by retrieving the path to the focussed field. var focussed = Selection.getFocus(); // Now we check each element of tabOrder to see if it // matches the focussed field. If no match is found, we // let currentFocus remain the same. This lets a user // unfocus a field by, say, clicking away, and then // refocus it with tab. for (var i = 0; i < tabOrder.length; i++) { if (tabOrder[i] == focussed) { // Stop when we find a match, and note which element has focus. currentFocus = i; break; } } // If no field from tabOrder has ever had focus, currentFocus // will be undefined, in which case... if (typeof(currentFocus) == "undefined") { // ...we focus the first field in the array of fields. Selection.setFocus(tabOrder[0]); } else { // Otherwise, we set the new focus to either the next // field or the previous field in tabOrder, // depending on whether the Shift key is down. // If the Shift key is down... if (Key.isDown(Key.SHIFT)) { // ...go to the previous field, // unless we're already at the beginning, in which case // wrap around to the end. nextFocus = currentFocus-1 == -1 ? tabOrder.length-1 : currentFocus-1; } else { // Shift key is not down, so go to the next field, // unless we're already at the end, in which case, // wrap around to the beginning. nextFocus = currentFocus+1 == tabOrder.length ? 0 : currentFocus+1; } // Finally, assign the new focus. Selection.setFocus(tabOrder[nextFocus]); } } } ?text field empty clipO^C^Cform1 #C #Cform2U@ TextField4Arialm}form1u @ TextField4Arialm}form2? form clipsO  q&70(0L0ee Afield4Arialfield4 on _root?text field on _rootOO CPicButtonMon (keyPress "") { var x = 0; // Dummy button to trap Tab key } ?tabcatcher buttonOO  CDocumentPage Page 1Scene 1/A:C; Symbol 4 empty clip;8; Symbol 3 tabCatcherx;6x; Symbol 1tabOrderA:;*@hhhhh333 Vector::Template"PublishFormatProperties::generator CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3f{"m}vf`zf*]PW|h