Section 1
//loader_1 (loader_fla.loader_1)
package loader_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.net.*;
import flash.text.*;
import flash.media.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
import flash.external.*;
import flash.errors.*;
import flash.accessibility.*;
public dynamic class loader_1 extends MovieClip {
public var textField:TextField;
public function loader_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package loader_fla
Section 2
//HUD_Top (project.HUD_Top)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class HUD_Top extends Screen {
public static var musicBoolean:Button_Boolean;
public static var soundBoolean:Button_Boolean;
public static var cursorBoolean:Button_Boolean;
public function HUD_Top(_arg1:MovieClip){
super(_arg1);
musicBoolean = new Button_Boolean(_arg1.music_bool, on_music);
musicBoolean.value = true;
on_music(true);
}
public function on_music(_arg1:Boolean){
Sounds.music.volume = (_arg1) ? 0.3 : 0;
}
public function on_sound(_arg1:Boolean){
Sounds.fx.volume = (_arg1) ? 1 : 0;
}
public function on_cursor(_arg1:Boolean){
Data.config.cursor = _arg1;
Cursor.show((_arg1) ? "hand" : null);
}
}
}//package project
Section 3
//Main (project.Main)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Main extends Toy {
public var loadBar:MovieClip;
public function Main(){
Load.loadBar = this.loadBar;
}
override public function init(){
TrackingManager.init();
Quality.medium();
Depth.removeChild(target.loadBar);
Screen.show("Screen_Splash");
Screen.show("HUD_Top");
Screen.screenSound = "Sound_Screen";
}
Toy.externalAssets = "Document.swf";
}
}//package project
Section 4
//Music (project.Music)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Music {
private static var music:Sounds;
private static var current:String;
public static function set volume(_arg1:Number){
Sounds.music.volume = _arg1;
}
public static function play(_arg1:String){
if (current == _arg1){
return;
};
stop();
current = _arg1;
if (!Sounds.music.volume){
return;
};
music = Sounds.loop(_arg1);
}
public static function stop(){
if (!music){
return;
};
music.stop();
current = null;
}
}
}//package project
Section 5
//Screen_Game (project.Screen_Game)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen_Game extends Screen {
public var isWinner:Boolean;
public var time:Time;
public var car:TimelineClip;
public var cars:Array;
public var hint:TimelineClip;
public var clickspot:TimelineClip;
public var dragtool:TimelineClip;
public var isPlaying:Boolean;
public var problems:Array;
public var problem:String;
public var carPoint:Point;
public var carSpawnX:int;// = 1111
public var carInPlace:Boolean;
public var isDragging:Boolean;
public var keepDownKeys:String;// = "wash,gas,oil"
public var isKeepDown:Boolean;
public var character:MovieClip;
public var soundprob:Sounds;
public function Screen_Game(_arg1:MovieClip){
var _local2:*;
problems = ["oil", "tire", "gas", "wash", "fix"];
carPoint = new Point(375, 304);
super(_arg1);
Displayer.getInstance("status").autoReach = true;
character = _arg1.character;
time = new Time(120, onTimeOut, "time");
time.isMute = false;
time.onUpdate = onTime;
hint = new TimelineClip(_arg1.hint);
clickspot = new TimelineClip(_arg1.clickspot);
dragtool = new TimelineClip(_arg1.dragtool);
new Button(clickspot.target.area, onClickSpot, {mouseUp:onClickSpotUp});
SpriteUtil.allowMouse(dragtool.target, false);
Data.setup("status", 100, onCarFixed);
cars = Depth.getMovieClips(_arg1, "car");
for (_local2 in cars) {
cars[_local2] = new TimelineClip(cars[_local2]);
};
}
override public function init(){
super.init();
time.reset();
resetValues();
Score.resetLevel();
Music.stop();
character.gotoAndStop(1);
}
override public function show(){
super.show();
Message.big.show("GET READY", 390, null, null, startGame);
character.gotoAndPlay(("begin" + Random.range(2, 1, true)));
character.gotoAndPlay(1);
}
public function startGame(){
pauseGame();
time.play();
isPlaying = true;
Music.play("Music_Game");
nextCar();
}
public function nextCar(){
if (!isPlaying){
return;
};
resetValues();
problem = ArrayUtil.getRandomItem(problems, problem);
isKeepDown = !((keepDownKeys.indexOf(problem) == -1));
car.gotoAndStop(0, problem);
hint.gotoAndStop(0, problem);
clickspot.gotoAndStop(0, problem);
Tweenr.to(car.target, 0.8, {x:375, ease:Easing.easeOutCirc}, showProblem);
Sounds.start("Sound_CarIN");
}
public function showProblem(){
carInPlace = true;
car.target.base.gotoAndPlay("open");
Depth.localToTarget(car.target.clickspot, target, clickspot.target);
Tweenr.FADE_IN(hint.target, 1);
Tweenr.FADE_IN(clickspot.target, 1);
character.gotoAndPlay((problem + Random.range(2, 1, true)));
}
public function resetValues(){
var _local1:*;
var _local2:*;
for (_local1 in cars) {
_local2 = TimelineClip(cars[_local1]).target;
_local2.x = 5000;
Tweenr.FADE_IN(_local2, 0);
};
car = ArrayUtil.getRandomItem(cars, car);
car.target.scaleX = (car.target.scaleY = 1);
car.target.x = carSpawnX;
car.target.y = carPoint.y;
clickspot.target.visible = false;
clickspot.target.glow.visible = false;
hint.target.visible = false;
dragtool.target.visible = false;
carInPlace = false;
isDragging = false;
Data.set("status", 0);
}
public function onCarFixed(){
motor.stop();
isDragging = false;
soundprob.stop();
Tweenr.FADE_OUT(hint.target);
clickspot.target.visible = false;
dragtool.target.visible = false;
Score.increase(1);
Dust.explosionParticles.start(car.target);
Message.medium.show("YOU FIXED IT!", 375);
car.target.base.gotoAndPlay("close");
character.gotoAndPlay(("correct" + Random.range(7, 1, true)));
car.gotoAndStop(0, "fixed");
Tweenr.FLICKER(car.target, 0.5, getCarOut);
Sounds.start("Sound_CarOUT");
}
public function getCarOut(){
Tweenr.to(car.target, 0.8, {x:-(carSpawnX), ease:Easing.easeInCirc, delay:0.5}, nextCar);
}
public function gameUpdate(){
}
public function pauseGame(){
isPlaying = false;
character.stop();
motor.stop();
time.pause();
if (soundprob){
soundprob.stop();
};
Music.stop();
}
public function onTime(){
if (Data.get("time") != 10){
return;
};
character.gotoAndPlay(("times-almost-up" + Random.range(2, 1, true)));
}
public function onTimeOut(){
pauseGame();
character.gotoAndPlay(("times-up" + Random.range(2, 1, true)));
Message.big.show("GOOD JOB!", 410, null, null);
Sounds.start("Sound_PassLevel");
motor.delay(endGame, 100);
}
public function endGame(){
Screen.show("Screen_Win", Screen.PAN_UP);
}
public function showHelp(){
pauseGame();
Screen.show("Screen_Instructions", Screen.PAN_RIGHT);
}
override public function _mouseDown(_arg1=null){
var _local3:*;
var _local2:* = _arg1.name;
if (_local2 == "help"){
return (showHelp());
};
if (((((!(carInPlace)) || (dragtool.target.visible))) || (!(isPlaying)))){
return;
};
if (_local2 != problem){
Message.medium.show("TRY ANOTHER TOOL!");
_local3 = ("hint" + Random.range(2, 1, true));
if (Random.chance()){
_local3 = (_local3 + "_alt");
};
character.gotoAndPlay(_local3);
Tweenr.FLICKER(target[(problem + "_btn")]);
return;
};
isDragging = true;
dragtool.gotoAndStop(0, problem);
dragtool.target.startDrag(true);
Tweenr.FADE_IN(dragtool.target);
_local3 = "hint3";
if (Random.chance()){
_local3 = (_local3 + "_alt");
};
motor.delay(character.gotoAndPlay, 100, _local3);
}
public function onClickSpot(_arg1){
if (soundprob){
soundprob.stop();
};
if ((((Data.get("status") >= 100)) || (!(isPlaying)))){
return;
};
character.gotoAndStop("idle");
if (!dragtool.target.visible){
Sounds.start("Sound_Wrong");
Message.medium.show("PICK A TOOL!");
return;
};
if (isDragging){
isDragging = false;
dragtool.target.stopDrag();
Tweenr.to(dragtool.target, 0.5, {x:clickspot.target.x, y:clickspot.target.y});
Tweenr.FLICKER(clickspot.target.glow, 1);
clickspot.gotoAndStop(0, "empty");
};
motor.delay(fillStatus, 3);
increaseStatus(10);
soundprob = Sounds.start(("Sound_" + problem));
}
public function onClickSpotUp(_arg1){
if (soundprob){
soundprob.stop();
};
if ((((((Data.get("status") >= 100)) || (!(dragtool.target.visible)))) || (!(isPlaying)))){
return;
};
motor.stop();
var _local2:* = ("hint" + Random.range(5, 4, true));
if (Random.chance()){
_local2 = (_local2 + "_alt");
};
character.gotoAndPlay(_local2);
}
public function fillStatus(){
motor.delay(fillStatus, 3);
increaseStatus(3);
}
public function increaseStatus(_arg1:int){
Data.increase("status", _arg1);
if (car.target.problem){
SpriteUtil.tweenPercent(car.target.problem, (Data.get("status") + 10), 0.2);
};
}
}
}//package project
Section 6
//Screen_Instructions (project.Screen_Instructions)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen_Instructions extends Screen {
public function Screen_Instructions(_arg1:MovieClip){
super(_arg1);
}
override public function show(){
super.show();
motor.start(waitForLastFrame);
}
public function waitForLastFrame(){
if (voiceOver.currentFrame < (voiceOver.totalFrames - 4)){
return;
};
_mouseDown();
}
override public function _mouseDown(_arg1=null){
Screen.show("Screen_Game", Screen.FADE_IN);
}
override public function _mouseOver(_arg1=null){
Sounds.start("Sound_Skip");
}
}
}//package project
Section 7
//Screen_Intro (project.Screen_Intro)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen_Intro extends Screen {
public function Screen_Intro(_arg1:MovieClip){
super(_arg1);
}
override public function show(){
super.show();
motor.start(waitForLastFrame);
}
public function waitForLastFrame(){
if (voiceOver.currentFrame < (voiceOver.totalFrames - 4)){
return;
};
_mouseDown();
}
override public function _mouseDown(_arg1=null){
Screen.show("Screen_Instructions", Screen.PAN_LEFT);
}
override public function _mouseOver(_arg1=null){
Sounds.start("Sound_Skip");
}
}
}//package project
Section 8
//Screen_Resume (project.Screen_Resume)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen_Resume extends Screen {
public function Screen_Resume(_arg1:MovieClip){
super(_arg1);
}
override public function show(){
super.show();
}
override public function init(){
super.init();
Sounds.start("Sound_Resume");
Music.play("Music_Setup");
}
override public function _mouseDown(_arg1=null){
var _local2:String = _arg1.name;
if (_local2 == "continue"){
return (Screen.show("Screen_Game", Screen.FADE_IN));
};
if (_local2 == "win"){
return (Screen.show("Screen_Win", Screen.PAN_UP));
};
}
}
}//package project
Section 9
//Screen_Splash (project.Screen_Splash)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen_Splash extends Screen {
public function Screen_Splash(_arg1:MovieClip){
super(_arg1);
Data.config.tutorial = true;
}
override public function init(){
Score.reset();
Music.play("Music_Main");
}
override public function show(){
super.show();
anim.gotoLabel("start", 1, onAnimEnd);
}
override public function hide(){
super.hide();
anim.target.talkingpeople.stop();
}
public function onAnimEnd(){
anim.target.talkingpeople.gotoAndPlay("start");
motor.delay(onTimeOut, 500);
}
public function onTimeOut(){
anim.target.talkingpeople.gotoAndPlay("timeout");
motor.delay(onTimeOut, 500);
}
public function on_tutorial(_arg1:Boolean){
Data.config.tutorial = _arg1;
}
override public function _mouseDown(_arg1=null){
var _local2:String = _arg1.name;
if (_local2 == "play"){
Screen.show("Screen_Intro", Screen.PAN_LEFT);
};
}
override public function _mouseOver(_arg1=null){
Sounds.start("Sound_Play");
}
}
}//package project
Section 10
//Screen_Win (project.Screen_Win)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
import flash.external.*;
public class Screen_Win extends Screen {
public var printJob:PrintJob;
public var voice:MovieClip;
public function Screen_Win(_arg1:MovieClip){
super(_arg1);
voice = _arg1.voice;
}
override public function show(){
super.show();
voice.gotoAndPlay("start");
motor.delay(onTimeOut, 1000);
}
public function onTimeOut(){
voice.gotoAndPlay("timeup");
motor.delay(onTimeOut, 400);
}
override public function init(){
super.init();
Sounds.start("Sound_Win");
Music.play("Music_Two");
voice.gotoAndStop(1);
}
override public function hide(){
super.hide();
if (voice){
voice.gotoAndStop(1);
};
}
override public function _mouseDown(_arg1=null){
var _local3:String;
var _local4:String;
var _local5:String;
var _local2:String = _arg1.name;
if (_local2 == "continue"){
return (Screen.show("Screen_Instructions", Screen.PAN_UP));
};
printJob = new PrintJob();
if (printJob.start()){
printJob.addPage(target.printmc);
printJob.send();
};
if (ExternalInterface.available){
_local3 = "print_track:hdm_greatgaragerescue/game/mannys_fix_it_fast_garage";
_local4 = "hdm_greatgaragerescue/game";
_local5 = "AnalyticsTrackLink";
ExternalInterface.call(_local5, _local3, _local4);
};
}
override public function _mouseOver(_arg1=null){
var _local2:* = _arg1.name;
if (_local2 == "continue"){
Sounds.start("Sound_Play");
};
}
}
}//package project
Section 11
//TrackingManager (project.TrackingManager)
package project {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class TrackingManager {
public static var trackerObj:Object;
public static var cto:Object;
private static var loader:Loader;
private static var loaderContext:LoaderContext;
private static var urlToLoad:URLRequest = new URLRequest("http://aglobal.go.com/stat/flash/analyticReportingAS3.swf");
public static function init():void{
Security.allowDomain("*");
cto = new Object();
loader = new Loader();
loaderContext = new LoaderContext();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loader.load(urlToLoad, loaderContext);
}
private static function loadCompleteHandler(_arg1:Event):void{
var _local2:Class = (loader.contentLoaderInfo.applicationDomain.getDefinition("com.disney.WebAnalytics.WebAnalyticsManager") as Class);
trackerObj = new (_local2);
trace("TrackingManager: trackerObj created");
}
public static function submitPageView(_arg1:String):void{
if (((_arg1) && (trackerObj))){
cto.trackType = "pageView";
cto.pageName = _arg1;
trackerObj.submitTracking(cto);
} else {
trace("TrackingManager: submitPageView Failed");
};
}
public static function submitLinkClick(_arg1:String, _arg2:String):void{
if (((((_arg1) || (_arg2))) && (trackerObj))){
cto.trackType = "linkTrack";
cto.linkId = _arg1;
cto.linkPosition = _arg2;
trackerObj.submitTracking(cto);
} else {
trace("TrackingManager: submitLinkClick Failed");
};
}
public static function ctoTrackLink(_arg1:String, _arg2:String):void{
cto.trackType = "linkTrack";
cto.linkId = _arg1;
cto.linkPosition = _arg2;
cto.linkType = "";
trackerObj.submitTracking(cto);
cto.linkId = "";
cto.linkPosition = "";
}
}
}//package project
Section 12
//Canvas (toy.canvas.Canvas)
package toy.canvas {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Canvas {
public var view:View;
public var container:Sprite;
public var _width:int;
public var _height:int;
public var pool:Dictionary;
public function Canvas(){
view = new View();
container = new Sprite();
pool = new Dictionary();
super();
}
public function add(_arg1:Clip){
pool[_arg1] = true;
}
public function remove(_arg1:Clip){
delete pool[_arg1];
}
public function update(){
var _local1:*;
for (_local1 in pool) {
_local1.update();
};
}
public function render(){
var _local1:*;
for (_local1 in pool) {
view.render(_local1);
};
}
public function set x(_arg1){
container.x = _arg1;
}
public function set y(_arg1){
container.y = _arg1;
}
public function get x(){
return (container.x);
}
public function get y(){
return (container.y);
}
public function set width(_arg1){
_width = _arg1;
}
public function set height(_arg1){
_height = _arg1;
}
public function get width(){
return (_width);
}
public function get height(){
return (_height);
}
}
}//package toy.canvas
Section 13
//Clip (toy.canvas.Clip)
package toy.canvas {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Clip {
public var _x:Number;// = 0
public var _y:Number;// = 0
public var _z:Number;// = 0
public var _align:uint;
public var width:uint;
public var height:uint;
public var depth:uint;
public var radius:uint;
public var width2:uint;
public var height2:uint;
public var depth2:uint;
public var top:int;
public var bottom:int;
public var left:int;
public var right:int;
public var back:int;
public var front:int;
public var center:Vector3;
public var sprite:Sprite;
public var mouseUp:Function;
public var mouseDown:Function;
public var mouseOver:Function;
public var mouseOut:Function;
public var doubleClick:Function;
public var isButtonEnabled:Boolean;
public var playing:Boolean;
public var selfControlled:Boolean;// = true
public var debugMode:Boolean;
public var target;
public var rotation:Number;// = 0
public var rotationX:Number;// = 0
public var rotationY:Number;// = 0
public var rotationZ:Number;// = 0
public var scale:Number;// = 1
public var angle:Number;// = 0
public var pool:Dictionary;
public static const ALIGN_TOPLEFT:int = 0;
public static const ALIGN_FLOOR:int = 1;
public static const ALIGN_CENTER:int = 2;
public function Clip(){
center = new Vector3();
pool = new Dictionary();
super();
}
public function set x(_arg1:Number){
_x = _arg1;
}
public function set y(_arg1:Number){
_y = _arg1;
}
public function set z(_arg1:Number){
_z = _arg1;
}
public function get x(){
return (_x);
}
public function get y(){
return (_y);
}
public function get z(){
return (_z);
}
public function set align(_arg1:uint){
_align = MathUtil.constrain(_arg1, 0, 2);
}
public function get align(){
return (_align);
}
public function resize(_arg1=null, _arg2=null, _arg3:Number=0){
if (((!(_arg1)) || (!(_arg2)))){
return;
};
this.width = _arg1;
this.height = _arg2;
this.depth = _arg3;
radius = (_arg1 + (_arg2 / 2));
width2 = (_arg1 / 2);
height2 = (_arg2 / 2);
depth2 = (_arg3 / 2);
updateBounds();
}
public function updateBounds(){
if (_align == ALIGN_TOPLEFT){
left = x;
top = y;
right = (x + width);
bottom = (y + height);
front = z;
back = (z + depth);
center.x = (x + width2);
center.y = (y + height2);
return;
};
left = (x - width2);
right = (x + width2);
center.x = (x + width2);
front = (z - depth2);
back = (z + depth2);
if (_align == ALIGN_CENTER){
top = (y - height2);
bottom = (y + height2);
center.y = y;
return;
};
if (_align == ALIGN_FLOOR){
top = (y - height);
bottom = y;
center.y = (y - width2);
};
}
public function enableButton(){
isButtonEnabled = true;
target.mouseEnabled = true;
target.buttonMode = true;
target.mouseChildren = false;
target.addEventListener(MouseEvent.MOUSE_DOWN, _mouseDown);
target.addEventListener(MouseEvent.MOUSE_OVER, _mouseOver);
target.addEventListener(MouseEvent.MOUSE_OUT, _mouseOut);
target.addEventListener(MouseEvent.DOUBLE_CLICK, _doubleClick);
}
public function blockMouse(){
disableButton();
target.buttonMode = false;
target.mouseEnabled = false;
target.mouseChildren = false;
}
public function disableButton(){
isButtonEnabled = false;
target.removeEventListener(MouseEvent.MOUSE_DOWN, _mouseDown);
target.removeEventListener(MouseEvent.MOUSE_OVER, _mouseOver);
target.removeEventListener(MouseEvent.MOUSE_OUT, _mouseOut);
target.removeEventListener(MouseEvent.DOUBLE_CLICK, _doubleClick);
Cursor.remove(MouseEvent.MOUSE_UP, _mouseUp);
}
public function enableMouseChildren(){
target.mouseEnabled = false;
target.mouseChildren = true;
}
public function enableContent(){
blockMouse();
enableMouseChildren();
}
public function _mouseDown(_arg1=null){
Cursor.add(MouseEvent.MOUSE_UP, _mouseUp);
if (mouseDown == null){
return;
};
}
public function _mouseOver(_arg1=null){
if (mouseOver == null){
return;
};
}
public function _mouseUp(_arg1=null){
Cursor.remove(MouseEvent.MOUSE_UP, _mouseUp);
if (mouseUp == null){
return;
};
}
public function _mouseOut(_arg1=null){
if (mouseOut == null){
return;
};
}
public function _doubleClick(_arg1=null){
if (doubleClick == null){
return;
};
}
public function start(){
play();
}
public function stop(){
pause();
}
public function play(){
playing = true;
if (selfControlled){
Motor.addClip(this);
};
}
public function pause(){
playing = false;
if (selfControlled){
Motor.remove(this);
};
}
public function show(){
}
public function hide(){
stop();
}
public function setTarget(_arg1:DisplayObject){
this.target = target;
sprite.addChild(target);
}
public function setSprite(_arg1:int=0){
var _local2:* = target.parent;
sprite = new Sprite();
if (target.parent){
target.parent.addChild(sprite);
};
sprite.x = target.x;
sprite.y = target.y;
target.x = (target.y = 0);
sprite.addChild(target);
}
public function init(){
}
public function addClip(_arg1){
pool[_arg1] = true;
}
public function remove(_arg1){
delete pool[_arg1];
}
public function update(){
var _local1:*;
for (_local1 in pool) {
_local1.update();
};
}
public function render(){
var _local1:*;
for (_local1 in pool) {
_local1.render();
};
}
}
}//package toy.canvas
Section 14
//View (toy.canvas.View)
package toy.canvas {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public final class View {
public var fov:Number;// = 300
public var zoom:Number;// = 1
public var rotationX:Number;// = 0
public var rotationY:Number;// = 0
public var rotationZ:Number;// = 0
public var cosX:Number;
public var sinX:Number;
public var cosY:Number;
public var sinY:Number;
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
public var focus:Object;
public var render:Function;
public static var ISO:Number = 0.707;
public static var fov:Number = 300;
public static var zoom:Number = 1;
public static var rotationX:Number = 0;
public static var rotationY:Number = 0;
public static var rotationZ:Number = 0;
public static var cosX:Number = Math.cos(rotationX);
public static var sinX:Number = Math.sin(rotationX);
public static var cosY:Number = Math.cos(rotationY);
public static var sinY:Number = Math.sin(rotationY);
public static var x:Number = 0;
public static var y:Number = 0;
public static var z:Number = 0;
public function View(){
cosX = Math.cos(rotationX);
sinX = Math.sin(rotationX);
cosY = Math.cos(rotationY);
sinY = Math.sin(rotationY);
super();
render = render2D;
}
public function point2D(_arg1, _arg2:Vector3):Point{
var _local3:* = (_arg2.x - x);
var _local4:* = (_arg2.y - y);
var _local5:* = (_arg2.z - z);
var _local6:* = ((cosX * _local3) - (sinX * _local5));
var _local7:* = ((sinX * _local3) + (cosX * _local5));
var _local8:* = ((cosY * _local4) - (sinY * _local7));
var _local9:* = ((sinY * _local4) + (cosY * _local7));
var _local10:* = ((fov / (fov + _local9)) * zoom);
var _local11:* = ((rotationZ / 180) * Math.PI);
var _local12:* = ((_local6 * Math.cos(_local11)) - (_local8 * Math.sin(_local11)));
var _local13:* = ((_local6 * Math.sin(_local11)) + (_local8 * Math.cos(_local11)));
var _local14:* = (_local12 * _local10);
var _local15:* = (_local13 * _local10);
return (new Point(_local14, _local15));
}
public function update(){
cosX = Math.cos(rotationX);
sinX = Math.sin(rotationX);
cosY = Math.cos(rotationY);
sinY = Math.sin(rotationY);
}
public static function render2D(_arg1){
if (!_arg1.visible){
return;
};
var _local2:* = _arg1.sprite;
var _local3:* = _arg1.scale;
_local2.x = _arg1.x;
_local2.y = _arg1.y;
_local2.scaleX = _local3;
_local2.scaleY = MathUtil.positive(_local3);
_local2.rotation = _arg1.rotation;
}
public static function renderZD(_arg1){
if (!_arg1.visible){
return;
};
var _local2:* = _arg1.sprite;
var _local3:* = _arg1.scale;
_local2.x = _arg1.x;
_local2.y = (_arg1.z + _arg1.y);
_local2.scaleX = _local3;
_local2.scaleY = MathUtil.positive(_local3);
}
public static function renderISO(_arg1){
if (!_arg1.visible){
return;
};
var _local2:* = _arg1.sprite;
var _local3:* = pointToISO(_arg1);
var _local4:* = _arg1.scale;
_local2.x = _local3.x;
_local2.y = _local3.y;
_local2.scaleX = _local4;
_local2.scaleY = MathUtil.positive(_local4);
}
public static function render3D(_arg1){
if (!_arg1.visible){
return;
};
var _local2:* = _arg1.sprite;
var _local3:* = (_arg1.x - x);
var _local4:* = (_arg1.y - y);
var _local5:* = (_arg1.z - z);
var _local6:* = ((cosX * _local3) - (sinX * _local5));
var _local7:* = ((sinX * _local3) + (cosX * _local5));
var _local8:* = ((cosY * _local4) - (sinY * _local7));
var _local9:* = ((sinY * _local4) + (cosY * _local7));
var _local10:* = ((fov / (fov + _local9)) * zoom);
if ((((_local10 < 0)) || ((_local10 > 1.1)))){
return ((_local2.visible = false));
};
var _local11:Number = ((rotationZ / 180) * Math.PI);
var _local12:* = ((_local6 * Math.cos(_local11)) - (_local8 * Math.sin(_local11)));
var _local13:* = ((_local6 * Math.sin(_local11)) + (_local8 * Math.cos(_local11)));
var _local14:Number = (_local12 * _local10);
var _local15:Number = (_local13 * _local10);
if ((((Math.abs(_local14) > 1000)) || ((Math.abs(_local14) > 1000)))){
return ((_local2.visible = false));
};
_local2.visible = true;
_local2.x = _local14;
_local2.y = _local15;
_local2.rotation = _arg1.rotation;
_local2.rotationX = _arg1.rotationX;
_local2.rotationY = _arg1.rotationY;
_local2.rotationZ = _arg1.rotationZ;
_local2.scaleX = (_local2.scaleY = _local10);
}
public static function ISOToPoint(_arg1){
var _local2:* = new Point();
_local2.x = (((-(_arg1.x) + (_arg1.y * 2)) / ISO) / 2);
_local2.y = (((_arg1.x + (_arg1.y * 2)) / ISO) / 2);
return (_local2);
}
public static function pointToISO(_arg1){
var _local2:* = new Point();
_local2.x = ((-(_arg1.x) + _arg1.y) * ISO);
_local2.y = (((_arg1.y + _arg1.x) * ISO) / 2);
return (_local2);
}
}
}//package toy.canvas
Section 15
//JSON (toy.com.adobe.serialization.json.JSON)
package toy.com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package toy.com.adobe.serialization.json
Section 16
//JSONDecoder (toy.com.adobe.serialization.json.JSONDecoder)
package toy.com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
public function getValue(){
return (value);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
if (token == null){
tokenizer.parseError("Unexpected end of input");
};
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
}
}//package toy.com.adobe.serialization.json
Section 17
//JSONEncoder (toy.com.adobe.serialization.json.JSONEncoder)
package toy.com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
public function getString():String{
return (jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package toy.com.adobe.serialization.json
Section 18
//JSONParseError (toy.com.adobe.serialization.json.JSONParseError)
package toy.com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
_location = _arg2;
_text = _arg3;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package toy.com.adobe.serialization.json
Section 19
//JSONToken (toy.com.adobe.serialization.json.JSONToken)
package toy.com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function get type():int{
return (_type);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function get value():Object{
return (_value);
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
}
}//package toy.com.adobe.serialization.json
Section 20
//JSONTokenizer (toy.com.adobe.serialization.json.JSONTokenizer)
package toy.com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = loc;
skipWhite();
skipComments();
} while (_local1 != loc);
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
}
}//package toy.com.adobe.serialization.json
Section 21
//JSONTokenType (toy.com.adobe.serialization.json.JSONTokenType)
package toy.com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package toy.com.adobe.serialization.json
Section 22
//YoutubePlayer (toy.com.google.YoutubePlayer)
package toy.com.google {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class YoutubePlayer extends Sprite {
private var player:Object;
private var loader:Loader;
private var onReady:Function;
private var onError:Function;
private var onStateChange:Function;
private var onPlaybackQualityChange:Function;
public static var SMALL:String = "small";
public static var MEDIUM:String = "medium";
public static var LARGE:String = "large";
public static var HD720:String = "hd720";
public function YoutubePlayer(_arg1:Function, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null){
this.onReady = _arg1;
this.onError = _arg2;
this.onStateChange = _arg3;
this.onPlaybackQualityChange = _arg4;
Security.allowDomain("www.youtube.com");
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
}
private function onLoaderInit(_arg1:Event):void{
addChild(loader);
loader.content.addEventListener("onReady", onPlayerReady, false, 0, true);
loader.content.addEventListener("onReady", onReady, false, 0, true);
loader.content.addEventListener("onError", onError, false, 0, true);
loader.content.addEventListener("onStateChange", onStateChange, false, 0, true);
loader.content.addEventListener("onPlaybackQualityChange", onPlaybackQualityChange, false, 0, true);
}
private function onPlayerReady(_arg1:Event):void{
player = loader.content;
}
public function setSize(_arg1:int, _arg2:int):void{
player.setSize(_arg1, _arg2);
}
public function loadVideoById(_arg1:String, _arg2:Number=0, _arg3:String="medium"):void{
player.loadVideoById(_arg1, _arg2, _arg3);
}
public function cueVideoById(_arg1:String, _arg2:Number=0, _arg3:String="medium"):void{
player.cueVideoById(_arg1, _arg2, _arg3);
}
public function cueVideoByUrl(_arg1:String, _arg2:Number=0):void{
player.cueVideoByUrl(_arg1, _arg2);
}
public function loadVideoByUrl(_arg1:String, _arg2:Number=0):void{
player.loadVideoByUrl(_arg1, _arg2);
}
public function toggleVideo():void{
if (player.getPlayerState() == 1){
player.pauseVideo();
} else {
if ((((((player.getPlayerState() == 2)) || ((player.getPlayerState() == 0)))) || ((player.getPlayerState() == -1)))){
player.playVideo();
};
};
}
public function playVideo():void{
player.playVideo();
}
public function pauseVideo():void{
player.pauseVideo();
}
public function stopVideo():void{
player.stopVideo();
}
public function seekTo(_arg1:Number, _arg2:Boolean=true):void{
player.seekTo(_arg1, _arg2);
}
public function mute():void{
player.mute();
}
public function unMute():void{
player.unMute();
}
public function isMuted():Boolean{
return (player.isMuted());
}
public function toggleMute():void{
if (player.isMuted()){
player.unMute();
} else {
player.mute();
};
}
public function setVolume(_arg1:Number):void{
player.setVolume(_arg1);
}
public function getVolume():Number{
return (player.getVolume());
}
public function getVideoBytesLoaded():Number{
return (player.getVideoBytesLoaded());
}
public function getVideoBytesTotal():Number{
return (player.getVideoBytesTotal());
}
public function getVideoStartBytes():Number{
return (player.getVideoStartBytes());
}
public function getPlayerState():Number{
return (player.getPlayerState());
}
public function getCurrentTime():Number{
return (player.getCurrentTime());
}
public function getPlaybackQuality():String{
return (player.getPlaybackQuality());
}
public function setPlaybackQuality(_arg1:String="default"):void{
player.setPlaybackQuality(_arg1);
}
public function getAvailableQualityLevels():Array{
return (player.getAvailableQualityLevels());
}
public function getDuration():Number{
return (player.getDuration());
}
public function getVideoUrl():String{
return (player.getVideoUrl());
}
public function getVideoEmbedCode():String{
return (player.getVideoEmbedCode());
}
public function destroy():void{
loader.content.removeEventListener("onReady", onPlayerReady);
loader.content.removeEventListener("onReady", onReady);
loader.content.removeEventListener("onError", onError);
loader.content.removeEventListener("onStateChange", onStateChange);
loader.content.removeEventListener("onPlaybackQualityChange", onPlaybackQualityChange);
player.destroy();
removeChild(loader);
player = null;
loader.unload();
onReady = null;
onError = null;
onStateChange = null;
onPlaybackQualityChange = null;
}
}
}//package toy.com.google
Section 23
//OverwriteManager (toy.com.tweenlite.OverwriteManager)
package toy.com.tweenlite {
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const version:Number = 1;
public static const NONE:int = 0;
public static const ALL:int = 1;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static var mode:int;
public static var enabled:Boolean;
public static function init(_arg1:int=2):int{
if (TweenLite.version < 9.29){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local9:Object;
var _local10:String;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (((((!((_local8 == _arg1))) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
_local7--;
};
if (_local6.length == 0){
return;
};
if (_local4 == AUTO){
if (_local3.isTV == true){
_local3 = _local3.exposedProps;
};
_local9 = {};
for (_local10 in _local3) {
if ((((((((((((((((((((((((((((((((((((((((((((_local10 == "ease")) || ((_local10 == "delay")))) || ((_local10 == "overwrite")))) || ((_local10 == "onComplete")))) || ((_local10 == "onCompleteParams")))) || ((_local10 == "runBackwards")))) || ((_local10 == "persist")))) || ((_local10 == "onUpdate")))) || ((_local10 == "onUpdateParams")))) || ((_local10 == "timeScale")))) || ((_local10 == "onStart")))) || ((_local10 == "onStartParams")))) || ((_local10 == "renderOnStart")))) || ((_local10 == "proxiedEase")))) || ((_local10 == "easeParams")))) || ((_local10 == "onCompleteAll")))) || ((_local10 == "onCompleteAllParams")))) || ((_local10 == "yoyo")))) || ((_local10 == "loop")))) || ((_local10 == "onCompleteListener")))) || ((_local10 == "onStartListener")))) || ((_local10 == "onUpdateListener")))){
} else {
_local9[_local10] = 1;
if (_local10 == "shortRotate"){
_local9.rotation = 1;
} else {
if (_local10 == "removeTint"){
_local9.tint = 1;
} else {
if (_local10 == "autoAlpha"){
_local9.alpha = 1;
_local9.visible = 1;
};
};
};
};
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].killVars(_local9);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array, _arg4:Array, _arg5:Array):void{
var _local6:int;
var _local7:String;
_local6 = (_arg4.length - 1);
while (_local6 > -1) {
if (_arg1[_arg4[_local6].name] != undefined){
_arg4.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg3.length - 1);
while (_local6 > -1) {
if (_arg1[_arg3[_local6][4]] != undefined){
_arg3.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg5.length - 1);
while (_local6 > -1) {
if (_arg1[_arg5[_local6].name] != undefined){
_arg5.splice(_local6, 1);
};
_local6--;
};
for (_local7 in _arg1) {
delete _arg2[_local7];
};
}
}
}//package toy.com.tweenlite
Section 24
//TweenEvent (toy.com.tweenlite.TweenEvent)
package toy.com.tweenlite {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const version:Number = 0.9;
public static const START:String = "start";
public static const UPDATE:String = "update";
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package toy.com.tweenlite
Section 25
//TweenFilterLite (toy.com.tweenlite.TweenFilterLite)
package toy.com.tweenlite {
import flash.utils.*;
import flash.filters.*;
public class TweenFilterLite extends TweenLite {
protected var _matrix:Array;
protected var _endMatrix:Array;
protected var _cmf:ColorMatrixFilter;
protected var _clrsa:Array;
protected var _hf:Boolean;// = false
protected var _filters:Array;
protected var _timeScale:Number;
protected var _roundProps:Boolean;
public static var version:Number = 9.29;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var removeTween:Function = TweenLite.removeTween;
protected static var _globalTimeScale:Number = 1;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumR:Number = 0.212671;
private static var _lumG:Number = 0.71516;
private static var _lumB:Number = 0.072169;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_filters = [];
super(_arg1, _arg2, _arg3);
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenFilterLite)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (TweenLite.version < 9.29){
trace("TweenFilterLite error! Please update your TweenLite class or try deleting your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:int;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:int;
var _local8:String;
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter roundProps ");
_roundProps = Boolean((this.vars.roundProps is Array));
if (_isDisplayObject){
if (this.vars.blurFilter != null){
_local4 = this.vars.blurFilter;
addFilter("blurFilter", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != null){
_local4 = this.vars.glowFilter;
addFilter("glowFilter", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != null){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrixFilter", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[this.tweens.length] = [_matrix, _local3.toString(), _matrix[_local3], (_endMatrix[_local3] - _matrix[_local3]), "colorMatrixFilter"];
};
_local3++;
};
};
if (this.vars.dropShadowFilter != null){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadowFilter", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != null){
_local4 = this.vars.bevelFilter;
addFilter("bevelFilter", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = (_clrsa.length - 1);
while (_local3 > -1) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3--;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
if (_roundProps){
_local3 = (this.vars.roundProps.length - 1);
while (_local3 > -1) {
_local8 = this.vars.roundProps[_local3];
_local7 = (this.tweens.length - 1);
while (_local7 > -1) {
if ((((this.tweens[_local7][1] == _local8)) && ((this.tweens[_local7][0] == this.target)))){
this.tweens[_local7][5] = true;
break;
};
_local7--;
};
_local3--;
};
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
var _local6:Object = {type:_arg3, name:_arg1};
var _local7:Array = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7[_local7.length] = _local6.filter;
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa[_clrsa.length] = {f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)};
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[this.tweens.length] = [_local6.filter, _local9, _local6.filter[_local9], _local10, _arg1];
};
};
};
_local8++;
};
_filters[_filters.length] = _local6;
_hf = true;
return (_local6);
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:int;
var _local8:Array;
var _local9:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
if (!_roundProps){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
} else {
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
if (_local4[5]){
_local6 = (_local4[2] + (_local3 * _local4[3]));
_local7 = ((_local6)<0) ? -1 : 1;
_local4[0][_local4[1]] = ((((_local6 % 1) * _local7))>0.5) ? (int(_local6) + _local7) : int(_local6);
} else {
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
};
_local5--;
};
};
if (_hf){
_local5 = (_clrsa.length - 1);
while (_local5 > -1) {
_local4 = _clrsa[_local5];
_local4.f[_local4.p] = ((((_local4.sr + (_local3 * _local4.cr)) << 16) | ((_local4.sg + (_local3 * _local4.cg)) << 8)) | (_local4.sb + (_local3 * _local4.cb)));
_local5--;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local8 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local9 = (_local8.length - 1);
while (_local9 > -1) {
if ((_local8[_local9] is _filters[_local5].type)){
_local8.splice(_local9, 1, _filters[_local5].filter);
break;
};
_local9--;
};
_local5++;
};
this.target.filters = _local8;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
override public function killVars(_arg1:Object):void{
if (TweenLite.overwriteManager.enabled){
TweenLite.overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, ((_filters) || ([])));
};
}
public function get timeScale():Number{
return (_timeScale);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenFilterLite)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
}
}//package toy.com.tweenlite
Section 26
//TweenLite (toy.com.tweenlite.TweenLite)
package toy.com.tweenlite {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class TweenLite {
public var duration:Number;
public var vars:Object;
public var delay:Number;
public var startTime:Number;
public var initTime:Number;
public var tweens:Array;
public var target:Object;
public var active:Boolean;
public var ease:Function;
public var initted:Boolean;
public var combinedTimeScale:Number;
public var gc:Boolean;
public var started:Boolean;
protected var _subTweens:Array;
protected var _hst:Boolean;
protected var _hasUpdate:Boolean;
protected var _isDisplayObject:Boolean;
protected var _specialVars:Object;
public static var version:Number = 9.29;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var defaultEase:Function = TweenLite.easeOut;
public static var overwriteManager:Object;
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
public static var timingSprite:Sprite = new Sprite();
private static var _classInitted:Boolean;
private static var _timer:Timer = new Timer(2000);
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
Motor.add(updateAll);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((_arg1 is DisplayObject));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((((_local3 == "timeScale")) && (!((this.target is TweenLite))))))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local4:Array;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number = _arg1.target.progress;
var _local4:Number = (1 - _local3);
var _local5:Object = _arg1.info.color;
var _local6:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite = _arg1.info.tween;
if (!(_local3.target is DisplayObject)){
return;
};
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
}
}//package toy.com.tweenlite
Section 27
//TweenMax (toy.com.tweenlite.TweenMax)
package toy.com.tweenlite {
import flash.events.*;
import flash.utils.*;
public class TweenMax extends TweenFilterLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
protected var _repeatCount:Number;
public var pauseTime:Number;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static var version:Number = 3.5;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var removeTween:Function = TweenLite.removeTween;
public static var setGlobalTimeScale:Function = TweenFilterLite.setGlobalTimeScale;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if (TweenFilterLite.version < 9.29){
trace("TweenMax error! Please update your TweenFilterLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Array;
var _local9:Number;
_arg2 = (_arg2 + " hexColors bezier bezierThrough shortRotation orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop onCompleteListener onUpdateListener onStartListener ");
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
var _local8:Function = bezierProxy;
if (this.vars.orientToBezier == true){
this.vars.orientToBezier = [["x", "y", "rotation", 0]];
_local8 = bezierProxy2;
} else {
if ((this.vars.orientToBezier is Array)){
_local8 = bezierProxy2;
};
};
if (((!((this.vars.bezier == undefined))) && ((this.vars.bezier is Array)))){
_local6 = {};
_local7 = this.vars.bezier;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezier", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, false), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (((!((this.vars.bezierThrough == undefined))) && ((this.vars.bezierThrough is Array)))){
_local6 = {};
_local7 = this.vars.bezierThrough;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezierThrough", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, true), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (!isNaN(this.vars.shortRotation)){
_local9 = ((this.vars.shortRotation - this.target.rotation) % 360);
if (((this.vars.shortRotation - this.target.rotation) % 360) != (_local9 % 180)){
_local9 = ((_local9)<0) ? (_local9 + 360) : (_local9 - 360);
};
this.tweens[this.tweens.length] = [this.target, "rotation", this.target.rotation, _local9, "rotation"];
};
if (((!((this.vars.hexColors == undefined))) && ((typeof(this.vars.hexColors) == "object")))){
for (_local3 in this.vars.hexColors) {
addSubTween("hexColors", hexColorsProxy, {r:(this.target[_local3] >> 16), g:((this.target[_local3] >> 8) & 0xFF), b:(this.target[_local3] & 0xFF)}, {r:(this.vars.hexColors[_local3] >> 16), g:((this.vars.hexColors[_local3] >> 8) & 0xFF), b:(this.vars.hexColors[_local3] & 0xFF)}, {prop:_local3, target:this.target});
};
};
super.initTweenVals(true, _arg2);
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
this.enabled = true;
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_subTweens = [];
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:Object;
var _local6:int;
var _local7:Object;
var _local8:Array;
var _local9:Array;
var _local4:Number = this.progress;
if (((!((this.vars[_arg1] == undefined))) && (this.initted))){
if (((!(_arg3)) && (!((_local4 == 0))))){
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
if (this.tweens[_local6][4] == _arg1){
this.tweens[_local6][0][this.tweens[_local6][1]] = this.tweens[_local6][2];
};
_local6--;
};
};
_local5 = {};
_local5[_arg1] = 1;
killVars(_local5);
};
this.vars[_arg1] = _arg2;
if (this.initted){
_local7 = this.vars;
_local8 = this.tweens;
_local9 = _subTweens;
this.vars = {};
this.tweens = [];
_subTweens = [];
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
this.vars = _local7;
this.tweens = _local8.concat(this.tweens);
_subTweens = _local9.concat(_subTweens);
};
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = (1 / (1 - this.ease((_local1 * this.duration), 0, 1, this.duration)));
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local3 = (_local4[2] + _local4[3]);
_local4[3] = ((_local3 - _local4[0][_local4[1]]) * _local2);
_local4[2] = (_local3 - _local4[3]);
_local5--;
};
};
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
if (this.vars[_arg1[_local3]] != null){
_local2[_arg1[_local3]] = 1;
};
_local3--;
};
killVars(_local2);
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get paused():Boolean{
return ((this.startTime == 999999999999999));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object):Array{
var _local4:int;
var _local5:Object;
var _local6:String;
var _local7:Number;
var _local8:Object;
trace("WARNING: TweenMax.allTo() and TweenMax.allFrom() have been deprecated in favor of the much more powerful and flexible TweenGroup class. See http://blog.greensock.com/tweengroup/ for more details. Future versions of TweenMax may not include allTo() and allFrom() (to conserve file size).");
if (_arg1.length == 0){
return ([]);
};
var _local9:Array = [];
var _local10:Number = ((_arg3.delayIncrement) || (0));
delete _arg3.delayIncrement;
if (_arg3.onCompleteAll == undefined){
_local8 = _arg3;
} else {
_local8 = {};
for (_local6 in _arg3) {
_local8[_local6] = _arg3[_local6];
};
_local8.onCompleteParams = [[_arg3.onComplete, _arg3.onCompleteAll], [_arg3.onCompleteParams, _arg3.onCompleteAllParams]];
_local8.onComplete = TweenMax.callbackProxy;
delete _arg3.onCompleteAll;
};
delete _arg3.onCompleteAllParams;
if (_local10 == 0){
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
} else {
_local7 = ((_arg3.delay) || (0));
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local5.delay = (_local7 + (_local4 * _local10));
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
_local8.delay = (_local7 + ((_arg1.length - 1) * _local10));
};
_local9[_local9.length] = new TweenMax(_arg1[(_arg1.length - 1)], _arg2, _local8);
if ((_arg3.onCompleteAllListener is Function)){
_local9[(_local9.length - 1)].addEventListener(TweenEvent.COMPLETE, _arg3.onCompleteAllListener);
};
return (_local9);
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object):Array{
_arg3.runBackwards = true;
return (allTo(_arg1, _arg2, _arg3));
}
public static function callbackProxy(_arg1:Array, _arg2:Array=null):void{
var _local3:uint;
while (_local3 < _arg1.length) {
if (_arg1[_local3] != undefined){
_arg1[_local3].apply(null, _arg2[_local3]);
};
_local3++;
};
}
public static function sequence(_arg1:Object, _arg2:Array):Array{
var _local3:uint;
while (_local3 < _arg2.length) {
_arg2[_local3].target = _arg1;
_local3++;
};
return (multiSequence(_arg2));
}
public static function multiSequence(_arg1:Array):Array{
var _local6:Object;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:Object;
var _local12:String;
trace("WARNING: TweenMax.multiSequence() and TweenMax.sequence() have been deprecated in favor of the much more powerful and flexible TweenGroup class. See http://blog.greensock.com/tweengroup/ for more details. Future versions of TweenMax may not include sequence() and multiSequence() (to conserve file size).");
var _local2:Dictionary = new Dictionary();
var _local3:Array = [];
var _local4:int = TweenLite.overwriteManager.mode;
var _local5:Number = 0;
_local10 = 0;
while (_local10 < _arg1.length) {
_local6 = _arg1[_local10];
_local9 = ((_local6.time) || (0));
_local11 = {};
for (_local12 in _local6) {
_local11[_local12] = _local6[_local12];
};
delete _local11.time;
_local8 = ((_local11.delay) || (0));
_local11.delay = (_local5 + _local8);
_local7 = _local11.target;
delete _local11.target;
if (_local4 == 1){
if (_local2[_local7] == undefined){
_local2[_local7] = _local11;
} else {
_local11.overwrite = 2;
};
};
_local3[_local3.length] = new TweenMax(_local7, _local9, _local11);
_local5 = (_local5 + (_local9 + _local8));
_local10++;
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = {s:_local4[0], cp:(_local4[1] - ((_local4[2] - _local4[0]) / 4)), e:_local4[1]};
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = {s:_local4[_local3], cp:(_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)].cp)), e:_local4[(_local3 + 1)]};
_local3++;
};
} else {
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:((_local4[1] + _local4[2]) / 2)};
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = {s:_local5[(_local3 - 2)].e, cp:_local4[_local3], e:((_local4[_local3] + _local4[(_local3 + 1)]) / 2)};
_local3++;
};
_local5[_local5.length] = {s:_local5[(_local5.length - 1)].e, cp:_local4[(_local4.length - 2)], e:_local4[(_local4.length - 1)]};
} else {
if (_local4.length == 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:_local4[2]};
} else {
if (_local4.length == 2){
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
};
};
};
return (_local7);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (!_local2[_local4].gc){
_local3[_local3.length] = _local2[_local4];
};
_local4--;
};
};
return (_local3);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((_local2[_local3].active) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function hexColorsProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target[_arg1.info.prop] = uint((((_arg1.target.r << 16) | (_arg1.target.g << 8)) | _arg1.target.b));
}
public static function bezierProxy(_arg1:Object, _arg2:Number=0):void{
var _local6:int;
var _local7:String;
var _local8:Object;
var _local9:Number;
var _local10:uint;
var _local3:Number = _arg1.target.t;
var _local4:Object = _arg1.info.props;
var _local5:Object = _arg1.info.target;
if (_local3 == 1){
for (_local7 in _local4) {
_local6 = (_local4[_local7].length - 1);
_local5[_local7] = _local4[_local7][_local6].e;
};
} else {
for (_local7 in _local4) {
_local10 = _local4[_local7].length;
if (_local3 < 0){
_local6 = 0;
} else {
if (_local3 >= 1){
_local6 = (_local10 - 1);
} else {
_local6 = int((_local10 * _local3));
};
};
_local9 = ((_local3 - (_local6 * (1 / _local10))) * _local10);
_local8 = _local4[_local7][_local6];
_local5[_local7] = (_local8.s + (_local9 * (((2 * (1 - _local9)) * (_local8.cp - _local8.s)) + (_local9 * (_local8.e - _local8.s)))));
};
};
}
public static function bezierProxy2(_arg1:Object, _arg2:Number=0):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Number;
bezierProxy(_arg1, _arg2);
var _local3:Object = {};
var _local4:Object = _arg1.info.target;
_arg1.info.target = _local3;
_arg1.target.t = (_arg1.target.t + 0.01);
bezierProxy(_arg1);
var _local5:Array = _arg1.info.orientToBezier;
var _local11:uint;
while (_local11 < _local5.length) {
_local9 = _local5[_local11];
_local10 = ((_local9[3]) || (0));
_local7 = (_local3[_local9[0]] - _local4[_local9[0]]);
_local8 = (_local3[_local9[1]] - _local4[_local9[1]]);
_local4[_local9[2]] = ((Math.atan2(_local8, _local7) * _RAD2DEG) + _local10);
_local11++;
};
_arg1.info.target = _local4;
_arg1.target.t = (_arg1.target.t - 0.01);
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
}
}//package toy.com.tweenlite
Section 28
//Button (toy.gui.button.Button)
package toy.gui.button {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Button extends TimelineClip {
public var selected:Button;
public var data:Object;
public var childPressed:Button;
public var name:String;
public var id:int;
public var isSelectable:Boolean;
private var _isUnique:Boolean;
private var _isOnOff:Boolean;
public var group:Button_Group;
private var isDown:Boolean;
private var isOver:Boolean;
public var thumbnail:Picture;
public var picture:Picture;
public static var instances:Dictionary = new Dictionary();
public function Button(_arg1:MovieClip=null, _arg2:Function=null, _arg3:Object=null){
data = {};
super(_arg1, true);
if (instances[_arg1]){
trace("ALREADY A BUTTON FOR THIS MOVIECLIP");
};
instances[_arg1] = this;
this.mouseDown = _arg2;
name = StringUtil.getPrefix(_arg1.name, "_btn");
setGroup(_arg1.parent);
extract(_arg3);
enableButton();
if (_arg1.thumbnail){
thumbnail = Picture.getInstance(_arg1.thumbnail);
};
if (_arg1.picture){
picture = Picture.getInstance(_arg1.picture);
};
}
public function extract(_arg1:Object=null){
if (!_arg1){
return;
};
ArrayUtil.extract(_arg1, this);
if (_arg1.data){
fill(data);
};
}
public function fill(_arg1:Object=null, _arg2:String="left"){
this.data = ((_arg1) || ({}));
if (thumbnail){
thumbnail.clear();
};
SpriteUtil.fillFields(target, this.data, false, _arg2);
target.visible = true;
}
public function setEvents(_arg1:Function=null, _arg2:Function=null, _arg3:Function=null){
this.mouseOver = _arg1;
this.mouseOut = _arg2;
this.mouseUp = _arg3;
}
public function setGroup(_arg1:Object){
group = Button_Group.getInstance(_arg1).push(this);
}
public function set choice(_arg1:Object){
isUnique = true;
setGroup(_arg1);
}
public function set isOnOff(_arg1:Boolean){
_isOnOff = _arg1;
if (_arg1){
isSelectable = true;
};
}
public function get isOnOff(){
return (_isOnOff);
}
public function set isUnique(_arg1:Boolean){
_isUnique = _arg1;
if (_arg1){
isSelectable = true;
};
}
public function get isUnique(){
return (_isUnique);
}
public function get isSelected(){
return (group.isSelected(this));
}
override public function _mouseDown(_arg1=null){
if (((isSelected) && (_isOnOff))){
deselect();
if (mouseDown != null){
mouseDown(this);
};
return;
};
isDown = true;
super._mouseDown(this);
gotoLabel("down", 1);
if (isSelectable){
select();
};
if (mouseDown != null){
mouseDown(this);
};
}
override public function _mouseOver(_arg1=null){
if (isSelected){
return;
};
isOver = true;
super._mouseOver(this);
gotoLabel("over", 1);
if (mouseOver == null){
return;
};
mouseOver(this);
}
override public function _mouseUp(_arg1=null){
if (isSelected){
return;
};
isDown = false;
super._mouseUp(this);
gotoLabel((isOver) ? "over" : "out", 1);
if (mouseUp == null){
return;
};
mouseUp(this);
}
override public function _mouseOut(_arg1=null){
if (isSelected){
return;
};
isOver = false;
super._mouseOut(this);
if (!isDown){
gotoLabel("out", 1);
};
if (mouseOut == null){
return;
};
mouseOut(this);
}
override public function _doubleClick(_arg1=null){
if (isSelected){
return;
};
super._doubleClick(this);
if (doubleClick == null){
return;
};
doubleClick(this);
}
public function select(){
if (isSelected){
return;
};
group.select(this);
gotoLabel("select", 1);
isDown = false;
isOver = false;
}
public function deselect(){
if (isSelected){
group.deselect(this);
};
isDown = false;
isOver = false;
gotoLabel("out", 1);
}
public function unselect(){
if (isSelected){
group.unselect(this);
};
isDown = false;
isOver = false;
gotoLabel("out", 1);
}
public function enable(){
super.enableButton();
target.visible = true;
target.alpha = 1;
}
public function disable(){
block();
target.alpha = 0.5;
}
public function block(){
blockMouse();
isDown = false;
isOver = false;
}
public function goto(_arg1){
if ((target is SimpleButton)){
return;
};
gotoAndPlay(_arg1);
}
public static function scan(_arg1:MovieClip, _arg2:Function, _arg3:Object=null):Array{
return (array(Depth.getMovieClipsNames(_arg1, "btn"), _arg2, _arg3));
}
public static function force(_arg1:MovieClip, _arg2:Function, _arg3:Object=null):Array{
return (array(Depth.getMovieClips(_arg1), _arg2, _arg3));
}
public static function array(_arg1, _arg2:Function, _arg3:Object=null):Array{
var _local5:*;
var _local6:Button;
var _local4:Array = [];
for (_local5 in _arg1) {
_local6 = getInstance(_arg1[_local5], _arg2, _arg3);
_local6.id = _local5;
_local4.push(_local6);
};
return (_local4);
}
public static function getInstance(_arg1:MovieClip, _arg2:Function=null, _arg3:Object=null):Button{
var _local4:Button = ((instances[_arg1]) || (new Button(_arg1)));
if (_arg2 != null){
_local4.mouseDown = _arg2;
};
_local4.extract(_arg3);
return (_local4);
}
}
}//package toy.gui.button
Section 29
//Button_Boolean (toy.gui.button.Button_Boolean)
package toy.gui.button {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Button_Boolean {
public var target:MovieClip;
public var onChange:Function;
private var true_btn:Button;
private var false_btn:Button;
private var isFullScreen:Boolean;
private var isMute:Boolean;
private var _value:Boolean;
public function Button_Boolean(_arg1:MovieClip, _arg2:Function=null, _arg3:Boolean=false, _arg4:Boolean=false){
this.target = _arg1;
this.onChange = _arg2;
this.isFullScreen = _arg3;
this.isMute = _arg4;
true_btn = new Button(_arg1.true_btn, mouseDown);
false_btn = new Button(_arg1.false_btn, mouseDown);
value = true;
if (_arg3){
};
if (_arg4){
value = true;
};
}
private function mouseDown(_arg1:Button){
value = ((_arg1.name == "true")) ? true : false;
if (onChange != null){
onChange(value);
};
}
public function on(){
true_btn._mouseDown();
}
public function off(){
false_btn._mouseDown();
}
public function set value(_arg1:Boolean){
_value = _arg1;
true_btn.target.visible = !(_arg1);
false_btn.target.visible = _arg1;
if (isFullScreen){
if (_arg1){
FullScreen.on();
} else {
FullScreen.off();
};
};
if (isMute){
if (_arg1){
Sounds.on();
} else {
Sounds.off();
};
};
}
public function get value(){
return (_value);
}
public function switchValue(){
value = !(_value);
if (onChange != null){
onChange(value);
};
}
public function onFullScreen(_arg1:Boolean){
if (_arg1){
true_btn._mouseDown();
} else {
false_btn._mouseDown();
};
}
public static function scan(_arg1:MovieClip, _arg2:Object=null):Array{
var _local5:*;
var _local6:MovieClip;
var _local7:String;
var _local8:Function;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Button_Boolean;
var _local3:Array = Depth.getMovieClips(_arg1, "_boolean");
var _local4:Array = [];
for (_local5 in _local3) {
_local6 = _local3[_local5];
_local7 = String(_local6.name.split("_boolean")[0]).toLowerCase();
_local8 = (_arg2) ? _arg2[("on_" + _local7)] : null;
_local9 = !((_local7.indexOf("fullscreen") == -1));
_local10 = !((_local7.indexOf("mute") == -1));
_local11 = new Button_Boolean(_local6, _local8, _local9, _local10);
_local4.push(_local11);
};
return (_local4);
}
}
}//package toy.gui.button
Section 30
//Button_Group (toy.gui.button.Button_Group)
package toy.gui.button {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Button_Group extends Dictionary {
public var id:Object;
public var selected:Dictionary;
public var _selMax:uint;// = 1
public var selData:Array;
private static var pool:Dictionary = new Dictionary();
public function Button_Group(_arg1:Object){
selected = new Dictionary();
selData = [];
super();
this.id = _arg1;
pool[_arg1] = this;
}
public function push(_arg1:Button){
this[_arg1] = true;
return (this);
}
public function select(_arg1:Button){
var _local3:Array;
selected[_arg1] = true;
ArrayUtil.pushUnique(_arg1.data, selData);
var _local2:* = ArrayUtil.extractPush(selData);
while (_local2.length > _selMax) {
_local3 = getButtonsByData(_local2.shift());
while (_local3.length) {
_local3.shift().deselect();
};
};
selData = _local2;
}
public function deselect(_arg1:Button=null){
delete selected[_arg1];
if (_arg1){
ArrayUtil.removeItem(_arg1.data, selData);
};
if (!_arg1){
for (_arg1 in this) {
_arg1.deselect();
};
};
}
public function unselect(_arg1:Button=null){
delete selected[_arg1];
if (!_arg1){
for (_arg1 in this) {
_arg1.unselect();
};
};
}
public function isSelected(_arg1:Button){
return (selected[_arg1]);
}
public function clear(){
var _local1:*;
for (_local1 in selected) {
_local1.deselect();
};
selected = new Dictionary();
selData = [];
}
public function selectByData(){
var _local2:Array;
unselect();
var _local1:* = ArrayUtil.extractPush(selData);
while (_local1.length) {
_local2 = getButtonsByData(_local1.shift());
while (_local2.length) {
_local2.shift().select();
};
};
}
public function getButtonsByData(_arg1:Object):Array{
var _local3:*;
var _local2:Array = [];
for (_local3 in this) {
if (_local3.data == _arg1){
_local2.push(_local3);
};
};
return (_local2);
}
public function get selLenght():uint{
var _local2:*;
var _local1:uint;
for (_local2 in selected) {
_local1++;
};
return (_local1);
}
public function set selMax(_arg1:int){
var _local2:*;
_selMax = _arg1;
for (_local2 in this) {
_local2.isSelectable = Boolean(_arg1);
};
}
public static function getInstance(_arg1:Object):Button_Group{
return (((pool[_arg1]) || (new Button_Group(_arg1))));
}
}
}//package toy.gui.button
Section 31
//Control_Stream (toy.gui.Control_Stream)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Control_Stream {
public var name:String;
public var target:MovieClip;
public var play_pause_btn:Button_Boolean;
public var slider:Slider;
public var loadbar:MovieClip;
public var controlled;
public function Control_Stream(_arg1:MovieClip, _arg2=null){
this.target = _arg1;
if (_arg1.play_pause_btn){
play_pause_btn = new Button_Boolean(_arg1.play_pause_btn, _onPlayPause);
play_pause_btn.value = false;
};
if (_arg1.slider){
slider = new Slider(_arg1.slider, _onSlide);
slider.BAR_FRICTION = 1;
slider.mouseUp = _mouseUp;
loadbar = slider.target.loadbar;
};
setControlled(_arg2);
}
public function setControlled(_arg1=null){
clear();
if (!_arg1){
return;
};
this.controlled = _arg1;
}
public function clear(){
controlled = {};
}
public function reset(){
if (target.time){
target.time.textField.text = "00:00 / 00:00";
};
if (loadbar){
loadbar.gotoAndStop(0);
};
if (slider){
slider.setPercent(0);
};
}
public function changeStatus(_arg1:Boolean){
if (play_pause_btn){
play_pause_btn.value = _arg1;
};
}
private function _onPlayPause(_arg1:Boolean){
if (!controlled){
return;
};
if (_arg1){
controlled.play();
} else {
controlled.pause();
};
}
private function _onSlide(_arg1:int){
if (!controlled){
return;
};
controlled.gotoAndPause(_arg1);
updateTimeText();
}
private function _mouseUp(_arg1:int){
if (!controlled){
return;
};
controlled.gotoAndPlay(_arg1);
updateTimeText();
}
public function goto(_arg1:int){
if (!slider){
return;
};
slider.setPercent(_arg1);
updateTimeText();
}
public function updateTimeText(){
if (!target.time){
return;
};
target.time.textField.text = controlled.timeText;
}
public function setPercentLoaded(_arg1:Number){
SpriteUtil.goPercent(loadbar, _arg1, false, 5);
}
}
}//package toy.gui
Section 32
//Displayer (toy.gui.Displayer)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Displayer {
public var target:MovieClip;
public var format:String;
public var _value:Number;
public var _temp:Number;// = 0
public var name:String;
public var textField:TextField;
public var onDisplayed:Function;
public var global:Data;
public var autoReach:Boolean;
public var percent:Number;
public static var pool:Dictionary = new Dictionary();
public function Displayer(_arg1:MovieClip, _arg2:String=null){
this.target = _arg1;
this.name = ((_arg2) || (StringUtil.getPrefix(_arg1.name, "_displayer")));
textField = _arg1.textField;
if (StringUtil.contains(this.name, "time")){
format = "time";
};
if (StringUtil.contains(this.name, "score")){
format = "score";
};
global = Data.getInstance(this.name);
global.addListener(display);
display(global.value);
pool[this.name] = this;
}
public function display(_arg1:Number, _arg2:Number=0.7, _arg3:Function=null){
_value = _arg1;
this.onDisplayed = _arg3;
if (autoReach){
return ((value = _value));
};
Tweenr.to(this, _arg2, {_temp:_value, ease:Easing.easeInOutCirc}, _onDisplayed);
Motor.addRender(render);
if ((Math.abs(_temp) - Math.abs(_value)) > 1){
return;
};
value = _value;
render();
}
public function set value(_arg1:int){
percent = (((global.min + _arg1) * 100) / global.max);
SpriteUtil.goPercent(target, percent, false);
if (textField){
textField.text = StringUtil.formatText(_arg1, format);
};
}
public function render(){
value = _temp;
}
public function _onDisplayed(){
render();
Motor.remove(render);
if (onDisplayed != null){
onDisplayed();
};
}
public static function scan(_arg1:MovieClip):Object{
var _local5:*;
var _local2:* = Depth.getMovieClips(_arg1, "displayer");
var _local3:* = [];
var _local4:* = {};
for (_local5 in _local2) {
_local3.push(new Displayer(_local2[_local5]));
};
for (_local5 in _local3) {
_local4[_local3[_local5].name] = _local3[_local5];
};
return (_local4);
}
public static function getInstance(_arg1:String):Displayer{
return (pool[_arg1]);
}
}
}//package toy.gui
Section 33
//Dust (toy.gui.Dust)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Dust extends Vector3 {
public var pool:Dictionary;
public var rotation:Number;// = 0
public var angle:Number;// = 0
public var scale:Number;// = 1
public var friction:Number;// = 1
public var lifespan:int;// = 50
public var color:String;
public var container:DisplayObjectContainer;
public var max:int;// = 50
public var delay:int;// = 1
public var label:String;
public var rotationVel:Number;// = 0
public var isExplosion:Boolean;
public var gravity:Vector3;
public var spectrumGravity:Vector3;
public var spectrumPos:Vector3;
public var spectrumVel:Vector3;
public var rotation3D:Vector3;
public var velocity:Vector3;
public var target:Object;
public var count:int;
public var autoFade:Boolean;
public var sprite:DisplayObject;
public var delayMotor:Motor;
public var inverseSpeed:Boolean;
public var alpha:Number;// = 1
private var _delay:int;
public static var explosion:Dust;
public static var explosionParticles:Dust;
public static var trail:Dust;
private static var item:Dust;
private static var bitmapData:Array = [];
public function Dust(_arg1){
pool = new Dictionary();
gravity = new Vector3(0, 0, 0);
spectrumGravity = new Vector3(0, 0, 0);
spectrumPos = new Vector3(5, 5, 5);
rotation3D = new Vector3();
velocity = new Vector3();
delayMotor = new Motor();
super();
setTarget(_arg1);
}
public function setTarget(_arg1, _arg2:DisplayObjectContainer=null){
this.target = _arg1;
if (((!((_arg1 is DisplayObject))) && (_arg1.sprite))){
sprite = _arg1.sprite;
} else {
sprite = _arg1;
};
this.container = ((_arg2) || (sprite.parent));
}
public function start(_arg1=null):Dust{
if (_arg1){
setTarget(_arg1);
};
kill();
play();
if (isExplosion){
while (count < max) {
spawn();
};
};
delayMotor.start(spawn);
return (this);
}
public function play(){
Motor.addClip(this);
}
public function stop(){
delayMotor.stop();
}
public function kill(){
var _local1:*;
stop();
for (_local1 in pool) {
_local1.remove();
};
Motor.remove(this);
}
public function spawn(){
count++;
var _local1:* = DustParticle.getInstance();
if (((inverseSpeed) && (target.velocity))){
velocity.x = (-(target.velocity.x) * 0.1);
velocity.y = (-(target.velocity.y) * 0.1);
};
pool[_local1] = true;
x = sprite.x;
y = sprite.y;
_local1.spawn(this);
if (count >= max){
delayMotor.stop();
};
}
public function remove(_arg1:DustParticle){
count--;
delete pool[_arg1];
if (!count){
stop();
};
}
public function update(){
var _local1:*;
x = sprite.x;
y = sprite.y;
for (_local1 in pool) {
_local1.update();
};
delayMotor.update();
}
public function render(){
var _local1:*;
for (_local1 in pool) {
_local1.render();
};
}
public static function scan(_arg1:MovieClip){
if (!_arg1.dust){
return;
};
init(_arg1.dust);
var _local2:MovieClip = new MovieClip();
explosion = Dust.EXPLOSION(_local2);
explosionParticles = Dust.EXPLOSION_PARTICLES(_local2);
trail = Dust.TRAIL_DUST(_local2);
explosion.kill();
explosionParticles.kill();
trail.kill();
}
public static function EXPLOSION(_arg1, _arg2:String=null):Dust{
item = new Dust(_arg1);
item.isExplosion = true;
item.spectrumPos = new Vector3(10, 10, 10);
item.spectrumVel = new Vector3(20, 20, 20);
item.max = 70;
item.autoFade = true;
item.label = ((_arg2) || ("dust"));
return (item.start());
}
public static function EXPLOSION_PARTICLES(_arg1, _arg2:String=null):Dust{
item = new Dust(_arg1);
item.isExplosion = true;
item.spectrumPos = new Vector3(10, 10, 10);
item.spectrumVel = new Vector3(20, 20, 20);
item.velocity = new Vector3(0, -15, 0);
item.gravity.y = 1;
item.spectrumGravity.y = 0.4;
item.max = 70;
item.autoFade = true;
item.label = ((_arg2) || ("dust"));
return (item.start());
}
public static function TRAIL(_arg1, _arg2:String=null):Dust{
item = new Dust(_arg1);
item.spectrumPos = new Vector3(5, 5, 5);
item.inverseSpeed = true;
item.max = 100;
item.rotationVel = 2;
item.lifespan = 20;
item.autoFade = true;
item.alpha = 0.5;
item.label = ((_arg2) || ("dust"));
return (item.start());
}
public static function TRAIL_DUST(_arg1, _arg2:String=null, _arg3:int=30):Dust{
item = new Dust(_arg1);
item.spectrumPos = new Vector3(_arg3, _arg3, _arg3);
item.inverseSpeed = true;
item.max = 100;
item.rotationVel = 2;
item.spectrumVel = new Vector3(2, 0, 0);
item.lifespan = 20;
item.autoFade = true;
item.alpha = 0.5;
item.gravity.y = 1;
item.label = ((_arg2) || ("dust"));
return (item.start());
}
public static function init(_arg1:MovieClip){
bitmapData = SpriteUtil.getTimeline(Depth.removeChild(_arg1), true);
}
public static function getBitmapdata(_arg1:String=null){
if (!_arg1){
return (bitmapData[0]);
};
var _local2:* = ((bitmapData.labels[_arg1]) || (bitmapData));
return (ArrayUtil.getRandomItem(_local2));
}
}
}//package toy.gui
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class DustParticle extends Vector3 {
public var bitmap:Bitmap;
public var sprite:Sprite;
public var rotation:Number;
public var rotation3D:Vector3;
public var velocity:Vector3;
public var angle:Number;
public var scale:Number;
public var autoFade:Number;// = 0
public var lifespan:int;
public var visible:Boolean;
public var sinCounter:SinCounter;
public var rotationVel:Number;// = 0
public var dust:Dust;
public var middleSpan:Number;
public var gravity:Vector3;
public static var unused:Array = [];
private function DustParticle(){
bitmap = new Bitmap();
sprite = new Sprite();
gravity = new Vector3();
super();
sprite.addChild(bitmap);
SpriteUtil.allowMouse(sprite, false);
}
override public function reset(){
super.reset();
Depth.removeChild(this);
rotation = 0;
rotation3D = new Vector3();
velocity = new Vector3();
angle = 0;
scale = 1;
autoFade = 0;
lifespan = 0;
visible = true;
sprite.alpha = 1;
}
public function spawn(_arg1:Dust){
this.dust = _arg1;
this.copy(_arg1);
this.addSpectrum(_arg1.spectrumPos);
rotation3D.copy(_arg1.rotation3D);
velocity.copy(_arg1.velocity);
gravity.copy(_arg1.gravity);
if (_arg1.spectrumVel){
velocity.addSpectrum(_arg1.spectrumVel);
};
if (_arg1.spectrumGravity){
gravity.addSpectrum(_arg1.spectrumGravity);
};
sprite.alpha = _arg1.alpha;
rotationVel = _arg1.rotationVel;
lifespan = _arg1.lifespan;
autoFade = (_arg1.autoFade) ? (2 / _arg1.lifespan) : 0;
middleSpan = (lifespan / 2);
bitmap.bitmapData = Dust.getBitmapdata(_arg1.label);
Depth.toFront(sprite, _arg1.container);
Align.selfCenter(bitmap);
}
public function update(){
velocity.add(gravity);
velocity.scalar(dust.friction);
this.add(velocity);
rotation = (rotation + rotationVel);
if (sinCounter){
sinCounter.increment();
x = (x + sinCounter.x);
y = (y + sinCounter.y);
};
if (!--lifespan){
remove();
};
}
public function render(){
View.render2D(this);
if (lifespan < middleSpan){
sprite.alpha = (sprite.alpha - autoFade);
};
}
public function remove(){
visible = false;
unused.push(this);
Depth.removeChild(sprite);
dust.remove(this);
}
public static function getInstance():DustParticle{
var _local1:DustParticle = ((unused.shift()) || (new (DustParticle)));
_local1.reset();
return (_local1);
}
}
Section 34
//Message (toy.gui.Message)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Message {
public var name:String;
public var target:MovieClip;
public var preset:Function;
public var container:DisplayObjectContainer;
public var x:int;
public var y:int;
public var sound:String;
public var duration:Number;// = 1
public static var big:Message;
public static var medium:Message;
public static var mini:Message;
public function Message(_arg1:MovieClip, _arg2:Function=null, _arg3:String=null){
this.target = _arg1;
this.preset = ((_arg2) || (Tweenr.FADE_UP));
this.sound = _arg3;
container = _arg1.parent;
x = (_arg1.x + (_arg1.width / 2));
y = (_arg1.y + (_arg1.height / 2));
name = String(_arg1.name.split("_message")[0]).toLowerCase();
Depth.removeChild(_arg1);
}
public function show(_arg1, _arg2=null, _arg3=null, _arg4:Function=null, _arg5=null, _arg6=null){
var _local7:MessageSprite = MessageSprite.getInstance();
_local7.show(target, _arg1, ((_arg2) || (this.x)), ((_arg3) || (this.y)), ((_arg4) || (this.preset)), ((_arg6) || (this.container)), duration, _arg5);
return (_local7);
}
public static function scan(_arg1:MovieClip){
var _local3:*;
var _local4:Message;
var _local2:Array = Depth.getMovieClips(_arg1, "_message");
for (_local3 in _local2) {
_local4 = new Message(_local2[_local3]);
if (_local4.name == "big"){
_local4.preset = Tweenr.FLICKER_OUT;
big = _local4;
};
if (_local4.name == "medium"){
_local4.preset = Tweenr.FADE_UP;
medium = _local4;
};
if (_local4.name == "mini"){
_local4.preset = Tweenr.PICK_UP;
mini = _local4;
};
};
}
public static function showBig(_arg1:String, _arg2:Function=null):MessageSprite{
if (!big){
return;
};
return (big.show(_arg1, null, null, null, _arg2));
}
public static function showMedium(_arg1:String, _arg2=null, _arg3=null):MessageSprite{
if (!medium){
return;
};
return (medium.show(_arg1, _arg2, _arg3));
}
public static function showMini(_arg1:String, _arg2:int, _arg3:int):MessageSprite{
if (!mini){
return;
};
return (mini.show(_arg1, _arg2, _arg3));
}
}
}//package toy.gui
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class MessageSprite extends Sprite {
public var bitmap:Bitmap;
public var onFinish:Function;
public static var pool:Dictionary = new Dictionary();
public static var unused:Array = [];
private function MessageSprite(){
bitmap = new Bitmap();
super();
addChild(bitmap);
SpriteUtil.allowMouse(this, false);
}
public function reset(){
Depth.removeChild(this);
scaleX = (scaleY = (alpha = 1));
rotation = (rotationX = (rotationY = (rotationZ = 0)));
filters = [];
visible = false;
}
public function show(_arg1:MovieClip, _arg2:String, _arg3:int, _arg4:int, _arg5:Function, _arg6:DisplayObjectContainer, _arg7:Number, _arg8:Function){
_arg1.textField.htmlText = _arg2;
_arg1.textField.autoSize = "left";
if (_arg1.area){
_arg1.area.width = ((_arg1.textField.x * 2) + _arg1.textField.width);
};
this.x = _arg3;
this.y = _arg4;
this.onFinish = _arg8;
visible = true;
bitmap.bitmapData = BitmapDataUtil.draw(_arg1);
pool[this] = true;
Align.selfCenter(bitmap);
_arg6.addChild(this);
_arg5(this, _arg7, _onFinish);
}
public function _onFinish(){
reset();
unused.push(this);
delete pool[this];
if (onFinish != null){
onFinish();
};
}
public static function getInstance():MessageSprite{
return (((unused.shift()) || (new (MessageSprite))));
}
}
Section 35
//Picture (toy.gui.Picture)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Picture {
public var target:MovieClip;
public var area:MovieClip;
public var name:String;
public var width:Number;
public var height:Number;
public var crop:Boolean;// = true
public var align:String;
public var noFade:Boolean;
public var arrow:MovieClip;
public var button:Button;
public var controls:Control_Stream;
public var bitmapContainer:Sprite;
public var bitmap:Bitmap;
public var bitmapBack:Bitmap;
public var fadeMode:int;
public var onBitmapData:Function;
public var video:VideoWrapper;
public var sound:Sounds;
public var isPlaying:Boolean;
public var mouseDown:Function;
public var onUpdate:Function;
public var onFinish:Function;
public var stream:Object;
public var data:Object;
public var position:int;
public var duration:int;// = 5
private var isShowing:Boolean;// = false
public var isStream:Boolean;// = true
private var inBypassFade:Boolean;
public var isThumbnail:Boolean;// = true
public var isControlLocal:Boolean;
public static var pool:Dictionary = new Dictionary();
public function Picture(_arg1, _arg2:Function=null, _arg3:int=0, _arg4:Boolean=true){
bitmapContainer = new Sprite();
bitmap = new Bitmap();
bitmapBack = new Bitmap();
video = new VideoWrapper();
super();
this.target = _arg1;
this.onBitmapData = _arg2;
this.fadeMode = _arg3;
this.crop = _arg4;
arrow = Depth.removeChild(_arg1.arrow);
area = _arg1.area;
_arg1.mask = area;
width = area.width;
height = area.height;
button = new Button(GraphicUtil.drawAreaMC(width, height), _mouseDown);
controls = (_arg1.controls) ? new Control_Stream(Depth.removeChild(_arg1.controls), this) : null;
isControlLocal = Boolean(controls);
button.target.buttonMode = false;
Depth.toBack(bitmapBack, bitmapContainer);
Depth.toFront(bitmap, bitmapContainer);
Depth.toFront(bitmapContainer, _arg1);
name = StringUtil.getPrefix(_arg1.name, "_picture");
pool[_arg1] = this;
clear();
}
public function fill(_arg1:Object=null){
clear();
this.data = _arg1;
if (((!(isThumbnail)) && (_arg1.picture))){
load(_arg1.picture);
} else {
if (_arg1.thumbnail){
load(_arg1.thumbnail);
};
};
if (!isStream){
return;
};
if (_arg1.audio){
stream = Sounds.getSound(_arg1.audio);
};
if (_arg1.video){
stream = video;
stream.uri = _arg1.video;
};
if (_arg1.youtube){
stream = YouTubeWrapper.getInstance();
stream.uri = _arg1.youtube;
};
if (stream){
stream.position = 0;
};
}
public function clear(){
hideAll();
stop();
if (controls){
controls.reset();
};
if (stream){
stream.stop();
};
if ((stream is VideoWrapper)){
stream.netStream.close();
};
if (!fadeMode){
bitmap.bitmapData = null;
};
stream = null;
isPlaying = false;
}
public function resize(_arg1=null, _arg2=null){
width = ((_arg1) || (area.width));
height = ((_arg2) || (area.height));
area.width = width;
area.height = height;
Align.fit(bitmap, area, crop);
Align.fit(bitmapBack, area, crop);
if ((stream is DisplayObject)){
Align.fit(stream, area, crop);
};
if (arrow){
Align.center(arrow, area);
};
}
public function load(_arg1){
clear();
inBypassFade = true;
Load.removeCallback(_onBitmapData);
Load.image(_arg1, _onBitmapData);
inBypassFade = false;
}
private function _mouseDown(_arg1){
if (isPlaying){
pause();
} else {
play();
};
if (mouseDown != null){
mouseDown(this);
};
}
public function start(){
position = 0;
play();
}
public function stop(){
pause();
if (stream){
stream.stop();
};
if (controls){
controls.goto(0);
};
showDefault();
}
public function play(){
if (isPlaying){
return;
};
isPlaying = true;
if (stream){
showStream();
stream.onFinish = _onFinish;
stream.play();
Motor.add(update);
} else {
showDefault();
showControls();
Motor.addTime(_onTime);
};
if (controls){
controls.changeStatus(isPlaying);
};
}
public function pause(){
if (!isPlaying){
return;
};
isPlaying = false;
if (controls){
controls.changeStatus(isPlaying);
};
Motor.remove(update);
Motor.remove(_onTime);
if (!stream){
return;
};
stream.pause();
showArrow();
}
private function update(){
if (onUpdate != null){
onUpdate();
};
if (!controls){
return;
};
if (Cursor.isDown){
return;
};
controls.goto(percent);
controls.setPercentLoaded(stream.percentLoaded);
autoHideControls();
}
private function _onTime(){
if (!bitmap.bitmapData){
return;
};
position++;
if (controls){
controls.goto(((position * 100) / duration));
};
if (position >= duration){
_onFinish();
};
}
public function gotoAndPause(_arg1){
play();
position = ((_arg1 * duration) / 100);
if (!stream){
return;
};
if (stream.percent == _arg1){
return;
};
stream.goto(_arg1);
stream.pause();
}
public function gotoAndPlay(_arg1){
if (!stream){
return;
};
stream.goto(_arg1);
stream.play();
}
private function _onFinish(){
stop();
if (onFinish != null){
onFinish();
};
}
private function _onBitmapData(_arg1:BitmapData){
if (_arg1 == bitmap.bitmapData){
return;
};
if (fadeMode){
bitmapBack.bitmapData = bitmap.bitmapData;
bitmapBack.alpha = 1;
bitmapBack.width = bitmap.width;
bitmapBack.height = bitmap.height;
bitmapBack.x = bitmap.x;
bitmapBack.y = bitmap.y;
bitmapBack.visible = true;
};
bitmap.bitmapData = _arg1;
bitmap.visible = true;
bitmap.alpha = 1;
Depth.toFront(bitmap);
if (((((!(noFade)) && (!(inBypassFade)))) || (fadeMode))){
Tweenr.FADE_IN(bitmap, 1);
};
resize();
showBitmap();
if (onBitmapData != null){
onBitmapData(_arg1);
};
}
private function hideAll(){
hideControls();
Depth.removeChild(button.target);
Depth.removeChild(bitmapContainer);
if (arrow){
Depth.removeChild(arrow);
};
if ((stream is DisplayObject)){
Depth.removeChild(stream);
};
}
private function showDefault(){
hideAll();
showBitmap();
if (!stream){
return;
};
showArrow();
showButton();
showControls();
}
private function showStream(){
hideAll();
if (!stream){
return;
};
if (!(stream is Sounds)){
Depth.toBack(stream, target);
};
showBitmap();
showButton();
showControls();
}
private function showButton(){
button.target.width = area.width;
button.target.height = area.height;
Depth.toFront(button.target, target);
}
private function showArrow(){
if (!arrow){
return;
};
Align.center(arrow, area, true);
SpriteUtil.allowMouse(arrow, false);
if (!arrow.visible){
Tweenr.FADE_IN(arrow, 0.3);
};
}
private function autoHideControls(){
if (((!(controls)) || ((stream is Sounds)))){
return;
};
if ((((((((target.mouseX > 0)) && ((target.mouseX < width)))) && ((target.mouseY > 0)))) && ((target.mouseY < height)))){
showControls();
} else {
hideControlsDelayed();
};
}
public function showControls(){
if (((!(controls)) || (isShowing))){
return;
};
isShowing = true;
if (isControlLocal){
Depth.toFront(controls.target, target);
};
Tweenr.to(controls.target, 0.3, {alpha:1});
}
private function hideControlsDelayed(){
if (((((((!(controls)) || (!(isPlaying)))) || (!(isShowing)))) || (Cursor.isDown))){
return;
};
isShowing = false;
Tweenr.to(controls.target, 0.3, {alpha:0, visible:false, delay:0.5}, hideControls);
}
public function hideControls(){
if (!controls){
return;
};
isShowing = false;
if (isControlLocal){
Depth.removeChild(controls.target);
};
controls.target.visible = false;
}
private function showBitmap(_arg1:Boolean=false){
Depth.toBack(bitmapContainer, target);
bitmapContainer.alpha = 1;
bitmapContainer.visible = true;
if (_arg1){
Tweenr.FADE_IN(bitmapContainer);
};
}
public function get timeText(){
return ((stream) ? stream.timeText : "00:00 / 00:00");
}
public function get percent(){
return ((stream) ? stream.percent : 0);
}
public static function scan(_arg1:MovieClip):Array{
var _local4:*;
var _local2:Array = Depth.getMovieClips(_arg1, "picture");
var _local3:Array = [];
for (_local4 in _local2) {
_local3.push(getInstance(_local2[_local4]));
};
return (_local3);
}
public static function getInstance(_arg1:MovieClip):Picture{
var _local2:Picture = ((pool[_arg1]) || (new Picture(_arg1)));
return (_local2);
}
}
}//package toy.gui
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class VideoWrapper extends Video {
public var onFinish:Function;
public var onStream:Function;
public var onVideo:Function;
public var percent:Number;// = 0
private var _uri:String;
public var isPlaying:Boolean;
private var isStarted:Boolean;
public var loops:uint;
public var duration:Number;
public var position:Number;
public var netConnection:NetConnection;
public var netStream:NetStream;
public var bufferTime:int;// = 9
public var isStreaming:Boolean;
private function VideoWrapper(){
onStream = function (){
};
netConnection = new NetConnection();
super();
}
public function set uri(_arg1:String){
var value = _arg1;
stop();
_uri = value;
netConnection.connect(null);
duration = 60;
isStarted = false;
if (netStream){
netStream.close();
netStream.removeEventListener(NetStatusEvent.NET_STATUS, _onNetStatus);
};
netStream = new NetStream(netConnection);
netStream.bufferTime = bufferTime;
netStream.client = {onMetaData:function (_arg1:Object){
duration = (_arg1.duration - 0.5);
}};
isStreaming = false;
netStream.addEventListener(NetStatusEvent.NET_STATUS, _onNetStatus);
attachNetStream(netStream);
}
public function start(){
isStarted = true;
isPlaying = false;
visible = false;
netStream.play(_uri);
Motor.add(waitForStart);
}
public function stop(){
if (netStream){
netStream.seek(0);
};
position = 0;
pause();
clear();
Motor.remove(waitForStart);
}
public function play(){
if (!isStarted){
return (start());
};
if (((isPlaying) || (!(isStreaming)))){
return;
};
isPlaying = true;
netStream.resume();
Motor.add(update);
}
public function pause(){
Motor.remove(update);
if (!isPlaying){
return;
};
isPlaying = false;
netStream.pause();
}
public function waitForStart(){
if (!videoWidth){
return;
};
_onNetStatus();
Motor.remove(waitForStart);
}
private function _onNetStatus(_arg1:NetStatusEvent=null){
if (((!(videoWidth)) || (isStreaming))){
return;
};
isStreaming = true;
Align.fit(this, parent.area, true);
Tweenr.FADE_IN(this);
play();
if (onVideo != null){
onVideo(this);
};
return (true);
}
public function loop(_arg1:int=-727379969){
loops = _arg1;
play();
}
public function goto(_arg1:Number){
this.percent = MathUtil.constrain(_arg1, 0, 100);
position = ((this.percent * duration) / 100);
netStream.seek(position);
}
private function update(){
position = netStream.time;
percent = ((position * 100) / duration);
if (percent >= 100){
_onFinish();
};
}
private function _onFinish(_arg1=null){
if (loops > 0){
if (--loops){
return (netStream.seek(0));
};
};
stop();
if (onFinish != null){
onFinish();
};
}
public function get durationText(){
return (StringUtil.seconds2Minutes(duration, true));
}
public function get positionText(){
return (StringUtil.seconds2Minutes(position, true));
}
public function get timeText(){
return (((positionText + " / ") + durationText));
}
public function get percentLoaded(){
return ((netStream) ? ((netStream.bytesLoaded * 100) / netStream.bytesTotal) : 0);
}
}
class YouTubeWrapper extends Sprite {
public var onFinish:Function;
public var onStream:Function;
public var onVideo:Function;
public var percent:Number;// = 0
private var _uri:String;
public var isPlaying:Boolean;
private var isStarted:Boolean;
public var offset:Number;
public var loops:uint;
public var isReady:Boolean;
public var youtube:YoutubePlayer;
public var isQuality:Boolean;
public static var instance:YouTubeWrapper;
private function YouTubeWrapper(){
onStream = function (){
};
super();
youtube = new YoutubePlayer(onPlayerReady, onPlayerError, onPlayerStateChange, onVideoPlaybackQualityChange);
addChild(youtube);
instance = this;
}
private function onPlayerReady(_arg1:Event){
isReady = true;
}
private function onPlayerError(_arg1:Event){
}
private function onPlayerStateChange(_arg1:Event){
}
private function onVideoPlaybackQualityChange(_arg1:Event){
if (isQuality){
return;
};
isQuality = true;
youtube.setPlaybackQuality(YoutubePlayer.HD720);
}
public function set uri(_arg1:String){
if (isReady){
youtube.seekTo(0);
};
stop();
_uri = _arg1;
offset = 0;
}
public function start(){
if (!isReady){
return;
};
isStarted = true;
isPlaying = false;
isQuality = false;
youtube.setSize(parent.area.width, parent.area.height);
youtube.loadVideoById(_uri);
youtube.x = (youtube.y = (x = (y = 0)));
Tweenr.FADE_IN(this);
play();
}
public function stop(){
if (!isReady){
return;
};
youtube.stopVideo();
position = 0;
pause();
}
public function play(){
if (!isStarted){
return (start());
};
if (isPlaying){
return;
};
isPlaying = true;
youtube.playVideo();
Motor.add(update);
}
public function pause(){
if (!isPlaying){
return;
};
isPlaying = false;
youtube.pauseVideo();
Motor.remove(update);
}
public function loop(_arg1:int=-727379969){
loops = _arg1;
play();
}
public function goto(_arg1:Number){
this.percent = MathUtil.constrain(_arg1, 0, 100);
offset = ((this.percent * duration) / 100);
youtube.seekTo(offset);
}
private function update(){
offset = youtube.getCurrentTime();
percent = ((offset * 100) / duration);
if (((offset) && ((percent >= 100)))){
_onFinish();
};
}
private function _onFinish(_arg1=null){
if (loops > 0){
if (--loops){
return (youtube.seekTo(0));
};
};
stop();
if (onFinish != null){
onFinish();
};
}
public function get position(){
return ((isReady) ? youtube.getCurrentTime() : 0);
}
public function set position(_arg1:int){
offset = _arg1;
}
public function get duration(){
return ((isReady) ? youtube.getDuration() : 0);
}
public function get durationText(){
return (StringUtil.seconds2Minutes(duration, true));
}
public function get positionText(){
return (StringUtil.seconds2Minutes(position, true));
}
public function get timeText(){
return (((positionText + " / ") + durationText));
}
public function get percentLoaded(){
return ((isReady) ? ((youtube.getVideoBytesLoaded() * 100) / youtube.getVideoBytesTotal()) : 0);
}
public static function getInstance():YouTubeWrapper{
return (((instance) || (new (YouTubeWrapper))));
}
}
Section 36
//Slider (toy.gui.Slider)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Slider {
public var BAR_FRICTION:Number;// = 10
public var target:MovieClip;
public var slider:Button;
public var bar:Button;
public var minus_btn:Button;
public var plus_btn:Button;
public var mask_mc:MovieClip;
public var percent:Number;// = 0
public var isHorizontal:Boolean;
public var mode:String;
public var onUpdate:Function;
public var mouseUp:Function;
public var steps:int;
public var _currentStep:int;
public var bounds:Bounds;
public var allowJump:Boolean;// = false
public var offsetPoint:Point;
public var width:Number;
public var height:Number;
public var isResizableHandler:Boolean;
public function Slider(_arg1:MovieClip, _arg2:Function=null){
bounds = new Bounds();
offsetPoint = new Point();
super();
this.target = _arg1;
this.onUpdate = ((_arg2) || (this.onUpdate));
mask_mc = _arg1.mask_mc;
isHorizontal = (_arg1.width > _arg1.height);
var _local3:* = {mouseUp:_mouseUp};
bar = new Button(_arg1.bar_btn, _mouseDown, _local3);
slider = new Button(_arg1.slider_btn, _mouseDown, _local3);
if (_arg1.minus_btn){
new Button(_arg1.minus_btn, _mouseDown, _local3);
};
if (_arg1.plus_btn){
new Button(_arg1.plus_btn, _mouseDown, _local3);
};
width = bar.target.width;
height = bar.target.height;
resize();
}
public function resize(_arg1=null, _arg2=null){
this.width = ((_arg1) || ((bar.target.width - slider.target.width)));
this.height = ((_arg2) || ((bar.target.height - slider.target.height)));
}
private function _mouseDown(_arg1:Button=null){
mode = _arg1.name;
offsetPoint.x = (offsetPoint.y = 0);
if (mode == "slider"){
offsetPoint.x = ((slider.target.x - target.mouseX) + (slider.target.width * 0.5));
offsetPoint.y = ((slider.target.y - target.mouseY) + (slider.target.height * 0.5));
};
Motor.addClip(this);
update();
render();
}
private function _mouseUp(_arg1:Button){
Motor.remove(this);
if (mouseUp != null){
mouseUp(percent);
};
}
public function show(){
target.visible = true;
}
public function hide(){
target.visible = false;
}
public function update(){
if (mode == "minus"){
percent--;
};
if (mode == "plus"){
percent++;
};
var _local1:* = ((target.mouseX - (slider.target.width * 0.5)) + offsetPoint.x);
var _local2:* = ((target.mouseY - (slider.target.height * 0.5)) + offsetPoint.y);
if (mode == "slider"){
percent = (isHorizontal) ? ((_local1 * 100) / width) : ((_local2 * 100) / height);
};
if (mode == "bar"){
percent = (isHorizontal) ? percent = (percent + ((((_local1 * 100) / width) - percent) / BAR_FRICTION)) : percent = (percent + ((((_local2 * 100) / height) - percent) / BAR_FRICTION));
};
percent = MathUtil.constrain(percent, 0, 100);
if (steps){
_currentStep = Math.round(((percent * (steps - 1)) / 100));
};
if (onUpdate != null){
onUpdate(percent);
};
}
public function render(){
if (isHorizontal){
slider.target.x = ((percent * width) / 100);
} else {
slider.target.y = ((percent * height) / 100);
};
if (mask_mc){
if (isHorizontal){
mask_mc.x = slider.target.x;
} else {
mask_mc.y = slider.target.y;
};
};
}
public function enableDelta(_arg1=null){
Cursor.add("mouseWheel", mouseWheel);
}
public function disableDelta(_arg1=null){
Cursor.remove("mouseWheel", mouseWheel);
}
private function mouseWheel(_arg1=null){
var _local2:* = Cursor.wheel;
setPercent((percent - (_local2 * 2)));
onUpdate(percent);
}
public function plus(_arg1:Number=1){
setPercent((percent + _arg1));
onUpdate(percent);
}
public function minus(_arg1:Number=1){
setPercent((percent - _arg1));
onUpdate(percent);
}
public function disable(){
target.alpha = 0.5;
if (target.blocked){
target.blocked.visible = true;
};
SpriteUtil.allowMouse(target, false);
}
public function enable(){
target.alpha = 1;
if (target.blocked){
target.blocked.visible = false;
};
SpriteUtil.allowMouse(target, true);
}
public function setPercent(_arg1:Number){
percent = MathUtil.constrain(_arg1, 0, 100);
if (steps){
_currentStep = Math.round(((percent * (steps - 1)) / 100));
};
render();
}
public function resizeHandler(_arg1:int){
var _local3:*;
var _local2:* = (isHorizontal) ? target.bar_btn.width : target.bar_btn.height;
if (_arg1 <= _local2){
_local3 = (_local2 - _arg1);
};
if (_arg1 > _local2){
_local3 = (_local2 / (_arg1 / _local2));
};
_local3 = MathUtil.constrain(_local3, (_local2 / 5), _local2);
if (isHorizontal){
target.slider_btn.width = _local3;
} else {
target.slider_btn.height = _local3;
};
resize();
setPercent(percent);
}
}
}//package toy.gui
Section 37
//TimelineClip (toy.gui.TimelineClip)
package toy.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class TimelineClip extends Clip {
public var labels:Object;
public var labelFrame:Object;
public var label:String;
public var timeline:Array;
public var _timeline:Array;
public var frame:Number;
public var lastFrame:uint;// = 0
public var isBackwards:Boolean;
public var loops:int;
public var onReach:Function;
public var frameRate:Number;// = 1
public function TimelineClip(_arg1:MovieClip, _arg2:Boolean=true){
labels = {};
super();
this.target = _arg1;
this.selfControlled = _arg2;
_timeline = SpriteUtil.getTimeline(_arg1);
timeline = _timeline;
labelFrame = _timeline.labelFrame;
labels = _timeline.labels;
lastFrame = (_timeline.length - 1);
frame = 0;
_arg1.gotoAndStop(1);
}
public function gotoLabel(_arg1:String, _arg2:int=-1, _arg3:Function=null){
gotoAndPlay(0, _arg1, _arg2, _arg3);
}
public function gotoAndPlay(_arg1:Number, _arg2:String=null, _arg3:int=-1, _arg4:Function=null){
this.onReach = _arg4;
this.loops = _arg3;
this.frame = _arg1;
this.label = (labels[_arg2]) ? _arg2 : null;
if (((debugMode) && (!(this.label)))){
trace(_arg2, "LABEL NOT FOUND");
};
timeline = (this.label) ? labels[this.label] : _timeline;
lastFrame = (timeline.length - 1);
target.gotoAndStop(timeline[int(_arg1)]);
play();
}
public function gotoAndStop(_arg1:Number, _arg2:String=null){
this.frame = _arg1;
this.label = (labels[_arg2]) ? _arg2 : null;
timeline = (this.label) ? labels[this.label] : _timeline;
lastFrame = (timeline.length - 1);
target.gotoAndStop(timeline[int(_arg1)]);
stop();
}
override public function show(){
target.alpha = 1;
target.visible = true;
}
override public function hide(){
stop();
target.visible = false;
}
override public function stop(){
super.stop();
}
public function random(_arg1:uint=0){
frame = Random.range(((_arg1) || (lastFrame)));
}
override public function update(){
if (!playing){
return;
};
var _local1:* = (isBackwards) ? -(frameRate) : frameRate;
frame = (frame + _local1);
if (((!(isBackwards)) && ((frame >= lastFrame)))){
while ((((frame >= lastFrame)) && (playing))) {
frame = (frame - lastFrame);
loopCount();
};
return;
};
if (((isBackwards) && ((frame <= 0)))){
while ((((frame <= 0)) && (playing))) {
frame = (frame + lastFrame);
loopCount();
};
return;
};
}
override public function render(){
var _local1:* = timeline[int(frame)];
target.gotoAndStop(_local1);
if (target.currentFrame != _local1){
target.gotoAndStop(timeline[int(lastFrame)]);
};
}
private function loopCount(){
if (loops <= -1){
return;
};
if (--loops > 0){
return;
};
frame = (isBackwards) ? 0 : lastFrame;
stop();
if (onReach != null){
onReach();
};
}
}
}//package toy.gui
Section 38
//SWFAddress (toy.system.connect.SWFAddress)
package toy.system.connect {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
import flash.external.*;
public class SWFAddress {
private static var _init:Boolean = false;
private static var _strict:Boolean = true;
private static var _value:String = "";
private static var _availability:Boolean = ExternalInterface.available;
public static var onChange:Function = function (_arg1){
};
private static var _interval:int;
private static var width:String = "100%";
private static var height:String = "100%";
public static function init(){
if (!_availability){
return;
};
ExternalInterface.addCallback("setSWFAddressValue", _onRemoteSetValue);
ExternalInterface.addCallback("getSWFAddressValue", function (){
return (_value);
});
_interval = setInterval(_wait, 10);
}
private static function _wait(){
_onRemoteSetValue(_remoteGetValue());
clearInterval(_interval);
}
private static function _onRemoteSetValue(_arg1:String):void{
if ((((_arg1 == "undefined")) || ((_arg1 == null)))){
_arg1 = "";
};
if ((((_value == _arg1)) && (_init))){
return;
};
_value = _arg1;
_init = true;
onChange(getValue());
}
private static function _remoteGetValue():String{
var _local1:String;
var _local2:String;
if (_availability){
_local1 = (ExternalInterface.call("SWFAddress.getValue") as String);
_local2 = (ExternalInterface.call("SWFAddress.getId") as String);
};
if ((((_local2 == null)) || (!(_availability)))){
_local1 = _value;
} else {
if ((((_local1 == "undefined")) || ((_local1 == null)))){
_local1 = "";
};
};
return (_strictCheck(_local1, false));
}
public static function getValue():String{
if (_init){
return (_strictCheck(_value, false));
};
return (_strictCheck((_availability) ? (ExternalInterface.call("SWFAddress.getValue") as String) : "", false));
}
public static function setValue(_arg1:String){
if ((((_arg1 == "undefined")) || ((_arg1 == null)))){
_arg1 = "";
};
_arg1 = _strictCheck(_arg1, true);
if (_value == _arg1){
return;
};
_value = _arg1;
if (((_availability) && (_init))){
ExternalInterface.call("SWFAddress.setValue", _arg1);
};
}
public static function back():void{
if (_availability){
ExternalInterface.call("SWFAddress.back");
};
}
public static function forward():void{
if (_availability){
ExternalInterface.call("SWFAddress.forward");
};
}
public static function go(_arg1:Number){
if (_availability){
ExternalInterface.call("SWFAddress.go", _arg1);
};
}
public static function getURL(_arg1:String, _arg2:String){
if (_availability){
ExternalInterface.call("SWFAddress.href", _arg1, _arg2);
};
}
public static function popup(_arg1:String, _arg2:String, _arg3:String, _arg4:String){
if (_availability){
ExternalInterface.call("SWFAddress.popup", _arg1, _arg2, _arg3, _arg4);
};
}
public static function getStrict():Boolean{
return ((_availability) ? ExternalInterface.call("SWFAddress.getStrict") : _strict);
}
public static function setStrict(_arg1:Boolean):void{
if (_availability){
ExternalInterface.call("SWFAddress.setStrict", _arg1);
};
_strict = _arg1;
}
public static function getHistory():Boolean{
return ((_availability) ? ExternalInterface.call("SWFAddress.getHistory") : false);
}
public static function setHistory(_arg1:Boolean):void{
if (_availability){
ExternalInterface.call("SWFAddress.setHistory", _arg1);
};
}
public static function getTracker():String{
return ((_availability) ? (ExternalInterface.call("SWFAddress.getTracker") as String) : "");
}
public static function setTracker(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setTracker", _arg1);
};
}
public static function getTitle():String{
var _local1:String = (_availability) ? (ExternalInterface.call("SWFAddress.getTitle") as String) : "";
return (((((_local1 == "undefined")) || ((_local1 == null)))) ? "" : _local1);
}
public static function setTitle(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setTitle", _arg1);
};
}
public static function getStatus():String{
var _local1:String = (_availability) ? (ExternalInterface.call("SWFAddress.getStatus") as String) : "";
return (((((_local1 == "undefined")) || ((_local1 == null)))) ? "" : _local1);
}
public static function setStatus(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setStatus", _arg1);
};
}
public static function resetStatus():void{
if (_availability){
ExternalInterface.call("SWFAddress.resetStatus");
};
}
public static function getNOQueryPath():String{
var _local1:String = getValue();
if (_local1.indexOf("?") != -1){
return (_local1.split("?")[0]);
};
return (_local1);
}
public static function getQueryString():String{
var _local1:String = getValue();
var _local2:Number = _local1.indexOf("?");
if (((!((_local2 == -1))) && ((_local2 < _local1.length)))){
return (_local1.substr((_local2 + 1)));
};
return ("");
}
public static function getParameter(_arg1:String):String{
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local2:String = getValue();
var _local3:Number = _local2.indexOf("?");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 1));
_local4 = _local2.split("&");
_local6 = _local4.length;
while (_local6--) {
_local5 = _local4[_local6].split("=");
if (_local5[0] == _arg1){
return (_local5[1]);
};
};
};
return ("");
}
public static function getParameterNames():Array{
var _local4:Array;
var _local5:Number;
var _local1:String = getValue();
var _local2:Number = _local1.indexOf("?");
var _local3:Array = new Array();
if (_local2 != -1){
_local1 = _local1.substr((_local2 + 1));
if (((!((_local1 == ""))) && (!((_local1.indexOf("=") == -1))))){
_local4 = _local1.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local3.push(_local4[_local5].split("=")[0]);
_local5++;
};
};
};
return (_local3);
}
private static function _strictCheck(_arg1:String, _arg2:Boolean):String{
var _local3:Number;
if (_strict){
if (_arg2){
if (_arg1.substr(0, 1) != "/"){
_arg1 = ("/" + _arg1);
};
_local3 = _arg1.indexOf("?");
if (_local3 != -1){
_arg1 = ((_arg1.substr((_local3 - 1), 1))!="/") ? ((_arg1.substr(0, _local3) + "/") + _arg1.substr(_local3)) : _arg1;
} else {
if (_arg1.substr((_arg1.length - 1)) != "/"){
_arg1 = (_arg1 + "/");
};
};
} else {
if (_arg1 == ""){
_arg1 = "/";
};
};
};
return (_arg1);
}
public static function resize(_arg1="100%", _arg2="100%"){
ExternalInterface.call("swffit.fit", "Document", _arg1, _arg2);
}
}
}//package toy.system.connect
Section 39
//Bounds (toy.system.math.Bounds)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Bounds {
public var radius:uint;
public var depth:uint;
public var width:uint;
public var height:uint;
public var halfWidth:uint;
public var halfHeight:uint;
public var halfDepth:uint;
public var top:int;
public var bottom:int;
public var left:int;
public var right:int;
public var back:int;
public var front:int;
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
public var rotation:Number;// = 0
public var rotationX:Number;// = 0
public var rotationY:Number;// = 0
public var rotationZ:Number;// = 0
public var scale:Number;// = 1
public var centerY:int;
public var centerX:int;
public var hit:Boolean;
public function Bounds(_arg1=0, _arg2=0, _arg3=0, _arg4=0, _arg5=0, _arg6=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
this.back = _arg5;
this.front = _arg6;
width = (_arg4 - _arg3);
height = (_arg2 - _arg1);
}
public function setSize(_arg1:int=0, _arg2:int=0, _arg3:int=0){
this.width = ((_arg1) || (this.width));
this.height = ((_arg2) || (this.height));
this.depth = ((_arg3) || (this.depth));
halfWidth = (this.width / 2);
halfHeight = (this.height / 2);
halfDepth = (this.depth / 2);
}
public function construct(_arg1){
if ((((_arg1 is Rectangle)) || ((_arg1 is DisplayObject)))){
fromRectangle(_arg1);
} else {
ArrayUtil.extract(_arg1, this);
};
}
public function fromRectangle(_arg1){
top = _arg1.y;
bottom = (_arg1.y + _arg1.height);
left = _arg1.x;
right = (_arg1.x + _arg1.width);
width = _arg1.width;
height = _arg1.height;
}
public function reset(){
top = (bottom = (left = (right = (back = (front = (radius = (width = (height = 0))))))));
}
public function constrain(_arg1){
return (((constrainX(_arg1)) || (constrainY(_arg1))));
}
public function constrainY(_arg1){
var _local2:Boolean;
if (_arg1.y < top){
_arg1.y = top;
_local2 = true;
};
if (_arg1.y > bottom){
_arg1.y = bottom;
_local2 = true;
};
return (_local2);
}
public function constrainX(_arg1){
var _local2:Boolean;
if (_arg1.x < left){
_arg1.x = left;
_local2 = true;
};
if (_arg1.x > right){
_arg1.x = right;
_local2 = true;
};
return (_local2);
}
public function setAura(_arg1=null, _arg2=null, _arg3=null, _arg4=null){
this.width = ((_arg3) || (this.width));
this.height = ((_arg4) || (this.height));
halfWidth = (((_arg3) || (this.width)) / 2);
halfHeight = (((_arg4) || (this.height)) / 2);
halfDepth = (this.depth / 2);
left = (_arg1 - halfWidth);
right = (_arg1 + halfWidth);
top = (_arg2 - halfHeight);
bottom = (_arg2 + halfHeight);
}
public function calcAuraFoot(){
left = (x - halfWidth);
right = (x + halfWidth);
top = (y - height);
bottom = y;
centerX = x;
centerY = (y - halfHeight);
}
public function calcAura(){
left = (x - halfWidth);
right = (x + halfWidth);
top = (y - halfHeight);
bottom = (y + halfHeight);
centerX = x;
centerY = y;
}
public function toString(){
return (((((((("BOUNDS Left " + left) + " Right ") + right) + " Top ") + top) + " Bottom ") + bottom));
}
public function cropConstrain(_arg1){
var _local2:* = (_arg1.width / 2);
var _local3:* = (_arg1.height / 2);
var _local4:Boolean;
if ((_arg1.x - _local2) > left){
_arg1.x = (left + _local2);
_local4 = true;
};
if ((_arg1.x + _local2) < right){
_arg1.x = (right - _local2);
_local4 = true;
};
if ((_arg1.y - _local3) > top){
_arg1.y = (top + _local3);
_local4 = true;
};
if ((_arg1.y + _local3) < bottom){
_arg1.y = (bottom - _local3);
_local4 = true;
};
return (_local4);
}
public function cropConstrainTOPLEFT(_arg1){
var _local2:* = (_arg1.area) ? (_arg1.area.width * _arg1.scaleX) : _arg1.width;
var _local3:* = (_arg1.area) ? (_arg1.area.height * _arg1.scaleY) : _arg1.height;
var _local4:Boolean;
if (_arg1.x > left){
_arg1.x = left;
_local4 = true;
};
if ((_arg1.x + _local2) < right){
_arg1.x = (right - _local2);
_local4 = true;
};
if (_arg1.y > top){
_arg1.y = top;
_local4 = true;
};
if ((_arg1.y + _local3) < bottom){
_arg1.y = (bottom - _local3);
_local4 = true;
};
return (_local4);
}
}
}//package toy.system.math
Section 40
//Easing (toy.system.math.Easing)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Easing {
public static function linear(_arg1, _arg2, _arg3, _arg4){
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
return (((_arg1 < 1)) ? ((((_arg3 / 2) * _arg1) * _arg1) + _arg2) : --_arg1;
(((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInCirc(_arg1, _arg2, _arg3, _arg4){
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutCirc(_arg1, _arg2, _arg3, _arg4){
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeInOutCirc(_arg1, _arg2, _arg3, _arg4){
_arg1 = (_arg1 / (_arg4 / 2));
return (((_arg1 < 1)) ? (((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2) : _arg1 = (_arg1 - 2);
(((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInElastic(_arg1, _arg2, _arg3, _arg4, _arg5=null, _arg6=null){
var _local7:*;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if ((((_arg5 < Math.abs(_arg3))) || ((_arg5 == null)))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutElastic(_arg1, _arg2, _arg3, _arg4, _arg5=null, _arg6=null){
var _local7:*;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if ((((_arg5 < Math.abs(_arg3))) || ((_arg5 == null)))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeInOutElastic(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
var _local7:*;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if ((((_arg5 < Math.abs(_arg3))) || ((_arg5 == null)))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInBounce(_arg1, _arg2, _arg3, _arg4){
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutBounce(_arg1, _arg2, _arg3, _arg4){
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutBounce(_arg1, _arg2, _arg3, _arg4){
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package toy.system.math
Section 41
//HitTest (toy.system.math.HitTest)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class HitTest {
public static function mouse(_arg1){
return (_arg1.hitTestPoint(_arg1.stage.mouseX, _arg1.stage.mouseY, true));
}
public static function targetPoints(_arg1:MovieClip, _arg2:MovieClip){
var _local4:*;
var _local5:Point;
if (!_arg1.points){
return (_arg1.hitTestObject(_arg2));
};
var _local3:* = Depth.getChilds(_arg1.points);
for (_local4 in _local3) {
_local5 = Depth.localToLocal(_local3[_local4]);
if (_arg2.hitTestPoint(_local5.x, _local5.y, true)){
return (true);
};
};
return (false);
}
}
}//package toy.system.math
Section 42
//Matrix4 (toy.system.math.Matrix4)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Matrix4 {
public var m00:Number;// = 0
public var m01:Number;// = 0
public var m02:Number;// = 0
public var m03:Number;// = 0
public var m10:Number;// = 0
public var m11:Number;// = 0
public var m12:Number;// = 0
public var m13:Number;// = 0
public var m20:Number;// = 0
public var m21:Number;// = 0
public var m22:Number;// = 0
public var m23:Number;// = 0
public var m30:Number;// = 0
public var m31:Number;// = 0
public var m32:Number;// = 0
public var m33:Number;// = 0
private var tm00:Number;// = 0
private var tm01:Number;// = 0
private var tm02:Number;// = 0
private var tm03:Number;// = 0
private var tm10:Number;// = 0
private var tm11:Number;// = 0
private var tm12:Number;// = 0
private var tm13:Number;// = 0
private var tm20:Number;// = 0
private var tm21:Number;// = 0
private var tm22:Number;// = 0
private var tm23:Number;// = 0
private var tm30:Number;// = 0
private var tm31:Number;// = 0
private var tm32:Number;// = 0
private var tm33:Number;// = 0
private var iRight:Vector3;
private var iUp:Vector3;
private var iDir:Vector3;
private var iPos:Vector3;
public static var Identity:Matrix4 = new (Matrix4);
;
public function Matrix4(_arg1:Boolean=true){
iRight = new Vector3();
iUp = new Vector3();
iDir = new Vector3();
iPos = new Vector3();
super();
if (_arg1){
this.m00 = (this.m11 = (this.m22 = (this.m33 = 1)));
};
}
public function zero(){
this.m00 = (this.m01 = (this.m02 = (this.m03 = (this.m10 = (this.m11 = (this.m12 = (this.m13 = (this.m20 = (this.m21 = (this.m22 = (this.m23 = (this.m30 = (this.m31 = (this.m32 = (this.m33 = 0)))))))))))))));
}
public function identity(){
this.m00 = (this.m11 = (this.m22 = (this.m33 = 1)));
this.m01 = (this.m02 = (this.m03 = (this.m10 = (this.m12 = (this.m13 = (this.m20 = (this.m21 = (this.m23 = (this.m30 = (this.m31 = (this.m32 = 0)))))))))));
}
public function identity3(){
this.m00 = (this.m11 = (this.m22 = (this.m33 = 1)));
this.m01 = (this.m02 = (this.m03 = (this.m10 = (this.m12 = (this.m13 = (this.m20 = (this.m21 = (this.m23 = 0))))))));
}
public function get right():Vector3{
iRight.set(m00, m01, m02);
return (iRight);
}
public function get up():Vector3{
iUp.set(m10, m11, m12);
return (iUp);
}
public function get dir():Vector3{
iDir.set(m20, m21, m22);
return (iDir);
}
public function get pos():Vector3{
iPos.set(m30, m31, m32);
return (iPos);
}
public function set pos(_arg1:Vector3){
m30 = _arg1.x;
m31 = _arg1.y;
m32 = _arg1.z;
}
public function copy3(_arg1:Matrix4){
m00 = _arg1.m00;
m01 = _arg1.m01;
m02 = _arg1.m02;
m10 = _arg1.m10;
m11 = _arg1.m11;
m12 = _arg1.m12;
m20 = _arg1.m20;
m21 = _arg1.m21;
m22 = _arg1.m22;
}
public function copy(_arg1:Matrix4){
m00 = _arg1.m00;
m01 = _arg1.m01;
m02 = _arg1.m02;
m10 = _arg1.m10;
m11 = _arg1.m11;
m12 = _arg1.m12;
m20 = _arg1.m20;
m21 = _arg1.m21;
m22 = _arg1.m22;
m30 = _arg1.m30;
m31 = _arg1.m31;
m32 = _arg1.m32;
}
public function product(_arg1:Matrix4){
tm00 = this.m00;
tm10 = this.m10;
tm20 = this.m20;
tm30 = this.m30;
tm01 = this.m01;
tm11 = this.m11;
tm21 = this.m21;
tm31 = this.m31;
tm02 = this.m02;
tm12 = this.m12;
tm22 = this.m22;
tm32 = this.m32;
tm03 = this.m03;
tm13 = this.m13;
tm23 = this.m23;
this.m00 = ((((tm00 * _arg1.m00) + (tm01 * _arg1.m10)) + (tm02 * _arg1.m20)) + (tm03 * _arg1.m30));
this.m01 = ((((tm00 * _arg1.m01) + (tm01 * _arg1.m11)) + (tm02 * _arg1.m21)) + (tm03 * _arg1.m31));
this.m02 = ((((tm00 * _arg1.m02) + (tm01 * _arg1.m12)) + (tm02 * _arg1.m22)) + (tm03 * _arg1.m32));
this.m03 = ((((tm00 * _arg1.m03) + (tm01 * _arg1.m13)) + (tm02 * _arg1.m23)) + tm03);
this.m10 = ((((tm10 * _arg1.m00) + (tm11 * _arg1.m10)) + (tm12 * _arg1.m20)) + (tm13 * _arg1.m30));
this.m11 = ((((tm10 * _arg1.m01) + (tm11 * _arg1.m11)) + (tm12 * _arg1.m21)) + (tm13 * _arg1.m31));
this.m12 = ((((tm10 * _arg1.m02) + (tm11 * _arg1.m12)) + (tm12 * _arg1.m22)) + (tm13 * _arg1.m32));
this.m13 = ((((tm10 * _arg1.m03) + (tm11 * _arg1.m13)) + (tm12 * _arg1.m23)) + tm13);
this.m20 = ((((tm20 * _arg1.m00) + (tm21 * _arg1.m10)) + (tm22 * _arg1.m20)) + (tm23 * _arg1.m30));
this.m21 = ((((tm20 * _arg1.m01) + (tm21 * _arg1.m11)) + (tm22 * _arg1.m21)) + (tm23 * _arg1.m31));
this.m22 = ((((tm20 * _arg1.m02) + (tm21 * _arg1.m12)) + (tm22 * _arg1.m22)) + (tm23 * _arg1.m32));
this.m23 = ((((tm20 * _arg1.m03) + (tm21 * _arg1.m13)) + (tm22 * _arg1.m23)) + tm23);
this.m30 = ((((tm30 * _arg1.m00) + (tm31 * _arg1.m10)) + (tm32 * _arg1.m20)) + _arg1.m30);
this.m31 = ((((tm30 * _arg1.m01) + (tm31 * _arg1.m11)) + (tm32 * _arg1.m21)) + _arg1.m31);
this.m32 = ((((tm30 * _arg1.m02) + (tm31 * _arg1.m12)) + (tm32 * _arg1.m22)) + _arg1.m32);
}
public function product3(_arg1:Matrix4){
tm00 = m00;
tm01 = m01;
tm02 = m02;
tm10 = m10;
tm11 = m11;
tm12 = m12;
tm20 = m20;
tm21 = m21;
tm22 = m22;
m00 = (((tm00 * _arg1.m00) + (tm01 * _arg1.m10)) + (tm02 * _arg1.m20));
m01 = (((tm00 * _arg1.m01) + (tm01 * _arg1.m11)) + (tm02 * _arg1.m21));
m02 = (((tm00 * _arg1.m02) + (tm01 * _arg1.m12)) + (tm02 * _arg1.m22));
m10 = (((tm10 * _arg1.m00) + (tm11 * _arg1.m10)) + (tm12 * _arg1.m20));
m11 = (((tm10 * _arg1.m01) + (tm11 * _arg1.m11)) + (tm12 * _arg1.m21));
m12 = (((tm10 * _arg1.m02) + (tm11 * _arg1.m12)) + (tm12 * _arg1.m22));
m20 = (((tm20 * _arg1.m00) + (tm21 * _arg1.m10)) + (tm22 * _arg1.m20));
m21 = (((tm20 * _arg1.m01) + (tm21 * _arg1.m11)) + (tm22 * _arg1.m21));
m22 = (((tm20 * _arg1.m02) + (tm21 * _arg1.m12)) + (tm22 * _arg1.m22));
}
public function rotZ(_arg1:Number):Matrix4{
identity();
m00 = Math.cos(_arg1);
m01 = Math.sin(_arg1);
m10 = -(m01);
m11 = m00;
return (this);
}
public function rotX(_arg1:Number):Matrix4{
identity();
m11 = Math.cos(_arg1);
m12 = Math.sin(_arg1);
m21 = -(m12);
m22 = m11;
return (this);
}
public function rotY(_arg1:Number):Matrix4{
identity();
m00 = Math.cos(_arg1);
m20 = Math.sin(_arg1);
m02 = -(m20);
m22 = m00;
return (this);
}
public static function interpolate3(_arg1:Matrix4, _arg2:Matrix4, _arg3:Number){
var _local4:Number;
_arg1.m10 = (_arg1.m10 + ((_arg2.m10 - _arg1.m10) * _arg3));
_arg1.m11 = (_arg1.m11 + ((_arg2.m11 - _arg1.m11) * _arg3));
_arg1.m12 = (_arg1.m12 + ((_arg2.m12 - _arg1.m12) * _arg3));
_local4 = Math.sqrt((((_arg1.m10 * _arg1.m10) + (_arg1.m11 * _arg1.m11)) + (_arg1.m12 * _arg1.m12)));
_arg1.m10 = (_arg1.m10 / _local4);
_arg1.m11 = (_arg1.m11 / _local4);
_arg1.m12 = (_arg1.m12 / _local4);
_arg1.m20 = (_arg1.m20 + ((_arg2.m20 - _arg1.m20) * _arg3));
_arg1.m21 = (_arg1.m21 + ((_arg2.m21 - _arg1.m21) * _arg3));
_arg1.m22 = (_arg1.m22 + ((_arg2.m22 - _arg1.m22) * _arg3));
_local4 = Math.sqrt((((_arg1.m20 * _arg1.m20) + (_arg1.m21 * _arg1.m21)) + (_arg1.m22 * _arg1.m22)));
_arg1.m20 = (_arg1.m20 / _local4);
_arg1.m21 = (_arg1.m21 / _local4);
_arg1.m22 = (_arg1.m22 / _local4);
_arg1.m00 = ((_arg1.m11 * _arg1.m22) - (_arg1.m12 * _arg1.m21));
_arg1.m01 = ((_arg1.m12 * _arg1.m20) - (_arg1.m10 * _arg1.m22));
_arg1.m02 = ((_arg1.m10 * _arg1.m21) - (_arg1.m11 * _arg1.m20));
}
public static function interpolate(_arg1:Matrix4, _arg2:Matrix4, _arg3:Number){
var _local4:Number;
_arg1.m10 = (_arg1.m10 + ((_arg2.m10 - _arg1.m10) * _arg3));
_arg1.m11 = (_arg1.m11 + ((_arg2.m11 - _arg1.m11) * _arg3));
_arg1.m12 = (_arg1.m12 + ((_arg2.m12 - _arg1.m12) * _arg3));
_local4 = Math.sqrt((((_arg1.m10 * _arg1.m10) + (_arg1.m11 * _arg1.m11)) + (_arg1.m12 * _arg1.m12)));
_arg1.m10 = (_arg1.m10 / _local4);
_arg1.m11 = (_arg1.m11 / _local4);
_arg1.m12 = (_arg1.m12 / _local4);
_arg1.m20 = (_arg1.m20 + ((_arg2.m20 - _arg1.m20) * _arg3));
_arg1.m21 = (_arg1.m21 + ((_arg2.m21 - _arg1.m21) * _arg3));
_arg1.m22 = (_arg1.m22 + ((_arg2.m22 - _arg1.m22) * _arg3));
_local4 = Math.sqrt((((_arg1.m20 * _arg1.m20) + (_arg1.m21 * _arg1.m21)) + (_arg1.m22 * _arg1.m22)));
_arg1.m20 = (_arg1.m20 / _local4);
_arg1.m21 = (_arg1.m21 / _local4);
_arg1.m22 = (_arg1.m22 / _local4);
_arg1.m00 = ((_arg1.m11 * _arg1.m22) - (_arg1.m12 * _arg1.m21));
_arg1.m01 = ((_arg1.m12 * _arg1.m20) - (_arg1.m10 * _arg1.m22));
_arg1.m02 = ((_arg1.m10 * _arg1.m21) - (_arg1.m11 * _arg1.m20));
_arg1.m30 = (_arg1.m30 + ((_arg2.m30 - _arg1.m30) * _arg3));
_arg1.m31 = (_arg1.m31 + ((_arg2.m31 - _arg1.m31) * _arg3));
_arg1.m32 = (_arg1.m32 + ((_arg2.m32 - _arg1.m32) * _arg3));
}
public static function product(_arg1:Matrix4, _arg2:Matrix4, _arg3:Matrix4){
_arg3.m00 = ((((_arg1.m00 * _arg2.m00) + (_arg1.m01 * _arg2.m10)) + (_arg1.m02 * _arg2.m20)) + (_arg1.m03 * _arg2.m30));
_arg3.m01 = ((((_arg1.m00 * _arg2.m01) + (_arg1.m01 * _arg2.m11)) + (_arg1.m02 * _arg2.m21)) + (_arg1.m03 * _arg2.m31));
_arg3.m02 = ((((_arg1.m00 * _arg2.m02) + (_arg1.m01 * _arg2.m12)) + (_arg1.m02 * _arg2.m22)) + (_arg1.m03 * _arg2.m32));
_arg3.m03 = ((((_arg1.m00 * _arg2.m03) + (_arg1.m01 * _arg2.m13)) + (_arg1.m02 * _arg2.m23)) + _arg1.m03);
_arg3.m10 = ((((_arg1.m10 * _arg2.m00) + (_arg1.m11 * _arg2.m10)) + (_arg1.m12 * _arg2.m20)) + (_arg1.m13 * _arg2.m30));
_arg3.m11 = ((((_arg1.m10 * _arg2.m01) + (_arg1.m11 * _arg2.m11)) + (_arg1.m12 * _arg2.m21)) + (_arg1.m13 * _arg2.m31));
_arg3.m12 = ((((_arg1.m10 * _arg2.m02) + (_arg1.m11 * _arg2.m12)) + (_arg1.m12 * _arg2.m22)) + (_arg1.m13 * _arg2.m32));
_arg3.m13 = ((((_arg1.m10 * _arg2.m03) + (_arg1.m11 * _arg2.m13)) + (_arg1.m12 * _arg2.m23)) + _arg1.m13);
_arg3.m20 = ((((_arg1.m20 * _arg2.m00) + (_arg1.m21 * _arg2.m10)) + (_arg1.m22 * _arg2.m20)) + (_arg1.m23 * _arg2.m30));
_arg3.m21 = ((((_arg1.m20 * _arg2.m01) + (_arg1.m21 * _arg2.m11)) + (_arg1.m22 * _arg2.m21)) + (_arg1.m23 * _arg2.m31));
_arg3.m22 = ((((_arg1.m20 * _arg2.m02) + (_arg1.m21 * _arg2.m12)) + (_arg1.m22 * _arg2.m22)) + (_arg1.m23 * _arg2.m32));
_arg3.m23 = ((((_arg1.m20 * _arg2.m03) + (_arg1.m21 * _arg2.m13)) + (_arg1.m22 * _arg2.m23)) + _arg1.m23);
_arg3.m30 = ((((_arg1.m30 * _arg2.m00) + (_arg1.m31 * _arg2.m10)) + (_arg1.m32 * _arg2.m20)) + _arg2.m30);
_arg3.m31 = ((((_arg1.m30 * _arg2.m01) + (_arg1.m31 * _arg2.m11)) + (_arg1.m32 * _arg2.m21)) + _arg2.m31);
_arg3.m32 = ((((_arg1.m30 * _arg2.m02) + (_arg1.m31 * _arg2.m12)) + (_arg1.m32 * _arg2.m22)) + _arg2.m32);
}
public static function product3(_arg1:Matrix4, _arg2:Matrix4, _arg3:Matrix4){
_arg3.m00 = (((_arg1.m00 * _arg2.m00) + (_arg1.m01 * _arg2.m10)) + (_arg1.m02 * _arg2.m20));
_arg3.m01 = (((_arg1.m00 * _arg2.m01) + (_arg1.m01 * _arg2.m11)) + (_arg1.m02 * _arg2.m21));
_arg3.m02 = (((_arg1.m00 * _arg2.m02) + (_arg1.m01 * _arg2.m12)) + (_arg1.m02 * _arg2.m22));
_arg3.m10 = (((_arg1.m10 * _arg2.m00) + (_arg1.m11 * _arg2.m10)) + (_arg1.m12 * _arg2.m20));
_arg3.m11 = (((_arg1.m10 * _arg2.m01) + (_arg1.m11 * _arg2.m11)) + (_arg1.m12 * _arg2.m21));
_arg3.m12 = (((_arg1.m10 * _arg2.m02) + (_arg1.m11 * _arg2.m12)) + (_arg1.m12 * _arg2.m22));
_arg3.m20 = (((_arg1.m20 * _arg2.m00) + (_arg1.m21 * _arg2.m10)) + (_arg1.m22 * _arg2.m20));
_arg3.m21 = (((_arg1.m20 * _arg2.m01) + (_arg1.m21 * _arg2.m11)) + (_arg1.m22 * _arg2.m21));
_arg3.m22 = (((_arg1.m20 * _arg2.m02) + (_arg1.m21 * _arg2.m12)) + (_arg1.m22 * _arg2.m22));
}
public static function inverse3(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
var _local3:Number = (((((_arg1.m00 * _arg1.m11) - (_arg1.m10 * _arg1.m01)) * _arg1.m22) - (((_arg1.m00 * _arg1.m21) - (_arg1.m20 * _arg1.m01)) * _arg1.m12)) + (((_arg1.m10 * _arg1.m21) - (_arg1.m20 * _arg1.m11)) * _arg1.m02));
if (Math.abs(_local3) > 0.001){
_local3 = (1 / _local3);
_arg2.m00 = (_local3 * ((_arg1.m11 * _arg1.m22) - (_arg1.m21 * _arg1.m12)));
_arg2.m01 = (-(_local3) * ((_arg1.m01 * _arg1.m22) - (_arg1.m21 * _arg1.m02)));
_arg2.m02 = (_local3 * ((_arg1.m01 * _arg1.m12) - (_arg1.m11 * _arg1.m02)));
_arg2.m10 = (-(_local3) * ((_arg1.m10 * _arg1.m22) - (_arg1.m20 * _arg1.m12)));
_arg2.m11 = (_local3 * ((_arg1.m00 * _arg1.m22) - (_arg1.m20 * _arg1.m02)));
_arg2.m12 = (-(_local3) * ((_arg1.m00 * _arg1.m12) - (_arg1.m10 * _arg1.m02)));
_arg2.m20 = (_local3 * ((_arg1.m10 * _arg1.m21) - (_arg1.m20 * _arg1.m11)));
_arg2.m21 = (-(_local3) * ((_arg1.m00 * _arg1.m21) - (_arg1.m20 * _arg1.m01)));
_arg2.m22 = (_local3 * ((_arg1.m00 * _arg1.m11) - (_arg1.m10 * _arg1.m01)));
};
return (_arg2);
}
public static function inverse(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
var _local3:Number = (((((_arg1.m00 * _arg1.m11) - (_arg1.m10 * _arg1.m01)) * _arg1.m22) - (((_arg1.m00 * _arg1.m21) - (_arg1.m20 * _arg1.m01)) * _arg1.m12)) + (((_arg1.m10 * _arg1.m21) - (_arg1.m20 * _arg1.m11)) * _arg1.m02));
if (Math.abs(_local3) > 0.001){
_local3 = (1 / _local3);
_arg2.m00 = (_local3 * ((_arg1.m11 * _arg1.m22) - (_arg1.m21 * _arg1.m12)));
_arg2.m01 = (-(_local3) * ((_arg1.m01 * _arg1.m22) - (_arg1.m21 * _arg1.m02)));
_arg2.m02 = (_local3 * ((_arg1.m01 * _arg1.m12) - (_arg1.m11 * _arg1.m02)));
_arg2.m10 = (-(_local3) * ((_arg1.m10 * _arg1.m22) - (_arg1.m20 * _arg1.m12)));
_arg2.m11 = (_local3 * ((_arg1.m00 * _arg1.m22) - (_arg1.m20 * _arg1.m02)));
_arg2.m12 = (-(_local3) * ((_arg1.m00 * _arg1.m12) - (_arg1.m10 * _arg1.m02)));
_arg2.m20 = (_local3 * ((_arg1.m10 * _arg1.m21) - (_arg1.m20 * _arg1.m11)));
_arg2.m21 = (-(_local3) * ((_arg1.m00 * _arg1.m21) - (_arg1.m20 * _arg1.m01)));
_arg2.m22 = (_local3 * ((_arg1.m00 * _arg1.m11) - (_arg1.m10 * _arg1.m01)));
_arg2.m30 = (-(_local3) * (((_arg1.m01 * ((_arg1.m12 * _arg1.m32) - (_arg1.m22 * _arg1.m31))) - (_arg1.m11 * ((_arg1.m02 * _arg1.m32) - (_arg1.m22 * _arg1.m30)))) + (_arg1.m21 * ((_arg1.m02 * _arg1.m31) - (_arg1.m12 * _arg1.m30)))));
_arg2.m31 = (_local3 * (((_arg1.m00 * ((_arg1.m12 * _arg1.m32) - (_arg1.m22 * _arg1.m31))) - (_arg1.m10 * ((_arg1.m02 * _arg1.m32) - (_arg1.m22 * _arg1.m30)))) + (_arg1.m20 * ((_arg1.m02 * _arg1.m31) - (_arg1.m12 * _arg1.m30)))));
_arg2.m32 = (-(_local3) * (((_arg1.m00 * ((_arg1.m11 * _arg1.m32) - (_arg1.m21 * _arg1.m31))) - (_arg1.m10 * ((_arg1.m01 * _arg1.m32) - (_arg1.m21 * _arg1.m30)))) + (_arg1.m20 * ((_arg1.m01 * _arg1.m31) - (_arg1.m11 * _arg1.m30)))));
};
return (_arg2);
}
public static function translate(_arg1:Number, _arg2:Number, _arg3:Number):Matrix4{
var _local4:Matrix4 = new Matrix4(true);
_local4.m30 = _arg1;
_local4.m31 = _arg2;
_local4.m32 = _arg3;
return (_local4);
}
public static function scale(_arg1:Number, _arg2:Number, _arg3:Number):Matrix4{
var _local4:Matrix4 = new Matrix4(true);
_local4.m00 = _arg1;
_local4.m11 = _arg2;
_local4.m22 = _arg3;
return (_local4);
}
public static function rotateZ(_arg1:Number):Matrix4{
var _local2:Matrix4 = new Matrix4(true);
_local2.m00 = Math.cos(_arg1);
_local2.m01 = Math.sin(_arg1);
_local2.m10 = -(_local2.m01);
_local2.m11 = _local2.m00;
return (_local2);
}
public static function rotateX(_arg1:Number):Matrix4{
var _local2:Matrix4 = new Matrix4(true);
_local2.m11 = Math.cos(_arg1);
_local2.m12 = Math.sin(_arg1);
_local2.m21 = -(_local2.m12);
_local2.m22 = _local2.m11;
return (_local2);
}
public static function rotateY(_arg1:Number):Matrix4{
var _local2:Matrix4 = new Matrix4(true);
_local2.m00 = Math.cos(_arg1);
_local2.m20 = Math.sin(_arg1);
_local2.m02 = -(_local2.m20);
_local2.m22 = _local2.m00;
return (_local2);
}
public static function transformVector(_arg1:Matrix4, _arg2:Vector3){
var _local3:Number = _arg2.x;
var _local4:Number = _arg2.y;
var _local5:Number = _arg2.z;
_arg2.x = ((((_local3 * _arg1.m00) + (_local4 * _arg1.m10)) + (_local5 * _arg1.m20)) + _arg1.m30);
_arg2.y = ((((_local3 * _arg1.m01) + (_local4 * _arg1.m11)) + (_local5 * _arg1.m21)) + _arg1.m31);
_arg2.z = ((((_local3 * _arg1.m02) + (_local4 * _arg1.m12)) + (_local5 * _arg1.m22)) + _arg1.m32);
}
public static function transformPoint(_arg1:Matrix4, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Vector3){
_arg5.x = ((((_arg2 * _arg1.m00) + (_arg3 * _arg1.m10)) + (_arg4 * _arg1.m20)) + _arg1.m30);
_arg5.y = ((((_arg2 * _arg1.m01) + (_arg3 * _arg1.m11)) + (_arg4 * _arg1.m21)) + _arg1.m31);
_arg5.z = ((((_arg2 * _arg1.m02) + (_arg3 * _arg1.m12)) + (_arg4 * _arg1.m22)) + _arg1.m32);
}
public static function getEulerAngles(_arg1:Matrix4, _arg2:Vector3):Vector3{
if (_arg1.m10 > 0.998){
_arg2.x = Math.atan2(_arg1.m02, _arg1.m22);
_arg2.y = (Math.PI / 2);
_arg2.z = 0;
return (_arg2);
};
if (_arg1.m10 < -0.998){
_arg2.x = Math.atan2(_arg1.m02, _arg1.m22);
_arg2.y = (-(Math.PI) / 2);
_arg2.z = 0;
return (_arg2);
};
_arg2.x = Math.atan2(-(_arg1.m20), _arg1.m00);
_arg2.z = Math.atan2(-(_arg1.m12), _arg1.m11);
_arg2.y = Math.asin(_arg1.m10);
return (_arg2);
}
}
}//package toy.system.math
Section 43
//SinCounter (toy.system.math.SinCounter)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class SinCounter extends Vector3 {
public var counter:Vector3;
public var incremental:Vector3;
public var multiplier:Vector3;
public var maxIncremental:Number;// = 0
public var maxMultiplier:Number;// = 100
public function SinCounter(_arg1:Number=0.1, _arg2:Number=50){
counter = new Vector3(Random.range(100), Random.range(100), Random.range(100));
incremental = new Vector3();
multiplier = new Vector3();
super();
this.maxIncremental = _arg1;
this.maxMultiplier = _arg2;
reset();
}
override public function reset(){
randomIncremental(maxIncremental);
randomMultiplier(maxMultiplier);
}
public function randomIncremental(_arg1:Number=0.5, _arg2:Number=0.01){
incremental.x = Random.range(_arg1, _arg2);
incremental.y = Random.range(_arg1, _arg2);
incremental.z = Random.range(_arg1, _arg2);
}
public function randomMultiplier(_arg1:Number=100, _arg2:Number=1){
multiplier.x = Random.range(_arg1, _arg2);
multiplier.y = Random.range(_arg1, _arg2);
multiplier.z = Random.range(_arg1, _arg2);
}
public function increment(){
counter.add(incremental);
this.sin(counter);
this.multiply(multiplier);
}
}
}//package toy.system.math
Section 44
//Vector2 (toy.system.math.Vector2)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Vector2 {
public var x:Number;
public var y:Number;
private var toVec3:Vector3;
public static const Zero:Vector2 = new Vector2(0, 0);
;
public static const Up:Vector2 = new Vector2(0, 1);
;
public static const Down:Vector2 = new Vector2(0, -1);
;
public static const Right:Vector2 = new Vector2(1, 0);
;
public static const Left:Vector2 = new Vector2(-1, 0);
;
private static var tx:Number;
private static var ty:Number;
public function Vector2(_arg1:Number=0, _arg2:Number=0){
toVec3 = new Vector3();
super();
this.x = _arg1;
this.y = _arg2;
}
public function random(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
x = MathUtil.random(_arg1, _arg2);
y = MathUtil.random(_arg3, _arg4);
}
public function set(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function zero(){
this.x = 0;
this.y = 0;
}
public function sub(_arg1:Vector2){
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function add(_arg1:Vector2){
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function multiply(_arg1:Vector2){
x = (x * _arg1.x);
y = (y * _arg1.y);
}
public function dot(_arg1:Vector2):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function scalar(_arg1:Number){
x = (x * _arg1);
y = (y * _arg1);
}
public function divide(_arg1:Number){
x = (x / _arg1);
y = (y / _arg1);
}
public function negate(){
this.x = -(this.x);
this.y = -(this.y);
}
public function abs(){
this.x = Math.abs(x);
this.y = Math.abs(y);
}
public function length():Number{
if ((((x == 0)) && ((y == 0)))){
return (0);
};
return (Math.sqrt(((x * x) + (y * y))));
}
public function length2():Number{
return (((x * x) + (y * y)));
}
public function normalize(){
var _local1:Number = Math.sqrt(((x * x) + (y * y)));
if (_local1 > 0){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
} else {
this.x = 0;
this.y = 0;
};
}
public function clone():Vector2{
return (new Vector2(x, y));
}
public function fmax(_arg1:Vector2){
if (_arg1.x > x){
x = _arg1.x;
};
if (_arg1.y > y){
y = _arg1.y;
};
}
public function fmin(_arg1:Vector2){
if (_arg1.x < x){
x = _arg1.x;
};
if (_arg1.y < y){
y = _arg1.y;
};
}
public function equal(_arg1:Vector2):Boolean{
if ((((x == _arg1.x)) && ((y == _arg1.y)))){
return (true);
};
return (false);
}
public function copy(_arg1:Vector2){
x = _arg1.x;
y = _arg1.y;
}
public function toVector3():Vector3{
toVec3.set(x, y, 0);
return (toVec3);
}
public function transform(_arg1:Matrix4){
tx = this.x;
ty = this.y;
this.x = (((tx * _arg1.m00) + (ty * _arg1.m10)) + _arg1.m30);
this.y = (((tx * _arg1.m01) + (ty * _arg1.m11)) + _arg1.m31);
}
public function transform3(_arg1:Matrix4){
tx = this.x;
ty = this.y;
this.x = ((tx * _arg1.m00) + (ty * _arg1.m10));
this.y = ((tx * _arg1.m01) + (ty * _arg1.m11));
}
public function toString():String{
return (((("Vector2 x:" + x) + ", y:") + y));
}
public static function random():Vector2{
var _local1:Vector2 = new Vector2(Math.random(), Math.random());
_local1.normalize();
return (_local1);
}
public static function sub(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Vector2{
_arg3.x = (_arg1.x - _arg2.x);
_arg3.y = (_arg1.y - _arg2.y);
return (_arg3);
}
public static function add(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Vector2{
_arg3.x = (_arg1.x + _arg2.x);
_arg3.y = (_arg1.y + _arg2.y);
return (_arg3);
}
public static function adds(_arg1:Vector2, ... _args):Vector2{
var _local3:Vector2;
for each (_local3 in _args) {
_arg1.x = (_arg1.x + _local3.x);
_arg1.y = (_arg1.y + _local3.y);
};
return (_arg1);
}
public static function scale(_arg1:Vector2, _arg2:Number, _arg3:Vector2):Vector2{
_arg3.x = (_arg1.x * _arg2);
_arg3.y = (_arg1.y * _arg2);
return (_arg3);
}
public static function divide(_arg1:Vector2, _arg2:Number, _arg3:Vector2):Vector2{
_arg3.x = (_arg1.x / _arg2);
_arg3.y = (_arg1.y / _arg2);
return (_arg3);
}
public static function multiply(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Vector2{
_arg3.x = (_arg1.x * _arg2.x);
_arg3.y = (_arg1.y * _arg2.y);
return (_arg3);
}
public static function cross(_arg1:Vector2, _arg2:Vector2):Vector2{
_arg2.x = _arg1.y;
_arg2.y = -(_arg1.x);
return (_arg2);
}
public static function dot(_arg1:Vector2, _arg2:Vector2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function abs(_arg1:Vector2, _arg2:Vector2):Vector2{
_arg2.x = Math.abs(_arg1.x);
_arg2.y = Math.abs(_arg1.y);
return (_arg2);
}
public static function negate(_arg1:Vector2, _arg2:Vector2):Vector2{
_arg2.x = -(_arg1.x);
_arg2.y = -(_arg1.y);
return (_arg2);
}
public static function mirror(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Vector2{
var _local4:Number = Vector2.dot(_arg1, _arg2);
_arg3.x = (_arg1.x - ((2 * _arg2.x) * _local4));
_arg3.y = (_arg1.y - ((2 * _arg2.y) * _local4));
_arg3.normalize();
return (_arg3);
}
public static function distance(_arg1:Vector2, _arg2:Vector2):Number{
tx = (_arg1.x - _arg2.x);
ty = (_arg1.y - _arg2.y);
return (Math.sqrt(((tx * tx) + (ty * ty))));
}
public static function distance2(_arg1:Vector2, _arg2:Vector2):Number{
tx = (_arg1.x - _arg2.x);
ty = (_arg1.y - _arg2.y);
return (((tx * tx) + (ty * ty)));
}
public static function pow(_arg1:Vector2, _arg2:int){
_arg1.x = Math.pow(_arg1.x, _arg2);
_arg1.y = Math.pow(_arg1.y, _arg2);
}
}
}//package toy.system.math
Section 45
//Vector3 (toy.system.math.Vector3)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Vector3 {
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
public static const Zero:Vector3 = new Vector3(0, 0, 0);
;
public static const Up:Vector3 = new Vector3(0, 1, 0);
;
public static const Down:Vector3 = new Vector3(0, -1, 0);
;
public static const Right:Vector3 = new Vector3(1, 0, 0);
;
public static const Left:Vector3 = new Vector3(-1, 0, 0);
;
public static const Forward:Vector3 = new Vector3(0, 0, 1);
;
public static const Backward:Vector3 = new Vector3(0, 0, -1);
;
private static var tx:Number;
private static var ty:Number;
private static var tz:Number;
public function Vector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function reset(){
x = (y = (z = 0));
}
public function random(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0){
x = Random.range(_arg1, _arg2);
y = Random.range(_arg3, _arg4);
z = Random.range(_arg5, _arg6);
}
public function round(){
x = Math.round(x);
y = Math.round(y);
z = Math.round(z);
}
public function set(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function zero(){
this.x = 0;
this.y = 0;
this.z = 0;
}
public function sub(_arg1:Vector3){
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function add(_arg1:Vector3){
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function spectrum(_arg1:Vector3){
x = Random.spectrum(_arg1.x);
y = Random.spectrum(_arg1.y);
z = Random.spectrum(_arg1.z);
}
public function addSpectrum(_arg1:Vector3){
x = (x + Random.spectrum(_arg1.x));
y = (y + Random.spectrum(_arg1.y));
z = (z + Random.spectrum(_arg1.z));
}
public function spectrumVal(_arg1:Number){
x = Random.spectrum(_arg1);
y = Random.spectrum(_arg1);
z = Random.spectrum(_arg1);
}
public function randomVal(_arg1:Number, _arg2=null){
x = Random.range(_arg1, _arg2);
y = Random.range(_arg1, _arg2);
z = Random.range(_arg1, _arg2);
}
public function sin(_arg1:Vector3){
x = Math.sin(_arg1.x);
y = Math.sin(_arg1.y);
z = Math.sin(_arg1.z);
}
public function multiply(_arg1:Vector3){
x = (x * _arg1.x);
y = (y * _arg1.y);
z = (z * _arg1.z);
}
public function dot(_arg1:Vector3):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function scalar(_arg1:Number){
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function divide(_arg1:Number){
x = (x / _arg1);
y = (y / _arg1);
z = (z / _arg1);
}
public function negate(){
this.x = -(this.x);
this.y = -(this.y);
this.z = -(this.z);
}
public function abs(){
this.x = Math.abs(x);
this.y = Math.abs(y);
this.z = Math.abs(z);
}
public function length():Number{
if ((((((x == 0)) && ((y == 0)))) && ((z == 0)))){
return (0);
};
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function length2():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function normalize(){
var _local1:Number = Math.sqrt((((x * x) + (y * y)) + (z * z)));
if (_local1 > 0){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
this.z = (this.z / _local1);
} else {
this.x = 0;
this.y = 0;
this.z = 0;
};
}
public function clone():Vector3{
return (new Vector3(x, y, z));
}
public function fmax(_arg1:Vector3){
if (_arg1.x > x){
x = _arg1.x;
};
if (_arg1.y > y){
y = _arg1.y;
};
if (_arg1.z > z){
z = _arg1.z;
};
}
public function fmin(_arg1:Vector3){
if (_arg1.x < x){
x = _arg1.x;
};
if (_arg1.y < y){
y = _arg1.y;
};
if (_arg1.z < z){
z = _arg1.z;
};
}
public function equal(_arg1:Vector3):Boolean{
if ((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z)))){
return (true);
};
return (false);
}
public function copy(_arg1){
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function transform(_arg1:Matrix4){
tx = this.x;
ty = this.y;
tz = this.z;
this.x = ((((tx * _arg1.m00) + (ty * _arg1.m10)) + (tz * _arg1.m20)) + _arg1.m30);
this.y = ((((tx * _arg1.m01) + (ty * _arg1.m11)) + (tz * _arg1.m21)) + _arg1.m31);
this.z = ((((tx * _arg1.m02) + (ty * _arg1.m12)) + (tz * _arg1.m22)) + _arg1.m32);
}
public function transform3(_arg1:Matrix4){
tx = this.x;
ty = this.y;
tz = this.z;
this.x = (((tx * _arg1.m00) + (ty * _arg1.m10)) + (tz * _arg1.m20));
this.y = (((tx * _arg1.m01) + (ty * _arg1.m11)) + (tz * _arg1.m21));
this.z = (((tx * _arg1.m02) + (ty * _arg1.m12)) + (tz * _arg1.m22));
}
public function position(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Matrix4=null){
if (!_arg4){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
} else {
this.x = ((((_arg1 * _arg4.m00) + (_arg2 * _arg4.m10)) + (_arg3 * _arg4.m20)) + _arg4.m30);
this.y = ((((_arg1 * _arg4.m01) + (_arg2 * _arg4.m11)) + (_arg3 * _arg4.m21)) + _arg4.m31);
this.z = ((((_arg1 * _arg4.m02) + (_arg2 * _arg4.m12)) + (_arg3 * _arg4.m22)) + _arg4.m32);
};
}
public function toVertex():Vertex{
return (new Vertex(x, y, z));
}
public function toVector2():Vector2{
return (new Vector2(x, y));
}
public function toString():String{
return (((((("Vector3 x:" + x) + ", y:") + y) + ", z:") + z));
}
public function randomize(_arg1:Number){
x = Random.spectrum(_arg1);
y = Random.spectrum(_arg1);
z = Random.spectrum(_arg1);
}
public static function random(_arg1:Vector3):Vector3{
_arg1.x = (Math.random() - 0.5);
_arg1.y = (Math.random() - 0.5);
_arg1.z = (Math.random() - 0.5);
_arg1.normalize();
return (_arg1);
}
public static function sub(_arg1:Vector3, _arg2:Vector3, _arg3:Vector3):Vector3{
_arg3.x = (_arg1.x - _arg2.x);
_arg3.y = (_arg1.y - _arg2.y);
_arg3.z = (_arg1.z - _arg2.z);
return (_arg3);
}
public static function add(_arg1:Vector3, _arg2:Vector3, _arg3:Vector3):Vector3{
_arg3.x = (_arg1.x + _arg2.x);
_arg3.y = (_arg1.y + _arg2.y);
_arg3.z = (_arg1.z + _arg2.z);
return (_arg3);
}
public static function adds(_arg1:Vector3, ... _args):Vector3{
var _local3:Vector3;
for each (_local3 in _args) {
_arg1.x = (_arg1.x + _local3.x);
_arg1.y = (_arg1.y + _local3.y);
_arg1.z = (_arg1.z + _local3.z);
};
return (_arg1);
}
public static function scale(_arg1:Vector3, _arg2:Number, _arg3:Vector3):Vector3{
_arg3.x = (_arg1.x * _arg2);
_arg3.y = (_arg1.y * _arg2);
_arg3.z = (_arg1.z * _arg2);
return (_arg3);
}
public static function divide(_arg1:Vector3, _arg2:Number, _arg3:Vector3):Vector3{
_arg3.x = (_arg1.x / _arg2);
_arg3.y = (_arg1.y / _arg2);
_arg3.z = (_arg1.z / _arg2);
return (_arg3);
}
public static function multiply(_arg1:Vector3, _arg2:Vector3, _arg3:Vector3):Vector3{
_arg3.x = (_arg1.x * _arg2.x);
_arg3.y = (_arg1.y * _arg2.y);
_arg3.z = (_arg1.z * _arg2.z);
return (_arg3);
}
public static function cross(_arg1:Vector3, _arg2:Vector3, _arg3:Vector3):Vector3{
_arg3.x = ((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y));
_arg3.y = ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z));
_arg3.z = ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x));
return (_arg3);
}
public static function dot(_arg1:Vector3, _arg2:Vector3):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)));
}
public static function abs(_arg1:Vector3, _arg2:Vector3):Vector3{
_arg2.x = Math.abs(_arg1.x);
_arg2.y = Math.abs(_arg1.y);
_arg2.z = Math.abs(_arg1.z);
return (_arg2);
}
public static function negate(_arg1:Vector3, _arg2:Vector3):Vector3{
_arg2.x = -(_arg1.x);
_arg2.y = -(_arg1.y);
_arg2.z = -(_arg1.z);
return (_arg2);
}
public static function mirror(_arg1:Vector3, _arg2:Vector3, _arg3:Vector3):Vector3{
var _local4:Number = Vector3.dot(_arg1, _arg2);
_arg3.x = (_arg1.x - ((2 * _arg2.x) * _local4));
_arg3.y = (_arg1.y - ((2 * _arg2.y) * _local4));
_arg3.z = (_arg1.z - ((2 * _arg2.z) * _local4));
_arg3.normalize();
return (_arg3);
}
public static function distance(_arg1:Vector3, _arg2:Vector3):Number{
tx = (_arg1.x - _arg2.x);
ty = (_arg1.y - _arg2.y);
tz = (_arg1.z - _arg2.z);
return (Math.sqrt((((tx * tx) + (ty * ty)) + (tz * tz))));
}
public static function distance2(_arg1:Vector3, _arg2:Vector3):Number{
tx = (_arg1.x - _arg2.x);
ty = (_arg1.y - _arg2.y);
tz = (_arg1.z - _arg2.z);
return ((((tx * tx) + (ty * ty)) + (tz * tz)));
}
public static function distanceX(_arg1:Vector3, _arg2:Vector3):Number{
return ((_arg1.x - _arg2.x));
}
public static function distanceY(_arg1:Vector3, _arg2:Vector3):Number{
return ((_arg1.y - _arg2.y));
}
public static function distanceZ(_arg1:Vector3, _arg2:Vector3):Number{
return ((_arg1.z - _arg2.z));
}
public static function pow(_arg1:Vector3, _arg2:int){
_arg1.x = Math.pow(_arg1.x, _arg2);
_arg1.y = Math.pow(_arg1.y, _arg2);
_arg1.z = Math.pow(_arg1.z, _arg2);
}
public static function min(_arg1:Vector3, ... _args){
var _local3:Vector3;
_arg1.x = Number.MAX_VALUE;
_arg1.y = Number.MAX_VALUE;
_arg1.z = Number.MAX_VALUE;
for each (_local3 in _args) {
if (_local3.x < _arg1.x){
_arg1.x = _local3.x;
};
if (_local3.y < _arg1.y){
_arg1.y = _local3.y;
};
if (_local3.z < _arg1.z){
_arg1.z = _local3.z;
};
};
}
public static function max(_arg1:Vector3, ... _args){
var _local3:Vector3;
_arg1.x = Number.MIN_VALUE;
_arg1.y = Number.MIN_VALUE;
_arg1.z = Number.MIN_VALUE;
for each (_local3 in _args) {
if (_local3.x > _arg1.x){
_arg1.x = _local3.x;
};
if (_local3.y > _arg1.y){
_arg1.y = _local3.y;
};
if (_local3.z > _arg1.z){
_arg1.z = _local3.z;
};
};
}
public static function smooth(_arg1:Vector3, _arg2:Vector3, _arg3:Number){
_arg1.x = (_arg1.x + ((_arg2.x - _arg1.x) * _arg3));
_arg1.y = (_arg1.y + ((_arg2.y - _arg1.y) * _arg3));
_arg1.z = (_arg1.z + ((_arg2.z - _arg1.z) * _arg3));
}
public static function equal(_arg1:Vector3, _arg2:Vector3):Boolean{
if ((((((_arg1.x == _arg2.x)) && ((_arg1.y == _arg2.y)))) && ((_arg1.z == _arg2.z)))){
return (true);
};
return (false);
}
}
}//package toy.system.math
Section 46
//Vertex (toy.system.math.Vertex)
package toy.system.math {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Vertex extends Vector3 {
public var nx:Number;// = 0
public var ny:Number;// = 0
public var nz:Number;// = 0
public var normal:Vector3;
public var px:Number;
public var py:Number;
public var pz:Number;
public var pu:Number;
public var pv:Number;
public var pw:Number;
public var trans:Vector3;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.normal = new Vector3();
this.trans = new Vector3();
}
override public function clone():Vector3{
var _local1:Vertex = new Vertex(x, y, z);
_local1.normal = this.normal.clone();
_local1.nx = this.nx;
_local1.ny = this.ny;
_local1.nz = this.nz;
_local1.px = this.px;
_local1.py = this.py;
_local1.pz = this.pz;
_local1.pu = this.pu;
_local1.pv = this.pv;
_local1.pw = this.pw;
return (_local1);
}
}
}//package toy.system.math
Section 47
//PNGEncoder (toy.system.util.encoder.PNGEncoder)
package toy.system.util.encoder {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
}
}//package toy.system.util.encoder
Section 48
//XMLCodec (toy.system.util.encoder.XMLCodec)
package toy.system.util.encoder {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class XMLCodec {
public static var validNodes:String;
public static var xml:String;
public static var validChars:String = "ABCDEFGHIJKLMÑNOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz0123456789_!;";
public static function enc(_arg1:Object){
return (toXML(_arg1));
}
public static function dec(_arg1:String){
return (toObject(_arg1));
}
public static function toObject(_arg1){
var _local2:XMLDocument = new XMLDocument();
_local2.ignoreWhite = true;
_local2.parseXML(_arg1);
return (parseNode(_local2.firstChild, []));
}
private static function parseNode(_arg1, _arg2):Object{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
for (_local3 in _arg1.attributes) {
_arg2[_local3] = Utils.getValueFromString(_arg1.attributes[_local3]);
};
if (((_arg1.firstChild) && ((_arg1.firstChild.nodeType == 3)))){
_local4 = Utils.getValueFromString(_arg1.firstChild.nodeValue);
if (ArrayUtil.length(_arg1.attributes)){
_arg2.value = _local4;
} else {
_arg2 = _local4;
};
} else {
_local5 = {item:true};
_local6 = {};
_local7 = _arg1.childNodes;
_local10 = 0;
while (_local10 < _local7.length) {
_local8 = _local7[_local10].nodeName;
if (_local6[_local8]){
_local5[_local8] = true;
};
_local6[_local8] = true;
_local10++;
};
_local10 = 0;
while (_local10 < _local7.length) {
_local8 = _local7[_local10].nodeName;
_local9 = parseNode(_local7[_local10], []);
if (_local5[_local8]){
_arg2.push(_local9);
} else {
_arg2[_local8] = _local9;
};
_local10++;
};
};
return (_arg2);
}
public static function toXML(_arg1:Object, _arg2:String=null){
validNodes = "";
xml = "";
return ((("<data>\n" + objtoXML(_arg1, _arg2)) + "\n</data>"));
}
private static function objtoXML(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:int;
for (_local3 in _arg1) {
_local4 = _arg1[_local3];
if (((!((typeof(_local4) == "function"))) && (!(((!((_arg2 == null))) && ((_arg2.indexOf(_local3) == -1))))))){
_local5 = ((_local3 is int)) ? "item" : _local3;
if (_local5 == "item"){
xml = (xml + (("\n\n<" + _local5) + ">"));
} else {
xml = (xml + (("\n<" + _local5) + ">"));
};
if (typeof(_local4) == "object"){
objtoXML(_local4, _arg2);
} else {
_local6 = !((_local4 is Number));
if (_local6){
_local6 = (validNodes.indexOf(_local4) == -1);
_local7 = 0;
while (((_local6) && ((_local7 <= _local4.length)))) {
_local6 = (validChars.indexOf(_local4.charAt(_local7)) == -1);
_local7++;
};
xml = (xml + (("<![CDATA[" + _local4) + "]]>"));
} else {
validNodes = (validNodes + _local4);
xml = (xml + _local4);
};
};
if (_local5 == "item"){
xml = (xml + (("\n</" + _local5) + ">"));
} else {
xml = (xml + (("</" + _local5) + ">"));
};
};
};
return (xml);
}
}
}//package toy.system.util.encoder
Section 49
//Align (toy.system.util.Align)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Align {
private static var margin_targets:Dictionary = new Dictionary();
public static function getMarginsRecursive(_arg1, _arg2, _arg3){
var _local5:*;
var _local6:*;
var _local4:Array = Depth.getMovieClips(_arg1, null, "area,_btn,thumbnail");
for (_local5 in _local4) {
_local6 = _local4[_local5];
if (StringUtil.containsKeys(_local6.name, _arg3)){
getMargins(_local6, _arg2);
};
getMarginsRecursive(_local6, _arg2, _arg3);
};
}
public static function getMargins(_arg1, _arg2:String="y"){
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
if (margin_targets[_arg1]){
return;
};
var _local3:Array = Depth.getMovieClips(_arg1, null, "area");
_local3.sortOn(_arg2, Array.NUMERIC);
var _local4:MarginData = new MarginData(_arg2, _local3[0][_arg2]);
var _local5:String = ((_arg2 == "x")) ? "width" : "height";
for (_local6 in _local3) {
_local7 = _local3[_local6];
_local8 = _local3[(_local6 - 1)];
_local9 = (_local8) ? ((_local7[_arg2] - _local8[_arg2]) - _local8[_local5]) : _local7[_arg2];
_local4.push(_local7, _local9);
};
margin_targets[_arg1] = _local4;
}
public static function setMargins(_arg1){
var _local9:*;
var _local10:*;
var _local11:MovieClip;
var _local14:MovieClip;
var _local15:Number;
var _local16:MovieClip;
var _local17:Number;
var _local2:* = Depth.getMovieClips(_arg1);
for (_local10 in _local2) {
setMargins(_local2[_local10]);
};
if (!margin_targets[_arg1]){
return;
};
var _local3:MarginData = margin_targets[_arg1];
var _local4:Number = _local3.areaMargin;
var _local5:Array = _local3.childs;
var _local6:Array = _local3.margins;
var _local7:String = _local3.align;
var _local8:String = ((_local7 == "x")) ? "width" : "height";
var _local12:Array = [];
var _local13:Array = [];
for (_local10 in _local5) {
_local14 = _local5[_local10];
if (!_local14.visible){
} else {
_local12.push(_local14);
_local13.push(_local6[_local10]);
};
};
_local13[0] = _local6[0];
for (_local10 in _local12) {
_local14 = _local12[_local10];
_local16 = _local12[(_local10 - 1)];
_local15 = _local13[_local10];
_local17 = (_local16) ? ((_local15 + _local16[_local8]) + _local16[_local7]) : _local15;
_local14[_local7] = _local17;
};
if (_arg1.area){
_arg1.area[_local8] = ((_local14[_local7] + _local14[_local8]) + _local4);
};
}
public static function flip(_arg1, _arg2){
var _local3:Number = MathUtil.positive(_arg1.scaleX);
_arg1.scaleX = ((_arg2 > 0)) ? _local3 : -(_local3);
}
public static function localToLocal(_arg1, _arg2){
return (_arg2.globalToLocal(_arg1.localToGlobal(new Point())));
}
public static function selfCenter(_arg1, _arg2:DisplayObjectContainer=null){
var _local3:Number = _arg1.width;
var _local4:Number = _arg1.height;
if ((((_arg1 is MovieClip)) && (_arg1.area))){
_local3 = (_arg1.area.width * _arg1.scaleX);
_local4 = (_arg1.area.height * _arg1.scaleY);
};
_arg1.x = (-(_local3) / 2);
_arg1.y = (-(_local4) / 2);
if (_arg2){
_arg2.addChild(_arg1);
};
}
public static function selfCenterFoot(_arg1, _arg2:DisplayObjectContainer=null){
var _local3:* = (_arg1.area) ? (_arg1.area.width * _arg1.scaleX) : _arg1.width;
var _local4:* = (_arg1.area) ? (_arg1.area.height * _arg1.scaleY) : _arg1.height;
_arg1.x = (-(_local3) / 2);
_arg1.y = -(_local4);
if (_arg2){
_arg2.addChild(_arg1);
};
}
public static function fit(_arg1, _arg2=null, _arg3=false){
var _local6:*;
var _local4:* = ((_arg2) || (_arg1.parent.area));
var _local5:* = _arg1;
if ((_arg1 is Video)){
if (_arg1.videoWidth){
_arg1.width = _arg1.videoWidth;
_arg1.height = _arg1.videoHeight;
};
} else {
_arg1.scaleX = (_arg1.scaleY = 1);
};
var _local7:* = _arg1.width;
var _local8:* = _arg1.height;
if ((((_arg1 is MovieClip)) && (_arg1.area))){
_local7 = _arg1.area.width;
_local8 = _arg1.area.height;
};
_local6 = (_local4.width / _local7);
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
_local8 = (_local8 * _local6);
_local6 = (_local4.height / _local8);
if (((((_arg3) && ((_local8 < _local4.height)))) || (((!(_arg3)) && ((_local8 > _local4.height)))))){
_local5.width = (_local5.width * _local6);
_local5.height = (_local5.height * _local6);
};
center(_arg1, _local4);
}
public static function constrainOverflow(_arg1, _arg2, _arg3:int=0){
var _local4:* = (((_arg2.x + _arg2.width) - _arg3) - _arg1.width);
var _local5:* = (_arg2.x + _arg3);
var _local6:* = (((_arg2.y + _arg2.height) - _arg3) - _arg1.height);
var _local7:* = (_arg2.y + _arg3);
var _local8:* = _arg1.x;
var _local9:* = _arg1.y;
_arg1.x = ((_arg1.width > _arg2.width)) ? MathUtil.constrain(_local8, _local4, _local5) : MathUtil.constrain(_local8, _local5, _local4);
_arg1.y = ((_arg1.height > _arg2.height)) ? MathUtil.constrain(_local9, _local6, _local7) : MathUtil.constrain(_local9, _local7, _local6);
}
public static function center(_arg1, _arg2, _arg3:Boolean=false){
var _local4:* = _arg1.width;
var _local5:* = _arg1.height;
if ((((_arg1 is MovieClip)) && (_arg1.area))){
_local4 = _arg1.area.width;
_local5 = _arg1.area.height;
};
_arg1.y = (_arg2.y + ((_arg2.height - _local5) / 2));
_arg1.x = (_arg2.x + ((_arg2.width - _local4) / 2));
if (((_arg3) && (_arg2.parent))){
_arg2.parent.addChild(_arg1);
};
}
public static function centerPoint(_arg1, _arg2, _arg3:Boolean=false){
_arg1.y = (_arg2.y + (_arg2.height / 2));
_arg1.x = (_arg2.x + (_arg2.width / 2));
if (((_arg3) && (_arg2.parent))){
_arg2.parent.addChild(_arg1);
};
}
public static function centerOf(_arg1, _arg2){
_arg1.x = (_arg2.x + (_arg2.width / 2));
_arg1.y = (_arg2.y + (_arg2.height / 2));
}
public static function centerX(_arg1, _arg2){
var _local3:* = (_arg1.area) ? _arg1.area.width : _arg1.width;
_arg1.x = (_arg2.x + ((_arg2.width - _local3) / 2));
}
public static function centerY(_arg1, _arg2){
_arg1.y = (_arg2.y + ((_arg2.height - _arg1.height) / 2));
}
public static function arrangeList(_arg1:Array, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:*;
for (_local3 in _arg1) {
_local4 = _arg1[_local3].target;
if (_local3 == 0){
_local4.y = 0;
} else {
_local5 = _arg1[(_local3 - 1)].target;
_local4.y = ((_local5.y + _local5.area.height) + _arg2);
};
};
}
public static function toColumns(_arg1, _arg2=5, _arg3=5, _arg4=1, _arg5=false){
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local6:* = 0;
var _local7:* = 0;
var _local8:* = new Rectangle(0, 0, 0, 0);
var _local15:* = 0;
for (;_local15 < _arg1.length;_local15++) {
_local9 = _arg1[_local15];
_local10 = _local9.width;
_local11 = _local9.height;
_local12 = ((_arg1[(_local15 - _arg4)]) || (_local8));
_local13 = _local12.width;
_local14 = _local12.height;
_local9.x = (_arg5) ? ((_local12.x + _local13) + _arg2) : ((_local10 + _arg2) * _local7);
_local9.y = (_arg5) ? ((_local11 + _arg3) * _local7) : ((_local12.y + _local14) + _arg3);
++_local7;
if ((_local7 >= _arg4)){
_local7 = 0;
_local6++;
continue;
};
};
}
public static function toColumnsForced(_arg1, _arg2=20, _arg3=20, _arg4=1, _arg5=false){
var _local8:*;
var _local9:*;
var _local6:* = 0;
var _local7:* = 0;
var _local10:* = 0;
for (;_local10 < _arg1.length;_local10++) {
_local8 = _arg1[_local10];
_local8.x = (_arg2 * _local7);
_local8.y = (_arg3 * _local6);
++_local7;
if ((_local7 >= _arg4)){
_local7 = 0;
_local6++;
continue;
};
};
}
public static function getPointsAxis(_arg1:Array, _arg2=null){
var _local3:* = ((_arg2) || (new Point()));
_local3.x = ArrayUtil.getMedianAttribute(_arg1, "x");
_local3.y = ArrayUtil.getMedianAttribute(_arg1, "y");
return (_local3);
}
}
}//package toy.system.util
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class MarginData {
public var align:String;
public var areaMargin:Number;
public var childs:Array;
public var margins:Array;
private function MarginData(_arg1:String, _arg2:Number){
childs = [];
margins = [];
super();
this.align = _arg1;
this.areaMargin = _arg2;
}
public function push(_arg1:MovieClip, _arg2:Number){
childs.push(_arg1);
margins.push(_arg2);
}
}
Section 50
//ArrayUtil (toy.system.util.ArrayUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class ArrayUtil {
public static function shiftAndPush(_arg1:Array, _arg2:Array){
while (_arg1.length) {
_arg2.push(_arg1.shift());
};
}
public static function cleanDuplicateItems(_arg1:Array):Array{
var _local3:*;
var _local2:Array = [];
for (_local3 in _arg1) {
if (!contains(_local2, _arg1[_local3])){
_local2.push(_arg1[_local3]);
};
};
return (_local2);
}
public static function contains(_arg1:Array, _arg2):Boolean{
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function del(_arg1:Array, _arg2){
_arg1.splice(_arg1.indexOf(_arg2), 1);
return (_arg2);
}
public static function concat(_arg1:Array, _arg2:Array){
var _local3:* = 0;
while (_local3 < _arg2.length) {
_arg1.push(_arg2[_local3]);
_local3++;
};
}
public static function random(_arg1:Array){
_arg1.sort(shuffle2);
return (_arg1);
}
private static function shuffle2(_arg1, _arg2):int{
return ((Math.round((Math.random() * 2)) - 1));
}
public static function extract(_arg1=null, _arg2=null){
var _local3:*;
_arg2 = ((_arg2) || ([]));
if (!_arg1){
return (_arg2);
};
for (_local3 in _arg1) {
_arg2[_local3] = _arg1[_local3];
};
return (_arg2);
}
public static function extractPushUnique(_arg1, _arg2=null){
var _local3:*;
_arg2 = ((_arg2) || ([]));
for (_local3 in _arg1) {
pushUnique(_arg1[_local3], _arg2);
};
return (_arg2);
}
public static function removeDuplicates(_arg1:Array){
var _local3:*;
var _local2:Array = [];
for (_local3 in _arg1) {
pushUnique(_arg1[_local3], _local2);
};
return (_local2);
}
public static function removeDuplicatesKey(_arg1:Array, _arg2){
var _local5:*;
var _local3:Array = [];
var _local4:Dictionary = new Dictionary();
for (_local5 in _arg1) {
_local4[_arg1[_local5][_arg2]] = _arg1[_local5];
};
for (_local5 in _local4) {
_local3.push(_local4[_local5]);
};
_local3.sortOn(_arg2, (Array.DESCENDING | Array.NUMERIC));
return (_local3);
}
public static function extractPush(_arg1=null, _arg2=null){
var _local3:*;
if (!_arg1){
return ([]);
};
_arg2 = ((_arg2) || ([]));
for (_local3 in _arg1) {
_arg2.push(_arg1[_local3]);
};
return (_arg2);
}
public static function extractPushInt(_arg1:Array=null, _arg2=null){
if (!_arg1){
return ([]);
};
_arg2 = ((_arg2) || ([]));
var _local3:int;
while (_local3 < _arg1.length) {
_arg2.push(_arg1[_local3]);
_local3++;
};
return (_arg2);
}
public static function set(_arg1, _arg2, _arg3):void{
if ((_arg1 is Array)){
_arg1.push(_arg3);
} else {
_arg1[_arg2] = _arg3;
};
}
public static function length(_arg1){
var _local3:*;
if ((_arg1 is Array)){
return (_arg1.length);
};
var _local2:* = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function getItemByProperty(_arg1:Array, _arg2:String, _arg3:Object){
var _local4:*;
for (_local4 in _arg1) {
if (((!((_arg1[_local4][_arg2] == null))) && ((_arg1[_local4][_arg2] == _arg3)))){
return (_arg1[_local4]);
};
};
return (false);
}
public static function getItemsByProperty(_arg1, _arg2:String, _arg3:Object){
var _local5:*;
var _local4:* = [];
for (_local5 in _arg1) {
if (((!((_arg1[_local5][_arg2] == null))) && ((_arg1[_local5][_arg2] == _arg3)))){
_local4.push(_arg1[_local5]);
};
};
return (_local4);
}
public static function search(_arg1, _arg2:String, _arg3:Object){
var _local5:*;
var _local4:Array = [];
for (_local5 in _arg1) {
if (_arg1[_local5][_arg2] == _arg3){
_local4.push(_arg1[_local5]);
};
};
return (_local4);
}
public static function searchStr(_arg1, _arg2:String, _arg3:String){
var _local5:*;
var _local4:Array = [];
for (_local5 in _arg1) {
if (StringUtil.contains(_arg1[_local5][_arg2], _arg3)){
_local4.push(_arg1[_local5]);
};
};
return (_local4);
}
public static function searchStrIndex(_arg1, _arg2:String, _arg3:String){
var _local5:*;
var _local4:Array = [];
for (_local5 in _arg1) {
if (StringUtil.contains(_arg1[_local5][_arg2], _arg3)){
_local4.push(_local5);
};
};
return (_local4);
}
public static function cloneIndexes(_arg1:Array){
var _local3:*;
var _local2:Array = [];
for (_local3 in _arg1) {
_local2.push(_local3);
};
return (_local2);
}
public static function searchDict(_arg1, _arg2:String, _arg3:Object){
var _local5:*;
var _local4:Array = [];
for (_local5 in _arg1) {
if (_local5[_arg2] == _arg3){
_local4.push(_local5);
};
};
return (_local4);
}
public static function searchProperty(_arg1, _arg2:String, _arg3:Array=null, _arg4:Boolean=false){
var _local6:*;
var _local7:*;
var _local8:*;
var _local5:Array = ((_arg3) || ([]));
for (_local6 in _arg1) {
_local7 = _arg1[_local6];
_local8 = _local7[_arg2];
if ((_local8 is Array)){
searchProperty(_local7, _arg2, _local5);
};
if (_local8 != null){
if (_arg4){
pushUnique(_local8, _local5);
} else {
_local5.push(_local8);
};
};
};
return (_local5);
}
public static function searchItemsWithProperty(_arg1, _arg2:String, _arg3:Array=null){
var _local5:*;
var _local4:Array = ((_arg3) || ([]));
for (_local5 in _arg1) {
if (_arg1[_local5][_arg2]){
_local4.push(_arg1[_local5]);
};
};
return (_local4);
}
public static function renameProperty(_arg1:String, _arg2:String, _arg3:Object){
var _local4:*;
var _local5:*;
for (_local4 in _arg3) {
_local5 = _arg3[_local4];
if ((_local5 is Array)){
renameProperty(_arg1, _arg2, _local5);
};
if (_local4 != _arg1){
} else {
_arg3[_arg2] = _arg3[_arg1];
delete _arg3[_arg1];
};
};
}
public static function mapProperty(_arg1:String, _arg2:Function, _arg3:Array){
var _local4:*;
var _local5:*;
for (_local4 in _arg3) {
_local5 = _arg3[_local4];
if ((_local5 is Array)){
mapProperty(_arg1, _arg2, _local5);
};
if (_local4 != _arg1){
} else {
_arg3[_arg1] = _arg2(_arg3[_arg1]);
};
};
}
public static function searchInText(_arg1:Array, _arg2:Array, _arg3:Array=null){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local4:Array = ((_arg3) || ([]));
for (_local5 in _arg1) {
_local6 = _arg1[_local5];
if ((_local6 is Array)){
searchInText(_local6, _arg2, _local4);
} else {
if (!(_local6 is String)){
} else {
_local7 = _local6;
for (_local8 in _arg2) {
if (_local7.indexOf(_arg2[_local8].toLowerCase()) != -1){
pushUnique(_local7, _local4);
continue;
};
};
};
};
};
return (_local4);
}
public static function arrayContainsValue(_arg1:Array, _arg2:Object){
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function containsItem(_arg1, _arg2){
return (!((_arg2.indexOf(_arg1) == -1)));
}
public static function splice(_arg1:Object, _arg2:Array=null){
if (!_arg2){
return;
};
var _local3:* = _arg2.indexOf(_arg1);
if (_local3 != -1){
_arg2.splice(_local3, 1);
};
return (_arg2);
}
public static function createUniqueCopy(_arg1:Array):Array{
var _local5:Object;
var _local2:Object = new Object();
var _local3:Array = new Array();
var _local4:Number = _arg1.length;
var _local6:uint;
while (_local6 < _local4) {
_local5 = _arg1[_local6];
if (arrayContainsValue(_local3, _local5)){
} else {
_local3.push(_local5);
};
_local6++;
};
return (_local3);
}
public static function copyRows(_arg1:Array, _arg2:int=0, _arg3:int=0):Array{
var _local4:Array = [];
var _local5:int = (_arg1.length) ? MathUtil.constrain((_arg2 + _arg3), _arg2, _arg1.length, false) : 0;
while (_arg2 < _local5) {
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
_local4.push(_arg1[_temp1]);
};
return (_local4);
}
public static function copy(_arg1:Array):Array{
return (_arg1.slice());
}
public static function sort(_arg1, _arg2="y", _arg3=true){
_arg1 = copy(_arg1);
if (_arg3){
_arg1.sortOn(_arg2, (Array.DESCENDING | Array.NUMERIC));
} else {
_arg1.sortOn(_arg2);
};
return (_arg1);
}
public static function sortData(_arg1, _arg2="SongName", _arg3="Song_Artist"){
var _local7:*;
var _local8:*;
var _local9:*;
var _local4:* = [];
var _local5:* = [];
var _local6:Array = [];
for (_local7 in _arg1) {
_local8 = _arg1[_local7];
_local9 = ((_local8[_arg2] + "_") + _local8[_arg3]);
_local5[_local9] = _local8;
_local6.push({tag:_local9});
};
_local6 = sort(_local6, "tag");
for (_local7 in _local6) {
_local4.push(_local5[_local6[_local7].tag]);
};
return (_local4);
}
public static function keyValPairs(_arg1:Object):Array{
var _local3:*;
var _local2:Array = [];
for (_local3 in _arg1) {
_local2.push([_local3, _arg1[_local3]]);
};
return (_local2);
}
public static function sortObjByKeys(_arg1:Object):Array{
var object = _arg1;
var kvArray:Array = keyValPairs(object);
kvArray.sort(function (_arg1, _arg2){
if (_arg1[0] < _arg2[0]){
return (-1);
};
if (_arg1[0] > _arg2[0]){
return (1);
};
return (0);
});
return (kvArray);
}
public static function sortObjByValues(_arg1:Object):Array{
var object = _arg1;
var kvArray:Array = keyValPairs(object);
kvArray.sort(function (_arg1, _arg2){
if (_arg1[1] < _arg2[1]){
return (-1);
};
if (_arg1[1] > _arg2[1]){
return (1);
};
return (0);
});
return (kvArray);
}
public static function extractToNew(_arg1):Array{
var _local2:* = [];
extract(_arg1, _local2);
return (_local2);
}
public static function areEqual(_arg1:Array, _arg2:Array):Boolean{
if (_arg1.length != _arg2.length){
return (false);
};
var _local3:Number = _arg1.length;
var _local4:Number = 0;
while (_local4 < _local3) {
if (_arg1[_local4] !== _arg2[_local4]){
return (false);
};
_local4++;
};
return (true);
}
public static function clone(_arg1:Object){
var _local2:ByteArray = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function next(_arg1){
return (Motor(_arg1, 1));
}
public static function prev(_arg1){
return (Motor(_arg1, -1));
}
public static function Motor(_arg1, _arg2=1){
if (_arg1._position == null){
_arg1._position = 0;
};
_arg1._position = MathUtil.Motor(_arg1._position, 0, (_arg1.length - 1), _arg2);
return (_arg1[_arg1._position]);
}
public static function getFromPosition(_arg1:Array, _arg2:int){
var _local3:* = _arg1.length;
if (_arg2 >= 0){
while (_arg2 > (_local3 - 1)) {
_arg2 = (_arg2 - _local3);
};
};
if (_arg2 < 0){
while (Math.abs(_arg2) > (_local3 - 1)) {
_arg2 = (_arg2 + _local3);
};
};
return (_arg1[((_arg2 >= 0)) ? _arg2 : (_local3 + _arg2)]);
}
public static function moveTo(_arg1, _arg2, _arg3){
removeItem(_arg1, _arg2);
_arg3.push(_arg1);
}
public static function removeItem(_arg1, _arg2){
if (_arg2.indexOf(_arg1) == -1){
return;
};
_arg2.splice(_arg2.indexOf(_arg1), 1);
return (_arg1);
}
public static function removeItemRecursive(_arg1, _arg2){
var _local3:*;
for (_local3 in _arg2) {
removeItem(_arg1, _arg2[_local3]);
};
removeItem(_arg1, _arg2);
}
public static function sumProperties(_arg1){
var _local3:*;
var _local2:* = [];
for (_local3 in _arg1) {
sumExtract(_arg1[_local3], _local2);
};
return (_local2);
}
public static function sumExtract(_arg1, _arg2){
var _local3:*;
for (_local3 in _arg1) {
_arg2[_local3] = (_arg2[_local3]) ? (Number(_arg1[_local3]) + Number(_arg2[_local3])) : Number(_arg1[_local3]);
};
}
public static function shuffle(_arg1=null, _arg2=null){
return (suffle(_arg1, _arg2));
}
public static function suffle(_arg1=null, _arg2=null){
if (!_arg1){
return (null);
};
_arg2 = ((_arg2) || (_arg1.length));
var _local3:* = copy(_arg1);
var _local4:* = new Array();
while (_local4.length < _arg2) {
_local4.push(_local3.splice(MathUtil.randomMax((_local3.length - 1)), 1)[0]);
};
return (_local4);
}
public static function getRandom(_arg1){
return (_arg1[Math.round(MathUtil.random((_arg1.length - 1)))]);
}
public static function remove(_arg1, _arg2){
_arg2.splice(_arg2.indexOf(_arg1), 1);
return (_arg2);
}
public static function toInverse(_arg1){
var _local3:*;
var _local2:* = {};
for (_local3 in _arg1) {
_local2[String(_arg1[_local3])] = _local3;
};
return (_local2);
}
public static function getConfig(_arg1, _arg2, _arg3=null){
return ((_arg3) ? getItemByProperty(_arg1[_arg2], "id", _arg3) : _arg1[_arg2]);
}
public static function parseCommas(_arg1=null){
var _local2:*;
var _local3:Array;
var _local4:int;
var _local5:*;
if (!_arg1){
return ([]);
};
if ((_arg1 is Array)){
if (((_arg1.default) && (_arg1.value))){
_local3 = [];
_local4 = 0;
while (_local4 < _arg1.length) {
_local3.push(ArrayUtil.extract(_arg1[_local4], ArrayUtil.copy(_arg1.default)));
_local4++;
};
_arg1 = _local3;
};
if (_arg1.value){
_local5 = _arg1.value;
if ((((_local5 is String)) && (!((_local5.indexOf(",") == -1))))){
_arg1.value = _arg1.value.split(",");
};
};
for (_local2 in _arg1) {
if (_local2 != "text"){
_arg1[_local2] = parseCommas(_arg1[_local2]);
};
};
} else {
if ((((_arg1 is String)) && (!((_arg1.indexOf(",") == -1))))){
_arg1 = _arg1.split(",");
};
};
return (_arg1);
}
public static function getItem(_arg1, _arg2:Array, _arg3:String="id"){
var _local4:*;
if ((_arg1 is String)){
return (getItemByProperty(_arg2, _arg3, _arg1));
};
var _local5:Boolean;
do {
_local4 = getRandom(_arg2);
_local5 = true;
if (_local4.probability != null){
_local5 = MathUtil.randomChance((_local4.probability / 100));
};
} while (!(_local5));
return (_local4);
}
public static function getProbableItem(_arg1:Array){
var _local2:Object;
var _local3:Boolean;
do {
_local2 = getRandom(_arg1);
_local3 = true;
if (_local2.probability != null){
_local3 = MathUtil.randomChance((_local2.probability / 100));
};
} while (!(_local3));
return (_local2);
}
public static function getRandomItem(_arg1, _arg2:Object=null){
var _local3:Object;
do {
_local3 = _arg1[Math.floor(Random.range(_arg1.length))];
} while ((((_local3 == _arg2)) && ((_arg1.length > 1))));
return (_local3);
}
public static function pushUnique(_arg1:Object, _arg2:Array){
if (_arg2.indexOf(_arg1) == -1){
_arg2.push(_arg1);
};
}
public static function pushUniqueKey(_arg1:Array, _arg2:Array, _arg3:String="id"){
var _local4:*;
var _local5:*;
var _local6:*;
for (_local4 in _arg1) {
_local5 = true;
for (_local6 in _arg2) {
if (_arg2[_local6][_arg3] == _arg1[_local4][_arg3]){
_local5 = false;
break;
};
};
if (_local5){
_arg2.push(_arg1[_local4]);
};
};
}
public static function shiftDictionary(_arg1:Dictionary){
var _local2:*;
for (_local2 in _arg1) {
delete _arg1[_local2];
return (_local2);
};
return (false);
}
public static function isHighscore(_arg1:Array, _arg2:int, _arg3:String="score"){
var _local4:*;
for (_local4 in _arg1) {
if (_arg2 > _arg1[_local4][_arg3]){
return (true);
};
};
return (false);
}
public static function parseToFields(_arg1){
var _local3:*;
var _local4:*;
var _local5:*;
var _local2:* = {};
for (_local3 in _arg1) {
_local4 = _arg1[_local3];
for (_local5 in _local4) {
if (!_local2[_local5]){
_local2[_local5] = "";
};
_local2[_local5] = (_local2[_local5] + (_local4[_local5] + "\n"));
};
};
return (_local2);
}
public static function stringToItems(_arg1:String, _arg2:String=null, _arg3:String=null){
var _local5:int;
var _local6:*;
var _local7:*;
var _local4:* = [];
if (_arg2){
_local4 = _arg1.split(_arg2);
} else {
_local5 = 0;
while (_local5 < _arg1.length) {
_local4.push(_arg1.charAt(_local5));
_local5++;
};
};
if (_arg3){
for (_local6 in _local4) {
_local7 = {};
_local7[_arg3] = _local4[_local6];
_local4[_local6] = _local7;
};
};
return (_local4);
}
public static function getMaxAttribute(_arg1:Array, _arg2:String){
var _local4:*;
var _local3:* = _arg1[0][_arg2];
for (_local4 in _arg1) {
if (_arg1[_local4][_arg2] >= _local3){
_local3 = _arg1[_local4][_arg2];
};
};
return (_local3);
}
public static function getMinAttribute(_arg1:Array, _arg2:String){
var _local4:*;
var _local3:* = _arg1[0][_arg2];
for (_local4 in _arg1) {
if (_arg1[_local4][_arg2] <= _local3){
_local3 = _arg1[_local4][_arg2];
};
};
return (_local3);
}
public static function getMedianAttribute(_arg1:Array, _arg2:String){
var _local3:* = getMinAttribute(_arg1, _arg2);
var _local4:* = getMaxAttribute(_arg1, _arg2);
return ((_local3 + ((_local4 - _local3) / 2)));
}
public static function valuesToProperty(_arg1:Array, _arg2:String):Array{
var _local4:*;
var _local5:*;
var _local3:Array = [];
for (_local4 in _arg1) {
_local5 = {};
_local5[_arg2] = _arg1[_local4];
_local3.push(_local5);
};
return (_local3);
}
}
}//package toy.system.util
Section 51
//BitmapDataUtil (toy.system.util.BitmapDataUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class BitmapDataUtil {
public static function draw(_arg1:DisplayObject, _arg2:BitmapData=null){
var _local3:* = ((_arg2) || (new BitmapData(_arg1.width, _arg1.height, true, 0)));
_local3.fillRect(_local3.rect, 0xFF);
_local3.draw(_arg1, null, null, null, null, true);
return (_local3);
}
public static function getPng(_arg1:DisplayObject, _arg2:BitmapData=null){
return (PNGEncoder.encode(draw(_arg1, _arg2)));
}
}
}//package toy.system.util
Section 52
//Depth (toy.system.util.Depth)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Depth {
private static var depth:uint;
private static var visited:Dictionary;
private static var dependency:Dictionary;
public static function localToLocal(_arg1, _arg2=null){
_arg2 = ((_arg2) || (Toy.root));
return (_arg2.globalToLocal(_arg1.localToGlobal(new Point())));
}
public static function localToTarget(_arg1, _arg2, _arg3){
var _local4:* = localToLocal(_arg1, _arg2);
_arg3.x = _local4.x;
_arg3.y = _local4.y;
}
public static function toFront(_arg1=null, _arg2=null){
if (!(_arg1 is DisplayObject)){
return;
};
var _local3:* = ((_arg2) || (_arg1.parent));
if (_local3){
_local3.addChild(_arg1);
};
}
public static function toBack(_arg1=null, _arg2=null){
if (!(_arg1 is DisplayObject)){
return;
};
if (_arg2){
_arg2.addChild(_arg1);
//unresolved jump
};
_arg1.parent.setChildIndex(_arg1, 0);
}
public static function sortZ(_arg1){
var _local3:*;
var _local2:* = ((_arg1 is Array)) ? ArrayUtil.copyRows(_arg1) : getChilds(_arg1);
_local2 = ArrayUtil.sort(_local2, "z", true);
for (_local3 in _local2) {
_local2[_local3].parent.setChildIndex(_local2[_local3], _local3);
};
return (_local2);
}
public static function sortZArray(_arg1:Array){
var _local3:*;
var _local2:* = _arg1[0].parent;
_arg1.sortOn("z", 16);
for (_local3 in _arg1) {
_local2.setChildIndex(_arg1[_local3], _local3);
};
}
public static function sortSprites(_arg1:Array, _arg2:String="z"){
var _local5:*;
var _local3:Array = ArrayUtil.copy(_arg1);
var _local4:* = _local3[0].sprite.parent;
_local3.sortOn(_arg2, (Array.DESCENDING | Array.NUMERIC));
for (_local5 in _local3) {
_local4.setChildIndex(_local3[_local5].sprite, _local5);
};
}
public static function sortZParticles(_arg1:Array){
var _local3:*;
if (!_arg1.length){
return;
};
var _local2:* = _arg1[0].target.parent;
_arg1.sortOn("z", (Array.DESCENDING | Array.NUMERIC));
for (_local3 in _arg1) {
_local2.setChildIndex(_arg1[_local3].target, _local3);
};
}
public static function sortY(_arg1){
var _local3:*;
var _local2:* = getChilds(_arg1);
_local2.sortOn("y", Array.NUMERIC);
for (_local3 in _local2) {
_local2[_local3].parent.setChildIndex(_local2[_local3], _local3);
};
return (_local2);
}
public static function sortX(_arg1){
var _local3:*;
var _local2:* = getChilds(_arg1);
_local2.sortOn("x", Array.NUMERIC);
for (_local3 in _local2) {
_local2[_local3].parent.setChildIndex(_local2[_local3], _local3);
};
return (_local2);
}
public static function getChilds(_arg1=null, _arg2:String=null):Array{
var _local5:*;
var _local3:Array = [];
if (!_arg1){
return (_local3);
};
var _local4:* = 0;
while (_local4 < _arg1.numChildren) {
_local5 = _arg1.getChildAt(_local4);
if (SpriteUtil.getPrefix(_local5, _arg2)){
_local3.push(_local5);
};
_local4++;
};
return (_local3);
}
public static function getMovieClips(_arg1, _arg2:String=null, _arg3:String=null):Array{
var _local6:*;
var _local7:*;
var _local4:Array = [];
var _local5:* = 0;
while (_local5 < _arg1.numChildren) {
_local6 = _arg1.getChildAt(_local5);
if (!(_local6 is MovieClip)){
} else {
_local7 = _local6.name.toLowerCase();
if (StringUtil.containsKeys(_local6.name, _arg3)){
} else {
if (((_arg2) && (!(StringUtil.containsKeys(_local6.name, _arg2))))){
} else {
_local4.push(_local6);
};
};
};
_local5++;
};
return (_local4);
}
public static function getMovieClipsNames(_arg1, _arg2:String=null, _arg3:String=null):Array{
var _local6:*;
var _local4:* = getMovieClips(_arg1, _arg2, _arg3);
var _local5:* = [];
for (_local6 in _local4) {
_local5[_local4[_local6].name] = _local4[_local6];
};
return (_local5);
}
public static function removeMovieClips(_arg1, _arg2:String=null, _arg3:String=null):Array{
var _local5:*;
var _local4:Array = getMovieClips(_arg1, _arg2, _arg3);
for (_local5 in _local4) {
removeChild(_local4[_local5]);
};
return (_local4);
}
public static function getFirstChild(_arg1){
return (_arg1.getChildAt(0));
}
public static function removeChilds(_arg1){
var _local3:*;
var _local2:Array = ((_arg1 is Array)) ? _arg1 : getChilds(_arg1);
for (_local3 in _local2) {
removeChild(_local2[_local3]);
};
return (_local2);
}
public static function setChild(_arg1, _arg2){
removeChilds(_arg2);
_arg2.addChild(_arg1);
}
public static function removeChild(_arg1=null){
if (!_arg1){
return;
};
if (((!((_arg1 is DisplayObject))) || (!(_arg1.parent)))){
return;
};
if ((_arg1.parent is Loader)){
return;
};
_arg1.parent.removeChild(_arg1);
return (_arg1);
}
public static function sortISO(_arg1:Array, _arg2:Boolean=false){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local3:uint = getTimer();
dependency = new Dictionary();
visited = new Dictionary();
depth = 0;
var _local4:uint = _arg1.length;
for (_local5 in _arg1) {
_local8 = _arg1[_local5];
_arg1[_local5].left = (_local8.x * (_arg2) ? -1 : 1);
_local8.right = ((_local8.left + _local8.width) - 1);
_local8.bottom = (_local8.y - (_local8.height - 1));
};
for (_local5 in _arg1) {
_local9 = [];
_local10 = _arg1[_local5];
for (_local6 in _arg1) {
if (_local6 == _local5){
} else {
_local11 = _arg1[_local6];
if ((((((_local10.right <= _local11.left)) && ((_local10.y >= _local11.bottom)))) || ((((_local10.bottom >= _local11.y)) && ((_local10.left <= _local11.right)))))){
_local9.push(_local11);
};
};
};
dependency[_local10] = _local9;
};
for each (_local7 in _arg1) {
placeISO(_local7);
};
}
private static function placeISO(_arg1){
var _local2:*;
if (visited[_arg1]){
return;
};
visited[_arg1] = true;
for each (_local2 in dependency[_arg1]) {
placeISO(_local2);
};
if (depth != _arg1.z){
_arg1.z = depth;
_arg1.target.parent.setChildIndex(_arg1.target, depth);
};
depth++;
}
public static function getTop(_arg1:MovieClip){
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:*;
var _local7:*;
var _local8:*;
var _local2:Array = getMovieClips(_arg1);
var _local3:Array = [];
var _local9:Dictionary = new Dictionary();
for (_local6 in _local2) {
_local4 = _local2[_local6];
_local9[_local4] = [];
for (_local7 in _local2) {
if (_local6 == _local7){
} else {
if (HitTest.targetPoints(_local4, _local2[_local7])){
_local9[_local4].push(_local2[_local7]);
};
};
};
};
for (_local4 in _local9) {
_local7 = _arg1.getChildIndex(_local4);
_local8 = true;
for (_local6 in _local9[_local4]) {
if (_arg1.getChildIndex(_local9[_local4][_local6]) > _local7){
_local8 = false;
break;
};
};
if (_local8){
_local3.push(_local4);
};
};
return (_local3);
}
}
}//package toy.system.util
Section 53
//GraphicUtil (toy.system.util.GraphicUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class GraphicUtil {
public static var colorTransform:ColorTransform = new ColorTransform();
public static var glowFilter:GlowFilter = new GlowFilter();
public static var IDMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
public static var R:Number = 0.212671;
public static var G:Number = 0.71516;
public static var B:Number = 0.072169;
public static function drawArea(_arg1:Number=100, _arg2:Number=100, _arg3=null):Sprite{
var _local4:* = new Sprite();
drawRect(_local4.graphics, _arg1, _arg2);
if (_arg3){
_arg3.addChild(_local4);
};
return (_local4);
}
public static function drawAreaMC(_arg1:Number=100, _arg2:Number=100, _arg3=null):MovieClip{
var _local4:* = new MovieClip();
drawRect(_local4.graphics, _arg1, _arg2);
if (_arg3){
_arg3.addChild(_local4);
};
return (_local4);
}
public static function drawVisibleArea(_arg1:Number=100, _arg2:Number=100, _arg3=null):Sprite{
var _local4:* = new Sprite();
drawRect(_local4.graphics, _arg1, _arg2, null, 1);
if (_arg3){
_arg3.addChild(_local4);
};
return (_local4);
}
public static function drawLine(_arg1:Graphics, _arg2, _arg3, _arg4, _arg5, _arg6:Number=1, _arg7=0, _arg8=1){
_arg1.clear();
_arg1.lineStyle(_arg6, _arg7, _arg8);
_arg1.moveTo(_arg2, _arg3);
_arg1.lineTo(_arg4, _arg5);
_arg1.endFill();
}
public static function drawRect(_arg1, _arg2=100, _arg3=100, _arg4=0, _arg5=0){
_arg1.clear();
_arg1.beginFill(_arg4, _arg5);
_arg1.drawRect(0, 0, _arg2, _arg3);
_arg1.endFill();
}
public static function drawRectXY(_arg1, _arg2=0, _arg3=0, _arg4=100, _arg5=100, _arg6=0, _arg7=0){
_arg1.beginFill(_arg6, _arg7);
_arg1.drawRect(_arg2, _arg3, _arg4, _arg5);
_arg1.endFill();
}
public static function drawRoundRect(_arg1, _arg2, _arg3, _arg4=22, _arg5=0, _arg6=1){
_arg1.clear();
_arg1.beginFill(_arg5, _arg6);
_arg1.drawRoundRect(0, 0, _arg2, _arg3, _arg4, _arg4);
_arg1.endFill();
}
public static function drawGrid(_arg1, _arg2=100, _arg3=100, _arg4=10, _arg5=null, _arg6=null){
var _local7:* = _arg1.graphics;
_local7.clear();
_local7.lineStyle(0, _arg5);
if (_arg6){
_local7.beginFill(_arg6);
_local7.drawRect(0, 0, _arg2, _arg3);
_local7.endFill();
};
var _local8:int;
while (_local8 <= _arg2) {
_local7.moveTo(_local8, 0);
_local7.lineTo(_local8, _arg3);
_local8 = (_local8 + _arg4);
};
var _local9:int;
while (_local9 <= _arg3) {
_local7.moveTo(0, _local9);
_local7.lineTo(_arg2, _local9);
_local9 = (_local9 + _arg4);
};
}
public static function drawRectDonut(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){
_arg1.clear();
_arg1.beginFill(0);
_arg1.drawRect(0, 0, _arg2, _arg3);
_arg1.drawRect(_arg4, _arg5, _arg6, _arg7);
_arg1.endFill();
}
public static function drawCircDonut(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
_arg1.clear();
_arg1.beginFill(0);
_arg1.drawRect(0, 0, _arg2, _arg3);
_arg1.drawCircle(_arg4, _arg5, _arg6);
_arg1.endFill();
}
public static function drawMap(_arg1, _arg2, _arg3){
var _local6:*;
var _local7:*;
var _local4:* = _arg1.graphics;
var _local5:* = 0xFFFFFF;
_local4.clear();
_local4.beginFill(0xFFFFFF);
for (_local6 in _arg2) {
_local7 = _arg2[_local6];
_local4.drawRect((_local7.x * _arg3), (_local7.y * _arg3), _arg3, _arg3);
};
_local4.endFill();
}
public static function HEXtoRGB(_arg1:Number){
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function RGBtoHEX(_arg1, _arg2, _arg3){
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
public static function setColor(_arg1, _arg2){
colorTransform.color = _arg2;
_arg1.transform.colorTransform = colorTransform;
}
public static function setGlow(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=1, _arg4:Number=5, _arg5:Number=5, _arg6:Number=4, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:int=1){
glowFilter.color = _arg2;
glowFilter.alpha = _arg3;
glowFilter.blurX = _arg4;
glowFilter.blurY = _arg5;
glowFilter.strength = _arg6;
glowFilter.inner = _arg7;
glowFilter.knockout = _arg8;
glowFilter.quality = _arg9;
_arg1.filters = [glowFilter];
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=100):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * R)), ((_arg3 * _local4) * G), ((_arg3 * _local4) * B), 0, 0, ((_arg3 * _local5) * R), (_local7 + ((_arg3 * _local5) * G)), ((_arg3 * _local5) * B), 0, 0, ((_arg3 * _local6) * R), ((_arg3 * _local6) * G), (_local7 + ((_arg3 * _local6) * B)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(R * 0x0100), (G * 0x0100), (B * 0x0100), 0, (-256 * _arg2), (R * 0x0100), (G * 0x0100), (B * 0x0100), 0, (-256 * _arg2), (R * 0x0100), (G * 0x0100), (B * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((R + (_local3 * (1 - R))) + (_local4 * -(R))), ((G + (_local3 * -(G))) + (_local4 * -(G))), ((B + (_local3 * -(B))) + (_local4 * (1 - B))), 0, 0, ((R + (_local3 * -(R))) + (_local4 * 0.143)), ((G + (_local3 * (1 - G))) + (_local4 * 0.14)), ((B + (_local3 * -(B))) + (_local4 * -0.283)), 0, 0, ((R + (_local3 * -(R))) + (_local4 * -((1 - R)))), ((G + (_local3 * -(G))) + (_local4 * G)), ((B + (_local3 * (1 - B))) + (_local4 * B)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * R);
var _local5:Number = (_local3 * G);
var _local6:Number = (_local3 * B);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
}
}//package toy.system.util
Section 54
//MathUtil (toy.system.util.MathUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class MathUtil {
public static const DEG2RAD:Number = 0.0174532925199433;
public static const RAD2DEG:Number = 57.2957795130823;
public static const PHI:Number = 1.61803398874989;
public static const LAMBDA:Number = 0.57721566490143;
public static const RAD:Number = 0.0174532925199433;
public static const ANG:Number = 57.2957795130823;
public static const PI2:Number = 6.28318530717959;
public static function random(_arg1:Number, _arg2:Number=0):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function randomInt(_arg1:int, _arg2:int=0):int{
return (((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1));
}
public static function randomSwitch(... _args){
var _local2:int = (Math.random() * _args.length);
return (_args[_local2]);
}
public static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 > _arg3){
_arg1 = _arg3;
};
if (_arg1 < _arg2){
_arg1 = _arg2;
};
return (_arg1);
}
public static function randomArraySlot(_arg1:Array){
return (_arg1[Math.floor((Math.random() * _arg1.length))]);
}
public static function randomSign(_arg1:Number){
return ((randomChance()) ? _arg1 : -(_arg1));
}
public static function randomMax(_arg1, _arg2=0){
return (Math.round(((Math.random() * (_arg1 - _arg2)) + _arg2)));
}
public static function randomOr(_arg1, _arg2){
return (randomArraySlot([_arg1, _arg2]));
}
public static function randomSpectrum(_arg1=1){
return ((((Math.random() * _arg1) * 2) - _arg1));
}
public static function randomChance(_arg1:Number=0.5){
return ((Math.random() > _arg1));
}
public static function sgn(_arg1:Number):Number{
return (((_arg1 > 0)) ? 1 : -1);
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local3 = "0123456789abcdef";
var _local4 = "";
if (_arg2){
_local5 = 0;
while (_local5 < 4) {
_local4 = (_local4 + (_local3.charAt(((_arg1 >> (((3 - _local5) * 8) + 4)) & 15)) + _local3.charAt(((_arg1 >> ((3 - _local5) * 8)) & 15))));
_local5++;
};
} else {
_local6 = 0;
while (_local6 < 4) {
_local4 = (_local4 + (_local3.charAt(((_arg1 >> ((_local6 * 8) + 4)) & 15)) + _local3.charAt(((_arg1 >> (_local6 * 8)) & 15))));
_local6++;
};
};
return (_local4);
}
public static function ln(_arg1:Number):Number{
return (Math.log(_arg1));
}
public static function logA(_arg1:Number, _arg2:Number):Number{
return ((Math.log(_arg2) / Math.log(_arg1)));
}
public static function summation(_arg1:Number, _arg2:Number):Number{
var _local4:Number;
var _local3:Number = 0;
_local4 = 1;
while (_local4 <= _arg1) {
_local3 = (_local3 + Math.pow(_local4, _arg2));
_local4++;
};
return (_local3);
}
public static function square(_arg1:Number):Number{
return ((_arg1 * _arg1));
}
public static function inverse(_arg1:Number):Number{
return ((1 / _arg1));
}
public static function pow2(_arg1:Number, _arg2:Number):Number{
return (((_arg1 == 0)) ? 0 : ((_arg1 > 0)) ? Math.pow(_arg1, _arg2) : (Math.pow((_arg1 * -1), _arg2) * -1));
}
public static function nRoot(_arg1:Number, _arg2:Number):Number{
return (pow2(_arg1, (1 / _arg2)));
}
public static function factorial(_arg1:Number):Number{
if (_arg1 != 0){
return ((_arg1 * factorial((_arg1 - 1))));
};
return (1);
}
public static function gammaApprox(_arg1:Number):Number{
var _local2:Number = (_arg1 - 1);
return (((Math.sqrt((((2 * _local2) + (1 / 3)) * Math.PI)) * Math.pow(_local2, _local2)) * Math.exp(-(_local2))));
}
public static function factorialApprox(_arg1:Number):Number{
return (Math.round(gammaApprox((_arg1 + 1))));
}
public static function productFactors(_arg1:Number):Number{
var _local3:Number;
var _local2:Number = 1;
_local3 = 3;
while (_local3 <= _arg1) {
if (isPrime(_local3)){
_local2 = (_local2 * _local3);
};
_local3 = (_local3 + 2);
};
if (_arg1 > 2){
_local2 = (_local2 * 2);
};
return (_local2);
}
public static function fibonacci(_arg1:Number):Number{
return (Math.round(((Math.pow(((1 + Math.sqrt(5)) / 2), _arg1) - Math.pow(((1 - Math.sqrt(5)) / 2), _arg1)) / Math.sqrt(5))));
}
public static function isPrime(_arg1:Number):Boolean{
var _local2:Number;
_arg1 = (_arg1 | 0);
if (((isNaN(_arg1)) || ((_arg1 == 0)))){
return (false);
};
if (_arg1 <= 3){
return (true);
};
if ((_arg1 % 2) == 0){
return (false);
};
var _local3:Number = Math.floor(Math.sqrt(_arg1));
_local2 = 3;
while (_local2 <= _local3) {
if ((_arg1 % _local2) == 0){
return (false);
};
_local2 = (_local2 + 2);
};
return (true);
}
public static function isPrime2(_arg1:Number){
_arg1 = (_arg1 | 0);
if (((isNaN(_arg1)) || ((_arg1 == 0)))){
return (false);
};
if (_arg1 <= 3){
return (true);
};
if ((_arg1 % 2) == 0){
return (false);
};
var _local2:Number = ((((Math.sqrt(_arg1) / 6) | 0) * 6) + 5);
var _local3:Number = 5;
do {
} while (((((!(((_arg1 % _local3) == 0))) && (!(((_arg1 % (_local3 + 2)) == 0))))) && (!((_temp2 == _local2)))));
return ((_local3 == _local2));
}
public static function findPrimeFrom(_arg1:Number, _arg2:Number):Array{
var _local3:*;
var _local4:Number;
_arg1 = (_arg1 | 0);
_arg2 = (_arg2 | 0);
var _local5:Array = [];
var _local6:Array = [];
if (!_arg2){
_arg2 = 0;
} else {
_arg2--;
};
_arg1 = (_arg1 + 1);
_local3 = 0;
while (_local3 < _arg1) {
_local6[_local3] = 0;
_local3++;
};
var _local7:Number = Math.round(Math.sqrt((_arg1 + 1)));
var _local8:Number = 2;
_local3 = 2;
while (_local3 <= _local7) {
if (_local6[_local3] == 0){
_local4 = (_local8 * _local3);
while (_local4 < _arg1) {
_local6[_local4] = 1;
_local4 = (_local4 + _local3);
};
_local8 = _local3;
};
_local3++;
};
_local3 = (_arg1 - 1);
while (_local3 > _arg2) {
if (_local6[_local3] == 0){
_local5.push(_local3);
};
_local3--;
};
return (_local5);
}
public static function totient(_arg1:Number):Number{
var _local3:Number;
var _local2:Number = 1;
if ((_arg1 % 2) == 0){
_local3++;
};
_local3 = 3;
while (_local3 <= _arg1) {
if (isPrime(_local3)){
_local2++;
};
_local3 = (_local3 + 2);
};
return (_local2);
}
public static function positive(_arg1){
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function negative(_arg1){
return (((_arg1 < 0)) ? _arg1 : -(_arg1));
}
public static function distance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Number = (_arg1 - _arg2);
var _local6:Number = (_arg3 - _arg4);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function Motor(_arg1:Number=0, _arg2:int=0, _arg3:int=100, _arg4:Number=1, _arg5:Boolean=true){
var _local6:int = ((_arg3 - _arg2) + 1);
_arg1 = (_arg1 + _arg4);
if (!_arg5){
return (clamp(_arg1, _arg2, _arg3));
};
while (_arg1 > _arg3) {
_arg1 = (_arg1 - _local6);
};
while (_arg1 < _arg2) {
_arg1 = (_arg1 + _local6);
};
return (_arg1);
}
public static function sign(_arg1, _arg2=false){
return (((_arg1 > 0)) ? (_arg2) ? 1 : true : (_arg2) ? -1 : false);
}
public static function constrain(_arg1:Number, _arg2=null, _arg3=null, _arg4:Boolean=true){
var _local5:* = _arg1;
if (((!((_arg2 == null))) && ((_local5 < _arg2)))){
_local5 = _arg2;
};
if (((((!((_arg3 == null))) && ((_arg3 > _arg2)))) && ((_local5 > _arg3)))){
_local5 = _arg3;
};
return ((_arg4) ? _local5 : Math.round(_local5));
}
public static function getPercent(_arg1, _arg2=100, _arg3=100, _arg4=0, _arg5=0, _arg6=true){
return (constrain((((_arg1 - _arg5) * _arg3) / (_arg2 - (_arg5 * 2))), _arg4, _arg3, _arg6));
}
public static function forceNumber(_arg1){
return ((isNumber(_arg1)) ? Number(_arg1) : 0);
}
public static function isNumber(_arg1){
return (((String(Number(_arg1)))!="NaN") ? true : false);
}
public static function isDivisibleBy(_arg1:Number, _arg2:int=2){
do {
_arg1 = (_arg1 / _arg2);
} while (_arg1 >= _arg2);
return ((_arg1 == 0));
}
public static function isPair(_arg1:Number){
var _local2:* = String(_arg1);
var _local3:* = Number(_local2.charAt((_local2.length - 1)));
return ((((((((((_local3 == 0)) || ((_local3 == 2)))) || ((_local3 == 4)))) || ((_local3 == 6)))) || ((_local3 == 8))));
}
}
}//package toy.system.util
Section 55
//Random (toy.system.util.Random)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Random {
public static function range(_arg1:Number, _arg2:Number=0, _arg3:Boolean=false):Number{
var _local4:* = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return ((_arg3) ? Math.round(_local4) : _local4);
}
public static function ranggeInt(_arg1:int, _arg2:int=0):int{
return (((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1));
}
public static function switcher(... _args){
var _local2:int = (Math.random() * _args.length);
return (_args[_local2]);
}
public static function arraySlot(_arg1:Array){
return (_arg1[Math.floor((Math.random() * _arg1.length))]);
}
public static function sign(_arg1:Number){
return ((chance()) ? _arg1 : -(_arg1));
}
public static function randomOr(_arg1, _arg2){
return (arraySlot([_arg1, _arg2]));
}
public static function spectrum(_arg1=1){
return ((((Math.random() * _arg1) * 2) - _arg1));
}
public static function chance(_arg1:Number=0.5){
return ((Math.random() < _arg1));
}
}
}//package toy.system.util
Section 56
//SpriteUtil (toy.system.util.SpriteUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class SpriteUtil {
public static function hide(_arg1){
_arg1.visible = false;
_arg1.gotoAndStop(1);
}
public static function cloneProperties(_arg1, _arg2=null){
var _local3:* = ((_arg2) || ({}));
_local3.x = _arg1.x;
_local3.y = _arg1.y;
_local3.alpha = _arg1.alpha;
_local3.scaleX = _arg1.scaleX;
_local3.scaleY = _arg1.scaleY;
_local3.visible = _arg1.visible;
_local3.rotation = _arg1.rotation;
return (_local3);
}
public static function allowMouse(_arg1, _arg2:Boolean=true){
_arg1.mouseEnabled = _arg2;
_arg1.mouseChildren = _arg2;
}
public static function buttonMode(_arg1, _arg2:Boolean=true){
_arg1.buttonMode = _arg2;
_arg1.mouseEnabled = _arg2;
_arg1.mouseChildren = !(_arg2);
}
public static function getPrefix(_arg1, _arg2:String=null){
if (!_arg2){
return (true);
};
if (!(((((_arg1 is MovieClip)) || ((_arg1 is SimpleButton)))) || ((_arg1 is Sprite)))){
return (false);
};
if (_arg1.name.indexOf(_arg2) == -1){
return (false);
};
return (StringUtil.getPrefix(_arg1.name, _arg2));
}
public static function flip(_arg1, _arg2){
var _local3:Number = MathUtil.positive(_arg1.scaleX);
_arg1.scaleX = ((_arg2 > 0)) ? _local3 : -(_local3);
}
public static function flashvar(_arg1:DisplayObject, _arg2:String):String{
if (_arg1.loaderInfo.parameters[_arg2]){
return (_arg1.loaderInfo.parameters[_arg2]);
};
return ((_arg1.parent) ? flashvar(_arg1.parent, _arg2) : null);
}
public static function localToLocal(_arg1, _arg2){
return (_arg2.globalToLocal(_arg1.localToGlobal(new Point())));
}
public static function goPercent(_arg1:MovieClip=null, _arg2:Number=0, _arg3:Boolean=true, _arg4:Number=1){
if (!_arg1){
return;
};
var _local5:* = (_arg1.currentFrame + ((((_arg2 * _arg1.totalFrames) / 100) - _arg1.currentFrame) / _arg4));
_arg1.gotoAndStop(Math.ceil(_local5));
_arg1.visible = ((!(_arg3)) || ((((_arg2 > 0)) && ((_arg2 < 100)))));
}
public static function tweenPercent(_arg1, _arg2, _arg3:Number=0.3, _arg4:Function=null){
if (!_arg1){
return;
};
_arg1.alpha = 1;
_arg1.visible = 0;
_arg2 = Math.round(_arg2);
var _local5:* = MathUtil.getPercent(_arg2, 100, _arg1.totalFrames, null, null, false);
Tweenr.to(_arg1, _arg3, {frame:_local5, ease:Easing.easeInOut}, _arg4);
}
public static function random(_arg1){
if (!_arg1){
return;
};
_arg1.gotoAndStop(Math.round(MathUtil.random((_arg1.totalFrames - 1), 1)));
}
public static function getLabels(_arg1){
var _local4:*;
if (!(_arg1 is MovieClip)){
return ({});
};
var _local2:* = [];
var _local3:* = _arg1.currentScene.labels;
for (_local4 in _local3) {
_local2[_local3[_local4].name] = _local3[_local4].frame;
};
return (_local2);
}
public static function getTimeline(_arg1:MovieClip, _arg2=false){
var _local8:*;
var _local9:*;
var _local11:*;
var _local3:* = [];
var _local4:* = getLabels(_arg1);
var _local5:* = ArrayUtil.toInverse(_local4);
var _local6:* = _arg1.totalFrames;
var _local7:* = {};
_local3.width = _arg1.width;
_local3.height = _arg1.height;
var _local10:* = 0;
for (;_local10 < _local6;(_local9 = _local8), _local7[_local8].push(((_local11) || ((_local10 + 1)))), _local10++) {
_arg1.gotoAndStop((_local10 + 1));
_local11 = (_arg2) ? BitmapDataUtil.draw(_arg1) : null;
_local8 = ((_local5[(_local10 + 1)]) || (_local9));
_local3.push(((_local11) || ((_local10 + 1))));
//unresolved if
if (!_local7[_local8]){
_local7[_local8] = [];
continue;
};
};
_local3.labelFrame = _local4;
_local3.labels = _local7;
return (_local3);
}
public static function getChilds(_arg1):Array{
var _local2:* = [];
var _local3:* = 0;
while (_local3 < _arg1.numChildren) {
_local2.push(_arg1.getChildAt(_local3));
_local3++;
};
return (_local2);
}
public static function getFirstChild(_arg1){
return (_arg1.getChildAt(0));
}
public static function removeChilds(_arg1){
while (_arg1.numChildren) {
removeChild(_arg1.getChildAt(0));
};
}
public static function removeChild(_arg1=null){
if ((((_arg1 is DisplayObject)) && (_arg1.parent))){
if ((_arg1.parent is Loader)){
return;
};
_arg1.parent.removeChild(_arg1);
return (_arg1);
};
}
public static function setRGB(_arg1, _arg2="0x000000"){
var _local3:ColorTransform = new ColorTransform();
_local3.color = int(_arg2);
_arg1.transform.colorTransform = _local3;
}
public static function selfCenter(_arg1){
_arg1.x = (-(_arg1.width) / 2);
_arg1.y = (-(_arg1.height) / 2);
}
public static function fit(_arg1, _arg2, _arg3=false){
var _local6:*;
var _local4:* = _arg2;
var _local5:* = _arg1;
_local6 = (_local4.width / _local5.width);
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
_local6 = (_local4.height / _local5.height);
if (((((_arg3) && ((_local5.height < _local4.height)))) || (((!(_arg3)) && ((_local5.height > _local4.height)))))){
_local5.width = (_local5.width * _local6);
_local5.height = (_local5.height * _local6);
};
center(_arg1, _arg2);
}
public static function constrainOverflow(_arg1, _arg2, _arg3:int=0){
var _local4:* = (((_arg2.x + _arg2.width) - _arg3) - _arg1.width);
var _local5:* = (_arg2.x + _arg3);
var _local6:* = (((_arg2.y + _arg2.height) - _arg3) - _arg1.height);
var _local7:* = (_arg2.y + _arg3);
var _local8:* = _arg1.x;
var _local9:* = _arg1.y;
_arg1.x = ((_arg1.width > _arg2.width)) ? MathUtil.constrain(_local8, _local4, _local5) : MathUtil.constrain(_local8, _local5, _local4);
_arg1.y = ((_arg1.height > _arg2.height)) ? MathUtil.constrain(_local9, _local6, _local7) : MathUtil.constrain(_local9, _local7, _local6);
}
public static function center(_arg1, _arg2){
_arg1.y = (_arg2.y + ((_arg2.height - _arg1.height) / 2));
_arg1.x = (_arg2.x + ((_arg2.width - _arg1.width) / 2));
}
public static function centerX(_arg1, _arg2){
_arg1.x = (_arg2.x + ((_arg2.width - _arg1.width) / 2));
}
public static function arrangeList(_arg1:Array, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:*;
for (_local3 in _arg1) {
_local4 = _arg1[_local3].target;
if (_local3 == 0){
_local4.y = 0;
} else {
_local5 = _arg1[(_local3 - 1)].target;
_local4.y = ((_local5.y + _local5.area.height) + _arg2);
};
};
}
public static function toColumns(_arg1, _arg2=5, _arg3=5, _arg4=1, _arg5=false){
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local6:* = 0;
var _local7:* = 0;
var _local8:* = new Rectangle(0, 0, 0, 0);
var _local15:* = 0;
for (;_local15 < _arg1.length;_local15++) {
_local9 = _arg1[_local15];
_local10 = _local9.width;
_local11 = _local9.height;
_local12 = ((_arg1[(_local15 - _arg4)]) || (_local8));
_local13 = _local12.width;
_local14 = _local12.height;
_local9.x = (_arg5) ? ((_local12.x + _local13) + _arg2) : ((_local10 + _arg2) * _local7);
_local9.y = (_arg5) ? ((_local11 + _arg3) * _local7) : ((_local12.y + _local14) + _arg3);
++_local7;
if ((_local7 >= _arg4)){
_local7 = 0;
_local6++;
continue;
};
};
}
public static function toColumnsForced(_arg1, _arg2=20, _arg3=20, _arg4=1, _arg5=false){
var _local9:*;
var _local10:*;
var _local6:* = 0;
var _local7:* = 0;
var _local8:* = new Rectangle(0, 0, 0, 0);
var _local11:* = 0;
for (;_local11 < _arg1.length;_local11++) {
_local9 = _arg1[_local11];
_local10 = ((_arg1[(_local11 - _arg4)]) || (_local8));
_local9.x = (_arg5) ? (_local10.x + (_arg2 * _local6)) : (_arg2 * _local7);
_local9.y = (_arg5) ? (_arg3 * _local7) : (_local10.y + (_arg3 * _local6));
++_local7;
if ((_local7 >= _arg4)){
_local7 = 0;
_local6++;
continue;
};
};
}
public static function fillFields(_arg1:MovieClip=null, _arg2:Object=null, _arg3:Boolean=false, _arg4:String=null){
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
if (!_arg2){
return;
};
if (!_arg1){
return;
};
var _local5:* = Depth.getMovieClips(_arg1);
for (_local6 in _local5) {
if ((_local5[_local6] is MovieClip)){
if (_arg3){
_local5[_local6].visible = false;
};
if ((((_local5[_local6].name == "thumbnailMC")) && ((_local5[_local6].numChildren > 0)))){
_local5[_local6].removeChildAt(0);
};
};
};
for (_local7 in _arg2) {
if (!_arg1[_local7]){
} else {
_local8 = _arg2[_local7];
_local9 = Depth.getMovieClips(_arg1, _local7);
for (_local10 in _local9) {
fillField(_local9[_local10], _local8, _arg4);
};
};
};
}
public static function fillField(_arg1:MovieClip, _arg2, _arg3:String="left"){
var _local5:Picture;
var _local4:String = _arg1.name;
_arg1.visible = true;
if ((_arg2 is Array)){
fillFields(_arg1, _arg2);
};
if (_arg1.textField){
_arg1.textField.htmlText = ((StringUtil.formatURLs((_arg2 + " "))) || (""));
if (_arg3){
_arg1.textField.autoSize = _arg3;
};
};
if ((((_local4 == "thumbnail")) || ((_local4 == "picture")))){
_local5 = Picture.getInstance(_arg1);
if ((_arg2 is String)){
_local5.load(_arg2);
};
if ((_arg2 is Array)){
_local5.fill(_arg2);
};
};
if ((((_arg1.totalFrames > 1)) && ((_arg2 is Number)))){
_arg1.gotoAndStop(Math.round(_arg2));
};
}
public static function scan_text(_arg1:MovieClip, _arg2:Object=null){
var _local4:*;
var _local5:MovieClip;
var _local6:*;
if (!_arg2){
return;
};
var _local3:* = Depth.getMovieClips(_arg1, "_text");
for (_local4 in _local3) {
_local5 = _local3[_local4];
_local6 = _local5.name.split("_text")[0];
if (((_arg2[_local6]) && (_local5.textField))){
_local5.textField.htmlText = _arg2[_local6];
};
allowMouse(_local5, false);
};
}
}
}//package toy.system.util
Section 57
//StringUtil (toy.system.util.StringUtil)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class StringUtil {
public static var ALPHABET:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static function contains(_arg1, _arg2){
return (!((_arg1.toLowerCase().indexOf(_arg2.toLowerCase()) == -1)));
}
public static function split(_arg1, _arg2){
return (_arg1.toLowerCase().split(_arg2.toLowerCase())[0]);
}
public static function displaySign(_arg1:int, _arg2:String=""){
var _local3:* = ((_arg1 > 0)) ? ("+" + _arg1) : String(_arg1);
if (_arg2){
_local3 = (_local3 + (" " + _arg2));
};
return (_local3);
}
public static function trim(_arg1:String):String{
_arg1 = String(_arg1);
while (_arg1.charAt(0) == " ") {
_arg1 = _arg1.substr(1);
};
while (_arg1.charAt((_arg1.length - 1)) == " ") {
_arg1 = _arg1.substr(0, -1);
};
return (_arg1);
}
public static function lTrim(_arg1:String):String{
_arg1 = String(_arg1);
while (_arg1.charAt(0) == " ") {
_arg1 = _arg1.substr(1);
};
return (_arg1);
}
public static function rTrim(_arg1:String):String{
_arg1 = String(_arg1);
while (_arg1.charAt((_arg1.length - 1)) == " ") {
_arg1 = _arg1.substr(0, -1);
};
return (_arg1);
}
public static function string(_arg1:String, _arg2:int):String{
if (_arg2 <= 0){
return ("");
};
var _local3 = "";
var _local4:uint;
while (_local4 < _arg2) {
_local3 = (_local3 + _arg1);
_local4++;
};
return (_local3);
}
public static function lFill(_arg1:String, _arg2:String, _arg3:uint):String{
while (_arg1.length < _arg3) {
_arg1 = (_arg2 + _arg1);
};
return (_arg1);
}
public static function rFill(_arg1:String, _arg2:String, _arg3:uint):String{
while (_arg1.length < _arg3) {
_arg1 = (_arg1 + _arg2);
};
return (_arg1);
}
public static function validateEmail(_arg1:String):Boolean{
var _local2:RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
return (Boolean(_arg1.match(_local2)));
}
public static function beginsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg2 == _arg1.substring(0, _arg2.length)));
}
public static function getPrefix(_arg1:String, _arg2:String="_", _arg3:Boolean=false){
var _local4:* = _arg1.split(_arg2)[0];
if (_arg3){
_local4.toLowerCase();
};
return (_local4);
}
public static function endsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg2 == _arg1.substring((_arg1.length - _arg2.length))));
}
public static function replaceStr(_arg1:String, _arg2:String, _arg3:String):String{
var _local9:Number;
var _local4:String = new String();
var _local5:Boolean;
var _local6:Number = _arg1.length;
var _local7:Number = _arg2.length;
var _local8:Number = 0;
while (_local8 < _local6) {
if (_arg1.charAt(_local8) == _arg2.charAt(0)){
_local5 = true;
_local9 = 0;
while (_local9 < _local7) {
if (_arg1.charAt((_local8 + _local9)) != _arg2.charAt(_local9)){
_local5 = false;
break;
};
_local9++;
};
//unresolved if
_local4 = (_local4 + _arg3);
_local8 = (_local8 + (_local7 - 1));
} else {
_local4 = (_local4 + _arg1.charAt(_local8));
};
_local8++;
};
return (_local4);
}
public static function getFileExtension(_arg1:String){
return (_arg1.substring((_arg1.lastIndexOf(".") + 1), _arg1.length).toLowerCase());
}
public static function containsKeys(_arg1:String, _arg2:String=null){
var _local5:*;
if (!_arg2){
return (false);
};
var _local3:* = _arg2.split(",");
var _local4:* = _arg1.toLowerCase();
for (_local5 in _local3) {
if (_local4.indexOf(_local3[_local5]) != -1){
return (true);
};
};
}
public static function strReplace(_arg1, _arg2, _arg3){
var _local4:* = String(_arg3);
return (_local4.split(_arg1).join(_arg2));
}
public static function excludeChars(_arg1:String, _arg2:String=":,<>-'{}[]/*-+!;8!@#$%.^&*()"){
var _local4:*;
var _local6:*;
var _local3:* = "";
var _local5:* = 0;
for (;_local5 < _arg1.length;_local5++) {
_local4 = true;
_local6 = 0;
while (_local6 < _arg2.length) {
if (_arg1.charAt(_local5) == _arg2.charAt(_local6)){
_local4 = false;
break;
};
_local6++;
};
if (_local4){
_local3 = (_local3 + _arg1.charAt(_local5));
continue;
};
};
return (_local3);
}
public static function charsToLongs(_arg1:Array):Array{
var _local2:Array = new Array(Math.ceil((_arg1.length / 4)));
var _local3:Number = 0;
while (_local3 < _local2.length) {
_local2[_local3] = (((_arg1[(_local3 * 4)] + (_arg1[((_local3 * 4) + 1)] << 8)) + (_arg1[((_local3 * 4) + 2)] << 16)) + (_arg1[((_local3 * 4) + 3)] << 24));
_local3++;
};
return (_local2);
}
public static function longsToChars(_arg1:Array):Array{
var _local2:Array = new Array();
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2.push((_arg1[_local3] & 0xFF), ((_arg1[_local3] >>> 8) & 0xFF), ((_arg1[_local3] >>> 16) & 0xFF), ((_arg1[_local3] >>> 24) & 0xFF));
_local3++;
};
return (_local2);
}
public static function charsToHex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:Number = 0;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
public static function hexToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:Number = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
public static function charsToStr(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
if (_arg1[_local3]){
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
};
_local3++;
};
return (_local2);
}
public static function strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
public static function extractKeywords(_arg1:String, _arg2:int=2):Array{
var _local8:*;
var _local3 = "abcdefghijklmnopqrstuvwxyz";
var _local4:Array = [];
var _local5:int = _arg1.length;
_arg1 = _arg1.toLowerCase();
var _local6 = "";
var _local7:int;
while (_local7 < _local5) {
_local8 = _arg1.charAt(_local7);
if (_local3.indexOf(_local8) != -1){
_local6 = (_local6 + _local8);
} else {
if (_local6.length > _arg2){
_local4.push(_local6);
};
_local6 = "";
};
_local7++;
};
return (_local4);
}
public static function toString(_arg1, _arg2=0){
var _local7:*;
var _local3:* = typeof(_arg1);
var _local4:* = "";
_arg2 = (_arg2 + 1);
var _local5:* = "\n";
var _local6:* = 0;
while (_local6 < _arg2) {
_local5 = (_local5 + "\t");
_local6++;
};
if ((((((_local3 == "string")) || ((_local3 == "number")))) || ((_local3 == "boolean")))){
if ((_local3 == "string")){
_local4 = (_local4 + "\"");
//unresolved jump
};
_local4 = (_local4 + String(_arg1));
if ((_local3 == "string")){
_local4 = (_local4 + "\"");
//unresolved jump
};
};
if (_local3 == "object"){
_local4 = (_local4 + ((_arg1 is Array)) ? "[" : "{");
for (_local7 in _arg1) {
_local4 = (_local4 + (((_local5 + String(_local7)) + " : ") + toString(_arg1[_local7], _arg2)));
};
_local4 = (_local4 + _local5);
_local4 = (_local4 + ((_arg1 is Array)) ? "]" : "}");
};
if (_local3 == "movieclip"){
_local4 = (_local4 + ("(movieclip) " + String(_arg1)));
};
if (_local3 == "function"){
_local4 = (_local4 + ("(function) " + String(_arg1)));
};
return (_local4);
}
public static function toStringer(_arg1, _arg2=0){
var _local7:*;
var _local3:* = typeof(_arg1);
var _local4:* = "";
_arg2 = (_arg2 + 1);
var _local5:* = "\n";
var _local6:* = 0;
while (_local6 < _arg2) {
_local5 = (_local5 + "\t");
_local6++;
};
if ((((((_local3 == "string")) || ((_local3 == "number")))) || ((_local3 == "boolean")))){
if ((_local3 == "string")){
_local4 = (_local4 + "\"");
//unresolved jump
};
_local4 = (_local4 + String(_arg1));
if ((_local3 == "string")){
_local4 = (_local4 + "\"");
//unresolved jump
};
};
if (_local3 == "object"){
_local4 = (_local4 + ((_arg1 is Array)) ? "[" : "{");
for (_local7 in _arg1) {
_local4 = (_local4 + (((_local5 + String(_local7)) + " : ") + toString(_arg1[_local7], _arg2)));
};
_local4 = (_local4 + _local5);
_local4 = (_local4 + ((_arg1 is Array)) ? "]" : "}");
};
if (_local3 == "movieclip"){
_local4 = (_local4 + ("(movieclip) " + String(_arg1)));
};
if (_local3 == "function"){
_local4 = (_local4 + ("(function) " + String(_arg1)));
};
return (_local4);
}
public static function toPHPArray(_arg1:Object){
var _local3:*;
var _local2:* = "array(";
for (_local3 in _arg1) {
_local2 = (_local2 + (((("\"" + _local3) + "\" => \"") + _arg1[_local3]) + "\";"));
};
_local2 = (_local2.substr(0, (_local2.length - 1)) + ")");
return (_local2);
}
public static function decode(_arg1:String, _arg2:String){
var _local8:*;
var _local9:*;
var _local3:Array = [];
var _local4:URLVariables = new URLVariables();
var _local5:Array = _arg2.split(",");
var _local6:int;
var _local7:Boolean;
_local4.decode(_arg1);
while (_local7) {
_local7 = _local4[(_local5[0] + _local6)];
if (_local7){
_local8 = {};
for (_local9 in _local5) {
_local8[_local5[_local9]] = _local4[(_local5[_local9] + _local6)];
};
_local3.push(_local8);
};
_local6++;
};
return (_local3);
}
public static function validate(_arg1:String=null){
if (!_arg1){
return (null);
};
if (!_arg1.length){
return (null);
};
return (_arg1);
}
public static function formatURLs(_arg1:String){
var _local5:String;
var _local6:String;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:String;
var _local11:String;
var _local2:Array = getIndexesFromTo(_arg1, "<a href=", "</a>");
var _local3:Array = getIndexAndEnds(_arg1, [".com", ".net", "http", "www"]);
var _local4:Array = [];
for (_local7 in _local3) {
_local5 = _local3[_local7].text;
if (_local5.length < 5){
} else {
if (_local5.indexOf(".") == -1){
} else {
if (_local5.lastIndexOf(".") > (_local5.length - 3)){
} else {
_local4.push(_local3[_local7]);
};
};
};
};
_local3 = _local4;
for (_local7 in _local3) {
_local8 = true;
for (_local9 in _local2) {
if ((((_local3[_local7].start >= _local2[_local9].start)) && ((_local3[_local7].end <= _local2[_local9].end)))){
_local8 = false;
break;
};
};
if (!_local8){
} else {
_local5 = _local3[_local7].text;
if (_local5.indexOf("http://") == -1){
_local5 = ((_local5.indexOf("www.") == -1)) ? ("http://www." + _local5) : ("http://" + _local5);
};
_local10 = _arg1.substr(0, _local3[_local7].start);
_local11 = _arg1.substr(_local3[_local7].end, (_arg1.length - _local3[_local7].end));
_arg1 = ((((((_local10 + "<a href='") + _local5) + "' target='_blank' >") + _local3[_local7].text) + "</a>") + _local11);
};
};
return (_arg1);
}
public static function getIndexAndEnds(_arg1:String, _arg2:Array){
var _local4:*;
var _local3:Array = indexesOfChars(_arg1, _arg2);
for (_local4 in _local3) {
_local3[_local4] = getEndFromIndex(_arg1, _local3[_local4]);
};
return (ArrayUtil.removeDuplicatesKey(_local3, "start"));
}
public static function getIndexesFromTo(_arg1:String, _arg2:String="<a href=", _arg3:String="</a>"){
var _local7:*;
var _local8:*;
var _local9:*;
var _local4:Array = [];
var _local5:Array = indexesOf(_arg1, _arg2);
var _local6:Array = indexesOf(_arg1, _arg3);
while (_local5.length) {
_local7 = _local5.shift();
for (_local8 in _local6) {
_local9 = _local6[_local8];
if (_local7 > _local9){
} else {
_local6.splice(_local8, 1);
_local9 = (_local9 + _arg3.length);
_local4.push({start:_local7, end:_local9, lenght:(_local9 - _local7), text:_arg1.substr(_local7, (_local9 - _local7))});
break;
};
};
};
return (_local4);
}
public static function getEndFromIndex(_arg1:String, _arg2:int){
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:* = " ,ñ!|#$%&()=¡";
_local5 = _arg2;
while (_local5 >= 0) {
if (((!((_local6.indexOf(_arg1.charAt(_local5)) == -1))) || ((_arg1.charCodeAt(_local5) == 160)))){
break;
};
_local3 = _local5;
_local5--;
};
_local5 = (_arg2 + 1);
while (_local5 < _arg1.length) {
_local4 = _local5;
if (((!((_local6.indexOf(_arg1.charAt(_local5)) == -1))) || ((_arg1.charCodeAt(_local5) == 160)))){
break;
};
_local5++;
};
var _local7:* = {start:_local3, end:_local4, lenght:(_local4 - _local3), text:_arg1.substr(_local3, (_local4 - _local3))};
return (_local7);
}
public static function indexesOfChars(_arg1:String, _arg2:Array){
var _local4:*;
var _local3:Array = [];
for (_local4 in _arg2) {
_local3 = _local3.concat(indexesOf(_arg1, _arg2[_local4]));
};
return (ArrayUtil.removeDuplicates(_local3));
}
public static function indexesOf(_arg1:String, _arg2:String){
var _local7:Boolean;
var _local8:Number;
var _local3:Array = [];
var _local4:* = _arg1.toLowerCase();
var _local5:* = _arg2.toLowerCase();
var _local6:Number = 0;
for (;_local6 < _local4.length;_local6++) {
if (_local4.charAt(_local6) == _local5.charAt(0)){
_local7 = true;
_local8 = 0;
while (_local8 < _local5.length) {
if (_local4.charAt((_local6 + _local8)) != _local5.charAt(_local8)){
_local7 = false;
break;
};
_local8++;
};
if (_local7){
_local3.push(_local6);
_local6 = (_local6 + (_local5.length - 1));
continue;
};
};
};
return (_local3);
}
public static function formatText(_arg1, _arg2:String=null){
if (!_arg2){
return (_arg1);
};
var _local3:* = (MathUtil.isNumber(_arg1)) ? int(_arg1) : String(_arg1);
if ((_local3 is String)){
return (_local3);
};
if (_arg2 == "time"){
return (seconds2Minutes(_local3));
};
if (_arg2 == "score"){
return (commas(_local3));
};
return (commas(fillZero(_arg1, 1)));
}
public static function fillZero(_arg1, _arg2=1){
var _local3:* = String(_arg1);
while (_local3.length < (_arg2 + 1)) {
_local3 = ("0" + _local3);
};
return (_local3);
}
public static function commas(_arg1, _arg2=3){
var _local4:*;
_arg1 = String(_arg1);
var _local3:* = "";
var _local5:* = 0;
var _local6:* = (_arg1.length - 1);
for (;_local6 >= 0;(_local4 = (_local4 + _arg1.charAt(_local6))), (_local3 = (_local4 + _local3)), _local6--) {
_local4 = "";
++_local5;
if ((((_local5 >= _arg2)) && ((_local6 > 0)))){
_local5 = 0;
_local4 = ",";
continue;
};
};
return (_local3);
}
public static function toDollars(_arg1:Number, _arg2:String="$", _arg3:int=1){
var _local4 = (_arg1 < 0);
var _local5:String = (_arg2 + commas(Math.abs(Math.round((_arg1 / _arg3)))));
if (_local4){
_local5 = ("-" + _local5);
};
return (_local5);
}
public static function seconds2Minutes(_arg1:int, _arg2:Boolean=false){
var _local3:* = 0;
var _local4:* = 0;
while (_arg1 >= 60) {
_arg1 = (_arg1 - 60);
_local3++;
};
while (_local3 >= 60) {
_local3 = (_local3 - 60);
_local4++;
};
var _local5:* = (_local4) ? (fillZero(_local4) + ":") : "";
var _local6:* = "";
if (((_local4) || (_arg2))){
_local6 = (fillZero(_local3) + ":");
} else {
if (_local3){
_local6 = (_local3 + ":");
};
};
var _local7:* = fillZero(_arg1);
return (((_local5 + _local6) + _local7));
}
public static function getTimeString(_arg1:int, _arg2:String="."):String{
var _local3:int = (_arg1 / 1000);
var _local4:int = ((_arg1 - (_local3 * 1000)) / 10);
var _local5:String = lFill(String(_local3), "0", 2);
var _local6:String = lFill(String(_local4), "0", 2);
return (((_local5 + _arg2) + _local6));
}
public static function getFormatTime(_arg1:int, _arg2:Boolean=true):String{
var _local3:Number = (_arg1 / 1000);
var _local4:int = (_local3 / 60);
var _local5:int = (_local3 - (_local4 * 60));
var _local6:int = ((_arg1 - (_local4 * 60000)) - (_local5 * 1000));
var _local7 = "";
_local7 = (_local7 + (lFill(_local4.toString(), "0", 2) + ":"));
_local7 = (_local7 + lFill(_local5.toString(), "0", 2));
if (_arg2){
_local7 = (_local7 + ("." + lFill(_local6.toString().substr(0, 2), "0", 2)));
};
return (_local7);
}
}
}//package toy.system.util
Section 58
//Utils (toy.system.util.Utils)
package toy.system.util {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Utils {
public static function getURL(_arg1:String, _arg2:String="_blank"){
var _local3:* = ((_arg1) || ("url"));
navigateToURL(new URLRequest(_local3), _arg2);
}
public static function attach(_arg1, _arg2:Object=null, _arg3=null){
var _local4:* = _arg1;
if ((_arg1 is String)){
_local4 = ((((asClass(_arg1)) || (asClass(("project." + _arg1))))) || (Load.getDefinition(_arg1, Toy.externalAssets)));
};
if (!_local4){
return;
};
var _local5:* = (_arg2) ? new _local4(_arg2) : new (_local4);
if (_arg3){
_arg3.addChild(_local5);
};
return (_local5);
}
public static function duplicate(_arg1:Object, _arg2=null){
var _local3:* = new (getConstructor(_arg1));
if (_arg2){
_arg2.addChild(_local3);
};
return (_local3);
}
public static function getConstructor(_arg1:Object){
return (Object(_arg1).constructor);
}
public static function asClass(_arg1:String){
var clssname:*;
var name = _arg1;
try {
clssname = (getDefinitionByName(name) as Class);
} catch(e) {
};
return (clssname);
}
public static function toBoolean(_arg1){
if (_arg1 == "true"){
return (true);
};
return (false);
}
public static function or(_arg1, _arg2){
if (_arg1 == null){
return (_arg2);
};
return (_arg1);
}
public static function checkVariable(_arg1, _arg2){
return (or(_arg1, _arg2));
}
public static function switchBoolean(_arg1){
return ((_arg1) ? false : true);
}
public static function tracer(_arg1){
trace(StringUtil.toString(_arg1));
}
public static function renameVariable(_arg1, _arg2, _arg3){
_arg3[_arg2] = _arg3[_arg1];
delete _arg3[_arg1];
}
public static function isObject(_arg1:Object){
if ((_arg1 is Number)){
return (false);
};
if ((_arg1 is String)){
return (false);
};
if ((_arg1 is Boolean)){
return (false);
};
return (true);
}
public static function getValueFromString(_arg1){
if (MathUtil.isNumber(_arg1)){
return (Number(_arg1));
};
if (_arg1 == "true"){
return (true);
};
if (_arg1 == "false"){
return (false);
};
return (_arg1);
}
}
}//package toy.system.util
Section 59
//Benchmark (toy.system.Benchmark)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Benchmark {
private static var itvTime:int;
private static var initTime:int;
private static var currentTime:int;
private static var frameCount:int;
private static var totalCount:int;
public static var minFps:Number;
public static var maxFps:Number;
public static var minMem:Number;
public static var maxMem:Number;
public static var history:int = 60;
public static var fpsList:Array = [];
public static var memList:Array = [];
private static var displayed:Boolean = false;
private static var started:Boolean = false;
private static var inited:Boolean = false;
private static var frame:Sprite;
private static var content:BenchmarkContent;
private static var ci:ContextMenuItem;
private static var fpsmedian:Array = [];
public static function init(){
if (inited){
return;
};
inited = true;
content = new BenchmarkContent();
frame = new Sprite();
minFps = Number.MAX_VALUE;
maxFps = Number.MIN_VALUE;
minMem = Number.MAX_VALUE;
maxMem = Number.MIN_VALUE;
var _local1:ContextMenu = new ContextMenu();
_local1.hideBuiltInItems();
ci = new ContextMenuItem("Benchmarks", true);
addEvent(ci, ContextMenuEvent.MENU_ITEM_SELECT, onSelect);
_local1.customItems = [ci];
Toy.root.contextMenu = _local1;
start();
}
public static function start(){
if (started){
return;
};
started = true;
initTime = (itvTime = getTimer());
totalCount = (frameCount = 0);
addEvent(frame, Event.ENTER_FRAME, draw);
}
public static function stop(){
if (!started){
return;
};
started = false;
removeEvent(frame, Event.ENTER_FRAME, draw);
}
public static function gc(){
try {
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
} catch(e:Error) {
};
}
public static function get currentFps():Number{
return ((frameCount / intervalTime));
}
public static function get currentMem():Number{
return (((System.totalMemory / 0x0400) / 1000));
}
public static function get averageFps():Number{
return ((totalCount / runningTime));
}
private static function get runningTime():Number{
return (((currentTime - initTime) / 1000));
}
private static function get intervalTime():Number{
return (((currentTime - itvTime) / 1000));
}
private static function onSelect(_arg1:ContextMenuEvent):void{
if (!displayed){
show();
} else {
hide();
};
}
private static function show():void{
ci.caption = "Hide Benchmarks";
displayed = true;
Screen.addResize(resize);
Toy.root.addChild(content);
updateDisplay();
}
private static function hide():void{
ci.caption = "Benchmarks";
displayed = false;
Screen.removeResize(resize);
Depth.removeChild(content);
}
private static function resize():void{
content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
}
private static function draw(_arg1:Event):void{
currentTime = getTimer();
frameCount++;
totalCount++;
if (intervalTime >= 1){
if (displayed){
updateDisplay();
} else {
updateMinMax();
};
fpsList.unshift(currentFps);
memList.unshift(currentMem);
fpsmedian.push(currentFps);
if (fpsList.length > history){
fpsList.pop();
};
if (memList.length > history){
memList.pop();
};
itvTime = currentTime;
frameCount = 0;
};
}
private static function updateDisplay():void{
updateMinMax();
content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
}
private static function updateMinMax():void{
minFps = Math.min(currentFps, minFps);
maxFps = Math.max(currentFps, maxFps);
minMem = Math.min(currentMem, minMem);
maxMem = Math.max(currentMem, maxMem);
}
private static function addEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.addEventListener(_arg2, _arg3, false, 0, true);
}
private static function removeEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.removeEventListener(_arg2, _arg3);
}
public static function getMedianFPS(){
var _local3:*;
var _local1:Number = 0;
var _local2:Number = fpsmedian.length;
for (_local3 in fpsmedian) {
_local1 = (_local1 + fpsmedian[_local3]);
};
fpsmedian = [];
return ((_local1 / _local2));
}
}
}//package toy.system
import flash.events.*;
import flash.display.*;
import flash.text.*;
class BenchmarkContent extends Sprite {
private var minFpsTxtBx:TextField;
private var maxFpsTxtBx:TextField;
private var minMemTxtBx:TextField;
private var maxMemTxtBx:TextField;
private var infoTxtBx:TextField;
private var box:Shape;
private var fps:Shape;
private var mb:Shape;
private function BenchmarkContent():void{
fps = new Shape();
mb = new Shape();
box = new Shape();
this.mouseChildren = false;
this.mouseEnabled = false;
fps.x = 65;
fps.y = 45;
mb.x = 65;
mb.y = 90;
var _local1:TextFormat = new TextFormat("_sans", 9, 0xAAAAAA);
infoTxtBx = new TextField();
infoTxtBx.autoSize = TextFieldAutoSize.LEFT;
infoTxtBx.defaultTextFormat = new TextFormat("_sans", 11, 0xCCCCCC);
infoTxtBx.y = 98;
minFpsTxtBx = new TextField();
minFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
minFpsTxtBx.defaultTextFormat = _local1;
minFpsTxtBx.x = 7;
minFpsTxtBx.y = 37;
maxFpsTxtBx = new TextField();
maxFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
maxFpsTxtBx.defaultTextFormat = _local1;
maxFpsTxtBx.x = 7;
maxFpsTxtBx.y = 5;
minMemTxtBx = new TextField();
minMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
minMemTxtBx.defaultTextFormat = _local1;
minMemTxtBx.x = 7;
minMemTxtBx.y = 83;
maxMemTxtBx = new TextField();
maxMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
maxMemTxtBx.defaultTextFormat = _local1;
maxMemTxtBx.x = 7;
maxMemTxtBx.y = 50;
addChild(box);
addChild(infoTxtBx);
addChild(minFpsTxtBx);
addChild(maxFpsTxtBx);
addChild(minMemTxtBx);
addChild(maxMemTxtBx);
addChild(fps);
addChild(mb);
}
public function update(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Array, _arg10:Array, _arg11:int):void{
var _local19:Number;
if (_arg1 >= 1){
minFpsTxtBx.text = (_arg2.toFixed(3) + " Fps");
maxFpsTxtBx.text = (_arg3.toFixed(3) + " Fps");
minMemTxtBx.text = (_arg4.toFixed(3) + " Mb");
maxMemTxtBx.text = (_arg5.toFixed(3) + " Mb");
};
infoTxtBx.text = (((((("Current Fps " + _arg6.toFixed(3)) + " | Average Fps ") + _arg8.toFixed(3)) + " | Memory Used ") + _arg7.toFixed(3)) + " Mb");
infoTxtBx.x = ((Screen.width - infoTxtBx.width) - 20);
var _local12:Graphics = fps.graphics;
_local12.clear();
_local12.lineStyle(1, 0x33FF00, 0.7);
var _local13:int;
var _local14:int = _arg9.length;
var _local15 = 35;
var _local16:int = (Screen.width - 80);
var _local17:Number = (_local16 / (_arg11 - 1));
var _local18:Number = (_arg3 - _arg2);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg9[_local13] - _arg2) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
_local12 = mb.graphics;
_local12.clear();
_local12.lineStyle(1, 26367, 0.7);
_local13 = 0;
_local14 = _arg10.length;
_local18 = (_arg5 - _arg4);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg10[_local13] - _arg4) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
}
private function added(_arg1:Event):void{
resize();
}
private function removed(_arg1:Event):void{
}
private function resize(_arg1:Event=null):void{
var _local2:Graphics = box.graphics;
_local2.clear();
_local2.beginFill(0, 0.9);
_local2.drawRect(0, 0, Screen.width, 120);
_local2.lineStyle(1, 0xFFFFFF, 0.2);
_local2.moveTo(65, 45);
_local2.lineTo(65, 10);
_local2.moveTo(65, 45);
_local2.lineTo((Screen.width - 15), 45);
_local2.moveTo(65, 90);
_local2.lineTo(65, 55);
_local2.moveTo(65, 90);
_local2.lineTo((Screen.width - 15), 90);
_local2.endFill();
infoTxtBx.x = ((Screen.width - infoTxtBx.width) - 20);
}
}
Section 60
//Cursor (toy.system.Cursor)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Cursor {
public static var x:Number = 0;
public static var y:Number = 0;
public static var velocity:Vector2 = new Vector2();
public static var target:MovieClip;
public static var area:Sprite;
public static var label:String;
public static var flipPoint:Point;
public static var isCustom:Boolean;
public static var SMOOTH_DRAG_VEL:Number = 2;
private static var dragTarget:DisplayObject;
private static var dragOffset:Point = new Point();
private static var _mouseDobleClick:int;
private static var _wheel:Number;
private static var _mouseHit:int;
public static var isDown:Boolean = false;
public static var isUp:Boolean = true;
public static function init(){
x = Toy.root.mouseX;
y = Toy.root.mouseY;
Toy.stage.addEventListener("mouseDown", mouseDownEvent);
Toy.stage.addEventListener("mouseUp", mouseUpEvent);
Toy.stage.addEventListener("mouseWheel", mouseWheelEvent);
Toy.stage.addEventListener("doubleClick", mouseDobleClickEvent);
Motor.add(update);
}
public static function setCustom(_arg1:MovieClip, _arg2:Sprite=null, _arg3:Point=null){
Cursor.target = Depth.removeChild(_arg1);
Cursor.area = _arg2;
Cursor.flipPoint = _arg3;
_arg1.mouseChildren = false;
_arg1.mouseEnabled = false;
show();
}
public static function add(_arg1:String, _arg2:Function){
remove(_arg1, _arg2);
Pools[_arg1][_arg2] = true;
}
public static function remove(_arg1:String, _arg2:Function){
delete Pools[_arg1][_arg2];
}
public static function hitTest(_arg1){
return (_arg1.hitTestPoint(x, y, true));
}
public static function hitTestRectangle(_arg1:Rectangle, _arg2:DisplayObject){
var _local3:* = _arg2.mouseX;
var _local4:* = _arg2.mouseY;
var _local5:* = (((((((_local3 >= 0)) && ((_local4 >= 0)))) && ((_local3 <= _arg1.width)))) && ((_local4 <= _arg1.height)));
return (_local5);
}
public static function set mouseHit(_arg1:int){
_mouseHit = _arg1;
}
public static function get mouseHit():int{
var _local1:int = _mouseHit;
_mouseHit = 0;
return (_local1);
}
public static function get mouseDobleClick():int{
var _local1:int = _mouseDobleClick;
_mouseDobleClick = 0;
return (_local1);
}
public static function get wheel():int{
var _local1:Number = _wheel;
_wheel = 0;
return (_local1);
}
public static function show(_arg1:String=null){
Mouse.show();
isCustom = false;
if (target){
target.visible = false;
};
if (!_arg1){
return;
};
Cursor.label = _arg1;
target.visible = true;
isCustom = true;
Depth.toFront(target, Toy.root);
target.x = x;
target.y = y;
Tweenr.FADE_IN(target);
target.gotoAndStop(_arg1);
Mouse.hide();
}
public static function hide(){
Mouse.hide();
}
public static function dispatch(_arg1:Event){
var _local3:*;
var _local2:* = _arg1.type;
for (_local3 in Pools[_local2]) {
_local3(_arg1);
};
}
public static function update(){
var _local1:*;
velocity.x = (Toy.root.mouseX - x);
velocity.y = (Toy.root.mouseY - y);
x = Toy.root.mouseX;
y = Toy.root.mouseY;
if (((dragTarget) && (dragTarget.parent))){
dragTarget.x = (dragTarget.x + (((dragTarget.parent.mouseX + dragOffset.x) - dragTarget.x) / SMOOTH_DRAG_VEL));
dragTarget.y = (dragTarget.y + (((dragTarget.parent.mouseY + dragOffset.y) - dragTarget.y) / SMOOTH_DRAG_VEL));
};
if (!isCustom){
return;
};
target.x = (target.x + ((x - target.x) / SMOOTH_DRAG_VEL));
target.y = (target.y + ((y - target.y) / SMOOTH_DRAG_VEL));
Depth.toFront(target, Toy.root);
if (flipPoint){
target.scaleX = ((target.x > flipPoint.x)) ? 1 : -1;
_local1 = ((target.y - flipPoint.y) / 4);
target.rotation = ((target.x > flipPoint.x)) ? _local1 : -(_local1);
};
if (!area){
return;
};
if (hitTest(area)){
Mouse.hide();
if (!target.visible){
Tweenr.FADE_IN(target);
};
target.visible = true;
return;
};
Mouse.show();
target.visible = false;
}
public static function startDrag(_arg1:DisplayObject){
dragTarget = _arg1;
dragOffset.x = (dragTarget.x - dragTarget.parent.mouseX);
dragOffset.y = (dragTarget.y - dragTarget.parent.mouseY);
Depth.toFront(dragTarget);
hide();
}
public static function stopDrag(){
dragTarget = null;
show();
}
private static function mouseDownEvent(_arg1:MouseEvent){
isDown = true;
isUp = false;
mouseHit = 1;
dispatch(_arg1);
}
private static function mouseWheelEvent(_arg1:MouseEvent){
_wheel = _arg1.delta;
dispatch(_arg1);
}
private static function mouseUpEvent(_arg1:MouseEvent){
isDown = false;
isUp = true;
mouseHit = 0;
dispatch(_arg1);
}
private static function mouseDobleClickEvent(_arg1:MouseEvent){
_mouseDobleClick = 1;
dispatch(_arg1);
}
}
}//package toy.system
import flash.utils.*;
class Pools {
public static var mouseDown:Dictionary = new Dictionary();
public static var mouseUp:Dictionary = new Dictionary();
public static var mouseWheel:Dictionary = new Dictionary();
public static var mouseMove:Dictionary = new Dictionary();
private function Pools(){
}
}
Section 61
//Data (toy.system.Data)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Data {
public var percent:int;
public var name:String;
public var initial:int;// = 0
public var max:int;// = 0
public var min:int;// = 0
private var _value:Number;// = -1
private var _int:int;
private var crypted:String;
private var reachPool:Dictionary;
private var listeners:Dictionary;
private var _isEncrypted:Boolean;
public static var data:Dictionary = new Dictionary();
public static var temp:Dictionary = new Dictionary();
public static var k:Array;
public static var config:Array = [];
public static var userData:Object = {};
public static var vars:Dictionary = new Dictionary();
private static var pool:Dictionary = new Dictionary();
private static var item:Data;
public function Data(_arg1:String, _arg2:int=0, _arg3:Function=null, _arg4:Function=null){
reachPool = new Dictionary();
listeners = new Dictionary();
super();
this.name = _arg1;
setup(_arg2, _arg3, _arg4);
push(_arg1, this);
}
public function setup(_arg1:int=0, _arg2:Function=null, _arg3:Function=null){
this.max = _arg1;
if (_arg3 != null){
addReach(min, _arg3);
};
if (_arg2 != null){
addReach(_arg1, _arg2);
};
reset();
return (this);
}
public function addReach(_arg1:int=-1, _arg2:Function=null){
if (_arg2 == null){
return;
};
reachPool[((_arg1)!=-1) ? _arg1 : max] = _arg2;
return (this);
}
public function addListener(_arg1:Function){
listeners[_arg1] = true;
return (this);
}
public function setEncryption(_arg1:Boolean){
var _local2:* = value;
_isEncrypted = _arg1;
value = _local2;
return (this);
}
public function reset(){
value = initial;
return (this);
}
public function set value(_arg1:Number){
var _local2:*;
if (_arg1 == _value){
return (_value);
};
_value = (_int = MathUtil.constrain(_arg1, min, (max) ? max : null));
percent = (((min + _value) * 100) / max);
if (_isEncrypted){
crypted = encode(String(_value));
};
for (_local2 in listeners) {
_local2(_value);
};
checkReach();
return (_value);
}
public function get value(){
return ((_isEncrypted) ? _value = Number(decode(crypted)) : _value);
}
public function increase(_arg1:int=1){
if (!_arg1){
return;
};
_value = value;
var _local2:* = MathUtil.constrain((_value + _arg1), min, max);
while (_value < (_local2 - 1)) {
_value++;
checkReach();
};
while (_value > (_local2 + 1)) {
_value--;
checkReach();
};
_value = -1;
return ((value = _local2));
}
private function checkReach(){
if (reachPool[_int]){
var _local1 = reachPool;
_local1[_int]();
};
}
public static function retrieve(_arg1:Object, _arg2:Boolean=true){
var _local3:* = ((temp[_arg1]) || (data[_arg1]));
if (_arg2){
delete temp[_arg1];
};
return (_local3);
}
public static function store(_arg1:Object, _arg2:Object, _arg3:Boolean=true){
var _local4:Dictionary = (_arg3) ? temp : data;
_local4[_arg1] = _arg2;
return (_arg2);
}
public static function init(){
var _local1:* = String(Math.random()).substr(2, 14);
var _local2:* = String(Math.random()).substr(2, 14);
k = StringUtil.charsToLongs(StringUtil.strToChars((_local1 + _local2)));
ArrayUtil.extract(Toy.stage.loaderInfo.parameters, vars);
}
public static function loadConfig(_arg1:Object){
ArrayUtil.extract(_arg1, config);
}
public static function encode(_arg1:String):String{
var _local7:Number;
var _local8:Number;
var _local11:Number;
var _local2:Array = StringUtil.charsToLongs(StringUtil.strToChars(_arg1));
var _local3:Number = _local2.length;
if (_local3 == 0){
return ("");
};
if (_local3 == 1){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local12 = _temp1;
_local2[_local12] = 0;
};
var _local4:Number = _local2[(_local3 - 1)];
var _local5:Number = _local2[0];
var _local6:Number = 2654435769;
var _local9:Number = Math.floor((6 + (52 / _local3)));
var _local10:Number = 0;
while (_local9-- > 0) {
_local10 = (_local10 + _local6);
_local8 = ((_local10 >>> 2) & 3);
_local11 = 0;
while (_local11 < (_local3 - 1)) {
_local5 = _local2[(_local11 + 1)];
_local7 = ((((_local4 >>> 5) ^ (_local5 << 2)) + ((_local5 >>> 3) ^ (_local4 << 4))) ^ ((_local10 ^ _local5) + (k[((_local11 & 3) ^ _local8)] ^ _local4)));
_local4 = (_local2[_local11] = (_local2[_local11] + _local7));
_local11++;
};
_local5 = _local2[0];
_local7 = ((((_local4 >>> 5) ^ (_local5 << 2)) + ((_local5 >>> 3) ^ (_local4 << 4))) ^ ((_local10 ^ _local5) + (k[((_local11 & 3) ^ _local8)] ^ _local4)));
_local4 = (_local2[(_local3 - 1)] = (_local2[(_local3 - 1)] + _local7));
};
return (StringUtil.charsToHex(StringUtil.longsToChars(_local2)));
}
public static function decode(_arg1:String):String{
var _local7:Number;
var _local8:Number;
var _local11:Number;
var _local2:Array = StringUtil.charsToLongs(StringUtil.hexToChars(_arg1));
var _local3:Number = _local2.length;
if (_local3 == 0){
return ("");
};
var _local4:Number = _local2[(_local3 - 1)];
var _local5:Number = _local2[0];
var _local6:Number = 2654435769;
var _local9:Number = Math.floor((6 + (52 / _local3)));
var _local10:Number = (_local9 * _local6);
while (_local10 != 0) {
_local8 = ((_local10 >>> 2) & 3);
_local11 = (_local3 - 1);
while (_local11 > 0) {
_local4 = _local2[(_local11 - 1)];
_local7 = ((((_local4 >>> 5) ^ (_local5 << 2)) + ((_local5 >>> 3) ^ (_local4 << 4))) ^ ((_local10 ^ _local5) + (k[((_local11 & 3) ^ _local8)] ^ _local4)));
_local5 = (_local2[_local11] = (_local2[_local11] - _local7));
_local11--;
};
_local4 = _local2[(_local3 - 1)];
_local7 = ((((_local4 >>> 5) ^ (_local5 << 2)) + ((_local5 >>> 3) ^ (_local4 << 4))) ^ ((_local10 ^ _local5) + (k[((_local11 & 3) ^ _local8)] ^ _local4)));
_local5 = (_local2[0] = (_local2[0] - _local7));
_local10 = (_local10 - _local6);
};
return (StringUtil.charsToStr(StringUtil.longsToChars(_local2)));
}
public static function add(_arg1:String, _arg2:int=0, _arg3:Function=null, _arg4:Function=null){
return (new Data(_arg1, _arg2, _arg3, _arg4));
}
public static function setup(_arg1:String, _arg2:int=0, _arg3:Function=null, _arg4:Function=null){
return (getInstance(_arg1).setup(_arg2, _arg3, _arg4));
}
public static function addReach(_arg1:String, _arg2:int, _arg3:Function){
return (getInstance(_arg1).addReach(_arg2, _arg3));
}
public static function addListener(_arg1:String, _arg2:Function){
return (getInstance(_arg1).addListener(_arg2));
}
public static function reset(_arg1:String){
return (getInstance(_arg1).reset());
}
public static function set(_arg1:String, _arg2:int){
return ((getInstance(_arg1).value = _arg2));
}
public static function get(_arg1:String){
return (getInstance(_arg1).value);
}
public static function getPercent(_arg1:String){
return (getInstance(_arg1).percent);
}
public static function increase(_arg1:String, _arg2:int=1){
return (getInstance(_arg1).increase(_arg2));
}
private static function push(_arg1:String, _arg2:Data){
if (pool[_arg1]){
return;
};
pool[_arg1] = _arg2;
}
public static function getInstance(_arg1:String):Data{
return (((pool[_arg1]) || (add(_arg1))));
}
}
}//package toy.system
Section 62
//FullScreen (toy.system.FullScreen)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class FullScreen {
private static var pool:Dictionary = new Dictionary();
public static function get status(){
return ((Toy.stage.displayState = "fullScreen"));
}
public static function init(){
Toy.stage.addEventListener("fullScreen", _onChange);
}
public static function on(){
Toy.stage.displayState = "fullScreen";
}
public static function off(){
Toy.stage.displayState = "normal";
}
public static function add(_arg1:Function){
pool[_arg1] = true;
}
private static function _onChange(_arg1=null){
var _local2:*;
for (_local2 in pool) {
_local2(status);
};
}
}
}//package toy.system
Section 63
//Keyb (toy.system.Keyb)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Keyb {
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const P:uint = 80;
public static const Q:uint = 81;
public static const R:uint = 82;
public static const S:uint = 83;
public static const T:uint = 84;
public static const U:uint = 85;
public static const V:uint = 86;
public static const W:uint = 87;
public static const X:uint = 88;
public static const Y:uint = 89;
public static const Z:uint = 90;
public static const ALTERNATE:uint = 18;
public static const BACKQUOTE:uint = 192;
public static const BACKSLASH:uint = 220;
public static const BACKSPACE:uint = 8;
public static const CAPS_LOCK:uint = 20;
public static const COMMA:uint = 188;
public static const COMMAND:uint = 19;
public static const CONTROL:uint = 17;
public static const DELETE:uint = 46;
public static const DOWN:uint = 40;
public static const END:uint = 35;
public static const ENTER:uint = 13;
public static const EQUAL:uint = 187;
public static const ESCAPE:uint = 27;
public static const F1:uint = 112;
public static const F10:uint = 121;
public static const F11:uint = 122;
public static const F12:uint = 123;
public static const F13:uint = 124;
public static const F14:uint = 125;
public static const F15:uint = 126;
public static const F2:uint = 113;
public static const F3:uint = 114;
public static const F4:uint = 115;
public static const F5:uint = 116;
public static const F6:uint = 117;
public static const F7:uint = 118;
public static const F8:uint = 119;
public static const F9:uint = 120;
public static const HOME:uint = 36;
public static const INSERT:uint = 45;
public static const LEFT:uint = 37;
public static const LEFTBRACKET:uint = 219;
public static const MINUS:uint = 189;
public static const NUMBER_0:uint = 48;
public static const NUMBER_1:uint = 49;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_4:uint = 52;
public static const NUMBER_5:uint = 53;
public static const NUMBER_6:uint = 54;
public static const NUMBER_7:uint = 55;
public static const NUMBER_8:uint = 56;
public static const NUMBER_9:uint = 57;
public static const NUMPAD:uint = 21;
public static const NUMPAD_0:uint = 96;
public static const NUMPAD_1:uint = 97;
public static const NUMPAD_2:uint = 98;
public static const NUMPAD_3:uint = 99;
public static const NUMPAD_4:uint = 100;
public static const NUMPAD_5:uint = 101;
public static const NUMPAD_6:uint = 102;
public static const NUMPAD_7:uint = 103;
public static const NUMPAD_8:uint = 104;
public static const NUMPAD_9:uint = 105;
public static const NUMPAD_ADD:uint = 107;
public static const NUMPAD_DECIMAL:uint = 110;
public static const NUMPAD_DIVIDE:uint = 111;
public static const NUMPAD_ENTER:uint = 108;
public static const NUMPAD_MULTIPLY:uint = 106;
public static const NUMPAD_SUBTRACT:uint = 109;
public static const PAGE_DOWN:uint = 34;
public static const PAGE_UP:uint = 33;
public static const PERIOD:uint = 190;
public static const QUOTE:uint = 222;
public static const RIGHT:uint = 39;
public static const RIGHTBRACKET:uint = 221;
public static const SEMICOLON:uint = 186;
public static const SHIFT:uint = 16;
public static const SLASH:uint = 191;
public static const SPACE:uint = 32;
public static const TAB:uint = 9;
public static const UP:uint = 38;
public static var downs:Array = [];
public static var hits:Array = [];
public static var up:Array = [];
private static var key:Array = [];
private static var params:Array = [];
private static var keyDownPool:Dictionary = new Dictionary();
private static var keyUpPool:Dictionary = new Dictionary();
public static function init(){
Toy.stage.addEventListener("keyDown", keyDownEvent);
Toy.stage.addEventListener("keyUp", keyUpEvent);
}
public static function addKeyDown(_arg1:Function){
remove(_arg1);
keyDownPool[_arg1] = true;
}
public static function addKeyUp(_arg1:Function){
remove(_arg1);
keyUpPool[_arg1] = true;
}
public static function remove(_arg1:Function){
delete keyDownPool[_arg1];
delete keyUpPool[_arg1];
}
public static function addKeyCode(_arg1:int, _arg2:Function, _arg3=null){
key[_arg1] = _arg2;
params[_arg1] = _arg3;
}
public static function addKeyCodes(_arg1:String, _arg2:Function){
var _local4:*;
var _local5:String;
var _local6:*;
var _local3:Array = _arg1.split(",");
for (_local4 in _local3) {
_local5 = _local3[_local4];
_local6 = Keyb[_local5];
if (_local6){
addKeyCode(_local6, _arg2, _local5);
};
};
}
public static function removeKeyCode(_arg1:int){
key[_arg1] = null;
params[_arg1] = null;
}
public static function removeAllKeyCodes(){
key = [];
params = [];
}
private static function keyDownEvent(_arg1:KeyboardEvent){
var _local3:*;
var _local2:int = _arg1.keyCode;
if (!downs[_local2]){
hits[_local2] = true;
if (key[_local2]){
if (params[_local2]){
var _local4 = key;
_local4[_local2](params[_local2]);
} else {
_local4 = key;
_local4[_local2]();
};
};
};
downs[_local2] = true;
for (_local3 in keyDownPool) {
_local3();
};
hits = [];
}
private static function keyUpEvent(_arg1:KeyboardEvent){
var _local3:*;
var _local2:int = _arg1.keyCode;
downs[_local2] = false;
hits[_local2] = false;
for (_local3 in keyUpPool) {
_local3();
};
}
public static function isDown(_arg1:int):Boolean{
return (downs[_arg1]);
}
public static function isHit(_arg1:int):Boolean{
return (hits[_arg1]);
}
}
}//package toy.system
Section 64
//Load (toy.system.Load)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Load {
public var bytesLoaded:int;
public var bytesTotal:int;
public var uri:String;
public var onLoad:Function;
public var loader:URLLoader;
public var urlrequest:URLRequest;
public var reloadCounter:int;// = 0
public var type:String;
public var percent:Number;
public var callbacks:Dictionary;
public var dataFormat:String;
public var bytes;
public var data:Object;
public var byteLoader:ByteLoader;
public static const EXTENSIONS:Object = {image:"png,jpg", swf:"swf", assets:"assets", sound:"mp3", video:"flv,fl4,mpeg", xml:"xml", vars:"txt", json:"json"};
public static const DATA_FORMAT:Object = {binary:"image,swf,assets,sound,video", text:"xml,jason", variables:"vars"};
public static var pool:Dictionary = new Dictionary();
public static var pendingPool:Array = [];
public static var loadingPool:Array = [];
public static var max:uint = 4;
public static var loadBar:MovieClip;
public function Load(_arg1:String, _arg2:String=null){
loader = new URLLoader();
super();
pool[_arg1] = this;
callbacks = new Dictionary();
this.uri = _arg1;
this.type = ((_arg2) || (getFileType(_arg1)));
dataFormat = getDataFormat(this.type);
loader.dataFormat = dataFormat;
urlrequest = new URLRequest(_arg1);
pendingPool.push(this);
loader.addEventListener(Event.COMPLETE, _onData);
loader.addEventListener(ProgressEvent.PROGRESS, _onProgress);
loader.addEventListener(IOErrorEvent.IO_ERROR, _onError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _onError);
}
public function getDefinition(_arg1:String){
var clssname:*;
var name = _arg1;
if (!byteLoader){
return;
};
try {
clssname = (byteLoader.loader.contentLoaderInfo.applicationDomain.getDefinition(name) as Class);
} catch(e) {
};
return (clssname);
}
public function start(){
if (++reloadCounter > 10){
return (_onError());
};
loader.load(urlrequest);
}
public function addCallback(_arg1:Function=null){
if (_arg1 == null){
return;
};
if (data){
return (resolve(_arg1));
};
callbacks[_arg1] = true;
}
public function removeCallback(_arg1:Function=null){
if ((((_arg1 == null)) || (!(callbacks)))){
return;
};
delete callbacks[_arg1];
}
private function _onProgress(_arg1:ProgressEvent){
bytesLoaded = _arg1.bytesLoaded;
bytesTotal = _arg1.bytesTotal;
percent = ((bytesLoaded * 100) / bytesTotal);
SpriteUtil.goPercent(loadBar, percent, false);
if (!loadBar.textField){
return;
};
loadBar.textField.text = (("LOADED " + int(percent)) + "%");
}
private function _onError(_arg1:Event=null){
trace(uri, " ERROR", _arg1);
remove();
}
private function remove(){
ArrayUtil.removeItem(this, loadingPool);
Load.start();
}
private function _onData(_arg1=null){
if (!loader.data){
return (start());
};
bytes = loader.data;
var _local2 = this;
_local2[("parse" + type.toUpperCase())]();
remove();
}
private function parseIMAGE(){
byteLoader = Load.byte(bytes, _onImageParsed);
}
private function _onImageParsed(_arg1){
data = Bitmap(_arg1).bitmapData;
resolveAll();
}
private function parseSWF(){
resolveAll();
}
private function parseASSETS(){
byteLoader = Load.byte(bytes, _onAssetsParsed);
}
private function _onAssetsParsed(_arg1){
data = _arg1;
resolveAll();
}
private function parseSOUND(){
}
private function parseVIDEO(){
}
private function parseVARS(){
data = loader.data;
resolveAll();
}
private function parseXML(){
data = XMLCodec.dec(loader.data);
resolveAll();
}
private function parseJSON(){
data = JSON.decode(loader.data);
resolveAll();
}
private function resolve(_arg1:Function){
if (type == "swf"){
return (Load.byte(bytes, _arg1));
};
_arg1(data);
}
private function resolveAll(){
var _local1:*;
for (_local1 in callbacks) {
_local1(data);
};
}
public static function image(_arg1:String=null, _arg2:Function=null){
if (!_arg1){
return;
};
load(_arg1, "image", _arg2);
}
public static function sound(_arg1:String, _arg2:Function=null){
load(_arg1, "sound", _arg2);
}
public static function video(_arg1:String, _arg2:Function=null){
load(_arg1, "video", _arg2);
}
public static function swf(_arg1:String, _arg2:Function=null){
load(_arg1, "swf", _arg2);
}
public static function assets(_arg1:String, _arg2:Function=null){
load(_arg1, "assets", _arg2);
}
public static function vars(_arg1:String, _arg2:Function=null){
load(_arg1, "vars", _arg2);
}
public static function xml(_arg1:String, _arg2:Function=null){
load(_arg1, "xml", _arg2);
}
public static function json(_arg1:String, _arg2:Function=null){
load(_arg1, "json", _arg2);
}
public static function byte(_arg1:ByteArray, _arg2:Function){
return (new ByteLoader(_arg1, _arg2));
}
public static function bulk(_arg1:String){
var _local3:*;
var _local2:Array = _arg1.split(",");
for (_local3 in _local2) {
load(_local2[_local3]);
};
}
public static function scanURIs(_arg1:Object){
}
public static function load(_arg1:String, _arg2:String=null, _arg3:Function=null){
var _local4:Load = ((pool[_arg1]) || (new Load(_arg1, _arg2)));
_local4.addCallback(_arg3);
start();
}
public static function removeCallback(_arg1:Function=null){
var _local2:*;
for (_local2 in pool) {
pool[_local2].removeCallback(_arg1);
};
}
public static function getDefinition(_arg1:String, _arg2:String=null){
var _local3:Load = pool[_arg2];
return ((_local3) ? _local3.getDefinition(_arg1) : null);
}
public static function getFileType(_arg1:String){
var _local3:*;
var _local2:* = StringUtil.getFileExtension(_arg1);
for (_local3 in EXTENSIONS) {
if (StringUtil.contains(EXTENSIONS[_local3], _local2)){
return (_local3);
};
};
trace(_local2, "ERROR NOT FOUND");
}
public static function getDataFormat(_arg1:String){
var _local2:*;
for (_local2 in DATA_FORMAT) {
if (StringUtil.contains(DATA_FORMAT[_local2], _arg1)){
return (_local2);
};
};
return ("text");
}
public static function start(){
var _local1:Load;
if (loadingPool.length >= max){
return;
};
while ((((loadingPool.length < max)) && (pendingPool.length))) {
_local1 = pendingPool.shift();
loadingPool.push(_local1);
_local1.start();
};
}
}
}//package toy.system
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class ByteLoader {
public var loader:Loader;
public var onComplete:Function;
private function ByteLoader(_arg1:ByteArray, _arg2:Function){
loader = new Loader();
super();
this.onComplete = _arg2;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, _onComplete);
loader.loadBytes(_arg1);
}
public function _onComplete(_arg1=null){
onComplete(loader.content);
}
}
Section 65
//Motor (toy.system.Motor)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Motor {
public var repeat:int;
public var bucle:int;
public var interval:int;
public var onFinish:Function;
public var onUpdate:Function;
public var playing:Boolean;
public var onFinishParams:Object;
public var selfControlled:Boolean;
public var id:int;
public static var CPU_NORMAL:int = 0;
public static var CPU_CRUNCH:int = 1;
public static var MODE_TIMER:int = 0;
public static var MODE_FRAME:int = 1;
public static var cpu:int;
public static var mode:int;
public static var updateFPS:int;
public static var renderFPS:int;
private static var timerFPS:Number = 1;
private static var mc:MovieClip = new MovieClip();
private static var timer:Timer = new Timer(1000);
private static var updatePool:Dictionary = new Dictionary();
private static var renderPool:Dictionary = new Dictionary();
private static var timePool:Dictionary = new Dictionary();
private static var clipPool:Dictionary = new Dictionary();
private static var initialTimer:int;
private static var currentSeconds:int;
private static var totalSeconds:int;
private static var before:int = 0;
private static var after:int = 0;
private static var sleep:int = 0;
private static var overSleep:int = 0;
private static var excess:int = 0;
public function Motor(_arg1:Boolean=false){
this.selfControlled = _arg1;
}
public function start(_arg1:Function=null, _arg2=-1, _arg3:int=0, _arg4:Function=null, _arg5:Object=null){
this.onUpdate = _arg1;
this.repeat = _arg2;
this.interval = _arg3;
this.bucle = _arg3;
this.onFinish = _arg4;
this.onFinishParams = _arg5;
playing = true;
if (selfControlled){
Motor.add(update);
};
}
public function delay(_arg1, _arg2=100, _arg3=null){
start(null, 1, _arg2, _arg1, _arg3);
}
public function update(){
if (!playing){
return;
};
if (interval){
if (--bucle > 0){
return;
};
};
if (onUpdate != null){
onUpdate();
};
if (((interval) && ((bucle > 0)))){
return;
};
bucle = interval;
if ((((repeat == -1)) || ((--repeat > 0)))){
return;
};
stop();
if (onFinish != null){
if (onFinishParams){
onFinish(onFinishParams);
} else {
onFinish();
};
};
}
public function stop(){
playing = false;
Motor.remove(update);
}
public function play(){
playing = true;
if (selfControlled){
Motor.add(update);
};
}
public static function init(_arg1:int=33, _arg2:int=33, _arg3:int=1, _arg4:int=0){
Motor.updateFPS = _arg1;
Motor.renderFPS = _arg2;
Motor.mode = _arg3;
Motor.cpu = _arg4;
Motor.timerFPS = (1000 / _arg1);
Motor.initialTimer = getTimer();
Toy.stage.frameRate = _arg2;
timer.delay = timerFPS;
timer.stop();
timer.removeEventListener("timer", onEvent);
mc.removeEventListener("enterFrame", onEvent);
if (_arg3 == MODE_FRAME){
return (mc.addEventListener("enterFrame", onEvent));
};
timer.addEventListener("timer", onEvent);
timer.start();
}
public static function add(_arg1:Function){
remove(_arg1);
updatePool[_arg1] = true;
}
public static function addRender(_arg1:Function){
remove(_arg1);
renderPool[_arg1] = true;
}
public static function addTime(_arg1:Function){
remove(_arg1);
timePool[_arg1] = true;
}
public static function addClip(_arg1){
remove(_arg1);
clipPool[_arg1] = true;
}
public static function remove(_arg1:Object){
delete timePool[_arg1];
delete updatePool[_arg1];
delete renderPool[_arg1];
delete clipPool[_arg1];
}
private static function onEvent(_arg1=null){
before = getTimer();
update();
render();
}
private static function update(_arg1:Event=null){
var _local2:*;
var _local3:*;
var _local4:*;
for (_local2 in clipPool) {
_local2.update();
};
for (_local3 in updatePool) {
_local3();
};
totalSeconds = ((getTimer() - initialTimer) / 1000);
while (currentSeconds < totalSeconds) {
currentSeconds++;
for (_local4 in timePool) {
_local4();
};
};
}
private static function render(_arg1:Event=null){
var _local2:*;
var _local3:*;
for (_local2 in clipPool) {
_local2.render();
};
for (_local3 in renderPool) {
_local3();
};
}
}
}//package toy.system
Section 66
//Quality (toy.system.Quality)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Quality {
public static const RENDER:String = "HIGH";
public static const GAME:String = "LOW";
public static const INTERFACE_FPS:int = 33;
public static const GAME_FPS:int = 100;
public static function high(){
Toy.stage.quality = "HIGH";
}
public static function low(){
Toy.stage.quality = "LOW";
}
public static function medium(){
Toy.stage.quality = "MEDIUM";
}
public static function render(){
Toy.stage.quality = RENDER;
}
public static function game(){
Toy.stage.quality = GAME;
}
}
}//package toy.system
Section 67
//Score (toy.system.Score)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Score {
private static var combo:Array = [];
public static function reset(){
Data.set("totalscore", 0);
resetLevel();
}
public static function resetLevel(){
Data.set("levelscore", 0);
resetCombo();
resetMultiplier();
}
public static function increase(_arg1:int=1){
Data.increase("levelscore", (_arg1 * multiplier));
Data.increase("totalscore", (_arg1 * multiplier));
if (Data.get("totalscore") > Data.get("maxscore")){
Data.set("maxscore", Data.get("totalscore"));
};
}
public static function get totalscore():int{
return (Data.get("totalscore"));
}
public static function get levelscore():int{
return (Data.get("levelscore"));
}
public static function get multiplier():int{
return (Data.get("scoremultiplier"));
}
public static function increaseMultiplier(_arg1:int=1):int{
return (Data.increase("scoremultiplier", _arg1));
}
public static function resetMultiplier():int{
return (Data.set("scoremultiplier", 1));
}
public static function add(_arg1:Number=0){
var _local2:Data = new Data(("combo" + combo.lenght));
_local2.value = _arg1;
combo.push(_local2);
}
public static function cash(){
var _local1:*;
for (_local1 in combo) {
increase(Data(combo[_local1]).value);
};
resetCombo();
}
public static function resetCombo(){
combo = [];
}
}
}//package toy.system
Section 68
//Screen (toy.system.Screen)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Screen extends Clip {
public var isDialog:Boolean;
public var screenLayer:ScreenLayer;
public var name:String;
public var canvas:Canvas;
public var anim:TimelineClip;
public var buttons:Array;
public var button_booleans:Array;
public var voiceOver:MovieClip;
public var motor:Motor;
public var music:Sounds;
public var musicName:String;
public static const CUT:uint = 0;
public static const FADE_IN:uint = 1;
public static const FADE_OUT:uint = 2;
public static const PAN_LEFT:uint = 3;
public static const PAN_RIGHT:uint = 4;
public static const PAN_UP:uint = 5;
public static const PAN_DOWN:uint = 6;
public static const FLIP_LEFT:uint = 7;
public static const FLIP_RIGHT:uint = 8;
public static const FLIP_UP:uint = 9;
public static const FLIP_DOWN:uint = 10;
public static const ZOOM_IN:uint = 11;
public static const ZOOM_OUT:uint = 12;
public static const ROTATE_Y:uint = 13;
public static const ROTATE_X:uint = 14;
public static var TRANSITION_TIME:Number = 0.6;
public static var assets:MovieClip;
public static var layers:Dictionary;
public static var left:Number;
public static var right:Number;
public static var top:Number;
public static var bottom:Number;
public static var width:Number;
public static var height:Number;
public static var center:Point = new Point();
public static var container:Sprite = new Sprite();
public static var pool:Dictionary = new Dictionary();
public static var url:Dictionary = new Dictionary();
public static var resizePool:Dictionary = new Dictionary();
public static var screenSound:String;
public static var onAssets:Function = function (){
};
public static var mouseDown:Function = function (_arg1:Screen, _arg2:Button){
};
public static var mouseOver:Function = function (_arg1:Screen, _arg2:Button){
};
public static var mouseOut:Function = function (_arg1:Screen, _arg2:Button){
};
public function Screen(_arg1:MovieClip, _arg2:String=null){
motor = new Motor(true);
super();
this.target = _arg1;
this.sprite = new Sprite();
name = ((_arg2) || (_arg1.name));
if (name.indexOf("instance") == -1){
setName(name);
};
}
public function setName(_arg1:String){
this.name = _arg1;
screenLayer = ScreenLayer.getLayer(_arg1);
buttons = Button.scan(target, _mouseDown, {mouseOver:_mouseOver, mouseOut:_mouseOut});
button_booleans = Button_Boolean.scan(target, this);
Align.selfCenter(target, sprite);
Displayer.scan(target);
Screen.pool[_arg1] = this;
Message.scan(target);
Dust.scan(target);
isDialog = StringUtil.getPrefix(_arg1);
if (target.anim){
Button.scan(target.anim, _mouseDown, {mouseOver:_mouseOver, mouseOut:_mouseOut});
anim = new TimelineClip(target.anim, true);
};
voiceOver = target.voiceOver;
if (voiceOver){
voiceOver.gotoAndStop(1);
};
hide();
target.mouseEnabled = false;
if (target.area){
SpriteUtil.allowMouse(target.area, false);
};
}
override public function init(){
SpriteUtil.scan_text(target, Data.config.text);
if (target.language){
target.language.gotoAndStop(Data.data.language);
};
}
override public function _mouseDown(_arg1=null){
Screen._mouseDown(this, _arg1);
}
override public function _mouseOver(_arg1=null){
Screen._mouseOver(this, _arg1);
}
override public function _mouseOut(_arg1=null){
Screen._mouseOut(this, _arg1);
}
override public function show(){
sprite.visible = true;
if (anim){
anim.gotoLabel("in", 1);
};
if (voiceOver){
voiceOver.gotoAndPlay("start");
};
play();
}
override public function hide(){
motor.stop();
sprite.visible = false;
if (anim){
anim.gotoAndStop(0);
};
if (voiceOver){
voiceOver.gotoAndStop(1);
};
if (music){
music.stop();
};
}
public static function init(){
Toy.stage.scaleMode = StageScaleMode.NO_SCALE;
Toy.stage.addEventListener(Event.RESIZE, resize);
Toy.root.addChild(container);
container.mouseEnabled = false;
new ScreenLayer("Background");
new ScreenLayer("Screen");
new ScreenLayer("Cover");
new ScreenLayer("Dialog");
new ScreenLayer("Navigation");
new ScreenLayer("Popup");
new ScreenLayer("HUD");
}
public static function layerToFront(_arg1:String){
ScreenLayer.toFront(_arg1);
}
public static function addResize(_arg1:Function){
resizePool[_arg1] = true;
}
public static function removeResize(_arg1:Function){
delete resizePool[_arg1];
}
public static function resize(_arg1=null){
var _local2:*;
width = 640;
height = 426;
center.x = (width / 2);
center.y = (height / 2);
container.x = (width / 2);
container.y = (height / 2);
top = 0;
left = 0;
bottom = height;
right = width;
ScreenLayer.resize(width, height);
for (_local2 in resizePool) {
_local2();
};
}
public static function scan(_arg1:MovieClip){
var _local3:*;
Toy.stage.align = StageAlign.TOP_LEFT;
assets = _arg1;
var _local2:* = Depth.getMovieClipsNames(_arg1);
for (_local3 in _local2) {
((Utils.attach(_local3, _local2[_local3])) || (new Screen(_local2[_local3])));
};
resize();
onAssets();
}
public static function getInstance(_arg1:String):Screen{
return (pool[_arg1]);
}
public static function load(_arg1:String, _arg2:String, _arg3:uint=0){
ScreenLoader.show(_arg1, _arg2, _arg3);
}
public static function show(_arg1:String, _arg2:uint=0){
var _local3:Screen = pool[_arg1];
if (!_local3){
return;
};
var _local4:ScreenLayer = _local3.screenLayer;
_local4.show(_local3, _arg2);
resize();
if (screenSound){
Sounds.start(screenSound);
};
return (_local3);
}
public static function hide(_arg1:String, _arg2:uint=1){
var _local3:Screen = pool[_arg1];
if (!_local3){
return;
};
var _local4:ScreenLayer = _local3.screenLayer;
_local4.hide(_local3, _arg2);
return (_local3);
}
public static function hideAll(_arg1:String=null){
var _local2:*;
var _local3:ScreenLayer;
for (_local2 in layers) {
_local3 = layers[_local2];
if (((_arg1) && (!((_arg1.indexOf(_local3.name) == -1))))){
} else {
if (_local3.current){
hide(_local3.current.name);
};
};
};
}
private static function _mouseDown(_arg1:Screen, _arg2:Button){
show(_arg2.name);
mouseDown(_arg1, _arg2);
}
private static function _mouseOver(_arg1:Screen, _arg2:Button){
mouseOver(_arg1, _arg2);
}
private static function _mouseOut(_arg1:Screen, _arg2:Button){
mouseOut(_arg1, _arg2);
}
}
}//package toy.system
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class ScreenLayer extends Sprite {
public var current:Screen;
public var last:Screen;
public static var pool:Dictionary = new Dictionary();
private function ScreenLayer(_arg1:String){
this.name = _arg1;
this.mouseEnabled = false;
pool[_arg1] = this;
Screen.layers = pool;
Screen.container.addChild(this);
}
public function show(_arg1:Screen, _arg2:int=0){
if (current == _arg1){
return;
};
last = current;
current = _arg1;
current.sprite.visible = true;
current.init();
addChild(current.sprite);
doTransition(_arg2);
}
public function hide(_arg1:Screen, _arg2:int=0){
if (!current){
return;
};
last = current;
current = null;
doTransition(_arg2);
}
private function doTransition(_arg1:uint=0){
var _local2:TransitionParams = new TransitionParams(last, true);
var _local3:TransitionParams = new TransitionParams(current, false);
if (_arg1 == Screen.CUT){
_local2.onFinish();
_local3.onFinish();
return;
};
Toy.block();
if (_arg1 == Screen.FADE_IN){
_local2.from.alpha = 1;
_local2.to.alpha = 0;
_local3.from.alpha = 0;
_local3.to.alpha = 1;
};
if (_arg1 == Screen.FADE_OUT){
_local2.from.alpha = 1;
_local2.to.alpha = 0;
_local3.from.alpha = 0;
_local3.to.alpha = 1;
};
if (_arg1 == Screen.PAN_UP){
_local2.to.y = -(Screen.height);
_local3.from.y = Screen.height;
};
if (_arg1 == Screen.PAN_DOWN){
_local2.to.y = Screen.height;
_local3.from.y = -(Screen.height);
};
if (_arg1 == Screen.PAN_LEFT){
_local2.to.x = -(Screen.width);
_local3.from.x = Screen.width;
};
if (_arg1 == Screen.PAN_RIGHT){
_local2.to.x = Screen.width;
_local3.from.x = -(Screen.width);
};
if (_arg1 == Screen.FLIP_UP){
_local2.to.y = -(Screen.height);
_local3.from.y = Screen.height;
_local3.from.rotationX = -180;
_local2.to.rotationX = 180;
};
if (_arg1 == Screen.FLIP_DOWN){
_local2.to.y = Screen.height;
_local3.from.y = -(Screen.height);
_local3.from.rotationX = 180;
_local2.to.rotationX = -180;
};
if (_arg1 == Screen.FLIP_LEFT){
_local2.to.x = (-(Screen.width) * 0.6);
_local3.from.x = (Screen.width * 0.6);
_local2.to.bezierThrough = [{z:1000}];
_local3.from.rotationY = 180;
_local2.to.rotationY = -180;
_local2.to.alpha = 0;
};
if (_arg1 == Screen.FLIP_RIGHT){
_local2.to.x = (Screen.width * 0.6);
_local3.from.x = (-(Screen.width) * 0.6);
_local2.to.bezierThrough = [{z:1000}];
_local3.from.rotationY = -180;
_local2.to.rotationY = 180;
_local2.to.alpha = 0;
};
if (_arg1 == Screen.ZOOM_IN){
_local2.to.scaleX = 1.5;
_local2.to.scaleY = 1.5;
_local2.to.alpha = 0;
_local3.from.scaleX = 0.5;
_local3.from.scaleY = 0.5;
_local3.from.alpha = 0;
};
if (_arg1 == Screen.ZOOM_OUT){
_local3.from.scaleX = 1.5;
_local3.from.scaleY = 1.5;
_local3.from.alpha = 0;
_local2.to.scaleX = 0.5;
_local2.to.scaleY = 0.5;
_local2.to.alpha = 0;
};
if (_arg1 == Screen.ROTATE_X){
_local2.to.rotationX = 90;
_local3.from.rotationX = -90;
_local3.to.delay = 0.3;
_local3.time = (_local3.time * 0.5);
_local2.time = (_local2.time * 0.5);
};
if (_arg1 == Screen.ROTATE_Y){
_local2.to.rotationY = 90;
_local3.from.rotationY = -90;
_local3.to.delay = 0.3;
_local3.time = (_local3.time * 0.5);
_local2.time = (_local2.time * 0.5);
};
_local2.start();
_local3.start();
}
public static function toFront(_arg1:String){
var _local2:ScreenLayer = pool[_arg1];
if (_local2){
Depth.toFront(_local2);
};
}
public static function resize(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Screen;
for (_local3 in pool) {
_local4 = pool[_local3].current;
if (!_local4){
} else {
_local4.resize(_arg1, _arg2);
};
};
}
public static function getLayer(_arg1:String){
var _local2:* = StringUtil.getPrefix(_arg1);
return (((pool[_local2]) || (new ScreenLayer(_local2))));
}
}
class TransitionParams {
public var from:Object;
public var to:Object;
public var screen:Screen;
public var isOut:Boolean;
public var sprite;
public var time:Number;
private static var _initParams:Object = {x:0, y:0, rotation:0, scaleX:1, scaleY:1, alpha:1};
private static var _initParams3D:Object = {x:0, y:0, z:0, rotationX:0, rotationY:0, rotationZ:0, scaleX:1, scaleY:1, alpha:1};
private function TransitionParams(_arg1:Screen=null, _arg2:Boolean=false){
from = {};
to = {};
super();
this.screen = _arg1;
this.isOut = _arg2;
if (!screen){
return;
};
sprite = screen.sprite;
from = ArrayUtil.extract(_initParams, {});
to = ArrayUtil.extract(_initParams, {});
to.ease = Easing.easeInOutCirc;
time = Screen.TRANSITION_TIME;
}
public function start(){
if (!screen){
return;
};
sprite.alpha = 1;
sprite.filters = [new BlurFilter(0, 0, 0)];
sprite.cacheAsBitmap = true;
ArrayUtil.extract(from, sprite);
Tweenr.to(sprite, time, to, onFinish);
}
public function onFinish(){
Toy.unblock();
if (!screen){
return;
};
ArrayUtil.extract(_initParams, sprite);
sprite.filters = [];
sprite.cacheAsBitmap = false;
if (!isOut){
return (screen.show());
};
screen.hide();
Depth.removeChild(sprite);
}
}
class ScreenLoader {
public var url:String;
public var name:String;
public var transition:int;
private static var loaders:Dictionary = new Dictionary();
private static var screens:Dictionary = new Dictionary();
private static var pending:int;
private function ScreenLoader(_arg1:String, _arg2:String, _arg3:int){
this.url = _arg1;
this.name = _arg2;
this.transition = _arg3;
loaders[_arg1] = this;
pending++;
Screen.show("Popup_Loader", Screen.FADE_IN);
Load.assets(_arg1, _onSWF);
}
private function _onSWF(_arg1:MovieClip){
if (!--pending){
Screen.hide("Popup_Loader");
};
var _local2:* = Depth.getChilds(_arg1);
screens[url] = ((Utils.attach(name, _arg1)) || (new Screen(_arg1)));
screens[url].setName(name);
Screen.resize();
Screen.show(name, transition);
}
public static function show(_arg1:String, _arg2:String, _arg3:int){
if (screens[_arg1]){
return (Screen.show(_arg2, _arg3));
};
if (loaders[_arg1]){
return;
};
new ScreenLoader(_arg1, _arg2, _arg3);
}
}
Section 69
//Sounds (toy.system.Sounds)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Sounds {
public var onFinish:Function;
public var onStream:Function;
public var percent:Number;// = 0
private var uri:String;
private var sound:Sound;
private var soundChannel:SoundChannel;
private var soundTransform:SoundTransform;
private var offset:uint;// = 0
private var loops:uint;
private var isStreaming:Boolean;
private var _volume:Number;// = 1
private var _pan:Number;// = 0
public var isPlaying:Boolean;
public var group:SoundsGroup;
public var positionTextField:TextField;
public var durationTextField:TextField;
public static var volume:Number = 1;
public static var pan:Number = 0;
private static var isMute:Boolean = false;
private static var soundTransform:SoundTransform = new SoundTransform(1, 0);
private static var pool:Dictionary = new Dictionary();
public static var music:SoundsGroup;
public static var fx:SoundsGroup;
public function Sounds(_arg1:String){
onStream = function (){
};
soundChannel = new SoundChannel();
soundTransform = new SoundTransform();
super();
this.uri = _arg1;
pool[_arg1] = this;
sound = ((Utils.attach(_arg1)) || (new Sound(new URLRequest(_arg1), new SoundLoaderContext(1000))));
}
public function play(){
if (isPlaying){
return;
};
isPlaying = true;
isStreaming = false;
soundChannel = sound.play(offset, loops);
soundChannel.soundTransform = soundTransform;
soundChannel.addEventListener(Event.SOUND_COMPLETE, _onFinish);
Motor.add(update);
return (this);
}
public function pause(){
if (!isPlaying){
return;
};
isPlaying = false;
if (soundChannel){
soundChannel.stop();
};
Motor.remove(update);
return (this);
}
public function start(_arg1:int=0, _arg2:Function=null){
this.loops = _arg1;
this.onFinish = _arg2;
group = SoundsGroup.addFX(this);
stop();
play();
return (this);
}
public function stop(){
position = 0;
percent = 0;
soundChannel.stop();
pause();
return (this);
}
public function loop(_arg1:int=999999){
start(_arg1);
group = SoundsGroup.addMusic(this);
return (this);
}
public function goto(_arg1:Number){
if (!soundChannel){
return;
};
this.percent = MathUtil.constrain(_arg1, 0, 100);
position = ((this.percent * duration) / 100);
pause();
play();
}
private function update(){
if (!soundChannel){
return;
};
soundTransform.volume = (_volume * group.volume);
soundTransform.pan = _pan;
soundChannel.soundTransform = soundTransform;
offset = position;
percent = ((offset * 100) / duration);
if (((!(isStreaming)) && ((position > 0)))){
_onStream();
};
}
private function _onStream(){
isStreaming = true;
onStream();
}
private function _onFinish(_arg1=null){
stop();
if (onFinish != null){
onFinish();
};
}
public function set volume(_arg1:Number){
_volume = _arg1;
}
public function get volume(){
return (_volume);
}
public function set pan(_arg1:Number){
_pan = _arg1;
}
public function get pan(){
return (_pan);
}
public function get position(){
return (soundChannel.position);
}
public function set position(_arg1:int){
return ((offset = _arg1));
}
public function get duration(){
return (sound.length);
}
public function get durationText(){
var _local1:* = StringUtil.seconds2Minutes((duration / 1000), true);
if (durationTextField){
durationTextField.text = _local1;
};
return (_local1);
}
public function get positionText(){
var _local1:* = StringUtil.seconds2Minutes((offset / 1000), true);
if (positionTextField){
positionTextField.text = _local1;
};
return (_local1);
}
public function get timeText(){
return (((positionText + " / ") + durationText));
}
public function get percentLoaded(){
return ((soundChannel) ? ((sound.bytesLoaded * 100) / sound.bytesTotal) : 0);
}
public static function init(){
SoundsGroup.init();
music = SoundsGroup.music;
fx = SoundsGroup.fx;
Motor.add(update);
}
public static function off(){
isMute = true;
}
public static function on(){
isMute = false;
}
public static function start(_arg1:String, _arg2:Function=null):Sounds{
var _local3:Sounds = getSound(_arg1);
if (isMute){
return (_local3);
};
_local3.start(0, _arg2);
return (_local3);
}
public static function stop(_arg1:String=null){
var _local2:*;
if (_arg1){
return (getSound(_arg1).stop());
};
for (_local2 in pool) {
pool[_local2].stop();
};
}
public static function loop(_arg1:String):Sounds{
var _local2:Sounds = getSound(_arg1);
if (isMute){
return (_local2);
};
_local2.loop();
return (_local2);
}
public static function getSound(_arg1:String):Sounds{
return (((pool[_arg1]) || (new Sounds(_arg1))));
}
private static function update(){
soundTransform.pan = pan;
soundTransform.volume = (isMute) ? 0 : volume;
SoundMixer.soundTransform = soundTransform;
}
}
}//package toy.system
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
class SoundsGroup extends Dictionary {
public var volume:Number;// = 1
public var name:String;
public var pool:Dictionary;
public static var groups:Object = {};
public static var music:SoundsGroup;
public static var fx:SoundsGroup;
private function SoundsGroup(_arg1:String){
pool = new Dictionary();
super();
this.name = _arg1;
groups[_arg1] = this;
}
public function add(_arg1:Sounds){
SoundsGroup.remove(_arg1);
pool[_arg1] = true;
}
public function remove(_arg1){
delete pool[_arg1];
}
public static function init(){
music = new SoundsGroup("music");
fx = new SoundsGroup("fx");
}
public static function remove(_arg1:Sounds){
var _local2:*;
for (_local2 in groups) {
groups[_local2].remove(_arg1);
};
}
public static function addMusic(_arg1:Sounds){
music.add(_arg1);
return (music);
}
public static function addFX(_arg1:Sounds){
fx.add(_arg1);
return (fx);
}
public static function getInstance(_arg1:String):SoundsGroup{
return (groups[_arg1]);
}
public static function addToChannel(_arg1:Sounds, _arg2:String){
remove(_arg1);
var _local3:SoundsGroup = getInstance(_arg2);
_local3.add(_arg1);
}
}
Section 70
//Time (toy.system.Time)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Time {
public var initialSeconds:int;
public var name:String;
public var onTimeOut:Function;
public var onUpdate:Function;
public var seconds:int;
private var data:Data;
public var isMute:Boolean;// = true
public static var count:uint = 0;
public function Time(_arg1:int=120, _arg2:Function=null, _arg3:String=null){
onTimeOut = function (){
};
onUpdate = function (){
};
super();
this.onTimeOut = ((_arg2) || (this.onTimeOut));
this.name = ((_arg3) || (("time_" + ++count)));
initialSeconds = _arg1;
data = Data.getInstance(this.name);
data.max = 0;
data.addReach(0, _onTimeOut);
}
public function set max(_arg1:int){
data.max = _arg1;
initialSeconds = _arg1;
}
public function start(){
reset();
play();
}
public function play(){
Motor.addTime(update);
}
public function stop(){
pause();
}
public function pause(){
Motor.remove(update);
}
public function reset(){
stop();
seconds = (data.value = initialSeconds);
}
public function increase(_arg1:int){
seconds = data.increase(_arg1);
play();
}
public function update(){
seconds = data.increase(-1);
onUpdate();
if ((((seconds < 10)) && (!(isMute)))){
Sounds.start("Sound_Time");
};
}
private function _onTimeOut(){
stop();
if (onTimeOut != null){
onTimeOut();
};
}
public function get formatted(){
return (StringUtil.seconds2Minutes(seconds));
}
}
}//package toy.system
Section 71
//Tweenr (toy.system.Tweenr)
package toy.system {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import toy.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public class Tweenr {
public var from:Object;
public var to:Object;
public var target:Object;
public var duration:Number;
public var onComplete:Function;
public var _target:Object;
public var isRender:Boolean;
private static var tween:Tweenr;
public static var pool:Dictionary = new Dictionary();
public function Tweenr(_arg1:Object){
_target = {};
super();
this.target = _arg1;
pool[_arg1] = this;
}
public function reset(_arg1:Number=1, _arg2:Function=null){
this.duration = _arg1;
this.onComplete = _arg2;
from = {};
to = {};
_target = (isRender) ? {} : target;
to.ease = Easing.easeInOutCirc;
to.bezierThrough = [];
to.onComplete = _onComplete;
}
public function bezier(_arg1:Object, _arg2:Number=1){
to.bezierThrough.push(_arg1);
}
public function start():Tweenr{
if ((target is DisplayObject)){
target.visible = true;
};
ArrayUtil.extract(from, _target);
TweenLite.killTweensOf(_target);
new TweenMax(_target, duration, to);
if (isRender){
Motor.addRender(render);
};
return (this);
}
public function update(){
}
public function render(){
ArrayUtil.extract(_target, target);
}
public function _onComplete(_arg1=null){
if (isRender){
render();
Motor.remove(render);
};
if (onComplete != null){
if (_arg1){
onComplete(_arg1);
} else {
onComplete();
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg4);
ArrayUtil.extract(_arg3, tween.to);
return (tween.start());
}
public static function FADE_IN(_arg1:Object, _arg2:Number=0.5, _arg3:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.from.alpha = 0;
tween.to.alpha = 1;
tween.to.ease = Easing.easeOut;
return (tween.start());
}
public static function FADE_OUT(_arg1:Object, _arg2:Number=0.5, _arg3:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.to.alpha = -0.1;
tween.to.visible = false;
return (tween.start());
}
public static function FLICKER(_arg1:Object, _arg2:Number=2, _arg3:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.to.alpha = 1;
var _local4:int;
while (_local4 < (_arg2 / 0.2)) {
tween.bezier({alpha:0});
tween.bezier({alpha:1});
_local4++;
};
return (tween.start());
}
public static function FLICKER_OUT(_arg1:Object, _arg2:Number=4, _arg3:Function=null, _arg4:Number=0):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.to.alpha = _arg4;
var _local5:int;
while (_local5 < (_arg2 / 0.2)) {
tween.bezier({alpha:0});
tween.bezier({alpha:1});
_local5++;
};
return (tween.start());
}
public static function FLICKER_SHAKE(_arg1:Object, _arg2:Number=1, _arg3:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.from.rotation = 0;
tween.from.alpha = 0;
tween.from.y = (_arg1.y - Random.range(60, 10));
tween.to.alpha = 1;
tween.to.rotation = 0;
tween.to.y = _arg1.y;
tween.to.ease = Easing.easeOutBounce;
var _local4:int;
while (_local4 < (_arg2 / 0.2)) {
tween.bezier({rotation:-1});
tween.bezier({rotation:1});
_local4++;
};
return (tween.start());
}
public static function PICK_UP(_arg1:Object, _arg2:Number=3, _arg3:Function=null):Tweenr{
tween = getInstance(_arg1, _arg2, _arg3);
tween.from.scaleX = 0.5;
tween.from.scaleY = 0.5;
tween.to.alpha = 1;
tween.to.scaleX = 1;
tween.to.scaleY = 1;
tween.to.y = (_arg1.y - 100);
tween.to.visible = false;
tween.to.ease = Easing.easeOutCirc;
tween.bezier({rotationY:360});
tween.bezier({rotationY:0});
return (tween.start());
}
public static function FADE_UP(_arg1:Object, _arg2:Number=2, _arg3:Function=null){
tween = getInstance(_arg1, _arg2, _arg3);
tween.from.alpha = 0;
tween.to.alpha = 0;
tween.to.y = (_arg1.y - 100);
tween.to.ease = Easing.easeInOut;
tween.bezier({alpha:1});
return (tween.start());
}
private static function getInstance(_arg1:Object, _arg2:Number=1, _arg3:Function=null):Tweenr{
var _local4:Tweenr = ((pool[_arg1]) || (new Tweenr(_arg1)));
_local4.reset(_arg2, _arg3);
return (_local4);
}
}
}//package toy.system
Section 72
//Toy (toy.Toy)
package toy {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import toy.system.*;
import flash.geom.*;
import toy.system.math.*;
import toy.canvas.*;
import toy.gui.button.*;
import toy.gui.*;
import toy.com.adobe.serialization.json.*;
import toy.com.tweenlite.*;
import flash.filters.*;
import flash.net.*;
import toy.system.util.encoder.*;
import toy.system.util.*;
import toy.system.connect.*;
import project.*;
import flash.text.*;
import flash.media.*;
import toy.com.google.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Toy extends MovieClip {
public var target:MovieClip;
public static var root:MovieClip;
public static var stage:Stage;
public static var externalAssets:String;
public static var externalConfig:String;
public static var internalConfig:Boolean = false;
public function Toy(){
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onPreload);
}
private function onPreload(_arg1:ProgressEvent){
if (((!(_arg1.bytesTotal)) || (!((_arg1.bytesLoaded == _arg1.bytesTotal))))){
return;
};
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onPreload);
getStage();
}
private function getStage(){
if (onStageLoaded()){
return;
};
this.addEventListener("enterFrame", onStageLoaded);
onStageLoaded();
}
private function onStageLoaded(_arg1=null){
if (!this.stage){
return (false);
};
this.removeEventListener("enterFrame", onStageLoaded);
_init();
return (true);
}
private function _init(){
target = this;
Toy.stage = this.stage;
Toy.root = this;
FullScreen.init();
Motor.init();
Benchmark.init();
Keyb.init();
Cursor.init();
Data.init();
Sounds.init();
SWFAddress.init();
Quality.high();
Screen.init();
Security.allowDomain("*");
if (internalConfig){
return (getConfigFromStage());
};
if (externalConfig){
return (Load.xml(externalConfig, onConfig));
};
if (externalAssets){
return (Load.assets(externalAssets, onAssets));
};
init();
}
public function getConfigFromStage(){
onConfig(XMLCodec.toObject(target.config.text));
Depth.removeChild(target.config);
}
public function onConfig(_arg1){
Data.loadConfig(_arg1);
if (externalAssets){
return (Load.assets(externalAssets, onAssets));
};
init();
}
public function onAssets(_arg1){
Screen.scan(_arg1);
init();
}
public function init(){
}
public static function block(){
SpriteUtil.allowMouse(root, false);
}
public static function unblock(){
SpriteUtil.allowMouse(root, true);
}
}
}//package toy