适时时间代码: this.createTextField("my_year", 1, 100, 100, 300, 100); this.createTextField("my_month", 2, 200, 100, 300, 100); this.createTextField("my_day", 3, 300, 100, 300, 100); this.createTextField("my_hours", 4, 100, 150, 300, 100); this.createTextField("my_minutes", 5, 200, 150, 300, 100); this.createTextField("my_seconds", 6, 300, 150, 300, 100); this.onEnterFrame = function() { var my_date:Date = new Date(); my_txt.text = my_date.getSeconds(); my_year.text = my_date.getFullYear()+"年"; my_month.text = int(int(my_date.getMonth())+1)+"月"; my_day.text = my_date.getDate()+"日"; my_hours.text = my_date.getHours()+"时"; my_minutes.text = my_date.getMinutes()+"分"; my_seconds.text = my_date.getSeconds()+"秒"; }; 两个mc 相撞问题: 我做了两个MC,分别是jj 和oo,,oo 是一个正方形,jj 是一个圆,影片剪辑的动作是 on (keyPress "") { this._x += 5; } 两个影片剪辑同在一帧上,帧上的动作是: _root.onEnterFrame = function() { if (jj.hitTest(oo)) { oo._x += 5; } }; 我想实现的是jj 向右移动遇到oo,然后jj 推着oo 一起移动,类似于以推箱子的小游戏。问题是jj 遇到oo 后照样跑了,oo 动都不动,望指点。 判断 i 能不能被 2 整除 if (i%2 == 0) { d=2//能被2 整除 } else { d = 1; } 在某帧上停留一定的时间 stop(); //停止播放影片 var fantast=setInterval(go,5000); //设置每5 秒钟调用一次go()函数。 function go() { //自定义函数 play(); //函数内容,就是继续播放影片。 clearInterval(fantast); //清除setInterval()轮询 } 在影片剪辑上写下面代码 播放点击时 调用库中的另外影片剪辑(这个影片剪辑属性标识符为对应的“h”+n) onClipEvent (load) { var i = 0; } on (press) { ++i; var n = random(3); attachMovie("h"+n,"mc"+i,i); this["mc" + i]._x = this._xmouse; this["mc" + i]._y = this._ymouse; this["mc" + i]._rotation = random(5) * 120; } 随机改变颜色: colorpy1 = random(255); colorpy2 = random(255) ; colorpy3 = random(255); my...