MC的控制
1.分别制作1立体小球、1箭头按钮和2个放大镜按钮(“+”和“-”)的元件,可根据自己喜好自行设计形状和样式;
2.将上面制作的影片拖入到场景中,再复制三个箭头按钮,并旋转,使它们分别朝上、下、左、右四个方向。调整好各元件的位置;
3.给小球取一实例名,如:“qiu”;
4.接下来给这些按钮写AS:
向上按钮:
on (release) {
setProperty("/qiu", _y, (getProperty ( "/qiu", _y))-10);
}
向下按钮:
on (release) {
setProperty("/qiu", _y, (getProperty ( "/qiu", _y))+10);
}
向左按钮:
on (release) {
setProperty("/qiu", _x, (getProperty ( "/qiu", _x))-10);
setProperty("/qiu", _rotation, (getProperty("/qiu", _rotation))-10);
}
向右按钮:
on (release) {
setProperty("/qiu", _x, (getProperty ( "/qiu", _x))+10);
setProperty("/qiu", _rotation, (getProperty("/qiu", _rotation))+10);
}
缩小按钮:
on (release) {
setProperty("/qiu", _xscale, (getProperty ( "/qiu", _xscale))*0.9);
setProperty(""/qiu", _y, "");
setProperty("/qiu", _yscale, (getProperty ( "/qiu", _yscale))*0.9);
}
放大按钮:
on (release) {
setProperty("/qiu", _xscale, (getProperty ( "/qiu", _xscale))*1.1);
setProperty("/qiu", _yscale, (getProperty ( "/qiu", _yscale))*1.1);
}
5.OK,一切完成,ctrl+enter测试影片。
- 上一篇: Flash的播放速的制做
- 下一篇: Flash MX 2004行为功能再体验