Search code examples
flashactionscriptflex4tabindex

Tab index not work on image, panel and Group tags in flash


I am writing code to order the tab on multiple tags like "img","Panel","LinkButton",... and pie charts. when I run my flash program, the tab indexing does not work at all. it just works on pie chart and "link button" tags, not on "img","Panel","Group" tags. I also have tried to "enable tab" on those fields , but no help.on the other hand when I disable tab on the pie chart, and link button, still the tab is enabled.

I have searched a lot and could not find a solution yet. appreciate a lot if someone could help me I am working on Flash 10.0.0.0 , sdk 4.1


Solution

  • I was finally able to implement the IFocusMangerComponent in order to get the focus for image. although the "tab index" is available in the class, if you want to get the tab to work on image, you have to simply implement IFocusMangerComponent as following in .as file. (no need to implement the functions in the new class)

    import mx.controls.Image; import mx.managers.IFocusManagerComponent;

      public class FocusableImage extends Image implements IFocusManagerComponent
      {
                public function FocusableImage()
                {
                          super();
                }
      }
    

    then in the code instead of using var image = new Image() , you have to use

    var image = new FocusableImage() 
       image.tabEnabled = true;
       image.tabFocusEnabled = true;
       image.tabIndex = 1;