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

String  - 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 範例
法律聲明

類別 x

AAAARecord    
AbandonCommand
ABRUtils
AbstractConsumer
AbstractEntityMetadata
AbstractEvent
AbstractInvoker
AbstractMessage
AbstractOperation
AbstractOperation
AbstractParticipant
AbstractProducer
AbstractSearchFilterVO
AbstractService
AbstractServiceWrapper
AbstractStage
AbstractTarget
AbstractWebService
AccConst
Accelerometer
AccelerometerEvent
Accessibility
AccessibilityImplementation
AccessibilityProperties
AccessibleButton
AccessibleText
AccessPrivileges
AccImpl
AccImpl
Accordion
AccordionAutomationImpl
AccordionHeader
AccordionHeaderAccImpl
AccordionHeaderSkin
AccordionHeaderSkin
AccordionHeaderSkin
AccordionNav
AccordionSkin
AcknowledgeMessage
ACMRelationshipManager
ActionBar
ActionBar    
ActionBarButtonSkinBase
ActionBarDefaultButtonAppearance    
ActionBarSkin    
ActionEffectInstance
ActionRenderer
ActionScriptVersion
ActionSelectedEvent
ActivationBrowser
ActivatorSkin
ActiveContentEvent
ActiveDataEvent
ActivityEvent
ActualBitrateMetric
AddAction
AddActionInstance
AddApprovalStageParticipant
AddAssetPopUp
AddChild
AddChildAction
AddChildActionInstance
AddCreatorDialog
AddItemAction
AddItemActionInstance
AddItems
AddPanelButton
AddPanelEvent
AddRemoveEffectTargetFilter
AddReviewStageParticipant
AddServiceEvent
AddStageParticipant
AddTileEvent
AddViewEvent
AddViewManagerEvent
AdjustColor
AdvanceDataElementsPanel
AdvancedChannelSet
AdvancedDataGrid
AdvancedDataGridAccImpl
AdvancedDataGridAutomationImpl
AdvancedDataGridBase
AdvancedDataGridBaseEx
AdvancedDataGridBaseExAutomationImpl
AdvancedDataGridBaseSelectionData
AdvancedDataGridColumn
AdvancedDataGridColumnGroup
AdvancedDataGridDragProxy
AdvancedDataGridEvent
AdvancedDataGridEventReason
AdvancedDataGridGroupItemRenderer
AdvancedDataGridGroupItemRendererAutomationImpl
AdvancedDataGridHeaderHorizontalSeparator
AdvancedDataGridHeaderInfo
AdvancedDataGridHeaderRenderer
AdvancedDataGridHeaderShiftEvent
AdvancedDataGridItemRenderer
AdvancedDataGridItemRendererAutomationImpl
AdvancedDataGridItemSelectEvent
AdvancedDataGridListData
AdvancedDataGridRendererDescription
AdvancedDataGridRendererProvider
AdvancedDataGridSortItemRenderer
AdvancedListBase
AdvancedListBaseAutomationImpl
AdvancedListBaseContentHolderAutomationImpl
AdvancedSearchPod
AdvancedStyleClient
AfterUpSwitchBufferBandwidthRule
AggregatingToken
AggregatingTokenError
AirDragManagerAutomationHandler
AIREvent    
AirFunctionsHelper
Alert
AlertAccImpl
AlertAutomationImpl
AlertFormatter
AlertFormAutomationImpl
AlignmentArea
AllRuntimeSparkControls
AlternativeAudioEvent
AlternativeAudioTrait
AMFChannel
AndOperator
Animate
AnimateColor
AnimateColorInstance
AnimateFilter
AnimateFilterInstance
AnimateInstance
AnimateProperty
AnimatePropertyInstance
AnimateTransform
AnimateTransform3D
AnimateTransformInstance
AnimateTransitionShader
AnimateTransitionShaderInstance
Animation
Animator
Animator3D
AnimatorBase
AnimatorFactory
AnimatorFactory3D
AnimatorFactoryBase
AnimatorFactoryUniversal
AnimatorUniversal
AnnotationParseEvent
AntiAliasType
Application
Application
Application
ApplicationAutomationImpl
ApplicationBackground
ApplicationConstants
ApplicationControlBar
ApplicationDomain
ApplicationDomainTarget
ApplicationListItem
ApplicationSkin
ApplicationSkin
ApplicationSpecifier
ApplicationTitleBarBackgroundSkin    
ApplicationUpdater    
ApplicationUpdaterUI    
ApplyElementIDOperation
ApplyElementStyleNameOperation
ApplyElementTypeNameOperation
ApplyElementUserStyleOperation
ApplyFormatOperation
ApplyFormatToElementOperation
ApplyLinkOperation
ApplyTCYOperation
ApprovalStage
ApprovalStage
Approver
Approver
ApproverCollection
ApproverStatus
ApproverStatus
ApproverVO
AreaChart
AreaRenderer
AreaSeries
AreaSeriesAutomationImpl
AreaSeriesItem
AreaSeriesRenderData
AreaSet
ARecord    
ArgumentError
arguments
Array
ArrayCollection
ArrayList
ArrayUtil
ArrowDirection    
Asset
AssetAction
AssetAction
AssetActionCompleteEvent
AssetActionCompleteEvent
AssetActionEvent
AssetActionEvent
AssetActionsChangeEvent
AssetDetailsPod
AssetEvent
AssetExplorerServiceDelegate
AssetFocusEvent
AssetHandlerRegistry
AssetHandlerRegistry
AssetManager
AssetManager
AssetManagerView
AssetModel
AssetPod
AssetPropertiesEditor
AssetPropertyDescriptor
AssetPropertyDescriptor
AssetQueryServiceDelegate
AssetReviewPod
AssetTypeDescriptor
AssetTypeDescriptor
AssetValidationEvent
AssetValidationFaultType
AssetVersionPod
AssetVO
Assignment
AssignmentConstants
AsyncErrorEvent
AsyncListView
AsyncMessage
AsyncRequest
AsyncResponder
AsyncToken
AsyncTokenResponder
AsyncTokenWrapper
Attachment
AttachmentCommand
AttachmentEvent
AttachmentHeader
AttachmentHeaderBase
AttachmentHeaderModel
AttachmentIconRenderer
AttachmentIconRendererSkin
AttachmentInfo
AttachmentList
AttachmentList
AttachmentListComponent
AttachmentListModel
AttachmentListSkin
AttachmentLoader
AttachmentPermissions
Attachments
AttachmentsModel
Attribute
AudioDecoder
AudioDeviceManager
AudioElement
AudioEvent
AudioOutputChangeEvent
AudioOutputChangeReason
AudioPlaybackMode    
AudioTrait
AuditActionVO
AuditAttributeVO
AuditLevel
AuditLevel
AuditLevelVO
AuditManager
AuditMetaInfoVO
AuditModuleVO
Auditor
AugmentedError
AugmentedErrorEvent
AuthenticatingApplication
AuthenticationEvent
AuthenticationMethod
AuthFailureCode
AuthOptions
Author
AuthorStatus
AuthorVO
AuthResult
AuthStatus
AutoCapitalize    
AutoLayoutEvent
Automation
AutomationAirEvent
AutomationClass
AutomationDragEvent
AutomationDragEventWithPositionInfo
AutomationError
AutomationEvent
AutomationEventDescriptor
AutomationFlexNativeMenuEvent
AutomationHelper
AutomationID
AutomationIDPart
AutomationManager
AutomationMethodDescriptor
AutomationPropertyDescriptor
AutomationRecordEvent
AutomationReplayEvent
AvailablePropertyIterator
AvailableQualityLevelsMetric
AVDictionaryDataEvent
AverageAggregator
AVHTTPStatusEvent
AVLoader
AVM1Movie
AVNetworkingParams
AVPauseAtPeriodEndEvent
AVTagData
AVURLLoader
AVURLStream
AxisBase
AxisLabel
AxisLabelSet
AxisRenderer
AxisRendererAutomationImpl
AXMAccordion
AXMAccordionItemVO
AXMAccordionSegment
AXMBreadCrumb
AXMButton
AXMButtonBar
AXMButtonBarButton
AXMCheckBox
AXMComboBox
AXMDropDownList
AXMDropDownListBase
AXMEnterpriseAccordionSegmentSkin
AXMEnterpriseAccordionSkin
AXMEnterpriseAssetTabBar
AXMEnterpriseAssetTabBarButtonSkin
AXMEnterpriseAssetTabBarSkin
AXMEnterpriseAssetViewTabBar
AXMEnterpriseAssetViewTabBarButtonSkin
AXMEnterpriseAssetViewTabBarSkin
AXMEnterpriseBreadCrumbButtonSkin
AXMEnterpriseBreadCrumbFocusSkin
AXMEnterpriseBreadCrumbSkin
AXMEnterpriseButtonBarFirstButtonSkin
AXMEnterpriseButtonBarLastButtonSkin
AXMEnterpriseButtonBarMiddleButtonSkin
AXMEnterpriseButtonBarSkin
AXMEnterpriseButtonSkin
AXMEnterpriseCheckboxSkin
AXMEnterpriseCheckboxSmallSkin
AXMEnterpriseClosableTabBarButtonSkin
AXMEnterpriseClosableTabBarSkin
AXMEnterpriseCloseButtonSkin
AXMEnterpriseComboBoxButtonSkin
AXMEnterpriseComboBoxSkin
AXMEnterpriseComboBoxTextInputSkin
AXMEnterpriseDropDownListButtonSkin
AXMEnterpriseDropDownListItemRenderer
AXMEnterpriseDropDownListSkin
AXMEnterpriseFocusSkin
AXMEnterpriseFooterSkin
AXMEnterpriseGridHeaderRenderer
AXMEnterpriseGridSkin
AXMEnterpriseHeaderBarSkin
AXMEnterpriseHeaderButtonBar
AXMEnterpriseHScrollBarLargeSkin
AXMEnterpriseHScrollbarNoControlsSkin
AXMEnterpriseHScrollbarSkin
AXMEnterpriseHScrollbarThumbSkin
AXMEnterpriseHScrollbarTrackNoControlsSkin
AXMEnterpriseHScrollbarTrackSkin
AXMEnterpriseIconButtonSkin
AXMEnterpriseLargeButtonSkin
AXMEnterpriseLargeToggleButtonSkin
AXMEnterpriseNavigationButtonBarSkin
AXMEnterpriseNumericStepperDecrementButtonSkin
AXMEnterpriseNumericStepperIncrementButtonSkin
AXMEnterpriseNumericStepperSkin
AXMEnterpriseNumericStepperTextInputSkin
AXMEnterprisePanelSkin
AXMEnterpriseProgressSpinnerSkin
AXMEnterpriseQuietButtonSkin
AXMEnterpriseQuietHeaderBarButton
AXMEnterpriseQuietLargeButtonSkin
AXMEnterpriseQuietLargeDropDownListButtonSkin
AXMEnterpriseRadioButtonSkin
AXMEnterpriseResizeHandleSkin
AXMEnterpriseScrollDownArrowSkin
AXMEnterpriseScrollLeftArrowSkin
AXMEnterpriseScrollRightArrowSkin
AXMEnterpriseScrollUpArrowSkin
AXMEnterpriseSlideToggleButton
AXMEnterpriseSplitActionButtonSkin
AXMEnterpriseSplitActionPopUpButtonSkin
AXMEnterpriseSplitActionSkin
AXMEnterpriseTabBarButtonSkin
AXMEnterpriseTabBarSkin
AXMEnterpriseTextAreaSkin
AXMEnterpriseTextInputSkin
AXMEnterpriseTitleWindowSkin
AXMEnterpriseToggleButtonSkin
AXMEnterpriseToolBarBottomSkin
AXMEnterpriseToolBarButtonBarFirstButtonSkin
AXMEnterpriseToolBarButtonBarLastButtonSkin
AXMEnterpriseToolBarButtonBarMiddleButtonSkin
AXMEnterpriseToolbarButtonBarSkin
AXMEnterpriseToolBarTopSkin
AXMEnterpriseViewModeButtonBarButtonSkin
AXMEnterpriseViewModeButtonBarSkin
AXMEnterpriseVScrollbarNoControlsSkin
AXMEnterpriseVScrollbarSkin
AXMEnterpriseVScrollbarThumbSkin
AXMEnterpriseVScrollbarTrackNoControlsSkin
AXMEnterpriseVScrollbarTrackSkin
AXMHeaderBar
AXMHScrollBar
AXMLightItemRenderer
AXMList
AXMPopUp
AXMProgressBar
AXMProgressSpinner
AXMResizableContainer
AXMRichTextEditor
AXMRichTextEditorControlBar
AXMScroller
AXMSplitActionButton
AXMSwitch
AXMTabBar
AXMTabBarButton
AXMTitleWindow
AXMToggleButton
AXMToolPopUp
AXMToolPopUpDropDownController
AXMVerticalDivider
AXMVScrollBar
套件最上層
類別public final class String
繼承String Inheritance Object

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

String 類別是代表字元字串的資料類型。String 類別可提供方法和屬性,讓您操作基本的字串值類型。您可以使用 String() 函數,將任何物件的值轉換成 String 資料類型物件。

由於所有字串索引都是從零開始計算的,因此任何 x 字串的最後一個字元索引都是 x.length - 1

不論是使用建構函式方法 new String() 建立新的字串變數,或是直接指定字串常值,您都可以呼叫 String 類別的任何方法。不同於先前版本的 ActionScript,不論您是使用建構函式、全域函數或是直接指派字串常值,都不會有任何差別。下列幾行程式碼是相等的:

 var str:String = new String("foo");
 var str:String = "foo";
 var str:String = String("foo");

當字串變數設定為 undefined 時,Flash 執行階段會強制將 undefined 轉型為 null。因此,陳述式:

 var s:String = undefined;
會將值設定為 null 而非 undefined。如果您需要使用 undefined,請使用 String() 函數。

檢視範例

相關 API 元素



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  length : int
[唯讀] 指定的 String 物件中用來指定字元數目的整數。
String
公用方法
 方法定義自
  
會建立初始化為指定之字串的新 String 物件。
String
  
charAt(index:Number = 0):String
傳回位於 index 參數所指定之位置的字元。
String
  
傳回位於指定 index 之字元的數字 Unicode 字元碼。
String
  
會將所提供的引數附加至 String 物件的結尾,在必要時將這些引數轉換成字串,並傳回產生的字串。
String
  
[靜態] 會傳回參數中 Unicode 字元碼代表之字元所組成的字串。
String
 Inherited
指出物件是否有已定義的指定屬性。
Object
  
indexOf(val:String, startIndex:Number = 0):int
搜尋字串,並傳回在呼叫字串內 startIndex 或之後找到之第一個 val 的位置。
String
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
  
lastIndexOf(val:String, startIndex:Number = 0x7FFFFFFF):int
由右至左搜尋字串,並傳回在 startIndex 之前找到,最後出現之 val 的索引。
String
  
localeCompare(other:String, ... values):int
會比較兩個或更多字串的排序順序,並以整數形式傳回比較的結果。
String
  
match(pattern:*):Array
根據字串比對指定的 pattern。
String
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
  
replace(pattern:*, repl:Object):String
根據該字串比對指定的 pattern,並傳回新的字串,其中第一個符合的 pattern 會被 repl 指定的內容取代。
String
  
search(pattern:*):int
搜尋指定的 pattern,並傳回第一個相符子字串的索引。
String
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
  
slice(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String
傳回字串,其中包含 startIndex 字元以及直到 endIndex 字元 (但不包括該字元) 的所有字元。
String
  
split(delimiter:*, limit:Number = 0x7fffffff):Array
在所指定 delimiter 參數出現的位置進行分割,將 String 物件分成子字串的陣列。
String
  
substr(startIndex:Number = 0, len:Number = 0x7fffffff):String
傳回子字串,由從指定之 startIndex 開始並具有 len 指定之長度的字元組成。
String
  
substring(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String
傳回字串,由 startIndex 所指定的字元,以及直到 endIndex -1 的所有字元組成。
String
  
會傳回此字串的副本,其中所有大寫字元都會轉換成小寫字元。
String
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
  
會傳回此字串的副本,其中所有小寫字元都會轉換成大寫字元。
String
  
會傳回此字串的副本,其中所有大寫字元都會轉換成小寫字元。
String
 Inherited
會傳回指定之物件的字串形式。
Object
  
會傳回此字串的副本,其中所有小寫字元都會轉換成大寫字元。
String
  
會傳回 String 實體的基本值。
String
屬性詳細資訊

length

屬性
length:int  [唯讀]

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

指定的 String 物件中用來指定字元數目的整數。

由於所有字串索引都是從零開始計算的,因此任何 x 字串的最後一個字元索引都是 x.length - 1



實作
    public function get length():int
建構函式詳細資料

String

()建構函式
public function String(val:String)

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會建立初始化為指定之字串的新 String 物件。

注意:因為字串常值使用的額外資源比 String 物件少,而且通常比較容易使用,所以除非您有很好的理由要使用 String 物件而非字串常值,否則應該使用字串常值而非 String 類別。

參數
val:String — 新 String 物件的初始值。
方法詳細資訊

charAt

()方法
AS3 function charAt(index:Number = 0):String

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會傳回位於 index 參數所指定之位置中的字元。如果 index 不是介於 0 和 string.length - 1 之間的數字,便會傳回空字串。

除了傳回的值是字元而非 16 位元整數字元碼以外,這個方法和 String.charCodeAt() 非常類似。

參數

index:Number (default = 0) — 整數,指定字串中某個字元的位置。第一個字元會由 0 指出,而最後一個字元則由 my_str.length - 1 指出。

傳回值
String — 位於指定之 index 的字元。或者,如果指定的索引在此字串索引的範圍以外,便會傳回空字串。

相關 API 元素

charCodeAt

()方法 
AS3 function charCodeAt(index:Number = 0):Number

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會傳回位於指定 index 之字元的數字 Unicode 字元碼。如果 index 不是介於 0 和 string.length - 1 之間的數字,便會傳回 NaN

除了傳回的值是 16 位元整數字元碼而非實際字元以外,這個方法與 String.charAt() 非常類似。

參數

index:Number (default = 0) — 整數,指定字串中某個字元的位置。第一個字元會由 0, 指出,而最後一個字元則由 my_str.length - 1 指出。

傳回值
Number — 位於指定 index 之字元的 Unicode 字元碼。或者,如果該索引在此字串的索引範圍之外,則為 NaN

Unicode 值定義於 Unicode Character Database 規格中。

相關 API 元素

concat

()方法 
AS3 function concat(... args):String

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會將所提供的引數附加至 String 物件的結尾,在必要時將這些引數轉換成字串,並傳回產生的字串。來源 String 物件的原始值會維持不變。

參數

... args — 零或多個要連接的值。

傳回值
String — 新的字串,由這個字串與指定之參數連接組成。

fromCharCode

()方法 
AS3 static function fromCharCode(... charCodes):String

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會傳回參數中 Unicode 字元碼代表之字元所組成的字串。

參數

... charCodes — 代表 Unicode 值的十進位整數系列。

Unicode 值定義於 Unicode Character Database 規格中。

傳回值
String — 指定之 Unicode 字元碼的字串值。

indexOf

()方法 
AS3 function indexOf(val:String, startIndex:Number = 0):int

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

搜尋字串,並傳回在呼叫字串中 startIndex 處或之後找到 val 第一次出現的位置。這個索引是從零開始,表示字串的第一個字串會視為位於索引 0 而非索引 1。如果找不到 val,此方法會傳回 -1。

參數

val:String — 要搜尋的子字串。
 
startIndex:Number (default = 0) — 選擇性整數,指定搜尋的開始索引。

傳回值
int — 指定之子字串第一次出現的索引或 -1

相關 API 元素

lastIndexOf

()方法 
AS3 function lastIndexOf(val:String, startIndex:Number = 0x7FFFFFFF):int

執行階段版本: Flash Player 9, AIR 1.0, Flash Lite 4

會由右至左搜尋字串,並傳回在 startIndex 之前找到,最後出現之 val 的索引。索引會從零開始,表示第一個字元會在索引 0,而最後一個字元則會在 string.length - 1。如果找不到 val,此方法會傳回 -1

參數

val:String — 要搜尋的字串。
 
startIndex:Number (default = 0x7FFFFFFF) — 選擇性的整數,指定要搜尋 val 的開始索引。預設值是索引可允許的最大值。如果沒有指定 startIndex,搜尋便會從字串中的最後一個項目開始。

傳回值
int — 指定之子字串最後出現的位置,若找不到則為 -1。

相關 API 元素

localeCompare

()方法 
AS3 function localeCompare(other:String, ... values):int

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會比較兩個或更多字串的排序順序,並以整數形式傳回比較的結果。當此方法要以地區特定的方式處理比較作業時,ActionScript 3.0 實作並不會產生不同於其他字串比較的結果,例如相等 (==) 或不相等 (!=) 運算子。如果這些字串都相等,傳回值就是 0。如果原始字串值在 other 指定的字串值之前,傳回值便會是負整數,而其絕對值則代表分隔兩個字串值的字元數。如果原始字串值在 other 之後,傳回值便會是正整數,而其絕對值則代表分隔兩個字串值的字元數。

參數

other:String — 要加以比較的字串值。
 
... values — 要加以比較的更多選擇性字串組。

傳回值
int — 如果字串都相等,則值為 0。否則,如果原始字串優先於字串引數,便會是負整數;如果字串引數優先於原始字串,則會是正整數。在這兩種情況下,數字的絕對值都代表兩個字串之間的差異。

match

()方法 
AS3 function match(pattern:*):Array

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會比對指定的 pattern 與字串。

參數

pattern:* — 要加以比對的樣式,可以是任何類型的物件,不過通常會是字串或規則運算式。如果 pattern 不是規則運算式或字串,此方法便會在執行前先將它轉換成字串。

傳回值
Array — 字串陣列,它是由字串中符合指定之 pattern 的所有子字串所組成。

如果 pattern 是規則運算式,則為了傳回具有一個以上相符子字串的陣列,就必須在規則運算式中設定 g (全域) 旗標:

  • 如果「沒有」設定 g (全域) 旗標,傳回的陣列便不會包含一個以上的符合項目,而且規則運算式的 lastIndex 屬性會維持不變。
  • 如果「有」設定 g (全域) 旗標,此法便會從字串的開頭 (索引位置 0) 開始搜尋。如果符合的子字串是空字串 (可能會在類似 /x*/ 的規則運算式發生),此方法便會將該空字串加入符合項目的陣列中,然後繼續在下一個索引位置搜尋。在此方法完成之後,規則運算式的 lastIndex 屬性便會設定為 0。

pattern 參數是已設定 g (全域) 旗標的規則運算式時,如果找不到相符項目,此方法便會傳回空陣列。如果 pattern 參數是字串或非全域的規則運算式,並且找不到相符項目,此方法便會傳回 null。如果您沒有傳遞任何值 (或是傳遞未定義的值) 做為 pattern 參數,此方法便會傳回 null

相關 API 元素

replace

()方法 
AS3 function replace(pattern:*, repl:Object):String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會針對指定的 pattern 與字串進行比對,並傳回新的字串,其中第一個符合的 pattern 會被 repl 指定的內容所取代。pattern 參數可以是字串或規則運算式。repl 參數可以是字串或函數;如果是函數,便會插入此函數傳回的字串來取代符合項目, 而原始的字串並不會遭到修改。

在下列範例中,只會取代 "sh" (區分大小寫) 的第一個實體:

    var myPattern:RegExp = /sh/;  
    var str:String = "She sells seashells by the seashore.";
    trace(str.replace(myPattern, "sch"));  
       // She sells seaschells by the seashore.

在下列範例中,由於在規則運算式中有設定 g (全域) 旗標,所以 "sh" (區分大小寫) 的所有實體都會遭到取代:

    var myPattern:RegExp = /sh/g;  
    var str:String = "She sells seashells by the seashore.";
    trace(str.replace(myPattern, "sch"));  
       // She sells seaschells by the seaschore.

在下列範例中,由於在規則運算式中有設定 g (全域) 旗標,所以 "sh" 的所有實體都會遭到取代;而且因為有設定 i (忽略大小寫) 旗標,所以相符項目便「不會」區分大小寫:

    var myPattern:RegExp = /sh/gi;  
    var str:String = "She sells seashells by the seashore.";
    trace(str.replace(myPattern, "sch"));  
       // sche sells seaschells by the seaschore.

參數

pattern:* — 要加以比對的樣式,它可以是任何類型的物件,不過通常會是字串或規則運算式。如果您指定的 pattern 參數是字串或規則運算式以外的任何物件,toString() 方法便會套用至參數,並且 replace() 方法會使用產生的字串做為 pattern 來執行。
 
repl:Object — 通常,這會是插入符合內容之位置的字串。不過,您也可以指定函數做為此參數。如果您指定函數,此函數傳回的字串便會插入符合內容的位置。

當您指定字串做為 repl 參數,並指定規則運算式做為 pattern 參數時,即可使用 repl 字串中的特殊「$ 取代程式碼」,如下所示:

$ 程式碼 取代文字
$$ $
$& 符合的子字串。
$` 符合之子字串前面的字串部分。請注意,此程式碼會使用一般左側單引號字元 (`),而非一般單引號字元 (') 或左側智慧單引號字元 (‘)。
$' 符合之子字串後面的字串部分。請注意,這個取代碼會使用一般單引號字元 (')。
$ n n 個捕捉到的括號群組相符項目,其中 n 是 1 到 9 的單一位數,而且 $ n 的後面沒有小數位數。
$ nn nn 個捕捉到的括號群組相符項目,其中 nn 是兩位數的十進位數字 (01 到 99)。如果第 nn 個捕捉未定義,取代文字便會是空字串。

例如,以下會說明 $2$1 取代程式碼的用法,這些程式碼代表捕捉到的第一個與第二個相符群組:

var str:String = "flip-flop";
    var pattern:RegExp = /(\w+)-(\w+)/g;
    trace(str.replace(pattern, "$2-$1")); // flop-flip

當您指定某個函數做為 repl 時,replace() 方法便會將下列參數傳遞至該函數:

  • 字串的符合部分。
  • 將所有捕捉到的額外符合群組提供做為下一批引數。以此方式傳遞的引數數目將會因額外相符項目數而有所不同。您可以檢查函數程式碼內的 arguments.length - 3,判斷括號符合項目的數目。
  • 相符項目在字串中開始的索引位置。
  • 完整的字串。

例如,請考慮下列範例:

    var str1:String = "abc12 def34";
    var pattern:RegExp = /([a-z]+)([0-9]+)/;
    var str2:String = str1.replace(pattern, replFN);
    trace (str2);   // 12abc 34def
    
    function replFN():String {
      return arguments[2] + arguments[1];
    }

replace() 方法的呼叫會使用函數做為 repl 參數。此規則運算式 (/([a-z]([0-9]/g) 已經符合兩次。第一次時,此樣式符合子字串 "abc12",並且將下列引數清單傳遞至該函數:

    {"abc12", "abc", "12", 0, "abc12 def34"}

第二次時,此樣式符合子字串 "def23",並且將下列引數清單傳遞至該函數:

    {"def34", "def", "34", 6, "abc123 def34"}

傳回值
String — 產生的字串。請注意,來源字串會維持不變。

相關 API 元素

search

()方法 
AS3 function search(pattern:*):int

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會搜尋指定的 pattern,並傳回第一個相符之子字串的索引。如果沒有符合的子字串,此方法便會傳回 -1

參數

pattern:* — 要加以比對的樣式,可以是任何類型的物件,不過通常會是字串或規則運算式。如果 pattern 不是規則運算式或字串,此方法便會在執行前先將它轉換成字串。請注意,如果您指定規則運算式,此方法便會忽略規則運算式的全域旗標 ("g"),並忽略規則運算式的 lastIndex 屬性 (而且不會加以修改)。如果您傳遞未定義的值 (或是不傳遞任何值),此方法便會傳回 -1

傳回值
int — 第一個相符之子字串的索引,若是沒有符合項目則為 -1。請注意,字串索引是從零開始,字串的第一個字元會在索引 0,最後一個字元則會在 string.length - 1

相關 API 元素

slice

()方法 
AS3 function slice(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回一個字串,其中包含 startIndex 字元以後,直到 endIndex 字元 (但不包含此字元) 之前的所有字元。 不會修改原始 String 物件。 如果沒有指定 endIndex 參數,子字串的結尾就會是字串的結尾。 如果以 startIndex 為索引的字元與以 endIndex 為索引的字元相同或是在其右邊,則此方法會傳回空字串。

參數

startIndex:Number (default = 0) — 片段起點的索引 (從零開始)。如果 startIndex 是負值,便會由右至左建立片段,其中的 -1 是最後一個字元。
 
endIndex:Number (default = 0x7fffffff) — 整數,其值比片段的結束點索引值大 1。索引為 endIndex 參數之字元將不會包含在擷取出來的字串之內。 如果 endIndex 是負值,表示結束點將由字串的結尾推算回來,-1 代表最後一個字元。 預設值是索引可允許的最大值。 如果省略此參數,便會使用 String.length

傳回值
String — 以指定之索引為基礎的子字串。

相關 API 元素

split

()方法 
AS3 function split(delimiter:*, limit:Number = 0x7fffffff):Array

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會分割指定之 delimiter 參數出現的每個位置,將 String 物件分成子字串的陣列。

如果 delimiter 參數是規則運算式,就只會考慮在字串之指定位置的第一個符合項目,即使回溯便能在該位置找到符合的非空白子字串也一樣。 例如:

     var str:String = "ab";
     var results:Array = str.split(/a*?/); // results == ["","b"]
     
     results = str.split(/a*/); // results == ["","b"].)

如果 delimiter 參數是包含群組括號的規則運算式,則每次 delimiter 符合時,群組括號的結果 (包括任何未定義的結果) 都會接合到輸出陣列中。 例如:

     var str:String = "Thi5 is a tricky-66 example.";
     var re:RegExp = /(\d+)/;
     var results:Array = str.split(re);
         // results == ["Thi","5"," is a tricky-","66"," example."]

如果有指定 limit 參數,傳回的陣列便不會包含多於指定之數目的元素。

如果 delimiter 是空字串、空的規則運算式,或是能夠符合空字串的規則運算式,則字串中的每個單一字元都會輸出為陣列中的元素。

如果未定義 delimiter 參數,整個字串會放到傳回之陣列的第一個元素中。

參數

delimiter:* — 指定在何處分割此字串的樣式。 這可以是任何類型的物件,不過通常會是字串或規則運算式。 如果 delimiter 不是規則運算式或字串,此方法便會在執行前先將它轉換成字串。
 
limit:Number (default = 0x7fffffff) — 要放入字串中之項目的最大數目。 預設值是允許的最大值。

傳回值
Array — 子字串的陣列。

相關 API 元素

substr

()方法 
AS3 function substr(startIndex:Number = 0, len:Number = 0x7fffffff):String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回子字串,它所組成的字元是從指定的 startIndex 開始,且長度為 len 所指定。 不會修改原始的字串。

參數

startIndex:Number (default = 0) — 整數,指定用來建立子字串之第一個字元的索引。 如果 startIndex 是負值,開始索引便會從字串的結尾來決定,其中 -1 是最後一個字元。
 
len:Number (default = 0x7fffffff) — 所建立之子字串中的字元數。 預設值是允許的最大值。 如果未指定 len,子字串就會包含從 startIndex 到字串結尾的所有字元。

傳回值
String — 以指定之參數為基礎的子字串。

substring

()方法 
AS3 function substring(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回字串,它是由 startIndex 所指定,一直到 endIndex - 1 的所有字元所組成。 如果未指定 endIndex,便會使用 String.length。 如果 startIndex 的值與 endIndex 的值相等,則此方法會傳回一個空字串。 如果 startIndex 的值大於 endIndex 的值,便會在函數執行之前自動替換參數。 不會修改原始的字串。

參數

startIndex:Number (default = 0) — 整數,指定用來建立子字串之第一個字元的索引。 startIndex 的有效值是從 0String.length。 如果 startIndex 是負值,就會使用 0
 
endIndex:Number (default = 0x7fffffff) — 整數,其值比擷取字串中最後一個字元的索引大 1。 endIndex 的有效值是從 0String.length。 在子字串中不會包含位於 endIndex 的字元。 預設值是索引可允許的最大值。 如果省略此參數,便會使用 String.length。 如果此參數是負值,便會使用 0

傳回值
String — 以指定之參數為基礎的子字串。

toLocaleLowerCase

()方法 
AS3 function toLocaleLowerCase():String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回此字串的副本,其中所有大寫字元都會轉換成小寫字元。 不會修改原始的字串。 儘管此方法會以地區特定的方式處理轉換,ActionScript 3.0 實作卻不會產生與 toLowerCase() 方法不同的結果。

傳回值
String — 此字串的副本,其中所有大寫字元都會轉換成小寫字元。

相關 API 元素

toLocaleUpperCase

()方法 
AS3 function toLocaleUpperCase():String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回此字串的副本,其中所有小寫字元都會轉換成大寫字元。 不會修改原始的字串。 儘管此方法會以地區特定的方式處理轉換,ActionScript 3.0 實作卻不會產生與 toUpperCase() 方法不同的結果。

傳回值
String — 此字串的副本,其中所有小寫字元都會轉換成大寫字元。

相關 API 元素

toLowerCase

()方法 
AS3 function toLowerCase():String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回此字串的副本,其中所有大寫字元都會轉換成小寫字元。 不會修改原始的字串。

此方法會轉換具有與 Unicode 小寫字元對等的所有字元 (不僅只是 A-Z):

     var str:String = " JOSÉ BARÇA";
     trace(str.toLowerCase()); // josé barça

這些大小寫定義於 Unicode Character Database 規格中。

傳回值
String — 此字串的副本,其中所有大寫字元都會轉換成小寫字元。

相關 API 元素

toUpperCase

()方法 
AS3 function toUpperCase():String

執行階段版本: Flash Lite 4, Flash Player 9, AIR 1.0

會傳回此字串的副本,其中所有小寫字元都會轉換成大寫字元。 不會修改原始的字串。

此方法會轉換具有 Unicode 大寫字元對等的所有字元 (不僅只是 a-z):

     var str:String = "José Barça";
     trace(str.toUpperCase()); // JOSÉ BARÇA

這些大小寫定義於 Unicode Character Database 規格中。

傳回值
String — 此字串的副本,其中所有小寫字元都會轉換成大寫字元。

相關 API 元素

valueOf

()方法 
AS3 function valueOf():String

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

會傳回 String 實體的基本值。 此方法的設計目的,是要將 String 物件轉換成基本字串值。 由於 Flash 執行階段會自動在必要時呼叫 valueOf(),所以您幾乎不需要明確呼叫這個方法。

傳回值
String — 字串的值。
StringExample.as

下列範例會使用 StringExample 和 StringHelper 類別,說明 String 類別之各種方法的使用方式。這是透過下列步驟完成:
  1. StringExample 的建構函式會宣告許多區域 String 實體,而這些實體是以各種字串和新的 StringHelper 物件來初始化。
  2. StringHelper 類別具有下列方法:
    • replace():呼叫 String 的 split()join() 方法,移除搭配新字串傳入之字串的子字串。
    • trim():使用傳入的字串呼叫 trimBack()trimFront(),並傳回更新的字串。
    • trimFront():以遞迴方式移除符合 char 參數的所有字元,從字串的前面開始處理到結尾,直到字串中的第一個字元不符合 char 為止,然後傳回更新的字串。
    • trimBack():以遞迴方式移除符合 char 參數的所有字元,從字串的結尾開始往回處理,直到字串中的最後一個字元不符合 char 為止,然後傳回更新的字串。
    • stringToCharacter():會傳回傳遞給此方法之字串中的第一個字元。
  3. 然後會使用宣告的字串變數來產生三個字串,包含用來產生第二個字串的 replace() 方法呼叫以及用來產生第三個字串的 trim()
package {
    import flash.display.Sprite;

    public class StringExample extends Sprite {
        public function StringExample() {
            var companyStr:String = new String("     Company X");
            var productStr:String = "Product Z Basic     ";
            var emptyStr:String = " ";
            var strHelper:StringHelper = new StringHelper();

            var companyProductStr:String = companyStr + emptyStr + productStr;
            trace("'" + companyProductStr + "'");    // '     Company X Product Z Basic     '

            companyProductStr = strHelper.replace(companyProductStr, "Basic", "Professional");
            trace("'" + companyProductStr + "'");    // '     Company X Product Z Professional     '

            companyProductStr = strHelper.trim(companyProductStr, emptyStr);
            trace("'" + companyProductStr + "'");    // 'Company X Product Z Professional'
        }
    }
}

class StringHelper {
    public function StringHelper() {
    }

    public function replace(str:String, oldSubStr:String, newSubStr:String):String {
        return str.split(oldSubStr).join(newSubStr);
    }

    public function trim(str:String, char:String):String {
        return trimBack(trimFront(str, char), char);
    }

    public function trimFront(str:String, char:String):String {
        char = stringToCharacter(char);
        if (str.charAt(0) == char) {
            str = trimFront(str.substring(1), char);
        }
        return str;
    }

    public function trimBack(str:String, char:String):String {
        char = stringToCharacter(char);
        if (str.charAt(str.length - 1) == char) {
            str = trimBack(str.substring(0, str.length - 1), char);
        }
        return str;
    }

    public function stringToCharacter(str:String):String {
        if (str.length == 1) {
            return str;
        }
        return str.slice(0, 1);
    }
}




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

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