#22002/8/28 11:26:05
//当键被按下后执行下面的语句
onClipEvent (keyDown) {
//如果击键为'→'键就执行下面的语句
if (Key.getCode() == Key.LEFT) {
//把影片宽度附值给变量width
width = getProperty(mc, _width);
movex = getProperty(mc, _x);
if(movex<= 0){
movex = width/10;
}
//以影片宽度的十分之一作为图片移动的单位值
setProperty (mc, _x, movex-width/10);
}
if (Key.getCode() == Key.RIGHT) {
width = getProperty(mc,_width);
movex = getProperty(mc,_x);
if(movex >= 360-width){
movex = 360-width-width/10;
}
setProperty (mc, _x, movex + width/10);
}
if (Key.getCode() == Key.UP) {
height = getProperty(mc, _height);
movey = getProperty(mc, _y);
if(movey <= 0){
movey = height/10;
}
setProperty (mc, _y, movey-height/10);
}
if (Key.getCode() == Key.DOWN) {
height = getProperty(mc,_height);
movey = getProperty(mc, _y);
if(movey >= 160- height){
movey = 160 - height- height/10;
}
setProperty (mc, _y, movey + height/10);
}
}