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

NetConnection  - 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 class NetConnection
継承NetConnection Inheritance EventDispatcher Inheritance Object

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

NetConnection クラスでは、クライアントとサーバー間の双方向の接続が作成されます。クライアントには Flash Player または AIR アプリケーションを使用できます。サーバーには、Web サーバー、Flash Media Server、Flash Remoting を実行しているアプリケーションサーバーまたは Adobe Stratus サービスを使用できます。NetConnection.connect() を呼び出して、接続を確立します。NetStream クラスを使用して、メディアおよびデータのストリームを接続に送信します。

コンテンツとデータを Flash Player および AIR にロードする際のセキュリティ情報については、以下を参照してください。

このクラスのコールバックメソッドを記述するには、クラスを拡張してサブクラスでコールバックメソッドを定義するか、client プロパティをオブジェクトに割り当てて、そのオブジェクトでコールバックメソッドを定義します。

例を表示

関連する API エレメント



パブリックプロパティ
 プロパティ定義元
  client : Object
コールバックメソッドが呼び出されるオブジェクトを示します。
NetConnection
  connected : Boolean
[読み取り専用] 永続的な RTMP 接続を介して(true)、またはそれ以外の方法で(false)サーバーに接続されていることを示します。
NetConnection
  connectedProxyType : String
[読み取り専用] Flash Media Server への正常な接続を作成するために使用するプロキシタイプ。
NetConnection
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
  defaultObjectEncoding : uint
[静的] NetConnection オブジェクトのデフォルトオブジェクトのエンコードです。
NetConnection
  farID : String
[読み取り専用] この Flash Player インスタンスまたは Adobe AIR インスタンスが接続されている Flash Media Server インスタンスの識別子。
NetConnection
  farNonce : String
[読み取り専用] 実際には Flash Media Server によって選択される値で、この接続に一意です。
NetConnection
      httpIdleTimeout : Number
HTTP 応答の待機時間(ミリ秒単位)です。
NetConnection
  maxPeerConnections : uint
Flash Player または Adobe AIR のこのインスタンスで可能となるピアーの受信接続と送信接続の総数。
NetConnection
  nearID : String
[読み取り専用] この NetConnection インスタンスに対する Flash Player インスタンスまたは Adobe AIR インスタンスの識別子。
NetConnection
  nearNonce : String
[読み取り専用] 実際にはこの Flash Player インスタンスまたは Adobe AIR インスタンスによって選択される値で、この接続に一意です。
NetConnection
  objectEncoding : uint
この NetConnection インスタンスのオブジェクトエンコードです。
NetConnection
  protocol : String
[読み取り専用] 接続の確立にプロトコルが使用されました。
NetConnection
  proxyType : String
Flash Media Server への最初の接続に失敗した場合に実行する代替手段を指定します。
NetConnection
  unconnectedPeerStreams : Array
[読み取り専用] パブリッシュする NetStream オブジェクトに関連付けられていない、すべてのピアーサブスクライバ NetStream オブジェクトを保持するオブジェクトです。
NetConnection
  uri : String
[読み取り専用] NetConnection.connect() メソッドに渡された URI。
NetConnection
  usingTLS : Boolean
[読み取り専用] HTTPS ではなく、ネイティブ TLS を使用してセキュア接続が確立されたかどうかを示します。
NetConnection
パブリックメソッド
 メソッド定義元
  
NetConnection オブジェクトを作成します。
NetConnection
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
イベントリスナーオブジェクトを EventDispatcher オブジェクトに登録し、リスナーがイベントの通知を受け取るようにします。
EventDispatcher
  
addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):void
コンテキストヘッダーを AMF(Action Message Format)パケット構造に追加します。
NetConnection
  
call(command:String, responder:Responder, ... arguments):void
Flash Media Server 上または Flash Remoting を実行しているアプリケーションサーバー上のコマンドまたはメソッドを呼び出します。
NetConnection
  
ローカルで開始した接続またはサーバーへの接続を閉じ、NetConnection.Connect.Closed を code プロパティとして、netStatus イベントを送出します。
NetConnection
  
connect(command:String, ... arguments):void
Flash Media Server 上のアプリケーションまたは Flash Remoting への双方向の接続を作成するか、RTMFP ピアーツアーピアーグループ通信用に双方向のネットワークエンドポイントを作成します。
NetConnection
 Inherited
イベントをイベントフローに送出します。
EventDispatcher
 Inherited
EventDispatcher オブジェクトに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。
EventDispatcher
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
EventDispatcher オブジェクトからリスナーを削除します。
EventDispatcher
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
 Inherited
指定されたイベントタイプについて、この EventDispatcher オブジェクトまたはその祖先にイベントリスナーが登録されているかどうかを確認します。
EventDispatcher
イベント
 イベント 概要 定義元
 Inherited[ブロードキャストイベント] Flash Player または AIR アプリケーションがオペレーティングシステムのフォーカスを取得して、アクティブになったときに送出されます。EventDispatcher
  非同期形式で、つまりネイティブ非同期コードから例外がスローされると送出されます。NetConnection
 Inherited[ブロードキャストイベント] Flash Player または AIR アプリケーションがオペレーティングシステムのフォーカスを失って、非アクティブになったときに送出されます。EventDispatcher
  入出力エラーが発生してネットワーク処理が失敗したときに送出されます。NetConnection
  NetConnection オブジェクトが、そのステータスまたはエラーの状況をレポートするときに送出されます。NetConnection
  NetConnection.call() の呼び出しによって呼び出し元のセキュリティサンドボックスの外部にあるサーバーに接続しようとすると送出されます。NetConnection
プロパティの詳細

client

プロパティ
client:Object

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

コールバックメソッドが呼び出されるオブジェクトを示します。デフォルト値はこの NetConnection インスタンスです。client プロパティを別のオブジェクトに設定すると、コールバックメソッドはそのオブジェクトで呼び出されます。



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

例外
TypeError client プロパティは、null 以外のオブジェクトに設定する必要があります。

connected

プロパティ 
connected:Boolean  [読み取り専用]

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

永続的な RTMP 接続を介して(true)、またはそれ以外の方法で(false)サーバーに接続されていることを示します。HTTP を介して接続された場合、このプロパティは false です。ただし、アプリケーションサーバー上の Flash Remoting サービスに接続した場合は true です。



実装
    public function get connected():Boolean

connectedProxyType

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

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

Flash Media Server への正常な接続を作成するために使用するプロキシタイプ。指定できる値は、"none""HTTP""HTTPS"、または "CONNECT" です。

トンネル接続ではない場合、またはネイティブ SSL 接続である場合、値は "none" です。

HTTP 経由のトンネル接続である場合、値は "HTTP" です。

HTTPS 経由のトンネル接続である場合、値は""HTTPS" です

プロキシサーバーを通じて CONNECT メソッドを使用するトンネル接続の場合、値は "CONNECT" です。



実装
    public function get connectedProxyType():String

例外
ArgumentError — NetConnection インスタンスが接続されていないときに、このプロパティにアクセスしようとしました。

defaultObjectEncoding

プロパティ 
defaultObjectEncoding:uint

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

NetConnection オブジェクトのデフォルトオブジェクトのエンコードです。バイナリデータにオブジェクトを書き込むかバイナリデータからオブジェクトを読み取るときに、データの直列化に使用される AMF(Action Message Format)のバージョンが defaultObjectEncoding プロパティに示されます。これらは、ActionScript 3.0 フォーマット(ObjectEncoding.AMF3)または ActionScript 1.0 および ActionScript 2.0 フォーマット(ObjectEncoding.AMF0)です。

デフォルト値は ObjectEncoding.AMF3 です。NetConnection.defaultObjectEncoding を変更しても、既存の NetConnection インスタンスには影響せず、それ以降に作成されたインスタンスにのみ影響します。

オブジェクトのエンコードを(アプリケーション全体に対してではなく)個別に設定するには、NetConnection オブジェクトの objectEncoding プロパティを設定します。

詳細については、objectEncoding プロパティの説明を参照してください。



実装
    public static function get defaultObjectEncoding():uint
    public static function set defaultObjectEncoding(value:uint):void

関連する API エレメント

farID

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

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

この Flash Player インスタンスまたは Adobe AIR インスタンスが接続されている Flash Media Server インスタンスの識別子。このプロパティは、RTMFP 接続にのみ意味があります。このプロパティの値は、RTMFP 接続が確立された後でのみ利用できます。



実装
    public function get farID():String

関連する API エレメント

farNonce

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

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

実際には Flash Media Server によって選択される値で、この接続に一意です。この値は、サーバー側では client.nearNonce 値となります。この値は、RTMFP、RTMPE および RTMPTE 接続についてのみ定義されます。



実装
    public function get farNonce():String
    

httpIdleTimeout

プロパティ 
httpIdleTimeout:Number

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

HTTP 応答の待機時間(ミリ秒単位)です。デフォルト値は 0 です。

  • httpIdleTimeout の値は Number です。
  • HTTP 接続を使用する場合、正の値は非アクティブな接続を保持する時間をミリ秒単位で示します。
  • ゼロの値は、プラットフォームで指定されているデフォルトのネットワーキングアイドルタイムアウト値を使用することを示します。
  • 負の値を指定すると、RangeError になります。
  • httpIdleTimeout で指定した値を超過すると、netStatus イベントが送出されます。
  • このプロパティは、HTTP 接続と共に作成された NetConnection オブジェクトにのみ影響します。RTMP、RTMFP、または他の HTTP チャンネルと共に作成された NetConnection オブジェクトは、このプロパティの影響を受けません。
    //Set the timeout to 5 seconds
    connection = new NetConnection();
    connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    connection.httpIdleTimeout = 5000;
    
Linux ベースのシステムでは、NetConnection を使用したタイムアウトは httpIdleTimeout 値を使用したタイムアウトに比較して長くかかることがあります。



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

maxPeerConnections

プロパティ 
maxPeerConnections:uint

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

Flash Player または Adobe AIR のこのインスタンスで可能となるピアーの受信接続と送信接続の総数。デフォルト値は 8 です。

この値は、発行者接続とサブスクライバ接続で違いはありません。ピアー接続が存在するときにこの値を減らす場合は、その新しい値は新しい受信接続だけに影響します。既存の接続は中断されません。



実装
    public function get maxPeerConnections():uint
    public function set maxPeerConnections(value:uint):void

nearID

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

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

この NetConnection インスタンスに対する Flash Player インスタンスまたは Adobe AIR インスタンスの識別子。このプロパティは、RTMFP 接続にのみ意味があります。

すべての NetConnection インスタンスは一意の nearID プロパティを持ちます。Flash Player インスタンス、Adobe AIR インスタンスまたは NetConnection インスタンスで同じ識別子を持つものはありません。

他の Flash Player インスタンスまたは Adobe AIR インスタンスは、このクライアントとの新しい NetStream 接続の peerID としてこの識別子を使用します。次に、この識別子は、このインスタンスに接続されているピアー NetStream の farID となります。



実装
    public function get nearID():String

関連する API エレメント

nearNonce

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

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

実際にはこの Flash Player インスタンスまたは Adobe AIR インスタンスによって選択される値で、この接続に一意です。この値は、サーバー側では client.farNonce 値となります。この値は、RTMFP、RTMPE および RTMPTE 接続についてのみ定義されます。



実装
    public function get nearNonce():String

objectEncoding

プロパティ 
objectEncoding:uint

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

この NetConnection インスタンスのオブジェクトエンコードです。

バイナリデータにオブジェクトを書き込むかバイナリデータからオブジェクトを読み取るときに、データの直列化に使用される AMF(Action Message Format)のバージョンが defaultObjectEncoding プロパティに示されます。これらは、ActionScript 3.0 形式(ObjectEncoding.AMF3)または ActionScript 1.0 および ActionScript 2.0 形式(ObjectEncoding.AMF0)です。objectEncoding プロパティを設定することにより、NetConnection インスタンスの AMF のバージョンを設定します。

アプリケーションが Flash Player 9 以前にリリースされたサーバーと通信する必要がある場合は、このプロパティを理解することが重要です。次の 3 つのシナリオが可能です。

  • AMF3 をサポートするサーバー(例えば、Flex Data Services 2 または Flash Media Server 3)に接続します。defaultObjectEncoding のデフォルト値は ObjectEncoding.AMF3 です。この ファイルで作成された NetConnection インスタンスはすべて AMF3 直列化を使用するので、objectEncoding プロパティを設定する必要はありません。
  • AMF3 をサポートしないサーバー(例えば、Flash Media Server 2)に接続します。このシナリオでは、静的な NetConnection.defaultObjectEncoding プロパティを ObjectEncoding.AMF0 に設定します。この SWF ファイルに作成されるすべての NetConnection インスタンスでは、AMF0 直列化を使用します。objectEncoding プロパティを設定する必要はありません。
  • 異なるエンコーディングバージョンを使用する複数のサーバーに接続する場合。defaultObjectEncoding を使用せずに、各接続の objectEncoding プロパティを使用して、接続ごとにオブジェクトエンコーディングを設定します。このプロパティを ObjectEncoding.AMF0 に設定すると、AMF0 エンコーディングを使用するサーバー(Flash Media Server 2 など)に接続します。ObjectEncoding.AMF3 に設定すると、AMF3 エンコーディングを使用するサーバー(Flex Data Services 2 など)に接続します。

NetConnection インスタンスが接続されたら、その objectEncoding プロパティは読み取り専用になります。

サーバーへの接続に誤ったエンコーディングを使用した場合は、NetConnection オブジェクトにより netStatus イベントが送出されます。 NetStatusEvent.info プロパティには、code プロパティ値 NetConnection.Connect.Failed を持つ情報オブジェクトとオブジェクトエンコードが正しくないことを示す説明が含まれています。



実装
    public function get objectEncoding():uint
    public function set objectEncoding(value:uint):void

例外
ReferenceError — NetConnection インスタンスが接続されているときに、objectEncoding プロパティの値を設定しようとしました。
 
ArgumentError — このプロパティに、ObjectEncoding.AMF0 または ObjectEncoding.AMF3 以外の値が設定されました。

関連する API エレメント

protocol

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

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

接続の確立にプロトコルが使用されました。Flash Media Server を使用するときは、このプロパティが適切です。有効な値は次のとおりです。

  • "rtmp":リアルタイムメッセージングプロトコル(RTMP)
  • "rtmpe":暗号化 RTMP
  • "rtmpt":HTTP トンネリング RTMP
  • "rtmpte":HTTP トンネリング暗号化 RTMP
  • "rtmps": HTTPS ベースの RTMP
  • "rtmfp":リアルタイムメディアフロープロトコル(RTMFP)



実装
    public function get protocol():String

例外
ArgumentError — NetConnection インスタンスが接続されていないときに、このプロパティにアクセスしようとしました。

proxyType

プロパティ 
proxyType:String

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

Flash Media Server への最初の接続に失敗した場合に実行する代替手段を指定します。proxyType プロパティを設定してから NetConnection.connect() メソッドを呼び出します。

有効な値は、"none""HTTP""CONNECTOnly""CONNECT" および "best" です。デフォルト値は "none" です。

ネイティブ SSL を使用するには、プロパティに "best" を設定します。プレーヤーが、デフォルトの 443 ポート経由または指定した他のポート経由でサーバーへの直接接続を作成できず、プロキシサーバーが所定の位置にある場合、プレーヤーは CONNECT メソッドの使用を試行します。この試行に失敗した場合、プレーヤーは HTTPS 経由でトンネル接続します。

このプロパティが "CONNECTOnly" に設定されている場合、プレーヤーは最初に CONNECT メソッドの使用を試行します。失敗した場合は、フォールバックは実行されません。

プロパティが "HTTP" に設定されていて、直接接続に失敗した場合は、HTTP トンネリングが使用されます。プロパティが "CONNECT" に設定されており、直接接続に失敗した場合は、トンネリングの CONNECT メソッドが使用されます。これに失敗すると、接続は HTTP トンネリングにフォールバックされなくなります。

このプロパティは RTMP、RTMPS、または RTMPTを使用している場合にのみ適用できます。CONNECT および CONNECTOnly メソッドは、プロキシサーバー経由でネットワークに接続しているユーザーにのみ適用できます。



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

unconnectedPeerStreams

プロパティ 
unconnectedPeerStreams:Array  [読み取り専用]

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

パブリッシュする NetStream オブジェクトに関連付けられていない、すべてのピアーサブスクライバ NetStream オブジェクトを保持するオブジェクトです。パブリッシュする NetStream オブジェクトに関連付けられたサブスクライバ NetStream オブジェクトは、NetStream.peerStreams 配列にあります。



実装
    public function get unconnectedPeerStreams():Array

関連する API エレメント

uri

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

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

NetConnection.connect() メソッドに渡された URI。NetConnection.connect() が呼び出されていない場合、または URI が渡されていない場合、このプロパティは undefined になります。



実装
    public function get uri():String

usingTLS

プロパティ 
usingTLS:Boolean  [読み取り専用]

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

HTTPS ではなく、ネイティブ TLS を使用してセキュア接続が確立されたかどうかを示します。このプロパティは、NetConnection オブジェクトが接続されている場合にのみ有効です。



実装
    public function get usingTLS():Boolean

例外
ArgumentError — NetConnection インスタンスが接続されていないときに、このプロパティにアクセスしようとしました。
コンストラクターの詳細

NetConnection

()コンストラクター
public function NetConnection()

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

NetConnection オブジェクトを作成します。connect() メソッドを呼び出して、接続を作成します。

アプリケーションが Flash Player 9 以前にリリースされたサーバーと通信する必要がある場合は、NetConnection オブジェクトの objectEncoding プロパティを設定します。

次のコードでは、NetConnection オブジェクトを作成します。

     var nc:NetConnection = new NetConnection();
     

関連する API エレメント

メソッドの詳細

addHeader

()メソッド
public function addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):void

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

コンテキストヘッダーを AMF(Action Message Format)パケット構造に追加します。このヘッダーは、将来のすべての AMF パケットと共に送信されます。同じ名前を使用して NetConnection.addHeader() を呼び出すと、既存のヘッダーが新しいヘッダーに置き換えられます。新しいヘッダーは、NetConnection オブジェクトのある間存在し続けます。ヘッダーの名前を使用して NetConnection.addHeader() を呼び出し、未定義のオブジェクトを削除して、ヘッダーを削除できます。

パラメーター

operation:String — ヘッダーとヘッダーに関連付けられている ActionScript オブジェクトデータを指定します。
 
mustUnderstand:Boolean (default = false)true 値は、サーバーがこのヘッダーに対応しており、次のヘッダーまたはメッセージを処理する前に、サーバーでヘッダーを処理する必要があることを示します。
 
param:Object (default = null) — 任意の ActionScript オブジェクトです。

call

()メソッド 
public function call(command:String, responder:Responder, ... arguments):void

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

Flash Media Server 上または Flash Remoting を実行しているアプリケーションサーバー上のコマンドまたはメソッドを呼び出します。NetConnection.call() を呼び出す前に、NetConnection.connect() を呼び出してサーバーに接続する必要があります。このメソッドに渡すには、サーバーサイド関数を作成する必要があります。

一般的な予約ポートには接続できません。遮断されたポートの詳しいリストについては、『ActionScript 3.0 開発ガイド』の「ネットワーク API の制限」を参照してください。

パラメーター

command:String[オブジェクトのパス/]method という形式で指定されたメソッドです。例えば、someObject/doSomething コマンドは、clientObject.someObject.doSomething() メソッドを、省略可能なすべての ... arguments パラメーターと共に呼び出すようにリモートサーバーに対して指定します。オブジェクトのパスが見つからない場合は、リモートサーバーで clientObject.doSomething() が呼び出されます。

Flash Media Server では、command は、アプリケーションのサーバーサイドスクリプトに定義されている関数の名前です。サーバーサイドスクリプトがアプリケーションディレクトリのルートレベルに配置されている場合、command の前にオブジェクトパスを付ける必要はありません。

 
responder:Responder — サーバーからの戻り値を処理するために使用される、省略可能なオブジェクトです。Responder オブジェクトには、返される結果を処理するための 2 つのメソッド result および status が定義されています。結果としてエラーが返された場合は status が呼び出され、それ以外の場合は result が呼び出されます。NetConnection オブジェクトが接続状態に関連したエラーに対処するものであるのに対して、Responder オブジェクトは個々の操作に関連したエラーを処理することができます。
 
... arguments — 省略可能なパラメーターです。別の ActionScript オブジェクトへの参照を含む、ActionScript の任意の型を取ることができます。メソッドがリモートアプリケーションサーバーで実行されると、これらのパラメーターは command パラメーターで指定されたメソッドに渡されます。


イベント
securityError:SecurityErrorEvent — 呼び出し元のセキュリティサンドボックスの外部にあるサーバーとの通信を試行する呼び出しです。サーバーでポリシーファイルを使用することにより、この問題を回避できます。

関連する API エレメント

close

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

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

ローカルで開始した接続またはサーバーへの接続を閉じ、NetConnection.Connect.Closedcode プロパティとして、netStatus イベントを送出します。

このメソッドは、接続上で実行されているすべての NetStream オブジェクトを切断します。キューに未送信のデータはすべて破棄されます。(接続を閉じずにローカルまたはサーバーストリームを終了するには、NetStream.close() を使用します。)接続を閉じて新しい接続を作成する場合は、新しい NetConnection オブジェクトを呼び出し、connect() メソッドをもう一度呼び出す必要があります。

close() メソッドは、この接続上で実行されているすべてのリモート共有オブジェクトも切断します。ただし、再接続するために共有オブジェクトを再作成する必要はありません。SharedObject.connect() を呼び出すだけで、共有オブジェクトへの接続を再確立できます。また、共有オブジェクトへの接続が再確立されると、NetConnection.close() を発行したときにキュー内にあった共有オブジェクトのデータがすべて送信されます。

Flash Media Server では、クライアントからサーバーへの接続が不要になったときは close() を呼び出すことをお勧めします。close() を呼び出すと、使用されていない接続が最も短時間でクリーンアップされます。予備の手段として、アイドル状態の接続を自動的に閉じるようにサーバーを設定できます。詳細については、Flash Media Server の設定と管理のガイドを参照してください。

関連する API エレメント

connect

()メソッド 
public function connect(command:String, ... arguments):void

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

Flash Media Server 上のアプリケーションまたは Flash Remoting への双方向の接続を作成するか、RTMFP ピアーツアーピアーグループ通信用に双方向のネットワークエンドポイントを作成します。ステータスまたはエラーの状況をレポートするために、NetConnection.connect() によって netStatus イベントが送出されます。

NetConnection.connect() を呼び出して、次の操作を行います。

  • 「null」を渡して、ローカルファイルシステムまたは Web サーバーからビデオファイルと mp3 ファイルを再生します。
  • 「http」 URL を渡して、Flash Remoting を実行しているアプリケーションサーバーに接続します。NetServices クラスを使用して、NetConnection オブジェクトでアプリケーションサーバーの関数を呼び出し、アプリケーションサーバーから結果を取得します。詳細については、Flash Remoting のマニュアルを参照してください。
  • 「rtmp/e/s」 URL を渡して、Flash Media Server アプリケーションに接続します。
  • 「rtmfp」 URL を渡して、RTMFP クライアント-サーバー通信、ピアーツーピアー通信および IP マルチキャスト通信用に双方向のネットワークエンドポイントを作成します。
  • ストリング「rtmfp:」を渡して、RTMFP IP マルチキャスト通信用にサーバーレスの双方向ネットワークエンドポイントを作成します。

次のセキュリティモデルを考慮してください。

  • デフォルトでは、Flash Player または AIR でのサンドボックス間のアクセスは拒否されます。URL ポリシーファイルを使用することで、Web サイトでリソースにアクセスできるようになります。
  • アプリケーションで、サーバー上のリソースへのアクセスを拒否できます。Flash Media Server アプリケーションでは、サーバーサイド ActionScript コードを使用してアクセスを拒否します。「Flash Media Server のリソース」を参照してください。
  • 呼び出し元ファイルがローカルファイルシステムのサンドボックスに配置されている場合は、NetConnection.connect() を呼び出すことはできません。
  • 一般的な予約ポートには接続できません。遮断されたポートの詳しいリストについては、『ActionScript 3.0 開発ガイド』の「ネットワーク API の制限」を参照してください。
  • SWF ファイルがこのメソッドを呼び出さないようにするには、allowNetworking パラメーター(SWF コンテンツを含んでいる HTML ページの object タグおよび embed タグのパラメーター)を設定します。

ただし、Adobe AIR では、アプリケーションセキュリティサンドボックス内のコンテンツ(AIR アプリケーションと共にインストールされたコンテンツ)は、これらのセキュリティ制限による制限を受けません。

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

パラメーター

command:String — 以下の値のいずれかを command パラメーターに使用します。
  • ビデオおよび mp3 ファイルをローカルのファイルシステムまたは Web サーバーから再生するには、null を渡します。
  • Flash Remoting を実行しているアプリケーションサーバーに接続するには、http プロトコルを使用している URL を渡します。
  • (Flash Player 10.1 または AIR 2 以降) RTMFP IP マルチキャスト通信用にサーバーレスネットワークエンドポイントを作成するには、ストリング「rtmfp:」を渡します。この接続タイプを使用して、サーバーを使用せずに発行者から IP マルチキャストストリームを受信します。また、この接続タイプを使用して IP マルチキャストを使用し、同じローカルエリアネットワーク(LAN)上でピアーを検出することもできます。
  • この接続タイプには次の制限があります。

    同じ LAN 上のピアーのみが相互に検出できます。

    Flash Player は、IP マルチキャストを使用してストリームを受信できますが、送信することはできません。

    Flash Player および AIR はピアーツーピアーグループでストリームを送受信できますが、ピアーは、IP マルチキャストを使用して同じ LAN 上で検出されなければなりません。

    このテクニックは 1 対 1 の通信には使用できません。

  • Flash Media Server に接続するには、サーバー上のアプリケーションの URI を渡します。次のシンタックスを使用します。角括弧内のアイテムは省略できます。

    protocol:[//host][:port]/appname[/instanceName]

    rtmprtmpertmpsrtmptrtmpte、または rtmfp のいずれかのプロトコルを使用します。接続に成功した場合、netStatus イベントが返されます。このときの code プロパティは NetConnection.Connect.Success です。すべてのイベントコードのリストの NetStatusEvent.info プロパティを参照してください。このイベントコードは connect() の呼び出しに応答して返されます。

    サーバーがインストールされているホストからファイルが提供されている場合は、//host パラメーターを省略できます。/instanceName パラメーターを省略すると、Flash Player または AIR はアプリケーションのデフォルトインスタンスに接続します。

    (Flash Player 10.1 または AIR 2 以降)ピアーツーピアーアプリケーションを作成するには、rtmfp プロトコルを使用します。

 
... argumentscommand で指定されたアプリケーションに渡された任意の型のパラメーターです。このパラメーターはオプションです。Flash Media Server では、アプリケーションのサーバーサイドコードの application.onConnect() イベントハンドラーに追加の引数が渡されます。onConnect() に引数を定義して処理する必要があります。


例外
ArgumentError command パラメーターに渡された URI は適切にフォーマットされていません。
 
IOError — 接続に失敗しました。これは、connect()netStatus イベントハンドラー内から呼び出すと起こることがあります。この呼び出しは許可されていません。
 
SecurityError — Local-with-filesystem SWF ファイルはインターネットと通信できません。この問題は、SWF ファイルを local-with-networking または trusted として分類し直すことで回避できます。
 
SecurityError — 一般的な予約ポートには接続できません。遮断されたポートの詳しいリストについては、『ActionScript 3.0 開発ガイド』の「ネットワーク API の制限」を参照してください。

関連する API エレメント

イベントの詳細

asyncError

イベント
イベントオブジェクトの型: flash.events.AsyncErrorEvent
プロパティ AsyncErrorEvent.type = flash.events.AsyncErrorEvent.ASYNC_ERROR

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

非同期形式で、つまりネイティブ非同期コードから例外がスローされると送出されます。

AsyncErrorEvent.ASYNC_ERROR 定数は、type プロパティ(asyncError イベントオブジェクト)の値を定義します。

このイベントには、次のプロパティがあります。

プロパティ
bubblesfalse
cancelablefalse は、キャンセルするデフォルトの動作がないことを示します。
currentTargetイベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
targetイベントを送出するオブジェクトです。
errorイベントをトリガーしたエラーです。

ioError

イベント  
イベントオブジェクトの型: flash.events.IOErrorEvent
プロパティ IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

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

入出力エラーが発生してネットワーク処理が失敗したときに送出されます。

type プロパティ(ioError イベントオブジェクト)の値を定義します。

このイベントには、次のプロパティがあります。

プロパティ
bubblesfalse
cancelablefalse は、キャンセルするデフォルトの動作がないことを示します。
currentTargetイベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
errorID特定のエラーに関連付けられた参照番号です(AIR のみ)。
target入出力エラーが発生したネットワークオブジェクトです。
textエラーメッセージとして表示されるテキストです。

netStatus

イベント  
イベントオブジェクトの型: flash.events.NetStatusEvent
プロパティ NetStatusEvent.type = flash.events.NetStatusEvent.NET_STATUS

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

NetConnection オブジェクトが、そのステータスまたはエラーの状況をレポートするときに送出されます。netStatus イベントには info プロパティが含まれます。このプロパティは、接続試行が成功したかどうかなど、イベントに関する特定の情報を含む情報オブジェクトです。

type プロパティ(netStatus イベントオブジェクト)の値を定義します。

このイベントには、次のプロパティがあります。

プロパティ
bubblesfalse
cancelablefalse は、キャンセルするデフォルトの動作がないことを示します。
currentTargetイベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
infoオブジェクトのステータスまたはエラー状態を記述するプロパティを持つオブジェクトです。
targetそのステータスを報告する NetConnection または NetStream オブジェクトです。

関連する API エレメント

securityError

イベント  
イベントオブジェクトの型: flash.events.SecurityErrorEvent
プロパティ SecurityErrorEvent.type = flash.events.SecurityErrorEvent.SECURITY_ERROR

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

NetConnection.call() の呼び出しによって呼び出し元のセキュリティサンドボックスの外部にあるサーバーに接続しようとすると送出されます。

SecurityErrorEvent.SECURITY_ERROR 定数は、type プロパティ(securityError イベントオブジェクト)の値を定義します。

このイベントには、次のプロパティがあります。

プロパティ
bubblesfalse
cancelablefalse は、キャンセルするデフォルトの動作がないことを示します。
currentTargetイベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
targetセキュリティエラーを報告するネットワークオブジェクトです。
textエラーメッセージとして表示されるテキストです。

関連する API エレメント

NetConnectionExample.as

次の例では、Video オブジェクトを NetConnection クラスおよび NetStream クラスと共に使用して、FLV ファイルをロードして再生します。

この例では、Video オブジェクトと NetStream オブジェクトを作成し、Video.attachNetStream() メソッドと NetStream.play() メソッドを呼び出すコードがハンドラー関数に配置されます。ハンドラーは、NetConnection オブジェクトとの接続が成功した場合にのみ呼び出されます。つまり、netStatus イベントが返す info オブジェクトの code プロパティが成功を示しているときです。接続に成功するまで待ってから、NetStream.play() を呼び出すことをお勧めします。

package {
    import flash.display.Sprite;
    import flash.events.NetStatusEvent;
    import flash.events.SecurityErrorEvent;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.events.Event;

    public class NetConnectionExample extends Sprite {
        private var videoURL:String = "http://www.helpexamples.com/flash/video/cuepoints.flv";
        private var connection:NetConnection;
        private var stream:NetStream;
        private var video:Video = new Video();        

        public function NetConnectionExample() {
            connection = new NetConnection();
            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            connection.connect(null);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Stream not found: " + videoURL);
                    break;
            }
        }

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

        private function connectStream():void {
            addChild(video);
            var stream:NetStream = new NetStream(connection);
            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            stream.client = new CustomClient();
            video.attachNetStream(stream);
            stream.play(videoURL);
        }
    }
}

class CustomClient {
    public function onMetaData(info:Object):void {
        trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    }
    public function onCuePoint(info:Object):void {
        trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
    }
}




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

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