flashactionscript-3flash-v3-components

remove keyboard control on flash slider component


by default the flash slider component can be manipulated with the keyboard. Is there a way to disable this behavior so that users can only drag the slider component with their mouse?


Solution

  • Simple, just set the 'focusEnabled' public property of the 'Slider' object to false:

    import fl.controls.Slider;
    
    var slider:Slider = new Slider();
    addChild(slider);
    
    slider.focusEnabled = false; 
    

    This will indicate that the 'Slider' object can't recieve focus after the user clicks on it and therefore not allow the keyboard to interact with it.