require "NewPrimitive.php";
require ".\Item\Item.php";
require ".\State\DragAndDrop.php";
class Root extends NewPrimitive
{
function Root()
{
$this->NewPrimitive();
$ItemDaze =new Item();
$StateOne =new DragAndDrop();
$this->addObject($StateOne->Layer(),"state");
$this->addObject($ItemDaze->Layer(),"item");
$this->_action();
$this->compire();
}
function _action()
{
$this->addAction(new SWFAction("
item.setFaculty(this.state);
state.setParent(item);
"),"state");
}
}
class Item extends NewPrimitive
{
function Item()
{
$this->NewPrimitive();
$this->addObject($this->Layer(),"primitive");
$this->_action();
$this->compire();
}
function _action()
{
$this->addAction
(
new SWFAction(
"
var faculty;
this.setFaculty = function(facu){faculty.end();faculty =facu;facu._x=300;};
this.onEnterFrame = function(){faculty.start();};
this.onPress = function(){faculty.press();};
this.onRelease = function(){ faculty.release();};
")
,"act0");
}
}
class DragAndDrop extends NewPrimitive
{
function DragAndDrop()
{
$this->NewPrimitive();
$this->addObject($this->Object(),"primitive");
$this->_action();
$this->compire();
}
function _object()
{
$this->_object = new SWFShape();
}
function _action()
{
$this->addAction(new SWFAction("
var parent;
this.setParent =function(par){parent = par;};
this.start =function(){;};
this.press =function(){parent.startDrag();};
this.release=function(){parent.stopDrag();};
_root.end =function(){parent.stopDrag();};
"),"drag");
}
}