先导入声音文件
步骤:
1 导入声音文件到库
2 选择库中的声音文件 为其加上链接(库的右上角有一链接菜单 为其命名为mySound)
3 在主场景中第一帧添加代码:
s = new Sound();
tachSound("mySound");
art();
以上是用代码来链接声音文件
以下是制作声道控制的步骤:
1 制作一个按钮
2 把铵钮拖到场景中
3 选择按钮 右键 - 转为影片剪辑 slide
4 选择slide 为里面的按钮输入代码
//按下鼠标时允许拖动
on (press) {
startDrag("", false, left, top, right, bottom);
dragging = true;
}
//释放鼠标按键时禁止拖动
on (release, releaseOutside) {
stopDrag();
dragging = false;
}
5 回到主场景中 选择slide 并添加代码:
onClipEvent (load) {
//使按钮不能上下移动
top = _y;
bottom = _y;
//按钮左右重点坐标
left = _x-85;
right = _x+85;
center = _x;
}
onClipEvent (enterFrame) {
if (dragging == true) {
//设置声音对象的平衡
_ tPan((_x-center)*2);
}
}
完成
。
。