2 Replies Latest reply on Feb 25, 2008 5:33 AM by s83g1000

    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?

        • 1. Re: Help with Selection.setFocus
          i_am_captivate Level 1

          I'm not sure why the 2 methods give different results, but if you are using the TextInput UI component, by default, flash uses the Halo theme, which would explain the green border.

          To resolve this, you could try one of two things, go to File --> Import --> Open External Library, then navigate to C:\Program files\Adobe\Flash CS3\en\Configuration\Component Source\Actionscript 2.0\FLA.... you will see "SampleTheme.fla".... double click on that, and then drag and drop the "Flash UI Components 2" folder into your library. This will change the theme used, and I believe it gets rid of the border problem.

          Another thing you can do is create a new flash file do the same steps above, but choose "HaloTheme.fla" instead. Drag and drop the folder into your library and then open the Flash UI Components 2 folder. You will see a movieclip named "HaloTheme" in there. Drag and drop the movieclip onto the stage and make the mods you want to make. Save the FLA.

          To use the mods you made, open your FLA file, follow the steps outlined in the first paragraph, but use the halo theme.


          • 2. Re: Help with Selection.setFocus
            s83g1000 Level 1
            Hi Doug

            Thanks for the response.

            I tried the first method which does change the border style slightly but the Halo theme is till visible when you tab to the textbox.

            I am not that keen on manually editing the halo theme in this case, I have done it before and it can be quite time consuming. I don't mind it being there, just as long as it does it consistently. There must be a property of some sort I can play with, I will keep looking.