Section 1
//MainTimeline (cube1_fla.MainTimeline)
package cube1_fla {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public var cube:DynamicMovie;
public var road:MovieClip;
public var rotationCounter:uint;
public var mainMenu:ContextMenu;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function enterFrameHandler(_arg1:Event):void{
if ((((rotationCounter >= 0)) && ((rotationCounter < 90)))){
cube.setRegistration(90, 90);
};
if ((((rotationCounter >= 90)) && ((rotationCounter < 180)))){
cube.setRegistration(90, 0);
};
if ((((rotationCounter >= 180)) && ((rotationCounter < 270)))){
cube.setRegistration(0, 0);
};
if ((((rotationCounter >= 270)) && ((rotationCounter < 360)))){
cube.setRegistration(0, 90);
};
cube.rotation2++;
rotationCounter++;
if (rotationCounter == 360){
rotationCounter = 0;
};
trace(rotationCounter);
}
function frame1(){
rotationCounter = 0;
cube = new DynamicMovie();
cube.x = 20;
cube.y = 170;
addChild(cube);
stage.quality = "BEST";
stage.scaleMode = "noScale";
stage.align = "TL";
mainMenu = new ContextMenu();
contextMenu = mainMenu;
contextMenu.hideBuiltInItems();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package cube1_fla
Section 2
//DynamicMovie (DynamicMovie)
package {
import flash.display.*;
import flash.geom.*;
public class DynamicMovie extends MovieClip {
public var rp:Point;
public function setRegistration(_arg1:Number=0, _arg2:Number=0):void{
rp = new Point(_arg1, _arg2);
}
public function get mouseX2():Number{
return (Math.round((this.mouseX - rp.x)));
}
public function set scaleX2(_arg1:Number):void{
this.setProperty2("scaleX", _arg1);
}
public function get mouseY2():Number{
return (Math.round((this.mouseY - rp.y)));
}
public function set x2(_arg1:Number):void{
var _local2:Point;
_local2 = this.parent.globalToLocal(this.localToGlobal(rp));
this.x = (this.x + (_arg1 - _local2.x));
}
public function get rotation2():Number{
return (this.rotation);
}
public function set scaleY2(_arg1:Number):void{
this.setProperty2("scaleY", _arg1);
}
public function get scaleX2():Number{
return (this.scaleX);
}
public function set y2(_arg1:Number):void{
var _local2:Point;
_local2 = this.parent.globalToLocal(this.localToGlobal(rp));
this.y = (this.y + (_arg1 - _local2.y));
}
public function get x2():Number{
var _local1:Point;
_local1 = this.parent.globalToLocal(this.localToGlobal(rp));
return (_local1.x);
}
public function setProperty2(_arg1:String, _arg2:Number):void{
var _local3:Point;
var _local4:Point;
_local3 = this.parent.globalToLocal(this.localToGlobal(rp));
this[_arg1] = _arg2;
_local4 = this.parent.globalToLocal(this.localToGlobal(rp));
this.x = (this.x - (_local4.x - _local3.x));
this.y = (this.y - (_local4.y - _local3.y));
}
public function get scaleY2():Number{
return (this.scaleY);
}
function DynamicSprite(){
setRegistration();
}
public function get y2():Number{
var _local1:Point;
_local1 = this.parent.globalToLocal(this.localToGlobal(rp));
return (_local1.y);
}
public function set rotation2(_arg1:Number):void{
this.setProperty2("rotation", _arg1);
}
}
}//package