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

SoundEffect 클래스는 MP3 오디오 파일을 재생합니다. 예를 들어, 유저가 Button 컨트롤을 클릭했을 때에, 사운드를 재생할 수가 있습니다. 이 effect에서는, 사운드의 반복 재생, 원시 파일의 선택, 및 볼륨과 빵의 제어가 가능합니다.

MP3 파일을 지정하려면 ,source property를 사용합니다. 이미 포함(Embed)되어 있는 MP3 파일이 있는 경우는,Embed 키워드를 사용해 MP3 파일의 Class object를 source property에 건네줍니다. 그 이외의 경우는, MP3 파일에의 완전한 URL 를 지정해 주세요.

MXML 문장구조법expandedMXML 문장구조법의 비표시

<mx:SoundEffect> 태그는 Super 클래스의 모든 태그 속성을 Inheritance해, 다음의 태그를 추가합니다.

 <mx:SoundEffect property id="ID" autoLoad="true|false" bufferTime="1000" loops="0" panEasingFunction="" panFrom="0" source="" startTime="0" useDuration="true|false" volumeEasingFunction="true|false" volumeTo="1" 

event complete="디폴트치 없음" id3="No default" ioError="디폴트치 없음" progress="디폴트치 없음" />

View the examples

See also

mx.effects.effectClasses.SoundEffectInstance
flash.media.Sound


Public property
 property정의
  autoLoad : Boolean
true 의 경우,source 가 지정되면 MP3 파일을 로드합니다.
SoundEffect
  bufferTime : Number = 1000
SoundEffect 클래스는, 내부의 Sound object를 사용해, MP3 파일을 제어합니다.
SoundEffect
 InheritedclassName : String
"Fade" 등, effect 클래스의 이름입니다.
Effect
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 InheritedcustomFilter : EffectTargetFilter
effect를 재생하는 타겟을 특정하기 위해서, effect에 의해 사용되는 타입 EffectTargetFilter 의 custom 필터 object를 지정합니다.
Effect
 Inheritedduration : Number
effect의 계속 시간을 나타냅니다 (밀리 세컨드 단위).
Effect
 Inheritedfilter : String
effect의 타겟을 필터링 하는 알고리즘을 지정합니다.
Effect
 InheritedinstanceClass : Class
이 effect 클래스의 effect 인스턴스 클래스를 지정하는 Class 형의 object를 나타냅니다.
Effect
  isLoading : Boolean
[read-only] 이 property는, MP3 가 로드 되고 있는 경우는,true 입니다.
SoundEffect
 InheritedisPlaying : Boolean
effect의 인스턴스중 한쪽이 현재 재생중의 경우에 true, 그렇지 않은 경우에 false 가 되는 읽기 전용(read-only) 플래그입니다.
Effect
  loops : int = 0
루프내에서 사운드를 재생하는 회수를 나타냅니다. 값이 0 의 경우, effect는 1 회 재생해, 값이 1 의 경우, effect는 2 회 재생됩니다.
SoundEffect
  panEasingFunction : Function
빵 effect의 이징 함수를 나타냅니다.
SoundEffect
  panFrom : Number
Sound object의 초기 빵을 나타냅니다.
SoundEffect
  panTo : Number
Sound object의 최종 빵을 나타냅니다.
SoundEffect
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
 InheritedrelevantProperties : Array
필터링 실행시에 사용하는 property명의 배열을 나타냅니다.
Effect
 InheritedrelevantStyles : Array
필터링 실행시에 사용하는 스타일명의 배열을 나타냅니다.
Effect
 InheritedrepeatCount : int = 1
effect를 반복하는 회수를 나타냅니다.
Effect
 InheritedrepeatDelay : int = 0
effect를 반복하기 전의 대기 시간을 나타냅니다 (밀리 세컨드 단위).
Effect
  sound : Sound
[read-only] MP3 파일이 로드 된 Sound object를 나타냅니다.
SoundEffect
  source : Object
재생하는 MP3 파일의 URL 또는 클래스를 나타냅니다.
SoundEffect
 InheritedstartDelay : int = 0
effect를 개시하기 전의 대기 시간을 나타냅니다 (밀리 세컨드 단위).
Effect
  startTime : Number = 0
재생을 개시하는 MP3 파일의 초기 위치를 나타냅니다 (밀리 세컨드 단위).
SoundEffect
 InheritedsuspendBackgroundProcessing : Boolean = false
true 의 경우, effect의 재생중에 모든 백그라운드 처리를 블록 합니다.
Effect
 Inheritedtarget : Object
이 effect가 적용되는 UIComponent object를 나타냅니다.
Effect
 Inheritedtargets : Array
effect의 타겟인 UIComponent object의 배열을 나타냅니다.
Effect
  useDuration : Boolean = true
true 의 경우,duration property로 지정된 시간의 경과후에 effect를 정지합니다.
SoundEffect
  volumeEasingFunction : Function
볼륨 effect의 이징 함수를 나타냅니다.
SoundEffect
  volumeFrom : Number
Sound object의 초기 볼륨을 나타냅니다.
SoundEffect
  volumeTo : Number
Sound object의 최종 볼륨을 나타냅니다.
SoundEffect
Public Methods
 Methods정의
  SoundEffect (target:Object = null)
constructor   .
SoundEffect
 InheritedaddEventListener (type:String , listener:Function , useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
event listener objects를 EventDispatcher object에 등록해, listener가 이벤트의 통지를 받도록(듯이) 합니다.
EventDispatcher
 InheritedcaptureStartValues ():void
effect의 타겟으로 두어 관련하는 property의 현재가를 capther 합니다.
Effect
 InheritedcreateInstance (target:Object = null):EffectInstance
1 개의 effect 인스턴스를 작성해, 그것을 초기화합니다.
Effect
 InheritedcreateInstances (targets:Array = null):Array
타겟 object의 배열을 취득해, 각 타겟으로 createInstance() Methods를 호출합니다.
Effect
 InheriteddispatchEvent (event:Event ):Boolean
이벤트를 event 플로우(flow)에 dispatch합니다.
EventDispatcher
 Inheritedend (effectInstance:EffectInstance = null):void
현재 재생중의 effect를 모두 중단해, 즉시 effect의 끝나에 점프 합니다.
Effect
 InheritedgetAffectedProperties ():Array
string의 배열을 돌려줍니다. 각 string는, 이 effect에 의해 변경되는 property의 이름입니다.
Effect
 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
  load ():void
source property에 URL 가 지정되고 있는 경우는, MP3 를 로드합니다.
SoundEffect
 Inheritedpause ():void
resume() Methods를 호출할 때까지, effect를 일시정지합니다.
Effect
 Inheritedplay (targets:Array = null, playReversedFromEnd:Boolean = false):Array
effect의 재생을 개시합니다.
Effect
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedremoveEventListener (type:String , listener:Function , useCapture:Boolean = false):void
EventDispatcher object로부터 listener를 삭제합니다.
EventDispatcher
 Inheritedresume ():void
pause() Methods를 호출해, effect를 일시정지한 후, 재개시킵니다.
Effect
 Inheritedreverse ():void
effect가 현재 재생중의 경우에, effect의 현재 위치로부터 개시해, 역순서로 effect를 재생합니다.
Effect
 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
Protected Methods
 Methods정의
 InheritedapplyValueToTarget (target:Object , property:String , value:* , props:Object ):void
effect 인프라스트럭쳐에 의해 내부적으로 사용됩니다.
Effect
 InheritedeffectEndHandler (event:EffectEvent ):void
effect 인스턴스의 재생 종료시에 불려 갑니다.
Effect
 InheritedeffectStartHandler (event:EffectEvent ):void
이 Methods는, effect 인스턴스의 재생 개시시에 불려 갑니다.
Effect
 InheritedfilterInstance (propChanges:Array , targ:Object ):Boolean
effect 인스턴스의 필터링에 필요한 논리를 결정합니다.
Effect
 InheritedgetValueFromTarget (target:Object , property:String ):*
타겟으로부터 property의 값을 취득하기 위해서 captureStartValues() 에 의해 불려 갑니다.
Effect
 InheritedinitInstance (instance:EffectInstance ):void
effect 인스턴스에 effect의 property를 복사합니다.
Effect
이벤트
 이벤트일람정의
  complete 사운드 파일의 로드가 완료하면 dispatch됩니다. SoundEffect
 InheritedeffectEnd effect의 재생 정지시 (effect의 재생 완료시, 또는 effect가 end() Methods의 호출에 의해 중단되었을 때)에 dispatch됩니다. Effect
 InheritedeffectStart effect의 재생 개시시에 dispatch됩니다. Effect
  id3 ID3 데이터가 MP3 사운드 파일로 사용할 수 있게 되면 dispatch됩니다. SoundEffect
  ioError 사운드 파일의 로드안에 에러가 발생하면 dispatch됩니다. SoundEffect
  progress 사운드 파일의 로드시에 정기적으로 dispatch됩니다. SoundEffect
property의 상세
autoLoadproperty
autoLoad:Boolean   [read-write]

true 의 경우,source 가 지정되면 MP3 파일을 로드합니다.

디폴트치true.

Implements
    public function get autoLoad():Boolean
    public function set autoLoad(value:Boolean ):void
bufferTimeproperty 
public var bufferTime:Number = 1000

SoundEffect 클래스는, 내부의 Sound object를 사용해, MP3 파일을 제어합니다. 이 property에 의해, Sound object의 버퍼로 보관 유지하는 사운드 데이터에 응한 최소 시간이 지정됩니다 (단위는 밀리 세컨드). Sound object는, 재생의 개시전, 및 네트워크 정지 후의 재생의 재개전에 적어도 이 대량의 데이터를 취득할 때까지 대기합니다.

디폴트치1000.

isLoadingproperty 
isLoading:Boolean   [read-only]

이 property는, MP3 가 로드 되고 있는 경우는,true 입니다.

Implements
    public function get isLoading():Boolean
loopsproperty 
public var loops:int = 0

루프내에서 사운드를 재생하는 회수를 나타냅니다. 값이 0 의 경우, effect는 1 회 재생해, 값이 1 의 경우, effect는 2 회 재생됩니다. MP3 파일을 반복하는 경우,useDuration property의 설정에 의해 재생 시간이 결정됩니다.

duration property는, 이 property보다 우선됩니다. effect의 지속 시간이 사운드를 최저 1 회 재생하는데 필요하게 되는 시간에 못 미친 경우, 사운드는 루프 처리되지 않습니다.

디폴트치0.

panEasingFunctionproperty 
public var panEasingFunction:Function

빵 effect의 이징 함수를 나타냅니다. 이 함수를 사용해,panFrompanTo 의 범위의 값을 보간 합니다.

panFromproperty 
public var panFrom:Number

Sound object의 초기 빵을 나타냅니다. 값의 범위는 -1. 0 ~ 1.0 입니다. 여기서,-1. 0 은 왼쪽의 채널만을 사용해, 1.0 은 오른쪽의 채널만을 사용합니다. 0.0 은 2 개의 채널간에 사운드가 균일하게 되도록(듯이) 밸런스를 취합니다.

디폴트치0.0.

panToproperty 
public var panTo:Number

Sound object의 최종 빵을 나타냅니다. 값의 범위는 -1. 0 ~ 1.0 입니다. 여기서,-1. 0 은 왼쪽의 채널만을 사용해, 1.0 은 오른쪽의 채널만을 사용합니다. 0.0 은 2 개의 채널간에 사운드가 균일하게 되도록(듯이) 밸런스를 취합니다.

디폴트치0.0.

soundproperty 
sound:Sound   [read-only]

MP3 파일이 로드 된 Sound object를 나타냅니다.

Implements
    public function get sound():Sound
sourceproperty 
source:Object   [read-write]

재생하는 MP3 파일의 URL 또는 클래스를 나타냅니다. 이미 포함(Embed)되어 있는 MP3 파일이 있는 경우는,Embed 키워드를 사용해 MP3 파일의 Class object를 source property에 건네줍니다. 그 이외의 경우는, MP3 파일에의 완전한 URL 를 지정해 주세요.

Implements
    public function get source():Object
    public function set source(value:Object ):void
startTimeproperty 
public var startTime:Number = 0

재생을 개시하는 MP3 파일의 초기 위치를 나타냅니다 (밀리 세컨드 단위).

디폴트치0.

useDurationproperty 
public var useDuration:Boolean = true

true 의 경우,duration property로 지정된 시간의 경과후에 effect를 정지합니다. false 의 경우, MP3 의 재생 또는 루프의 완료 후에 effect를 정지합니다.

디폴트치true.

volumeEasingFunctionproperty 
public var volumeEasingFunction:Function

볼륨 effect의 이징 함수를 나타냅니다. 이 함수를 사용해,volumeFromvolumeTo 의 범위의 값을 보간 합니다.

volumeFromproperty 
public var volumeFrom:Number

Sound object의 초기 볼륨을 나타냅니다. 값의 범위는 0.0 에서 1.0 입니다.

디폴트치1.

volumeToproperty 
public var volumeTo:Number

Sound object의 최종 볼륨을 나타냅니다. 값의 범위는 0.0 에서 1.0 입니다.

디폴트치1.

constructor    의 상세
SoundEffect()constructor   
public 함수 SoundEffect(target:Object = null)

constructor   .

Parameters
target:Object (default = null) — 이 effect로 애니메이션화하는 object를 나타냅니다.
Methods의 상세
load()Methods
public function load():void

source property에 URL 가 지정되고 있는 경우는, MP3 를 로드합니다.

이벤트의 상세
completeevent 
Event object type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

사운드 파일의 로드가 완료하면 dispatch됩니다.

complete event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetevent listener로 Event object를 액티브하게 처리하고 있는 object입니다.
target로드가 완료한 네트워크 object입니다. target 는, 반드시 event listener를 등록한 표시 리스트내의 object라고는 할 수 없습니다. 현재 이벤트를 처리하고 있는 표시 리스트내의 object에 액세스 하려면 ,currentTarget property를 사용합니다.
id3event  
Event object type: flash.events.Event
Event.type property = flash.events.Event.ID3

ID3 데이터가 MP3 사운드 파일로 사용할 수 있게 되면 dispatch됩니다.

id3 event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetevent listener로 Event object를 액티브하게 처리하고 있는 object입니다.
targetID3 데이터가 현재 사용 가능한 MP3 를 로드하고 있는 Sound object입니다. target 는, 반드시 event listener를 등록한 표시 리스트내의 object라고는 할 수 없습니다. 현재 이벤트를 처리하고 있는 표시 리스트내의 object에 액세스 하려면 ,currentTarget property를 사용합니다.
ioErrorevent  
Event object type: flash.events.IOErrorEvent
IOErrorEvent.type property = flash.events.IOErrorEvent.IO_ERROR

사운드 파일의 로드안에 에러가 발생하면 dispatch됩니다.

ioError event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetevent listener로 Event object를 액티브하게 처리하고 있는 object입니다.
target입출력 에러가 발생한 네트워크 object입니다.
text에러 메세지로서 표시되는 텍스트입니다.
progressevent  
Event object type: flash.events.ProgressEvent
ProgressEvent.type property = flash.events.ProgressEvent.PROGRESS

사운드 파일의 로드시에 정기적으로 dispatch됩니다.

event object에서는, 현재 로드 되고 있는 바이트수와 로드 대상의 합계 바이트수에 액세스 할 수 있습니다. 이 이벤트는 항상 dispatch된다고는 할 수 없습니다. progress 이벤트가 dispatch되어 있지 않아도 complete 이벤트가 dispatch되는 경우도 있습니다.

progress event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
bytesLoadedlistener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.
bytesTotal로드 프로세스가 성공했을 경우에 최종적으로 로드 되는 아이템 또는 바이트의 총수입니다.
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetevent listener로 Event object를 액티브하게 처리하고 있는 object입니다.
target진행 상황을 리포트하는 네트워크 object입니다.
Examples
SoundEffectExample
<? xml version="1.0"? >
<! -- Simple example to demonstrate the SoundEffect effect.  -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:SoundEffect id="mySounds" source="@Embed(source='assets/jazz.mp3')"/>

    <mx:Panel title="Sound Effect Example" width="75%" height="75%" 
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

        <mx:Label width="100%" color="blue" 
            text="Click on the phone to hear the sound effect. "/>

        <mx:Image id="flex" source="@Embed(source='assets/Nokia_6630.png')" 
            mouseDownEffect="{mySounds}"/>

    </mx:Panel>
</mx:Application>






 

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

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