AS语言代码

来源:百度知道 编辑:UC知道 时间:2024/05/14 04:26:02
请问如何只用一个Buttom同时加入回车建。控制整个动画的STOP和PLAY
我只知道AS是
on (release,keyPress"<Enter>"){
stop(),play();
}
这对吗 我感觉不对 请指点下 写出中文说明 必要写出英文翻译
还有trace("The Enter Key was pressed."); 中文解释 谢谢

在主时间条上加:
_root.stop();
_root._isPlaying = false;
------------------分割线------------------
在按钮上加:
on(press){
if(_isPlaying){
_root.stop();
}else{
_root.play();
}
}
on(keyPress "<Enter>"){
if(_isPlaying){
_root.stop();
}else{
_root.play();
}
}
这个是AS2.0版本的答案。不过你应该是用的AS2.0的吧,是么。