0
我試圖從類內繪製影片剪輯對象,並直接將其輸出到屏幕上。不用說,我對actionscript相當陌生。這是我的班級:Actionsapt:在類中創建影片剪輯
class Class.player {
function create() {
_root.createEmptyMovieClip("ship", _root.getNextHighestDepth());
ship._x = 200;
ship._y = 390;
ship.beginFill(0xFF00AA);
ship.moveTo(-20, -12);
ship.lineTo(20, -12);
ship.lineTo(20, 12);
ship.lineTo(-20, 12);
ship.lineTo(-20, -12);
ship.endFill();
}
}
這是我用來導入,調用和執行它的代碼。
import Class.player;
var Player:player = new player();
Player.create();
沒有錯誤消息,如果我放在創建函數到主腳本它工作正常,但沒有任何反應,如果我把它從類中。
任何意見,將不勝感激。謝謝!
非常感謝,幫助! – Tom
當然可以!任何時候! – Domecraft