| 패키지 | flash.text.engine |
| 클래스 | public final class TextLineMirrorRegion |
| 상속 | TextLineMirrorRegion Object |
| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
텍스트 줄에 대한 일반적인 이벤트 전달이 끝난 후 줄이 유효하고 이벤트 전파가 중지되지 않은 경우, 이벤트가 줄의 미러 영역에 다시 전달됩니다.
마우스 이벤트의 미러링은 특별한 경우입니다. 미러 영역에는 객체가 실제로 표시되지 않기 때문에 mouseOver 및 mouseOut 이벤트가 시뮬레이션됩니다. rollOver 및 rollOut 이벤트는 시뮬레이션되지 않습니다. 자연적으로 발생하는 mouseOver, mouseOut, rollOver, rollOut 이벤트는 텍스트 줄을 대상으로 하든 텍스트 줄의 자식을 대상으로 하든 관계없이 무시되며 미러링되지 않습니다.
ActionScript 코드에서 직접 TextLineMirrorRegion 객체를 만들 수 없습니다. new TextLineMirrorRegion()을 호출하면 예외가 발생합니다. 이벤트 미러를 설정하고 ContentElement 객체로부터 텍스트 줄을 만들면 TextLineMirrorRegion이 만들어져 텍스트 줄에 연결됩니다.
TextLineMirrorRegion 클래스는 최종 클래스이므로 하위 클래스를 만들 수 없습니다.
관련 API 요소
| 속성 | 정의 주체 | ||
|---|---|---|---|
| bounds : Rectangle [읽기 전용]
텍스트 행을 기준으로 한 미러 영역의 경계입니다. | TextLineMirrorRegion | ||
![]() | constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | |
| element : ContentElement [읽기 전용]
미러 영역이 파생된 ContentElement 객체입니다. | TextLineMirrorRegion | ||
| mirror : EventDispatcher [읽기 전용]
미러 영역에 영향을 주는 이벤트가 미러링되는 EventDispatcher 객체입니다. | TextLineMirrorRegion | ||
| nextRegion : flash.text.engine:TextLineMirrorRegion [읽기 전용]
텍스트 요소에서 파생된 세트의 다음 TextLineMirrorRegion입니다. 현재 영역이 세트의 마지막 미러 영역이면 null입니다. | TextLineMirrorRegion | ||
| previousRegion : flash.text.engine:TextLineMirrorRegion [읽기 전용]
텍스트 요소에서 파생된 세트의 이전 TextLineMirrorRegion입니다. 현재 영역이 세트의 첫 번째 미러 영역이면 null입니다. | TextLineMirrorRegion | ||
| textLine : flash.text.engine:TextLine [읽기 전용]
이 미러 영역을 포함하는 TextLine입니다. | TextLineMirrorRegion | ||
bounds | 속성 |
element | 속성 |
element:ContentElement [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
미러 영역이 파생된 ContentElement 객체입니다.
구현
public function get element():ContentElement오류
IllegalOperationError — 이 요소가 속하는 TextLine이 잘못되었습니다.
|
mirror | 속성 |
mirror:EventDispatcher [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
미러 영역에 영향을 주는 이벤트가 미러링되는 EventDispatcher 객체입니다. 여기에는 특히 미러 영역에서 발생하는 마우스 이벤트와 텍스트 행을 대상으로 하는 다른 모든 이벤트가 포함됩니다.
구현
public function get mirror():EventDispatchernextRegion | 속성 |
nextRegion:flash.text.engine:TextLineMirrorRegion [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
텍스트 요소에서 파생된 세트의 다음 TextLineMirrorRegion입니다. 현재 영역이 세트의 마지막 미러 영역이면 null입니다. 같은 행이나 다른 텍스트 행에 있을 수 있습니다.
구현
public function get nextRegion():flash.text.engine:TextLineMirrorRegionpreviousRegion | 속성 |
previousRegion:flash.text.engine:TextLineMirrorRegion [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
텍스트 요소에서 파생된 세트의 이전 TextLineMirrorRegion입니다. 현재 영역이 세트의 첫 번째 미러 영역이면 null입니다. 같은 행이나 다른 텍스트 행에 있을 수 있습니다.
구현
public function get previousRegion():flash.text.engine:TextLineMirrorRegiontextLine | 속성 |
textLine:flash.text.engine:TextLine [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
이 미러 영역을 포함하는 TextLine입니다.
구현
public function get textLine():flash.text.engine:TextLine
package {
import flash.display.Sprite;
import flash.text.engine.TextBlock;
import flash.text.engine.TextLine;
import flash.text.engine.TextElement;
import flash.text.engine.ElementFormat;
import flash.text.engine.FontDescription;
import flash.text.engine.ContentElement;
import flash.text.engine.GroupElement;
import flash.text.engine.TextLineMirrorRegion;
import flash.events.MouseEvent;
import flash.events.EventDispatcher;
import flash.ui.Mouse;
public class TextLineMirrorRegionExample extends Sprite {
var myEvent:EventDispatcher = new EventDispatcher();
var fontDescription:FontDescription = new FontDescription();
var textBlock:TextBlock = new TextBlock();
public function TextLineMirrorRegionExample():void {
fontDescription.fontWeight = "bold";
var blackFormat:ElementFormat = new ElementFormat();
blackFormat.fontSize = 18;
blackFormat.color = 0x000000;
blackFormat.fontDescription = fontDescription;
var textElement1 = new TextElement("Click on different parts of me to find the ", blackFormat);
var textElement2 = new TextElement("mirror regions",blackFormat);
var textElement3 = new TextElement(". If I am a mirror region, I'll ",blackFormat);
var textElement4 = new TextElement("turn red",blackFormat);
var textElement5 = new TextElement(".",blackFormat);
myEvent.addEventListener("click", clickHandler);
myEvent.addEventListener("mouseOut", mouseOutHandler);
myEvent.addEventListener("mouseOver", mouseOverHandler);
var groupVector:Vector.<ContentElement> = new Vector.<ContentElement>;
groupVector.push(textElement1, textElement2, textElement3, textElement4, textElement5);
var groupElement:GroupElement = new GroupElement(groupVector);
textElement2.eventMirror=myEvent;
textElement4.eventMirror=myEvent;
textBlock.content = groupElement;
createLines(textBlock);
}
private function clickHandler(event:MouseEvent):void
{
var redFormat:ElementFormat = new ElementFormat();
redFormat.color = 0xCC0000;
redFormat.fontSize = 18;
redFormat.fontDescription = fontDescription;
var line:TextLine = event.target as TextLine;
var region:TextLineMirrorRegion = line.getMirrorRegion(myEvent);
region.element.elementFormat = redFormat;
createLines(textBlock);
}
private function mouseOverHandler(event:MouseEvent):void
{
Mouse.cursor = "button";
}
private function mouseOutHandler(event:MouseEvent):void
{
Mouse.cursor = "arrow";
}
private function createLines(textBlock:TextBlock):void
{
var purgeLine:TextLine = textBlock.firstLine;
while (purgeLine)
{
removeChild (purgeLine);
purgeLine = purgeLine.nextLine;
}
var lineWidth:Number = 150;
var xPos:Number = 15.0;
var yPos:Number = 20.0;
var textLine:TextLine = textBlock.createTextLine (null, lineWidth);
while (textLine)
{
textLine.x = xPos;
textLine.y = yPos;
yPos += textLine.height + 2;
addChild (textLine);
textLine = textBlock.createTextLine (textLine, lineWidth);
}
}
}
}
Tue Jun 12 2018, 03:17 PM Z
상속되는 공용 속성 숨기기
상속되는 공용 속성 표시