適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隱藏篩選
flash.text.engine 

TextLine  - AS3

套件x

最上層
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

語言元素

全域常數
全域函數
運算子
陳述式、關鍵字和指令
特殊類型

附錄

新增內容
編譯器錯誤
編譯器警告
執行階段錯誤
移轉至 ActionScript 3
支援的字元集
僅限 MXML 標籤
移動 XML 元素
Timed Text 標籤
不建議元素清單
AccessibilityImplementation 常數
如何使用 ActionScript 範例
法律聲明
套件flash.text.engine
類別public final class TextLine
繼承TextLine Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

TextLine 類別是用來顯示顯示清單上的文字。

您不能直接從 ActionScript 程式碼建立 TextLine 物件。如果您呼叫 new TextLine(),就會擲出例外。若要建立 TextLine 物件,請呼叫 TextBlock 的 createTextLine() 方法。

TextLine 封裝顯示其內容所需的最基本資訊,並透過某些描述文字行 Atom 屬性的方法,提供互動性。Atom 一詞同時可做為圖形元素與字元 (包括結合的字元群組) 來解釋,亦即組成文字行的實體。

在完成文字行的一般事件傳送之後,如果該文字行有效,則事件會鏡像至構成該文字行之內容元素物件的 eventMirror 屬性中指定的事件發送程式。TextLine.mirrorRegions 屬性會記錄這些物件。如果事件散播失敗或停止,或者如果文字行無效,則不會鏡像事件。

滑鼠事件的鏡像處理屬於特殊案例。因為鏡像區域並不是真的顯示物件,所以它們的 mouseOvermouseOut 事件是模擬的。rollOverrollOut 事件則不是模擬的。所有自然發生的 mouseOvermouseOutrollOverrollOut 事件 (不論是以文字行或文字行的子項目為目標) 都會予以忽略,不為它們進行鏡像處理。

文字行物件的原點是基線的開頭。如果您未針對包含羅馬字基線上拉丁文字的字行設定垂直位置 (y 屬性),只有文字的字母下緣會出現在加入文字行之 Sprite 頂端的下方。請參閱下圖:

文字基線

TextLine 類別有數個祖系類別 (DisplayObjectContainer、InteractiveObject、DisplayObject 和 EventDispatcher),TextLine 類別會從這些祖系類別繼承屬性與方法。下列繼承的屬性不適用於 TextLine 物件:

  • contextMenu
  • focusRect
  • tabChildren
  • tabEnabled
  • tabIndex

如果您嘗試設定這些屬性,文字引擎會擲回錯誤 IllegalOperationError。您可以讀取這些屬性,但它們一定會包含預設值。

檢視範例

相關 API 元素



公用屬性
 屬性定義自
 InheritedaccessibilityImplementation : AccessibilityImplementation
對此 InteractiveObject 實體目前的輔助功能實作 (AccessibilityImplementation)。
InteractiveObject
 InheritedaccessibilityProperties : AccessibilityProperties
此顯示物件的目前輔助功能選項。
DisplayObject
 Inheritedalpha : Number
指出所指定物件的 Alpha 透明度值。
DisplayObject
  ascent : Number
[唯讀] 指定此行中從基線開始到最高字元的上方,之間距離多少像素。
TextLine
  atomCount : int
[唯讀] 字行中的 Atom 數目,亦即不可分元素的數目,包括空格與圖像元素。
TextLine
 InheritedblendMode : String
來自 BlendMode 類別的值,會指定要使用何種混合模式。
DisplayObject
 InheritedblendShader : Shader
[唯寫] 設定用來混合前景和背景的著色器。
DisplayObject
 InheritedcacheAsBitmap : Boolean
如果設定為 true,Flash 執行階段會快取顯示物件的內部點陣圖表示法。
DisplayObject
 Inherited    cacheAsBitmapMatrix : Matrix
如果為非 null,當 cacheAsBitmap 設定為 true 時,這個 Matrix 物件會定義顯示物件的顯示方法。
DisplayObject
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
 InheritedcontextMenu : NativeMenu
指定與此物件有關聯的快顯選單。
InteractiveObject
  descent : Number
[唯讀] 指定此行中從基線開始到最低字元的下方,之間距離多少像素。
TextLine
 InheriteddoubleClickEnabled : Boolean
會指定物件是否會收到 doubleClick 事件。
InteractiveObject
 Inheritedfilters : Array
索引的陣列,其中包含目前和顯示物件相關的每個濾鏡物件。
DisplayObject
 InheritedfocusRect : Object
會指定這個物件是否會顯示焦點矩形。
InteractiveObject
  hasGraphicElement : Boolean
[唯讀] 指出文字行是否包含任何圖像元素。
TextLine
  hasTabs : Boolean
[唯讀] 指出文字行是否包含任何定位。
TextLine
 Inheritedheight : Number
會指出顯示物件的高度,以像素為單位。
DisplayObject
 InheritedloaderInfo : LoaderInfo
[唯讀] 會傳回 LoaderInfo 物件,其中包含關於載入此顯示物件所屬之檔案的資訊。
DisplayObject
 Inheritedmask : DisplayObject
呼叫之顯示物件會以指定的 mask 物件遮蓋。
DisplayObject
 InheritedmetaData : Object
如果中繼資料是透過 PlaceObject4 標籤與 SWF 檔案中的這個 DisplayObject 實體一同儲存,則會取得 DisplayObject 實體的中繼資料物件。
DisplayObject
  mirrorRegions : Vector.<flash.text.engine:TextLineMirrorRegion>
[唯讀] 包含與此行有關之 TextLineMirrorRegion 物件的 Vector,如果沒有任何物件則為 null。
TextLine
 InheritedmouseChildren : Boolean
判斷物件的子系是否支援啟用滑鼠或使用者輸入裝置。
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
指定此物件是否接收滑鼠或其他使用者輸入及訊息。
InteractiveObject
 InheritedmouseX : Number
[唯讀] 指出滑鼠或使用者輸入裝置位置的 x 座標,以像素為單位。
DisplayObject
 InheritedmouseY : Number
[唯讀] 指出滑鼠或使用者輸入裝置位置的 y 座標,以像素為單位。
DisplayObject
 Inheritedname : String
指出 DisplayObject 的實體名稱。
DisplayObject
 InheritedneedsSoftKeyboard : Boolean
指定虛擬鍵盤 (螢幕上的軟體鍵盤) 是否應在此 InteractiveObject 實體接收到焦點時顯示。
InteractiveObject
  nextLine : flash.text.engine:TextLine
[唯讀] TextBlock 中的下一個 TextLine,如果目前字行是區塊內的最後一行或是此行的有效性為 TextLineValidity.STATIC,則為 null。
TextLine
 InheritednumChildren : int
[唯讀] 傳回此物件的子系數量。
DisplayObjectContainer
 InheritedopaqueBackground : Object
會指定顯示物件是否不透明,並具有特定背景顏色。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[唯讀] 指出包含此顯示物件的 DisplayObjectContainer 物件。
DisplayObject
  previousLine : flash.text.engine:TextLine
[唯讀] TextBlock 中的上一個 TextLine,如果這是區塊內的第一行或是此行的 validity 為 TextLineValidity.STATIC,則為 null。
TextLine
  rawTextLength : int
[唯讀] 文字區塊內變成此行的原始文字長度,包括 U+FDEF 字元,這些字元代表屬於此行的一部分但不會顯示的圖像元素和任何結尾空格。
TextLine
 Inheritedroot : DisplayObject
[唯讀] 對載入之 SWF 檔案的顯示物件而言,root 屬性就是該 SWF 檔案所呈現之顯示清單樹狀結構部分的最上層顯示物件。
DisplayObject
 Inheritedrotation : Number
指出 DisplayObject 實體的旋轉度數 (從該物件原本方向算起)。
DisplayObject
 InheritedrotationX : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 x 軸旋轉 (以度數為單位)。
DisplayObject
 InheritedrotationY : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 y 軸旋轉 (以度數為單位)。
DisplayObject
 InheritedrotationZ : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 z 軸旋轉 (以度數為單位)。
DisplayObject
 Inheritedscale9Grid : Rectangle
目前產生效用的縮放格線。
DisplayObject
 InheritedscaleX : Number
指出從註冊點套用的物件水平縮放 (百分比)。
DisplayObject
 InheritedscaleY : Number
指出從物件註冊點套用的物件垂直縮放 (百分比)。
DisplayObject
 InheritedscaleZ : Number
指出從物件註冊點套用的物件深度縮放 (百分比)。
DisplayObject
 InheritedscrollRect : Rectangle
顯示物件的捲動矩形範圍。
DisplayObject
 Inherited    softKeyboard : String
控制軟體鍵盤的外觀。
InteractiveObject
 InheritedsoftKeyboardInputAreaOfInterest : Rectangle
定義顯示軟體鍵盤時,應保留於螢幕上的區域 (iOS 未提供)。
InteractiveObject
  specifiedWidth : Number
[唯讀] 當 TextBlock.createTextLine() 方法建立此行時,為其指定的寬度。
TextLine
 Inheritedstage : Stage
[唯讀] 顯示物件的「舞台」。
DisplayObject
 InheritedtabChildren : Boolean
判斷物件的子系是否支援啟用定位鍵。
DisplayObjectContainer
 InheritedtabEnabled : Boolean
會指定這個物件是否在停駐點順序中。
InteractiveObject
 InheritedtabIndex : int
會指定 SWF 檔中的物件停駐點順序。
InteractiveObject
  textBlock : flash.text.engine:TextBlock
[唯讀] 包含這個文字行的 TextBlock,如果文字行的有效性是 TextLineValidity.STATIC 則為 null,表示在文字行與 TextBlock 之間的連線已經切斷。
TextLine
  textBlockBeginIndex : int
[唯讀] 該行第一個字元的索引位於文字區塊的原始文字中。
TextLine
  textHeight : Number
[唯讀] 文字行的邏輯高度,等於 ascent + descent。
TextLine
 InheritedtextSnapshot : flash.text:TextSnapshot
[唯讀] 傳回此 DisplayObjectContainer 實體的 TextSnapshot 物件。
DisplayObjectContainer
  textWidth : Number
[唯讀] 文字行的邏輯寬度,文字引擎會使用此寬度來配置字行。
TextLine
  totalAscent : Number
[唯讀] 指定此行中從基線開始到最高字元或圖形的上方之間距離多少像素。
TextLine
  totalDescent : Number
[唯讀] 指定此行中從基線開始到最低字元或圖形的下方之間距離多少像素。
TextLine
  totalHeight : Number
[唯讀] 文字行的邏輯高度,等於 totalAscent + totalDescent。
TextLine
 Inheritedtransform : flash.geom:Transform
這是一個物件,具有和顯示物件的矩陣、顏色轉換和像素邊界有關的屬性。
DisplayObject
  unjustifiedTextWidth : Number
[唯讀] 字行未對齊時的寬度。
TextLine
  userData : *
提供了讓應用程式將任意資料與文字行產生關聯的方法。
TextLine
  validity : String
指定文字行的目前有效性。
TextLine
 Inheritedvisible : Boolean
不管是否看得見顯示物件。
DisplayObject
 Inheritedwidth : Number
會指出顯示物件的寬度,以像素為單位。
DisplayObject
 Inheritedx : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 x 座標。
DisplayObject
 Inheritedy : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 y 座標。
DisplayObject
 Inheritedz : Number
表示 DisplayObject 實體相對於 3D 父輩容器的 z 座標位置 (沿著 z 軸)。
DisplayObject
公用方法
 方法定義自
 Inherited
將 DisplayObject 子實體加入至此 DisplayObjectContainer 實體。
DisplayObjectContainer
 Inherited
將 DisplayObject 子實體加入至此 DisplayObjectContainer 實體。
DisplayObjectContainer
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。
EventDispatcher
 Inherited
指出安全性限制是否會造成傳回的清單 (可用指定的 point 點呼叫 DisplayObjectContainer.getObjectsUnderPoint() 方法來取得) 省略任何顯示物件。
DisplayObjectContainer
 Inherited
判斷指定的顯示物件是否為 DisplayObjectContainer 實體的子系,或為實體本身。
DisplayObjectContainer
 Inherited
會將事件傳送到事件流程。
EventDispatcher
  
將 TextLine 的基礎內容傾印為 XML 字串。
TextLine
  
從下列版本以後不建議使用: Flash Player 10.1現在不做任何動作。
這個方法已經不建議使用並且無效果。
TextLine
  
取得位於指定索引處之 Atom 的雙向層級。
TextLine
  
在指定的索引 (相對於文字行) 上取得 Atom 的邊界。
TextLine
  
取得 Atom 的中央 (沿著指定之索引處的基線測量所得)。
TextLine
  
取得位於指定索引處之 Atom 的圖像,如果 Atom 為一個字元則為 null。
TextLine
  
傳回包含 charIndex 參數指定之字元的 Atom 索引,如果該字元並不會造成此行上的任何 Atom 則為 -1。
TextLine
  
傳回 x 和 y 參數指定之點上的 Atom 索引,如果該點沒有 Atom 則為 -1。
TextLine
  
取得位於指定索引處之 Atom 的文字區塊開始索引。
TextLine
  
取得位於指定索引處之 Atom 的文字區塊結束索引。
TextLine
  
取得位於指定索引處之 Atom 的旋轉。
TextLine
  
指出文字界限是否會出現在指定索引處的 Atom 左側。
TextLine
  
取得相對於 TextBlock.baselineZero 的指定基線位置。
TextLine
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
傳回可定義顯示物件區域 (相對於 targetCoordinateSpace 物件的座標系統) 的矩形。
DisplayObject
 Inherited
傳回存在於指定索引位置的子顯示物件實體。
DisplayObjectContainer
 Inherited
傳回具有指定名稱的子顯示物件。
DisplayObjectContainer
 Inherited
傳回 child DisplayObject 實體的索引位置。
DisplayObjectContainer
  
傳回此行的第一個 TextLineMirrorRegion,它的 mirror 屬性符合 mirror 參數指定的屬性,如果不相符則為 null。
TextLine
 Inherited
傳回位於指定點底下,且屬於此 DisplayObjectContainer 實體之子系 (或孫系,以下類推) 的物件陣列。
DisplayObjectContainer
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
根據 targetCoordinateSpace 參數所定義的座標系統,並排除形狀上的任何筆畫,傳回可定義顯示物件邊界的矩形。
DisplayObject
 Inherited
將 point 物件從「舞台」(全域) 座標轉換成顯示物件的 (區域) 座標。
DisplayObject
 Inherited
將二維點從「舞台」(全域) 座標轉換為三維顯示物件的 (區域) 座標。
DisplayObject
 Inherited
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。
EventDispatcher
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
評估顯示物件的範圍框,看它是否與 obj 顯示物件的範圍框重疊或相交。
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
評估顯示物件,看它是否與 x 和 y 參數所指定的點重疊或相交。
DisplayObject
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
將三維顯示物件的 (區域) 座標的三維點轉換為「舞台」(全域) 座標中的二維點。
DisplayObject
 Inherited
將 point 物件從顯示物件的 (區域) 座標轉換成「舞台」(全域) 座標。
DisplayObject
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
將指定的 child DisplayObject 實體從 DisplayObjectContainer 實體的子清單中移除。
DisplayObjectContainer
 Inherited
從 DisplayObjectContainer 子清單中的指定索引位置移除子 DisplayObject。
DisplayObjectContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 0x7fffffff):void
將所有 child DisplayObject 實體從 DisplayObjectContainer 實體的子清單中移除。
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
會從 EventDispatcher 物件移除偵聽程式。
EventDispatcher
 Inherited
升起顯示虛擬鍵盤。
InteractiveObject
 Inherited
變更顯示物件容器中現有子系的位置。
DisplayObjectContainer
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
遞迴停止執行所有 MovieClips 的時間軸根源於此物件。
DisplayObjectContainer
 Inherited
替換兩個指定子物件的 z 順序 (深度階層,由前至後順序)。
DisplayObjectContainer
 Inherited
swapChildrenAt(index1:int, index2:int):void
在子清單的兩個指定索引位置,替換子物件的 z 順序 (深度階層,由前至後順序)。
DisplayObjectContainer
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
 Inherited
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。
EventDispatcher
事件
 事件 摘要 定義自
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。EventDispatcher
 Inherited當顯示物件加入顯示清單中時傳送。DisplayObject
 Inherited會在顯示物件加入舞台上的顯示清單時,以直接或是透過加入包含該顯示物件之子樹狀結構的方式傳送。DisplayObject
 Inherited當使用者從文字快顯選單中選取「清除」(或「刪除」) 時傳送。InteractiveObject
 Inherited會當使用者在相同的 InteractiveObject 上方按下並放開使用者的指向裝置主按鈕時傳送。InteractiveObject
 Inherited
    contextMenu
當使用者手勢在 AIR 應用程式中觸發與此互動式物件相關聯的快顯選單時傳送。InteractiveObject
 Inherited當使用者針對複製作業啟動平台特有的快速鍵組合或從文字快顯選單中選取「複製」時傳送。InteractiveObject
 Inherited當使用者針對剪下作業啟動平台特有的快速鍵組合或從文字快顯選單中選取「剪下」時傳送。InteractiveObject
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。EventDispatcher
 Inherited在 InteractiveObject 物件的 doubleClickEnabled 旗標設為 true 的情況下,當使用者在相同的物件上方連續兩次快速按下並放開指標裝置主要按鈕時傳送。InteractiveObject
 Inherited[廣播事件] 當播放磁頭進入新影格時傳送。DisplayObject
 Inherited[廣播事件] 當播放磁頭結束目前影格時傳送。DisplayObject
 Inherited當顯示物件取得焦點之後傳送。InteractiveObject
 Inherited當顯示物件失去焦點時傳送。InteractiveObject
 Inherited[廣播事件] 在影格顯示物件的建構函式執行之後,且影格指令碼執行之前傳送。DisplayObject
 Inherited當使用者沿著觸控面與 InteractiveObject 實體建立接觸點 (例如沿著 Apple TV 的 Siri Remote 觸控面點選),某些裝置可能也會將此接觸解譯為數個觸控事件的組合。InteractiveObject
 Inherited當使用在觸控裝置上的同一個 InteractiveObject 實體上按下兩個接觸點後送出 (例如在行動電話或平板電腦觸控螢幕的顯示物件上方,以兩支手指按下後鬆開)。InteractiveObject
 Inherited當使用者在觸控裝置上,將接觸點移動到 InteractiveObject 實體上方後傳送 (例如,在行動電話或平板電腦觸控螢幕的顯示物件上,由左向右移動手指)。InteractiveObject
 Inherited當使用者在 InteractiveObject 實體的接觸點上做出旋轉手勢後傳送 (例如兩指觸摸行動電話或平板電腦的觸控螢幕,然後手指在顯示物件上旋轉)。InteractiveObject
 Inherited當使用者在與 InteractiveObject 實體的某個接觸點上做出揮動手勢後傳送 (例如,三指併在一起觸碰行動電話或平板電腦的觸控螢幕,然後在顯示物件上快速平行移動手指)。InteractiveObject
 Inherited當使用者與 InteractiveObject 實體建立接觸點,然後在觸控裝置上點一下後送出 (例如,將多根手指放到行動電話或平板電腦觸控螢幕的顯示物件上以開啟選單,然後其中一根手點一下,選取選單項目)。InteractiveObject
 Inherited當使用者在 InteractiveObject 實體的某個接觸點上做出放大縮小手勢後傳送 (例如兩指併在一起觸摸行動電話或平板電腦的觸控螢幕,然後手指在顯示物件上快速張開)。InteractiveObject
 Inherited這個事件會送出至任何支援 IME 內嵌輸入的用戶端應用程式。InteractiveObject
 Inherited會當使用者按下按鍵時傳送。InteractiveObject
 Inherited當使用者嘗試使用鍵盤瀏覽變更焦點時傳送。InteractiveObject
 Inherited會當使用者放開按鍵時傳送。InteractiveObject
 Inherited當使用者在相同的 InteractiveObject 上方按下並放開使用者的指向裝置中間按鈕時傳送。InteractiveObject
 Inherited當使用者將指向裝置的中間按鈕移至 InteractiveObject 實體上方按下時傳送。InteractiveObject
 Inherited當使用者將指向裝置按鈕移至 InteractiveObject 實體上方放開時傳送。InteractiveObject
 Inherited當使用者將指向裝置按鈕移至 InteractiveObject 實體上方按下時傳送。InteractiveObject
 Inherited會當使用者嘗試使用指向裝置變更焦點時傳送。InteractiveObject
 Inherited會當指向裝置停在 InteractiveObject 上方的情況下使用者將其移動時傳送。InteractiveObject
 Inherited會當使用者將指向裝置移開 InteractiveObject 實體時傳送。InteractiveObject
 Inherited會當使用者將指向裝置移至 InteractiveObject 實體上方時傳送。InteractiveObject
 Inherited當使用者將指向裝置按鈕移至 InteractiveObject 實體上方放開時傳送。InteractiveObject
 Inherited當滑鼠滾輪在 InteractiveObject 實體上方轉動時傳送。InteractiveObject
 Inherited當使用者釋放手勢時,由拖曳初始程式 InteractiveObject 傳送。InteractiveObject
 Inherited已在目標 InteractiveObject 上放下拖曳的物件,而且已呼叫 DragManager.acceptDragDrop() 接受該放開的資料時,由此目標 InteractiveObject 傳送。InteractiveObject
 Inherited當手勢進入 InteractiveObject 的邊界時,由此 InteractiveObject 傳送。InteractiveObject
 Inherited當手勢離開 InteractiveObject 的邊界時,由此 InteractiveObject 傳送。InteractiveObject
 Inherited當拖曳手勢還留在 InteractiveObject 的邊界內,由此 InteractiveObject 持續傳送。InteractiveObject
 Inherited在呼叫 DragManager.doDrag() 進行拖曳作業初期,由指定做為拖曳初始程式的 InteractiveObject 傳送。InteractiveObject
 Inherited在呼叫 DragManager.doDrag() 進行拖曳作業期間,由指定做為拖曳初始程式的 InteractiveObject 傳送。InteractiveObject
 Inherited當使用者針對貼上作業啟動平台特有的快速鍵組合或從文字快顯選單中選取「貼上」時傳送。InteractiveObject
 Inherited在使用者將作用中觸控筆往下移至超過螢幕鄰近偵測邊框時傳送。InteractiveObject
 Inherited
    proximityEnd
在使用者將作用中觸控筆提到螢幕鄰近偵測邊框時傳送。InteractiveObject
 Inherited在使用者將作用中觸控筆移到螢幕上方,而其餘仍在鄰近偵測邊框內時傳送。InteractiveObject
 Inherited
    proximityOut
在使用者將作用中觸控筆移出這個 InteractiveObject 之外,而其餘仍在螢幕的鄰近偵測邊框內時傳送。InteractiveObject
 Inherited在使用者直接將作用中觸控筆移到這個 InteractiveObject 上方,而其餘仍在螢幕的鄰近偵測邊框內時傳送。InteractiveObject
 Inherited在使用者將作用中觸控筆移出這個 InteractiveObject 及其任一子系之外,而其餘仍在螢幕的鄰近偵測邊框內時傳送。InteractiveObject
 Inherited在使用者透過這個 InteractiveObject,從顯示清單中後代的物件樹狀結構之外移動作用中觸控筆時傳送 (而其餘仍在螢幕的鄰近偵測邊框內)。InteractiveObject
 Inherited當使用者第一次按下 InteractiveObject 實體上方的按鈕,然後將指向裝置滑出 InteractiveObject 實體之後即放開指向裝置上的按鈕時傳送。InteractiveObject
 Inherited會當顯示物件將要從顯示清單移除時傳送。DisplayObject
 Inherited會在顯示物件即將從顯示清單移除時,以直接或是透過移除包含該顯示物件之子樹狀結構的方式傳送。DisplayObject
 Inherited[廣播事件] 當顯示清單將要更新和顯示時傳送。DisplayObject
 Inherited當使用者在相同的 InteractiveObject 上方按下並放開使用者的指向裝置右邊按鈕時傳送。InteractiveObject
 Inherited當使用者將指向裝置按鈕移至 InteractiveObject 實體上方按下時傳送。InteractiveObject
 Inherited當使用者將指向裝置按鈕移至 InteractiveObject 實體上方放開時傳送。InteractiveObject
 Inherited會當使用者將指向裝置移開 InteractiveObject 實體時傳送。InteractiveObject
 Inherited會當使用者將指向裝置移至 InteractiveObject 實體上方時傳送。InteractiveObject
 Inherited當使用者針對全選作業啟動平台特有的快速鍵組合或從文字快顯選單中選取「全選」時傳送。InteractiveObject
 Inherited升起顯示軟體鍵盤之後立即傳送。InteractiveObject
 Inherited升起顯示軟體鍵盤前立即傳送。InteractiveObject
 Inherited降下隱藏軟體鍵盤之後立即傳送。InteractiveObject
 Inherited在物件的 tabChildren 旗標值變更時傳送。InteractiveObject
 Inherited在物件的 tabEnabled 旗標變更時傳送。InteractiveObject
 Inherited在物件的 tabIndex 屬性值變更時傳送。InteractiveObject
 Inherited當使用者輸入一或多文字的字元時送出。InteractiveObject
 Inherited當使用者在第一次接觸觸控裝置後傳送 (例如手指觸摸行動電話或平板電腦的觸控螢幕)。InteractiveObject
 Inherited當使用者在觸控裝置上移除接觸點後傳送 (例如在行動電話或平板電腦觸控螢幕上移開手指)。InteractiveObject
 Inherited當使用者觸控裝置時傳送,並且連續不斷地傳送,直到接觸點移除為止。InteractiveObject
 Inherited當使用者在觸控裝置中,將接觸點移出 InteractiveObject 實體後送出 (例如在行動電話或平板電腦的觸控螢幕上,將手指從顯示物件移至另一個顯示物件)。InteractiveObject
 Inherited當使用者在觸控裝置中將接觸點移至 InteractiveObject 實體上方後送出 (例如在行動電話或平板電腦的觸控螢幕上,將手指從顯示物件外面的某一點,往顯示物件上方拖曳)。InteractiveObject
 Inherited當使用者在觸控裝置上,將接觸點從 InteractiveObject 實體移出後送出 (例如,在行動電話或平板電腦的觸控螢幕上,將手指從顯示物件上方拖曳到顯示物件以外)。InteractiveObject
 Inherited當使用者在觸控裝置中將接觸點移至 InteractiveObject 實體上方後送出 (例如在行動電話或平板電腦的觸控螢幕上,將手指從顯示物件外面的某一點,往顯示物件上方拖曳)。InteractiveObject
 Inherited當使用者在觸控裝置的同一個 InteractiveObject 實體上,在原先開始接觸點放開後送出 (例如在行動電話或平板電腦觸控螢幕上的顯示物件上方,以手指按下某個點後又鬆開)。InteractiveObject
公用常數
 常數定義自
  MAX_LINE_WIDTH : int = 1000000
[靜態] 文字行的最大要求寬度 (以像素為單位)。
TextLine
屬性詳細資訊

ascent

屬性
ascent:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定此行中從基線開始到最高字元的上方,之間距離多少像素。在只包含圖像元素的 TextLine 中,會將 ascent 設為 0。



實作
    public function get ascent():Number

atomCount

屬性 
atomCount:int  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

字行中的 Atom 數目,亦即不可分元素的數目,包括空格與圖像元素。



實作
    public function get atomCount():int

擲回值
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

descent

屬性 
descent:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定此行中從基線開始到最低字元的下方,之間距離多少像素。在只包含圖像元素的 TextLine 中,會將 descent 設為 0。



實作
    public function get descent():Number

hasGraphicElement

屬性 
hasGraphicElement:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指出文字行是否包含任何圖像元素。



實作
    public function get hasGraphicElement():Boolean

相關 API 元素

hasTabs

屬性 
hasTabs:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 10.1

指出文字行是否包含任何定位。



實作
    public function get hasTabs():Boolean

mirrorRegions

屬性 
mirrorRegions:Vector.<flash.text.engine:TextLineMirrorRegion>  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

包含與此行有關之 TextLineMirrorRegion 物件的 Vector,如果沒有任何物件則為 null



實作
    public function get mirrorRegions():Vector.<flash.text.engine:TextLineMirrorRegion>

相關 API 元素

nextLine

屬性 
nextLine:flash.text.engine:TextLine  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock 中的下一個 TextLine,如果目前字行是區塊內的最後一行或是此行的有效性為 TextLineValidity.STATIC,則為 null



實作
    public function get nextLine():flash.text.engine:TextLine

相關 API 元素

previousLine

屬性 
previousLine:flash.text.engine:TextLine  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock 中的上一個 TextLine,如果這是區塊內的第一行或是此行的 validity 為 TextLineValidity.STATIC,則為 null



實作
    public function get previousLine():flash.text.engine:TextLine

相關 API 元素

rawTextLength

屬性 
rawTextLength:int  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

文字區塊內變成此行的原始文字長度,包括 U+FDEF 字元,這些字元代表屬於此行的一部分但不會顯示的圖像元素和任何結尾空格。



實作
    public function get rawTextLength():int

相關 API 元素

specifiedWidth

屬性 
specifiedWidth:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock.createTextLine() 方法建立此行時,為其指定的寬度。此值在決定變更是否需要重新斷行時很有用處。



實作
    public function get specifiedWidth():Number

相關 API 元素

textBlock

屬性 
textBlock:flash.text.engine:TextBlock  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

包含這個文字行的 TextBlock,如果文字行的有效性是 TextLineValidity.STATIC 則為 null,表示在文字行與 TextBlock 之間的連線已經切斷。



實作
    public function get textBlock():flash.text.engine:TextBlock

相關 API 元素

textBlockBeginIndex

屬性 
textBlockBeginIndex:int  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

該行第一個字元的索引位於文字區塊的原始文字中。



實作
    public function get textBlockBeginIndex():int

相關 API 元素

textHeight

屬性 
textHeight:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

文字行的邏輯高度,等於 ascent + descent。若要取得油墨高度,請存取繼承的 height 屬性。

此值會依據框住字行的基線之間差異來計算,這些基線有可能是表意上/下或上緣/下緣基線,需視 TextBlock.baselineZero 是否為表意而定。計算這些基線時,不會將圖像元素納入考慮。



實作
    public function get textHeight():Number

相關 API 元素

textWidth

屬性 
textWidth:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

文字行的邏輯寬度,文字引擎會使用此寬度來配置字行。請存取繼承的 width 屬性來取得所有繪製像素之範圍框的實際寬度。



實作
    public function get textWidth():Number

相關 API 元素


範例  ( 如何使用本範例 )
這個範例會以正常的字體型態顯示一次字行並以斜體字的字體型態顯示一次字行,而且每次都會追蹤 specifiedWidthtextWidthwidth 屬性的值。追蹤輸出為:
  • specifiedWidth 為 500
  • textWidth 為 268.9921875
  • width 為 269
  • specifiedWidth 為 500
  • textWidth 為 267.52734375
  • width 為 267.55
 
package {
import flash.display.Sprite;
import flash.text.engine.TextBlock;
import flash.text.engine.TextElement;
import flash.text.engine.TextLine;
import flash.text.engine.FontDescription;
import flash.text.engine.ElementFormat;
import flash.text.engine.FontPosture;

    public class TextLine_textWidthExample extends Sprite {
        
        public function TextLine_textWidthExample() {
            
            var str:String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, ";
            var yPos:Number = 20;
            var fontDescription:FontDescription = new FontDescription();
            var textBlock:TextBlock = new TextBlock();
            fontDescription.fontPosture = FontPosture.NORMAL;
            var format:ElementFormat = new ElementFormat(fontDescription, 12);
            var textElement:TextElement = new TextElement(str, format);
            textBlock.content = textElement;
            createLine(textBlock, yPos);
            var fontDescriptionItalic = fontDescription.clone();
            fontDescriptionItalic.fontPosture = FontPosture.ITALIC;
            var formatItalic = new ElementFormat(fontDescriptionItalic, 12);
            textElement = new TextElement(str, formatItalic);
            textBlock.content = textElement;
            createLine(textBlock, yPos + 20);
        }

        private function createLine(textBlock:TextBlock, yPos:Number):void {
            var textLine:TextLine = textBlock.createTextLine (null, 500);
            trace("specifiedWidth is: " + textLine.specifiedWidth);
            trace("textWidth is: " + textLine.textWidth);
            trace("width is: " + textLine.width);
            addChild(textLine);
            textLine.x = 15;
            textLine.y = yPos;     
        }
    }
}

totalAscent

屬性 
totalAscent:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 10.2

指定此行中從基線開始到最高字元或圖形的上方之間距離多少像素。



實作
    public function get totalAscent():Number

totalDescent

屬性 
totalDescent:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 10.2

指定此行中從基線開始到最低字元或圖形的下方之間距離多少像素。



實作
    public function get totalDescent():Number

totalHeight

屬性 
totalHeight:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 10.2

文字行的邏輯高度,等於 totalAscent + totalDescent



實作
    public function get totalHeight():Number

unjustifiedTextWidth

屬性 
unjustifiedTextWidth:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

字行未對齊時的寬度。如果是未對齊的文字,此值與 textWidth 相同。如果是對齊的文字,此值為未強制齊行時的長度,而且 textWidth 代表實際的字行寬度。例如,當對齊並送出下列 String 至具有寬度 500 的 TextBlock.createTextLine() 時,它的實際寬度為 500,但未對齊的寬度為 268.9921875。



實作
    public function get unjustifiedTextWidth():Number

相關 API 元素


範例  ( 如何使用本範例 )
在下列範例中對齊並送出 String 至具有寬度 500 的 TextBlock.createTextLine() 時,它的實際寬度為 500,但未對齊的寬度為 268.9921875。
     import flash.display.Sprite;
     import flash.text.engine.TextBlock;
     import flash.text.engine.TextElement;
     import flash.text.engine.TextLine;
     import flash.text.engine.FontDescription;
     import flash.text.engine.ElementFormat;
     import flash.text.engine.SpaceJustifier;
     import flash.text.engine.LineJustification;

     var str:String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, ";
     var fontDescription:FontDescription = new FontDescription();
     var textBlock:TextBlock = new TextBlock();
     var format:ElementFormat = new ElementFormat(fontDescription, 12);
     var textElement:TextElement = new TextElement(str, format);
     textBlock.content = textElement;
     var spaceJustifier:SpaceJustifier = new SpaceJustifier("en", LineJustification.ALL_INCLUDING_LAST);
     textBlock.textJustifier = spaceJustifier;
     var textLine:TextLine = textBlock.createTextLine(null, 500);
     textLine.y = 20;

     addChild(textLine);
     trace("textWidth value is: " + textLine.textWidth);        // 500.00244140625
     trace("unjustifiedTextWidth is: " + textLine.unjustifiedTextWidth); // 268.9921875
     

userData

屬性 
public var userData:*

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

提供了讓應用程式將任意資料與文字行產生關聯的方法。

validity

屬性 
validity:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定文字行目前的有效性。此屬性的值可在 TextLineValidity 類別的成員中找到。設定此屬性的規則如下:

如果有效性設定為不屬於 TextLineValidity 成員的任何字串,行會被視為 USER_INVALID。USER_INVALID 是一種抽象觀念,用在這裡可代表任何的這類值。

當修改了 TextBlock 的內容時,Flash 執行階段會將受影響的文字行、上一行及之後的所有行標示為 INVALID。當變更允許上一行吸收原本位於第一個受影響字行上的內容一部分時,上一行就必須標示為 invalid。

新的斷行一定是 VALID。Flash 執行階段可能會將下列幾行從 VALID 變更為 POSSIBLY_INVALID 或 INVALID。如果斷行相符,它可能會將 POSSIBLY_INVALID 行變更為 VALID,如果不相符則變更為 INVALID。

應用程式程式碼可將 VALID 行標示為 INVALID 或 USER_INVALID,而且可將 USER_INVALID 行標示為 VALID。應用程式程式碼無法將行標示為 POSSIBLY_INVALID。

應用程式程式碼可以將任何行標示為 STATIC。這樣做會使得 block 成員變成 null。如果 STATIC 文字行中的任何圖像元素屬於文字區塊中新文字斷行的一部分 (STATIC 文字行一開始是衍生自此文字區塊),將會移除這些圖像元素並重新改變其父輩。



實作
    public function get validity():String
    public function set validity(value:String):void

擲回值
ArgumentError — 如果目前的值為 TextLineValidity.STATIC
 
ArgumentError — 如果目前的值為 TextLineValidity.INVALID,而新值為 TextValidity.STATIC 以外的任何值。
 
ArgumentError — 如果目前的值為 TextLineValidity.POSSIBLY_INVALID,而新值為 TextLineValidity.VALID
 
ArgumentError — 如果新值為 TextLineValidity.POSSIBLY_INVALID

相關 API 元素

方法詳細資訊

dump

()方法
public function dump():String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

將 TextLine 的基礎內容傾印為 XML 字串。在自動化測試中,這樣的處理非常有用,而且包括了文字、格式化和版面資訊。

以下說明該輸出:

	 [LINE]
	 <line ascent=[Number] descent=[Number] rotation=[int]>
	 	<elements>
	 		[0-N ELEMENT]
	 	</elements>
	 	<clusters>
	 		[0-N CLUSTER]
	 	</clusters>
	 </line>
	 
	 [ELEMENT]
	 <glyph isEmbedded=[Boolean] fontName=[String] isBold=[Boolean] isItalic=[Boolean] gid=[int] pointSize=[Number] x=[Number] y=[Number] rotation=[int]/>
	 or
	 <graphic child=[int] x=[Number] y=[Number] rotation=[int]/>
	 or
	 <embeddedRun x=[Number] y=[Number]>
	 	[LINE]
	 </embeddedRun>
	 
	 [CLUSTER]
	 <cluster xLeft=[Number] xCenter=[Number] xRight=[Number] cursorOnLeft=[Boolean] cursorOnRight=[Boolean] wordBoundaryOnLeft=[Boolean] wordBoundaryOnRight=[Boolean]/>
	 

注意:來自此方法的輸出內容與格式未來可能有所變更。Adobe 不保證對此方法提供舊版相容。

傳回值
String

相關 API 元素

flushAtomData

()方法 
public function flushAtomData():void
從下列版本以後不建議使用: Flash Player 10.1現在不做任何動作。

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

這個方法已經不建議使用並且無效果。Atom 資料已經壓縮,並且不會影響管理記憶體效率。

相關 API 元素

getAtomBidiLevel

()方法 
public function getAtomBidiLevel(atomIndex:int):int

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得位於指定索引處之 Atom 的雙向層級。由 TextBlock.bidiLevel 以及文字行構成字元的 Unicode 雙向屬性組合決定。

例如,如果文字區塊以一些希伯來文字為開頭,您要將 TextBlock.bidiLevel 設定為 1,這會建立由右至左的預設文字方向。如果這些文字內有英文 (由左至右) 的引文,該文字的 AtomBidiLevel 為 2。如果英文內有一些阿拉伯文 (由右至左),該連續文字的 AtomBidiLevel 會是 3。如果阿拉伯文內有數字 (由左至右),則數字的 AtomBidiLevel 設定為 4。無論 Atom 最後出現在哪一行,希伯來文 Atom 為 AtomBidiLevel 1,英文 Atom 為 AtomBidiLevel 2,阿拉伯文 Atom 為 AtomBidiLevel 3,數字 Atom 為 AtomBidiLevel 4。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
int — 位於 atomIndex 之 Atom 的雙向層級。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

相關 API 元素

getAtomBounds

()方法 
public function getAtomBounds(atomIndex:int):Rectangle

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

在指定的索引 (相對於文字行) 上取得 Atom 的邊界。指定之 Atom 的邊界包含該行中自己的水平位置 (x)、該行中自己的垂直位置 (y)、自己的寬度 (w) 以及自己的高度 (h)。所有值都是以像素為單位。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
Rectangle — 位於 atomIndex 之 Atom 的邊界。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomCenter

()方法 
public function getAtomCenter(atomIndex:int):Number

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得 Atom 的中央 (沿著指定之索引處的基線測量所得)。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
Number — 位於 atomIndex 之 Atom 的中央。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomGraphic

()方法 
public function getAtomGraphic(atomIndex:int):DisplayObject

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得位於指定索引處之 Atom 的圖像,如果 Atom 為一個字元則為 null

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
DisplayObject — 位於 atomIndex 之 Atom 的圖像。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomIndexAtCharIndex

()方法 
public function getAtomIndexAtCharIndex(charIndex:int):int

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

傳回包含 charIndex 參數指定之字元的 Atom 索引,如果該字元並不會造成此行上的任何 Atom 則為 -1。charIndex 相對於包含此行之文字區塊的整個內容。

參數

charIndex:int — 字元的索引值 (從零開始,例如,第一個字元是 0,第二個字元是 1,依此類推)。

傳回值
int — 包含位於 charIndex 之字元的 Atom 索引。如果該字元並不會造成此行上的任何 Atom,則會傳回 -1。

擲回值
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomIndexAtPoint

()方法 
public function getAtomIndexAtPoint(stageX:Number, stageY:Number):int

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

傳回 xy 參數指定之點上的 Atom 索引,如果該點沒有 Atom 則為 -1。

此方法會採用全域座標,以便輕易地搭配 MouseEvent.stageXMouseEvent.stageY 屬性一起使用。

參數

stageX:Number — 要測試之點的全域 x 座標。
 
stageY:Number — 要測試之點的全域 y 座標。

傳回值
int — 此點底下之 Atom 的索引。如果該點不在任何 Atom 上方,則會傳回 -1。

擲回值
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomTextBlockBeginIndex

()方法 
public function getAtomTextBlockBeginIndex(atomIndex:int):int

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得位於指定索引處之 Atom 的文字區塊開始索引。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
int — 位於 atomIndex 之 Atom 的文字區塊開始索引。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomTextBlockEndIndex

()方法 
public function getAtomTextBlockEndIndex(atomIndex:int):int

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得位於指定索引處之 Atom 的文字區塊結束索引。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
int — 位於 atomIndex 之 Atom 的文字區塊結尾索引。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getAtomTextRotation

()方法 
public function getAtomTextRotation(atomIndex:int):String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得位於指定索引處之 Atom 的旋轉。這個屬性會用到 TextRotation 常數。Atom 的旋轉是元素和文字行的累積旋轉。它的主要用途在於與 TextLine 互動時設定跳脫字元 (游標) 的方向。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
String — 位於 atomIndex 之 Atom 的旋轉。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

相關 API 元素

getAtomWordBoundaryOnLeft

()方法 
public function getAtomWordBoundaryOnLeft(atomIndex:int):Boolean

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指出文字界限是否會出現在指定索引處的 Atom 左側。單字界限會依據字元的 Unicode 屬性 (這些字元構成字行) 來決定。

參數

atomIndex:int — Atom 的索引值 (從零開始,例如,第一個 Atom 是 0,第二個 Atom 是 1,依此類推)。

傳回值
Boolean — Boolean 值,指出文字界限是否會出現在 atomIndex 處的 Atom 左側。

擲回值
RangeError — 指定的 Atom 索引超出範圍。
 
IllegalOperationError — 此行的 validityTextLineValidity.STATIC

getBaselinePosition

()方法 
public function getBaselinePosition(baseline:String):Number

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

取得相對於 TextBlock.baselineZero 的指定基線位置。

參數

baseline:String — 要據此擷取位置的基線。使用 TextBaseline 值。

傳回值
Number — 指定基線的位置 (相對於 TextBlock.baselineZero)。

擲回值
ArgumentError — 如果指定的 baseline 不是 TextBaseline 的成員。

相關 API 元素

getMirrorRegion

()方法 
public function getMirrorRegion(mirror:EventDispatcher):flash.text.engine:TextLineMirrorRegion

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

傳回此行的第一個 TextLineMirrorRegion,它的 mirror 屬性符合 mirror 參數指定的屬性,如果不相符則為 null

即使是單一 TextElement 也可以在一行或多行上產生多個 TextLineMirrorRegion 物件 (取決於雙向層級和斷行)。nextRegionpreviousRegion 屬性會連結從一個文字元素所產生的所有鏡像區域。

參數

mirror:EventDispatcher — 要搜尋的 EventDispatcher mirror 物件。

傳回值
flash.text.engine:TextLineMirrorRegion — 此行的第一個 TextLineMirrorRegion,它的 mirror 屬性符合指定的值,如果不相符則為 null

相關 API 元素

常數詳細資訊

MAX_LINE_WIDTH

常數
public static const MAX_LINE_WIDTH:int = 1000000

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

文字行的最大要求寬度 (以像素為單位)。如果您未指定值,TextBlock.createTextLine() 方法會使用此常數做為 width 參數的預設值。

相關 API 元素

TextLineExample.as

此範例顯示不同的文字行,並進入文字區塊的 Atom 中 (透過 getAtomBounds() 來為每個 Atom 加上影格)。
  1. 將 NumericStepper 組件加入元件庫。
  2. 將此程式碼另存為 TextLineExample.as,並與 FLA 放在同一個目錄中。
  3. 在 FLA 的「屬性」視窗中,將「類別」設定為 TextLineExample。
package {
    import flash.display.Sprite;
    import flash.text.engine.TextBlock;
    import flash.text.engine.TextElement;
    import flash.text.engine.TextLine;
    import flash.text.engine.ElementFormat;
    import flash.text.engine.FontDescription;
    import flash.text.engine.FontPosture;
    import flash.text.engine.FontWeight;
    import fl.controls.NumericStepper;
    import flash.events.Event;
    import flash.geom.Rectangle;
    
    public class TextLineExample extends Sprite {
        
        private var atomStepper:NumericStepper = new NumericStepper();
        private var atomDataContainer:Sprite;
        private var fontDescriptionItalic:FontDescription = new FontDescription("Arial", FontWeight.NORMAL, FontPosture.ITALIC);
        private var fontDescriptionNormal:FontDescription = new FontDescription("Arial", FontWeight.NORMAL , FontPosture.NORMAL);
        private var textBlock:TextBlock = new TextBlock();
        private var textLine:TextLine;
        
        public function TextLineExample():void {
            
            var myText:String = "I am a TextElement, created from a String and assigned " +
            "to the content property of a TextBlock. From the text block, " +
            "the createTextLine() method created these lines, 300 pixels wide, "  +
            "for display." ;
            
            atomStepper.minimum = 0;
            atomStepper.value = 0;
            atomStepper.width = 50;
            addChild(atomStepper);
            atomStepper.x = 20;
            atomStepper.y = 120;
            atomStepper.addEventListener(Event.CHANGE, nsChange);
            
            var directions:String = "Click up / down arrows to frame atoms in text block above.";
            
            var formatItalic:ElementFormat = new ElementFormat(fontDescriptionItalic);
            formatItalic.fontSize = 12;
            var textElement1:TextElement = new TextElement(directions, formatItalic);
            textBlock.content = textElement1;
            createLines(textBlock, 15, 160, 400, this);
            
            var formatNormal:ElementFormat = new ElementFormat(fontDescriptionNormal);
            formatNormal.fontSize = 16;
            var textElement2:TextElement = new TextElement(myText, formatNormal);
            textBlock.content = textElement2;
            createLines(textBlock, 15.0, 20.0, 300, this);
            textLine = textBlock.firstLine;
            atomStepper.maximum = textLine.atomCount - 1;
            showAtom(textLine, 0);
        }
            
        private function nsChange(event:Event):void
        {
            removeAtom(textLine);
            if (atomStepper.value == textLine.atomCount - 1)
            {
                if(textLine != textBlock.lastLine)
                {
                    textLine = textLine.nextLine;
                    atomStepper.maximum = textLine.atomCount - 1;
                    atomStepper.value = 0;
                }
            }
            showAtom(textLine, atomStepper.value);
        }
            
        private function createLines(textBlock, startX, startY, width, container)
        {
            var textLine:TextLine = textBlock.createTextLine (null, width);
            while (textLine)
            {
                textLine.x = startX;
                textLine.y = startY;
                startY += textLine.height + 2;
                container.addChild(textLine);
                textLine = textBlock.createTextLine (textLine, width);
            }
        }
            
        private function showAtom(textLine, i):void
        {
            var box:Sprite = new Sprite();
            var mcGraphics = box.graphics;
            var bounds:Rectangle = textLine.getAtomBounds(i);
            mcGraphics.lineStyle(1, 0xFF0000, 1.0);
            mcGraphics.drawRect(bounds.left, bounds.top, bounds.width, bounds.height);
            textLine.userData = textLine.addChild(box);
            displayAtomData(textLine,i);
        }
            
        private function displayAtomData(textLine, i)
        {
            if(atomDataContainer != null)
                removeChild(atomDataContainer);
            atomDataContainer=new Sprite();
            var format = new ElementFormat(fontDescriptionNormal);
            format.color = 0x00000FF;
            var n:int = 0;
            var nxtY:Number = 0;
            var atomInfo:String = "value of getAtomBidiLevel() is: " + textLine.getAtomBidiLevel(i)+"\n"
            +"value of getAtomCenter() is: " + textLine.getAtomCenter(i)+"\n"
            +"value of getAtomIndexAtCharIndex() is: " + textLine.getAtomIndexAtCharIndex(i)+"\n"
            +"value of getAtomTextBlockBeginIndex() is: " + textLine.getAtomTextBlockBeginIndex(i)+"\n"
            +"value of getAtomTextBlockEndIndex() is: " + textLine.getAtomTextBlockEndIndex(i)+"\n"
            +"value of getAtomTextRotation() is: " + textLine.getAtomTextRotation(i)+"\n";
            var atomtextBlock:TextBlock = new TextBlock();
            var textElement3:TextElement = new TextElement(atomInfo, format);
            atomtextBlock.content = textElement3;
            createLines(atomtextBlock,20,200,500, atomDataContainer)
            addChild(atomDataContainer);
        }
            
        private function removeAtom(textLine):void
        {
            textLine.removeChild(textLine.userData);
        }
    }    
}




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。