Guida di riferimento di ActionScript® 3.0 per la piattaforma Adobe® Flash®
Home  |  Nascondi elenco pacchetti e classi |  Pacchetti  |  Classi  |  Novità  |  Indice  |  Appendici  |  Perché in inglese?
Filtri: Recupero dati dal server...
Recupero dati dal server...
mx.managers 

FocusManager  - AS3 Flex

Pacchettomx.managers
Classepublic class FocusManager
EreditarietàFocusManager Inheritance EventDispatcher Inheritance Object
Implementa IFocusManager

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The FocusManager class manages the focus on components in response to mouse activity or keyboard activity (Tab key). There can be several FocusManager instances in an application. Each FocusManager instance is responsible for a set of components that comprise a "tab loop". If you hit Tab enough times, focus traverses through a set of components and eventually get back to the first component that had focus. That is a "tab loop" and a FocusManager instance manages that loop. If there are popup windows with their own set of components in a "tab loop" those popup windows will have their own FocusManager instances. The main application always has a FocusManager instance.

The FocusManager manages focus from the "component level". In Flex, a UITextField in a component is the only way to allow keyboard entry of text. To the Flash Player or AIR, that UITextField has focus. However, from the FocusManager's perspective the component that parents the UITextField has focus. Thus there is a distinction between component-level focus and player-level focus. Application developers generally only have to deal with component-level focus while component developers must understand player-level focus.

All components that can be managed by the FocusManager must implement mx.managers.IFocusManagerComponent, whereas objects managed by player-level focus do not.

The FocusManager also managers the concept of a defaultButton, which is the Button on a form that dispatches a click event when the Enter key is pressed depending on where focus is at that time.

Altri esempi



Proprietà pubbliche
 ProprietàDefinito da
 Inheritedconstructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto.
Object
  defaultButton : IButton
A reference to the original default Button control.
FocusManager
  defaultButtonEnabled : Boolean
A flag that indicates whether the FocusManager should check for the Enter key being pressed to activate the default button.
FocusManager
  focusPane : Sprite
A single Sprite that is moved from container to container as the focus moves to those containers.
FocusManager
  nextTabIndex : int
[sola lettura] The next unique tab index to use in this tab loop.
FocusManager
  showFocusIndicator : Boolean
A flag that indicates whether to display an indicator that a component has focus.
FocusManager
Metodi pubblici
 MetodoDefinito da
  
FocusManager(container:IFocusManagerContainer, popup:Boolean = false)
Constructor.
FocusManager
  
The SystemManager activates and deactivates a FocusManager if more than one IFocusManagerContainer is visible at the same time.
FocusManager
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un oggetto listener di eventi con un oggetto EventDispatcher, in modo che il listener riceva la notifica di un evento.
EventDispatcher
  
The SystemManager activates and deactivates a FocusManager if more than one IFocusManagerContainer is visible at the same time.
FocusManager
 Inherited
Invia un evento nel flusso di eventi.
EventDispatcher
  
Returns the IFocusManagerComponent that contains the given object, if any.
FocusManager
  
Gets the IFocusManagerComponent component that currently has the focus.
FocusManager
  
Returns the IFocusManagerComponent that would receive focus if the user pressed the Tab key to navigate to another component.
FocusManager
 Inherited
Verifica se per l'oggetto EventDispatcher sono presenti listener registrati per un tipo specifico di evento.
EventDispatcher
 Inherited
Indica se per un oggetto è definita una proprietà specifica.
Object
  
Sets showFocusIndicator to false and removes the visual focus indicator from the focused object, if any.
FocusManager
 Inherited
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro.
Object
 Inherited
Indica se la proprietà specificata esiste ed è enumerabile.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Rimuove un listener dall'oggetto EventDispatcher.
EventDispatcher
  
Sets focus to an IFocusManagerComponent component.
FocusManager
 Inherited
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche.
Object
  
Sets showFocusIndicator to true and draws the visual focus indicator on the focused object, if any.
FocusManager
 Inherited
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate.
Object
  
[override] Returns a String representation of the component hosting the FocusManager object, with the String ".focusManager" appended to the end of the String.
FocusManager
 Inherited
Restituisce il valore di base dell'oggetto specificato.
Object
 Inherited
Verifica se un listener di eventi è registrato con questo oggetto EventDispatcher o qualsiasi suo antenato per il tipo di evento specificato.
EventDispatcher
Eventi
 Evento Riepilogo Definito da
 Inherited[evento di trasmissione] Inviato quando Flash Player o l'applicazione AIR ottiene lo stato di attivazione del sistema operativo ed entra nello stato attivo.EventDispatcher
 Inherited[evento di trasmissione] Inviato quando Flash Player o l'applicazione AIR perde l'attivazione del sistema operativo e sta entrando nello stato inattivo.EventDispatcher
Descrizione delle proprietà

defaultButton

proprietà
defaultButton:IButton

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A reference to the original default Button control. Pressing the Enter key while the focus is on any control activates the Button control by dispatching a click event on the Button control, just as if it was clicked with the mouse. The actual default Button control changes if focus is given to another Button control, but switches back to the original if focus is not on a button.

This property is managed by Flex containers; do not set it directly to specify the default button.

The defaultButton must be of class mx.controls.Button even though this property is of type IUIComponent.



Implementazione
    public function get defaultButton():IButton
    public function set defaultButton(value:IButton):void

defaultButtonEnabled

proprietà 
defaultButtonEnabled:Boolean

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A flag that indicates whether the FocusManager should check for the Enter key being pressed to activate the default button. TextArea and other components that want to recognize the Enter key set this property to false to disable the Enter key from dispatching a click event on the default button, if it exists.



Implementazione
    public function get defaultButtonEnabled():Boolean
    public function set defaultButtonEnabled(value:Boolean):void

focusPane

proprietà 
focusPane:Sprite

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A single Sprite that is moved from container to container as the focus moves to those containers. The Sprite is used as the parent of the visual indicator that a component has focus.



Implementazione
    public function get focusPane():Sprite
    public function set focusPane(value:Sprite):void

nextTabIndex

proprietà 
nextTabIndex:int  [sola lettura]

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The next unique tab index to use in this tab loop.



Implementazione
    public function get nextTabIndex():int

showFocusIndicator

proprietà 
showFocusIndicator:Boolean

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A flag that indicates whether to display an indicator that a component has focus. If true a component receiving focus draws a visible indicator that it has focus.

By default, this is false until the user uses the Tab key, then it is set to true.

In general it is better to use the showFocus() and hideFocus() methods to change this property as those methods also update the visual indicator that a component has focus.



Implementazione
    public function get showFocusIndicator():Boolean
    public function set showFocusIndicator(value:Boolean):void
Descrizione della funzione di costruzione

FocusManager

()Funzione di costruzione
public function FocusManager(container:IFocusManagerContainer, popup:Boolean = false)

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Constructor.

A FocusManager manages the focus within the children of an IFocusManagerContainer. It installs itself in the IFocusManagerContainer during execution of the constructor.

Parametri
container:IFocusManagerContainer — An IFocusManagerContainer that hosts the FocusManager.
 
popup:Boolean (default = false) — If true, indicates that the container is a popup component and not the main application.
Descrizione dei metodi

activate

()metodo
public function activate():void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The SystemManager activates and deactivates a FocusManager if more than one IFocusManagerContainer is visible at the same time. If the mouse is clicked in an IFocusManagerContainer with a deactivated FocusManager, the SystemManager will call the activate() method on that FocusManager. The FocusManager that was activated will have its deactivate() method called prior to the activation of another FocusManager.

The FocusManager adds event handlers that allow it to monitor focus related keyboard and mouse activity.

deactivate

()metodo 
public function deactivate():void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The SystemManager activates and deactivates a FocusManager if more than one IFocusManagerContainer is visible at the same time. If the mouse is clicked in an IFocusManagerContainer with a deactivated FocusManager, the SystemManager will call the activate() method on that FocusManager. The FocusManager that was activated will have its deactivate() method called prior to the activation of another FocusManager.

The FocusManager removes event handlers that allow it to monitor focus related keyboard and mouse activity.

findFocusManagerComponent

()metodo 
public function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Returns the IFocusManagerComponent that contains the given object, if any. Because the player can set focus to a subcomponent of a Flex component this method determines which IFocusManagerComponent has focus from the component perspective.

Parametri

o:InteractiveObject — An object that can have player-level focus.

Restituisce
IFocusManagerComponent — The IFOcusManagerComponent containing o or null

getFocus

()metodo 
public function getFocus():IFocusManagerComponent

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Gets the IFocusManagerComponent component that currently has the focus. Calling this method is recommended instead of using the Stage object because it indicates which component has focus. The Stage might return a subcomponent in that component.

Restituisce
IFocusManagerComponent — IFocusManagerComponent object that has focus.

getNextFocusManagerComponent

()metodo 
public function getNextFocusManagerComponent(backward:Boolean = false):IFocusManagerComponent

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Returns the IFocusManagerComponent that would receive focus if the user pressed the Tab key to navigate to another component. It will return the same component as the current focused component if there are no other valid components in the application.

Parametri

backward:Boolean (default = false) — If true, return the object as if the Shift-Tab keys were pressed.

Restituisce
IFocusManagerComponent — The component that would receive focus.

hideFocus

()metodo 
public function hideFocus():void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Sets showFocusIndicator to false and removes the visual focus indicator from the focused object, if any.

setFocus

()metodo 
public function setFocus(o:IFocusManagerComponent):void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Sets focus to an IFocusManagerComponent component. Does not check for the components visibility, enabled state, or any other conditions.

Parametri

o:IFocusManagerComponent — A component that can receive focus.

showFocus

()metodo 
public function showFocus():void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Sets showFocusIndicator to true and draws the visual focus indicator on the focused object, if any.

toString

()metodo 
override public function toString():String

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Returns a String representation of the component hosting the FocusManager object, with the String ".focusManager" appended to the end of the String.

Restituisce
String — Returns a String representation of the component hosting the FocusManager object, with the String ".focusManager" appended to the end of the String.




[ X ]Perché in inglese?
Il contenuto della Guida di riferimento di ActionScript 3.0 appare in inglese

Non tutte le parti della Guida di riferimento di ActionScript 3.0 sono tradotte in tutte le lingue. Quando un elemento del linguaggio non è tradotto, viene riportato in inglese. Ad esempio, la classe ga.controls.HelpBox non è tradotta in nessuna lingua. Pertanto, nella versione italiana della guida di riferimento, la descrizione della classe ga.controls.HelpBox è riportata in inglese.