This page was saved using jaction on 2006-09-04 8:34:04.
Address: http://flexdocs.kr/docs/flex2/langref/mx/core/SoundAsset.html
Title: mx.core.SoundAsset (Flex™ 2 레퍼런스 가이드)  •  Size: 33340
Packagemx.core
Classpublic class SoundAsset
InheritanceSoundAsset Inheritance Sound Inheritance EventDispatcher Inheritance Object
ImplementsIFlexAsset

SoundAsset 는, Flex 어플리케이션에 포함된 사운드를 나타내는 Flash Player 의 Sound 클래스의 서브 클래스입니다.

MP3 파일의 사운드를 포함할 수가 있습니다. Flash 에 의해 작성된 SWF 파일의 사운드 심볼을 포함할 수도 있습니다. 어느 케이스에서도, MXML 컴파일러는, 포함된 사운드 데이터를 나타내도록(듯이) SoundAsset 를 확장하는 클래스를 자동 생성합니다.

통상은, Flex 어플리케이션을 작성할 경우에 SoundAsset 클래스를 직접 사용할 필요는 없습니다. 예를 들어, 다음과 같이 기술하는 것만으로, MP3 파일을 포함하여, SoundEffect 로 사용할 수가 있습니다.

<mx:SoundEffect id="beep" source="@Embed(source='Beep.mp3')"/>

MXML 컴파일러에 의해 SoundAsset 의 서브 클래스가 작성된 것을 인식해 둘 필요는 없습니다.

다만, ActionScript 레벨로 무엇을 하고 있는지를 이해해 두는 것은 유익합니다. 비트 맵을 ActionScript 에 포함하려면 , Class 형의 변수를 선언해, 거기에 [Embed] 메타데이타를 넣습니다. 예를 들어, 이와 같이 해 MP3 파일을 포함합니다.

[Bindable]
[Embed(source="sound1.mp3")]
private var beepClass:Class;

MXML 컴파일러는, 확장자(extension) . mp3 를 확인해, MP3 데이터를 Flash Player 가 사용하는 사운드 형식에 트랜스 코드 해, SoundAsset 클래스의 서브 클래스를 자동 생성해, 이 자동 생성된 클래스에의 참조를 변수로 설정합니다. 그 후, 이 클래스 참조를 사용해,new 연산자를 사용해 SoundAsset 의 인스턴스를 작성하는 것, 및 그것들에 Sound 클래스의 API 를 사용할 수가 있습니다.

var beepSound:SoundAsset = SoundAsset(new beepClass());
beepSound.play();

다만, 사운드 관련의 property 및 스타일을 사운드 생성 클래스로 설정할 수 있어 컴퍼넌트가 필요에 따라서 사운드 인스턴스를 작성하기 위해(때문에), SoundAsset 인스턴스를 스스로 작성할 필요는 거의 없습니다. 예를 들어, 이 사운드를 SoundEffect 로 재생하기 위해서, SoundEffect 의 source property를 beepClass 로 설정할 수가 있습니다. MXML 에서는, 다음과 같이 합니다.

<mx:SoundEffect id="beepEffect" source="{beepClass}"/>



Public property
 property정의
 InheritedbytesLoaded : uint
이 Sound object로 현재 이용할 수 있는 데이터의 바이트수를 돌려줍니다.
Sound
 InheritedbytesTotal : int
이 Sound object의 합계 바이트수를 돌려줍니다.
Sound
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 Inheritedid3 : ID3Info
MP3 파일의 일부인 메타데이타에 대한 액세스를 제공합니다.
Sound
 InheritedisBuffering : Boolean
외부 MP3 파일의 버퍼링 상태를 돌려줍니다.
Sound
 Inheritedlength : Number
현재의 사운드의 계속 시간을 나타내는 밀리 세컨드수입니다.
Sound
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
 Inheritedurl : String
사운드가 로드 되는 URL 입니다.
Sound
Public Methods
 Methods정의
  SoundAsset ()
constructor   .
SoundAsset
 InheritedaddEventListener (type:String , listener:Function , useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
event listener objects를 EventDispatcher object에 등록해, listener가 이벤트의 통지를 받도록(듯이) 합니다.
EventDispatcher
 Inheritedclose ():void
스트림(Stream)을 닫아, 데이터의 다운로드를 중지합니다.
Sound
 InheriteddispatchEvent (event:Event ):Boolean
이벤트를 event 플로우(flow)에 dispatch합니다.
EventDispatcher
 InheritedhasEventListener (type:String ):Boolean
EventDispatcher object에, 특정의 event 타입에 대해서 등록된 listener가 있을지 어떨지를 확인합니다.
EventDispatcher
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 Inheritedload (stream:URLRequest , context:SoundLoaderContext = null):void
지정한 URL 로부터 외부 MP3 파일의 로드를 개시합니다.
Sound
 Inheritedplay (startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):SoundChannel
사운드를 재생하는 SoundChannel object를 새롭게 작성합니다.
Sound
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedremoveEventListener (type:String , listener:Function , useCapture:Boolean = false):void
EventDispatcher object로부터 listener를 삭제합니다.
EventDispatcher
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
 InheritedtoString ():String
지정된 object의 string 표현을 돌려줍니다.
Object
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
 InheritedwillTrigger (type:String ):Boolean
지정된 event 타입에 대해, 이 EventDispatcher object 또는 그 조상에게 event listener가 등록되어 있는지 어떤지를 확인합니다.
EventDispatcher
이벤트
 이벤트일람정의
 Inheritedcomplete 데이터가 정상적으로 로드 되었을 때에 dispatch됩니다. Sound
 Inheritedid3 MP3 사운드로 ID3 데이터를 사용할 수 있는 경우에, Sound object에 의해 dispatch됩니다. Sound
 InheritedioError 입출력 에러가 발생해 로드 조작이 실패했을 때에 dispatch됩니다. Sound
 Inheritedopen 로드 조작이 개시했을 때에 dispatch됩니다. Sound
 Inheritedprogress 로드 처리를 실행중에 데이터를 수신했을 때에 dispatch됩니다. Sound
constructor    의 상세
SoundAsset()constructor   
public 함수 SoundAsset()

constructor   .







 

코멘트가 추가되었을 경우, 메일로 받기. | 코멘트 리포트

현재의 페이지: http://flexdocs.kr/docs/flex2/langref/mx/core/SoundAsset.html