我从图书馆拿一个音频文件时遇到麻烦, 以前我把音频文件装在外部,就像:
var s1: 声音 = 新声音 (新的 URL 请求 (“ 声音/ Melody1. mp3 ” ) );
然而,我现在需要从图书馆上载它们,因为我遇到一个与 mp3 文件有关的循环问题。
Below is my attempt, however I am receiving the error: Scene 1, Layer Actions , Frame 1, Line 21 1061: Call to a possibly undefined method attachSound through a reference with static type flash.media:Sound.
/* Click to Play/Stop Sound 1 Clicking on the symbol instance plays the specified sound. Clicking on the symbol instance a second time stops the sound. */
Btn_ Melody1. 增加的 Event 倾听器( 移动 Event. CLICK, Fl_ ClickToPlayStopSound1) ;
Var fl_ SC1: 声音通道;
//This variable keeps track of whether you want to play or stop the sound var fl_ToPlay1:Boolean = true;
函数 fl_ ClickToClitToPlayStopSound1( evt: 鼠标Event): 避免
{ { {
if (fl_ToPlay1)
{ { {
var s1:Sound = new Sound();
s1.attachSound("Melody1");
fl_SC1 = s1.play(0,999);
时 时
else
{ { {
fl_SC1.stop();
时 时
fl_ToPlay1 = ! fl_ToPlay1;
时 时
我看不到我做错什么了 任何帮助和一切帮助都会感激不尽