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 태그
사용되지 않는 요소의 목록
액세스 가능성 구현 상수
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 응용 프로그램일 수 있습니다. 서버는 웹 서버, 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 인스턴스의 ID입니다.
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 인스턴스의 ID입니다.
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
[읽기 전용] URI가 NetConnection.connect() 메서드로 전달됩니다.
NetConnection
  usingTLS : Boolean
[읽기 전용] HTTPS가 아니라 기본 TLS(Transport Layer Security)를 사용하여 보안 연결이 이루어졌는지 여부를 나타냅니다.
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 객체에 대한 기본 객체 인코딩입니다. 객체를 이진 데이터로 쓰거나 이진 데이터에서 읽을 때 defaultObjectEncoding 속성은 데이터를 직렬화하기 위해 ActionScript 3.0 형식(ObjectEncoding.AMF3) 또는 ActionScript 1.0 및 ActionScript 2.0 형식(ObjectEncoding.AMF0) 중 어떤 AMF(Action Message Format) 버전이 사용되는지를 나타냅니다.

기본값은 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 인스턴스의 ID입니다. 이 속성은 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 연결을 사용할 경우 양의 값은 비활성 연결을 열어 두어야 하는 시간(밀리초)을 나타냅니다.
  • 값 0은 플랫폼의 기본 네트워킹 유휴 시간 제한 값을 사용해야 한다는 것을 나타냅니다.
  • 음의 값이면 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 인스턴스의 ID입니다. 이 속성은 RTMFP 연결에서만 의미가 있습니다.

각 NetConnection 인스턴스에는 고유한 nearID 속성이 있습니다. 어떠한 Flash Player, Adobe AIR 인스턴스 또는 NetConnection 인스턴스도 같은 ID를 갖지 않습니다.

다른 Flash Player 또는 Adobe AIR 인스턴스에서는 이 ID를 이 클라이언트에 대한 새 NetStream 연결의 peerID로 사용합니다. 결과적으로 이 ID는 이 인스턴스에 연결된 모든 피어 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 인스턴스에 대한 객체 인코딩입니다.

객체를 이진 데이터로 쓰거나 이진 데이터에서 읽을 때 defaultObjectEncoding 속성은 데이터를 직렬화하기 위해 ActionScript 3.0 형식(ObjectEncoding.AMF3) 또는 ActionScript 1.0 및 ActionScript 2.0 형식(ObjectEncoding.AMF0) 중 어떤 AMF(Action Message Format) 버전이 사용되는지를 나타냅니다. objectEncoding 속성을 설정해서 NetConnection 인스턴스에 대한 AMF 버전을 설정합니다.

응용 프로그램이 Flash Player 9 이전에 릴리스된 서버와 통신해야 하는 경우 이 속성을 잘 이해해야 합니다. 다음과 같은 세 가지 시나리오가 가능합니다.

  • 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 속성을 사용하여 연결 기준으로 객체의 인코딩을 설정합니다. Flash Media Server 2와 같은 AMF0 인코딩을 사용하는 서버로 연결하려면 ObjectEncoding.AMF0으로 설정하고, Flex Data Services 2와 같은 AMF3 인코딩을 사용하는 서버로 연결하려면 ObjectEncoding.AMF3으로 설정합니다.

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(Real-Time Messaging Protocol)
  • "rtmpe": 암호화된 RTMP
  • "rtmpt": HTTP 터널링 RTMP
  • "rtmpte": HTTP 터널링 암호화된 RTMP
  • "rtmps": HTTPS 기반 RTMP
  • "rtmfp": RTMFP(Real-Time Media Flow Protocol)



구현
    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를 사용하는 경우에만 적용할 수 있습니다. CONNECTCONNECTOnly 메서드는 프록시 서버를 통해 네트워크에 연결된 사용자에게만 적용할 수 있습니다.



구현
    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

URI가 NetConnection.connect() 메서드로 전달됩니다. 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(Transport Layer Security)를 사용하여 보안 연결이 이루어졌는지 여부를 나타냅니다. 이 속성은 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[objectPath/]method 형식으로 지정된 메서드입니다. 예를 들어 someObject/doSomething 명령은 모든 선택적 ... arguments 매개 변수를 사용하여 clientObject.someObject.doSomething() 메서드를 호출하도록 원격 서버에 지시합니다. 객체 경로가 없는 경우 원격 서버에서 clientObject.doSomething()이 호출됩니다.

Flash Media Server가 있을 경우, command는 응용 프로그램의 서버측 스크립트에서 정의한 함수의 이름입니다. 서버측 스크립트가 응용 프로그램 디렉토리의 루트 레벨에 위치한 경우 command 앞에 객체 경로를 사용할 필요가 없습니다.

 
responder:Responder — 서버로부터의 반환 값을 처리하기 위해 사용되는 선택적 객체입니다. Responder 객체는 반환 값을 처리하기 위해 resultstatus라는 두 가지 정의된 메서드를 가질 수 있습니다. 결과로 오류가 반환될 경우 status가 호출되고, 그렇지 않으면 result가 호출됩니다. Responder 객체는 특정 작업과 관련된 오류를 처리할 수 있으며 NetConnection 객체는 연결 상태와 관련된 오류에 응답할 수 있습니다.
 
... 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"을 전달하여 로컬 파일 시스템 또는 웹 서버에서 비디오 및 mp3 파일을 재생합니다.
  • "http" URL을 전달하여 Flash Remoting을 실행하는 응용 프로그램 서버에 연결합니다. NetConnection 객체를 통해 함수를 호출하고 응용 프로그램 서버로부터 결과를 반환하려면 NetServices 클래스를 사용합니다. 자세한 내용은 Flash Remoting 설명서를 참조하십시오.
  • "rtmp/e/s" URL을 전달하여 Flash Media Server 응용 프로그램에 연결합니다.
  • "rtmfp" URL을 전달하여 RTMFP 클라이언트-서버, 피어 투 피어, IP 멀티캐스트 통신을 위한 양방향 네트워크 끝점을 만듭니다.
  • 문자열 "rtmfp:"를 전달하여 RTMFP IP 멀티캐스트 통신을 위한 서버 없는 양방향 네트워크 끝점을 만듭니다.

다음과 같은 보안 모델을 고려합니다.

  • 기본적으로 Flash Player 또는 AIR는 샌드박스 간의 액세스를 거부합니다. URL 정책 파일을 사용하여 웹 사이트에서 리소스에 액세스를 허용할 수 있습니다.
  • 응용 프로그램은 서버 리소스에 대한 액세스를 거부할 수 있습니다. Flash Media Server 응용 프로그램에서 서버측 ActionScript 코드를 사용하여 액세스를 거부합니다. 자세한 내용은 Flash Media Server 설명서를 참조하십시오.
  • 호출하는 파일이 local-with-file-system 샌드박스에 있는 경우 NetConnection.connect()를 호출할 수 없습니다.
  • 일반적으로 예약된 포트에 연결할 수 없습니다. 차단된 포트의 전체 목록은 ActionScript 3.0 개발자 안내서의 "제한적 네트워킹 API"를 참조하십시오.
  • SWF 파일에서 이 메서드를 호출하지 못하도록 하려면 해당 SWF 내용이 포함된 HTML 페이지에서 objectembed 태그의 allowNetworking 매개 변수를 설정합니다.

그러나 Adobe AIR에서 application 보안 샌드박스의 내용, 즉 AIR 응용 프로그램과 함께 설치되는 내용은 이러한 보안 제한에 의해 제한되지 않습니다.

보안에 대한 자세한 내용은 Adobe Flash Player 개발자 센터에서 보안을 참조하십시오.

매개 변수

command:Stringcommand 매개 변수에 다음 값 중 하나를 사용합니다.
  • 로컬 파일 시스템 또는 웹 서버에서 비디오 및 mp3 파일을 재생하려면 null을 전달합니다.
  • Flash Remoting을 실행하는 응용 프로그램 서버에 연결하려면 http 프로토콜을 사용하는 URL을 전달합니다.
  • (Flash Player 10.1 또는 AIR 2 이상) RTMFP IP 멀티캐스트 통신을 위해 서버 없는 네트워크 끝점을 만들려면 문자열 "rtmfp:"을 전달합니다. 서버를 사용하지 않고 제작자로부터 IP 멀티캐스트 스트림을 수신하려면 이 연결 유형을 사용합니다. 또한 IP 멀티캐스트를 사용하여 동일한 LAN(Local Area Network)에 있는 피어를 검색하려는 경우에도 이 연결 유형을 사용할 수 있습니다.
  • 이 연결 유형에는 다음과 같은 제한 사항이 있습니다.

    동일한 LAN에 있는 피어끼리만 검색할 수 있습니다.

    IP 멀티캐스트를 사용하는 경우 Flash Player는 스트림을 수신할 수 있지만 전송할 수는 없습니다.

    Flash Player 및 AIR는 피어 투 피어 그룹에서 스트림을 전송하고 수신할 수 있지만 IP 멀티캐스트를 사용하는 동일한 LAN에서 피어를 검색해야 합니다.

    이 기술은 일대일 통신에 사용할 수 없습니다.

  • Flash Media Server에 연결하려면 해당 서버의 응용 프로그램 URI를 전달합니다. 다음 구문을 사용하십시오(대괄호 안의 항목은 생략 가능).

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

    rtmp, rtmpe, rtmps, rtmpt, rtmpte 또는rtmfp 프로토콜 중 하나를 사용합니다. 연결이 성공적으로 이루어지면 netStatus 이벤트가 NetConnection.Connect.Successcode 속성을 갖고 반환됩니다. 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 — 연결에 실패했습니다. netStatus 이벤트 핸들러 내에서 connect()를 호출하는 경우 이러한 상황이 발생할 수 있으며, 이는 허용되지 않습니다.
 
SecurityError — Local-with-filesystem SWF 파일은 인터넷 통신이 불가능합니다. SWF 파일을 네트워킹 가능한 로컬 파일(local-with-networking) 또는 신뢰할 수 있는 파일로 다시 규정하면 이 문제를 해결할 수 있습니다.
 
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 상수는 asyncError 이벤트 객체의 type 속성 값을 정의합니다.

이 이벤트에는 다음과 같은 속성이 있습니다.

속성
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

네트워크 작업의 실패를 유발하는 입력 또는 출력 오류가 발생할 때 전달됩니다.

ioError 이벤트 객체의 type 속성 값을 정의합니다.

이 이벤트에는 다음과 같은 속성이 있습니다.

속성
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 속성이 포함되어 있습니다.

netStatus 이벤트 객체의 type 속성 값을 정의합니다.

이 이벤트에는 다음과 같은 속성이 있습니다.

속성
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 상수는 securityError 이벤트 객체의 type 속성 값을 정의합니다.

이 이벤트에는 다음과 같은 속성이 있습니다.

속성
bubblesfalse
cancelablefalse. 취소할 기본 비헤이비어가 없습니다.
currentTarget이벤트 리스너를 통해 Event 객체를 처리하고 있는 객체입니다.
target보안 오류를 보고하는 네트워크 객체입니다.
text오류 메시지로 표시될 텍스트입니다.

관련 API 요소

NetConnectionExample.as

다음 예제에서는 NetConnection 및 NetStream 클래스와 함께 Video 객체를 사용하여 FLV 파일을 로드 및 재생합니다.

이 예제에서는 Video 및 NetStream 객체를 만들고 Video.attachNetStream()NetStream.play() 메서드를 호출하는 코드가 핸들러 함수에 배치됩니다. 핸들러는 NetConnection 객체에 대한 연결에 성공할 경우, 즉 netStatus 이벤트가 성공을 나타내는 code 속성이 있는 info 객체를 반환할 경우에만 호출됩니다. 연결에 성공할 때까지 기다렸다가 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 클래스는 영어로 나타납니다.