TypeError: Error #1007: Instantiation attempted on a non-constructor. when trying to play audio

TypeError: Error #1007: Instantiation attempted on a non-constructor. when trying to play audio

我正在使用 Adob​​e Animate CC 2019,ActionScript 3。

在我的主时间轴中,我在单个帧上使用影片剪辑,每个帧都应用了 stop(); 动作。我的主要内容在每个影片剪辑中。在每个影片剪辑中,我在一层上有一个 PNG 序列,在另一层上有我要播放的音频。我的图书馆里有所有需要的音频。每个音频都已为 ActionScript 导出并分配了 class。在所有影片剪辑中,我通过在(空白)音频层上所需帧处使用代码在所需帧处播放声音。示例代码是:

var fl_SC:SoundChannel;

var s:Sound = new (b);
fl_SC = s.play();

其中 b 是音频的 class。

我已经重复了所有这些以创建另一个影片剪辑。我创建了一个影片剪辑,将它放在主时间轴的一个帧上,向该帧添加 stop(); 动作,进入影片剪辑内部,在图层上导入图像序列,创建另一个(空白)图层,添加一个关键帧,向关键帧添加动作:

var fl_SC:SoundChannel;

var s:Sound = new (z);
fl_SC = s.play();

其中 z 是音频的 class。

问题是,我的 SWF 文件在没有音频层的情况下工作正常,但是,一旦我使用上述代码添加层,我的输出 window 就会抛出此错误:

TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Audi_fla::MarketShareTrend_9/frame1()
at flash.display::MovieClip/gotoAndPlay()
at Audi_fla::MainTimeline/fl_ClickToGoToAndPlayFromFrame_7()

其中 Audi.fla 是我的 Animate 文件的名称,frame1(在影片剪辑中)是我要添加此动作的那个,市场份额趋势是影片剪辑的名称.

不知道为什么要提到fl_ClickToGoToAndPlayFromFrame_7()部分。这是我在主时间轴的前一帧中添加的其他一些影片剪辑的代码部分。

这是代码:

stop();

movieClip_6.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_7);

function fl_ClickToGoToAndPlayFromFrame_7(event:MouseEvent):void
{
    gotoAndPlay(54);
}

如何消除错误并保持音频在所需的影片剪辑中播放?

正如@Organis 在评论中指出的那样,问题是 class 名称 z。更改了名称,现在同样有效。