我有一小段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
我该如何解决这个问题?
帆布
答案 0 :(得分:3)
您必须导入类:
import flash.media.Sound;
import flash.media.SoundChannel;
或只是:
import flash.media.*;