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 

TextBlock  - 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 タグ
使用されなくなったエレメントのリスト
Accessibility Implementation 定数
ActionScript の例の使用方法
法律上の注意
パッケージflash.text.engine
クラスpublic final class TextBlock
継承TextBlock Inheritance Object

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock クラスは、表示リストに配置して表示できる TextLine オブジェクトを作成するためのファクトリです。

Unicode 双方向アルゴリズムおよび改行アルゴリズムは一度に 1 つの段落に対して実行されるので、TextBlock クラスは単一の段落が含まれることを想定しています。複数の段落でテキストを構成するアプリケーションは、テキストを段落に分割し、段落ごとに 1 つの TextBlock を作成するために、マークアップ言語またはテキスト解析を使用します。

TextBlock オブジェクトは、ContentElement クラスのインスタンスである content プロパティにそのコンテンツを格納します。ContentElement クラスのインスタンスを作成することはできないため、content をそのサブクラスである TextElement、GraphicElement または GroupElement のいずれかのインスタンスに設定します。純粋なテキストコンテンツには TextElement、イメージコンテンツまたはグラフィックコンテンツには GraphicElement、TextElement オブジェクト、GraphicElement オブジェクトおよびその他の GroupElement オブジェクトの組み合わせを含むコンテンツには GroupElement を使用します。フォーマットされたテキスト範囲、埋め込みのサブテキストおよびグラフィックエレメントの管理について詳しくは、ContentElement クラスおよびそのサブクラスを参照してください。

TextBlock インスタンスを作成して content プロパティを設定した後、createTextLine() メソッドを呼び出して TextLine クラスのインスタンスのテキスト行を作成します。

例を表示

関連する API エレメント



パブリックプロパティ
 プロパティ定義元
  applyNonLinearFontScaling : Boolean
WYSIWYG 印刷の再現性を犠牲にして、画面の外観を強調するように指定します。
TextBlock
  baselineFontDescription : FontDescription
行の内容には関係なく、ブロックから作成されたすべての行に対するベースラインを特定するために使用されるフォントです。
TextBlock
  baselineFontSize : Number
ブロックから作成された行に対するベースラインを計算するのに使用されるフォントサイズです。
TextBlock
  baselineZero : String
このブロックから作成した行に対して y=0 であるベースラインを指定します。
TextBlock
  bidiLevel : int
テキストブロックの双方向段落の埋め込みレベルを指定します。
TextBlock
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
  content : ContentElement
テキストブロックの内容を保持します。
TextBlock
  firstInvalidLine : flash.text.engine:TextLine
[読み取り専用] TextLine.validity と TextLineValidity.VALID が等しくないテキストブロックで最初の行を指定します。
TextBlock
  firstLine : flash.text.engine:TextLine
[読み取り専用] TextBlock 内の最初の TextLine(存在する場合)です。
TextBlock
  lastLine : flash.text.engine:TextLine
[読み取り専用] TextBlock 内の最後の TextLine(存在する場合)です。
TextBlock
  lineRotation : String
テキストブロックのテキスト行を単位として回転します。
TextBlock
  tabStops : Vector.<flash.text.engine:TabStop>
テキストブロック内のテキストのタブストップを TabStop オブジェクトの Vector の形式で指定します。
TextBlock
  textJustifier : flash.text.engine:TextJustifier
行の作成時に使用する TextJustifier を指定します。
TextBlock
  textLineCreationResult : String
[読み取り専用] createTextLine() 操作の結果を示します。
TextBlock
  userData : *
アプリケーションが任意のデータをテキストブロックに関連付けるための方法を提供します。
TextBlock
パブリックメソッド
 メソッド定義元
  
TextBlock(content:ContentElement = null, tabStops:Vector.<flash.text.engine:TabStop> = null, textJustifier:flash.text.engine:TextJustifier = null, lineRotation:String = "rotate0", baselineZero:String = "roman", bidiLevel:int = 0, applyNonLinearFontScaling:Boolean = true, baselineFontDescription:FontDescription = null, baselineFontSize:Number = 12.0)
TextBlock オブジェクトを作成します。
TextBlock
  
createTextLine(previousLine:flash.text.engine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):flash.text.engine:TextLine
テキストブロックの内容からテキスト行を作成し、その場合に previousLine パラメーターで指定されたポイントで開始し、width パラメーターで指定されたポイントで改行するように指示します。
TextBlock
  
TextBlock の基になるコンテンツを XML ストリングとしてダンプします。
TextBlock
  
findNextAtomBoundary(afterCharIndex:int):int
指定された文字インデックスの次のアトム境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。
TextBlock
  
findNextWordBoundary(afterCharIndex:int):int
指定された文字インデックスの次の単語境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。
TextBlock
  
指定された文字インデックスの前のアトム境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。
TextBlock
  
指定された文字インデックスの前の単語境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。
TextBlock
  
charIndex パラメーターで指定された位置の文字を含む TextLine を返します。
TextBlock
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
  
recreateTextLine(textLine:flash.text.engine:TextLine, previousLine:flash.text.engine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):flash.text.engine:TextLine
既存のテキスト行を再利用するテキストブロックの内容からテキスト行を作成します。その際、previousLine パラメーターで指定されたポイントで開始し、width パラメーターで指定されたポイントで改行するように指示します。
TextBlock
  
テキストブロックに、テキスト行の作成に関連する一時ファイルのデータをすべて解放するように指示します。
TextBlock
  
TextBlock によって維持される行のリストから、テキスト行の範囲を削除します。
TextBlock
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
プロパティの詳細

applyNonLinearFontScaling

プロパティ
applyNonLinearFontScaling:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

WYSIWYG 印刷の再現性を犠牲にして、画面の外観を強調するように指定します。デバイスによるフォントのレンダリング中のサブピクセル文字配置をサポートしていないが、非直線的な拡大 / 縮小をサポートしているプラットフォームとフォントでは、このプロパティを true に設定することで、特に小さいポイントサイズで WYSIWYG 出力を犠牲にして、これらのメトリックを使用できます。非直線的な拡大 / 縮小は、個々の文字の幅を選択的に拡大 / 縮小することでピクセルの吸着で発生する見苦しい隙間を隠します。

サブピクセル文字配置をサポートしているプラットフォームでは、このフラグは無視されます。

このフラグは、埋め込みフォントのレンダリングには影響しません。

デフォルト値は true です。



実装
    public function get applyNonLinearFontScaling():Boolean
    public function set applyNonLinearFontScaling(value:Boolean):void

baselineFontDescription

プロパティ 
baselineFontDescription:FontDescription

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

行の内容には関係なく、ブロックから作成されたすべての行に対するベースラインを特定するために使用されるフォントです。ベースラインは、フォントおよびフォントサイズによって異なります。

デフォルト値は null です。ベースラインフォントが null の場合、ベースラインフォントのサイズは無視され、いずれの行に対するベースラインも、行内の最大のテキストのフォントおよびサイズによって決まります。baselineFontDescription および baselineFontSize の両方を指定すると、それらの内容に関係なく、テキストブロックのすべての行に対するベースラインを決定します。この組み合わせは、文字体裁で最も役立ちます。



実装
    public function get baselineFontDescription():FontDescription
    public function set baselineFontDescription(value:FontDescription):void

関連する API エレメント

baselineFontSize

プロパティ 
baselineFontSize:Number

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

ブロックから作成された行に対するベースラインを計算するのに使用されるフォントサイズです。ベースラインは、フォントおよびフォントサイズによって異なります。

デフォルト値は 12 です。ベースラインフォントが null の場合、ベースラインフォントのサイズは無視され、いずれの行に対するベースラインも、行内の最大のテキストのフォントおよびサイズによって決まります。



実装
    public function get baselineFontSize():Number
    public function set baselineFontSize(value:Number):void

例外
ArgumentError — 指定された baselineFontSize が、0 未満です。

関連する API エレメント

baselineZero

プロパティ 
baselineZero:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

このブロックから作成した行に対して y=0 であるベースラインを指定します。このプロパティの有効な値は、TextBaseline クラスのメンバー内に含まれます。

デフォルト値は、TextBaseline.ROMAN です。

このプロパティの値を設定するには、次のストリング値を使用します。

ストリング値説明
TextBaseline.ROMAN行の欧文ベースラインが y=0 になります。
TextBaseline.ASCENT行のアセントのベースラインが y=0 になります。
TextBaseline.DESCENT行のディセントのベースラインが y=0 になります。
TextBaseline.IDEOGRAPHIC_TOP行の文字最上部のベースラインが y=0 になります。
TextBaseline.IDEOGRAPHIC_CENTER行の文字の中心のベースラインが y=0 になります。
TextBaseline.IDEOGRAPHIC_BOTTOM行の文字最下部のベースラインが y=0 になります。



実装
    public function get baselineZero():String
    public function set baselineZero(value:String):void

例外
ArgumentError TextBaseline のメンバーではないいずれかの値に設定する場合。

関連する API エレメント

bidiLevel

プロパティ 
bidiLevel:int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

テキストブロックの双方向段落の埋め込みレベルを指定します。通常、LTR 段落(英語、日本語など)の場合は 0 を、RTL 段落(アラビア語、ヘブライ語など)の場合は 1 を使用します。0 と 1 以外の値は、特殊な場合のために予約されています。詳しくは、UAX#9『Unicode Bidirectional Algorithm』(http://www.unicode.org/reports/tr9/)を参照してください。

デフォルト値は 0 です。

bidiLevel を変更すると、すべての前の改行の有効性が TextLineValidity.INVALID に変わります。bidiLevel の変更後、firstInvalidLine プロパティは firstLine プロパティに等しくなるため、TextBlock のすべての行を再度改行する必要があります。



実装
    public function get bidiLevel():int
    public function set bidiLevel(value:int):void

例外
ArgumentError — 0 未満の値に設定する場合。

関連する API エレメント


例  ( この例の使用方法 )
この例は、まず bidiLevel even、次に bidiLevel odd でレンダリングされた同じテキストストリング(論理的順序:a、b、c、alef、bet、gimel)を示します。
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;
    
    public class TextBlock_bidiLevelExample extends Sprite {
        
        public function TextBlock_bidiLevelExample():void {             
            var fontSize:Number = 36;

            var format:ElementFormat = new ElementFormat();        
            format.fontDescription = new FontDescription("Adobe Hebrew");
            format.fontSize = fontSize;
            var y:Number = 0;
            var leading:Number = fontSize * 0.2;
            var text:String = "abc" + String.fromCharCode(0x05D0, 0x05D1, 0x05D2);

            var textBlock:TextBlock = new TextBlock();
            textBlock.content = new TextElement(text, format);
                        
            // bidiLevel even
            textBlock.bidiLevel = 0;
            var textLine = textBlock.createTextLine(null, 400);
            y += leading + textLine.ascent;
            textLine.y = y;
            y += textLine.descent;
            addChild(textLine);      
            
            // bidiLevel odd
            textBlock.content = new TextElement(text, format);
            textBlock.bidiLevel = 1;
            textLine = textBlock.createTextLine(null, 400);
            y += leading + textLine.ascent;          
            textLine.y = y;
            addChild(textLine);   
        }
    }
}

content

プロパティ 
content:ContentElement

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

テキストブロックの内容を保持します。ContentElement は、基本クラスであるため、content を ContentElement サブクラスのインスタンスである、TextElement、GraphicElement または GroupElement に割り当てます。TextElement オブジェクトは String、GraphicElement オブジェクトは DisplayObject、GroupElement は、1 つ以上の TextElement、GraphicElement またはその他の GroupElement オブジェクトを含む Vector オブジェクトをそれぞれ含みます。均一なテキストの段落には TextElement、グラフィックには GraphicElement、テキストエレメントとグラフィックエレメントの組み合わせ、またはこれらのエレメントの複数のインスタンスには GroupElement をその他の GroupElement オブジェクトと共に使用します。

デフォルト値は null です。

content プロパティを変更すると、以前作成されたすべての行の有効性が TextLineValidity.INVALID に変わります。content の変更後、firstInvalidLine プロパティは firstLine プロパティに等しくなるため、TextBlock のすべての行を再度改行する必要があります。



実装
    public function get content():ContentElement
    public function set content(value:ContentElement):void

例外
ArgumentError ContentElement の既知のサブクラスではない値に設定する場合。
 
ArgumentError — 指定された value は、既にグループのメンバーです。

関連する API エレメント

firstInvalidLine

プロパティ 
firstInvalidLine:flash.text.engine:TextLine  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextLine.validityTextLineValidity.VALID が等しくないテキストブロックで最初の行を指定します。

デフォルト値は null です。



実装
    public function get firstInvalidLine():flash.text.engine:TextLine

関連する API エレメント

firstLine

プロパティ 
firstLine:flash.text.engine:TextLine  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock 内の最初の TextLine(存在する場合)です。

デフォルト値は null です。



実装
    public function get firstLine():flash.text.engine:TextLine

関連する API エレメント

lastLine

プロパティ 
lastLine:flash.text.engine:TextLine  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock 内の最後の TextLine(存在する場合)です。

デフォルト値は null です。



実装
    public function get lastLine():flash.text.engine:TextLine

関連する API エレメント

lineRotation

プロパティ 
lineRotation:String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

テキストブロックのテキスト行を単位として回転します。有効にするには createTextLine() メソッドは lineRotation を設定してから呼び出します。デフォルト値は、TextRotation.ROTATE_0 です。

文字の最終的な回転は、ElementFormat.textRotationContentElement.textRotation および TextBlock.lineRotation の値によって異なります。

TextBlock.lineRotation は一般に、日中韓のテキストで使用されます。縦書きの日本語テキストの段落を作成するには、次の処理を行います。

  1. TextBlock.lineRotation プロパティを TextRotation.ROTATE_90 に設定します。
  2. コンテンツの ElementFormat.textRotation プロパティをデフォルトの TextRotation.AUTO のままにしておきます。

このプロパティの値を設定するには、TextRotation クラスで定義される次の定数を使用します。

ストリング値説明
TextRotation.ROTATE_0行は回転しません。
TextRotation.ROTATE_90行は時計回りに 90 度回転します。
TextRotation.ROTATE_180行は 180 度回転します。
TextRotation.ROTATE_270行は時計回りに 270 度回転します。
TextRotation.AUTOサポートされません。



実装
    public function get lineRotation():String
    public function set lineRotation(value:String):void

例外
ArgumentError TextRotation のメンバーではないいずれかの値に設定する場合。
 
ArgumentError TextRotation.AUTO に設定する場合。

関連する API エレメント


例  ( この例の使用方法 )
この例では、TextBlock に日本語テキストを追加し、lineRotation() プロパティを TextRotation.ROTATE_90 に設定して、行を垂直に表示します。
package {
    import flash.display.Sprite;
    import flash.text.engine.FontDescription;
    import flash.text.engine.TextBlock;
    import flash.text.engine.TextElement;
    import flash.text.engine.TextLine;
    import flash.text.engine.TextRotation;
    import flash.text.engine.ElementFormat;
    
    public class TextBlock_lineRotationExample extends Sprite {
        
        public function TextBlock_lineRotationExample():void {
            var Japanese:String = String.fromCharCode(
                0x5185, 0x95A3, 0x5E9C, 0x304C, 0x300C, 0x653F, 0x5E9C, 0x30A4,
                0x30F3, 0x30BF, 0x30FC, 0x30CD, 0x30C3, 0x30C8, 0x30C6, 0x30EC, 
                0x30D3, 0x300D, 0x306E, 0x52D5, 0x753B, 0x914D, 0x4FE1, 0x5411, 
                0x3051, 0x306B, 0x30A2, 0x30C9, 0x30D3, 0x30B7, 0x30B9, 0x30C6, 
                0x30E0, 0x30BA, 0x793E, 0x306E
            ) +
            "FMS 2" +
            String.fromCharCode(0x3092, 0x63A1, 0x7528, 0x3059, 0x308B, 0x3068, 
                0x767a, 0x8868, 0x3057, 0x307e, 0x3057, 0x305F, 0x3002);

            var fontDescription:FontDescription = new FontDescription("MS Mincho");
            var format:ElementFormat = new ElementFormat();
            format.fontSize = 15;
            format.fontDescription = fontDescription;
                        
            var textElement:TextElement = new TextElement(Japanese, format); 
            var textBlock:TextBlock = new TextBlock();
            textBlock.content = textElement;
            textBlock.lineRotation = TextRotation.ROTATE_90;

            var linePosition:Number = this.stage.stageWidth - 120;
            var previousLine:TextLine = null;
        
            while (true) {
                var textLine:TextLine = textBlock.createTextLine(
                    previousLine, 
                    300);
                if (textLine == null) 
                    break;
                textLine.y = 30;    
                textLine.x = linePosition;
                linePosition -= 24;
                addChild(textLine);                
                previousLine = textLine;
            }        
        }
    }
}

tabStops

プロパティ 
tabStops:Vector.<flash.text.engine:TabStop>

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

テキストブロック内のテキストのタブストップを TabStop オブジェクトの Vector の形式で指定します。

デフォルト値は null です。これは、タブストップが指定されていないことを意味します。タブストップが指定されていない場合(または最後に指定されたタブストップを挿入ポイントが超えている場合)、ランタイムはデフォルトで 1/2 インチのタブを作成します。

tabStops プロパティが設定されているときは、TextBlock によって内部使用のために Vector のコピーが作成されます。元の Vector またはそのコンテンツを変更しても TextBlock には影響しません。tabStops プロパティを照会すると、内部 Vector のコピーが返されます。この返された Vector またはそのコンテンツを変更しても TextBlock には影響しません。



実装
    public function get tabStops():Vector.<flash.text.engine:TabStop>
    public function set tabStops(value:Vector.<flash.text.engine:TabStop>):void

例外
ArgumentError — 指定された tabStopsnull エレメントが含まれています。
 
ArgumentError — 指定された tabStops は、位置が大きくなる順にソートされません。

関連する API エレメント

textJustifier

プロパティ 
textJustifier:flash.text.engine:TextJustifier

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

行の作成時に使用する TextJustifier を指定します。

デフォルト値は、作成されるデフォルトの TextJustifier オブジェクトです。

textJustifier プロパティが設定されているときは、TextBlock によって内部使用のためにオブジェクトのコピーが作成されます。元のオブジェクトを変更しても TextBlock には影響しません。textJustifier プロパティを照会すると、内部オブジェクトのコピーが返されます。この返されたオブジェクトを変更しても TextBlock には影響しません。



実装
    public function get textJustifier():flash.text.engine:TextJustifier
    public function set textJustifier(value:flash.text.engine:TextJustifier):void

例外
ArgumentError TextJustifier の既知のサブクラスではない値に設定する場合。

関連する API エレメント

textLineCreationResult

プロパティ 
textLineCreationResult:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

createTextLine() 操作の結果を示します。ブロックの内容が変更されると、以前に改行された行が無効化され、このプロパティが null にリセットされます。

デフォルト値は null です。

このプロパティの値は、TextLineCreationResult 内に含まれます。

ストリング値説明
TextLineCreationResult.SUCCESS行が正常に改行されました。
TextLineCreationResult.COMPLETE作成された新しい行が継続行に完全に揃っており、POSSIBLY_INVALID から VALID に変更されたかまたはブロック内のすべてのテキストが既に改行されていたので、行は作成されませんでした。
TextLineCreationResult.INSUFFICIENT_WIDTHテキストが指定された幅に収まらないので、行は作成されませんでした。



実装
    public function get textLineCreationResult():String

関連する API エレメント

userData

プロパティ 
public var userData:*

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

アプリケーションが任意のデータをテキストブロックに関連付けるための方法を提供します。データは改訂日付や作者名などのコンテンツを指す情報の場合もあれば、処理中に使用するキャッシュされたデータの場合もあります。

コンストラクターの詳細

TextBlock

()コンストラクター
public function TextBlock(content:ContentElement = null, tabStops:Vector.<flash.text.engine:TabStop> = null, textJustifier:flash.text.engine:TextJustifier = null, lineRotation:String = "rotate0", baselineZero:String = "roman", bidiLevel:int = 0, applyNonLinearFontScaling:Boolean = true, baselineFontDescription:FontDescription = null, baselineFontSize:Number = 12.0)

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock オブジェクトを作成します。

パラメーター
content:ContentElement (default = null) — テキストブロックの内容です。
 
tabStops:Vector.<flash.text.engine:TabStop> (default = null) — テキストブロック内のテキストのタブストップです。
 
textJustifier:flash.text.engine:TextJustifier (default = null) — このブロックの行作成時に使用される TextJustifier オブジェクトです。均等配置を指定しない場合は、英語ロケールに基づいてデフォルトの均等配置が作成されます。
 
lineRotation:String (default = "rotate0") — テキストブロックを単位として生成されるテキスト行に適用する回転です。
 
baselineZero:String (default = "roman") — ブロック内のすべての行に対して y=0 であるベースラインを指定します。
 
bidiLevel:int (default = 0) — テキストブロック内のテキストのデフォルトの双方向埋め込みレベルです。
 
applyNonLinearFontScaling:Boolean (default = true) — WYSIWYG 印刷の再現性を犠牲にして、画面の外観を強調するように指定します。
 
baselineFontDescription:FontDescription (default = null) — ブロック内のすべての行に対して、行のベースラインの派生元にするフォントの説明を指定します。
 
baselineFontSize:Number (default = 12.0) — baselineFontDescription に使用するサイズを指定します。このパラメーターは、baselineFontDescriptionnull の場合は無視されます。

例外
ArgumentError — 指定された content は、ContentElement の既知のサブクラスではありません。
 
ArgumentError — 指定された content は、既にグループのメンバーです。
 
ArgumentError — 指定された lineRotation は、TextRotation のメンバーではありません。
 
ArgumentError — 指定された baselineZero は、TextBaseline のメンバーではありません。
 
ArgumentError — 指定された bidiLevel は、0 未満です。
 
ArgumentError — 指定された tabStopsnull エレメントが含まれています。
 
ArgumentError — 指定された tabStops は、位置が大きくなる順にソートされません。
 
ArgumentError — 指定された baselineFontSize が、0 未満です。

関連する API エレメント

メソッドの詳細

createTextLine

()メソッド
public function createTextLine(previousLine:flash.text.engine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):flash.text.engine:TextLine

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

テキストブロックの内容からテキスト行を作成し、その場合に previousLine パラメーターで指定されたポイントで開始し、width パラメーターで指定されたポイントで改行するように指示します。テキスト行は TextLine オブジェクトで表され、表示リストに追加できます。

既に改行されているテキストブロックの範囲を越えて行を改行すると、改行が発生する領域の内外で行の有効性が変更されることがあります。行のステータスが、VALID から INVALID または POSSIBLY_INVALID に変更されることがあります。新しく改行された行が、ステータスが POSSIBLY_INVALID の前回改行された行に完全に揃っている場合、前回改行された行およびそれ以降のすべての POSSIBLY_INVALID の行のステータスが VALID に戻ります。TextLineValidity のメンバーではない値に設定された行の有効性は、VALID には変更されませんが、INVALID には変更されることがあります。テキストブロックに対する変更の後は、再改行するテキスト行を開始または継続する位置を firstInvalidLine プロパティで確認します。

テキストに Unicode Zero Width Space(ZWSP)文字を含めることによって、人為的な単語分割を作成できます。これは、正しく改行するために辞書が必要になるタイ語などの言語の場合に便利です。Flash ランタイムは、このような辞書を含んでいません。

メモリのオーバーヘッドを削減する方法として、目的の行がすべて作成済みの場合、親のフレームのリサイズなどでその度に再改行が必要になることがない限り、ユーザーは releaseLineCreationData() メソッドを呼び出して、改行に関連する一時データからテキストブロックを解放することができます。

パラメーター

previousLine:flash.text.engine:TextLine (default = null) — 直前に改行された行を指定します。この行の次から改行処理を開始します。1 行目を改行する場合は null を指定します。
 
width:Number (default = 1000000) — 線幅をピクセル単位で指定します。実際の幅はより小さくなることがあります。
 
lineOffset:Number (default = 0.0) — 行の起点とタブストップの起点の差をピクセルで指定するオプションのパラメーターです。行揃えしていないが、タブを整列させる必要がある場合に使用できます。このパラメーターのデフォルト値は 0.0 です。
 
fitSomething:Boolean (default = false) — 指定された幅には関係なく(例外がスローされる場合もある幅が 0 または負の場合でも)、1 文字以上をテキスト行に収めるように Flash Player に指示するオプションのパラメーターです。

戻り値
flash.text.engine:TextLine — テキスト行。テキストブロックが空か、指定された幅が次のエレメントの幅より小さい場合は null。これらのいずれの場合かを識別するには、テキストブロックの textLineCreationResult プロパティをチェックします。

例外
ArgumentError previousLine で指定された TextLine が有効でない場合。
 
ArgumentError previousLine で指定された TextLine が別の TextBlock に所有されている場合。
 
ArgumentError width が 0 未満の場合(fitSomething が true の場合を除く)。
 
ArgumentError widthTextLine.MAX_LINE_WIDTH より大きい場合。
 
IllegalOperationError — テキストブロックの 1 つ以上のエレメントに null ElementFormat がある場合。

関連する API エレメント


例  ( この例の使用方法 )

この例では、createTextLine() メソッドを呼び出して、テキストブロック内にテキスト行を作成します。以下の手順を実行して行います。
  • String から TextElement を作成し、フォントサイズ 20 を設定します。
  • TextBlock を作成し、このオブジェクトに TextElement を割り当てます。
  • createTextLine() を呼び出して、テキストブロックから 300 ピクセルの幅を持つ行を作成します。
  • 各行を Stage(addChild())に配置し、その位置(x および y)を設定します。
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;
    
    public class TextBlock_createTextLineExample extends Sprite {
        
        public function TextBlock_createTextLineExample():void {
            
            var str:String = "I am a TextElement, created from a String and assigned " +
            "to the content property of a TextBlock. The createTextLine() method " +
            "then created these lines, 300 pixels wide, for display." ;
            
            var fontDescription:FontDescription = new FontDescription("Arial");
            var format:ElementFormat = new ElementFormat(fontDescription);
            format.fontSize = 16;
            var textElement:TextElement = new TextElement(str, format); 
            var textBlock:TextBlock = new TextBlock();
            textBlock.content = textElement; 
            createLines(textBlock); 
        }
        
        private function createLines(textBlock:TextBlock):void 
        {            
            var lineWidth:Number = 300;
            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);
            }
        }
    }
}

dump

()メソッド 
public function dump():String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5

TextBlock の基になるコンテンツを XML ストリングとしてダンプします。これにはテキスト、書式およびレイアウト情報が含まれており、自動化されたテストで役立ちます。

次に出力について説明します。

	 >block<
	 	[0-N LINE]
	 >/block<
	 

各行の出力の説明については、TextLine.dump() メソッドを参照してください。

注意:コンテンツおよび出力のフォーマットは、今後変更される可能性があります。アドビ システムズ社は、このメソッドの後方互換性は保証しません。

戻り値
String

関連する API エレメント

findNextAtomBoundary

()メソッド 
public function findNextAtomBoundary(afterCharIndex:int):int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

指定された文字インデックスの次のアトム境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。アトム境界間の文字は結合されて、「e」と結合されるアキュートアクセントのように、TextLine で 1 つのアトムを形成します。

パラメーター

afterCharIndex:int — 次のアトム境界の検索を開始する文字のインデックスを指定します。

戻り値
int — 指定された文字インデックスの次のアトム境界のインデックスです。

例外
RangeError — 指定された index は範囲外です。
 
IllegalOperationError — このインデックス位置の文字が含まれる TextLine は無効です。

関連する API エレメント

findNextWordBoundary

()メソッド 
public function findNextWordBoundary(afterCharIndex:int):int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

指定された文字インデックスの次の単語境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。単語境界は、文字の Unicode プロパティに基づいて決定されます。

パラメーター

afterCharIndex:int — 次の単語境界の検索を開始する文字のインデックスを指定します。

戻り値
int — 指定された文字インデックスの次の単語境界のインデックスです。

例外
RangeError — 指定された index は範囲外です。
 
IllegalOperationError — このインデックス位置の文字が含まれる TextLine は無効です。

findPreviousAtomBoundary

()メソッド 
public function findPreviousAtomBoundary(beforeCharIndex:int):int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

指定された文字インデックスの前のアトム境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。アトム境界間の文字は結合されて、「e」と結合されるアキュートアクセントのように、TextLine で 1 つのアトムを形成します。

パラメーター

beforeCharIndex:int — 前のアトム境界の検索を開始する文字のインデックスを指定します。

戻り値
int — 指定された文字インデックスの前のアトム境界のインデックスです。

例外
RangeError — 指定された index は範囲外です。
 
IllegalOperationError — このインデックス位置の文字が含まれる TextLine は無効です。

関連する API エレメント

findPreviousWordBoundary

()メソッド 
public function findPreviousWordBoundary(beforeCharIndex:int):int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

指定された文字インデックスの前の単語境界のインデックスを検索します。指定されたインデックス位置の文字は含めません。単語境界は、文字の Unicode プロパティに基づいて決定されます。

パラメーター

beforeCharIndex:int — 前の単語境界の検索を開始する文字のインデックスを指定します。

戻り値
int — 指定された文字インデックスの前の単語境界のインデックスです。

例外
RangeError — 指定された index は範囲外です。
 
IllegalOperationError — このインデックス位置の文字が含まれる TextLine は無効です。

getTextLineAtCharIndex

()メソッド 
public function getTextLineAtCharIndex(charIndex:int):flash.text.engine:TextLine

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

charIndex パラメーターで指定された位置の文字を含む TextLine を返します。

パラメーター

charIndex:int — 文字の 0 から始まるインデックス値です。つまり、最初の文字は 0、2 番目の文字は 1 で、以下同様に続きます。

戻り値
flash.text.engine:TextLinecharIndex で指定された位置の文字を含む TextLine です。

例外
RangeError — 指定された文字インデックスは範囲外です。

recreateTextLine

()メソッド 
public function recreateTextLine(textLine:flash.text.engine:TextLine, previousLine:flash.text.engine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):flash.text.engine:TextLine

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2, Flash Lite 4

既存のテキスト行を再利用するテキストブロックの内容からテキスト行を作成します。その際、previousLine パラメーターで指定されたポイントで開始し、width パラメーターで指定されたポイントで改行するように指示します。テキスト行は TextLine オブジェクトで表され、表示リストに追加できます。既存のテキスト行を再利用すると、作成されるオブジェクトの数が少なくなるので、パフォーマンスが向上します。

再作成される textLine は、どのテキストブロック内にあっても解放されます。さらに、DisplayObjectContainerInteractiveObject および DisplayObject から継承されたプロパティを含むすべてのプロパティは、デフォルト値にリセットされます。最後に、グラフィック要素およびその他の装飾を含む行のすべての子は削除され、その行に対するすべてのイベントリスナーも削除されます。パフォーマンスを向上させるために、このような全体的なリセットでは唯一例外的に、行自体は親から削除されません。

既に改行されているテキストブロックの範囲を越えて行を改行すると、改行が発生する領域の内外で行の有効性が変更されることがあります。行のステータスが、VALID から INVALID または POSSIBLY_INVALID に変更されることがあります。新しく改行された行が、ステータスが POSSIBLY_INVALID の前回改行された行に完全に揃っている場合、前回改行された行およびそれ以降のすべての POSSIBLY_INVALID の行のステータスが VALID に戻ります。TextLineValidity のメンバーではない値に設定された行の有効性は、VALID には変更されませんが、INVALID には変更されることがあります。テキストブロックに対する変更の後は、再改行するテキスト行を開始または継続する位置を firstInvalidLine プロパティで確認します。

テキストに Unicode Zero Width Space(ZWSP)文字を含めることによって、人為的な単語分割を作成できます。これは、正しく改行するために辞書が必要になるタイ語などの言語の場合に便利です。Flash ランタイムは、このような辞書を含んでいません。

メモリのオーバーヘッドを削減する方法として、目的の行がすべて作成済みの場合、親のフレームのリサイズなどでその度に再改行が必要になることがない限り、ユーザーは releaseLineCreationData() メソッドを呼び出して、改行に関連する一時データからテキストブロックを解放することができます。

パラメーター

textLine:flash.text.engine:TextLine — 前に作成された TextLine を再利用するよう指定します。
 
previousLine:flash.text.engine:TextLine (default = null) — 直前に改行された行を指定します。この行の次から改行処理を開始します。1 行目を改行する場合は null を指定します。
 
width:Number (default = 1000000) — 線幅をピクセル単位で指定します。実際の幅はより小さくなることがあります。
 
lineOffset:Number (default = 0.0) — 行の起点とタブストップの起点の差をピクセルで指定するオプションのパラメーターです。行揃えしていないが、タブを整列させる必要がある場合に使用できます。このパラメーターのデフォルト値は 0.0 です。
 
fitSomething:Boolean (default = false) — 指定された幅には関係なく(例外がスローされる場合もある幅が 0 または負の場合でも)、1 文字以上をテキスト行に収めるように Flash Player に指示するオプションのパラメーターです。

戻り値
flash.text.engine:TextLine — テキスト行。テキストブロックが空か、指定された幅が次のエレメントの幅より小さい場合は null。これらのいずれの場合かを識別するには、テキストブロックの textLineCreationResult プロパティをチェックします。

例外
ArgumentError textLine が null の場合。
 
ArgumentError previousLine で指定された TextLine が有効でない場合。
 
ArgumentError previousLine で指定された TextLine が別の TextBlock に所有されている場合。
 
ArgumentError previousLine で指定された TextLine が textLine でも指定されている場合。
 
ArgumentError width が 0 未満の場合(fitSomething が true の場合を除く)。
 
ArgumentError widthTextLine.MAX_LINE_WIDTH より大きい場合。
 
IllegalOperationError — テキストブロックの 1 つ以上のエレメントに null ElementFormat がある場合。

関連する API エレメント


例  ( この例の使用方法 )

この例では、textLine という TextLine オブジェクトを再利用します。
var elementFormat:ElementFormat = new ElementFormat();
elementFormat.fontDescription = new FontDescription("Arial");
elementFormat.fontSize = 48;

var textElement:TextElement = new TextElement("Text you'll never see", elementFormat)
var textBlock:TextBlock = new TextBlock(textElement);
var textLine:TextLine = textBlock.createTextLine();
textLine.x = 50;
textLine.y = 50;
addChild(textLine);

// Reuse the element format to preserve the text formatting
var elementTwo:TextElement = new TextElement("Text you see", elementFormat);  
textBlock.content = elementTwo;
textBlock.recreateTextLine(textLine);

// Set the position (and any other display object properties like alpha, children, etc.)
// otherwise, they're all set to default properties.
textLine.x = 50;  
textLine.y = 50;

releaseLineCreationData

()メソッド 
public function releaseLineCreationData():void

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2, Flash Lite 4

テキストブロックに、テキスト行の作成に関連する一時ファイルのデータをすべて解放するように指示します。アプリケーションのメモリ使用率をできるだけ低く抑えるには、テキストブロックからテキスト行を作成するときに releaseLineCreationData() メソッドを呼び出します。 ただし、(例えば、親のフレームのリサイズなどで発生する)再改行のパフォーマンスをできるだけ高くするには、releaseLineCreationData() メソッドは呼び出さないようにします。メモリとパフォーマンスとのバランスはアプリケーションによって異なります。

内容が確定し、更新されることがないテキストの場合、推奨される処理は、テキストブロックを初期化し、目的の出力が得られるまで繰り返し createTextLine() メソッドを呼び出した後、 releaseLineCreationData() メソッドを呼び出します。

関連する API エレメント

releaseLines

()メソッド 
public function releaseLines(firstLine:flash.text.engine:TextLine, lastLine:flash.text.engine:TextLine):void

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10, AIR 1.5, Flash Lite 4

TextBlock によって維持される行のリストから、テキスト行の範囲を削除します。これにより、他の参照が存在しない場合、行がガベージコレクションされます。

削除された行の textBlocknextLine および previousLine メンバーを null に設定します。TextBlock の削除された行および削除された行の後のすべての行の validityTextLineValidity.INVALID に設定します。

パラメーター

firstLine:flash.text.engine:TextLine — リリースされる最初の行を指定します。
 
lastLine:flash.text.engine:TextLine — リリースされる最後の行を指定します。


例外
ArgumentError firstLine または lastLine によって指定される TextLine が、テキストブロックによって維持されるテキスト行のリストにない場合。

関連する API エレメント

TextBlockExample.as

この例は、日本語および英語テキスト中の 3 つの TextBlock 段落です。日本語テキストは、Unicode 文字コードから String に変換されます。ボタンをクリックすると、テキストが水平から垂直へ、または垂直から水平へと回転します。
package { 
    import fl.controls.Button;
     import flash.text.engine.TextBlock;
    import flash.text.engine.TextLine;
    import flash.text.engine.TextElement;
    import flash.text.engine.ElementFormat;
    import flash.text.engine.TextRotation;
    import flash.text.engine.TextBaseline;
    import flash.text.engine.LineJustification;
    import flash.text.engine.FontDescription;
    import flash.text.engine.EastAsianJustifier; 
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.display.Stage;
    import flash.events.MouseEvent;
    import flash.system.Capabilities;
    
    public class TextBlockExample extends Sprite {
        
        var vertical:Boolean;    
        var container:Sprite;
        var textBlocks:Vector.<TextBlock>;
        var loader:Loader = new Loader();
        var directionButton:Button = new Button();
        
        public function TextBlockExample():void {
            addChild(directionButton);
            directionButton.width = 30;
            directionButton.move(50, 350);
            directionButton.addEventListener(MouseEvent.CLICK, clickHandler);
            createContent();
            createLines();
        }

        private function createEmptyBlock():TextBlock {
        
            var textBlock:TextBlock = new TextBlock();
            textBlock.baselineZero = TextBaseline.IDEOGRAPHIC_CENTER;
            textBlock.textJustifier = new EastAsianJustifier("ja", LineJustification.ALL_BUT_LAST);
            textBlock.lineRotation = vertical? TextRotation.ROTATE_90: TextRotation.ROTATE_0;
            return textBlock;    
        }
        
        private function paragraph1(format:ElementFormat):TextBlock {
        
            var textBlock:TextBlock = createEmptyBlock();
            textBlock.content = new TextElement(
            String.fromCharCode(
                0x5185, 0x95A3, 0x5E9C, 0x304C, 0x300C, 0x653F, 0x5E9C, 0x30A4,
                0x30F3, 0x30BF, 0x30FC, 0x30CD, 0x30C3, 0x30C8, 0x30C6, 0x30EC, 
                0x30D3, 0x300D, 0x306E, 0x52D5, 0x753B, 0x914D, 0x4FE1, 0x5411, 
                0x3051, 0x306B, 0x30A2, 0x30C9, 0x30D3, 0x30B7, 0x30B9, 0x30C6, 
                0x30E0, 0x30BA, 0x793E, 0x306E
            ) +
            "FMS 2" +
            String.fromCharCode(0x3092, 0x63A1, 0x7528, 0x3059, 0x308B, 0x3068, 
                0x767a, 0x8868, 0x3057, 0x307e, 0x3057, 0x305F, 0x3002), format);
            return textBlock;
        }

        private function paragraph2(format:ElementFormat):TextBlock {
            
            var textBlock:TextBlock = createEmptyBlock();
            textBlock.content = new TextElement(
            String.fromCharCode(
                0x30AF, 0x30ED, 0x30B9, 0x30D7, 0x30E9, 0x30C3, 0x30C8, 0x30D5, 
                0x30A9, 0x30FC, 0x30E0, 0x4E0A, 0x3067, 0x518D, 0x751F, 0x53EF, 
                0x80FD, 0x306A
            ) + 
            "Flash Video" +
            String.fromCharCode(
                0x3092, 0x914D, 0x4FE1, 0x3001, 0x653F, 0x5E9C, 0x6700, 0x65B0, 
                0x60C5, 0x5831, 0x3092, 0x3088, 0x308A, 0x591A, 0x304F, 0x306E, 
                0x56FD, 0x6C11, 0x306B, 0x9AD8, 0x54C1, 0x8CEA, 0x306A, 0x753B, 
                0x50CF, 0x3067, 0x7C21, 0x5358, 0x304B, 0x3064, 0x30EA, 0x30A2, 
                0x30EB, 0x30BF, 0x30A4, 0x30E0, 0x306B, 0x63D0, 0x4F9B, 0x3059, 
                0x308B, 0x3053, 0x3068, 0x304C, 0x53EF, 0x80FD, 0x306B, 0x306A, 
                0x308A, 0x307e, 0x3057, 0x305F, 0x3002), format);
            return textBlock;    
        }

        private function paragraph3(format:ElementFormat):TextBlock {
            
            var textBlock:TextBlock = createEmptyBlock();
            textBlock.content = new TextElement(
            String.fromCharCode(0x3010) +
            "2007" +
            String.fromCharCode(0x5E74) + "2" + String.fromCharCode(0x6708) +
            "21" +
            String.fromCharCode(0x65E5, 0x3011),
            format);
            return textBlock;    
        }

        private function createContent():void {
            
            var font:FontDescription = new FontDescription();
            if (Capabilities.os.search("Mac OS") > -1) 
                font.fontName = String.fromCharCode(0x5C0F, 0x585A, 0x660E, 0x671D) + " Pro R"; // "Kozuka Mincho Pro R"                    koFont.fontName = "Adobe " + String.fromCharCode(0xBA85, 0xC870) + " Std M"; // "Adobe Myungjo Std M"
            else 
                font.fontName = "Kozuka Mincho Pro R";        
            var format:ElementFormat = new ElementFormat();
            format.fontDescription = font;
            format.fontSize = 12;
            format.locale = "ja";
            format.color = 0x000000;
            if (!vertical) 
                format.textRotation = TextRotation.ROTATE_0; 
            textBlocks = new Vector.<TextBlock>();
            textBlocks.push(
                paragraph1(format),
                paragraph2(format),
                paragraph3(format)//,
            );
        }

        private function createLines():void {    
        
            if (container != null) {
                removeChild(container);
            }            
            container = new Sprite();
            container.y = 45;
            container.x = 40;
            addChild(container);
            var linePosition:Number = vertical? this.stage.stageWidth - 120: 12;
        
            for (var i:uint = 0; i < textBlocks.length; i++) {
                var textBlock:TextBlock = textBlocks[i];
                var previousLine:TextLine = null;
        
                while (true) {
                    var textLine:TextLine = textBlock.createTextLine(
                        previousLine, 
                        300);
                    if (textLine == null) 
                        break;
                    if (vertical) 
                    {
                        textLine.x = linePosition;
                        linePosition -= 24;
                        directionButton.label = " -- ";
                    }
                    else 
                    {
                        textLine.y = linePosition+50;
                        linePosition += 24;
                        directionButton.label = " | ";
                    }
                    container.addChild(textLine);                
                    previousLine = textLine;
                }
                if (vertical) 
                    linePosition -= 16;
                else 
                    linePosition += 16; 
            }
        }

        private function clickHandler(event:MouseEvent):void {
            
            vertical = !vertical;
            createContent();
            createLines();
        }
    }
}




[ X ]英語で表示される理由
ActionScript 3.0 リファレンスガイドのコンテンツが英語で表示されます。

ActionScript 3.0 リファレンスガイドのすべての部分がすべての言語に翻訳されているわけではありません。言語エレメントが翻訳されていない場合、そのエレメントは英語で表示されます。例えば、ga.controls.HelpBox クラスはどの言語にも訳されていません。このため、リファレンスガイドの日本語バージョンでは、ga.controls.HelpBox クラスは英語で表示されます。