| Pacote | flashx.textLayout.elements |
| Classe | public final class LinkState |
| Herança | LinkState Object |
| Versão da linguagem: | ActionScript 3.0 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
linkState da classe LinkElement.
Elementos da API relacionados
Propriedades públicas
Métodos públicos
Constantes públicas
| Constante | Definido por | ||
|---|---|---|---|
| ACTIVE : String = "active" [estático]
Valor do estado ativo, que ocorre quando você mantém o mouse clicado sobre um link. | LinkState | ||
| HOVER : String = "hover" [estático]
Valor do estado hover, que ocorre quando você arrasta o mouse sobre um link. | LinkState | ||
| LINK : String = "link" [estático]
Valor do estado normal inicial do link. | LinkState | ||
Detalhes da constante
ACTIVE | Constante |
public static const ACTIVE:String = "active"| Versão da linguagem: | ActionScript 3.0 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
Valor do estado ativo, que ocorre quando você mantém o mouse clicado sobre um link.
HOVER | Constante |
public static const HOVER:String = "hover"| Versão da linguagem: | ActionScript 3.0 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
Valor do estado hover, que ocorre quando você arrasta o mouse sobre um link.
LINK | Constante |
public static const LINK:String = "link"| Versão da linguagem: | ActionScript 3.0 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
Valor do estado normal inicial do link.
Exemplos Como usar este exemplo
LinkStateExample.as
Este exemplo acrescenta leitores de eventos a um LinkElement para ler os seguintes eventos do mouse: CLICK, MOUSE_DOWN, MOUSE_OUT, ROLL_OVER, ROLL_OUT. Quando um desses eventos ocorrer, o exemplo verifica se o link está no estado hover. Nesse caso, ele exibe o tipo de evento e o valor de
linkState.
package flashx.textLayout.elements.examples
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.LinkElement;
import flashx.textLayout.elements.LinkState;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.events.FlowElementMouseEvent;
import flashx.textLayout.formats.TextLayoutFormat;
public class LinkStateExample extends Sprite
{
public function LinkStateExample()
{
var textFlow:TextFlow = new TextFlow();
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
textLayoutFormat.fontFamily = "Arial, Helvetica, _sans";
textLayoutFormat.fontSize = 18;
textFlow.hostFormat = textLayoutFormat;
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
var link:LinkElement = new LinkElement();
link.addEventListener(MouseEvent.CLICK, checkState);
link.addEventListener(MouseEvent.MOUSE_DOWN, checkState);
link.addEventListener(MouseEvent.MOUSE_UP, checkState);
link.addEventListener(MouseEvent.ROLL_OVER, checkState);
link.addEventListener(MouseEvent.ROLL_OUT, checkState);
span.text = "Text that includes a link to ";
link.href = "http://www.adobe.com";
var linkSpan:SpanElement = new SpanElement();
linkSpan.text = "Adobe's website";
link.addChild(linkSpan);
p.addChild(span);
p.addChild(link);
textFlow.addChild(p);
textFlow.flowComposer.addController(new ContainerController(this,stage.stageWidth, stage.stageHeight));
textFlow.flowComposer.updateAllControllers();
}
public function checkState(event:FlowElementMouseEvent):void {
var link:LinkElement = LinkElement(event.flowElement);
if(link.linkState == LinkState.HOVER) {
trace("Event type is: " + event.type);
trace("Link state is: " + link.linkState);
}
}
}
}
Wed Jun 13 2018, 11:10 AM Z
Ocultar propriedades públicas herdadas
Mostrar propriedades públicas herdadas