我是as3的新手,我正在尝试编写一个必须绘制某些东西的类。我不太明白你是怎么把代码放上去的?
播放器/Player.as:
package player {
import flash.display.Sprite;
public class Player extends Sprite {
public var loader = null;
public function Player(){
this.cnstr_loader();
}
private function cnstr_loader(){
this.loader = new Sprite();
addChild(this.loader);
this.loader.graphics.lineStyle(1,0x000000);
this.loader.graphics.beginFill(0x0000FF);
this.loader.graphics.drawRect(0,0,10,10);
this.loader.graphics.endFill();
this.loader.x = 10;
this.loader.y = 10;
trace('e');
}
}
}main.as:
import player.Player;
var _Player = new Player();你如何在它自己的电影剪辑或者精灵或者它的名字中绘制整个Player类呢?
发布于 2011-01-28 21:13:33
addChild就是你要找的东西。您还应该阅读有关DisplayList的信息
https://stackoverflow.com/questions/4827494
复制相似问题