Flash脚本错误

来源:百度知道 编辑:UC知道 时间:2024/05/19 22:39:13
onClipEvent(enterFrame){
if(_root._ymouse<=20,_root._xmouse<=355){
targetPosi=40;
}else if(_root._ymouse>=160){
targetPosi=40;
}else{
targetPosi= Math.ceil(_root._ymouse/20)*20;
}
this._y+=Math.round((targetPosi-this._y)/5);
}
他说 剪辑事件只允许用于影片剪辑实例
onClipEvent(enterFrame){
的错误,怎么改啊?

onClipEvent是写在元件上的脚本语言,您应该是把它写在了时间轴上而引起的错误。 请把它写在元件上就可以了。如果要写在时间轴上:
mc.onEnterFrame = function(){
....
}
//因为不知道你的文件的具体元件信息,所以不知道具体怎么写,包括目标路径都是不得而知。请根据实际需要修改