0

我有一小段 AS3 代码,但它不起作用:(

var snd:Sound = new Sound(new URLRequest("Hit1.wav"));
var channel:SoundChannel = new SoundChannel();
channel= snd.play();

我得到的只是

type was not found or was not a compile-time constant: Sound
type was not found or was not a compile-time constant: SoundChannel

我怎样才能解决这个问题?

帆布

4

1 回答 1

3

您必须导入类:

import flash.media.Sound;
import flash.media.SoundChannel;

要不就:

import flash.media.*;
于 2013-01-09T17:27:54.583 回答