Spriteの使い方
class Primitive
{
var $_object;
var $_layer;
var $_controller;
function Primitive()
{
$this->_object();
$this->_layer();
}
function _object()
{
$this->_object = new SWFShape();
$this->_object->setRightFill(255,0,255);
$this->_object->drawCircle(100);
}
function _layer()
{
$this->_layer = new SWFSprite();
$this->_controller = $this->_layer->add($this->_object);
$this->_controller->setName("primitive");
}
function Layer()
{
$this->_layer->nextFrame();
return $this->_layer;
}
function Object()
{
return $this->_object;
}
}
require "Primitive.php";
$movie = new SWFMovie();
$movie->setDimension(400,400);
$movie->setBackground(0,0,0);
$movie->setRate(12);
$class = new Primitive();
$movie->add($class->Layer());
$movie->nextFrame();
$movie->save("moss.swf");
<
実行結果(swfファイル)>