English 中文(简体)
使用 Linkage 从图书馆装入音频文件出错
原标题:Error loading Audio file from Library using Linkage

我从图书馆拿一个音频文件时遇到麻烦, 以前我把音频文件装在外部,就像:

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;

时 时

我看不到我做错什么了 任何帮助和一切帮助都会感激不尽

最佳回答
问题回答

暂无回答




相关问题
Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

Play sound in iPhone web app with Javascript?

I m currently creating an iPhone web application for piano chords, and I wanted to add an option that would let the user press a Play button and play the selected chord. However, I m not sure how to ...

热门标签