[問題] 急問 這要怎麼寫呢?

看板Flash作者 (阿MAN)時間16年前 (2010/01/11 00:38), 編輯推噓0(003)
留言3則, 3人參與, 最新討論串1/1
以下是我的code 我想要在我隨機產生的東西上 可以用滑鼠點它然後前往下一個場景播放 我要怎麼寫呢? 有哪位神人可以幫我這個大忙? onClipEvent (load) { //data you may want to change width = 1280; height = 800; speed = Math.round(Math.random()*3)+1; //initial positions x = this._x=Math.random()*width; y = this._y=Math.random()*height; x_new = Math.random()*width; y_new = Math.random()*height;} onClipEvent (enterFrame) { //x movement if (x_new>this._x) {sign_x = 1;} else {sign_x = -1;} dx = Math.abs(x_new-this._x); if ((dx>speed) || (dx<-speed)) {this._x += sign_x*speed;} else {x_new = Math.random()*width;} //y movement if (y_new>this._y) {sign_y = 1;} else {sign_y = -1;} dy = Math.abs(y_new-this._y); if ((dy>speed) || (dy<-speed)) {this._y += sign_y*speed;} else {y_new = Math.random()*height;} } -- ※ 編輯: AlexanderMax 來自: 61.217.195.47 (01/11 01:40)

01/11 01:40, , 1F
也許你需要先學一下什麼是縮排喔 :)
01/11 01:40, 1F

01/11 13:58, , 2F
推 樓上
01/11 13:58, 2F

01/11 20:03, , 3F
可以試著使用 Flash Sript視窗上方的自動格式化按鈕
01/11 20:03, 3F
文章代碼(AID): #1BIW9hGu (Flash)
文章代碼(AID): #1BIW9hGu (Flash)