import flash.events.KeyboardEvent;import flash.display.MovieClip;stop();var zhanzi:MovieClip;var mc:MovieClip = new dasheti;stage.addEventListener(KeyboardEvent.KEY_DOWN, dasheti1);function dasheti1(e:KeyboardEvent):void{if(e.keyCode == 85)this.removeChild(zhanzi)if(e.keyCode == 85)this.addChild(mc)mc.x = zhanzi.x + 100;mc.y = zhanzi.ymc.height = zhanzi.height;mc.width = zhanzi.width;if(mc.currentFrame == 64)trace("125")}现在的问题是,当我按了U键播放完了mc,而最后的trace(125)输不出来?
3 回答
阿晨1998
TA贡献2037条经验 获得超6个赞
import flash.events.KeyboardEvent;
import flash.display.MovieClip;
stop();
var zhanzi:MovieClip;
var mc:MovieClip = new dasheti;
stage.addEventListener(KeyboardEvent.KEY_DOWN, dasheti1);
function dasheti1(e:KeyboardEvent):void
{
if(e.keyCode == 85)this.removeChild(zhanzi)
if(e.keyCode == 85)this.addChild(mc)
mc.x = zhanzi.x + 100;
mc.y = zhanzi.y
mc.height = zhanzi.height;
mc.width = zhanzi.width;
mc.addEventListener(Event.ENTER_FRAME,refresh);//在mc播放的时候添加逐帧的监听
}
function refresh(e:Event):void
{
if (mc.currentFrame == 64)
{
trace("125");
}
}
天涯尽头无女友
TA贡献1831条经验 获得超9个赞
提供教科书,if 语句检查该语句括号中的值或表达式。如果值为 true,则执行大括号中的代码行;否则,将忽略它们。
if (age < 20)
{
trace("显示针对青少年的特殊内容")
}
- 3 回答
- 0 关注
- 171 浏览
添加回答
举报
0/150
提交
取消