【发布时间】:2012-11-12 05:52:32
【问题描述】:
你能帮我把这个函数转换成 ActionScript 3.0 吗?
for (i=1; i<3; i++) {
_root["pemain"+i].onEnterFrame = function() {
ulartangga();
if (this.temp_nomor<this.nomor) {
this.temp_nomor++;
}
this._x = _root["kotak"+this.temp_nomor]._x;
this._y = _root["kotak"+this.temp_nomor]._y;
};
}
我遵循了http://warungflash.com/2009/05/ular-tangga-player-vs-player/的教程
我已经尝试转换成这个:
function onEnterFrame() {
//ulartangga();
if (this.temp_nomor<this.nomor) {
this.temp_nomor++;
}
this.x = stage["kotak"+this.temp_nomor].x;
this.y = stage["kotak"+this.temp_nomor].y;
}
【问题讨论】:
-
你试过什么?你得到哪个错误? whathaveyoutried.com
-
我是初学者,不明白怎么把'_root["pemain"+i].onEnterFrame = function()'转成as3..thx
-
那么你有什么尝试?理解很重要,否则任何答案都将一文不值。
-
我试图转换成这个:function onEnterFrame() { //ulartangga(); if (this.temp_nomor
-
好! :) 然后您应该使用帖子的“编辑”链接,添加一行 EDIT : 然后将您的代码粘贴到那里!这就是这里做事的方式;)如果人们看到你的尝试,他们会更倾向于帮助你,甚至更快!您应该始终这样做,这会使您的问题更有价值且更容易回答。如果你这样做,我会支持你的问题。
标签: actionscript-3 flash