Adobe® Flash® Platform 用 ActionScript® 3.0 リファレンスガイド
ホーム  |  パッケージおよびクラスリストの非表示 |  パッケージ  |  クラス  |  新機能  |  索引  |  付録  |  英語で表示される理由
フィルター: AIR 30.0 以前, Flash Player 30.0 以前, Flash Lite 4
Flex 4.6 以前, Flash Pro CS6 以前
フィルターを非表示
flash.net 

URLRequest  - 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.net
クラスpublic final class URLRequest
継承URLRequest Inheritance Object

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

URLRequest クラスは、すべての情報を 1 つの HTTP 要求にキャプチャします。URLRequest のオブジェクトは、Loader、URLStream、URLLoader の各クラスの load() メソッド、およびその他のロード処理に渡され、URL のダウンロードが開始されます。また、FileReference クラスの upload() メソッドおよび download() メソッドにも渡されます。

ローカルファイルシステムのサンドボックスの SWF ファイルは、ネットワーク上のサンドボックス内のリソースからデータを読み込んだり、リソースにデータを書き込んだりしないことがあります。

デフォルトで、呼び出し元の SWF ファイルおよびロードする URL は、同じドメインにある必要があります。例えば www.adobe.com に置かれている SWF ファイルは、www.adobe.com に置かれているソースからのみデータをロードできます。異なるドメインからデータをロードするには、データをホストするサーバーに URL ポリシーファイルを配置します。

ただし、Adobe AIR では、アプリケーションセキュリティサンドボックス内のコンテンツ(AIR アプリケーションと共にインストールされたコンテンツ)は、これらのセキュリティ制限による制限を受けません。Adobe AIR で実行中のコンテンツの場合、アプリケーションセキュリティサンドボックス内のファイルは、次のいずれかの URL スキームを使って URL にアクセスできます。

  • http および https
  • file
  • app-storage
  • app

アプリケーションセキュリティサンドボックスにない、Adobe AIR で実行されるコンテンツには、(Flash Player の)ブラウザーで実行されるコンテンツと同じ制限が適用され、コンテンツのドメインと URL ポリシーファイルで付与されたアクセス許可によりロード操作が管理されます

メモ:Apple では App Transport Security を iOS9 に導入しました。これにより、アプリと Web サービスの間でセキュリティ保護されていない接続は使用できなくりました。この変更により、Loader および URLLoader を使用した保護されていない Web サイトへのすべての接続は切断され、使用できなくなります。アプリのアプリケーション記述子にキーを追加して、例外をデフォルトの動作に指定してください。

アプリのアプリケーション記述子の InfoAdditions タグにキーを追加し、デフォルトの動作の例外を指定してください。

  <iPhone>
  <InfoAdditions>
                   <![CDATA[
                          <key>NSAppTransportSecurity</key>
                              <dict>
                                        <key>NSExceptionDomains</key>
                              <dict>
                                       <key>www.example.com</key>
                              <dict>
                                     <!--Include to allow subdomains-->
                                     <key>NSIncludesSubdomains</key>
                                     <true/>
                                     <!--Include to allow HTTP requests-->
                                     <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                                     <true/>
                                      <!--Include to specify minimum TLS version-->
                                      <key>NSTemporaryExceptionMinimumTLSVersion</key>
                                      <string>TLSv1.1</string>
                              </dict>
                              </dict>
                              </dict>
                  ]]>
         </InfoAdditions>
  </iPhone>
  

セキュリティについて詳しくは、Flash Player デベロッパーセンターのトピック:セキュリティを参照してください。

例を表示

関連する API エレメント



パブリックプロパティ
 プロパティ定義元
      authenticate : Boolean
この要求に関する認証要求を処理するかどうかを指定します(true または false)。
URLRequest
      cacheResponse : Boolean
この要求に対する正常な応答データをキャッシュするかどうかを指定します。
URLRequest
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
  contentType : String
data プロパティのコンテンツの MIME コンテンツタイプです。
URLRequest
  data : Object
URL リクエストで送信されるデータを含むオブジェクトです。
URLRequest
  digest : String
Flash Player キャッシュに保存される(または Flash Player キャッシュから取得される)署名付き Adobe プラットフォームコンポーネントを一意に識別するストリングです。
URLRequest
  followRedirects : Boolean
リダイレクトを続行するか(true)、続行しないか(false)を指定します。
URLRequest
      idleTimeout : Number
この要求のアイドルタイムアウト値をミリ秒単位で指定します。
URLRequest
      manageCookies : Boolean
HTTP プロトコルスタックでこの要求のクッキーを管理するかどうかを指定します。
URLRequest
  method : String
HTTP フォーム送信メソッドを制御します。
URLRequest
  requestHeaders : Array
HTTP リクエストヘッダーの配列が HTTP リクエストに追加されます。
URLRequest
  url : String
リクエストされる URL です。
URLRequest
      useCache : Boolean
この URLRequest がデータを取得する前に、ローカルキャッシュを参照するかどうかを指定します。
URLRequest
  userAgent : String
HTTP 要求で使用されるユーザーエージェントストリングを指定します。
URLRequest
パブリックメソッド
 メソッド定義元
  
URLRequest(url:String = null)
URLRequest オブジェクトを作成します。
URLRequest
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
  
useRedirectedURL(sourceRequest:URLRequest, wholeURL:Boolean = false, pattern:* = null, replace:String = null):void
新しい URLRequest 内の URL の一部を、ソースの URLRequest からリダイレクトされた URL に置換することを許可します。
URLRequest
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
プロパティの詳細
    

authenticate

プロパティ
authenticate:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: AIR 1.0

この要求に関する認証要求を処理するかどうかを指定します(true または false)。false の場合、認証チャレンジは HTTP エラーを返します。

以下の認証メソッドがサポートされています。

  • Windows — HTTP 認証(基本 / ダイジェスト)、Windows 統合認証(NTLM および Kerberos を含む)、SSL 証明書認証
  • Mac — HTTP 認証(基本 / ダイジェスト)、NTLM 認証、SSL 証明書認証

注意:FileReference.upload()FileReference.download()、および HTMLLoader.load() の各メソッドは、URLRequest.authenticate プロパティをサポートしていません。

デフォルト値: true。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

    

cacheResponse

プロパティ 
cacheResponse:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: AIR 1.0

この要求に対する正常な応答データをキャッシュするかどうかを指定します。true に設定すると、AIR アプリケーションはオペレーティングシステムの HTTP キャッシュを使用します。

注意:HTMLLoader.load() メソッドは URLRequest.cacheResponse プロパティをサポートしていません。

デフォルト値: true。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

contentType

プロパティ 
contentType:String

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

data プロパティのコンテンツの MIME コンテンツタイプです。

デフォルト値は application/x-www-form-urlencoded です。

注意:FileReference.upload()FileReference.download() および HTMLLoader.load() の各メソッドは、URLRequest.contentType プロパティをサポートしていません。

POST リクエストを送信する場合、contentType プロパティと data プロパティの値が正しく対応している必要があります。contentType プロパティの値は、data プロパティの値を解釈する方法をサーバーに指示します。

  • data プロパティの値が URLVariables オブジェクトの場合、contentType の値は application/x-www-form-urlencoded である必要があります。
  • data プロパティの値が他の型の場合、contentType の値は送信される POST データ(data プロパティの値に含まれるバイナリまたはストリングのデータ)の型を示す必要があります。
  • FileReference.upload() の場合、リクエストの Content-Type は自動的に multipart/form-data に設定され、contentType プロパティの値は無視されます。

Flash Player 10 以降では、"multipart/form-data" などのマルチパート Content-Type にアップロードが含まれていると(アップロードが含まれているかどうかは POST ボディ内の "content-disposition" ヘッダーの "filename" パラメーターで示されます)、そのアップロードに適用されるセキュリティ規則によって POST 処理が拘束されます。

  • POST 処理は、マウスのクリックやキーの押下などのユーザーが開始したアクションに応答して実行する必要があります。
  • POST 処理がクロスドメインである(POST ターゲットが、POST 要求を送信中の SWF ファイルと同じサーバー上にない)場合は、クロスドメインアクセスを許可する URL ポリシーファイルをターゲットサーバーが提供する必要があります。

また、すべてのマルチパート Content-Type では、RFC2046 標準に準拠した有効なシンタックスを使用する必要があります。シンタックスが有効でない場合は、アップロードに適用されるセキュリティ規則によって POST 処理が拘束されます。



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

関連する API エレメント

data

プロパティ 
data:Object

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

URL リクエストで送信されるデータを含むオブジェクトです。

このプロパティはメソッドプロパティと一緒に使用します。method の値が GET のときは、HTTP クエリ文字列シンタックスを使って、data の値は URLRequest.url の値に追加されます。method の値が POST(または GET 以外の値)のときは、data の値は、HTTP 要求の本文に送信されます。

URLRequest API は、ストリング以外に、バイナリ POST と URL エンコード変数もサポートします。データオブジェクトには、ByteArray、URLVariables、または String オブジェクトを指定できます。

データが使用される方法は、使用されるオブジェクトの型によって異なります。

  • オブジェクトが ByteArray オブジェクトの場合、ByteArray オブジェクトのバイナリデータは POST データとして使用されます。GET の場合、ByteArray 型のデータはサポートされません。FileReference.upload() および FileReference.download() の場合も、ByteArray 型のデータはサポートされません。
  • オブジェクトが URLVariables オブジェクトで、メソッドが POST の場合、変数は x-www-form-urlencoded 形式を使用してエンコードされ、結果のストリングが POST データとして使用されます。例外は FileReference.upload() の呼び出しです。この場合、変数は、multipart/form-data ポストの個別のフィールドとして送信されます。
  • オブジェクトが URLVariables オブジェクトで、メソッドが GET の場合、URLVariables オブジェクトは URLRequest オブジェクトによって送信される変数を定義します。
  • それ以外の場合、オブジェクトはストリングに変換され、そのストリングが POST または GET データとして使用されます。

このデータは、navigateToURL()FileReference.upload() などのメソッドで URLRequest オブジェクトが使用されるまで送信されません。

注意:contentType の値は、data プロパティのデータ型に対応させる必要があります。contentType プロパティの説明の注意を参照してください。



実装
    public function get data():Object
    public function set data(value:Object):void

関連する API エレメント


例  ( この例の使用方法 )
次の例では、新しいブラウザーウィンドウで http://www.[yourDomain].com/application.jsp でホストされるリモートアプリケーションを開き、URLVariables オブジェクトで捕捉したユーザーセッションに関するデータをアプリケーションに渡します。

この例のハイライトは、次のとおりです。

  1. コンストラクター関数が request という名前の URLRequest インスタンスを作成します。このとき、リモートアプリケーションの URL をパラメーターとして取ります。
  2. URLVariables オブジェクトが作成され、その 2 つのプロパティに値が割り当てられます。
  3. URLVariables オブジェクトが URLRequest オブジェクトの data プロパティに割り当てられます。
  4. navigateToURL を呼び出して、リモートアプリケーションの URL 用の新しいブラウザーウィンドウを開きます。

注意:この例を実行するには、この例のリモートアプリケーションの URL を実際の URL に置き換える必要があります。さらに、URLVariables オブジェクトの Flash Player で捕捉した情報を処理するためのサーバーコードが必要です。

package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class URLVariablesExample extends Sprite {

        public function URLVariablesExample() {
            var url:String = "http://www.[yourDomain].com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            navigateToURL(request);
        }
    }
}

digest

プロパティ 
digest:String

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

Flash Player キャッシュに保存される(または Flash Player キャッシュから取得される)署名付き Adobe プラットフォームコンポーネントを一意に識別するストリングです。 Adobe プラットフォームコンポーネントは、ユーザーのコンピューターに永続的にキャッシュされる SWF コンテンツを含む署名付きファイル(SWZ ファイル)です。すべての SWZ ファイルはアドビ システムズ社によって署名されます。ダイジェストは単一のキャッシュされているファイルに対応します。ファイルを何らかの方法で変更すると、ダイジェストは予期しない方法で変更されます。ダイジェストを使用することにより、複数のドメインにまたがってキャッシュされているファイルを確認できます。同じダイジェストを持つ 2 つのファイルは同じファイルで、異なるダイジェストを持つ 2 つのファイルは同じファイルではありません。 ダイジェストに「なりすます」ファイル、ダイジェストを装うファイルを作成することは(実質的に)できません。

ダイジェストは、SHA-256 メッセージダイジェストアルゴリズム(16 進数形式で 64 文字長)に基づきます。

例えば、Flex SDK は Flex フレームワークの SWZ を含みます(また、その SWZ ファイルのダイジェストストリングを提供します)。この SWZ を Web サーバーにポストし、それを URLLoader オブジェクトの load() メソッドを使用して SWF ファイルにロードすることができます。エンドユーザーのコンピューターに一致する SWZ ファイルが既にキャッシュされている場合は、そのキャッシュされている SWZ ファイルが使用されます。SWZ ファイルの digest と提供したダイジェストが一致すると、SWZ ファイルは一致します。それ以外の場合は、指定した URL から SWZ ファイルがアプリケーションによってダウンロードされます。

URLRequest オブジェクトの digest パラメーターは、URLLoader.load() メソッドを呼び出して SWZ ファイルをロードする場合にのみ設定します。URLRequest オブジェクトの digest パロパティが、他のメソッドで設定済みである場合は、IOError 例外がスローされます。



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

例外
ArgumentError — 提供されるダイジェストは、ダウンロードされた署名付きファイルから抽出されたファイルのダイジェスト、またはキャッシュからロードされた署名付きファイルから抽出されたファイルのダイジェストとは一致しません。提供されたダイジェストの長さが誤っている場合、または提供されたダイジェストに無効な(16 進数以外の)文字が含まれている場合にも、このエラーがスローされます。

例  ( この例の使用方法 )
次の例では、キャッシュにリモートファイルをロードしています。ロードの最後で、バイト配列に(署名付きファイルでない)実際のファイルが格納されます。 この例では、loadBytes() を呼び出すことでロード操作を完了しています。
 
var myURLReq:URLRequest = new URLRequest();
myURLReq.url = "http://yourdomain/users/jdoe/test01/_rsc/Automated/AssetCaching_rsc/test01/rsl.swz";
myURLReq.digest = "3B0AA28C7A990385E044D80F5637FB036317BB41E044D80F5637FB036317BB41";
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.dataFormat = URLLoaderDataFormat.BINARY;
myURLLoader.addEventListener("complete", onC);

myURLLoad.load(myURLReq);

function onC(e) {
    var someLoader:Loader = new Loader();
    addChild(someLoader);
    someLoader.loadBytes((ByteArray)(myURLLoad.data)); 
}

followRedirects

プロパティ 
followRedirects:Boolean

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

リダイレクトを続行するか(true)、続行しないか(false)を指定します。

注意:FileReference.upload()FileReference.download()、および HTMLLoader.load() の各メソッドは、URLRequest.followRedirects プロパティをサポートしていません。

デフォルト値: true。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

    

idleTimeout

プロパティ 
idleTimeout:Number

言語バージョン: ActionScript 3.0
ランタイムバージョン: AIR 2

この要求のアイドルタイムアウト値をミリ秒単位で指定します。

アイドルタイムアウトとは、接続が確立された後、要求が廃棄されるまでの間、クライアントがサーバーからの応答を待機する時間です。

注意:HTMLLoader.load() メソッドは URLRequest.idleTimeout プロパティをサポートしていません。HTMLLoader クラスは、このクラス自体の idleTimeout プロパティを定義します。

デフォルト値: initialized from the URLRequestDefaults.idleTimeout property。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

    

manageCookies

プロパティ 
manageCookies:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: AIR 1.0

HTTP プロトコルスタックでこの要求のクッキーを管理するかどうかを指定します。true の場合、cookie が要求に追加され、応答 cookie が記憶されます。false の場合、cookie は要求に追加されず 応答 cookie は記憶されませんが、ユーザーは直接ヘッダーを操作することで cookie 自体を管理できます。注意:Windows では、manageCookiestrue に設定されている場合、URL 要求に手動で cookie を追加することはできません。他のオペレーティングシステムでは、manageCookiestruefalse のどちらに設定されているかに関わらず、要求に cookie を追加することができます。cookie の追加が許可されている場合、cookie のデータを格納している URLRequestHeader オブジェクトを requestHeaders 配列に手動で追加することで、要求に cookie を追加できます。

Mac OS では、cookie は Safari と共有されます。Mac OS でクッキーを消去するには:

  1. Safari を開きます。
  2. Safari/Preferences を選択し、Security パネルをクリックします。
  3. 「Show Cookies」ボタンをクリックします。
  4. 「Remove All」ボタンをクリックします。

Windows でクッキーを消去するには:

  1. インターネットのプロパティコントロールパネルを開き、「全般」タブをクリックします。
  2. 「Cookie の削除」ボタンをクリックします。

デフォルト値: true。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

method

プロパティ 
method:String

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

HTTP フォーム送信メソッドを制御します。

(ブラウザーの)Flash Player で実行される SWF コンテンツの場合、このプロパティは GET 操作または POST 操作に制限されます。有効な値は URLRequestMethod.GET または URLRequestMethod.POST です。

Adobe AIR で実行されるコンテンツの場合、そのコンテンツがアプリケーションセキュリティボックス内にあれば、どのストリング値も使用可能です。それ以外の場合、コンテンツが Flash Player で実行されるときと同様に、GET 操作または POST 操作の使用に制限されます。

Adobe AIR で実行中のコンテンツの場合、navigateToURL() 関数を使用すると、ランタイムでは、POST メソッドを使用する URLRequest(method プロパティが URLRequestMethod.POST に設定されているもの)は、GET メソッドとして処理されます。

注意:Flash Player で実行されているときに、参照されるフォームに本文がない場合、Flash Player では自動的に GET 操作が使用されます。これは、メソッドが URLRequestMethod.POST に設定されている場合でも同じです。このため、正しいメソッドが使用されるように、ダミーの body を必ず含めることをお勧めします。

デフォルト値: URLRequestMethod.GET。



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

例外
ArgumentError value パラメーターが URLRequestMethod.GET でも URLRequestMethod.POST でもない場合。

関連する API エレメント


例  ( この例の使用方法 )
次の例では、新しいブラウザーウィンドウで http://www.[yourDomain].com/application.jsp でホストされるリモートアプリケーションを開き、URLVariables オブジェクトで捕捉したユーザーセッションに関するデータをアプリケーションに渡します。URLRequest.method プロパティの値を、URLRequestMethod.POST に明示的に設定します。

この例のハイライトは、次のとおりです。

  1. コンストラクター関数が request という名前の URLRequest インスタンスを作成します。このとき、リモートアプリケーションの URL をパラメーターとして取ります。
  2. URLVariables オブジェクトが作成され、その 2 つのプロパティに値が割り当てられます。
  3. URLVariables オブジェクトが URLRequest オブジェクトの data プロパティに割り当てられます。
  4. URLRequest.method プロパティの値が URLRequestMethod.POST に設定されます。
  5. navigateToURL を呼び出して、リモートアプリケーションの URL 用の新しいブラウザーウィンドウを開きます。

注意:この例を実行するには、この例のリモートアプリケーションの URL を実際の URL に置き換える必要があります。さらに、URLVariables オブジェクトの Flash Player で捕捉した情報を処理するためのサーバーコードが必要です。

package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import flash.net.URLVariables;

    public class URLRequest_method extends Sprite {

        public function URLRequest_method() {
            var url:String = "http://www.[yourDomain].com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            request.method = URLRequestMethod.POST;
            
            navigateToURL(request);
        }
    }
}

requestHeaders

プロパティ 
requestHeaders:Array

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

HTTP リクエストヘッダーの配列が HTTP リクエストに追加されます。配列は URLRequestHeader オブジェクトから構成されます。配列の各オブジェクトは、次のように名前ストリングと値ストリングを含む URLRequestHeader オブジェクトである必要があります。

     var rhArray:Array = new Array(new URLRequestHeader("Content-Type", "text/html"));
     

Flash Player および AIR ランタイムには、リクエストヘッダーに一定の制限があります。詳しくは、URLRequestHeader クラスの説明を参照してください。

URLRequest パラメーターを受け取るメッソドすべてが requestHeaders プロパティをサポートしているわけではありません。呼び出すメソッドのマニュアルを参照してください。例えば、FileReference.upload() メソッドおよび FileReference.download() メソッドは、URLRequest.requestHeaders プロパティをサポートしていません。

ブラウザーの制限により、カスタム HTTP リクエストヘッダーは POST リクエストだけをサポートし、GET リクエストはサポートしません。



実装
    public function get requestHeaders():Array
    public function set requestHeaders(value:Array):void

関連する API エレメント

url

プロパティ 
url:String

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

リクエストされる URL です。

Uniform Resource Locator 仕様で危険と説明されている文字(http://www.faqs.org/rfcs/rfc1738.html を参照)や、URLRequest オブジェクトの URL スキームで予約されている文字(予約されている目的以外に使用する場合)は、必ずエンコードしてください。例えば、パーセント(%)記号の場合は "%25" を、番号記号の場合は "%23" を使用し、"http://www.example.com/orderForm.cfm?item=%23B-3&discount=50%25" などと示します。

デフォルトで、URL は呼び出し元のファイルと同じドメインにある必要があります。ただし、コンテンツが Adobe AIR アプリケーションセキュリティボックスで実行中の場合を除きます。異なるドメインからデータをロードする必要があるときは、データをホストするサーバーに URL ポリシーファイルを配置します。詳細については、URLRequest クラスの説明を参照してください。

Adobe AIR で実行されるコンテンツの場合、アプリケーションセキュリティサンドボックス内のファイル(AIR アプリケーションと共にインストールされるファイル)は、次の URL スキームのいずれかを使用して URL にアクセスできます。

  • http および https
  • file
  • app-storage
  • app

注意:IPv6(Internet Protocol version 6)は AIR および Flash Player 9.0.115.0 以降のバージョンでサポートされています。IPv6 は、128 bit のアドレスをサポートするインターネットプロトコルのバージョンです(32 bit のアドレスをサポートする、以前の IPv4 プロトコルの機能を向上したものです)。ネットワークインターフェイスでの IPv6 のアクティブ化が必要になる場合があります。詳細については、データをホストするオペレーティングシステムのヘルプを参照してください。ホストしているシステムで IPv6 がサポートされる場合、次に示すように、角括弧([])内に URL の IPv6 数値リテラルアドレスを指定できます。

     rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]:1935/test
     



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

例  ( この例の使用方法 )
次の例は、ActionScript 3.0 の Loader クラスを使用して、イメージを動的にロードする方法を示しています。ActionScriptExamples.com によって提供される例。
var url:String = "http://www.helpexamples.com/flash/images/image2.jpg";
var urlRequest:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.load(urlRequest);
addChild(loader);
    

useCache

プロパティ 
useCache:Boolean

言語バージョン: ActionScript 3.0
ランタイムバージョン: AIR 1.0

この URLRequest がデータを取得する前に、ローカルキャッシュを参照するかどうかを指定します。

注意:HTMLLoader.load() メソッドは URLRequest.useCache プロパティをサポートしていません。

デフォルト値: true。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

userAgent

プロパティ 
userAgent:String

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

HTTP 要求で使用されるユーザーエージェントストリングを指定します。

デフォルト値は、Flash Player で使用されるユーザーエージェントストリングと同じです。これは、Macintosh、Linux、Windows で異なります。

注意:HTMLLoader オブジェクトの load() メソッドで URLRequest オブジェクトが使用される場合、このプロパティはユーザーエージェントストリングに影響しません。HTMLLoader オブジェクトに対しユーザーエージェントストリングを設定するには、HTMLLoader オブジェクトの userAgent プロパティを設定するか、静的な URLRequestDefaults.userAgent プロパティを設定します。



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

例外
SecurityError — 呼び出し元が AIR アプリケーションセキュリティサンドボックス内に存在しません。

関連する API エレメント

コンストラクターの詳細

URLRequest

()コンストラクター
public function URLRequest(url:String = null)

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

URLRequest オブジェクトを作成します。System.useCodePagetrue の場合、リクエストは Unicode ではなく、システムのコードページを使ってエンコードされます。System.useCodePagefalse の場合、リクエストはシステムのコードページではなく、Unicode を使ってエンコードされます。

パラメーター
url:String (default = null) — リクエストされる URL です。url プロパティを使用して、URL を後から設定できます。

関連する API エレメント


例  ( この例の使用方法 )

次の例は、Flash Player から navigateToURL() メソッドを使用して、新しいブラウザーウィンドウを開く方法を示しています。ActionScriptExamples.com で作成された例。
// Requires
// - Button symbol on Stage (or a display object, such as a MovieClip) with instance name "buttonSymbol"
//
buttonSymbol.addEventListener(MouseEvent.CLICK, buttonSymbol_click);
 
function buttonSymbol_click(evt:MouseEvent):void {
    var req:URLRequest = new URLRequest("http://www.adobe.com/");
    navigateToURL(req, "_blank");
}
メソッドの詳細

useRedirectedURL

()メソッド
public function useRedirectedURL(sourceRequest:URLRequest, wholeURL:Boolean = false, pattern:* = null, replace:String = null):void

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

新しい URLRequest 内の URL の一部を、ソースの URLRequest からリダイレクトされた URL に置換することを許可します。最初の要求がリダイレクトされた後、その後の要求を、リダイレクトされたサーバーの場所に直接送信することができます。

最初の URLRequest が完了し、HTTPStatusEvent.redirected が true の場合、最初の要求を sourceRequest として使用し、このメソッドを呼び出すことができます。デフォルトでは、リダイレクトされた URL のドメインを使用して、この URLRequest の URL のドメインが置換されます。このメソッドを呼び出す前に、URLRequest.url を設定する必要があります。このメソッドは、この URLRequest が読み込まれる前に呼び出す必要があります。オプションとして、wholeURL パラメーターが true の場合、ソースの URLRequest のファイル名を除く URL 全体を使用して、この URLRequest の最終的なファイル名を除く URL 全体が置換されます。また、オプションとして pattern パラメーターに文字列や正規表現を指定して呼び出すこともできます。このパターンが検索され、replace パラメーターの文字列に置換されます。この検索と置換は、URL の置換後に行われます。

パラメーター

sourceRequest:URLRequest — 既に要求され、リダイレクトされた URLRequest オブジェクト。リダイレクトされた URL を使用して、この URLRequest オブジェクトの URL の一部が置換されます。
 
wholeURL:Boolean (default = false) — sourceRequest の最終的な URL のドメインだけを使用してこの要求の URL のドメインを置換するか、ファイル名を除く URL 全体を使用するかを指定します。デフォルト値は false です。
 
pattern:* (default = null) — URL 内の検索に使用するパターン。String オブジェクトまたは RegExp オブジェクトを指定できます。デフォルト値は null です。
 
replace:String (default = null) — URL 内で見つかったパターンに対して置換するための文字列。デフォルト値は null です。

関連する API エレメント

URLRequestExample.as

次の例では、新しい Loader オブジェクトを作成し、それに XML ファイルへのパスを含む URLRequest オブジェクトを渡します。ロード処理が成功した場合、complete イベントが送出され、XML ファイル内のデータが出力されます。追加のイベントハンドラーはエラーイベントを含む他のイベントをキャプチャします。

この例を実行するには、XMLFile.xml というファイルを SWF ファイルと同じディレクトリに配置します。

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.*;

    public class URLRequestExample extends Sprite {
        private var loader:URLLoader;
        
        public function URLRequestExample() {
            loader = new URLLoader();
            configureListeners(loader);

            var request:URLRequest = new URLRequest("XMLFile.xml");
            try {
                loader.load(request);
            } catch (error:Error) {
                trace("Unable to load requested document.");
            }
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}




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

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