package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
public class MasterContainer extends MovieClip
{
public var playTimer:Timer = new Timer(1000,16);
public function MasterContainer()
{
// constructor code
t1.setSoundName("drum.mp3");
t2.setSoundName("pluck.mp3");
t3.setSoundName("drum.mp3");
t4.setSoundName("drum.mp3");
t5.setSoundName("drum.mp3");
t6.setSoundName("drum.mp3");
t7.setSoundName("drum.mp3");
t8.setSoundName("drum.mp3");
masterPlay.addEventListener(flash.events.MouseEvent.CLICK, handleMasterPlay);
playTimer.addEventListener(TimerEvent.TIMER, onTick);
}
public function onTick(event:TimerEvent):void
{
t1.playSound();
t2.playSound();
t3.playSound();
t4.playSound();
t5.playSound();
t6.playSound();
t7.playSound();
t8.playSound();
}
private function handleMasterPlay(e:MouseEvent):void
{
trace('bla');
}
}
}
这是我班的切碎版本。我得到的错误是:C:\Users\Mark\Documents\Creative Multimedia\semester 5\Action Script\project\MasterContainer.as, Line 9 1046: Type was not found or is not a compile-time constant: Timer.
C:\Users\Mark\Documents\Creative Multimedia\semester 5\Action Script\project\MasterContainer.as,第 9 行 1180:调用可能未定义的方法 Timer。
C:\Users\Mark\Documents\Creative Multimedia\semester 5\Action Script\project\MasterContainer.as,第 9 行 1180:调用可能未定义的方法 Timer。
我不明白这个错误任何帮助将不胜感激。