Flash
Flash sound
OJR
2008. 11. 7. 11:26
// 외부 파일 로드후 실행
_root.loadSoundbtn.onRelease = function(){
_root.click_loadSoundBtn();
}
var my_sound:Sound = new Sound();
my_sound.onLoad = function(success:Boolean) {
if (success) {
my_sound.start();
status_txt.text = "Sound loaded";
} else {
status_txt.text = "Sound failed";
}
trace( success );
};
function click_loadSoundBtn(){
my_sound.loadSound("song2.mp3", true);
}
_root.loadSoundbtn.onRelease = function(){
_root.click_loadSoundBtn();
}
var my_sound:Sound = new Sound();
my_sound.onLoad = function(success:Boolean) {
if (success) {
my_sound.start();
status_txt.text = "Sound loaded";
} else {
status_txt.text = "Sound failed";
}
trace( success );
};
function click_loadSoundBtn(){
my_sound.loadSound("song2.mp3", true);
}
/////////////////////////////////////////////////
// 라이브러리에 있는 사운드 실행
// 단 이경우 로드되어진 자식swf파일의 라이브러리는 안된다.
var my_sound2:Sound = new Sound();
my_sound2.attachSound("mySoundID");
my_sound2.onSoundComplete = function() {
trace("mySoundID completed");
status_txt2.text = "attachSound 성공";
};
_root.attachSoundbtn.onRelease = function(){
my_sound2.start();
}