Section 1
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 2
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 3
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 4
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 5
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 6
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 7
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 8
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 9
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 10
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 11
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 12
//AppConfiguration (Slice.app.data.AppConfiguration)
package Slice.app.data {
public class AppConfiguration {
public const scenes:SceneConfiguration;
public const profile:ProfileConfiguration;
public const data:DataConfiguration;
public const debug:Boolean = false;
public const version:String = "1.0";
public const buildName:String = "";
public function AppConfiguration(){
data = new DataConfiguration();
profile = new ProfileConfiguration();
scenes = new SceneConfiguration();
super();
}
}
}//package Slice.app.data
Section 13
//DataConfiguration (Slice.app.data.DataConfiguration)
package Slice.app.data {
import Slice.data.*;
import flash.ui.*;
public class DataConfiguration {
public const profileDataService:Object;
public const levelDataService:Object;
public const secretDataService:Object;
public const scoringDataService:Object;
public function DataConfiguration(){
profileDataService = {name:"LocalProfileData", type:LocalProfileDataService, sharedObjectName:"Profile"};
levelDataService = {name:"CompiledLevelData", type:CompiledLevelDataService};
scoringDataService = {name:"LocalScoringData", type:LocalScoringDataService};
secretDataService = {name:"GameSecretsData", type:GameSecretDataService, code:[Keyboard.UP, Keyboard.UP, Keyboard.DOWN, Keyboard.DOWN, Keyboard.LEFT, Keyboard.RIGHT, Keyboard.LEFT, Keyboard.RIGHT, 66, 65]};
super();
}
}
}//package Slice.app.data
Section 14
//Fonts (Slice.app.data.Fonts)
package Slice.app.data {
public class Fonts {
public static const DefaultFont:Class = Fonts_DefaultFont;
public static const DetailFont:Class = Fonts_DetailFont;
}
}//package Slice.app.data
Section 15
//Fonts_DefaultFont (Slice.app.data.Fonts_DefaultFont)
package Slice.app.data {
import mx.core.*;
public class Fonts_DefaultFont extends FontAsset {
}
}//package Slice.app.data
Section 16
//Fonts_DetailFont (Slice.app.data.Fonts_DetailFont)
package Slice.app.data {
import mx.core.*;
public class Fonts_DetailFont extends FontAsset {
}
}//package Slice.app.data
Section 17
//Graphics (Slice.app.data.Graphics)
package Slice.app.data {
public class Graphics {
public static const arrow:Class = Graphics_arrow;
public static const uTurnLevel:Class = Graphics_uTurnLevel;
public static const spiderLevel:Class = Graphics_spiderLevel;
public static const boneLevel:Class = Graphics_boneLevel;
public static const secretCursor:Class = Graphics_secretCursor;
public static const cakeLevel:Class = Graphics_cakeLevel;
public static const bentPipeLevel:Class = Graphics_bentPipeLevel;
public static const crossLevel:Class = Graphics_crossLevel;
public static const muteCheckedOver:Class = Graphics_muteCheckedOver;
public static const tutorialLevel:Class = Graphics_tutorialLevel;
public static const muteUncheckedOver:Class = Graphics_muteUncheckedOver;
public static const sLevel:Class = Graphics_sLevel;
public static const starLevel:Class = Graphics_starLevel;
public static const muteUnchecked:Class = Graphics_muteUnchecked;
public static const triangleLevel:Class = Graphics_triangleLevel;
public static const muteChecked:Class = Graphics_muteChecked;
public static const chaosLevel:Class = Graphics_chaosLevel;
public static const octagonLevel:Class = Graphics_octagonLevel;
public static const endLevel1:Class = Graphics_endLevel1;
public static const endLevel2:Class = Graphics_endLevel2;
public static const endLevel3:Class = Graphics_endLevel3;
public static const endLevel4:Class = Graphics_endLevel4;
public static const endLevel5:Class = Graphics_endLevel5;
public static const endLevel6:Class = Graphics_endLevel6;
public static const squareLevel:Class = Graphics_squareLevel;
public static const hourGlassLevel:Class = Graphics_hourGlassLevel;
public static const title:Class = Graphics_title;
public static const xLevel:Class = Graphics_xLevel;
public static const trapezoidLevel:Class = Graphics_trapezoidLevel;
}
}//package Slice.app.data
Section 18
//Graphics_arrow (Slice.app.data.Graphics_arrow)
package Slice.app.data {
import mx.core.*;
public class Graphics_arrow extends SpriteAsset {
}
}//package Slice.app.data
Section 19
//Graphics_bentPipeLevel (Slice.app.data.Graphics_bentPipeLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_bentPipeLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 20
//Graphics_boneLevel (Slice.app.data.Graphics_boneLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_boneLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 21
//Graphics_cakeLevel (Slice.app.data.Graphics_cakeLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_cakeLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 22
//Graphics_chaosLevel (Slice.app.data.Graphics_chaosLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_chaosLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 23
//Graphics_crossLevel (Slice.app.data.Graphics_crossLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_crossLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 24
//Graphics_endLevel1 (Slice.app.data.Graphics_endLevel1)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel1 extends SpriteAsset {
}
}//package Slice.app.data
Section 25
//Graphics_endLevel2 (Slice.app.data.Graphics_endLevel2)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel2 extends SpriteAsset {
}
}//package Slice.app.data
Section 26
//Graphics_endLevel3 (Slice.app.data.Graphics_endLevel3)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel3 extends SpriteAsset {
}
}//package Slice.app.data
Section 27
//Graphics_endLevel4 (Slice.app.data.Graphics_endLevel4)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel4 extends SpriteAsset {
}
}//package Slice.app.data
Section 28
//Graphics_endLevel5 (Slice.app.data.Graphics_endLevel5)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel5 extends SpriteAsset {
}
}//package Slice.app.data
Section 29
//Graphics_endLevel6 (Slice.app.data.Graphics_endLevel6)
package Slice.app.data {
import mx.core.*;
public class Graphics_endLevel6 extends SpriteAsset {
}
}//package Slice.app.data
Section 30
//Graphics_hourGlassLevel (Slice.app.data.Graphics_hourGlassLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_hourGlassLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 31
//Graphics_muteChecked (Slice.app.data.Graphics_muteChecked)
package Slice.app.data {
import mx.core.*;
public class Graphics_muteChecked extends SpriteAsset {
}
}//package Slice.app.data
Section 32
//Graphics_muteCheckedOver (Slice.app.data.Graphics_muteCheckedOver)
package Slice.app.data {
import mx.core.*;
public class Graphics_muteCheckedOver extends SpriteAsset {
}
}//package Slice.app.data
Section 33
//Graphics_muteUnchecked (Slice.app.data.Graphics_muteUnchecked)
package Slice.app.data {
import mx.core.*;
public class Graphics_muteUnchecked extends SpriteAsset {
}
}//package Slice.app.data
Section 34
//Graphics_muteUncheckedOver (Slice.app.data.Graphics_muteUncheckedOver)
package Slice.app.data {
import mx.core.*;
public class Graphics_muteUncheckedOver extends SpriteAsset {
}
}//package Slice.app.data
Section 35
//Graphics_octagonLevel (Slice.app.data.Graphics_octagonLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_octagonLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 36
//Graphics_secretCursor (Slice.app.data.Graphics_secretCursor)
package Slice.app.data {
import mx.core.*;
public class Graphics_secretCursor extends SpriteAsset {
}
}//package Slice.app.data
Section 37
//Graphics_sLevel (Slice.app.data.Graphics_sLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_sLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 38
//Graphics_spiderLevel (Slice.app.data.Graphics_spiderLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_spiderLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 39
//Graphics_squareLevel (Slice.app.data.Graphics_squareLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_squareLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 40
//Graphics_starLevel (Slice.app.data.Graphics_starLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_starLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 41
//Graphics_title (Slice.app.data.Graphics_title)
package Slice.app.data {
import mx.core.*;
public class Graphics_title extends SpriteAsset {
}
}//package Slice.app.data
Section 42
//Graphics_trapezoidLevel (Slice.app.data.Graphics_trapezoidLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_trapezoidLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 43
//Graphics_triangleLevel (Slice.app.data.Graphics_triangleLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_triangleLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 44
//Graphics_tutorialLevel (Slice.app.data.Graphics_tutorialLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_tutorialLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 45
//Graphics_uTurnLevel (Slice.app.data.Graphics_uTurnLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_uTurnLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 46
//Graphics_xLevel (Slice.app.data.Graphics_xLevel)
package Slice.app.data {
import mx.core.*;
public class Graphics_xLevel extends SpriteAsset {
}
}//package Slice.app.data
Section 47
//LevelData (Slice.app.data.LevelData)
package Slice.app.data {
public class LevelData {
public var defaultLevelID:String;// = "Square"
public var levels:Array;
public function LevelData(){
levels = [{id:"Tutorial", nextLevelID:"Square", winAreaRatio:0.4, saveState:false, required:false, color:0x990099, shapeGraphic:"tutorialLevel", shapePoints:[{x:0, y:0}, {x:300, y:0}, {x:300, y:80}, {x:190, y:80}, {x:190, y:300}, {x:110, y:300}, {x:110, y:80}, {x:0, y:80}], objects:[{id:"instructions", visible:false, objects:[{baseType:"instructions", x:50, y:65, text:"Keep slicing until the bar drops to here"}, {baseType:"arrow", x:200, y:45}]}]}, {id:"Square", winAreaRatio:0.3, color:0xCC0066, shapeGraphic:"squareLevel", shapePoints:[{x:0, y:0}, {x:200, y:0}, {x:200, y:200}, {x:0, y:200}], balls:[{baseType:"ball", x:50, y:50, vx:3, vy:-3}]}, {id:"Triangle", winAreaRatio:0.3, color:0xCC0000, shapeGraphic:"triangleLevel", shapePoints:[{x:0, y:200}, {x:200, y:0}, {x:400, y:200}], balls:[{baseType:"ball", x:80, y:150, vx:0, vy:-5}, {baseType:"ball", x:280, y:150, vx:0, vy:-5}]}, {id:"BentPipe", winAreaRatio:0.3, color:0xFF9900, shapeGraphic:"bentPipeLevel", shapePoints:[{x:100, y:0}, {x:200, y:0}, {x:200, y:130}, {x:100, y:230}, {x:100, y:300}, {x:0, y:300}, {x:0, y:170}, {x:100, y:70}], balls:[{baseType:"ball", x:180, y:30, vx:0, vy:6}, {baseType:"ball", x:20, y:270, vx:0, vy:-6}]}, {id:"UTurn", winAreaRatio:0.3, color:0xFFCC00, shapeGraphic:"uTurnLevel", shapePoints:[{x:0, y:0}, {x:50, y:0}, {x:50, y:150}, {x:150, y:150}, {x:150, y:0}, {x:200, y:0}, {x:200, y:200}, {x:0, y:200}], balls:[{baseType:"ball", x:25, y:25, vx:0, vy:6}, {baseType:"ball", x:25, y:175, vx:6, vy:0}, {baseType:"ball", x:175, y:175, vx:0, vy:-6}]}, {id:"HourGlass", winAreaRatio:0.4, color:0x99CC00, shapeGraphic:"hourGlassLevel", shapePoints:[{x:0, y:0}, {x:200, y:0}, {x:200, y:45}, {x:120, y:125}, {x:200, y:205}, {x:200, y:250}, {x:0, y:250}, {x:0, y:205}, {x:80, y:125}, {x:0, y:45}], balls:[{baseType:"ball", x:100, y:60, vx:0, vy:7}, {baseType:"largeBall", x:30, y:30, vx:0, vy:5}, {baseType:"largeBall", x:170, y:220, vx:0, vy:-5}]}, {id:"S", winAreaRatio:0.3, color:2267426, shapeGraphic:"sLevel", shapePoints:[{x:60, y:0}, {x:200, y:0}, {x:200, y:80}, {x:80, y:80}, {x:80, y:100}, {x:140, y:100}, {x:200, y:160}, {x:200, y:220}, {x:140, y:280}, {x:0, y:280}, {x:0, y:200}, {x:120, y:200}, {x:120, y:180}, {x:60, y:180}, {x:0, y:120}, {x:0, y:60}], balls:[{baseType:"ball", x:160, y:40, vx:-6, vy:0}, {baseType:"ball", x:40, y:90, vx:0, vy:6}, {baseType:"ball", x:40, y:240, vx:6, vy:0}, {baseType:"ball", x:160, y:190, vx:0, vy:-6}]}, {id:"Octagon", winAreaRatio:0.4, color:0x7777, shapeGraphic:"octagonLevel", shapePoints:[{x:60, y:0}, {x:140, y:0}, {x:200, y:60}, {x:200, y:140}, {x:140, y:200}, {x:60, y:200}, {x:0, y:140}, {x:0, y:60}], balls:[{baseType:"ball", x:30, y:30, vx:0, vy:-5}, {baseType:"ball", x:170, y:170, vx:0, vy:5}, {baseType:"smallBall", x:170, y:30, vx:-4, vy:-3}, {baseType:"smallBall", x:30, y:170, vx:4, vy:3}]}, {id:"Trapezoid", winAreaRatio:0.55, color:21947, shapeGraphic:"trapezoidLevel", shapePoints:[{x:0, y:0}, {x:200, y:100}, {x:200, y:200}, {x:0, y:300, type:1}], balls:[{baseType:"ball", x:100, y:100, vx:-3, vy:-3}, {baseType:"ball", x:100, y:150, vx:4, vy:2}, {baseType:"ball", x:100, y:200, vx:-1, vy:5}, {baseType:"largeBall", x:50, y:150, vx:2, vy:2}]}, {id:"Cross", winAreaRatio:0.5, color:0x7777, shapeGraphic:"crossLevel", shapePoints:[{x:60, y:0, type:1}, {x:140, y:0}, {x:140, y:60}, {x:200, y:60, type:1}, {x:200, y:140}, {x:140, y:140}, {x:140, y:200, type:1}, {x:60, y:200}, {x:60, y:140}, {x:0, y:140, type:1}, {x:0, y:60}, {x:60, y:60}], balls:[{baseType:"ball", x:100, y:30, vx:0, vy:6}, {baseType:"ball", x:100, y:120, vx:0, vy:-6}, {baseType:"ball", x:50, y:100, vx:6, vy:0}, {baseType:"ball", x:150, y:100, vx:-6, vy:0}]}, {id:"X", winAreaRatio:0.3, color:3381555, shapeGraphic:"xLevel", shapePoints:[{x:0, y:0}, {x:100, y:0, type:1}, {x:100, y:55}, {x:150, y:55, type:1}, {x:150, y:0}, {x:250, y:0}, {x:250, y:100, type:1}, {x:205, y:100}, {x:205, y:150, type:1}, {x:250, y:150}, {x:250, y:250}, {x:150, y:250, type:1}, {x:150, y:195}, {x:100, y:195, type:1}, {x:100, y:250}, {x:0, y:250}, {x:0, y:150, type:1}, {x:55, y:150}, {x:55, y:100, type:1}, {x:0, y:100}], balls:[{baseType:"ball", x:50, y:50, vx:2, vy:5}, {baseType:"ball", x:200, y:50, vx:-4, vy:3}, {baseType:"ball", x:50, y:200, vx:5, vy:-2}, {baseType:"ball", x:200, y:200, vx:-4, vy:-3}, {baseType:"smallBall", x:220, y:220, vx:5, vy:-5}]}, {id:"Chaos", winAreaRatio:0.3, color:0x99CC00, shapeGraphic:"chaosLevel", shapePoints:[{x:142, y:0, type:1}, {x:215, y:100, type:1}, {x:270, y:70}, {x:320, y:130}, {x:290, y:150}, {x:410, y:220, type:1}, {x:300, y:220}, {x:310, y:280, type:1}, {x:240, y:220}, {x:180, y:290}, {x:190, y:190, type:1}, {x:160, y:170}, {x:130, y:290}, {x:50, y:300, type:1}, {x:0, y:200}, {x:80, y:140}, {x:30, y:130, type:1}, {x:90, y:90}, {x:50, y:40, type:1}, {x:130, y:60}], balls:[{baseType:"ball", x:120, y:90, vx:0, vy:6}, {baseType:"ball", x:70, y:210, vx:-4, vy:3}, {baseType:"smallBall", x:250, y:120, vx:5, vy:-5}, {baseType:"largeBall", x:240, y:180, vx:3, vy:-3}]}, {id:"Bone", winAreaRatio:0.3, color:0xFFCC00, shapeGraphic:"boneLevel", shapePoints:[{x:50, y:0}, {x:100, y:50, type:1}, {x:175, y:50}, {x:225, y:50, type:1}, {x:300, y:50}, {x:350, y:0}, {x:400, y:50, type:1}, {x:350, y:100, type:1}, {x:400, y:150}, {x:350, y:200}, {x:300, y:150, type:1}, {x:225, y:150}, {x:175, y:150, type:1}, {x:100, y:150}, {x:50, y:200}, {x:0, y:150, type:1}, {x:50, y:100, type:1}, {x:0, y:50}], balls:[{baseType:"smallBall", x:150, y:100, vx:-9, vy:0}, {baseType:"smallBall", x:250, y:100, vx:9, vy:0}, {baseType:"ball", x:200, y:100, vx:0, vy:-8}]}, {id:"Star", winAreaRatio:0.3, color:0xFF9900, shapeGraphic:"starLevel", shapePoints:[{x:250, y:150, type:1}, {x:293, y:196}, {x:231, y:209, type:1}, {x:238, y:271}, {x:181, y:245, type:1}, {x:150, y:300}, {x:119, y:245, type:1}, {x:62, y:271}, {x:69, y:209, type:1}, {x:7, y:196}, {x:50, y:150, type:1}, {x:7, y:104}, {x:69, y:91, type:1}, {x:62, y:29}, {x:119, y:55, type:1}, {x:150, y:0}, {x:181, y:55, type:1}, {x:238, y:29}, {x:231, y:91, type:1}, {x:293, y:104}], balls:[{baseType:"largeBall", x:100, y:150, vx:-4, vy:4}, {baseType:"largeBall", x:200, y:150, vx:4, vy:-4}, {baseType:"ball", x:150, y:100, vx:-4, vy:-4}, {baseType:"ball", x:150, y:200, vx:4, vy:4}]}, {id:"Spider", winAreaRatio:0.2, color:0xCC0000, shapeGraphic:"spiderLevel", shapePoints:[{x:0, y:80}, {x:80, y:40}, {x:160, y:80, type:1}, {x:220, y:80}, {x:180, y:40}, {x:220, y:0}, {x:260, y:0}, {x:300, y:40}, {x:260, y:80, type:1}, {x:320, y:80}, {x:400, y:40}, {x:480, y:80}, {x:480, y:115}, {x:400, y:75}, {x:320, y:115}, {x:320, y:135}, {x:400, y:95}, {x:480, y:135}, {x:480, y:170}, {x:400, y:130}, {x:320, y:170}, {x:320, y:190}, {x:400, y:150}, {x:480, y:190}, {x:480, y:225}, {x:400, y:185}, {x:320, y:225}, {x:320, y:245}, {x:400, y:205}, {x:480, y:245}, {x:480, y:280}, {x:400, y:240}, {x:320, y:280, type:1}, {x:160, y:280}, {x:80, y:240}, {x:0, y:280}, {x:0, y:245}, {x:80, y:205}, {x:160, y:245}, {x:160, y:225}, {x:80, y:185}, {x:0, y:225}, {x:0, y:190}, {x:80, y:150}, {x:160, y:190}, {x:160, y:170}, {x:80, y:130}, {x:0, y:170}, {x:0, y:135}, {x:80, y:95}, {x:160, y:135}, {x:160, y:115}, {x:80, y:75}, {x:0, y:115}], balls:[{baseType:"ball", x:200, y:200, vx:-4, vy:4}, {baseType:"ball", x:280, y:200, vx:4, vy:4}, {baseType:"ball", x:200, y:150, vx:-4, vy:-4}, {baseType:"smallBall", x:280, y:150, vx:5, vy:-6}, {baseType:"smallBall", x:240, y:50, vx:6, vy:5}, {baseType:"smallBall", x:240, y:160, vx:-6, vy:-5}, {baseType:"smallBall", x:240, y:190, vx:6, vy:5}, {baseType:"smallBall", x:200, y:190, vx:6, vy:-5}]}, {id:"Cake", winAreaRatio:0.3, color:0xCC0066, shapeGraphic:"cakeLevel", shapePoints:[{x:0, y:130, type:1}, {x:140, y:95}, {x:140, y:50, type:1}, {x:130, y:30}, {x:160, y:0, type:1}, {x:190, y:30}, {x:180, y:50, type:1}, {x:180, y:90}, {x:215, y:80, type:1}, {x:290, y:120, type:1}, {x:290, y:260}, {x:0, y:240, type:1}], balls:[{baseType:"smallBall", x:40, y:200, vx:-6, vy:6}, {baseType:"smallBall", x:100, y:150, vx:5, vy:3}, {baseType:"ball", x:200, y:110, vx:6, vy:-1}, {baseType:"largeBall", x:240, y:190, vx:4, vy:2}]}, {id:"End1", hidden:true, saveState:false, winAreaRatio:0.05, color:21947, shapeGraphic:"endLevel1", shapePoints:[{x:0, y:0}, {x:149, y:0}, {x:149, y:30}, {x:90, y:30}, {x:90, y:150}, {x:149, y:150}, {x:149, y:180}, {x:30, y:180}, {x:30, y:210}, {x:149, y:210}, {x:149, y:240}, {x:30, y:240}, {x:30, y:270}, {x:150, y:270}, {x:150, y:0}, {x:180, y:0}, {x:180, y:60}, {x:270, y:60}, {x:270, y:0}, {x:450, y:0}, {x:450, y:30}, {x:330, y:30}, {x:330, y:60}, {x:450, y:60}, {x:450, y:90}, {x:330, y:90}, {x:330, y:120}, {x:450, y:120}, {x:450, y:149}, {x:270, y:149}, {x:270, y:90}, {x:180, y:90}, {x:180, y:150}, {x:270, y:0xFF}, {x:270, y:150}, {x:405, y:150}, {x:450, y:185}, {x:450, y:0xFF}, {x:405, y:300}, {x:331, y:300}, {x:331, y:270}, {x:390, y:270}, {x:420, y:240}, {x:420, y:205}, {x:390, y:180}, {x:330, y:180}, {x:330, y:300}, {x:270, y:300}, {x:180, y:190}, {x:180, y:300}, {x:0, y:300}, {x:0, y:150}, {x:60, y:150}, {x:60, y:30}, {x:0, y:30}]}, {id:"End2", hidden:true, saveState:false, winAreaRatio:0.1, color:0xCC0000, shapeGraphic:"endLevel2", shapePoints:[{x:90, y:0}, {x:210, y:0}, {x:300, y:90}, {x:300, y:210}, {x:210, y:300}, {x:90, y:300}, {x:0, y:210}, {x:0, y:90}]}, {id:"End3", hidden:true, saveState:false, winAreaRatio:0.1, color:16764057, shapeGraphic:"endLevel3", shapePoints:[{x:82, y:20}, {x:113, y:17}, {x:123, y:146}, {x:133, y:0}, {x:163, y:0}, {x:170, y:144}, {x:181, y:11}, {x:206, y:11}, {x:209, y:147}, {x:224, y:47}, {x:247, y:47}, {x:245, y:195}, {x:232, y:291}, {x:200, y:325}, {x:110, y:331}, {x:47, y:287}, {x:0, y:173}, {x:28, y:161}, {x:53, y:183}, {x:78, y:229}, {x:82, y:149}]}, {id:"End4", hidden:true, saveState:false, winAreaRatio:0.1, color:0x993300, shapeGraphic:"endLevel4", shapePoints:[{x:2, y:65}, {x:19, y:48}, {x:35, y:44}, {x:54, y:48}, {x:100, y:71}, {x:138, y:69}, {x:153, y:79}, {x:150, y:67}, {x:161, y:55}, {x:184, y:43}, {x:213, y:44}, {x:260, y:26}, {x:269, y:23}, {x:284, y:11}, {x:308, y:1}, {x:322, y:4}, {x:334, y:22}, {x:344, y:33}, {x:321, y:28}, {x:314, y:59}, {x:318, y:119}, {x:315, y:151}, {x:313, y:155}, {x:319, y:175}, {x:304, y:202}, {x:307, y:228}, {x:314, y:250}, {x:321, y:0xFF}, {x:319, y:263}, {x:306, y:268}, {x:294, y:265}, {x:278, y:229}, {x:263, y:235}, {x:234, y:243}, {x:221, y:245}, {x:211, y:264}, {x:218, y:302}, {x:228, y:314}, {x:219, y:336}, {x:202, y:338}, {x:187, y:334}, {x:184, y:319}, {x:186, y:305}, {x:173, y:228}, {x:137, y:211}, {x:111, y:188}, {x:108, y:201}, {x:86, y:216}, {x:92, y:244}, {x:100, y:0xFF}, {x:104, y:270}, {x:93, y:275}, {x:79, y:275}, {x:70, y:268}, {x:59, y:200}, {x:66, y:185}, {x:72, y:166}, {x:64, y:137}, {x:62, y:117}, {x:73, y:104}, {x:70, y:82}, {x:63, y:74}, {x:27, y:63}, {x:15, y:68}, {x:11, y:77}, {x:18, y:93}, {x:13, y:101}, {x:0, y:85}]}, {id:"End5", hidden:true, winAreaRatio:0.3, color:8453951, shapeGraphic:"endLevel5", shapePoints:[{x:21, y:38}, {x:11, y:64}, {x:25, y:96}, {x:30, y:129, type:1}, {x:25, y:159, type:1}, {x:50, y:179, type:1}, {x:71, y:181, type:1}, {x:91, y:166, type:1}, {x:105, y:157, type:1}, {x:120, y:113, type:1}, {x:138, y:77, type:1}, {x:148, y:53, type:1}, {x:152, y:25}, {x:169, y:2}, {x:186, y:0}, {x:210, y:6}, {x:215, y:10}, {x:227, y:13}, {x:231, y:23}, {x:245, y:37}, {x:253, y:63}, {x:245, y:69, type:1}, {x:227, y:65, type:1}, {x:206, y:49, type:1}, {x:224, y:75, type:1}, {x:222, y:88}, {x:210, y:90}, {x:198, y:81}, {x:187, y:68, type:1}, {x:191, y:99, type:1}, {x:196, y:112, type:1}, {x:201, y:119}, {x:218, y:113}, {x:235, y:123}, {x:231, y:135}, {x:215, y:122}, {x:198, y:129, type:1}, {x:199, y:164, type:1}, {x:202, y:181}, {x:219, y:187, type:1}, {x:241, y:211, type:1}, {x:247, y:227, type:1}, {x:235, y:271}, {x:243, y:282}, {x:0x0101, y:279}, {x:266, y:275}, {x:290, y:277}, {x:298, y:288}, {x:292, y:295}, {x:270, y:298}, {x:0x0101, y:305}, {x:240, y:304}, {x:226, y:293}, {x:212, y:302}, {x:209, y:286}, {x:213, y:271}, {x:209, y:238, type:1}, {x:181, y:246, type:1}, {x:159, y:247, type:1}, {x:115, y:268, type:1}, {x:106, y:282, type:1}, {x:84, y:290, type:1}, {x:68, y:311}, {x:74, y:339}, {x:88, y:344}, {x:95, y:355}, {x:84, y:355}, {x:71, y:357}, {x:57, y:355}, {x:48, y:358}, {x:45, y:345}, {x:50, y:335}, {x:49, y:300, type:1}, {x:65, y:268, type:1}, {x:74, y:263, type:1}, {x:74, y:0x0100, type:1}, {x:60, y:252, type:1}, {x:42, y:235}, {x:17, y:215, type:1}, {x:1, y:182, type:1}, {x:0, y:157}, {x:14, y:116}, {x:14, y:104}, {x:5, y:76}, {x:4, y:59}], balls:[{baseType:"smallBall", x:35, y:195, vx:-5, vy:5}, {baseType:"ball", x:114, y:213, vx:3, vy:7}, {baseType:"smallBall", x:91, y:271, vx:9, vy:1}, {baseType:"largeBall", x:182, y:213, vx:-3, vy:1}, {baseType:"ball", x:150, y:159, vx:2, vy:4}, {baseType:"smallBall", x:168, y:73, vx:-8, vy:2}]}, {id:"End6", hidden:true, saveState:false, color:0x990066, shapeGraphic:"endLevel6", shapePoints:[{x:0, y:0}, {x:250, y:0}, {x:250, y:300}, {x:0, y:300}, {x:0, y:100}, {x:150, y:100}, {x:150, y:200}, {x:100, y:200}, {x:100, y:150}, {x:50, y:150}, {x:50, y:250}, {x:200, y:250}, {x:200, y:50}, {x:0, y:50}]}];
super();
}
}
}//package Slice.app.data
Section 48
//PreloaderConfiguration (Slice.app.data.PreloaderConfiguration)
package Slice.app.data {
public class PreloaderConfiguration {
public static const StageWidth:uint = 500;
public static const ProgressBarHeight:uint = 10;
public static const SupportedTextColor:uint = 0xFFFFFF;
public static const SupportedTextFont:String = "Default";
public static const ProgressBarY:int = 285;
public static const GameMoldButtonUp:Class = PreloaderConfiguration_GameMoldButtonUp;
public static const ProgressBarMargin:uint = 50;
public static const SupportedTextY:int = 185;
public static const DefaultFont:Class = PreloaderConfiguration_DefaultFont;
public static const GameMoldButtonOver:Class = PreloaderConfiguration_GameMoldButtonOver;
public static const StageHeight:uint = 500;
public static const SupportedText:String = "supported by";
public static const SupportedTextFontSize:uint = 20;
public static const GameMoldLinkUrl:String = "http://www.gamemold.com";
public static const MinDelay:uint = 3000;
public static const GameMoldButtonY:int = 215;
public static const ProgressBarColor:uint = 0xFFCC00;
}
}//package Slice.app.data
Section 49
//PreloaderConfiguration_DefaultFont (Slice.app.data.PreloaderConfiguration_DefaultFont)
package Slice.app.data {
import mx.core.*;
public class PreloaderConfiguration_DefaultFont extends FontAsset {
}
}//package Slice.app.data
Section 50
//PreloaderConfiguration_GameMoldButtonOver (Slice.app.data.PreloaderConfiguration_GameMoldButtonOver)
package Slice.app.data {
import mx.core.*;
public class PreloaderConfiguration_GameMoldButtonOver extends SpriteAsset {
}
}//package Slice.app.data
Section 51
//PreloaderConfiguration_GameMoldButtonUp (Slice.app.data.PreloaderConfiguration_GameMoldButtonUp)
package Slice.app.data {
import mx.core.*;
public class PreloaderConfiguration_GameMoldButtonUp extends SpriteAsset {
}
}//package Slice.app.data
Section 52
//ProfileConfiguration (Slice.app.data.ProfileConfiguration)
package Slice.app.data {
public class ProfileConfiguration {
public var defaultSettings:Object;
public var defaultGameState:Object;
public function ProfileConfiguration(){
defaultGameState = {levels:[]};
defaultSettings = {soundVolume:0.7, soundMuted:false};
super();
}
}
}//package Slice.app.data
Section 53
//Resources (Slice.app.data.Resources)
package Slice.app.data {
public class Resources {
public var sounds:Class;
public var fonts:Class;
public var graphics:Class;
public var text:Object;
public function Resources(){
graphics = Graphics;
sounds = Sounds;
fonts = Fonts;
text = {};
super();
}
}
}//package Slice.app.data
Section 54
//SceneConfiguration (Slice.app.data.SceneConfiguration)
package Slice.app.data {
import Slice.scene.objects.*;
import flash.text.*;
import Slice.app.scene.objects.*;
import Slice.app.scene.*;
import flash.ui.*;
public class SceneConfiguration {
public const secretCursor:String = "secretCursor";
public const secretCursorSound:String = "secretCursor";
public const defaultSceneGroup:String = "intro";
public const backgroundColor:uint = 0x333333;
public var sceneGroups:Object;
public var scenes:Object;
public var objects:Object;
public function SceneConfiguration(){
sceneGroups = {intro:["intro"], play:["play", "playHUD"]};
scenes = {intro:{type:IntroScene, buttonType:"levelButton", buttonSpacingX:60, buttonSpacingY:60, buttonColumns:8, hiddenLevelButtonsY:300, webLinkUrl:"http://www.chewonglass.com", objects:[{baseType:"title"}, {id:"levelButtons", x:15, y:325}, {baseType:"textSmall", text:"BY AARON NEUGEBAUER", x:15, y:475, fontColor:0xCCCCCC}, {id:"webLink", baseType:"textButtonSmall", text:"CHEWONGLASS.COM", x:283, y:475}, {id:"versionText", baseType:"textSmall", x:485, y:460, fontSize:11, autoSize:TextFieldAutoSize.RIGHT, fontColor:0x999999}, {id:"transition", baseType:"sceneTransition"}]}, play:{type:PlayScene, maxCollisionIterations:5, sliceSounds:[{minLength:0, sound:"sliceShort"}, {minLength:75, sound:"slice"}, {minLength:150, sound:"sliceLong"}], ballElasticity:0.3, secretSliceSound:"secretSlice", invalidSliceSound:"invalidSlice", wallSliceSound:"wallSlice", collisionSound:"sliceCollision", lineSegmentExplosionType:"lineSegmentExplosion", lineSegmentFadeType:"lineSegmentFade", objects:[{id:"playContainer", objects:[{type:BoundaryShape, id:"shape", wallWidth:3, wallColor:0xFFFFFF}, {type:RemovedShapesContainer, id:"removedShapes", shapeFadeRate:0.03, shapeMaxRotation:1, shapeVelocity:3, shapeAccelerationX:0, shapeAccelerationY:0.5}, {id:"ballContainer"}, {baseType:"lineSegment", id:"lineSegment"}]}]}, playHUD:{type:PlayHUDScene, pauseKeys:[Keyboard.SPACE, Keyboard.ESCAPE], instructionsAppearFrames:20, windowAppearFrames:10, windowDelay:300, restartDelay:1000, singlePreviousSliceText:"1 slice", objects:[{id:"progressBar", baseType:"levelProgressBar", x:50, y:20}, {id:"muteButton", baseType:"muteButton", x:355, y:470}, {id:"volumeSlider", baseType:"volumeSlider", x:375, y:470}, {id:"menuButton", baseType:"textButtonSmall", x:430, y:470, text:"MENU"}, {id:"transition", baseType:"sceneTransition"}, {id:"winWindow", baseType:"window", x:50, y:110, width:400, height:290, visible:false, objects:[{id:"reviewShape", baseType:"levelReviewShape", x:20, y:20, width:150, height:150}, {baseType:"textLabel", x:180, y:20, text:"Slices:"}, {id:"sliceCountText", baseType:"statText", x:325, y:20}, {baseType:"textLabel", x:180, y:45, text:"Area left:"}, {id:"endAreaText", baseType:"statText", x:325, y:45}, {baseType:"textLabel", x:180, y:70, text:"Avg. slice:"}, {id:"avgSliceText", baseType:"statText", x:325, y:70}, {baseType:"statText", x:180, y:100}, {id:"previousBestText", baseType:"textLabel", text:"Previous best:", x:180, y:100}, {id:"previousBestSlicesText", baseType:"statText", text:"{0} slices", x:280, y:125}, {id:"newBestText", baseType:"highlightText", text:"A NEW BEST!", x:180, y:150}, {id:"nextLevelButton", baseType:"textButton", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:400, x:0, y:180, text:"Next level"}, {id:"replayButton", baseType:"textButtonMedium", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:400, x:0, y:220, text:"Replay level"}, {id:"winMainMenuButton", baseType:"textButtonMedium", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:400, x:0, y:247, text:"Main menu"}]}, {id:"pauseWindow", baseType:"window", x:140, y:200, width:220, height:110, visible:false, objects:[{id:"resumeButton", baseType:"textButtonMedium", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:220, x:0, y:10, text:"Resume game"}, {id:"restartButton", baseType:"textButtonMedium", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:220, x:0, y:40, text:"Restart level"}, {id:"mainMenuButton", baseType:"textButtonMedium", textAlign:TextFormatAlign.CENTER, wordWrap:true, width:220, x:0, y:70, text:"Main menu"}]}]}};
objects = {title:{type:SkinnedObject, skin:{graphicID:"title"}}, text:{type:TextBox, fontName:"Default", fontSize:26, fontColor:0xFFFFFF}, textSmall:{baseType:"text", fontSize:16}, statText:{baseType:"text", fontSize:20}, textLabel:{baseType:"text", fontColor:0xCCCCCC, fontSize:20}, highlightText:{baseType:"text", fontColor:0xFFFF00, fontSize:26}, instructions:{baseType:"text", fontColor:0xCCCCCC, fontSize:14, width:400, wordWrap:true, textAlign:TextFormatAlign.CENTER}, levelButton:{type:LevelButton, width:50, height:50, shapeColor:0xFFFFFF, shapePadding:10, slicesText:{fontName:"Detail", fontBold:true, fontSize:12, fontColor:0x444444, textAlign:TextFormatAlign.CENTER, wordWrap:true, width:40}, slicesCount:{x:40, y:40, radius:10, color:0xFFFFFF}, slicesBlendRatio:0.5, upSkin:{}, overSkin:{blendColor:0xFFFFFF, blendRatio:0.3, slicesBlendRatio:0.7}, downSkin:{blendColor:0xFFFFFF, blendRatio:0.3, slicesBlendRatio:0.7}, disabledSkin:{shapeColor:0x999999, blendColor:0x444444, blendRatio:0.7}}, textButton:{type:TextButton, fontName:"Default", fontSize:35, fontColor:0xFF9900, textAlign:TextFormatAlign.LEFT, overSkin:{fontColor:0xFFCC00}, downSkin:{fontColor:0xFFCC00}, disabledSkin:{fontColor:0x999999}}, textButtonMedium:{baseType:"textButton", fontSize:22}, textButtonSmall:{baseType:"textButton", fontSize:16}, muteButton:{type:GraphicCheckBox, graphic:"muteUnchecked", overSkin:{graphic:"muteUncheckedOver"}, downSkin:{graphic:"muteUncheckedOver"}, upCheckedSkin:{graphic:"muteChecked"}, overCheckedSkin:{graphic:"muteCheckedOver"}, downCheckedSkin:{graphic:"muteCheckedOver"}, disabledCheckedSkin:{graphic:"muteChecked"}}, volumeSlider:{type:VolumeSlider, backgroundColor:0x666666, width:40, height:20, barColor:0xFF9900, overSkin:{barColor:0xFFCC00}, downSkin:{barColor:0xFFCC00}, disabledSkin:{barColor:0x999999}}, ball:{type:Ball, radius:10, color:0xFFFFFF}, smallBall:{baseType:"ball", radius:7}, largeBall:{baseType:"ball", radius:16}, lineSegment:{type:LineSegment, color:268435455, thickness:3, gapLength:12, dashLength:10}, lineSegmentExplosion:{baseType:"lineSegment", type:LineSegmentExplosion, gravity:0.5, maxDashVx:2, maxDashVy:4, maxDashVTheta:0.2}, lineSegmentFade:{baseType:"lineSegment", type:LineSegmentFade, fadeRate:0.2}, levelProgressBar:{type:LevelProgressBar, width:400, height:15, progressEasing:0.3, backgroundColor:0x777777, goalColor:0xFFFFFF, goalLineWidth:2, goalMarkerWidth:10, goalMarkerHeight:6}, window:{type:Window, skin:{fillAlpha:0.6, fillColor:0}}, blankWindow:{baseType:"window", skin:{fillAlpha:0}}, arrow:{type:SkinnedObject, skin:{graphicID:"arrow"}}, sceneTransition:{type:SceneTransition, shapeVelocity:20, fadeRate:0.03, maxSliceDistance:100, sound:"slice"}, levelReviewShape:{type:LevelReviewShape, sliceColor:268435455, sliceThickness:2, sliceGapLength:7, sliceDashLength:5, shapeLineThickness:2, shapeBlendColor:0, shapeBlendRatio:0.5}};
super();
}
}
}//package Slice.app.data
Section 55
//Sounds (Slice.app.data.Sounds)
package Slice.app.data {
public class Sounds {
public static var sliceCollision:Class = Sounds_sliceCollision;
public static var secretCursor:Class = Sounds_secretCursor;
public static var wallSlice:Class = Sounds_wallSlice;
public static var secretSlice:Class = Sounds_secretSlice;
public static var sliceShort:Class = Sounds_sliceShort;
public static var sliceLong:Class = Sounds_sliceLong;
public static var slice:Class = Sounds_slice;
public static var invalidSlice:Class = Sounds_invalidSlice;
}
}//package Slice.app.data
Section 56
//Sounds_invalidSlice (Slice.app.data.Sounds_invalidSlice)
package Slice.app.data {
import mx.core.*;
public class Sounds_invalidSlice extends SoundAsset {
}
}//package Slice.app.data
Section 57
//Sounds_secretCursor (Slice.app.data.Sounds_secretCursor)
package Slice.app.data {
import mx.core.*;
public class Sounds_secretCursor extends SoundAsset {
}
}//package Slice.app.data
Section 58
//Sounds_secretSlice (Slice.app.data.Sounds_secretSlice)
package Slice.app.data {
import mx.core.*;
public class Sounds_secretSlice extends SoundAsset {
}
}//package Slice.app.data
Section 59
//Sounds_slice (Slice.app.data.Sounds_slice)
package Slice.app.data {
import mx.core.*;
public class Sounds_slice extends SoundAsset {
}
}//package Slice.app.data
Section 60
//Sounds_sliceCollision (Slice.app.data.Sounds_sliceCollision)
package Slice.app.data {
import mx.core.*;
public class Sounds_sliceCollision extends SoundAsset {
}
}//package Slice.app.data
Section 61
//Sounds_sliceLong (Slice.app.data.Sounds_sliceLong)
package Slice.app.data {
import mx.core.*;
public class Sounds_sliceLong extends SoundAsset {
}
}//package Slice.app.data
Section 62
//Sounds_sliceShort (Slice.app.data.Sounds_sliceShort)
package Slice.app.data {
import mx.core.*;
public class Sounds_sliceShort extends SoundAsset {
}
}//package Slice.app.data
Section 63
//Sounds_wallSlice (Slice.app.data.Sounds_wallSlice)
package Slice.app.data {
import mx.core.*;
public class Sounds_wallSlice extends SoundAsset {
}
}//package Slice.app.data
Section 64
//Ball (Slice.app.scene.objects.Ball)
package Slice.app.scene.objects {
import Slice.scene.objects.*;
import flash.geom.*;
public class Ball extends SceneObject {
private var _vx:Number;
private var _graphicsDirty:Boolean;// = true
private var _vy:Number;
private var _color:uint;// = 0
private var _radius:Number;
private var _previousPosition:Point;
public function Ball(){
this._vx = 0;
this._vy = 0;
this._radius = 10;
this._previousPosition = new Point();
}
public function get previousPosition():Point{
return (this._previousPosition);
}
public function get vy():Number{
return (this._vy);
}
public function set vy(_arg1:Number):void{
this._vy = _arg1;
}
public function get radius():Number{
return (this._radius);
}
public function set vx(_arg1:Number):void{
this._vx = _arg1;
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._vx = ((Number(_arg1.vx)) || (0));
this._vy = ((Number(_arg1.vy)) || (0));
this.radius = ((Number(_arg1.radius)) || (10));
this._color = ((_arg1.color) || (0));
}
override public function update():void{
this._previousPosition.x = this.x;
this._previousPosition.y = this.y;
this.x = (this.x + this._vx);
this.y = (this.y + this._vy);
}
public function get vx():Number{
return (this._vx);
}
public function set radius(_arg1:Number):void{
this._radius = _arg1;
this._graphicsDirty = true;
}
override public function draw():void{
if (this._graphicsDirty){
this.graphics.clear();
this.graphics.beginFill(this._color);
this.graphics.drawCircle(0, 0, this.radius);
this.graphics.endFill();
this._graphicsDirty = false;
};
}
}
}//package Slice.app.scene.objects
Section 65
//BoundaryIntersection (Slice.app.scene.objects.BoundaryIntersection)
package Slice.app.scene.objects {
public class BoundaryIntersection {
public var point:BoundaryShapePoint;
public var length:Number;
public function BoundaryIntersection(_arg1:BoundaryShapePoint, _arg2:Number):void{
this.point = _arg1;
this.length = _arg2;
}
}
}//package Slice.app.scene.objects
Section 66
//BoundaryShape (Slice.app.scene.objects.BoundaryShape)
package Slice.app.scene.objects {
import flash.display.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.geometry.*;
import Slice.utils.*;
public class BoundaryShape extends SceneObject {
private var _height:Number;// = 0
private var _width:Number;// = 0
private var _graphicsDirty:Boolean;// = false
private var _slicePoints:Array;
private var _mouseInterceptSegment:uint;
private var _wallWidth:uint;// = 0
private var _color:uint;// = 0
private var _shapePoints:Array;
private var _fillGraphic:DisplayObject;// = null
private var _fillBitmap:BitmapData;// = null
private var _wallColor:uint;// = 0
public function BoundaryShape(){
_slicePoints = [];
super();
}
public function getArea():Number{
return (Geometry.area(this._shapePoints));
}
override public function draw():void{
var _local1:BoundaryShapePoint;
var _local2:uint;
var _local3:uint;
if (this._graphicsDirty){
this.graphics.clear();
if (this._fillBitmap){
this.graphics.beginBitmapFill(this._fillBitmap);
} else {
this.graphics.beginFill(this._color);
};
_local1 = this._shapePoints[0];
this.graphics.moveTo(_local1.x, _local1.y);
_local2 = this._shapePoints.length;
_local3 = 1;
while (_local3 <= _local2) {
_local1 = this._shapePoints[(_local3 % _local2)];
switch (this._shapePoints[(_local3 - 1)].type){
case BoundaryShapePoint.TYPE_WALL:
this.graphics.lineStyle(this._wallWidth, this._wallColor);
break;
default:
this.graphics.lineStyle();
break;
};
this.graphics.lineTo(_local1.x, _local1.y);
_local3++;
};
this.graphics.endFill();
this._graphicsDirty = false;
};
}
public function set points(_arg1:Array):void{
this._shapePoints = _arg1;
this._graphicsDirty = true;
}
public function set fillGraphic(_arg1:DisplayObject):void{
this._fillGraphic = _arg1;
this.redrawFillBitmap();
this._graphicsDirty = true;
}
public function set color(_arg1:uint):void{
this._color = _arg1;
this.redrawFillBitmap();
this._graphicsDirty = true;
}
public function getEdgeCircleIntersection(_arg1:Point, _arg2:Number):Vector{
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local3:Vector;
var _local4:Number = 0;
var _local5:uint = this._shapePoints.length;
var _local6:Number = (_arg2 * _arg2);
var _local7:uint;
while (_local7 < _local5) {
_local8 = this._shapePoints[_local7];
_local9 = this._shapePoints[((_local7 + 1) % _local5)];
_local10 = Geometry.nearestPoint(_local8, _local9, _arg1);
if (((MathUtility.between(_local10.x, _local8.x, _local9.x)) && (MathUtility.between(_local10.y, _local8.y, _local9.y)))){
_local11 = Geometry.distanceSquared(_arg1, _local10);
if ((((_local11 < _local6)) && ((((_local11 < _local4)) || ((_local3 == null)))))){
_local12 = (_local9.x - _local8.x);
_local13 = (_local9.y - _local8.y);
_local14 = Geometry.distance(_local8, _local9);
_local4 = _local11;
_local3 = new Vector(((_arg1.x + ((_arg2 * _local13) / _local14)) - _local10.x), ((_arg1.y - ((_arg2 * _local12) / _local14)) - _local10.y));
};
} else {
_local15 = Geometry.distanceSquared(_arg1, _local8);
if ((((_local15 < _local6)) && ((((_local15 < _local4)) || ((_local3 == null)))))){
_local16 = (_local8.x - _arg1.x);
_local17 = (_local8.y - _arg1.y);
_local4 = _local15;
_local15 = Math.sqrt(_local15);
_local3 = new Vector(((_arg1.x + ((_arg2 * _local16) / _local15)) - _local8.x), ((_arg1.y + ((_arg2 * _local17) / _local15)) - _local8.y));
};
};
_local7++;
};
return (_local3);
}
public function getEdgeIntersections(_arg1:Point, _arg2:Point):Array{
var vertex1:BoundaryShapePoint;
var vertex2:BoundaryShapePoint;
var p:Point;
var p1 = _arg1;
var p2 = _arg2;
var numPoints:uint = this._shapePoints.length;
var intersections:Array = [];
var k:uint;
while (k < numPoints) {
vertex1 = this._shapePoints[k];
vertex2 = this._shapePoints[((k + 1) % numPoints)];
p = Geometry.segmentsIntersection(p1, p2, vertex1, vertex2);
if (p != null){
intersections.push(new BoundaryShapePoint(p.x, p.y, vertex1.type));
};
k = (k + 1);
};
intersections.sort(function (_arg1:BoundaryShapePoint, _arg2:BoundaryShapePoint):int{
return (((Geometry.distanceRatio(p1, p2, _arg1) < Geometry.distanceRatio(p1, p2, _arg2))) ? -1 : 1);
});
return (intersections);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._wallColor = uint(_arg1.wallColor);
this._wallWidth = uint(_arg1.wallWidth);
}
public function getNearestPoint(_arg1:Point):BoundaryIntersection{
var _local6:BoundaryShapePoint;
var _local7:BoundaryShapePoint;
var _local8:Point;
var _local9:Number;
var _local10:Number;
var _local2:uint = this._shapePoints.length;
var _local3:Number = -1;
var _local4:BoundaryIntersection;
var _local5:uint;
for (;_local5 < _local2;_local5++) {
_local6 = this._shapePoints[_local5];
_local7 = this._shapePoints[((_local5 + 1) % _local2)];
_local8 = Geometry.nearestPoint(_local6, _local7, _arg1);
_local9 = Geometry.distanceRatio(_local6, _local7, _local8);
if (_local9 < 0){
_local8 = _local6;
} else {
if ((((_local9 > 1)) || (isNaN(_local9)))){
continue;
};
};
_local10 = Geometry.distanceSquared(_arg1, _local8);
if ((((_local4 == null)) || ((_local10 < _local3)))){
_local3 = _local10;
_local4 = new BoundaryIntersection(new BoundaryShapePoint(_local8.x, _local8.y, _local6.type), (_local5 + _local9));
};
};
return (_local4);
}
public function get points():Array{
return (this._shapePoints);
}
private function redrawFillBitmap():void{
var _local1:Rectangle;
if (this._fillGraphic){
_local1 = Geometry.bounds(this._shapePoints);
this._width = _local1.width;
this._height = _local1.height;
this._fillBitmap = new BitmapData(this._width, this._height, true, (this._color | 4278190080));
this._fillBitmap.draw(this._fillGraphic);
} else {
this._fillBitmap = null;
};
}
public function get color():uint{
return (this._color);
}
public function get fillGraphic():DisplayObject{
return (this._fillGraphic);
}
public function getEdgePoint(_arg1:Number):BoundaryShapePoint{
var _local2:uint = ((_arg1)!=this._shapePoints.length) ? Math.floor(_arg1) : (this._shapePoints.length - 1);
if ((((_local2 < 0)) || ((_local2 >= this._shapePoints.length)))){
return (null);
};
var _local3:BoundaryShapePoint = this._shapePoints[_local2];
var _local4:BoundaryShapePoint = this._shapePoints[((_local2 + 1) % this._shapePoints.length)];
_arg1 = (_arg1 - Number(_local2));
return (new BoundaryShapePoint((_local3.x + ((_local4.x - _local3.x) * _arg1)), (_local3.y + ((_local4.y - _local3.y) * _arg1)), _local3.type));
}
public function pointIsInside(_arg1:Point):Boolean{
return (Geometry.pointInsideShape(_arg1, this._shapePoints));
}
public function getSlicePoints(_arg1:Number, _arg2:Number):Array{
var _local7:Array;
_arg1 = Math.max(0, _arg1);
_arg2 = Math.max(0, _arg2);
var _local3:uint = Math.floor(_arg1);
var _local4:uint = (Math.ceil(_arg2) % this._shapePoints.length);
var _local5:BoundaryShapePoint = this.getEdgePoint(_arg1);
var _local6:BoundaryShapePoint = this.getEdgePoint(_arg2);
this._slicePoints.push(_local5, _local6);
var _local8:Array = ObjectUtility.copyArray(this._shapePoints);
if (_local3 > _local4){
_local7 = _local8.splice((_local3 + 1), ((_local8.length - _local3) - 1), _local5.cloneNormal(), _local6);
_local7.unshift(_local6.cloneNormal(), _local5);
if (_local4 > 0){
_local7 = _local7.concat(_local8.splice(0, _local4));
};
} else {
if (_local3 == _local4){
_local7 = _local8;
_local8 = [_local8[_local3], _local5.cloneNormal(), _local6];
_local7.splice(_local3, 1, _local6.cloneNormal(), _local5);
} else {
_local7 = _local8.splice((_local3 + 1), ((_local4 - _local3) - 1), _local5.cloneNormal(), _local6);
_local7.push(_local6.cloneNormal(), _local5);
};
};
return ([_local7, _local8]);
}
}
}//package Slice.app.scene.objects
Section 67
//BoundaryShapePoint (Slice.app.scene.objects.BoundaryShapePoint)
package Slice.app.scene.objects {
import flash.geom.*;
public class BoundaryShapePoint extends Point {
private var _type:uint;// = 0
public static const TYPE_NORMAL:uint = 0;
public static const TYPE_WALL:uint = 1;
public function BoundaryShapePoint(_arg1:Number, _arg2:Number, _arg3:uint=0){
super(_arg1, _arg2);
this._type = _arg3;
}
public function set type(_arg1:uint):void{
this._type = _arg1;
}
public function get type():uint{
return (this._type);
}
public function cloneNormal():BoundaryShapePoint{
return (new BoundaryShapePoint(this.x, this.y));
}
}
}//package Slice.app.scene.objects
Section 68
//LevelButton (Slice.app.scene.objects.LevelButton)
package Slice.app.scene.objects {
import Slice.scene.objects.*;
public class LevelButton extends Button {
override protected function createSkins():void{
this.upSkin = new LevelButtonSkin();
this.downSkin = new LevelButtonSkin();
this.overSkin = new LevelButtonSkin();
this.disabledSkin = new LevelButtonSkin();
}
public function setLevelData(_arg1:Array, _arg2:uint, _arg3:uint=0):void{
LevelButtonSkin(this.upSkin).setLevelData(_arg1, _arg2, _arg3);
LevelButtonSkin(this.downSkin).setLevelData(_arg1, _arg2, _arg3);
LevelButtonSkin(this.overSkin).setLevelData(_arg1, _arg2, _arg3);
LevelButtonSkin(this.disabledSkin).setLevelData(_arg1, _arg2);
this.resize();
}
}
}//package Slice.app.scene.objects
Section 69
//LevelButtonSkin (Slice.app.scene.objects.LevelButtonSkin)
package Slice.app.scene.objects {
import Slice.scene.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.geometry.*;
import Slice.utils.*;
public class LevelButtonSkin extends Skin {
private var _shapeColor:uint;// = 0xFFFFFF
private var _slicesCountRadius:Number;// = 0
private var _slicesText:TextBox;// = null
private var _shapePadding:uint;// = 0
private var _blendColor:uint;// = 0
private var _slicesCountColor:uint;// = 0
private var _slicesCountPosition:Point;// = null
private var _blendRatio:Number;// = 0
private var _slicesBlendRatio:Number;// = 0
override public function draw():void{
}
public function setLevelData(_arg1:Array, _arg2:int, _arg3:uint=0):void{
var _local8:uint;
this.graphics.clear();
var _local4:uint = _arg2;
if (this._blendRatio > 0){
_local4 = MathUtility.lerpColor(_arg2, this._blendColor, this._blendRatio);
};
this.graphics.beginFill(_local4);
this.graphics.drawCircle((this.width / 2), (this.height / 2), (this.width / 2));
this.graphics.endFill();
this.graphics.beginFill(this._shapeColor);
var _local5:Rectangle = Geometry.bounds(_arg1);
var _local6:Number = Geometry.getFillScale(new Point((this.width - (2 * this._shapePadding)), (this.height - (2 * this._shapePadding))), new Point(_local5.width, _local5.height));
var _local7:Point = new Point(((this.width / 2) - ((_local6 * (_local5.left + _local5.right)) / 2)), ((this.height / 2) - ((_local6 * (_local5.top + _local5.bottom)) / 2)));
this.graphics.lineStyle();
GraphicsUtility.drawShape(this.graphics, _arg1, _local6, _local7);
this.graphics.endFill();
if (_arg3 > 0){
_local8 = MathUtility.lerpColor(_arg2, this._slicesCountColor, this._slicesBlendRatio);
this.graphics.beginFill(_local8);
this.graphics.drawCircle(this._slicesCountPosition.x, this._slicesCountPosition.y, this._slicesCountRadius);
this.graphics.endFill();
this._slicesText.visible = true;
this._slicesText.text = _arg3.toString();
} else {
this._slicesText.visible = false;
};
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._shapeColor = uint(_arg1.shapeColor);
this._shapePadding = uint(_arg1.shapePadding);
this._blendColor = ((uint(_arg1.blendColor)) || (0));
this._blendRatio = ((Number(_arg1.blendRatio)) || (0));
this._slicesText = new TextBox();
this.addChild(this._slicesText);
this._slicesText.initialize(_arg1.slicesText);
var _local2:Object = ((_arg1.slicesCount) || ({}));
this._slicesCountPosition = new Point(((Number(_local2.x)) || (0)), ((Number(_local2.y)) || (0)));
this._slicesCountRadius = Number(_local2.radius);
this._slicesCountColor = ((uint(_local2.color)) || (0));
this._slicesBlendRatio = ((Number(_arg1.slicesBlendRatio)) || (0));
this._slicesText.text = "0";
this._slicesText.x = (this._slicesCountPosition.x - (this._slicesText.width / 2));
this._slicesText.y = (this._slicesCountPosition.y - (this._slicesText.height / 2));
}
}
}//package Slice.app.scene.objects
Section 70
//LevelProgressBar (Slice.app.scene.objects.LevelProgressBar)
package Slice.app.scene.objects {
import Slice.scene.objects.*;
public class LevelProgressBar extends SceneObject {
private var _height:Number;// = 0
private var _width:Number;// = 0
private var _graphicsDirty:Boolean;// = false
private var _progress:Number;// = 0
private var _goalColor:uint;
private var _goalMarkerHeight:uint;// = 10
private var _backgroundColor:uint;
private var _progressEasing:Number;// = 0.5
private var _goalMarkerWidth:uint;// = 10
private var _goalLineWidth:uint;
private var _barColor:uint;
private var _goal:Number;// = 0
private var _displayedProgress:Number;// = 0
override public function draw():void{
var _local1:Number;
if (this._graphicsDirty){
this.graphics.clear();
this.graphics.beginFill(this._backgroundColor);
this.graphics.drawRect(0, 0, this._width, this._height);
this.graphics.endFill();
this.graphics.lineStyle();
if (this._displayedProgress > 0){
this.graphics.beginFill(this._barColor);
this.graphics.drawRect(0, 0, (this._width * this._displayedProgress), this._height);
this.graphics.endFill();
};
if (this._goal > 0){
this.graphics.beginFill(this._goalColor);
_local1 = (this._width * this._goal);
this.graphics.drawRect((_local1 - (this._goalLineWidth / 2)), 0, this._goalLineWidth, this._height);
this.graphics.endFill();
this.graphics.beginFill(this._goalColor);
this.graphics.moveTo((_local1 - (this._goalMarkerWidth / 2)), -(this._goalMarkerHeight));
this.graphics.lineTo((_local1 + (this._goalMarkerWidth / 2)), -(this._goalMarkerHeight));
this.graphics.lineTo((_local1 + (this._goalLineWidth / 2)), 0);
this.graphics.lineTo((_local1 - (this._goalLineWidth / 2)), 0);
this.graphics.lineTo((_local1 - (this._goalMarkerWidth / 2)), -(this._goalMarkerHeight));
this.graphics.endFill();
this.graphics.beginFill(this._goalColor);
this.graphics.moveTo((_local1 - (this._goalMarkerWidth / 2)), (this._height + this._goalMarkerHeight));
this.graphics.lineTo((_local1 + (this._goalMarkerWidth / 2)), (this._height + this._goalMarkerHeight));
this.graphics.lineTo((_local1 + (this._goalLineWidth / 2)), this._height);
this.graphics.lineTo((_local1 - (this._goalLineWidth / 2)), this._height);
this.graphics.lineTo((_local1 - (this._goalMarkerWidth / 2)), (this._height + this._goalMarkerHeight));
this.graphics.endFill();
};
this._graphicsDirty = (this._displayedProgress == this._progress);
};
}
override public function update():void{
if (this._displayedProgress != this._progress){
if ((Math.abs((this._displayedProgress - this._progress)) * this._width) <= 1){
this._displayedProgress = this._progress;
} else {
this._displayedProgress = (this._displayedProgress + ((this._progress - this._displayedProgress) * this._progressEasing));
this._graphicsDirty = true;
};
};
}
public function set displayedProgress(_arg1:Number):void{
this._displayedProgress = _arg1;
this._graphicsDirty = true;
}
public function get barColor():uint{
return (this._barColor);
}
public function set progress(_arg1:Number):void{
this._progress = _arg1;
this._graphicsDirty = true;
}
public function set barColor(_arg1:uint):void{
this._barColor = _arg1;
this._graphicsDirty = true;
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._backgroundColor = uint(_arg1.backgroundColor);
this._goalColor = uint(_arg1.goalColor);
this._goalLineWidth = uint(_arg1.goalLineWidth);
this._goalMarkerWidth = uint(_arg1.goalMarkerWidth);
this._goalMarkerHeight = uint(_arg1.goalMarkerHeight);
this._progressEasing = Number(_arg1.progressEasing);
this._width = Number(_arg1.width);
this._height = Number(_arg1.height);
this._graphicsDirty = true;
this.draw();
}
public function get goal():Number{
return (this._goal);
}
public function get progress():Number{
return (this._progress);
}
public function get displayedProgress():Number{
return (this._displayedProgress);
}
public function set goal(_arg1:Number):void{
this._goal = _arg1;
this._graphicsDirty = true;
}
}
}//package Slice.app.scene.objects
Section 71
//LevelReviewShape (Slice.app.scene.objects.LevelReviewShape)
package Slice.app.scene.objects {
import flash.display.*;
import Slice.scene.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.geometry.*;
import Slice.utils.*;
public class LevelReviewShape extends SceneObject {
private var _height:Number;
private var _slices:Array;
private var _graphicsDirty:Boolean;// = false
private var _sliceGapLength:Number;
private var _sliceDashLength:Number;
private var _width:Number;
private var _sliceColor:uint;
private var _shapeBlendColor:uint;
private var _shapeLineThickness:Number;
private var _sliceThickness:Number;
private var _shapePoints:Array;
private var _shapeColor:uint;
private var _lineConfig:Object;
private var _shapeBlendRatio:Number;
private var _endingShapePoints:Array;
override public function draw():void{
var _local1:Rectangle;
var _local2:Number;
var _local3:Point;
var _local4:Object;
if (this._graphicsDirty){
this._graphicsDirty = false;
this.graphics.clear();
if (this._shapePoints){
_local1 = Geometry.bounds(this._shapePoints);
_local2 = Geometry.getFillScale(new Point(this._width, this._height), new Point(_local1.width, _local1.height));
_local3 = new Point(((this._width / 2) - ((_local2 * (_local1.left + _local1.right)) / 2)), ((this._height / 2) - ((_local2 * (_local1.top + _local1.bottom)) / 2)));
this.graphics.lineStyle();
this.graphics.beginFill(MathUtility.lerpColor(this._shapeColor, this._shapeBlendColor, this._shapeBlendRatio));
GraphicsUtility.drawShape(this.graphics, this._shapePoints, _local2, _local3);
this.graphics.endFill();
if (this._endingShapePoints){
this.graphics.lineStyle();
this.graphics.beginFill(this._shapeColor);
GraphicsUtility.drawShape(this.graphics, this._endingShapePoints, _local2, _local3);
this.graphics.endFill();
};
if (this._slices){
this.graphics.lineStyle(this._sliceThickness, this._sliceColor, 1, false, "normal", CapsStyle.SQUARE);
for each (_local4 in this._slices) {
GraphicsUtility.drawDashedLine(this.graphics, new Point(((_local2 * _local4.p1.x) + _local3.x), ((_local2 * _local4.p1.y) + _local3.y)), new Point(((_local2 * _local4.p2.x) + _local3.x), ((_local2 * _local4.p2.y) + _local3.y)), this._sliceDashLength, this._sliceGapLength);
};
};
this.graphics.lineStyle(this._shapeLineThickness, this._shapeColor);
GraphicsUtility.drawShape(this.graphics, this._shapePoints, _local2, _local3);
this.graphics.endFill();
};
};
}
override public function update():void{
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._sliceDashLength = Number(_arg1.sliceDashLength);
this._sliceGapLength = Number(_arg1.sliceGapLength);
this._sliceColor = uint(_arg1.sliceColor);
this._shapeBlendColor = uint(_arg1.shapeBlendColor);
this._shapeBlendRatio = Number(_arg1.shapeBlendRatio);
this._sliceThickness = Number(_arg1.sliceThickness);
this._shapeLineThickness = Number(_arg1.shapeLineThickness);
this._width = Number(_arg1.width);
this._height = Number(_arg1.height);
}
public function setShapePoints(_arg1:Array, _arg2:uint):void{
this._shapePoints = _arg1;
this._shapeColor = _arg2;
this._graphicsDirty = true;
}
public function setSlices(_arg1:Array):void{
this._slices = _arg1;
this._graphicsDirty = true;
}
public function setEndingShapePoints(_arg1:Array):void{
this._endingShapePoints = _arg1;
this._graphicsDirty = true;
}
}
}//package Slice.app.scene.objects
Section 72
//LineSegment (Slice.app.scene.objects.LineSegment)
package Slice.app.scene.objects {
import flash.display.*;
import Slice.scene.*;
import Slice.scene.objects.*;
import flash.geom.*;
public class LineSegment extends SceneObject {
private var _graphicsDirty:Boolean;// = true
private var _lineColor:uint;
private var _gapLength:uint;// = 10
private var _p1:Point;
private var _p2:Point;
private var _lineThickness:Number;
private var _dashLength:uint;// = 10
protected function set point2(_arg1:Point):void{
this._p2 = _arg1;
this._graphicsDirty = true;
}
protected function get graphicsDirty():Boolean{
return (this._graphicsDirty);
}
override public function draw():void{
if (this._graphicsDirty){
this.graphics.clear();
if (((this._p1) && (this._p2))){
this.graphics.lineStyle(this._lineThickness, this._lineColor, 1, false, "normal", CapsStyle.SQUARE);
GraphicsUtility.drawDashedLine(this.graphics, this._p1, this._p2, this._dashLength, this._gapLength);
this._graphicsDirty = false;
};
};
}
protected function get lineColor():uint{
return (this._lineColor);
}
protected function set point1(_arg1:Point):void{
this._p1 = _arg1;
this._graphicsDirty = true;
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._lineColor = uint(_arg1.color);
this._lineThickness = Number(_arg1.thickness);
this._gapLength = uint(_arg1.gapLength);
this._dashLength = uint(_arg1.dashLength);
}
protected function get dashLength():uint{
return (this._dashLength);
}
protected function get gapLength():uint{
return (this._gapLength);
}
protected function get point2():Point{
return (this._p2);
}
public function setPoints(_arg1:Point, _arg2:Point):void{
this._p1 = _arg1;
this._p2 = _arg2;
this._graphicsDirty = true;
this.draw();
}
protected function get lineThickness():Number{
return (this._lineThickness);
}
protected function get point1():Point{
return (this._p1);
}
}
}//package Slice.app.scene.objects
Section 73
//LineSegmentExplosion (Slice.app.scene.objects.LineSegmentExplosion)
package Slice.app.scene.objects {
import flash.display.*;
import flash.geom.*;
import Slice.geometry.*;
public class LineSegmentExplosion extends LineSegment {
private var _maxDashVTheta:Number;
private var _gravity:Number;
private var _maxDashVx:Number;
private var _maxDashVy:Number;
private var _dashes:Array;
override public function draw():void{
var _local1:Dash;
var _local2:Number;
var _local3:Number;
if (this._dashes){
this.graphics.clear();
this.graphics.lineStyle(this.lineThickness, this.lineColor, 1, false, "normal", CapsStyle.SQUARE);
for each (_local1 in this._dashes) {
_local2 = Math.cos(_local1.theta);
_local3 = Math.sin(_local1.theta);
this.graphics.moveTo((_local1.x - ((_local2 * _local1.length) / 2)), (_local1.y - ((_local3 * _local1.length) / 2)));
this.graphics.lineTo((_local1.x + ((_local2 * _local1.length) / 2)), (_local1.y + ((_local3 * _local1.length) / 2)));
};
};
}
override public function setPoints(_arg1:Point, _arg2:Point):void{
var _local7:Point;
var _local8:Dash;
this._dashes = [];
var _local3:Vector = new Vector((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
var _local4:Number = ((_local3.x * _local3.x) + (_local3.y * _local3.y));
_local3.normalize(this.dashLength);
var _local5:Vector = new Vector(_local3.x, _local3.y);
_local5.normalize(this.gapLength);
var _local6:Point = new Point(_arg1.x, _arg1.y);
while (Geometry.distanceSquared(_arg1, _local6) < _local4) {
_local7 = new Point((_local6.x + _local3.x), (_local6.y + _local3.y));
_local8 = new Dash();
_local8.length = this.dashLength;
if (Geometry.distanceSquared(_arg1, _local7) >= _local4){
_local7 = _arg2;
_local8.length = Geometry.distance(_local6, _local7);
};
_local8.x = ((_local6.x + _local7.x) / 2);
_local8.y = ((_local6.y + _local7.y) / 2);
_local8.theta = Math.atan2((_local7.y - _local6.y), (_local7.x - _local6.x));
_local8.vx = (this._maxDashVx * (1 - (2 * Math.random())));
_local8.vy = (this._maxDashVy * (1 - (2 * Math.random())));
_local8.vtheta = (this._maxDashVTheta * (1 - (2 * Math.random())));
this._dashes.push(_local8);
_local6.x = (_local6.x + (_local3.x + _local5.x));
_local6.y = (_local6.y + (_local3.y + _local5.y));
};
}
override public function update():void{
var _local1:Dash;
if (this._dashes){
for each (_local1 in this._dashes) {
_local1.vy = (_local1.vy + this._gravity);
_local1.x = (_local1.x + _local1.vx);
_local1.y = (_local1.y + _local1.vy);
_local1.theta = (_local1.theta + _local1.vtheta);
};
};
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._gravity = Number(_arg1.gravity);
this._maxDashVTheta = Number(_arg1.maxDashVTheta);
this._maxDashVx = Number(_arg1.maxDashVx);
this._maxDashVy = Number(_arg1.maxDashVy);
}
}
}//package Slice.app.scene.objects
class Dash {
public var vx:Number;
public var vy:Number;
public var length:Number;
public var vtheta:Number;
public var x:Number;
public var y:Number;
public var theta:Number;
private function Dash(){
}
}
Section 74
//LineSegmentFade (Slice.app.scene.objects.LineSegmentFade)
package Slice.app.scene.objects {
import flash.geom.*;
public class LineSegmentFade extends LineSegment {
private var _progress:Number;
private var _dx:Number;
private var _dy:Number;
private var _fadeRate:Number;
override public function setPoints(_arg1:Point, _arg2:Point):void{
super.setPoints(_arg1, _arg2);
this._dx = (this._fadeRate * (_arg1.x - _arg2.x));
this._dy = (this._fadeRate * (_arg1.y - _arg2.y));
this._progress = 0;
}
override public function update():void{
this.point2 = new Point((this.point2.x + this._dx), (this.point2.y + this._dy));
this._progress = (this._progress + this._fadeRate);
if (this._progress >= 1){
this.parent.removeChild(this);
};
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._fadeRate = Number(_arg1.fadeRate);
}
}
}//package Slice.app.scene.objects
Section 75
//RemovedShapesContainer (Slice.app.scene.objects.RemovedShapesContainer)
package Slice.app.scene.objects {
import flash.display.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.geometry.*;
import flash.utils.*;
public class RemovedShapesContainer extends SceneObject {
private var _shapeMaxRotation:Number;// = 0
private var _shapeAcceleration:Vector;
private var _fadeRate:Number;// = 0
private var _shapeVelocity:Number;// = 0
private var _color:uint;// = 0
private var _fillGraphic:DisplayObject;// = null
private var _shapeData:Dictionary;
private var _fillBitmap:BitmapData;// = null
public function set color(_arg1:uint):void{
this._color = _arg1;
}
override public function update():void{
var _local2:Shape;
var _local3:Object;
var _local1:uint;
while (_local1 < this.numChildren) {
_local2 = (this.getChildAt(_local1) as Shape);
_local2.alpha = (_local2.alpha - this._fadeRate);
if (_local2.alpha <= 0){
this.removeChildAt(_local1);
delete this._shapeData[_local2];
_local1--;
} else {
_local3 = this._shapeData[_local2];
_local2.rotation = (_local2.rotation + _local3.rot);
_local3.vx = (_local3.vx + this._shapeAcceleration.x);
_local3.vy = (_local3.vy + this._shapeAcceleration.y);
_local2.x = (_local2.x + _local3.vx);
_local2.y = (_local2.y + _local3.vy);
};
_local1++;
};
}
public function set fillGraphic(_arg1:DisplayObject):void{
this._fillGraphic = _arg1;
if (_arg1){
this._fillBitmap = new BitmapData(_arg1.width, _arg1.height, true, 0);
this._fillBitmap.draw(_arg1);
} else {
this._fillBitmap = null;
};
}
override public function draw():void{
}
public function addShape(_arg1:Array, _arg2:Vector):void{
var _local7:Matrix;
var _local3:Shape = new Shape();
var _local4:Point = Geometry.getCenter(_arg1);
_local3.x = _local4.x;
_local3.y = _local4.y;
if (this._fillBitmap){
_local7 = new Matrix();
_local7.translate(-(_local4.x), -(_local4.y));
_local3.graphics.beginBitmapFill(this._fillBitmap, _local7);
} else {
_local3.graphics.beginFill(this._color);
};
var _local5:Point = _arg1[0];
_local3.graphics.moveTo((_local5.x - _local4.x), (_local5.y - _local4.y));
var _local6:uint = 1;
while (_local6 < _arg1.length) {
_local5 = _arg1[_local6];
_local3.graphics.lineTo((_local5.x - _local4.x), (_local5.y - _local4.y));
_local6++;
};
_local5 = _arg1[0];
_local3.graphics.lineTo((_local5.x - _local4.x), (_local5.y - _local4.y));
_local3.graphics.endFill();
this.addChild(_local3);
_arg2.normalize(this._shapeVelocity);
this._shapeData[_local3] = {rot:(this._shapeMaxRotation * (1 - (2 * Math.random()))), vx:_arg2.x, vy:_arg2.y};
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._shapeData = new Dictionary(true);
this._fadeRate = Number(_arg1.shapeFadeRate);
this._shapeMaxRotation = Number(_arg1.shapeMaxRotation);
this._shapeVelocity = Number(_arg1.shapeVelocity);
this._shapeAcceleration = new Vector(Number(_arg1.shapeAccelerationX), Number(_arg1.shapeAccelerationY));
}
public function get color():uint{
return (this._color);
}
public function get fillGraphic():DisplayObject{
return (this._fillGraphic);
}
}
}//package Slice.app.scene.objects
Section 76
//SceneTransition (Slice.app.scene.objects.SceneTransition)
package Slice.app.scene.objects {
import Slice.*;
import flash.display.*;
import flash.media.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.geometry.*;
import flash.utils.*;
public class SceneTransition extends SceneObject {
private var _maxSliceDistance:Number;
private var _fadeRate:Number;
private var _shapeData:Dictionary;
private var _sound:Sound;
private var _shapeVel:Number;
override public function update():void{
var _local1:uint;
var _local2:DisplayObject;
var _local3:Object;
if (this.numChildren > 0){
_local1 = 0;
while (_local1 < this.numChildren) {
_local2 = this.getChildAt(_local1);
_local3 = this._shapeData[_local2];
_local2.x = (_local2.x + _local3.x);
_local2.y = (_local2.y + _local3.y);
_local2.alpha = (_local2.alpha - this._fadeRate);
if (_local2.alpha <= 0){
this.removeChildAt(_local1);
_local1--;
};
_local1++;
};
};
}
public function start(_arg1:BitmapData):void{
var _local2:Array;
var _local3:Array;
var _local4:Point;
var _local5:Point;
var _local6:Point;
if (Math.random() > 0.5){
_local4 = new Point(this.randomMidPoint(_arg1.width), 0);
_local5 = new Point(this.randomMidPoint(_arg1.width), _arg1.height);
_local2 = [new Point(0, 0), _local4, _local5, new Point(0, _arg1.height)];
_local3 = [_local4, new Point(_arg1.width, 0), new Point(_arg1.width, _arg1.height), _local5];
_local6 = new Vector((_local4.y - _local5.y), (_local5.x - _local4.x));
} else {
_local4 = new Point(0, this.randomMidPoint(_arg1.height));
_local5 = new Point(_arg1.width, this.randomMidPoint(_arg1.height));
_local2 = [new Point(0, 0), new Point(_arg1.width, 0), _local5, _local4];
_local3 = [_local4, _local5, new Point(_arg1.width, _arg1.height), new Point(0, _arg1.height)];
_local6 = new Vector((_local5.y - _local4.y), (_local4.x - _local5.x));
};
this._shapeData = new Dictionary();
_local6.normalize(this._shapeVel);
this.createShape(_local2, _arg1, _local6);
this.createShape(_local3, _arg1, new Point(-(_local6.x), -(_local6.y)));
this._sound.play();
}
private function createShape(_arg1:Array, _arg2:BitmapData, _arg3:Point):Shape{
var _local4:Shape = new Shape();
_local4.graphics.beginBitmapFill(_arg2, null, false);
_local4.graphics.moveTo(_arg1[0].x, _arg1[0].y);
var _local5:uint = 1;
while (_local5 < _arg1.length) {
_local4.graphics.lineTo(_arg1[_local5].x, _arg1[_local5].y);
_local5++;
};
_local4.graphics.endFill();
this._shapeData[_local4] = _arg3;
this.addChild(_local4);
return (_local4);
}
private function randomMidPoint(_arg1:Number):Number{
var _local2:Number = Math.random();
return (((_arg1 * 0.5) + (this._maxSliceDistance * (1 - ((2 * _local2) * _local2)))));
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._shapeVel = Number(_arg1.shapeVelocity);
this._fadeRate = Number(_arg1.fadeRate);
this._maxSliceDistance = Number(_arg1.maxSliceDistance);
this._sound = ResourceManager.sound(_arg1.sound);
}
}
}//package Slice.app.scene.objects
Section 77
//VolumeSlider (Slice.app.scene.objects.VolumeSlider)
package Slice.app.scene.objects {
import flash.events.*;
import Slice.scene.objects.*;
import flash.geom.*;
public class VolumeSlider extends Button {
private var _height:Number;
private var _width:Number;
private var _volume:Number;// = 1
public static const EVENT_VOLUME_CHANGED:String = "volumeChanged";
public function VolumeSlider(){
this.upOnMouseOut = false;
}
override protected function onStageMouseUp(_arg1:MouseEvent):void{
if (this.mouseIsDown){
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this.dispatchEvent(new Event(EVENT_VOLUME_CHANGED));
};
super.onStageMouseUp(_arg1);
}
private function updateVolume(_arg1:Number, _arg2:Number):void{
var _local3:Point = this.globalToLocal(new Point(_arg1, _arg2));
this.volume = Math.max(0, Math.min(1, (_local3.x / this.width)));
}
override protected function onMouseDown(_arg1:MouseEvent):void{
super.onMouseDown(_arg1);
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this.updateVolume(_arg1.stageX, _arg1.stageY);
}
override protected function createSkins():void{
this.upSkin = new VolumeSliderSkin();
this.overSkin = new VolumeSliderSkin();
this.downSkin = new VolumeSliderSkin();
this.disabledSkin = new VolumeSliderSkin();
}
override public function set width(_arg1:Number):void{
this._width = _arg1;
this.resize();
}
override public function get width():Number{
return (this._width);
}
override public function set height(_arg1:Number):void{
this._height = _arg1;
this.resize();
}
override public function initialize(_arg1:Object):void{
this._width = ((Number(_arg1.width)) || (0));
this._height = ((Number(_arg1.height)) || (0));
super.initialize(_arg1);
}
public function set volume(_arg1:Number):void{
var value = _arg1;
this._volume = value;
this.forEachSkin(function (_arg1:VolumeSliderSkin, _arg2:Number):void{
_arg1.volume = _arg2;
}, value);
}
override public function get height():Number{
return (this._height);
}
protected function onMouseMove(_arg1:MouseEvent):void{
this.updateVolume(_arg1.stageX, _arg1.stageY);
}
public function get volume():Number{
return (this._volume);
}
}
}//package Slice.app.scene.objects
Section 78
//VolumeSliderSkin (Slice.app.scene.objects.VolumeSliderSkin)
package Slice.app.scene.objects {
import Slice.scene.objects.*;
public class VolumeSliderSkin extends Skin {
private var _backgroundColor:uint;
private var _volume:Number;// = 1
private var _barColor:uint;
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._backgroundColor = ((uint(_arg1.backgroundColor)) || (0));
this._barColor = ((uint(_arg1.barColor)) || (0));
}
public function set volume(_arg1:Number):void{
this._volume = _arg1;
this.graphicsDirty = true;
}
public function get volume():Number{
return (this._volume);
}
override public function draw():void{
var _local1:Number;
var _local2:Number;
if (this.graphicsDirty){
this.graphicsDirty = false;
_local1 = this.width;
_local2 = this.height;
this.graphics.clear();
this.graphics.beginFill(this._backgroundColor);
this.graphics.moveTo(0, _local2);
this.graphics.lineTo(_local1, 0);
this.graphics.lineTo(_local1, _local2);
this.graphics.lineTo(0, _local2);
this.graphics.endFill();
this.graphics.beginFill(this._barColor);
this.graphics.moveTo(0, _local2);
this.graphics.lineTo((this._volume * _local1), ((1 - this._volume) * _local2));
this.graphics.lineTo((this._volume * _local1), _local2);
this.graphics.lineTo(0, _local2);
this.graphics.endFill();
};
}
}
}//package Slice.app.scene.objects
Section 79
//IntroScene (Slice.app.scene.IntroScene)
package Slice.app.scene {
import Slice.*;
import flash.events.*;
import flash.display.*;
import Slice.scene.*;
import Slice.data.*;
import Slice.scene.objects.*;
import Slice.app.*;
import flash.geom.*;
import Slice.app.scene.objects.*;
import flash.net.*;
import flash.utils.*;
public class IntroScene extends SceneGraph {
private var _buttonLevels:Dictionary;
private var _webLinkButton:Button;
private var _webLinkUrl:String;
private function onLevelClick(_arg1:MouseEvent):void{
_arg1.stopPropagation();
var _local2:SceneObject = (_arg1.target as SceneObject);
var _local3:BitmapData = new BitmapData(this.width, this.height, false);
_local3.draw(this.stage);
SceneManager.loadSceneGroup("play", {level:this._buttonLevels[_local2], transitionGraphic:_local3});
}
override public function deinitialize():void{
super.deinitialize();
this._webLinkButton.removeEventListener(MouseEvent.CLICK, this.onWebLinkClick);
var _local1:SceneObject = this.getSceneObject("levelButtons");
var _local2:uint;
while (_local2 < _local1.numChildren) {
_local1.getChildAt(_local2).removeEventListener(MouseEvent.CLICK, this.onLevelClick);
_local2++;
};
}
private function onWebLinkClick(_arg1:MouseEvent):void{
_arg1.stopPropagation();
navigateToURL(new URLRequest(this._webLinkUrl));
}
override public function initialize(_arg1:Object, _arg2:Object=null):void{
var lvl:Object;
var savedLevelData:GameStateLevel;
var btn:LevelButton;
var transition:SceneTransition;
var config = _arg1;
var state = _arg2;
super.initialize(config, state);
this._webLinkButton = (this.getSceneObject("webLink") as Button);
this._webLinkButton.addEventListener(MouseEvent.CLICK, this.onWebLinkClick);
this._webLinkUrl = String(config.webLinkUrl);
TextBox(this.getSceneObject("versionText")).text = ((("v " + Configuration.version) + (Configuration.buildName) ? (" " + Configuration.buildName) : "") + (Configuration.debug) ? " debug" : "");
this._buttonLevels = new Dictionary(true);
var buttonSpacingX:Number = Number(config.buttonSpacingX);
var buttonSpacingY:Number = Number(config.buttonSpacingY);
var buttonCols:uint = uint(config.buttonColumns);
var levels:Array = DataManager.levelDataService.getLevels();
var buttonContainer:SceneObject = this.getSceneObject("levelButtons");
var buttonConfig:Object = Configuration.getSceneObjectConfig(config.buttonType);
var col:uint;
var row:uint;
var prevLevelCompleted:Boolean;
var hiddenLevelsVisible:Boolean;
var gameState:GameState = GameState(Profile.current.currentGame);
var k:uint;
while (k < levels.length) {
lvl = levels[k];
savedLevelData = gameState.getLevelData(lvl.id);
if (((lvl.hidden) && (!(prevLevelCompleted)))){
} else {
btn = (this.createSceneObject(buttonConfig, buttonContainer) as LevelButton);
btn.addEventListener(MouseEvent.CLICK, this.onLevelClick);
btn.enabled = prevLevelCompleted;
btn.x = (col * buttonSpacingX);
btn.y = (row * buttonSpacingY);
btn.setLevelData(lvl.shapePoints.map(function (_arg1:Object, _arg2:uint, _arg3:Array):Point{
return (new Point(_arg1.x, _arg1.y));
}), uint(lvl.color), ((savedLevelData == null)) ? 0 : savedLevelData.slices);
this._buttonLevels[btn] = lvl.id;
col = (col + 1);
if (col >= buttonCols){
col = 0;
row = (row + 1);
};
if (((!((lvl.required === false))) && (!((lvl.saveState === false))))){
prevLevelCompleted = !((savedLevelData == null));
};
if (lvl.hidden){
hiddenLevelsVisible = true;
};
};
k = (k + 1);
};
if (hiddenLevelsVisible){
buttonContainer.y = config.hiddenLevelButtonsY;
};
var transitionGraphic:BitmapData = ((state)!=null) ? (state.transitionGraphic as BitmapData) : null;
if (transitionGraphic != null){
transition = (this.getSceneObject("transition") as SceneTransition);
transition.start(transitionGraphic);
};
}
}
}//package Slice.app.scene
Section 80
//PlayHUDScene (Slice.app.scene.PlayHUDScene)
package Slice.app.scene {
import Slice.*;
import flash.events.*;
import flash.display.*;
import Slice.scene.*;
import Slice.data.*;
import Slice.scene.objects.*;
import Slice.app.*;
import flash.geom.*;
import Slice.app.scene.objects.*;
import Slice.utils.*;
import flash.utils.*;
public class PlayHUDScene extends SceneGraph {
private var _singlePreviousSliceText:String;
private var _pauseKeys:Array;
private var _menuButton:Button;
private var _restartDelay:uint;
private var _windowDelay:uint;
private var _playScene:PlayScene;
private var _slices:Array;
private var _instructionsAppearFrames:uint;
private var _muteButton:CheckBox;
private var _windowAppearFrames:uint;
private var _pauseWindow:Window;
private var _levelID:String;
private var _winAreaRatio:Number;
private var _progressBar:LevelProgressBar;
private var _winWindow:Window;
private var _volumeSlider:VolumeSlider;
private function onMuteChanged(_arg1:Event):void{
this._volumeSlider.enabled = !(this._muteButton.checked);
Profile.current.settings.soundMuted = this._muteButton.checked;
Profile.current.saveSettings();
}
private function get winMainMenuButton():Button{
return ((this.getSceneObject("winMainMenuButton") as Button));
}
private function winLevel():void{
var _local7:Object;
var _local8:GameStateLevel;
this._playScene.inputEnabled = false;
var _local1:GameStateLevel = new GameStateLevel();
var _local2:Number = this._playScene.getOriginalArea();
_local1.areaRatio = (this._playScene.getArea() / _local2);
_local1.slices = this._slices.length;
var _local3:TextBox = TextBox(this.getSceneObject("newBestText"));
_local3.visible = false;
var _local4:TextBox = TextBox(this.getSceneObject("previousBestText"));
_local4.visible = false;
var _local5:TextBox = TextBox(this.getSceneObject("previousBestSlicesText"));
_local5.visible = false;
if (DataManager.levelDataService.getLevelData(this._levelID).saveState !== false){
DataManager.scoringDataService.saveLevelScore(this._levelID, _local1.slices, _local1.areaRatio);
_local8 = GameState(Profile.current.currentGame).getLevelData(this._levelID);
if (_local8){
if (_local8.slices > _local1.slices){
_local3.visible = true;
};
_local4.visible = (_local5.visible = true);
_local5.text = ((_local8.slices > 1)) ? StringUtility.format(_local5.text, _local8.slices) : this._singlePreviousSliceText;
_local8.areaRatio = Math.min(_local1.areaRatio, _local8.areaRatio);
_local8.slices = Math.min(_local1.slices, _local8.slices);
} else {
GameState(Profile.current.currentGame).setLevelData(this._levelID, _local1);
};
Profile.current.saveGames();
};
this.reviewShape.setSlices(this._slices);
this.reviewShape.setEndingShapePoints(this._playScene.getShapePoints());
TextBox(this.getSceneObject("sliceCountText")).text = this._slices.length.toString();
TextBox(this.getSceneObject("endAreaText")).text = StringUtility.formatPercentage(_local1.areaRatio);
TextBox(this.getSceneObject("avgSliceText")).text = StringUtility.formatPercentage(((1 - _local1.areaRatio) / this._slices.length));
var _local6:Number = 0;
for each (_local7 in this._slices) {
_local6 = Math.max(_local6, _local7.area);
};
this.winMainMenuButton.addEventListener(MouseEvent.CLICK, this.onMainMenuClick);
this.replayButton.addEventListener(MouseEvent.CLICK, this.onRetryClick);
this.nextLevelButton.addEventListener(MouseEvent.CLICK, this.onNextLevelClick);
setTimeout(this.showWinWindow, this._windowDelay);
}
private function onMainMenuClick(_arg1:MouseEvent):void{
SceneManager.loadSceneGroup("intro", {transitionGraphic:this.getTransitionGraphic()});
}
override public function initialize(_arg1:Object, _arg2:Object=null):void{
var _local5:SceneTransition;
super.initialize(_arg1, _arg2);
this._singlePreviousSliceText = String(_arg1.singlePreviousSliceText);
this._instructionsAppearFrames = uint(_arg1.instructionsAppearFrames);
this._windowAppearFrames = uint(_arg1.windowAppearFrames);
this._windowDelay = uint(_arg1.windowDelay);
this._restartDelay = uint(_arg1.restartDelay);
this._playScene = (SceneManager.getScene("play") as PlayScene);
this._playScene.addEventListener(PlayScene.EVENT_BALL_SLICE_COLLISION, this.onBallSliceCollision);
this._playScene.addEventListener(PlayScene.EVENT_INVALID_SLICE, this.onInvalidSlice);
this._playScene.addEventListener(PlayScene.EVENT_SLICE, this.onSlice);
this._progressBar = (this.getSceneObject("progressBar") as LevelProgressBar);
this._winWindow = (this.getSceneObject("winWindow") as Window);
this._pauseKeys = (_arg1.pauseKeys as Array);
this._pauseWindow = (this.getSceneObject("pauseWindow") as Window);
this._menuButton = (this.getSceneObject("menuButton") as Button);
this._menuButton.addEventListener(MouseEvent.CLICK, this.onMenuClick);
this._volumeSlider = (this.getSceneObject("volumeSlider") as VolumeSlider);
this._volumeSlider.addEventListener(VolumeSlider.EVENT_VOLUME_CHANGED, this.onVolumeChanged);
this._volumeSlider.volume = Profile.current.settings.soundVolume;
this._volumeSlider.enabled = !(Profile.current.settings.soundMuted);
this._muteButton = (this.getSceneObject("muteButton") as CheckBox);
this._muteButton.addEventListener(CheckBox.EVENT_CHECKED_CHANGED, this.onMuteChanged);
this._muteButton.checked = Profile.current.settings.soundMuted;
this.pauseMainMenuButton.addEventListener(MouseEvent.CLICK, this.onMainMenuClick);
this.resumeButton.addEventListener(MouseEvent.CLICK, this.onResumeClick);
this.restartButton.addEventListener(MouseEvent.CLICK, this.onRestartClick);
this.stage.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUp);
this.stage.addEventListener(Event.DEACTIVATE, this.onStageDeactivate);
var _local3:String = (((_arg2) && (_arg2.level))) ? _arg2.level : DataManager.levelDataService.defaultLevelID;
this.loadLevel(_local3);
var _local4:BitmapData = (_arg2.transitionGraphic as BitmapData);
if (_local4 != null){
_local5 = (this.getSceneObject("transition") as SceneTransition);
_local5.start(_local4);
};
}
private function getTransitionGraphic():BitmapData{
var _local1:BitmapData = new BitmapData(this.width, this.height, false);
_local1.draw(this.stage);
return (_local1);
}
private function get restartButton():Button{
return ((this.getSceneObject("restartButton") as Button));
}
private function onVolumeChanged(_arg1:Event):void{
Profile.current.settings.soundVolume = this._volumeSlider.volume;
Profile.current.saveSettings();
}
private function onPauseMenuTransitionComplete(_arg1:Event):void{
this._pauseWindow.visible = false;
}
private function get instructions():SceneObject{
return (this.getSceneObject("instructions"));
}
private function get pauseMainMenuButton():Button{
return ((this.getSceneObject("mainMenuButton") as Button));
}
private function get reviewShape():LevelReviewShape{
return ((this.getSceneObject("reviewShape") as LevelReviewShape));
}
private function onStageDeactivate(_arg1:Event):void{
this.showPauseMenu();
}
private function restartLevel():void{
SceneManager.loadSceneGroup("play", {level:this._levelID, transitionGraphic:this.getTransitionGraphic()});
}
private function onRestartClick(_arg1:MouseEvent):void{
_arg1.stopPropagation();
this.restartLevel();
}
private function onKeyUp(_arg1:KeyboardEvent):void{
if (this._pauseKeys.indexOf(_arg1.keyCode) >= 0){
if (this._pauseWindow.visible){
this.hidePauseMenu();
} else {
this.showPauseMenu();
};
};
}
public function loadLevel(_arg1:String):void{
var id = _arg1;
this._levelID = id;
var levelData:Object = DataManager.levelDataService.getLevelData(id);
this._progressBar.barColor = uint(levelData.color);
this._winAreaRatio = ((Number(levelData.winAreaRatio)) || (0));
if (this._winAreaRatio){
this._progressBar.goal = this._winAreaRatio;
this._progressBar.progress = (this._progressBar.displayedProgress = 1);
} else {
this._progressBar.visible = false;
};
this._slices = [];
if ((levelData.objects is Array)){
this.initializeSceneObjects(levelData.objects);
};
this.reviewShape.setShapePoints(levelData.shapePoints.map(function (_arg1:Object, _arg2:uint, _arg3:Array):Point{
return (new Point(_arg1.x, _arg1.y));
}), levelData.color);
}
private function get resumeButton():Button{
return ((this.getSceneObject("resumeButton") as Button));
}
private function hidePauseMenu():void{
this._playScene.enabled = true;
var _local1:PropertyTransistion = new PropertyTransistion(this._pauseWindow, "alpha", this._windowAppearFrames, 1, 0);
_local1.addEventListener(Event.COMPLETE, this.onPauseMenuTransitionComplete);
_local1.start();
}
override public function deinitialize():void{
super.deinitialize();
this.nextLevelButton.removeEventListener(MouseEvent.CLICK, this.onNextLevelClick);
this.winMainMenuButton.removeEventListener(MouseEvent.CLICK, this.onMainMenuClick);
this.replayButton.removeEventListener(MouseEvent.CLICK, this.onRetryClick);
this.restartButton.removeEventListener(MouseEvent.CLICK, this.onRestartClick);
this._playScene.removeEventListener(PlayScene.EVENT_BALL_SLICE_COLLISION, this.onBallSliceCollision);
this._playScene.removeEventListener(PlayScene.EVENT_INVALID_SLICE, this.onInvalidSlice);
this._playScene.removeEventListener(PlayScene.EVENT_SLICE, this.onSlice);
this.resumeButton.removeEventListener(MouseEvent.CLICK, this.onResumeClick);
this.pauseMainMenuButton.removeEventListener(MouseEvent.CLICK, this.onMainMenuClick);
this._volumeSlider.removeEventListener(VolumeSlider.EVENT_VOLUME_CHANGED, this.onVolumeChanged);
this._muteButton.removeEventListener(CheckBox.EVENT_CHECKED_CHANGED, this.onMuteChanged);
this.stage.removeEventListener(Event.DEACTIVATE, this.onStageDeactivate);
this.stage.removeEventListener(KeyboardEvent.KEY_UP, this.onKeyUp);
}
private function onMenuClick(_arg1:MouseEvent):void{
this.showPauseMenu();
}
private function onBallSliceCollision(_arg1:Event):void{
this.loseLevel();
}
private function get nextLevelButton():TextButton{
return ((this.getSceneObject("nextLevelButton") as TextButton));
}
private function onInvalidSlice(_arg1:Event):void{
}
private function showWinWindow():void{
this._winWindow.visible = true;
var _local1:PropertyTransistion = new PropertyTransistion(this._winWindow, "alpha", this._windowAppearFrames, 0, 1);
_local1.start();
}
private function onSlice(_arg1:SliceEvent):void{
var _local3:PropertyTransistion;
this._slices.push({p1:_arg1.point1, p2:_arg1.point2, area:_arg1.area});
var _local2:Number = (this._playScene.getArea() / this._playScene.getOriginalArea());
this._progressBar.progress = _local2;
if (_local2 < this._winAreaRatio){
this.winLevel();
} else {
if (((!((this.instructions == null))) && (!(this.instructions.visible)))){
this.instructions.visible = true;
_local3 = new PropertyTransistion(this.instructions, "alpha", this._instructionsAppearFrames, 0, 1);
_local3.start();
};
};
}
private function loseLevel():void{
this._playScene.inputEnabled = false;
setTimeout(this.restartLevel, this._restartDelay);
}
private function showPauseMenu():void{
var _local1:PropertyTransistion;
if (this._playScene.inputEnabled){
this._pauseWindow.visible = true;
this._playScene.enabled = false;
_local1 = new PropertyTransistion(this._pauseWindow, "alpha", this._windowAppearFrames, 0, 1);
_local1.start();
};
}
private function get replayButton():Button{
return ((this.getSceneObject("replayButton") as Button));
}
private function onResumeClick(_arg1:MouseEvent):void{
this.hidePauseMenu();
}
private function onNextLevelClick(_arg1:MouseEvent):void{
_arg1.stopPropagation();
var _local2:String = DataManager.levelDataService.getNextLevelID(this._levelID);
if (_local2){
SceneManager.loadSceneGroup("play", {level:_local2, transitionGraphic:this.getTransitionGraphic()});
} else {
SceneManager.loadSceneGroup("intro", {transitionGraphic:this.getTransitionGraphic()});
};
}
private function onRetryClick(_arg1:MouseEvent):void{
_arg1.stopPropagation();
this.restartLevel();
}
}
}//package Slice.app.scene
Section 81
//PlayScene (Slice.app.scene.PlayScene)
package Slice.app.scene {
import Slice.*;
import flash.events.*;
import flash.display.*;
import Slice.scene.*;
import Slice.data.*;
import flash.media.*;
import Slice.scene.objects.*;
import flash.geom.*;
import Slice.app.scene.objects.*;
import Slice.geometry.*;
import Slice.utils.*;
public class PlayScene extends SceneGraph {
private var _lineFadeConfig:Object;
private var _mousePrevPos:Point;
private var _lastIntersection:Point;
private var _shape:BoundaryShape;
private var _maxCollisionIterations:uint;
private var _wallSliceSound:Sound;
private var _sliceSounds:Array;
private var _playContainer:SceneObject;
private var _ballContainer:DisplayObjectContainer;
private var _secretSliceSound:Sound;
private var _ballElasticity:Number;
private var _originalArea:Number;
private var _mousePositions:Array;
private var _lineExplosionConfig:Object;
private var _sliceCollisionSound:Sound;
private var _removedShapes:RemovedShapesContainer;
private var _segment:LineSegment;
private var _invalidSliceSound:Sound;
private var _inputEnabled:Boolean;// = true
private var disabled:Boolean;// = false
public static const EVENT_INVALID_SLICE:String = "invalidSlice";
public static const EVENT_BALL_SLICE_COLLISION:String = "ballSliceCollision";
public static const EVENT_SLICE:String = "slice";
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (((_arg1) && (this._inputEnabled))){
this.enableInput();
} else {
this.disableInput();
};
}
public function getArea():Number{
return (this._shape.getArea());
}
private function createSlice(_arg1:Point, _arg2:Point):void{
var _local7:Boolean;
var _local8:Boolean;
var _local9:uint;
var _local10:Ball;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local3:BoundaryIntersection = this._shape.getNearestPoint(_arg1);
var _local4:BoundaryIntersection = this._shape.getNearestPoint(_arg2);
if ((((_local3.point.type == BoundaryShapePoint.TYPE_WALL)) || ((_local4.point.type == BoundaryShapePoint.TYPE_WALL)))){
this._wallSliceSound.play();
this.onInvalidSlice(_local3.point, _local4.point);
return;
};
if (Math.floor(_local3.length) == Math.floor(_local4.length)){
return;
};
var _local5:Array = this._shape.getSlicePoints(_local3.length, _local4.length);
var _local6:Array = (_local5[0] as Array);
if (this._ballContainer.numChildren > 0){
_local7 = true;
_local8 = true;
_local9 = 0;
while (_local9 < this._ballContainer.numChildren) {
_local10 = (this._ballContainer.getChildAt(_local9) as Ball);
if (!Geometry.pointInsideShape(new Point(_local10.x, _local10.y), _local6)){
_local7 = false;
} else {
_local8 = false;
};
_local9++;
};
if (((!(_local7)) && (!(_local8)))){
this._invalidSliceSound.play();
this.onInvalidSlice(_local3.point, _local4.point);
} else {
if (_local7){
_local11 = _local6;
_local12 = _local5[1];
} else {
if (_local8){
_local11 = _local5[1];
_local12 = _local6;
};
};
this._removedShapes.addShape(_local12, this.getRemovedShapeVector(_local3.point, _local4.point, _local11));
this._shape.points = _local11;
this.onSlice(_local3.point, _local4.point, _local12);
};
} else {
_local13 = _local5[1];
if (Geometry.area(_local6) < Geometry.area(_local13)){
_local13 = _local6;
_local6 = _local5[1];
};
this._removedShapes.addShape(_local13, this.getRemovedShapeVector(_local3.point, _local4.point, _local6));
this._shape.points = _local6;
this.onSlice(_local3.point, _local4.point, _local13);
};
}
private function enableInput():void{
this.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.onStageMouseDown);
this.stage.addEventListener(MouseEvent.MOUSE_UP, this.onStageMouseUp);
}
override public function initialize(_arg1:Object, _arg2:Object=null):void{
var config = _arg1;
var state = _arg2;
super.initialize(config, state);
this._ballElasticity = config.ballElasticity;
this._playContainer = this.getSceneObject("playContainer");
this._shape = (this.getSceneObject("shape") as BoundaryShape);
this._segment = (this.getSceneObject("lineSegment") as LineSegment);
this._segment.visible = false;
this._removedShapes = (this.getSceneObject("removedShapes") as RemovedShapesContainer);
this._ballContainer = this.getSceneObject("ballContainer");
this._sliceSounds = config.sliceSounds.map(function (_arg1:Object, _arg2:int, _arg3:Array):Object{
return ({minLength:_arg1.minLength, sound:ResourceManager.sound(_arg1.sound)});
});
this._secretSliceSound = ResourceManager.sound(config.secretSliceSound);
this._wallSliceSound = ResourceManager.sound(config.wallSliceSound);
this._invalidSliceSound = ResourceManager.sound(config.invalidSliceSound);
this._sliceCollisionSound = ResourceManager.sound(config.collisionSound);
var levelID:String = (((state) && (state.level))) ? state.level : DataManager.levelDataService.defaultLevelID;
this._lineExplosionConfig = Configuration.getSceneObjectConfig(config.lineSegmentExplosionType);
this._lineFadeConfig = Configuration.getSceneObjectConfig(config.lineSegmentFadeType);
this._maxCollisionIterations = uint(config.maxCollisionIterations);
this.loadLevel(levelID);
this.enableInput();
}
private function onCollision(_arg1:Point):void{
this._sliceCollisionSound.play();
var _local2:LineSegmentExplosion = (this.createSceneObject(this._lineExplosionConfig, this._playContainer) as LineSegmentExplosion);
_local2.setPoints(this._lastIntersection, _arg1);
this.dispatchEvent(new Event(EVENT_BALL_SLICE_COLLISION));
}
public function get inputEnabled():Boolean{
return (this._inputEnabled);
}
public function getShapePoints():Array{
return (this._shape.points);
}
public function set inputEnabled(_arg1:Boolean):void{
this._inputEnabled = _arg1;
if (((_arg1) && (this.enabled))){
this.enableInput();
} else {
this.disableInput();
};
}
private function loadLevel(_arg1:String):void{
var b:Object;
var levelID = _arg1;
var levelData:Object = DataManager.levelDataService.getLevelData(levelID);
var points:Array = (levelData.shapePoints as Array);
this._shape.points = points.map(function (_arg1:Object, _arg2:uint, _arg3:Array):Point{
return (new BoundaryShapePoint(_arg1.x, _arg1.y, ((_arg1.type) || (0))));
});
this._shape.color = (this._removedShapes.color = uint(levelData.color));
if (levelData.shapeGraphic){
this._shape.fillGraphic = ResourceManager.graphic(levelData.shapeGraphic);
};
this._shape.draw();
this._removedShapes.fillGraphic = this._shape;
this._originalArea = this._shape.getArea();
var bounds:Rectangle = this._shape.getBounds(this);
this._playContainer.x = ((this.width / 2) - ((bounds.left + bounds.right) / 2));
this._playContainer.y = ((this.height / 2) - ((bounds.top + bounds.bottom) / 2));
var balls:Array = (levelData.balls as Array);
for each (b in balls) {
this.createSceneObject(Configuration.getFullSceneObjectConfig(b), this._ballContainer);
};
}
private function onStageMouseUp(_arg1:MouseEvent):void{
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this._mousePrevPos = null;
this._mousePositions = null;
this._lastIntersection = null;
this._segment.visible = false;
}
private function disableInput():void{
this._lastIntersection = null;
this._segment.visible = false;
this.stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.onStageMouseDown);
this.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onStageMouseUp);
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
override public function update():void{
var _local1:Array;
if (this.disabled){
return;
};
super.update();
this.resolveBallBallCollisions();
this.resolveBallShapeCollisions();
if (((this._lastIntersection) && (this._mousePositions))){
this._mousePositions.push(this._mousePrevPos);
if (this._mousePositions.length > 2){
this._mousePositions.shift();
};
_local1 = ObjectUtility.copyArray(this._mousePositions);
_local1.push(this._lastIntersection);
if (this.ballCollidesShape(_local1)){
this.onCollision(this._mousePrevPos);
};
};
}
private function resolveBallBallCollisions():void{
var _local3:Ball;
var _local4:uint;
var _local5:Ball;
var _local6:Rectangle;
var _local7:Rectangle;
var _local8:MovingCircle;
var _local9:MovingCircle;
var _local10:Number;
var _local11:Number;
var _local12:Point;
var _local13:Point;
var _local14:Vector;
var _local15:Vector;
var _local16:Vector;
var _local17:Vector;
var _local18:Vector;
var _local19:Vector;
var _local20:Number;
var _local21:Point;
var _local22:Point;
var _local23:Vector;
var _local1:uint = this._ballContainer.numChildren;
var _local2:uint;
while (_local2 < _local1) {
_local3 = (this._ballContainer.getChildAt(_local2) as Ball);
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local5 = (this._ballContainer.getChildAt(_local4) as Ball);
_local6 = new Rectangle((Math.min(_local3.x, _local3.previousPosition.x) - _local3.radius), (Math.min(_local3.y, _local3.previousPosition.y) - _local3.radius), ((2 * _local3.radius) + Math.abs((_local3.x - _local3.previousPosition.x))), ((2 * _local3.radius) + Math.abs((_local3.y - _local3.previousPosition.y))));
_local7 = new Rectangle((Math.min(_local5.x, _local5.previousPosition.x) - _local5.radius), (Math.min(_local5.y, _local5.previousPosition.y) - _local5.radius), ((2 * _local5.radius) + Math.abs((_local5.x - _local5.previousPosition.x))), ((2 * _local5.radius) + Math.abs((_local5.y - _local5.previousPosition.y))));
if (!_local6.intersects(_local7)){
} else {
_local8 = new MovingCircle(_local3.previousPosition, new Vector(_local3.vx, _local3.vy), _local3.radius);
_local9 = new MovingCircle(_local5.previousPosition, new Vector(_local5.vx, _local5.vy), _local5.radius);
_local10 = Geometry.circleCircleCollision(_local8, _local9);
if (_local10 > 0){
_local12 = new Point((_local3.previousPosition.x + (_local10 * _local8.velocity.x)), (_local3.previousPosition.y + (_local10 * _local8.velocity.y)));
_local13 = new Point((_local5.previousPosition.x + (_local10 * _local9.velocity.x)), (_local5.previousPosition.y + (_local10 * _local9.velocity.y)));
_local14 = new Vector((_local13.x - _local12.x), (_local13.y - _local12.y));
_local15 = _local14.getPerpendicular();
_local16 = _local8.velocity.getComponent(_local14);
_local17 = _local8.velocity.getComponent(_local15);
_local18 = _local9.velocity.getComponent(_local14);
_local19 = _local9.velocity.getComponent(_local15);
_local20 = (1 - _local10);
_local21 = _local17.add(_local18);
_local21.normalize(_local8.velocity.length);
_local3.vx = _local21.x;
_local3.vy = _local21.y;
_local3.x = (_local12.x + (_local20 * _local3.vx));
_local3.y = (_local12.y + (_local20 * _local3.vy));
_local22 = _local19.add(_local16);
_local22.normalize(_local9.velocity.length);
_local5.vx = _local22.x;
_local5.vy = _local22.y;
_local5.x = (_local13.x + (_local20 * _local5.vx));
_local5.y = (_local13.y + (_local20 * _local5.vy));
};
_local11 = (_local3.radius + _local5.radius);
if (Geometry.distanceSquared(new Point(_local3.x, _local3.y), new Point(_local5.x, _local5.y)) < (_local11 * _local11)){
_local23 = new Vector((_local5.x - _local3.x), (_local5.y - _local3.y));
_local23.normalize(((_local11 - _local23.length) / 2));
_local3.x = (_local3.x - _local23.x);
_local3.y = (_local3.y - _local23.y);
_local5.x = (_local5.x + _local23.x);
_local5.y = (_local5.y + _local23.y);
};
};
_local4++;
};
_local2++;
};
}
override public function deinitialize():void{
super.deinitialize();
this.disableInput();
}
private function getRemovedShapeVector(_arg1:Point, _arg2:Point, _arg3:Array):Vector{
var _local4:Vector = new Vector((_arg2.y - _arg1.y), (_arg1.x - _arg2.x));
_local4.normalize(0.1);
var _local5:Point = new Point((((_arg1.x + _arg2.x) / 2) + _local4.x), (((_arg1.y + _arg2.y) / 2) + _local4.y));
return ((Geometry.pointInsideShape(_local5, _arg3)) ? new Vector(-(_local4.x), -(_local4.y)) : _local4);
}
private function initSecretCursor():void{
}
private function onStageMouseDown(_arg1:MouseEvent):void{
this._mousePrevPos = this._shape.globalToLocal(new Point(_arg1.stageX, _arg1.stageY));
this._mousePositions = [this._mousePrevPos];
this._lastIntersection = null;
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
private function onInvalidSlice(_arg1:Point, _arg2:Point):void{
var _local3:LineSegmentFade = (this.createSceneObject(this._lineFadeConfig, this._playContainer) as LineSegmentFade);
_local3.setPoints(_arg1, _arg2);
this._mousePositions = [];
this.dispatchEvent(new Event(EVENT_INVALID_SLICE));
}
private function ballCollidesShape(_arg1:Array):Boolean{
var _local3:Ball;
var _local2:uint;
while (_local2 < this._ballContainer.numChildren) {
_local3 = (this._ballContainer.getChildAt(_local2) as Ball);
if (Geometry.circleCollidesShape(new Point(_local3.x, _local3.y), _local3.radius, _arg1)){
return (true);
};
_local2++;
};
return (false);
}
private function resolveBallShapeCollisions():void{
var _local4:Ball;
var _local5:uint;
var _local6:Point;
var _local7:Vector;
var _local8:Vector;
var _local1:uint = this._ballContainer.numChildren;
var _local2:uint = this._maxCollisionIterations;
var _local3:uint;
while (_local3 < _local1) {
_local4 = (this._ballContainer.getChildAt(_local3) as Ball);
_local5 = 0;
while (_local5 < _local2) {
_local6 = new Point(_local4.x, _local4.y);
_local7 = this._shape.getEdgeCircleIntersection(_local6, _local4.radius);
if (_local7 != null){
_local8 = new Vector(_local4.vx, _local4.vy);
_local8.reflect(_local7.getPerpendicular());
_local4.x = (_local4.x - (this._ballElasticity * _local7.x));
_local4.y = (_local4.y - (this._ballElasticity * _local7.y));
_local4.vx = _local8.x;
_local4.vy = _local8.y;
} else {
break;
};
_local5++;
};
_local3++;
};
}
private function onSlice(_arg1:Point, _arg2:Point, _arg3:Array):void{
var _local4:Number;
var _local5:uint;
var _local6:Object;
this._mousePositions = [];
if (!DataManager.secretDataService.secretActivated){
_local4 = Geometry.distanceSquared(_arg1, _arg2);
_local5 = (this._sliceSounds.length - 1);
while (_local5 >= 0) {
_local6 = this._sliceSounds[_local5];
if (_local4 >= (_local6.minLength * _local6.minLength)){
_local6.sound.play();
break;
};
_local5--;
};
} else {
this._secretSliceSound.play();
};
this.dispatchEvent(new SliceEvent(EVENT_SLICE, _arg1, _arg2, Geometry.area(_arg3)));
}
public function getOriginalArea():Number{
return (this._originalArea);
}
private function onMouseMove(_arg1:MouseEvent):void{
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local6:Array;
var _local7:int;
var _local8:BoundaryShapePoint;
var _local9:Point;
var _local10:Point;
var _local2:Point = this._shape.globalToLocal(new Point(_arg1.stageX, _arg1.stageY));
if (this._mousePrevPos == null){
this._mousePrevPos = _local2;
} else {
if (Geometry.distance(_local2, this._mousePrevPos) >= 1){
_local3 = ((this._mousePositions)!=null) ? this._mousePositions.length : 0;
if (((((!((this._lastIntersection == null))) && ((_local3 > 0)))) && (this.ballCollidesShape([this._lastIntersection, this._mousePositions[(_local3 - 1)], _local2])))){
this.onCollision(_local2);
} else {
_local4 = this._shape.getEdgeIntersections(this._mousePrevPos, _local2);
if (this._lastIntersection != null){
_local6 = this._shape.getEdgeIntersections(this._lastIntersection, ((_local4.length > 0)) ? _local4[0] : _local2);
if (_local6.length > 0){
if ((((_local6[0].x == this._lastIntersection.x)) && ((_local6[0].y == this._lastIntersection.y)))){
_local6.shift();
};
_local7 = (_local6.length - 1);
while (_local7 >= 0) {
_local4.unshift(_local6[_local7]);
_local7--;
};
};
_local4.unshift(this._lastIntersection);
};
if ((((_local4.length > 0)) && (this._shape.pointIsInside(_local2)))){
_local8 = _local4[(_local4.length - 1)];
if (_local8.type != BoundaryShapePoint.TYPE_WALL){
this._lastIntersection = _local8;
this._segment.setPoints(this._lastIntersection, _local2);
this._segment.visible = true;
} else {
this._wallSliceSound.play();
this._lastIntersection = null;
this._segment.visible = false;
this._mousePositions = [];
};
} else {
this._lastIntersection = null;
this._segment.visible = false;
};
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
_local9 = _local4[_local5];
_local10 = _local4[(_local5 + 1)];
if (this._shape.pointIsInside(new Point(((_local9.x + _local10.x) / 2), ((_local9.y + _local10.y) / 2)))){
this.createSlice(_local9, _local10);
};
_local5++;
};
this._mousePrevPos = _local2;
};
};
};
}
}
}//package Slice.app.scene
Section 82
//SliceEvent (Slice.app.scene.SliceEvent)
package Slice.app.scene {
import flash.events.*;
import flash.geom.*;
public class SliceEvent extends Event {
private var _p1:Point;
private var _p2:Point;
private var _area:Number;
public function SliceEvent(_arg1:String, _arg2:Point, _arg3:Point, _arg4:Number){
super(_arg1);
this._p1 = _arg2;
this._p2 = _arg3;
this._area = _arg4;
}
public function get point1():Point{
return (this._p1);
}
public function get point2():Point{
return (this._p2);
}
public function get area():Number{
return (this._area);
}
}
}//package Slice.app.scene
Section 83
//GameState (Slice.app.GameState)
package Slice.app {
import Slice.data.*;
public class GameState implements IGameState {
private var _levels:Object;
public function GameState(){
this._levels = {};
}
public function serialize():Object{
var _local2:String;
var _local1:Object = {};
_local1.levels = {};
for (_local2 in this._levels) {
if (this._levels[_local2]){
_local1.levels[_local2] = GameStateLevel(this._levels[_local2]).serialize();
};
};
return (_local1);
}
public function getLevelData(_arg1:String):GameStateLevel{
return (this._levels[_arg1]);
}
public function setLevelData(_arg1:String, _arg2:GameStateLevel):void{
this._levels[_arg1] = _arg2;
}
public function clone():IGameState{
var _local2:String;
var _local1:GameState = new GameState();
for (_local2 in this._levels) {
if (this._levels[_local2]){
_local1.setLevelData(_local2, this._levels[_local2].clone());
};
};
return (_local1);
}
public function deserialize(_arg1:Object):void{
var _local2:String;
var _local3:GameStateLevel;
this._levels = {};
if ((_arg1.levels is Object)){
for (_local2 in _arg1.levels) {
if (_arg1.levels[_local2]){
_local3 = new GameStateLevel();
_local3.deserialize(_arg1.levels[_local2]);
this._levels[_local2] = _local3;
};
};
};
}
}
}//package Slice.app
Section 84
//GameStateLevel (Slice.app.GameStateLevel)
package Slice.app {
public class GameStateLevel {
public var slices:uint;// = 0
public var areaRatio:Number;// = 0
public function GameStateLevel(_arg1:uint=0, _arg2:Number=0){
this.slices = _arg1;
this.areaRatio = _arg2;
}
public function serialize():Object{
return ({slices:this.slices, areaRatio:this.areaRatio});
}
public function clone():GameStateLevel{
var _local1:GameStateLevel = new GameStateLevel();
_local1.areaRatio = this.areaRatio;
_local1.slices = this.slices;
return (_local1);
}
public function deserialize(_arg1:Object):void{
this.slices = uint(_arg1.slices);
this.areaRatio = Number(_arg1.areaRatio);
}
}
}//package Slice.app
Section 85
//CompiledLevelDataService (Slice.data.CompiledLevelDataService)
package Slice.data {
import Slice.app.data.*;
public class CompiledLevelDataService extends DataService implements ILevelDataService {
private var _levels:Array;
private var _defaultLevelID:String;
public function getLevels():Array{
return (this._levels);
}
public function get defaultLevelID():String{
return (this._defaultLevelID);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
var _local2:Object = new LevelData();
this._defaultLevelID = String(_local2.defaultLevelID);
this._levels = _local2.levels;
}
public function getNextLevelID(_arg1:String):String{
var _local4:Object;
var _local2:Boolean;
var _local3:uint;
while (_local3 < this._levels.length) {
_local4 = this._levels[_local3];
if (_local4.id == _arg1){
_local2 = true;
} else {
if (_local2){
return (_local4.id);
};
};
_local3++;
};
if (!_local2){
throw (new Error(("Level not found: " + _arg1)));
};
return (null);
}
public function getLevelData(_arg1:String):Object{
var _local3:Object;
var _local2:uint;
while (_local2 < this._levels.length) {
_local3 = this._levels[_local2];
if (_local3.id == _arg1){
return (_local3);
};
_local2++;
};
throw (new Error(("Level data not found: " + _arg1)));
}
}
}//package Slice.data
Section 86
//DataErrorEvent (Slice.data.DataErrorEvent)
package Slice.data {
import flash.events.*;
public class DataErrorEvent extends AsyncErrorEvent {
public function DataErrorEvent(_arg1:String, _arg2:String):void{
super(_arg1, false, false, _arg2);
}
}
}//package Slice.data
Section 87
//DataLoadedEvent (Slice.data.DataLoadedEvent)
package Slice.data {
import flash.events.*;
public class DataLoadedEvent extends Event {
private var _data:Object;
public function DataLoadedEvent(_arg1:String, _arg2:Object):void{
this._data = _arg2;
super(_arg1, false, false);
}
public function get data():Object{
return (this._data);
}
}
}//package Slice.data
Section 88
//DataManager (Slice.data.DataManager)
package Slice.data {
import Slice.*;
import flash.display.*;
import Slice.instrumentation.*;
public class DataManager {
private static var _profileDataService:IProfileDataService;
private static var _componentContainer:DisplayObjectContainer;
private static var _levelDataService:ILevelDataService;
private static var _scoringDataService:IScoringDataService;
private static var _secretDataService:IGameSecretDataService;
public static function get componentContainer():DisplayObjectContainer{
return (_componentContainer);
}
public static function get levelDataService():ILevelDataService{
return (_levelDataService);
}
public static function get secretDataService():IGameSecretDataService{
return (_secretDataService);
}
public static function get scoringDataService():IScoringDataService{
return (_scoringDataService);
}
public static function initialize(_arg1:DisplayObjectContainer):void{
_componentContainer = _arg1;
if (Configuration.data.profileDataService != null){
_profileDataService = (new Configuration.data.profileDataService.type() as IProfileDataService);
_profileDataService.initialize(Configuration.data.profileDataService);
};
if (Configuration.data.levelDataService != null){
_levelDataService = (new Configuration.data.levelDataService.type() as ILevelDataService);
_levelDataService.initialize(Configuration.data.levelDataService);
};
if (Configuration.data.scoringDataService != null){
_scoringDataService = (new Configuration.data.scoringDataService.type() as IScoringDataService);
_scoringDataService.initialize(Configuration.data.scoringDataService);
};
if (Configuration.data.secretDataService != null){
_secretDataService = (new Configuration.data.secretDataService.type() as IGameSecretDataService);
_secretDataService.initialize(Configuration.data.secretDataService);
};
LogManager.logInfo(DataManager, "DataManager initialized");
}
public static function get profileDataService():IProfileDataService{
return (_profileDataService);
}
}
}//package Slice.data
Section 89
//DataService (Slice.data.DataService)
package Slice.data {
import flash.events.*;
import Slice.instrumentation.*;
public class DataService extends EventDispatcher implements IDataService {
private var _name:String;// = null
public static const EVENT_DATA_LOADED:String = "dataLoaded";
public static const EVENT_DATA_SAVE_ERROR:String = "dataSaveError";
public static const EVENT_DATA_SAVED:String = "dataSaved";
public static const EVENT_DATA_LOAD_ERROR:String = "dataLoadError";
public function initialize(_arg1:Object):void{
this._name = (_arg1.name as String);
}
protected function onDataSaveError(_arg1:String, _arg2:String):void{
LogManager.logError(this, null, ((("Error saving data '" + _arg1) + "': ") + _arg2));
this.dispatchEvent(new DataErrorEvent(_arg1, _arg2));
}
protected function onDataSaved(_arg1:String):void{
LogManager.logInfo(this, ("Data saved: " + _arg1));
this.dispatchEvent(new Event(_arg1));
}
protected function onDataLoadError(_arg1:String, _arg2:String):void{
LogManager.logError(this, null, ((("Error loading data '" + _arg1) + "': ") + _arg2));
this.dispatchEvent(new DataErrorEvent(_arg1, _arg2));
}
public function get name():String{
return (this._name);
}
protected function onDataLoaded(_arg1:String, _arg2:Object):void{
LogManager.logInfo(this, ("Data loaded: " + _arg1));
this.dispatchEvent(new DataLoadedEvent(_arg1, _arg2));
}
}
}//package Slice.data
Section 90
//GameSecretDataService (Slice.data.GameSecretDataService)
package Slice.data {
import flash.events.*;
import Slice.instrumentation.*;
public class GameSecretDataService extends DataService implements IGameSecretDataService {
private var _secretActivated:Boolean;// = false
private var _code:Array;
private var _pressedKeys:Array;
public static const EVENT_SECRET_ACTIVATED:String = "secretActivated";
public function GameSecretDataService(){
this._pressedKeys = [];
}
public function get secretActivated():Boolean{
return (this._secretActivated);
}
public function onKeyPressed(_arg1:uint):void{
var _local2:uint;
this._pressedKeys.push(_arg1);
if (this._pressedKeys.length >= this._code.length){
this._pressedKeys.splice(0, (this._pressedKeys.length - this._code.length));
_local2 = 0;
while (_local2 < this._code.length) {
if (this._pressedKeys[_local2] != this._code[_local2]){
return;
};
_local2++;
};
LogManager.logInfo(this, "Konami code entered");
this._secretActivated = !(this._secretActivated);
this.dispatchEvent(new Event(EVENT_SECRET_ACTIVATED));
};
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._code = _arg1.code;
}
}
}//package Slice.data
Section 91
//IDataService (Slice.data.IDataService)
package Slice.data {
import flash.events.*;
public interface IDataService extends IEventDispatcher {
function initialize(_arg1:Object):void;
function get name():String;
}
}//package Slice.data
Section 92
//IGameSecretDataService (Slice.data.IGameSecretDataService)
package Slice.data {
public interface IGameSecretDataService extends IDataService {
function get secretActivated():Boolean;
function onKeyPressed(_arg1:uint):void;
}
}//package Slice.data
Section 93
//IGameState (Slice.data.IGameState)
package Slice.data {
public interface IGameState {
function serialize():Object;
function clone():IGameState;
function deserialize(_arg1:Object):void;
}
}//package Slice.data
Section 94
//ILevelDataService (Slice.data.ILevelDataService)
package Slice.data {
public interface ILevelDataService extends IDataService {
function getLevelData(_arg1:String):Object;
function getNextLevelID(_arg1:String):String;
function getLevels():Array;
function get defaultLevelID():String;
}
}//package Slice.data
Section 95
//IProfileDataService (Slice.data.IProfileDataService)
package Slice.data {
public interface IProfileDataService extends IDataService {
function saveSettings(_arg1:Object):void;
function loadSettings():void;
function loadGames():void;
function saveGames(_arg1:Array):void;
}
}//package Slice.data
Section 96
//IScoringDataService (Slice.data.IScoringDataService)
package Slice.data {
public interface IScoringDataService extends IDataService {
function saveLevelScore(_arg1:String, _arg2:uint, _arg3:Number):void;
}
}//package Slice.data
Section 97
//LocalProfileDataService (Slice.data.LocalProfileDataService)
package Slice.data {
import flash.net.*;
public class LocalProfileDataService extends DataService implements IProfileDataService {
private var _profile:SharedObject;
private static const GamesObjectName:String = "games";
private static const SettingsObjectName:String = "settings";
public function loadGames():void{
if (this._profile.size > 0){
this.onDataLoaded(ProfileDataEvent.GAMES_LOADED, this._profile.data[GamesObjectName]);
} else {
this.onDataLoaded(ProfileDataEvent.GAMES_LOADED, null);
};
}
public function saveSettings(_arg1:Object):void{
this._profile.setProperty(SettingsObjectName, _arg1);
this._profile.flush();
this.onDataSaved(ProfileDataEvent.SETTINGS_SAVED);
}
public function saveGames(_arg1:Array):void{
this._profile.setProperty(GamesObjectName, _arg1);
this._profile.flush();
this.onDataSaved(ProfileDataEvent.GAMES_SAVED);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this._profile = SharedObject.getLocal(_arg1.sharedObjectName);
}
public function loadSettings():void{
if (this._profile.size > 0){
this.onDataLoaded(ProfileDataEvent.SETTINGS_LOADED, this._profile.data[SettingsObjectName]);
} else {
this.onDataLoaded(ProfileDataEvent.SETTINGS_LOADED, null);
};
}
}
}//package Slice.data
Section 98
//LocalScoringDataService (Slice.data.LocalScoringDataService)
package Slice.data {
import Slice.instrumentation.*;
public class LocalScoringDataService extends DataService implements IScoringDataService {
public function saveLevelScore(_arg1:String, _arg2:uint, _arg3:Number):void{
LogManager.logInfo(this, "Ignoring level score");
}
}
}//package Slice.data
Section 99
//ProfileDataEvent (Slice.data.ProfileDataEvent)
package Slice.data {
public class ProfileDataEvent {
public static const SETTINGS_LOADED:String = "settingsLoaded";
public static const GAMES_LOADED:String = "gamesLoaded";
public static const GAMES_SAVE_ERROR:String = "gameSaveError";
public static const GAMES_SAVED:String = "gamesSaved";
public static const SETTINGS_SAVED:String = "settingsSaved";
public static const GAMES_LOAD_ERROR:String = "gameLoadError";
public static const SETTINGS_SAVE_ERROR:String = "settingsSaveError";
public static const SETTINGS_LOAD_ERROR:String = "settingsLoadError";
}
}//package Slice.data
Section 100
//Geometry (Slice.geometry.Geometry)
package Slice.geometry {
import flash.geom.*;
import Slice.utils.*;
public class Geometry {
public static function distanceSquared(_arg1:Point, _arg2:Point=null):Number{
var _local3:Point = ((_arg2)!=null) ? _arg2.subtract(_arg1) : _arg1;
return (((_local3.x * _local3.x) + (_local3.y * _local3.y)));
}
public static function circleCollidesShape(_arg1:Point, _arg2:Number, _arg3:Array):Boolean{
if (_arg3.length == 2){
return (circleCollidesSegment(_arg1, _arg2, _arg3[0], _arg3[1]));
};
if (pointInsideShape(_arg1, _arg3)){
return (true);
};
var _local4:uint = _arg3.length;
var _local5:uint;
while (_local5 < _local4) {
if (circleCollidesSegment(_arg1, _arg2, _arg3[_local5], _arg3[((_local5 + 1) % _local4)])){
return (true);
};
_local5++;
};
return (false);
}
public static function distance(_arg1:Point, _arg2:Point=null):Number{
return (Math.sqrt(distanceSquared(_arg1, _arg2)));
}
public static function segmentsIntersection(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Point{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local5:Number = (_arg2.x - _arg1.x);
var _local6:Number = (_arg2.y - _arg1.y);
var _local7:Number = (_arg4.x - _arg3.x);
var _local8:Number = (_arg4.y - _arg3.y);
if (_local5 != 0){
if (_local7 != 0){
_local9 = (_local6 / _local5);
_local10 = (_local8 / _local7);
if (_local9 == _local10){
return (null);
};
_local11 = (_arg1.y - (_local9 * _arg1.x));
_local12 = (_arg3.y - (_local10 * _arg3.x));
_local13 = ((_local12 - _local11) / (_local9 - _local10));
return ((((MathUtility.between(_local13, _arg1.x, _arg2.x)) && (MathUtility.between(_local13, _arg3.x, _arg4.x)))) ? new Point(_local13, (_arg1.y + ((_local6 * (_local13 - _arg1.x)) / _local5))) : null);
} else {
_local14 = ((_arg3.x - _arg1.x) / _local5);
_local15 = (_arg1.y + (_local14 * _local6));
return ((((MathUtility.between(_local14, 0, 1)) && (MathUtility.between(_local15, _arg3.y, _arg4.y)))) ? new Point((_arg1.x + (_local5 * _local14)), _local15) : null);
};
//unresolved jump
};
if (_local7 != 0){
_local16 = ((_arg1.x - _arg3.x) / _local7);
_local17 = (_arg3.y + (_local16 * _local8));
return ((((MathUtility.between(_local16, 0, 1)) && (MathUtility.between(_local17, _arg1.y, _arg2.y)))) ? new Point((_arg3.x + (_local7 * _local16)), _local17) : null);
//unresolved jump
};
return (null);
}
public static function getCenter(_arg1:Array):Point{
var _local3:Point;
var _local2:Point = new Point();
for each (_local3 in _arg1) {
_local2.x = (_local2.x + _local3.x);
_local2.y = (_local2.y + _local3.y);
};
_local2.x = (_local2.x / _arg1.length);
_local2.y = (_local2.y / _arg1.length);
return (_local2);
}
public static function area(_arg1:Array):Number{
var _local5:uint;
var _local2:Number = 0;
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = ((_local4 + 1) % _local3);
_local2 = (_local2 + ((_arg1[_local4].x * _arg1[_local5].y) - (_arg1[_local5].x * _arg1[_local4].y)));
_local4++;
};
return ((_local2 / 2));
}
public static function circleCollidesSegment(_arg1:Point, _arg2:Number, _arg3:Point, _arg4:Point):Boolean{
var _local5:Point = nearestPoint(_arg3, _arg4, _arg1);
var _local6:Number = (_arg2 * _arg2);
if (((((MathUtility.between(_local5.x, _arg3.x, _arg4.x)) && (MathUtility.between(_local5.y, _arg3.y, _arg4.y)))) && ((distanceSquared(_local5, _arg1) <= _local6)))){
return (true);
};
return ((((distanceSquared(_arg1, _arg3) <= _local6)) || ((distanceSquared(_arg1, _arg4) <= _local6))));
}
public static function getFillScale(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.x / _arg2.x);
var _local4:Number = (_arg1.y / _arg2.y);
return (((((_local3 <= 1)) || ((_local4 <= 1)))) ? Math.min(_local3, _local4) : Math.max(_local3, _local4));
}
public static function nearestPoint(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Number=1E-5):Point{
var _local7:Number;
var _local8:Number;
var _local5:Number = (_arg2.x - _arg1.x);
var _local6:Number = (_arg2.y - _arg1.y);
if (Math.abs(_local5) < _arg4){
return (new Point(_arg1.x, _arg3.y));
};
if (Math.abs(_local6) < _arg4){
return (new Point(_arg3.x, _arg1.y));
};
_local7 = (_local6 / _local5);
_local8 = ((((-(_arg1.y) + (_local7 * _arg1.x)) + _arg3.y) + (_arg3.x / _local7)) / (_local7 + (1 / _local7)));
return (new Point(_local8, (((_local7 * _local8) + _arg1.y) - (_local7 * _arg1.x))));
}
private static function nextPointSide(_arg1:Array, _arg2:uint, _arg3:Number):int{
var _local6:int;
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 < _local4) {
_local6 = MathUtility.sign((_arg1[((_local5 + _arg2) % _local4)].x - _arg3));
if (_local6 != 0){
return (_local6);
};
_local5++;
};
return (0);
}
public static function pointInsideShape(_arg1:Point, _arg2:Array):Boolean{
var _local6:Point;
var _local7:uint;
var _local8:Point;
var _local9:Number;
var _local3:uint = _arg2.length;
var _local4:uint;
var _local5:uint;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
_local7 = ((_local5 + 1) % _local3);
_local8 = _arg2[_local7];
if ((((((_local6.x < _arg1.x)) && ((_local8.x >= _arg1.x)))) || ((((_local6.x > _arg1.x)) && ((_local8.x <= _arg1.x)))))){
_local9 = (_local6.y + (((_arg1.x - _local6.x) * (_local8.y - _local6.y)) / (_local8.x - _local6.x)));
if ((((_local9 > _arg1.y)) && (((!((_local8.x == _arg1.x))) || (!((MathUtility.sign((_local6.x - _arg1.x)) == nextPointSide(_arg2, _local7, _arg1.x)))))))){
_local4++;
};
} else {
if ((((_local6.x == _local8.x)) && ((_local6.x == _arg1.x)))){
if (MathUtility.between(_arg1.y, _local6.y, _local8.y)){
return (true);
};
};
};
_local5++;
};
return (!(MathUtility.isEven(_local4)));
}
public static function distanceRatio(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Number=1E-5):Number{
if ((((_arg1.x == _arg2.x)) && ((_arg1.y == _arg2.y)))){
return (((((_arg1.x == _arg3.x)) && ((_arg1.y == _arg3.y)))) ? 0 : NaN);
};
return (((Math.abs((_arg1.x - _arg2.x)) < _arg4)) ? ((_arg3.y - _arg1.y) / (_arg2.y - _arg1.y)) : ((_arg3.x - _arg1.x) / (_arg2.x - _arg1.x)));
}
public static function circleCircleCollision(_arg1:MovingCircle, _arg2:MovingCircle):Number{
var _local3:Vector = new Vector((_arg2.velocity.x - _arg1.velocity.x), (_arg2.velocity.y - _arg1.velocity.y));
if ((((_local3.x == 0)) && ((_local3.y == 0)))){
return (-1);
};
var _local4:Point = _arg2.position.subtract(_arg1.position);
var _local5:Number = (_arg1.radius + _arg2.radius);
var _local6:Number = (Geometry.distanceSquared(_local4) - (_local5 * _local5));
if (_local6 < 0){
return (-1);
};
var _local7:Number = _local3.lengthSquared;
var _local8:Number = (((2 * _local3.x) * _local4.x) + ((2 * _local3.y) * _local4.y));
var _local9:Number = (((((2 * _local3.x) * _local4.x) + ((2 * _local3.y) * _local4.y)) * _local8) - ((4 * _local7) * _local6));
if (_local9 < 0){
return (-1);
};
_local9 = Math.sqrt(Math.abs(_local9));
var _local10:Number = ((-(_local8) - _local9) / (2 * _local7));
var _local11:Boolean = (((_local10 > 0)) && ((_local10 <= 1)));
var _local12:Number = ((-(_local8) + _local9) / (2 * _local7));
var _local13:Boolean = (((_local12 > 0)) && ((_local12 <= 1)));
if (((_local11) && (_local13))){
return (Math.min(_local10, _local12));
};
if (_local11){
return (_local10);
};
if (_local13){
return (_local12);
};
return (-1);
}
public static function bounds(_arg1:Array):Rectangle{
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (((_arg1) && ((_arg1.length > 0)))){
_local2 = (_arg1[0] as Point);
_local3 = _local2.x;
_local4 = _local2.x;
_local5 = _local2.y;
_local6 = _local2.y;
for each (_local2 in _arg1) {
_local3 = Math.min(_local3, _local2.x);
_local4 = Math.max(_local4, _local2.x);
_local5 = Math.min(_local5, _local2.y);
_local6 = Math.max(_local6, _local2.y);
};
return (new Rectangle(_local3, _local5, (_local4 - _local3), (_local6 - _local5)));
//unresolved jump
};
return (new Rectangle());
}
}
}//package Slice.geometry
Section 101
//MovingCircle (Slice.geometry.MovingCircle)
package Slice.geometry {
import flash.geom.*;
public class MovingCircle {
public var radius:Number;
public var position:Point;
public var velocity:Vector;
public function MovingCircle(_arg1:Point, _arg2:Vector, _arg3:Number){
this.position = _arg1;
this.velocity = _arg2;
this.radius = _arg3;
}
}
}//package Slice.geometry
Section 102
//Vector (Slice.geometry.Vector)
package Slice.geometry {
import flash.geom.*;
public class Vector extends Point {
public function Vector(_arg1:Number=0, _arg2:Number=0):void{
super(_arg1, _arg2);
}
public function get lengthSquared():Number{
return (((this.x * this.x) + (this.y * this.y)));
}
public function getPerpendicular():Vector{
return (new Vector(-(this.y), this.x));
}
public function reflect(_arg1:Vector):void{
var _local2:Point = Geometry.nearestPoint(new Point(), _arg1, this);
this.x = ((2 * _local2.x) - this.x);
this.y = ((2 * _local2.y) - this.y);
}
public function getComponent(_arg1:Vector):Vector{
var _local2:Point = Geometry.nearestPoint(new Point(), _arg1, this);
return (new Vector(_local2.x, _local2.y));
}
}
}//package Slice.geometry
Section 103
//ErrorLogEntry (Slice.instrumentation.ErrorLogEntry)
package Slice.instrumentation {
public class ErrorLogEntry extends LogEntry {
public var error:Error;// = null
public function ErrorLogEntry(_arg1:Object, _arg2:Error=null, _arg3:String=null):void{
super(_arg1, _arg3);
this.error = _arg2;
}
override public function toString():String{
var _local1:String = ("Error: " + super.toString());
if (this.error != null){
_local1 = (_local1 + (" - " + this.error.toString()));
};
if (this.message != null){
_local1 = (_local1 + (" - " + this.message));
};
return (_local1);
}
}
}//package Slice.instrumentation
Section 104
//LogEntry (Slice.instrumentation.LogEntry)
package Slice.instrumentation {
import flash.utils.*;
public class LogEntry {
public var message:String;// = null
public var caller:Object;// = null
public var time:Date;
public function LogEntry(_arg1:Object, _arg2:String):void{
this.caller = _arg1;
this.message = _arg2;
this.time = new Date();
}
public function toString():String{
return (((("[" + getQualifiedClassName(this.caller)) + "] ") + message));
}
}
}//package Slice.instrumentation
Section 105
//LogEntryAddedEvent (Slice.instrumentation.LogEntryAddedEvent)
package Slice.instrumentation {
import flash.events.*;
public class LogEntryAddedEvent extends Event {
private var _entry:LogEntry;// = null
public function LogEntryAddedEvent(_arg1:String, _arg2:LogEntry):void{
super(_arg1);
this._entry = _arg2;
}
public function get entry():LogEntry{
return (this._entry);
}
}
}//package Slice.instrumentation
Section 106
//LogManager (Slice.instrumentation.LogManager)
package Slice.instrumentation {
import Slice.*;
import flash.events.*;
public class LogManager extends EventDispatcher {
private const MaxLogSize:uint = 100;
private var _log:Array;
private static const EVENT_LOG_ENTRY_ADDED:String = "log";
private static const _instance:LogManager = new (LogManager);
;
public function LogManager():void{
if (_instance != null){
throw (new Error("Only one instance of LogManager can exist"));
};
this._log = new Array();
}
public function addLogEntry(_arg1:LogEntry):void{
if (Configuration.debug){
trace(_arg1.toString());
};
this._log.push(_arg1);
if (this._log.length > MaxLogSize){
this._log.shift();
};
this.dispatchEvent(new LogEntryAddedEvent(EVENT_LOG_ENTRY_ADDED, _arg1));
}
public static function logInfo(_arg1:Object, _arg2:String):void{
instance.addLogEntry(new LogEntry(_arg1, _arg2));
}
public static function logError(_arg1:Object, _arg2:Error=null, _arg3:String=null):void{
instance.addLogEntry(new ErrorLogEntry(_arg1, _arg2, _arg3));
}
private static function get instance():LogManager{
return (_instance);
}
public static function addListener(_arg1:Function):void{
instance.addEventListener(EVENT_LOG_ENTRY_ADDED, _arg1);
}
public static function removeListener(_arg1:Function):void{
instance.removeEventListener(EVENT_LOG_ENTRY_ADDED, _arg1);
}
}
}//package Slice.instrumentation
Section 107
//Button (Slice.scene.objects.Button)
package Slice.scene.objects {
import flash.events.*;
import flash.display.*;
import Slice.utils.*;
public class Button extends SkinnedObject {
private var _upOnMouseOut:Boolean;// = true
private var _disabledSkin:DisplayObject;// = null
private var _isDown:Boolean;// = false
private var _overSkin:DisplayObject;// = null
private var _upSkin:DisplayObject;// = null
private var _downSkin:DisplayObject;// = null
private var _isOver:Boolean;// = false
public function Button():void{
this.mouseChildren = false;
this.buttonMode = true;
this.mouseEnabled = true;
this.hitArea = new Sprite();
this.hitArea.visible = false;
this.addChild(this.hitArea);
this.createSkins();
this.updateSkin();
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
}
public function get mouseIsDown():Boolean{
return (this._isDown);
}
public function get enabled():Boolean{
return (this.mouseEnabled);
}
protected function configureSkin(_arg1:DisplayObject, _arg2:Object, _arg3:String):void{
var _local4:Object = ObjectUtility.copyObject(_arg2);
ObjectUtility.copyProperties(_arg2[(_arg3 + "Skin")], _local4);
this.initializeSkin(_arg1, _local4);
}
protected function set upOnMouseOut(_arg1:Boolean):void{
this._upOnMouseOut = _arg1;
}
protected function onRollOver(_arg1:MouseEvent):void{
this._isOver = true;
this.updateSkin();
}
public function set enabled(_arg1:Boolean):void{
this.mouseEnabled = _arg1;
this.updateSkin();
}
protected function forEachSkin(_arg1:Function, ... _args):void{
if (!_args){
var _local2:Array = [];
};
_args.unshift(this.upSkin);
_arg1.apply(this, _args);
_args.shift();
_args.unshift(this.overSkin);
_arg1.apply(this, _args);
_args.shift();
_args.unshift(this.downSkin);
_arg1.apply(this, _args);
_args.shift();
_args.unshift(this.disabledSkin);
_arg1.apply(this, _args);
_args.shift();
}
protected function onMouseDown(_arg1:MouseEvent):void{
this._isDown = true;
this.updateSkin();
}
protected function createSkins():void{
this.upSkin = new Skin();
this.downSkin = new Skin();
this.overSkin = new Skin();
this.disabledSkin = new Skin();
}
protected function onStageMouseUp(_arg1:MouseEvent):void{
this._isDown = false;
this.updateSkin();
}
protected function get disabledSkin():DisplayObject{
return (this._disabledSkin);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this.configureSkin(this.upSkin, _arg1, "up");
this.configureSkin(this.overSkin, _arg1, "over");
this.configureSkin(this.downSkin, _arg1, "down");
this.configureSkin(this.disabledSkin, _arg1, "disabled");
this.resize();
}
protected function set overSkin(_arg1:DisplayObject):void{
this._overSkin = _arg1;
}
public function get mouseIsOver():Boolean{
return (this._isOver);
}
protected function updateSkin():void{
var _local1:DisplayObject;
if (!this.enabled){
_local1 = this.disabledSkin;
} else {
if (((this._isDown) && (((this._isOver) || (!(this._upOnMouseOut)))))){
_local1 = this.downSkin;
} else {
if (this._isOver){
_local1 = this.overSkin;
};
};
};
if (!_local1){
_local1 = this.upSkin;
};
this.skin = _local1;
}
private function onAddedToStage(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
this.addEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
this.addEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
this.addEventListener(MouseEvent.ROLL_OUT, this.onRollOut);
this.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
this.stage.addEventListener(MouseEvent.MOUSE_UP, this.onStageMouseUp);
}
protected function get upOnMouseOut():Boolean{
return (this._upOnMouseOut);
}
private function onRemovedFromStage(_arg1:Event):void{
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
this.removeEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
this.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
this.removeEventListener(MouseEvent.ROLL_OUT, this.onRollOut);
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
this.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onStageMouseUp);
}
protected function set upSkin(_arg1:DisplayObject):void{
this._upSkin = _arg1;
}
protected function get overSkin():DisplayObject{
return (this._overSkin);
}
protected function set disabledSkin(_arg1:DisplayObject):void{
this._disabledSkin = _arg1;
}
protected function resize():void{
this.hitArea.graphics.beginFill(0);
this.hitArea.graphics.drawRect(0, 0, this.width, this.height);
this.hitArea.graphics.endFill();
}
protected function get upSkin():DisplayObject{
return (this._upSkin);
}
protected function onRollOut(_arg1:MouseEvent):void{
this._isOver = false;
this.updateSkin();
}
protected function set downSkin(_arg1:DisplayObject):void{
this._downSkin = _arg1;
}
protected function get downSkin():DisplayObject{
return (this._downSkin);
}
}
}//package Slice.scene.objects
Section 108
//CheckBox (Slice.scene.objects.CheckBox)
package Slice.scene.objects {
import flash.events.*;
import flash.display.*;
public class CheckBox extends Button {
private var _downCheckedSkin:DisplayObject;// = null
private var _overCheckedSkin:DisplayObject;// = null
private var _checked:Boolean;// = false
private var _upCheckedSkin:DisplayObject;// = null
private var _disabledCheckedSkin:DisplayObject;// = null
public static const EVENT_CHECKED_CHANGED:String = "checkedChanged";
protected function get downCheckedSkin():DisplayObject{
return (this._downCheckedSkin);
}
protected function set downCheckedSkin(_arg1:DisplayObject):void{
this._downCheckedSkin = _arg1;
}
public function set checked(_arg1:Boolean):void{
this._checked = _arg1;
this.updateSkin();
}
protected function set upCheckedSkin(_arg1:DisplayObject):void{
this._upCheckedSkin = _arg1;
}
protected function get overCheckedSkin():DisplayObject{
return (this._overCheckedSkin);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this.configureSkin(this.upCheckedSkin, _arg1, "upChecked");
this.configureSkin(this.overCheckedSkin, _arg1, "overChecked");
this.configureSkin(this.downCheckedSkin, _arg1, "downChecked");
this.configureSkin(this.disabledCheckedSkin, _arg1, "disabledChecked");
this.addEventListener(MouseEvent.CLICK, this.onClick);
}
protected function set overCheckedSkin(_arg1:DisplayObject):void{
this._overCheckedSkin = _arg1;
}
override protected function updateSkin():void{
var _local1:DisplayObject;
if (!this._checked){
super.updateSkin();
} else {
if (!this.enabled){
_local1 = this.disabledCheckedSkin;
} else {
if (((this.mouseIsDown) && (this.mouseIsOver))){
_local1 = this.downCheckedSkin;
} else {
if (this.mouseIsOver){
_local1 = this.overCheckedSkin;
};
};
};
if (!_local1){
_local1 = this.upCheckedSkin;
};
this.skin = _local1;
};
}
public function get checked():Boolean{
return (this._checked);
}
protected function onClick(_arg1:MouseEvent):void{
this.checked = !(this.checked);
this.dispatchEvent(new Event(EVENT_CHECKED_CHANGED));
}
protected function get disabledCheckedSkin():DisplayObject{
return (this._disabledCheckedSkin);
}
protected function set disabledCheckedSkin(_arg1:DisplayObject):void{
this._disabledCheckedSkin = _arg1;
}
protected function get upCheckedSkin():DisplayObject{
return (this._upCheckedSkin);
}
override protected function createSkins():void{
super.createSkins();
this.upCheckedSkin = new Skin();
this.downCheckedSkin = new Skin();
this.overCheckedSkin = new Skin();
this.disabledCheckedSkin = new Skin();
}
}
}//package Slice.scene.objects
Section 109
//GraphicCheckBox (Slice.scene.objects.GraphicCheckBox)
package Slice.scene.objects {
public class GraphicCheckBox extends CheckBox {
override protected function createSkins():void{
this.upSkin = new GraphicSkin();
this.downSkin = new GraphicSkin();
this.overSkin = new GraphicSkin();
this.disabledSkin = new GraphicSkin();
this.upCheckedSkin = new GraphicSkin();
this.downCheckedSkin = new GraphicSkin();
this.overCheckedSkin = new GraphicSkin();
this.disabledCheckedSkin = new GraphicSkin();
}
}
}//package Slice.scene.objects
Section 110
//GraphicSkin (Slice.scene.objects.GraphicSkin)
package Slice.scene.objects {
import Slice.*;
import flash.display.*;
public class GraphicSkin extends Skin {
private var _graphic:DisplayObject;
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
if (_arg1.graphic){
this._graphic = ResourceManager.graphic(_arg1.graphic);
this.addChild(this._graphic);
};
}
}
}//package Slice.scene.objects
Section 111
//SceneObject (Slice.scene.objects.SceneObject)
package Slice.scene.objects {
import flash.display.*;
import Slice.scene.*;
public class SceneObject extends Sprite {
private var _id:String;// = null
private var _scene:SceneGraph;// = null
public function draw():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.draw();
});
}
public function update():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.update();
});
}
public function get scene():SceneGraph{
return (this._scene);
}
public function initialize(_arg1:Object):void{
this.x = ((uint(_arg1.x)) || (0));
this.y = ((uint(_arg1.y)) || (0));
this.name = String(_arg1.name);
this._id = String(_arg1.id);
if (_arg1.visible != null){
this.visible = Boolean(_arg1.visible);
};
}
public function deinitialize():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.deinitialize();
});
}
public function set scene(_arg1:SceneGraph):void{
this._scene = _arg1;
}
public function get id():String{
return (this._id);
}
}
}//package Slice.scene.objects
Section 112
//Skin (Slice.scene.objects.Skin)
package Slice.scene.objects {
import flash.display.*;
public class Skin extends Sprite {
private var _fillColor:uint;// = 0
private var _height:Number;
private var _width:Number;
private var _graphicsDirty:Boolean;// = false
private var _fillAlpha:Number;// = 0
public function draw():void{
if (this._graphicsDirty){
this.graphics.clear();
if (this._fillAlpha > 0){
this.graphics.beginFill(this._fillColor, this._fillAlpha);
this.graphics.drawRect(0, 0, this.width, this.height);
this.graphics.endFill();
};
this._graphicsDirty = false;
};
}
override public function get width():Number{
return (this._width);
}
override public function set width(_arg1:Number):void{
this._width = _arg1;
this._graphicsDirty = true;
}
override public function set height(_arg1:Number):void{
this._height = _arg1;
this._graphicsDirty = true;
}
override public function get height():Number{
return (this._height);
}
public function initialize(_arg1:Object):void{
this._fillAlpha = ((Number(_arg1.fillAlpha)) || (0));
this._fillColor = ((uint(_arg1.fillColor)) || (0));
if ((_arg1.width is Number)){
this._width = Number(_arg1.width);
};
if ((_arg1.height is Number)){
this._height = Number(_arg1.height);
};
this._graphicsDirty = true;
}
protected function set graphicsDirty(_arg1:Boolean):void{
this._graphicsDirty = _arg1;
}
protected function get graphicsDirty():Boolean{
return (this._graphicsDirty);
}
}
}//package Slice.scene.objects
Section 113
//SkinnedObject (Slice.scene.objects.SkinnedObject)
package Slice.scene.objects {
import Slice.*;
import flash.display.*;
public class SkinnedObject extends SceneObject {
private var _skin:DisplayObject;// = null
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
if (_arg1.skin){
if (_arg1.skin.graphicID){
this.skin = ResourceManager.graphic(String(_arg1.skin.graphicID));
};
this.initializeSkin(this.skin, _arg1.skin);
};
}
override public function draw():void{
super.draw();
if ((this.skin is Skin)){
Skin(this.skin).draw();
};
}
protected function initializeSkin(_arg1:DisplayObject, _arg2:Object):void{
var _local3:Skin;
if ((_arg1 is Skin)){
_local3 = (_arg1 as Skin);
_local3.width = this.width;
_local3.height = this.height;
_local3.initialize(_arg2);
} else {
_arg1.x = ((Number(_arg2.x)) || (0));
_arg1.y = ((Number(_arg2.y)) || (0));
};
}
public function set skin(_arg1:DisplayObject):void{
if (_arg1 != this.skin){
if (this._skin){
this.removeChild(this._skin);
};
this._skin = _arg1;
if (this._skin){
this.addChild(this._skin);
};
};
}
public function get skin():DisplayObject{
return (this._skin);
}
}
}//package Slice.scene.objects
Section 114
//TextBox (Slice.scene.objects.TextBox)
package Slice.scene.objects {
import Slice.scene.*;
import flash.text.*;
public class TextBox extends SceneObject {
private var _textField:TextField;
public function TextBox(){
this._textField = SceneHelper.createTextField();
this.addChild(this._textField);
}
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
SceneHelper.initializeTextField(this._textField, _arg1);
this.text = String(((_arg1.text) || ("")));
}
public function get color():uint{
return (this._textField.textColor);
}
public function set color(_arg1:uint):void{
this._textField.textColor = _arg1;
}
public function set text(_arg1:String):void{
this._textField.text = ((_arg1) || (""));
}
public function get text():String{
return (this._textField.text);
}
}
}//package Slice.scene.objects
Section 115
//TextButton (Slice.scene.objects.TextButton)
package Slice.scene.objects {
import flash.display.*;
public class TextButton extends Button {
private var _text:String;// = null
override public function initialize(_arg1:Object):void{
super.initialize(_arg1);
this.text = (_arg1.text as String);
}
public function set text(_arg1:String):void{
var value = _arg1;
this._text = value;
this.forEachSkin(function (_arg1:DisplayObject, _arg2:String):void{
TextSkin(_arg1).text = _arg2;
}, text);
this.resize();
}
override protected function createSkins():void{
this.upSkin = new TextSkin();
this.downSkin = new TextSkin();
this.overSkin = new TextSkin();
this.disabledSkin = new TextSkin();
}
public function get text():String{
return (this._text);
}
}
}//package Slice.scene.objects
Section 116
//TextSkin (Slice.scene.objects.TextSkin)
package Slice.scene.objects {
import Slice.scene.*;
import flash.text.*;
public class TextSkin extends Skin {
private var _textField:TextField;
public function TextSkin(){
this._textField = SceneHelper.createTextField();
this.addChild(this._textField);
}
override public function initialize(_arg1:Object):void{
SceneHelper.initializeTextField(this._textField, _arg1);
}
public function set text(_arg1:String):void{
this._textField.text = ((_arg1) || (""));
}
public function get text():String{
return (this._textField.text);
}
}
}//package Slice.scene.objects
Section 117
//Window (Slice.scene.objects.Window)
package Slice.scene.objects {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Window extends SkinnedObject {
private var _hitArea:Sprite;
private var _height:Number;
private var _width:Number;
public function Window(){
this._hitArea = new Sprite();
this._hitArea.visible = false;
this.addChild(this._hitArea);
this.skin = new Skin();
}
override public function set visible(_arg1:Boolean):void{
super.visible = _arg1;
if (_arg1){
this.addMouseListeners();
} else {
this.removeMouseListeners();
};
}
private function addMouseListeners():void{
this.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseEvent);
this.addEventListener(MouseEvent.MOUSE_UP, this.onMouseEvent);
this.addEventListener(MouseEvent.CLICK, this.onMouseEvent);
}
override public function set width(_arg1:Number):void{
this._width = _arg1;
}
override public function get width():Number{
return (this._width);
}
override public function set height(_arg1:Number):void{
this._height = _arg1;
}
override public function initialize(_arg1:Object):void{
var _local2:Point = this.globalToLocal(new Point(0, 0));
var _local3:Point = this.globalToLocal(new Point(this.stage.stageWidth, this.stage.stageHeight));
this._hitArea.graphics.clear();
this._hitArea.graphics.beginFill(0);
this._hitArea.graphics.drawRect(_local2.x, _local2.y, (_local3.x - _local2.x), (_local3.y - _local2.y));
this._hitArea.graphics.endFill();
this.hitArea = this._hitArea;
if (this.visible){
this.addMouseListeners();
};
this._width = Number(_arg1.width);
this._height = Number(_arg1.height);
super.initialize(_arg1);
}
override public function deinitialize():void{
this.removeMouseListeners();
}
private function onMouseEvent(_arg1:MouseEvent):void{
_arg1.stopPropagation();
}
override public function get height():Number{
return (this._height);
}
private function removeMouseListeners():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.onMouseEvent);
this.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseEvent);
this.removeEventListener(MouseEvent.CLICK, this.onMouseEvent);
}
}
}//package Slice.scene.objects
Section 118
//GraphicsUtility (Slice.scene.GraphicsUtility)
package Slice.scene {
import flash.display.*;
import flash.geom.*;
import Slice.geometry.*;
public class GraphicsUtility {
public static function drawDashedLine(_arg1:Graphics, _arg2:Point, _arg3:Point, _arg4:Number, _arg5:Number):void{
var _local10:Point;
var _local6:Point = new Point((_arg3.x - _arg2.x), (_arg3.y - _arg2.y));
var _local7:Number = ((_local6.x * _local6.x) + (_local6.y * _local6.y));
_local6.normalize(_arg4);
var _local8:Point = _local6.clone();
_local8.normalize(_arg5);
var _local9:Point = new Point(_arg2.x, _arg2.y);
while (Geometry.distanceSquared(_arg2, _local9) < _local7) {
_arg1.moveTo(_local9.x, _local9.y);
_local10 = new Point((_local9.x + _local6.x), (_local9.y + _local6.y));
if (Geometry.distanceSquared(_arg2, _local10) < _local7){
_arg1.lineTo(_local10.x, _local10.y);
} else {
_arg1.lineTo(_arg3.x, _arg3.y);
};
_local9.x = (_local9.x + (_local6.x + _local8.x));
_local9.y = (_local9.y + (_local6.y + _local8.y));
};
}
public static function drawShape(_arg1:Graphics, _arg2:Array, _arg3:Number=1, _arg4:Point=null):void{
var _local6:Point;
if (!_arg4){
_arg4 = new Point();
};
var _local5:Point = _arg2[(_arg2.length - 1)];
_arg1.moveTo(((_arg3 * _local5.x) + _arg4.x), ((_arg3 * _local5.y) + _arg4.y));
for each (_local6 in _arg2) {
_arg1.lineTo(((_arg3 * _local6.x) + _arg4.x), ((_arg3 * _local6.y) + _arg4.y));
};
}
}
}//package Slice.scene
Section 119
//PropertyTransistion (Slice.scene.PropertyTransistion)
package Slice.scene {
import flash.display.*;
public class PropertyTransistion extends Transition {
private var _property:String;
private var _endValue:Number;
private var _startValue:Number;
public function PropertyTransistion(_arg1:DisplayObject, _arg2:String, _arg3:uint, _arg4:Number, _arg5:Number){
super(_arg1, this.updateProperty, _arg3);
this._property = _arg2;
this._startValue = _arg4;
this._endValue = _arg5;
}
private function updateProperty(_arg1:DisplayObject, _arg2:Number):void{
_arg1[this._property] = (this._startValue + ((this._endValue - this._startValue) * _arg2));
}
}
}//package Slice.scene
Section 120
//SceneGraph (Slice.scene.SceneGraph)
package Slice.scene {
import Slice.*;
import flash.display.*;
import Slice.scene.objects.*;
public class SceneGraph extends Sprite {
private var _enabled:Boolean;// = false
private var _height:Number;
private var _width:Number;
private var _objects:Object;
private var _id:String;// = null
public function get enabled():Boolean{
return (this._enabled);
}
public function set enabled(_arg1:Boolean):void{
this._enabled = _arg1;
}
public function addSceneObject(_arg1:SceneObject, _arg2:DisplayObjectContainer=null, _arg3:Object=null):void{
if (_arg2 == null){
_arg2 = this;
};
_arg2.addChild(_arg1);
_arg1.scene = this;
_arg1.initialize(_arg3);
if (_arg1.id != null){
this._objects[_arg1.id] = _arg1;
};
}
public function draw():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.draw();
});
}
override public function set width(_arg1:Number):void{
this._width = _arg1;
}
override public function get width():Number{
return (this._width);
}
public function createSceneObject(_arg1:Object, _arg2:DisplayObjectContainer=null):SceneObject{
if (_arg2 == null){
_arg2 = this;
};
var _local3:SceneObject = ((Class(_arg1.type))!=null) ? (new _arg1.type() as SceneObject) : new SceneObject();
_arg2.addChild(_local3);
_local3.scene = this;
var _local4:Array = (_arg1.objects as Array);
if (_local4 != null){
this.initializeSceneObjects(_local4, _local3);
};
_local3.initialize(_arg1);
if (_local3.id != null){
this._objects[_local3.id] = _local3;
};
return (_local3);
}
public function initialize(_arg1:Object, _arg2:Object=null):void{
this._id = String(_arg1.id);
this._width = ((Number(_arg1.width)) || (this.stage.stageWidth));
this._height = ((Number(_arg1.height)) || (this.stage.stageHeight));
this._objects = {};
var _local3:Array = (_arg1.objects as Array);
if (_local3 != null){
this.initializeSceneObjects(_local3);
};
this._enabled = true;
this.stage.focus = this.stage;
}
public function deinitialize():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.deinitialize();
});
}
public function update():void{
SceneHelper.forEachChildObject(this, function (_arg1:SceneObject):void{
_arg1.update();
});
}
public function get id():String{
return (this._id);
}
override public function set height(_arg1:Number):void{
this._height = _arg1;
}
protected function initializeSceneObjects(_arg1:Array, _arg2:SceneObject=null):void{
var _local4:Object;
var _local5:SceneObject;
var _local3:uint;
while (_local3 < _arg1.length) {
_local4 = Configuration.getFullSceneObjectConfig(_arg1[_local3]);
_local5 = this.createSceneObject(_local4, _arg2);
_local3++;
};
}
override public function get height():Number{
return (this._height);
}
public function getSceneObject(_arg1:String):SceneObject{
return (this._objects[_arg1]);
}
}
}//package Slice.scene
Section 121
//SceneHelper (Slice.scene.SceneHelper)
package Slice.scene {
import flash.display.*;
import Slice.scene.objects.*;
import flash.text.*;
public class SceneHelper {
public static function forEachChildObject(_arg1:DisplayObjectContainer, _arg2:Function, ... _args):void{
var _local5:SceneObject;
var _local4:uint;
while (_local4 < _arg1.numChildren) {
_local5 = (_arg1.getChildAt(_local4) as SceneObject);
if (_local5 != null){
_arg2(_local5);
};
_local4++;
};
}
public static function createTextField(_arg1:String=null):TextField{
var _local2:TextField = new TextField();
_local2.selectable = false;
_local2.height = (_local2.width = 0);
_local2.autoSize = TextFieldAutoSize.LEFT;
_local2.mouseEnabled = false;
_local2.embedFonts = true;
if (_arg1 != null){
_local2.text = _arg1;
};
return (_local2);
}
public static function initializeTextField(_arg1:TextField, _arg2:Object):void{
_arg1.defaultTextFormat = new TextFormat(String(_arg2.fontName), String(_arg2.fontSize), uint(_arg2.fontColor), Boolean(_arg2.fontBold), null, null, null, null, _arg2.textAlign);
_arg1.defaultTextFormat.kerning = true;
_arg1.setTextFormat(_arg1.defaultTextFormat);
if ((_arg2.wordWrap is Boolean)){
_arg1.wordWrap = Boolean(_arg2.wordWrap);
};
if ((_arg2.autoSize is String)){
_arg1.autoSize = _arg2.autoSize;
};
if ((_arg2.width is Number)){
_arg1.width = Number(_arg2.width);
};
if ((_arg2.embedFonts is Boolean)){
_arg1.embedFonts = Boolean(_arg2.embedFonts);
};
}
}
}//package Slice.scene
Section 122
//SceneManager (Slice.scene.SceneManager)
package Slice.scene {
import Slice.*;
import flash.display.*;
import Slice.instrumentation.*;
public class SceneManager {
private static var _scenes:Array;
private static var _currentSceneGroup:String;
private static var _sceneContainer:DisplayObjectContainer;
public static function update():void{
var _local1:SceneGraph;
for each (_local1 in _scenes) {
if (_local1.enabled){
_local1.update();
_local1.draw();
};
};
}
public static function get currentSceneGroup():String{
return (_currentSceneGroup);
}
public static function initialize(_arg1:DisplayObjectContainer):void{
_sceneContainer = _arg1;
_scenes = [];
LogManager.logInfo(SceneManager, "SceneManager initialized");
loadSceneGroup(Configuration.scenes.defaultSceneGroup);
}
public static function unloadSceneGroup():void{
var _local1:SceneGraph;
for each (_local1 in _scenes) {
_local1.deinitialize();
_sceneContainer.removeChild(_local1);
};
_scenes = [];
LogManager.logInfo(SceneManager, ("Scene group unloaded: " + _currentSceneGroup));
_currentSceneGroup = null;
}
public static function getScene(_arg1:String):SceneGraph{
var _local2:SceneGraph;
for each (_local2 in _scenes) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function loadSceneGroup(_arg1:String, _arg2:Object=null):void{
var _local5:Object;
var _local6:SceneGraph;
if (_currentSceneGroup != null){
unloadSceneGroup();
};
var _local3:Array = Configuration.getSceneGroupConfig(_arg1);
var _local4:uint;
while (_local4 < _local3.length) {
_local5 = _local3[_local4];
_local6 = (new _local5.type() as SceneGraph);
_scenes.push(_local6);
_sceneContainer.addChild(_local6);
_local6.initialize(_local5, _arg2);
_local4++;
};
_currentSceneGroup = _arg1;
_sceneContainer.stage.focus = null;
LogManager.logInfo(SceneManager, ("Scene group loaded: " + _arg1));
}
}
}//package Slice.scene
Section 123
//Transition (Slice.scene.Transition)
package Slice.scene {
import flash.events.*;
import flash.display.*;
public class Transition extends EventDispatcher {
private var _frameCount:uint;
private var _func:Function;
private var _obj:DisplayObject;
private var _totalFrames:uint;
public function Transition(_arg1:DisplayObject, _arg2:Function, _arg3:uint){
this._obj = _arg1;
this._func = _arg2;
this._totalFrames = _arg3;
}
public function stop():void{
this._obj.removeEventListener(Event.ENTER_FRAME, this.onObjectEnterFrame);
}
private function onObjectEnterFrame(_arg1:Event):void{
this._func(this._obj, (this._frameCount / this._totalFrames));
if (this._frameCount >= this._totalFrames){
this.stop();
this.dispatchEvent(new Event(Event.COMPLETE));
};
this._frameCount++;
}
public function start():void{
this._frameCount = 0;
this._func(this._obj, 0);
this._obj.addEventListener(Event.ENTER_FRAME, this.onObjectEnterFrame);
}
}
}//package Slice.scene
Section 124
//MathUtility (Slice.utils.MathUtility)
package Slice.utils {
public class MathUtility {
public static function between(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return ((((((_arg2 <= _arg1)) && ((_arg1 <= _arg3)))) || ((((_arg3 <= _arg1)) && ((_arg1 <= _arg2))))));
}
public static function lerpColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = Math.max(Math.min(_arg3, 1), 0);
var _local5:Number = (1 - _local4);
var _local6:uint = (((_arg1 >> 16) * _local5) + ((_arg2 >> 16) * _local4));
var _local7:uint = ((((_arg1 >> 8) & 0xFF) * _local5) + (((_arg2 >> 8) & 0xFF) * _local4));
var _local8:uint = (((_arg1 & 0xFF) * _local5) + ((_arg2 & 0xFF) * _local4));
return ((((_local6 << 16) + (_local7 << 8)) + _local8));
}
public static function isEven(_arg1:int):Boolean{
return ((((_arg1 >> 1) << 1) == _arg1));
}
public static function sign(_arg1:Number):int{
return (((_arg1 == 0)) ? 0 : ((_arg1 < 0)) ? -1 : 1);
}
}
}//package Slice.utils
Section 125
//ObjectUtility (Slice.utils.ObjectUtility)
package Slice.utils {
public class ObjectUtility {
public static function copyProperties(_arg1:Object, _arg2:Object):void{
var _local3:*;
for (_local3 in _arg1) {
_arg2[_local3] = _arg1[_local3];
};
}
public static function copyObject(_arg1:Object):Object{
var _local2:Object = {};
copyProperties(_arg1, _local2);
return (_local2);
}
public static function copyArray(_arg1:Array):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
}
}//package Slice.utils
Section 126
//StringUtility (Slice.utils.StringUtility)
package Slice.utils {
public class StringUtility {
public static function formatPercentage(_arg1:Number):String{
return ((Math.round((100 * _arg1)) + "%"));
}
public static function isEmpty(_arg1:String):Boolean{
return ((((_arg1 === null)) || ((_arg1 === ""))));
}
public static function format(_arg1:String, ... _args):String{
var str = _arg1;
var replacements = _args;
return (((str)!=null) ? str.replace(/\{(\d+)\}/g, function ():String{
return (replacements[uint(arguments[1])]);
}) : null);
}
}
}//package Slice.utils
Section 127
//Configuration (Slice.Configuration)
package Slice {
import Slice.instrumentation.*;
import Slice.app.data.*;
import Slice.utils.*;
public class Configuration {
private static var _config:AppConfiguration;
private static var _sceneObjectConfigCache:Object = {};
public static function get scenes():Object{
return (_config.scenes);
}
public static function get data():Object{
return (_config.data);
}
public static function getSceneGroupConfig(_arg1:String):Array{
var _local2:Array = (_config.scenes.sceneGroups[_arg1] as Array);
if (_local2 == null){
throw (new Error(("Scene group configuration not found: " + _arg1)));
};
var _local3:Array = [];
var _local4:uint;
while (_local4 < _local2.length) {
_local3[_local4] = _config.scenes.scenes[_local2[_local4]];
_local3[_local4].id = _local2[_local4];
_local4++;
};
return (_local3);
}
public static function getFullSceneObjectConfig(_arg1:Object, _arg2:Boolean=true):Object{
var _local3:Object;
var _local5:Object;
var _local4:String = (_arg1.baseType as String);
if (_local4 != null){
_local5 = getSceneObjectConfig(_local4, _arg2);
if (_local5 == null){
throw (new Error(("Scene object configuration not found: " + _local4)));
};
_local3 = ObjectUtility.copyObject(_local5);
ObjectUtility.copyProperties(_arg1, _local3);
} else {
_local3 = _arg1;
};
return (_local3);
}
public static function get profile():Object{
return (_config.profile);
}
public static function get debug():Boolean{
return (_config.debug);
}
public static function initialize():void{
_config = new AppConfiguration();
LogManager.logInfo(Configuration, "Configuration initialized");
}
public static function get version():String{
return (_config.version);
}
public static function get buildName():String{
return (_config.buildName);
}
public static function getSceneObjectConfig(_arg1:String, _arg2:Boolean=true):Object{
var _local5:Object;
if (_arg2){
_local5 = _sceneObjectConfigCache[_arg1];
if (_local5 != null){
return (_local5);
};
};
var _local3:Object = _config.scenes.objects[_arg1];
if (_local3 == null){
throw (new Error(("Scene object configuration not found: " + _arg1)));
};
var _local4:Object = getFullSceneObjectConfig(_local3, false);
if (_arg2){
_sceneObjectConfigCache[_arg1] = _local4;
};
return (_local4);
}
}
}//package Slice
Section 128
//Main (Slice.Main)
package Slice {
import flash.events.*;
import flash.display.*;
import Slice.scene.*;
import Slice.data.*;
import Slice.instrumentation.*;
import flash.ui.*;
public class Main extends Sprite {
private var _scenes:Array;
private var _sceneContainer:DisplayObjectContainer;
private var _cursor:DisplayObject;
private static var _instance:Main;
public function Main():void{
_instance = this;
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
}
private function onAddedToStage(_arg1:Event):void{
var e = _arg1;
try {
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
Configuration.initialize();
ResourceManager.initialize();
DataManager.initialize(this);
this.initBackground();
this._sceneContainer = new Sprite();
this.addChild(this._sceneContainer);
this.initSecretCursor();
Profile.current.addEventListener(Event.INIT, this.onProfileLoaded);
Profile.current.load();
this.stage.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUp);
DataManager.secretDataService.addEventListener(GameSecretDataService.EVENT_SECRET_ACTIVATED, this.onSecretActivated);
} catch(e:Error) {
LogManager.logError(this, e);
};
}
private function onSecretActivated(_arg1:Event):void{
if (DataManager.secretDataService.secretActivated){
this._cursor.visible = true;
Mouse.hide();
ResourceManager.sound(Configuration.scenes.secretCursorSound).play();
} else {
this._cursor.visible = false;
Mouse.show();
};
}
private function onProfileLoaded(_arg1:Event):void{
if (Profile.current.savedGames.length > 0){
Profile.current.loadGame(0);
} else {
Profile.current.startNewGame();
};
SceneManager.initialize(this._sceneContainer);
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
private function initSecretCursor():void{
var _local1:Sprite = new Sprite();
_local1.mouseEnabled = (_local1.mouseChildren = false);
this.addChild(_local1);
this._cursor = ResourceManager.graphic(Configuration.scenes.secretCursor);
this._cursor.visible = false;
_local1.addChild(this._cursor);
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
private function onMouseMove(_arg1:MouseEvent):void{
this._cursor.x = _arg1.stageX;
this._cursor.y = _arg1.stageY;
_arg1.updateAfterEvent();
}
private function onEnterFrame(_arg1:Event):void{
var e = _arg1;
try {
SceneManager.update();
} catch(e:Error) {
LogManager.logError(this, e);
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
private function onKeyUp(_arg1:KeyboardEvent):void{
DataManager.secretDataService.onKeyPressed(_arg1.keyCode);
}
private function initBackground():void{
this.hitArea = new Sprite();
this.hitArea.graphics.beginFill(Configuration.scenes.backgroundColor);
this.hitArea.graphics.drawRect(0, 0, this.stage.stageWidth, this.stage.stageHeight);
this.hitArea.graphics.endFill();
this.addChild(this.hitArea);
this.contextMenu = new ContextMenu();
this.contextMenu.hideBuiltInItems();
}
public static function get instance():Main{
return (_instance);
}
}
}//package Slice
Section 129
//Preloader (Slice.Preloader)
package Slice {
import flash.events.*;
import flash.display.*;
import Slice.app.data.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
public class Preloader extends MovieClip {
private var _timerElapsed:Boolean;// = false
private var _delayTimeout:uint;
public function Preloader():void{
this.stop();
this.initialize();
this.drawProgressBar();
this._delayTimeout = setTimeout(this.onDelayTimeoutElapsed, PreloaderConfiguration.MinDelay);
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
private function initialize():void{
var _local1:TextField = new TextField();
_local1.embedFonts = true;
_local1.selectable = false;
_local1.autoSize = TextFieldAutoSize.LEFT;
_local1.mouseEnabled = false;
Font.registerFont(PreloaderConfiguration.DefaultFont);
_local1.defaultTextFormat = new TextFormat(PreloaderConfiguration.SupportedTextFont, PreloaderConfiguration.SupportedTextFontSize, PreloaderConfiguration.SupportedTextColor);
_local1.text = PreloaderConfiguration.SupportedText;
_local1.y = PreloaderConfiguration.SupportedTextY;
_local1.x = ((PreloaderConfiguration.StageWidth / 2) - (_local1.width / 2));
this.addChild(_local1);
var _local2:DisplayObject = new PreloaderConfiguration.GameMoldButtonUp();
var _local3:Shape = new Shape();
_local3.graphics.beginFill(0);
_local3.graphics.drawRect(0, 0, _local2.width, _local2.height);
_local3.graphics.endFill();
var _local4:SimpleButton = new SimpleButton(_local2, new PreloaderConfiguration.GameMoldButtonOver(), new PreloaderConfiguration.GameMoldButtonOver(), _local3);
_local4.x = ((PreloaderConfiguration.StageWidth / 2) - (_local4.width / 2));
_local4.y = PreloaderConfiguration.GameMoldButtonY;
this.addChild(_local4);
_local4.addEventListener(MouseEvent.CLICK, this.onGameMoldButtonClick);
}
private function drawProgressBar():void{
this.graphics.clear();
var _local1:uint = (PreloaderConfiguration.StageWidth - (2 * PreloaderConfiguration.ProgressBarMargin));
var _local2:Number = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal);
this.graphics.beginFill(PreloaderConfiguration.ProgressBarColor);
this.graphics.drawRect(PreloaderConfiguration.ProgressBarMargin, PreloaderConfiguration.ProgressBarY, (_local1 * _local2), PreloaderConfiguration.ProgressBarHeight);
this.graphics.endFill();
this.graphics.lineStyle(0, PreloaderConfiguration.ProgressBarColor);
this.graphics.drawRect(PreloaderConfiguration.ProgressBarMargin, PreloaderConfiguration.ProgressBarY, _local1, PreloaderConfiguration.ProgressBarHeight);
}
private function onEnterFrame(_arg1:Event):void{
if (this.framesLoaded >= this.totalFrames){
if (this._timerElapsed){
this.loadMain();
} else {
this.drawProgressBar();
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
} else {
this.drawProgressBar();
};
}
private function onGameMoldButtonClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(PreloaderConfiguration.GameMoldLinkUrl), "_blank");
}
private function loadMain():void{
clearTimeout(this._delayTimeout);
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.nextFrame();
var _local1:Class = Class(getDefinitionByName("Slice.Main"));
var _local2:Object = new (_local1);
this.addChild((_local2 as DisplayObject));
}
private function onDelayTimeoutElapsed():void{
if (this.framesLoaded >= this.totalFrames){
this.loadMain();
} else {
this._timerElapsed = true;
};
}
}
}//package Slice
Section 130
//Profile (Slice.Profile)
package Slice {
import flash.events.*;
import Slice.data.*;
import Slice.instrumentation.*;
import Slice.app.*;
public class Profile extends EventDispatcher {
private var _settings:Settings;// = null
private var _currentGameIndex:int;// = -1
private var _currentGame:IGameState;// = null
private var _savedGames:Array;
private static var _instance:Profile = null;
public function Profile():void{
this._savedGames = new Array();
}
public function saveSettings():void{
LogManager.logInfo(this, "Saving settings");
DataManager.profileDataService.saveSettings(this._settings.serialize());
}
public function get settings():Settings{
return (this._settings);
}
private function onGamesSaved(_arg1:Event):void{
LogManager.logInfo(this, "Games saved");
}
public function get currentGameIndex():uint{
return (this._currentGameIndex);
}
private function onLoadError(_arg1:DataErrorEvent):void{
LogManager.logError(this, _arg1.error, _arg1.text);
}
public function get currentGame():IGameState{
return (this._currentGame);
}
public function load():void{
LogManager.logInfo(this, "Loading profile");
DataManager.profileDataService.addEventListener(ProfileDataEvent.GAMES_LOADED, this.onGamesLoaded);
DataManager.profileDataService.addEventListener(ProfileDataEvent.GAMES_LOAD_ERROR, this.onLoadError);
DataManager.profileDataService.addEventListener(ProfileDataEvent.GAMES_SAVED, this.onGamesSaved);
DataManager.profileDataService.addEventListener(ProfileDataEvent.GAMES_SAVE_ERROR, this.onSaveError);
DataManager.profileDataService.addEventListener(ProfileDataEvent.SETTINGS_LOADED, this.onSettingsLoaded);
DataManager.profileDataService.addEventListener(ProfileDataEvent.SETTINGS_LOAD_ERROR, this.onLoadError);
DataManager.profileDataService.addEventListener(ProfileDataEvent.SETTINGS_SAVED, this.onSettingsSaved);
DataManager.profileDataService.addEventListener(ProfileDataEvent.SETTINGS_SAVE_ERROR, this.onSaveError);
this._savedGames = null;
this._settings = null;
DataManager.profileDataService.loadSettings();
DataManager.profileDataService.loadGames();
}
private function onGamesLoaded(_arg1:DataLoadedEvent):void{
var _local2:Array;
var _local3:IGameState;
this._savedGames = [];
if (_arg1.data != null){
_local2 = (_arg1.data as Array);
if (_local2.length > 0){
_local3 = new GameState();
_local3.deserialize(_local2[0]);
this._savedGames[0] = _local3;
};
LogManager.logInfo(this, "Saved games loaded");
} else {
LogManager.logInfo(this, "No saved games found");
};
if (this._settings){
this.dispatchEvent(new Event(Event.INIT));
};
}
public function startNewGame():void{
this._currentGame = new GameState();
this._currentGame.deserialize(Configuration.profile.defaultGameState);
this._currentGameIndex = 0;
this._savedGames[0] = this._currentGame.clone();
LogManager.logInfo(this, "New game started");
}
private function onSettingsSaved(_arg1:Event):void{
LogManager.logInfo(this, "Settings saved");
}
private function onSettingsLoaded(_arg1:DataLoadedEvent):void{
if (_arg1.data != null){
this._settings = Settings.deserialize(_arg1.data);
LogManager.logInfo(this, "Settings loaded");
} else {
this._settings = Settings.deserialize(Configuration.profile.defaultSettings);
LogManager.logInfo(this, "Default settings loaded");
};
if (this._savedGames){
this.dispatchEvent(new Event(Event.INIT));
};
}
public function get savedGames():Array{
return (this._savedGames);
}
private function onSaveError(_arg1:DataErrorEvent):void{
LogManager.logError(this, _arg1.error, _arg1.text);
}
public function saveGames():void{
LogManager.logInfo(this, "Saving games");
this._savedGames[this._currentGameIndex] = this._currentGame.clone();
var games:Array = this._savedGames.map(function (_arg1:Object, _arg2:uint, _arg3:Array):Object{
return (IGameState(_arg1).serialize());
});
DataManager.profileDataService.saveGames(games);
}
public function deleteGame(_arg1:uint):void{
this._savedGames.splice(_arg1, 1);
}
public function loadGame(_arg1:uint):void{
this._currentGameIndex = _arg1;
this._currentGame = IGameState(this._savedGames[_arg1]).clone();
LogManager.logInfo(this, "Game loaded");
}
public static function get current():Profile{
if (_instance == null){
_instance = new (Profile);
};
return (_instance);
}
public static function initialize():void{
current.load();
}
}
}//package Slice
Section 131
//ResourceManager (Slice.ResourceManager)
package Slice {
import flash.display.*;
import flash.media.*;
import Slice.instrumentation.*;
import flash.text.*;
import Slice.app.data.*;
public class ResourceManager {
private static var _resources:Resources = new Resources();
public static function initialize():void{
var _local2:Class;
var _local1:Array = (_resources.fonts as Array);
for each (_local2 in _local1) {
Font.registerFont(_local2);
};
LogManager.logInfo(Resources, "Resources initialized");
}
public static function graphicType(_arg1:String):Class{
return (Class(_resources.graphics[_arg1]));
}
public static function graphic(_arg1:String):DisplayObject{
var _local2:Class = graphicType(_arg1);
return (new (_local2));
}
public static function text(_arg1:String):String{
return (String(_resources.text[_arg1]));
}
public static function sound(_arg1:String):Sound{
var _local2:Class = _resources.sounds[_arg1];
return (new (_local2));
}
}
}//package Slice
Section 132
//Settings (Slice.Settings)
package Slice {
import flash.media.*;
public class Settings {
private var _soundVolume:Number;// = 1
private var _soundMuted:Boolean;// = false
public function serialize():Object{
return ({soundMuted:this.soundMuted, soundVolume:this.soundVolume});
}
public function set soundVolume(_arg1:Number):void{
this._soundVolume = _arg1;
if (!this._soundMuted){
SoundMixer.soundTransform = new SoundTransform(_arg1);
};
}
public function set soundMuted(_arg1:Boolean):void{
this._soundMuted = _arg1;
if (_arg1){
SoundMixer.stopAll();
SoundMixer.soundTransform = new SoundTransform(0);
} else {
SoundMixer.soundTransform = new SoundTransform(this.soundVolume);
};
}
public function get soundVolume():Number{
return (this._soundVolume);
}
public function get soundMuted():Boolean{
return (this._soundMuted);
}
public static function deserialize(_arg1:Object):Settings{
if (_arg1 == null){
return (null);
};
var _local2:Settings = new (Settings);
_local2.soundMuted = Boolean(_arg1.soundMuted);
_local2.soundVolume = Number(_arg1.soundVolume);
return (_local2);
}
}
}//package Slice