[英]AS3 type was not found : Sound
我有這小塊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
我怎樣才能解決這個問題?
帆布
您必須導入類:
import flash.media.Sound;
import flash.media.SoundChannel;
要不就:
import flash.media.*;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.