加入两个按钮,一个命名为btnclick,为单击停止
一个为btndbclick,为双击播放
制作一个简单的小动画,加入如下代码:
function startMovie(event:MouseEvent):void
{
this.play();
}
function stopMovie(event:MouseEvent):void
{
this.stop();
}
btndbclick.doubleClickEnabled=true
//btnclick.addEventListener(MouseEvent.CLICK, startMovie);
btndbclick.addEventListener(MouseEvent.DOUBLE_CLICK,startMovie)
btnclick.addEventListener(MouseEvent.CLICK,stopMovie)