Posted
Filed under Action Script

flash에서 사운드 객체 생성시

ac 2.0 API

The Sound class lets you control sound in a movie. You can add sounds to a movie clip from the library while the movie is playing and control those sounds. If you do not specify a target when you create a new Sound object, you can use the methods to control sound for the whole movie.

You must use the constructor new Sound to create a Sound object before calling the methods of the Sound class.

Availability: ActionScript 1.0; Flash Player


Constructor summary

Signature

Description

Sound([target:Object])

Creates a new Sound object for a specified movie clip.




api 에서 설명 한것 처럼 Sound Object를 생성 할 때 target<-- MovieClip 을 지정 하지 않으면,
전체 무비를 위한 사운드 제어 메소드를 사용 할 수 있다 ...
즉... loadmove를 통해서 불러 들여진 외부 swf에서  사운드 객체 생성시  target을 자기 자신으로 지정 하지 않는다면,,  root에 포함 되어 있는 사운드 객체를 참조 하겠다는 의미가 된다..

Sound  객체 생성시 반드시 target Object를 지정 한다.

var snd:Sound  = new Sound(this);

2010/01/07 19:43 2010/01/07 19:43