注:a1为自定义变量,名字可以随便起的。另外此处的播放是start而不是play
停止:
on(release){
a1.stop();
}
(5)、若将动作设在帧上(比如放在第一帧上),则代码可以这样写:
a1=new Sound();
a1.attachSound("s1");
a1.start();
然后在按钮上写上:
on(release){
a1.start();
}
或
on(release){
a1.stop();
}
8、startDrag 方法
语法1:
startDrag(target[,lock[,left,top,right,bottom]]);
语法2:
anyMovieClip.startDrag([lock,left,right,top,bottom]);
功能:设置影片剪辑实例可被鼠标拖拽,以及可拖拽的范围,例如
onClipEvent(mouseDown){
this.startDrag(true);
}
onClipEvent(mouseUp){
this.stopDrag();
}