Section 1
//BulkErrorEvent (br.com.stimuli.loading.BulkErrorEvent)
package br.com.stimuli.loading {
import flash.events.*;
public class BulkErrorEvent extends Event {
public var name:String;
public var errors:Array;
public static const ERROR:String = "error";
public function BulkErrorEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
this.name = _arg1;
}
override public function toString():String{
return (super.toString());
}
override public function clone():Event{
var _local1:BulkErrorEvent;
_local1 = new BulkErrorEvent(name, bubbles, cancelable);
_local1.errors = (errors) ? errors.slice() : [];
return (_local1);
}
}
}//package br.com.stimuli.loading
Section 2
//BulkLoader (br.com.stimuli.loading.BulkLoader)
package br.com.stimuli.loading {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
public class BulkLoader extends EventDispatcher {
private var _itemsTotal:int;// = 0
public var speedAvg:Number;
private var _totalWeight:int;// = 0
private var _bytesTotalCurrent:int;// = 0
private var _itemsLoaded:int;// = 0
public var totalTime:Number;
private var lastSpeedCheck:int;
private var _bytesTotal:int;// = 0
private var speedTotal:Number;
private var _loadedRatio:Number;// = 0
private var endTime:int;
private var _speed:Number;
private var _isFinished:Boolean;
private var startTime:int;
private var _name:String;
private var _numConnectons:int;// = 7
private var _contents:Dictionary;
private var _logFunction:Function;
private var _bytesLoaded:int;// = 0
private var lastBytesCheck:int;
private var _connections:Array;
public var logLevel:int;// = 3
private var _percentLoaded:Number;// = 0
private var _weightPercent:Number;
private var _isRunning:Boolean;
private var _id:int;
private var _items:Array;
public var avgLatency:Number;
public static const LOG_INFO:int = 2;
public static const CONTEXT:String = "context";
public static const HTTP_STATUS:String = "httpStatus";
public static const TYPE_VIDEO:String = "video";
public static const CAN_BEGIN_PLAYING:String = "canBeginPlaying";
public static const TYPE_TEXT:String = "text";
public static const ID:String = "id";
public static const PREVENT_CACHING:String = "preventCache";
public static const PAUSED_AT_START:String = "pausedAtStart";
public static const PRIORITY:String = "priority";
public static const TYPE_SOUND:String = "sound";
public static const PROGRESS:String = "progress";
public static const VERSION:String = "rev 88 (0.9.3.1)";
public static const COMPLETE:String = "complete";
public static const MAX_TRIES:String = "maxTries";
public static const TYPE_LOADER:String = "loader";
private static const AVAILABLE_PROPS:Array = [PAUSED_AT_START, WEIGHT, MAX_TRIES, HEADERS, ID, PRIORITY, PREVENT_CACHING, CONTEXT, CAN_BEGIN_PLAYING, "type"];
public static const OPEN:String = "open";
public static const DEFAULT_NUM_CONNECTIONS:int = 7;
public static const LOG_VERBOSE:int = 0;
public static const LOG_SILENT:int = 10;
public static const TYPE_SWF:String = "loader";
public static const HEADERS:String = "headers";
public static const ERROR:String = "error";
public static const LOG_ERRORS:int = 3;
public static const TYPE_IMAGE:String = "loader";
public static const WEIGHT:String = "weight";
public static const TYPE_XML:String = "xml";
static var SOUND_TYPES:Array = ["mp3", "f4a", "f4b"];
static var XML_TYPES:Array = ["xml"];
static var LOADER_TYPES:Array = ["swf", "jpg", "jpeg", "gif", "png", "image"];
static var AVAILABLE_TYPES:Array = ["swf", "jpg", "jpeg", "gif", "png", "flv", "mp3", "xml", "txt", "js"];
static var TEXT_TYPES:Array = ["txt", "js", "xml", "php", "asp", "py"];
private static var allLoaders:Object = {};
private static var _instancesCreated:int = 0;
static var VIDEO_TYPES:Array = ["flv", "f4v", "f4p"];
public function BulkLoader(_arg1:String, _arg2:int=7, _arg3:int=3){
_items = [];
_contents = new Dictionary();
_numConnectons = DEFAULT_NUM_CONNECTIONS;
_loadedRatio = 0;
_itemsTotal = 0;
_itemsLoaded = 0;
_totalWeight = 0;
_bytesTotal = 0;
_bytesTotalCurrent = 0;
_bytesLoaded = 0;
_percentLoaded = 0;
logLevel = 3;
_logFunction = trace;
super();
if (Boolean(allLoaders[_arg1])){
throw (new Error((("BulkLoader with name'" + _arg1) + "' has already been created.")));
};
allLoaders[_arg1] = this;
if (_arg2 > 0){
this._numConnectons = _arg2;
};
this.logLevel = _arg3;
_name = _arg1;
_instancesCreated++;
_id = _instancesCreated;
}
public function get loadedRatio():Number{
return (_loadedRatio);
}
public function removePausedItems():Boolean{
var stoppedLoads:Array;
stoppedLoads = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_STOPPED));
});
stoppedLoads.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
loadNext();
return ((stoppedLoads.length > 0));
}
public function loadNow(_arg1):Boolean{
var _local2:LoadingItem;
var _local3:LoadingItem;
if ((_arg1 is LoadingItem)){
_local2 = _arg1;
} else {
_local2 = get(_arg1);
};
if (!_local2){
return (false);
};
if ((((_local2.status == LoadingItem.STATUS_FINISHED)) || ((_local2.status == LoadingItem.STATUS_STARTED)))){
return (true);
};
if (_connections.length >= numConnectons){
_local3 = getLeastUrgentOpenedItem();
removeFromConnections(_local3);
_local3.status = null;
};
_local2._priority = highestPriority;
loadNext(_local2);
return (true);
}
private function removeFromItems(_arg1:LoadingItem):Boolean{
var _local2:int;
_local2 = _items.indexOf(_arg1);
if (_local2 > -1){
_items.splice(_local2, 1);
} else {
return (false);
};
if (_arg1._isLoaded){
_itemsLoaded--;
};
_itemsTotal--;
log(("Removing " + _arg1), LOG_VERBOSE);
return (true);
}
private function getLeastUrgentOpenedItem():LoadingItem{
var _local1:LoadingItem;
_local1 = LoadingItem(_connections.sortOn(["priority", "bytesRemaining"], [Array.NUMERIC, Array.DESCENDING, Array.NUMERIC])[0]);
return (_local1);
}
public function get contents():Object{
return (_contents);
}
public function get id():int{
return (_id);
}
public function getBitmap(_arg1:String, _arg2:Boolean=false):Bitmap{
return (Bitmap(getContentAsType(_arg1, Bitmap, _arg2)));
}
private function removeFromConnections(_arg1):Boolean{
var _local2:int;
if (!_connections){
return (false);
};
_local2 = _connections.indexOf(_arg1);
if (_local2 > -1){
_connections.splice(_local2, 1);
return (true);
};
return (false);
}
public function resume(_arg1):Boolean{
var _local2:LoadingItem;
_local2 = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
if (((_local2) && ((_local2.status == LoadingItem.STATUS_STOPPED)))){
_local2.status = null;
return (true);
};
return (false);
}
public function get isRunning():Boolean{
return (_isRunning);
}
public function getNetStreamMetaData(_arg1:String, _arg2:Boolean=false):Object{
var _local3:NetStream;
_local3 = getNetStream(_arg1, _arg2);
return ((Boolean(_local3)) ? get(_arg1).metaData : null);
}
private function onProgress(_arg1:Event=null):void{
var _local2:BulkProgressEvent;
_local2 = getProgressForItems(_items);
dispatchEvent(_local2);
}
public function get logFunction():Function{
return (_logFunction);
}
private function hasItemInBulkLoader(_arg1, _arg2:BulkLoader):Boolean{
var _local3:LoadingItem;
_local3 = get(_arg1);
if (((_local3) && (_local3._isLoaded))){
return (true);
};
return (false);
}
public function getProgressForItems(_arg1:Array):BulkProgressEvent{
var _local2:int;
var _local3:Number;
var _local4:*;
var _local5:BulkProgressEvent;
_bytesLoaded = (_bytesTotal = (_bytesTotalCurrent = 0));
_weightPercent = 0;
_itemsLoaded = 0;
_local2 = 0;
_local3 = 0;
for each (_local4 in _arg1) {
_local4 = ((_local4 is LoadingItem)) ? _local4 : get(_local4);
if (!_local4){
} else {
if ((((((_local4.status == LoadingItem.STATUS_STARTED)) || ((_local4.status == LoadingItem.STATUS_FINISHED)))) || ((_local4.status == LoadingItem.STATUS_STOPPED)))){
_bytesLoaded = (_bytesLoaded + _local4._bytesLoaded);
_bytesTotalCurrent = (_bytesTotalCurrent + _local4._bytesTotal);
_local3 = (_local3 + ((_local4._bytesLoaded / _local4._bytesTotal) * _local4.weight));
if (_local4.status == LoadingItem.STATUS_FINISHED){
_itemsLoaded++;
};
_local2++;
};
};
};
if (_local2 == _items.length){
_bytesTotal = bytesTotalCurrent;
} else {
_bytesTotal = Number.POSITIVE_INFINITY;
};
_weightPercent = (_local3 / totalWeight);
_local5 = new BulkProgressEvent(PROGRESS);
_local5.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
return (_local5);
}
public function getContent(_arg1:String, _arg2:Boolean=false){
return (getContentAsType(_arg1, Object, _arg2));
}
public function getSerializedData(_arg1, _arg2:Boolean=false, _arg3:Function=null){
var raw:*;
var parsed:*;
var key = _arg1;
var clearMemory = _arg2;
var encodingFunction = _arg3;
try {
raw = getContentAsType(key, Object, clearMemory);
parsed = encodingFunction.apply(null, [raw]);
return (parsed);
} catch(e:Error) {
log("Failed to parse key:", key, ("with encodingFunction:" + encodingFunction), LOG_ERRORS);
};
return (null);
}
private function isAllDoneP():Boolean{
return (_items.every(function (_arg1:LoadingItem, ... _args):Boolean{
return (_arg1._isLoaded);
}));
}
function log(... _args):void{
var _local2:int;
_local2 = (isNaN(_args[(_args.length - 1)])) ? 3 : int(_args.pop());
if (_local2 >= logLevel){
_logFunction(("[BulkLoader] " + _args.join(" ")));
};
}
public function get speed():Number{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = (getTimer() - lastSpeedCheck);
_local2 = ((bytesLoaded - lastBytesCheck) / 0x0400);
_local3 = (_local2 / (_local1 / 1000));
lastSpeedCheck = _local1;
lastBytesCheck = bytesLoaded;
return (_local3);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function getSound(_arg1, _arg2:Boolean=false):Sound{
return (Sound(getContentAsType(_arg1, Sound, _arg2)));
}
public function traceStats():String{
var _local1:Array;
var _local2:LoadingItem;
var _local3:String;
_local1 = [];
_local1.push("\n************************************");
_local1.push((("All items loaded(" + itemsTotal) + ")"));
_local1.push(("Total time(s): " + totalTime));
_local1.push(("Average latency(s): " + int((avgLatency * 1000))));
_local1.push(("Average speed(kb/s): " + truncateNumber(speedAvg)));
_local1.push(("Median speed(kb/s): " + truncateNumber(speedTotal)));
_local1.push(("KiloBytes total:" + truncateNumber((bytesTotal / 0x0400))));
_local1.push("");
for each (_local2 in _items) {
if (_local2._isLoaded){
_local1.push(((((((((("\t- Item url:" + _local2.url.url) + ", total time: ") + _local2.timeToDownload) + ", latency:") + _local2.latency) + ", speed: ") + _local2.speed) + ", kbs total: ") + truncateNumber((_local2.bytesTotal / 0x0400))));
};
};
_local1.push("************************************");
_local3 = _local1.join("\n");
log(_local3, LOG_VERBOSE);
return (_local3);
}
private function updateStats():void{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:LoadingItem;
avgLatency = 0;
speedAvg = 0;
_local1 = 0;
_local2 = 0;
speedTotal = 0;
_local3 = 0;
for each (_local4 in _items) {
if (((_local4._isLoaded) && (!((_local4.status == LoadingItem.STATUS_ERROR))))){
_local1 = (_local1 + _local4.latency);
_local2 = (_local2 + _local4.bytesTotal);
_local3++;
};
};
speedTotal = ((_local2 / 0x0400) / totalTime);
avgLatency = (_local1 / _local3);
speedAvg = (speedTotal / _local3);
}
public function removeFailedItems():int{
var numCleared:int;
var badItems:Array;
numCleared = 0;
badItems = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
});
numCleared = badItems.length;
badItems.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
loadNext();
return (numCleared);
}
public function resumeAll():Boolean{
var affected:Boolean;
log("Resuming all items", LOG_VERBOSE);
affected = false;
_items.forEach(function (_arg1:LoadingItem, ... _args):void{
if (_arg1.status == LoadingItem.STATUS_STOPPED){
resume(_arg1);
affected = true;
};
});
loadNext();
return (affected);
}
public function start(_arg1:int=-1):void{
var _local2:int;
if (_connections){
loadNext();
return;
};
startTime = getTimer();
if (_arg1 > 0){
_numConnectons = _arg1;
};
_connections = [];
_local2 = Math.max(_numConnectons, _items.length);
loadNext();
isRunning = true;
lastBytesCheck = 0;
lastSpeedCheck = getTimer();
}
public function get itemsTotal():int{
return (_itemsTotal);
}
public function get(_arg1):LoadingItem{
var _local2:LoadingItem;
if (!_arg1){
return (null);
};
for each (_local2 in _items) {
if ((((((((_local2._id == _arg1)) || ((_local2.url.url == _arg1)))) || ((_local2.url == _arg1)))) || ((((_arg1 is URLRequest)) && ((_local2.url.url == _arg1.url)))))){
return (_local2);
};
};
return (null);
}
public function get highestPriority():int{
var _local1:int;
var _local2:LoadingItem;
_local1 = int.MIN_VALUE;
for each (_local2 in _items) {
if (_local2.priority > _local1){
_local1 = _local2.priority;
};
};
return (_local1);
}
override public function toString():String{
return (((((("[BulkLoader] name:" + name) + ", itemsTotal: ") + itemsTotal) + ", itemsLoaded: ") + _itemsLoaded));
}
public function getBitmapData(_arg1, _arg2:Boolean=false):BitmapData{
var key = _arg1;
var clearMemory = _arg2;
try {
return (getBitmap(key, clearMemory).bitmapData);
} catch(e:Error) {
log("Failed to get bitmapData with url:", key, LOG_ERRORS);
};
return (null);
}
public function get numConnectons():int{
return (_numConnectons);
}
public function set logFunction(_arg1:Function):void{
_logFunction = _arg1;
}
public function sortItemsByPriority():void{
_items.sortOn(["priority", "addedTime"], [(Array.NUMERIC | Array.DESCENDING), Array.NUMERIC]);
}
public function get name():String{
return (_name);
}
public function set isRunning(_arg1:Boolean):void{
_isRunning = _arg1;
}
private function onItemStarted(_arg1:Event):void{
var _local2:LoadingItem;
_local2 = (_arg1.target as LoadingItem);
if (_local2.isVideo()){
_contents[_local2.url.url] = _local2.stream;
};
log("Started loading", _local2, LOG_INFO);
dispatchEvent(_arg1);
}
public function removeAll():void{
var _local1:LoadingItem;
for each (_local1 in _items) {
remove(_local1);
};
delete allLoaders[name];
_items = (_connections = null);
_contents = null;
_items = [];
_contents = new Dictionary();
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function remove(_arg1):Boolean{
var item:LoadingItem;
var allDone:Boolean;
var key = _arg1;
try {
if ((key is LoadingItem)){
item = key;
} else {
item = get(key);
};
if (!item){
return (false);
};
removeFromItems(item);
removeFromConnections(item);
item.destroy();
item = null;
onProgress();
allDone = isAllDoneP();
if (allDone){
onAllLoaded();
};
return (true);
} catch(e:Error) {
log(("Error while removing item from key:" + key), LOG_ERRORS);
};
return (false);
}
private function onItemError(_arg1:BulkErrorEvent):void{
var item:LoadingItem;
var bulkErrorEvent:BulkErrorEvent;
var evt = _arg1;
item = (evt.target as LoadingItem);
log(((("After " + item.numTries) + " I am giving up on ") + item.url.url), LOG_ERRORS);
log("Error loading", item, LOG_ERRORS);
removeFromConnections(item);
bulkErrorEvent = new BulkErrorEvent(BulkErrorEvent.ERROR);
bulkErrorEvent.errors = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
});
dispatchEvent(bulkErrorEvent);
}
public function getHttpStatus(_arg1):int{
var _local2:LoadingItem;
_local2 = get(_arg1);
if (_local2){
return (_local2.httpStatus);
};
return (-1);
}
public function add(_arg1, _arg2:Object=null):LoadingItem{
var _local3:LoadingItem;
var _local4:String;
_arg2 = ((_arg2) || ({}));
if ((_arg1 is String)){
_arg1 = new URLRequest(_arg1);
if (_arg2[HEADERS]){
_arg1.requestHeaders = _arg2[HEADERS];
};
} else {
if ((!(_arg1) is URLRequest)){
throw (new Error(("[BulkLoader] cannot add object with bad type for url:'" + _arg1.url)));
};
};
_local3 = get(_arg1);
if (_local3){
return (_local3);
};
_local3 = new LoadingItem(_arg1, _arg2["type"]);
log("Added", _local3, LOG_VERBOSE);
_local3.preventCache = _arg2[PREVENT_CACHING];
_local3._id = _arg2[ID];
_local3._priority = ((int(_arg2[PRIORITY])) || (0));
_local3.maxTries = ((_arg2[MAX_TRIES]) || (3));
_local3.weight = ((int(_arg2[WEIGHT])) || (1));
_local3.context = ((_arg2[CONTEXT]) || (null));
_local3.pausedAtStart = ((_arg2[PAUSED_AT_START]) || (false));
for (_local4 in _arg2) {
if (AVAILABLE_PROPS.indexOf(_local4) == -1){
log(((("add got a wrong property name: " + _local4) + ", with value:") + _arg2[_local4]));
};
};
_local3._addedTime = getTimer();
_local3.addEventListener(Event.COMPLETE, onItemComplete, false, int.MIN_VALUE, true);
_local3.addEventListener(ERROR, onItemError, false, 0, true);
_local3.addEventListener(Event.OPEN, onItemStarted, false, 0, true);
_local3.addEventListener(ProgressEvent.PROGRESS, onProgress, false, 0, true);
_items.push(_local3);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local3.weight);
sortItemsByPriority();
_isFinished = false;
return (_local3);
}
public function getText(_arg1, _arg2:Boolean=false):String{
return (String(getContentAsType(_arg1, String, _arg2)));
}
public function get bytesTotalCurrent():int{
return (_bytesTotalCurrent);
}
public function getAVM1Movie(_arg1:String, _arg2:Boolean=false):AVM1Movie{
return (AVM1Movie(getContentAsType(_arg1, AVM1Movie, _arg2)));
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get weightPercent():Number{
return (_weightPercent);
}
private function getContentAsType(_arg1, _arg2:Class, _arg3:Boolean=false){
var item:LoadingItem;
var res:*;
var key = _arg1;
var type = _arg2;
var clearMemory = _arg3;
item = get(key);
if (!item){
return (null);
};
try {
if (((item._isLoaded) || (item.isStreamable()))){
res = (item.content as type);
if (res == null){
throw (new Error("bad cast"));
};
if (clearMemory){
remove(key);
};
return (res);
};
} catch(e:Error) {
log((("Failed to get content with url: '" + key) + "'as type:"), type, LOG_ERRORS);
};
return (null);
}
public function get isFinished():Boolean{
return (_isFinished);
}
public function changeItemPriority(_arg1:String, _arg2:int):Boolean{
var _local3:LoadingItem;
_local3 = get(_arg1);
if (!_local3){
return (false);
};
_local3._priority = _arg2;
sortItemsByPriority();
return (true);
}
public function get items():Array{
return (_items.slice());
}
public function getNetStream(_arg1:String, _arg2:Boolean=false):NetStream{
return (NetStream(getContentAsType(_arg1, NetStream, _arg2)));
}
private function set itemsLoaded(_arg1:int):void{
_itemsLoaded = _arg1;
}
public function pauseAll():void{
var _local1:LoadingItem;
for each (_local1 in _items) {
pause(_local1);
};
isRunning = false;
log("Stopping all items", LOG_INFO);
}
public function hasItem(_arg1, _arg2:Boolean=true):Boolean{
var _local3:*;
var _local4:BulkLoader;
if (_arg2){
_local3 = allLoaders;
} else {
_local3 = [this];
};
for each (_local4 in _local3) {
if (hasItemInBulkLoader(_arg1, _local4)){
return (true);
};
};
return (false);
}
public function get totalWeight():int{
return (_totalWeight);
}
public function getNotLoadedItems():Array{
return (_items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return (!((_arg1.status == LoadingItem.STATUS_FINISHED)));
}));
}
public function getXML(_arg1, _arg2:Boolean=false):XML{
return (XML(getContentAsType(_arg1, XML, _arg2)));
}
public function get itemsLoaded():int{
return (_itemsLoaded);
}
private function onAllLoaded():void{
var _local1:BulkProgressEvent;
var _local2:BulkProgressEvent;
if (_isFinished){
return;
};
_local1 = new BulkProgressEvent(COMPLETE);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
_local2 = new BulkProgressEvent(PROGRESS);
_local2.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
isRunning = false;
endTime = getTimer();
totalTime = BulkLoader.truncateNumber(((endTime - startTime) / 1000));
updateStats();
_connections = [];
traceStats();
_isFinished = true;
log("Finished all", LOG_INFO);
dispatchEvent(_local2);
dispatchEvent(_local1);
}
public function getMovieClip(_arg1:String, _arg2:Boolean=false):MovieClip{
return (MovieClip(getContentAsType(_arg1, MovieClip, _arg2)));
}
private function onItemComplete(_arg1:Event):void{
var _local2:LoadingItem;
var _local3:Boolean;
var _local4:Boolean;
_local2 = (_arg1.target as LoadingItem);
removeFromConnections(_local2);
log("Loaded ", _local2, LOG_INFO);
log("Items to load", getNotLoadedItems(), LOG_VERBOSE);
_local2.cleanListeners();
_contents[_local2.url.url] = _local2.content;
_local3 = loadNext();
_local4 = isAllDoneP();
_itemsLoaded++;
if (_local4){
onAllLoaded();
};
}
public function pause(_arg1, _arg2:Boolean=false):Boolean{
var _local3:LoadingItem;
var _local4:Boolean;
_local3 = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
if (!_local3){
return (false);
};
_local3.stop();
_local4 = removeFromConnections(_local3);
if (_arg2){
loadNext();
};
return (_local4);
}
private function loadNext(_arg1:LoadingItem=null):Boolean{
var next:Boolean;
var checkItem:LoadingItem;
var toLoad = _arg1;
if (_isFinished){
return (false);
};
_connections.forEach(function (_arg1:LoadingItem, ... _args):void{
if ((((_arg1.status == LoadingItem.STATUS_ERROR)) && ((_arg1.numTries < _arg1.maxTries)))){
removeFromConnections(_arg1);
};
});
next = false;
if (!toLoad){
for each (checkItem in _items) {
if (((!(checkItem._isLoading)) && (!((checkItem.status == LoadingItem.STATUS_STOPPED))))){
toLoad = checkItem;
break;
};
};
};
if (toLoad){
next = true;
isRunning = true;
if (_connections.length < numConnectons){
_connections.push(toLoad);
toLoad.load();
log("Will load item:", toLoad, LOG_INFO);
};
if (_connections.length < numConnectons){
loadNext();
};
};
return (next);
}
public static function pauseAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in allLoaders) {
_local1.pauseAll();
};
}
public static function removeAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in allLoaders) {
_local1.removeAll();
delete allLoaders[_local1.name];
_local1 = null;
};
allLoaders = null;
}
public static function whichLoaderHasItem(_arg1):BulkLoader{
var _local2:BulkLoader;
for each (_local2 in allLoaders) {
if (_local2.hasItemInBulkLoader(_arg1, _local2)){
return (_local2);
};
};
return (null);
}
public static function getLoader(_arg1:String):BulkLoader{
return ((BulkLoader.allLoaders[_arg1] as BulkLoader));
}
public static function truncateNumber(_arg1:Number, _arg2:int=2):Number{
var _local3:int;
_local3 = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function registerNewType(_arg1:String, _arg2:String):Boolean{
var _local3:Array;
var _local4:Object;
if (_arg1.charAt(0) == "."){
_arg1 = _arg1.substring(1);
};
_local4 = {TYPE_LOADER:LOADER_TYPES, TYPE_VIDEO:VIDEO_TYPES, TYPE_SOUND:SOUND_TYPES, TYPE_TEXT:TEXT_TYPES};
_local3 = _local4[_arg2];
if (((_local3) && ((_local3.indexOf(_arg1) == -1)))){
_local3.push(_arg1);
return (true);
};
return (false);
}
}
}//package br.com.stimuli.loading
Section 3
//BulkProgressEvent (br.com.stimuli.loading.BulkProgressEvent)
package br.com.stimuli.loading {
import flash.events.*;
public class BulkProgressEvent extends ProgressEvent {
public var name:String;
public var bytesTotalCurrent:int;
public var itemsTotal:int;
public var itemsLoaded:int;
public var weightPercent:Number;
public var ratioLoaded:Number;
public var percentLoaded:Number;
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public function BulkProgressEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
this.name = _arg1;
}
public function loadingStatus():String{
var _local1:Array;
_local1 = [];
_local1.push(("bytesLoaded: " + bytesLoaded));
_local1.push(("bytesTotal: " + bytesTotal));
_local1.push(("itemsLoaded: " + itemsLoaded));
_local1.push(("itemsTotal: " + itemsTotal));
_local1.push(("bytesTotalCurrent: " + bytesTotalCurrent));
_local1.push(("percentLoaded: " + BulkLoader.truncateNumber(percentLoaded)));
_local1.push(("weightPercent: " + BulkLoader.truncateNumber(weightPercent)));
_local1.push(("ratioLoaded: " + BulkLoader.truncateNumber(ratioLoaded)));
return ((("BulkProgressEvent " + _local1.join(", ")) + ";"));
}
override public function clone():Event{
var _local1:BulkProgressEvent;
_local1 = new BulkProgressEvent(name, bubbles, cancelable);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, itemsLoaded, itemsTotal, weightPercent);
return (_local1);
}
override public function toString():String{
return (super.toString());
}
public function setInfo(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Number):void{
this.bytesLoaded = _arg1;
this.bytesTotal = _arg2;
this.bytesTotalCurrent = _arg3;
this.itemsLoaded = _arg4;
this.itemsTotal = _arg5;
this.weightPercent = _arg6;
this.percentLoaded = (_arg1 / _arg2);
ratioLoaded = (_arg4 / _arg5);
}
}
}//package br.com.stimuli.loading
Section 4
//LoadingItem (br.com.stimuli.loading.LoadingItem)
package br.com.stimuli.loading {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
public class LoadingItem extends EventDispatcher {
var _priority:int;// = 0
private var loader;
var _type:String;
private var _canBeginStreaming:Boolean;// = false
var _isLoaded:Boolean;
var _isLoading:Boolean;
var _bytesTotal:int;// = -1
private var _content;
var _speed:Number;
var _weightPercentLoaded:Number;
var _addedTime:int;
var url:URLRequest;
var weight:int;// = 1
private var _httpStatus:int;// = 0
var stream:NetStream;
var preventCache:Boolean;
var _bytesLoaded:int;// = 0
var maxTries:int;// = 3
private var internalType:String;
private var _responseTime:Number;
private var dummyEventTrigger:Sprite;
var _percentLoaded:Number;
private var _metaData:Object;
var context;// = null
private var _totalTime:int;
var numTries:int;// = 0
private var nc:NetConnection;
var _id:String;
var _latency:Number;
private var _startTime:int;
var pausedAtStart:Boolean;// = false
var _bytesRemaining:int;// = -1
private var _timeToDownload:int;
var status:String;
static const STATUS_STOPPED:String = "stopped";
static const STATUS_STARTED:String = "started";
static const STATUS_ERROR:String = "error";
static const STATUS_FINISHED:String = "finished";
private static var classes:Object = {loader:Loader, xml:URLLoader, video:NetConnection, sound:Sound, text:URLLoader};
public function LoadingItem(_arg1:URLRequest, _arg2:String){
_priority = 0;
_canBeginStreaming = false;
maxTries = 3;
numTries = 0;
weight = 1;
_bytesTotal = -1;
_bytesLoaded = 0;
_bytesRemaining = -1;
_httpStatus = 0;
context = null;
pausedAtStart = false;
super();
if (_arg2){
this._type = _arg2.toLowerCase();
} else {
this._type = guessType(_arg1.url);
};
internalType = getInternalType(this._type);
this.url = _arg1;
}
function stop():void{
if (_isLoaded){
return;
};
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
status = STATUS_STOPPED;
_isLoading = false;
}
public function isSound():Boolean{
return ((internalType == BulkLoader.TYPE_SOUND));
}
function get weightPercentLoaded():Number{
return (_weightPercentLoaded);
}
public function get id():String{
return (_id);
}
function onVideoMetadata(_arg1):void{
_metaData = _arg1;
}
function onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
function createNetStreamEvent(_arg1:Event):void{
var _local2:Event;
var _local3:Event;
var _local4:ProgressEvent;
if ((((_bytesTotal == _bytesLoaded)) && ((_bytesTotal > 8)))){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
_local2 = new Event(Event.COMPLETE);
onCompleteHandler(_local2);
} else {
if ((((_bytesTotal == 0)) && ((stream.bytesTotal > 4)))){
_local3 = new Event(Event.OPEN);
onStartedHandler(_local3);
_bytesLoaded = stream.bytesLoaded;
_bytesTotal = stream.bytesTotal;
} else {
_local4 = new ProgressEvent(ProgressEvent.PROGRESS, false, false, stream.bytesLoaded, stream.bytesTotal);
onProgressHandler(_local4);
};
};
}
public function get type():String{
return (_type);
}
public function get totalTime():int{
return (_totalTime);
}
private function fireCanBeginStreamingEvent():void{
var _local1:Event;
if (_canBeginStreaming){
return;
};
_canBeginStreaming = true;
_local1 = new Event(BulkLoader.CAN_BEGIN_PLAYING);
dispatchEvent(_local1);
}
public function get metaData():Object{
return (_metaData);
}
function get bytesLoaded():int{
return (_bytesLoaded);
}
private function onStartedHandler(_arg1:Event):void{
_responseTime = getTimer();
_latency = BulkLoader.truncateNumber(((_responseTime - _startTime) / 1000));
status = STATUS_STARTED;
if (((pausedAtStart) && (stream))){
stream.pause();
};
if (isSound()){
_content = loader;
};
dispatchEvent(_arg1);
}
public function isImage():Boolean{
return (((isLoader()) && ((content is Bitmap))));
}
public function get speed():Number{
return (_speed);
}
public function get startTime():int{
return (_startTime);
}
override public function toString():String{
return (((((("LoadingItem url: " + url.url) + ", type:") + _type) + ", status: ") + status));
}
public function isVideo():Boolean{
return ((internalType == BulkLoader.TYPE_VIDEO));
}
public function isText():Boolean{
return ((internalType == BulkLoader.TYPE_TEXT));
}
public function get content(){
return (_content);
}
private function onProgressHandler(_arg1):void{
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_bytesLoaded = _arg1.bytesLoaded;
_bytesTotal = _arg1.bytesTotal;
_bytesRemaining = (_bytesTotal - bytesLoaded);
_percentLoaded = (_bytesLoaded / _bytesTotal);
_weightPercentLoaded = (_percentLoaded * weight);
if (((((isVideo()) && (metaData))) && (!(_canBeginStreaming)))){
_local2 = (getTimer() - responseTime);
_local3 = (bytesLoaded / (_local2 / 1000));
_local4 = (_bytesRemaining / (_local3 * 0.8));
_local5 = (metaData.duration - stream.bufferLength);
if (_local5 > _local4){
fireCanBeginStreamingEvent();
};
};
dispatchEvent(_arg1);
}
public function isXML():Boolean{
return ((internalType == BulkLoader.TYPE_XML));
}
function get bytesTotal():int{
return (_bytesTotal);
}
public function get httpStatus():int{
return (_httpStatus);
}
private function onErrorHandler(_arg1:Event):void{
var _local2:BulkErrorEvent;
numTries++;
status = STATUS_ERROR;
if (numTries >= maxTries){
_local2 = new BulkErrorEvent(BulkErrorEvent.ERROR);
_local2.errors = [this];
dispatchEvent(_local2);
} else {
status = null;
load();
};
}
public function isStreamable():Boolean{
return (((((isVideo()) || (isSound()))) || (isSWF())));
}
function get percentLoaded():Number{
return (_percentLoaded);
}
public function get priority():int{
return (_priority);
}
public function get responseTime():Number{
return (_responseTime);
}
function get bytesRemaining():int{
return (_bytesRemaining);
}
public function get isLoaded():Boolean{
return (_isLoaded);
}
function onNetStatus(_arg1:NetStatusEvent):void{
var _local2:Event;
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
if (_arg1.info.code == "NetStream.Play.Start"){
_content = stream;
_local2 = new Event(Event.OPEN);
onStartedHandler(_local2);
};
}
public function isLoader():Boolean{
return ((internalType == BulkLoader.TYPE_LOADER));
}
public function get timeToDownload():int{
return (_timeToDownload);
}
function load():void{
var loaderClass:Class;
var cacheString:String;
var customClient:Object;
if (preventCache){
cacheString = ("BulkLoaderNoCache=" + int(((Math.random() * 100) * getTimer())));
if (url.url.indexOf("?") == -1){
url.url = (url.url + ("?" + cacheString));
} else {
url.url = (url.url + ("&" + cacheString));
};
};
loaderClass = LoadingItem.classes[internalType];
loader = new (loaderClass);
if ((loader is Loader)){
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatusHandler, false, 0, true);
loader.load(url, context);
} else {
if ((loader is Sound)){
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatusHandler, false, 0, true);
loader.load(url, context);
} else {
if ((loader is NetConnection)){
loader.connect(null);
stream = new NetStream(loader);
stream.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
dummyEventTrigger = new Sprite();
dummyEventTrigger.addEventListener(Event.ENTER_FRAME, createNetStreamEvent, false, 0, true);
customClient = new Object();
customClient.onCuePoint = function (... _args):void{
};
customClient.onMetaData = onVideoMetadata;
customClient.onPlayStatus = function (... _args):void{
};
stream.client = customClient;
stream.play(url.url);
stream.seek(0);
} else {
if ((loader is URLLoader)){
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.load(url);
};
};
};
};
_isLoading = true;
_startTime = getTimer();
}
public function get addedTime():int{
return (_addedTime);
}
private function onCompleteHandler(_arg1:Event):void{
_totalTime = getTimer();
_timeToDownload = ((_totalTime - _responseTime) / 1000);
if (_timeToDownload == 0){
_timeToDownload = 0.2;
};
_speed = BulkLoader.truncateNumber(((bytesTotal / 0x0400) / _timeToDownload));
if (_timeToDownload == 0){
_speed = 3000;
};
status = STATUS_FINISHED;
_isLoaded = true;
if ((loader is Loader)){
_content = loader.content;
} else {
if ((loader is URLLoader)){
if (_type == BulkLoader.TYPE_XML){
_content = new XML(loader.data);
} else {
_content = loader.data;
};
} else {
if ((loader is Sound)){
_content = loader;
} else {
if ((loader is NetConnection)){
_content = stream;
};
};
};
};
dispatchEvent(_arg1);
}
function cleanListeners():void{
var _local1:Object;
if (((!((_type == BulkLoader.TYPE_VIDEO))) && (loader))){
_local1 = loader;
if ((loader is Loader)){
_local1 = loader.contentLoaderInfo;
};
_local1.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
_local1.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
_local1.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
_local1.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
} else {
if (_type == BulkLoader.TYPE_VIDEO){
if (stream){
stream.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
};
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
dummyEventTrigger = null;
};
};
};
}
public function isSWF():Boolean{
return (((isLoader()) && ((content is MovieClip))));
}
function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
public function get latency():Number{
return (_latency);
}
static function getInternalType(_arg1:String):String{
var _local2:String;
if ((((_arg1 == BulkLoader.TYPE_LOADER)) || ((BulkLoader.LOADER_TYPES.indexOf(_arg1) > -1)))){
_local2 = BulkLoader.TYPE_LOADER;
} else {
if ((((_arg1 == BulkLoader.TYPE_SOUND)) || ((BulkLoader.SOUND_TYPES.indexOf(_arg1) > -1)))){
_local2 = BulkLoader.TYPE_SOUND;
} else {
if ((((_arg1 == BulkLoader.TYPE_VIDEO)) || ((BulkLoader.VIDEO_TYPES.indexOf(_arg1) > -1)))){
_local2 = BulkLoader.TYPE_VIDEO;
} else {
if ((((_arg1 == BulkLoader.TYPE_XML)) || ((BulkLoader.XML_TYPES.indexOf(_arg1) > -1)))){
_local2 = BulkLoader.TYPE_XML;
} else {
_local2 = BulkLoader.TYPE_TEXT;
};
};
};
};
return (_local2);
}
static function guessType(_arg1:String):String{
var _local2:String;
var _local3:String;
_local2 = ((_arg1.indexOf("?") > -1)) ? _arg1.substring(0, _arg1.indexOf("?")) : _arg1;
_local3 = _local2.substring((_local2.lastIndexOf(".") + 1)).toLowerCase();
if (!Boolean(_local3)){
_local3 = BulkLoader.TYPE_TEXT;
};
return (_local3);
}
}
}//package br.com.stimuli.loading
Section 5
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
}
}//package caurina.transitions
Section 6
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5, _arg6));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5, _arg6));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
}
}//package caurina.transitions
Section 7
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var valueComplete:Number;
public var modifierFunction:Function;
public var hasModifier:Boolean;
public var valueStart:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Function, _arg4:Array){
valueStart = _arg1;
valueComplete = _arg2;
hasModifier = Boolean(_arg3);
modifierFunction = _arg3;
modifierParameters = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 8
//SpecialPropertiesDefault (caurina.transitions.SpecialPropertiesDefault)
package caurina.transitions {
import flash.media.*;
import flash.filters.*;
import flash.geom.*;
public class SpecialPropertiesDefault {
public function SpecialPropertiesDefault(){
trace("SpecialProperties is a static class and should not be instantiated.");
}
public static function _sound_volume_get(_arg1:Object):Number{
return (_arg1.soundTransform.volume);
}
public static function _color_splitter(_arg1):Array{
var _local2:Array;
_local2 = new Array();
if (_arg1 == null){
_local2.push({name:"_color_ra", value:1});
_local2.push({name:"_color_rb", value:0});
_local2.push({name:"_color_ga", value:1});
_local2.push({name:"_color_gb", value:0});
_local2.push({name:"_color_ba", value:1});
_local2.push({name:"_color_bb", value:0});
} else {
_local2.push({name:"_color_ra", value:0});
_local2.push({name:"_color_rb", value:AuxFunctions.numberToR(_arg1)});
_local2.push({name:"_color_ga", value:0});
_local2.push({name:"_color_gb", value:AuxFunctions.numberToG(_arg1)});
_local2.push({name:"_color_ba", value:0});
_local2.push({name:"_color_bb", value:AuxFunctions.numberToB(_arg1)});
};
return (_local2);
}
public static function frame_get(_arg1:Object):Number{
return (_arg1.currentFrame);
}
public static function _sound_pan_get(_arg1:Object):Number{
return (_arg1.soundTransform.pan);
}
public static function _color_property_get(_arg1:Object, _arg2:Array):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function _sound_volume_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
public static function _autoAlpha_get(_arg1:Object):Number{
return (_arg1.alpha);
}
public static function _filter_splitter(_arg1:BitmapFilter):Array{
var _local2:Array;
_local2 = new Array();
if ((_arg1 is BlurFilter)){
_local2.push({name:"_blur_blurX", value:BlurFilter(_arg1).blurX});
_local2.push({name:"_blur_blurY", value:BlurFilter(_arg1).blurY});
_local2.push({name:"_blur_quality", value:BlurFilter(_arg1).quality});
} else {
trace("??");
};
return (_local2);
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", frame_get, frame_set);
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
public static function _sound_pan_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.pan = _arg2;
_arg1.soundTransform = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:ColorTransform;
_local4 = _arg1.transform.colorTransform;
_local4[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local4;
}
public static function _filter_property_get(_arg1:Object, _arg2:Array):Number{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local3 = _arg1.filters;
_local5 = _arg2[0];
_local6 = _arg2[1];
_local4 = 0;
while (_local4 < _local3.length) {
if ((((_local3[_local4] is BlurFilter)) && ((_local5 == BlurFilter)))){
return (_local3[_local4][_local6]);
};
_local4++;
};
switch (_local5){
case BlurFilter:
_local7 = {blurX:0, blurY:0, quality:NaN};
break;
};
return (_local7[_local6]);
}
public static function _bezier_get(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Array):Number{
var _local5:uint;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg4.length == 1){
return ((_arg1 + (_arg3 * (((2 * (1 - _arg3)) * (_arg4[0] - _arg1)) + (_arg3 * (_arg2 - _arg1))))));
};
_local5 = Math.floor((_arg3 * _arg4.length));
_local6 = ((_arg3 - (_local5 * (1 / _arg4.length))) * _arg4.length);
if (_local5 == 0){
_local7 = _arg1;
_local8 = ((_arg4[0] + _arg4[1]) / 2);
} else {
if (_local5 == (_arg4.length - 1)){
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = _arg2;
} else {
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = ((_arg4[_local5] + _arg4[(_local5 + 1)]) / 2);
};
};
return ((_local7 + (_local6 * (((2 * (1 - _local6)) * (_arg4[_local5] - _local7)) + (_local6 * (_local8 - _local7))))));
}
public static function frame_set(_arg1:Object, _arg2:Number):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _filter_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:Array;
var _local5:uint;
var _local6:Object;
var _local7:String;
var _local8:BitmapFilter;
_local4 = _arg1.filters;
_local6 = _arg3[0];
_local7 = _arg3[1];
_local5 = 0;
while (_local5 < _local4.length) {
if ((((_local4[_local5] is BlurFilter)) && ((_local6 == BlurFilter)))){
_local4[_local5][_local7] = _arg2;
_arg1.filters = _local4;
return;
};
_local5++;
};
if (_local4 == null){
_local4 = new Array();
};
switch (_local6){
case BlurFilter:
_local8 = new BlurFilter(0, 0);
break;
};
_local8[_local7] = _arg2;
_local4.push(_local8);
_arg1.filters = _local4;
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _scale_splitter(_arg1:Number):Array{
var _local2:Array;
_local2 = new Array();
_local2.push({name:"scaleX", value:_arg1});
_local2.push({name:"scaleY", value:_arg1});
return (_local2);
}
public static function _colorTransform_splitter(_arg1):Array{
var _local2:Array;
_local2 = new Array();
if (_arg1 == null){
_local2.push({name:"_color_ra", value:1});
_local2.push({name:"_color_rb", value:0});
_local2.push({name:"_color_ga", value:1});
_local2.push({name:"_color_gb", value:0});
_local2.push({name:"_color_ba", value:1});
_local2.push({name:"_color_bb", value:0});
} else {
if (_arg1.ra != undefined){
_local2.push({name:"_color_ra", value:_arg1.ra});
};
if (_arg1.rb != undefined){
_local2.push({name:"_color_rb", value:_arg1.rb});
};
if (_arg1.ga != undefined){
_local2.push({name:"_color_ba", value:_arg1.ba});
};
if (_arg1.gb != undefined){
_local2.push({name:"_color_bb", value:_arg1.bb});
};
if (_arg1.ba != undefined){
_local2.push({name:"_color_ga", value:_arg1.ga});
};
if (_arg1.bb != undefined){
_local2.push({name:"_color_gb", value:_arg1.gb});
};
if (_arg1.aa != undefined){
_local2.push({name:"_color_aa", value:_arg1.aa});
};
if (_arg1.ab != undefined){
_local2.push({name:"_color_ab", value:_arg1.ab});
};
};
return (_local2);
}
public static function _bezier_modifier(_arg1):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local6:Object;
_local2 = [];
if ((_arg1 is Array)){
_local3 = _arg1;
} else {
_local3 = [_arg1];
};
_local6 = {};
_local4 = 0;
while (_local4 < _local3.length) {
for (_local5 in _local3[_local4]) {
if (_local6[_local5] == undefined){
_local6[_local5] = [];
};
_local6[_local5].push(_local3[_local4][_local5]);
};
_local4++;
};
for (_local5 in _local6) {
_local2.push({name:_local5, parameters:_local6[_local5]});
};
return (_local2);
}
}
}//package caurina.transitions
Section 9
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 10
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 11
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function){
splitValues = _arg1;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 12
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null):void{
var _local5:SpecialProperty;
if (!_inited){
init();
};
_local5 = new SpecialProperty(_arg2, _arg3, _arg4);
_specialPropertyList[_arg1] = _local5;
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Function;
var _local11:TweenListObj;
var _local12:Number;
var _local13:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local7 = arguments[(arguments.length - 1)];
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
if (typeof(_local7.transition) == "string"){
_local13 = _local7.transition.toLowerCase();
_local10 = _transitionList[_local13];
} else {
_local10 = _local7.transition;
};
if (!Boolean(_local10)){
_local10 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local11 = new TweenListObj(_local4[_local5], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), (_local7.useFrames == true), _local10);
_local11.properties = null;
_local11.onStart = _local7.onStart;
_local11.onUpdate = _local7.onUpdate;
_local11.onComplete = _local7.onComplete;
_local11.onOverwrite = _local7.onOverwrite;
_local11.onStartParams = _local7.onStartParams;
_local11.onUpdateParams = _local7.onUpdateParams;
_local11.onCompleteParams = _local7.onCompleteParams;
_local11.onOverwriteParams = _local7.onOverwriteParams;
_local11.isCaller = true;
_local11.count = _local7.count;
_local11.waitFrames = _local7.waitFrames;
_tweenList.push(_local11);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local12 = (_tweenList.length - 1);
updateTweenByIndex(_local12);
removeTweenByIndex(_local12);
};
_local5++;
};
return (true);
}
public static function init(_arg1=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
SpecialPropertiesDefault.init();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local2.timeStart = (_local2.timeStart + (_currentTime - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_currentTime - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function debug_getList():String{
var _local1:String;
var _local2:uint;
var _local3:uint;
_local1 = "";
_local2 = 0;
while (_local2 < _tweenList.length) {
_local1 = (_local1 + (("[" + _local2) + "] ::\n"));
_local3 = 0;
while (_local3 < _tweenList[_local2].properties.length) {
_local1 = (_local1 + ((((" " + _tweenList[_local2].properties[_local3].name) + " -> ") + _tweenList[_local2].properties[_local3].valueComplete) + "\n"));
_local3++;
};
_local2++;
};
return (_local1);
}
public static function getVersion():String{
return ("AS3 1.25.55");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
if (_currentTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(_currentTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (_currentTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
try {
tTweening.onStart.apply(tScope, tTweening.onStartParams);
} catch(e:Error) {
};
};
for (pName in tTweening.properties) {
pv = getPropertyValue(tScope, pName);
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (_currentTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (_currentTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
setPropertyValue(tScope, pName, nv);
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
try {
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
} catch(e:Error) {
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
try {
tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
} catch(e:Error) {
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
_local2 = 0;
while (_local2 < _tweenList.length) {
_tweenList[_local2].timeStart = (_currentTime - (((_currentTime - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_currentTime - (((_currentTime - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_currentTime - (((_currentTime - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:String;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Object;
var _local14:Object;
var _local15:Function;
var _local16:Object;
var _local17:TweenListObj;
var _local18:Number;
var _local19:Array;
var _local20:Array;
var _local21:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local9 = arguments[(arguments.length - 1)];
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local10 = (isNaN(_local9.time)) ? 0 : _local9.time;
_local11 = (isNaN(_local9.delay)) ? 0 : _local9.delay;
_local12 = new Array();
_local13 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true};
_local14 = new Object();
for (_local7 in _local9) {
if (!_local13[_local7]){
if (_specialPropertySplitterList[_local7]){
_local19 = _specialPropertySplitterList[_local7].splitValues(_local9[_local7]);
_local5 = 0;
while (_local5 < _local19.length) {
_local12[_local19[_local5].name] = {valueStart:undefined, valueComplete:_local19[_local5].value};
_local5++;
};
} else {
if (_specialPropertyModifierList[_local7] != undefined){
_local20 = _specialPropertyModifierList[_local7].modifyValues(_local9[_local7]);
_local5 = 0;
while (_local5 < _local20.length) {
_local14[_local20[_local5].name] = {modifierParameters:_local20[_local5].parameters, modifierFunction:_specialPropertyModifierList[_local7].getValue};
_local5++;
};
} else {
_local12[_local7] = {valueStart:undefined, valueComplete:_local9[_local7]};
};
};
};
};
for (_local7 in _local14) {
if (_local12[_local7] != undefined){
_local12[_local7].modifierParameters = _local14[_local7].modifierParameters;
_local12[_local7].modifierFunction = _local14[_local7].modifierFunction;
};
};
if (typeof(_local9.transition) == "string"){
_local21 = _local9.transition.toLowerCase();
_local15 = _transitionList[_local21];
} else {
_local15 = _local9.transition;
};
if (!Boolean(_local15)){
_local15 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local16 = new Object();
for (_local7 in _local12) {
_local16[_local7] = new PropertyInfoObj(_local12[_local7].valueStart, _local12[_local7].valueComplete, _local12[_local7].modifierFunction, _local12[_local7].modifierParameters);
};
_local17 = new TweenListObj(_local4[_local5], (_currentTime + ((_local11 * 1000) / _timeScale)), (_currentTime + (((_local11 * 1000) + (_local10 * 1000)) / _timeScale)), (_local9.useFrames == true), _local15);
_local17.properties = _local16;
_local17.onStart = _local9.onStart;
_local17.onUpdate = _local9.onUpdate;
_local17.onComplete = _local9.onComplete;
_local17.onOverwrite = _local9.onOverwrite;
_local17.onStartParams = _local9.onStartParams;
_local17.onUpdateParams = _local9.onUpdateParams;
_local17.onCompleteParams = _local9.onCompleteParams;
_local17.onOverwriteParams = _local9.onOverwriteParams;
_local17.rounded = _local9.rounded;
_local17.skipUpdates = _local9.skipUpdates;
removeTweensByTime(_local17.scope, _local17.properties, _local17.timeStart, _local17.timeComplete);
_tweenList.push(_local17);
if ((((_local10 == 0)) && ((_local11 == 0)))){
_local18 = (_tweenList.length - 1);
updateTweenByIndex(_local18);
removeTweenByIndex(_local18);
};
_local5++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
private static function setPropertyValue(_arg1:Object, _arg2:String, _arg3:Number):void{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
_specialPropertyList[_arg2].setValue(_arg1, _arg3, _specialPropertyList[_arg2].parameters);
} else {
_specialPropertyList[_arg2].setValue(_arg1, _arg3);
};
} else {
_arg1[_arg2] = _arg3;
};
}
private static function getPropertyValue(_arg1:Object, _arg2:String):Number{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
return (_specialPropertyList[_arg2].getValue(_arg1, _specialPropertyList[_arg2].parameters));
};
return (_specialPropertyList[_arg2].getValue(_arg1));
} else {
};
return (!NULL!);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = _currentTime;
_local2.isPaused = true;
return (true);
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
try {
_tweenList[i].onOverwrite.apply(_tweenList[i].scope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function):void{
var _local3:SpecialPropertySplitter;
if (!_inited){
init();
};
_local3 = new SpecialPropertySplitter(_arg2);
_specialPropertySplitterList[_arg1] = _local3;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 13
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var auxProperties:Object;
public var timeComplete:Number;
public var onStartParams:Array;
public var rounded:Boolean;
public var updatesSkipped:Number;
public var onUpdateParams:Array;
public var onComplete:Function;
public var properties:Object;
public var onStart:Function;
public var skipUpdates:Number;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
auxProperties = new Object();
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:uint;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = 0;
while (_local2 < properties.length) {
if (_local2 > 0){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local2].name));
_local1 = (_local1 + (",valueStart:" + properties[_local2].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local2].valueComplete));
_local1 = (_local1 + "]");
_local2++;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
}
}//package caurina.transitions
Section 14
//FrameScriptManager (com.gskinner.utils.FrameScriptManager)
package com.gskinner.utils {
import flash.display.*;
public class FrameScriptManager {
private var target:MovieClip;
private var labels:Object;
public function FrameScriptManager(_arg1:MovieClip){
this.target = _arg1;
updateLabels();
}
public function getFrameNumber(_arg1):uint{
var _local2:uint;
var _local3:String;
_local2 = uint(_arg1);
if (_local2){
return (_local2);
};
_local3 = String(_arg1);
if (_local3 == null){
return (0);
};
_local2 = labels[_local3];
return (_local2);
}
private function updateLabels():void{
var _local1:Array;
var _local2:uint;
_local1 = target.currentLabels;
labels = {};
_local2 = 0;
while (_local2 < _local1.length) {
labels[_local1[_local2].name] = _local1[_local2].frame;
_local2++;
};
}
public function setFrameScript(_arg1, _arg2:Function):void{
var _local3:uint;
_local3 = getFrameNumber(_arg1);
if (_local3 == 0){
return;
};
target.addFrameScript((_local3 - 1), _arg2);
}
}
}//package com.gskinner.utils
Section 15
//Tracker (com.memecounter.Tracker)
package com.memecounter {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class Tracker {
private static var ori_dom:String;
private static var lurl:String;
private static var _isReady:Boolean = false;
public static var a:uint = 0;
public static var root:DisplayObject;
public static var c:uint;
public static var d:String = "";
private static var _isInited:Boolean = false;
public static var fpv:String = "";
private static var l:Loader;
private static var tracker:MovieClip;
public static var da:Array = ["distralytics.com", "distralytics.co.uk"];
private static function loadError(_arg1:Event):void{
a++;
lc();
}
public static function init(_arg1:uint, _arg2:DisplayObject):void{
var _local3:uint;
if (!_isInited){
_isInited = true;
c = _arg1;
root = _arg2;
_local3 = 0;
while (_local3 < da.length) {
Security.allowDomain(da[_local3], ((c + ".c.") + da[_local3]), ("*." + da[_local3]));
_local3++;
};
ori_dom = (root.loaderInfo.parameters.hasOwnProperty("ori_dom")) ? root.loaderInfo.parameters.ori_dom : "";
d = ((ori_dom)!="") ? ori_dom : ((root.loaderInfo.loaderURL.split("/")[0].indexOf("http"))==-1) ? "Local" : root.loaderInfo.loaderURL.split("/")[2].split("?")[0];
fpv = Capabilities.version.split(" ")[1].split(",")[0];
lurl = ((((((((("/control/tracking/trackerAS3.swf" + "?c=") + c) + "&r=") + Math.floor((Math.random() * 10000000000))) + "&d=") + d) + "&p=") + fpv) + "&as=3");
l = new Loader();
l.contentLoaderInfo.addEventListener(Event.INIT, loadComplete);
l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
lc();
};
}
public static function get isReady():Boolean{
return (isReady);
}
public static function kvClick(_arg1:uint):void{
if (_isReady){
tracker.kvClick(_arg1);
};
}
public static function kvCountry():String{
if (_isReady){
return (tracker.kvCountry());
};
return ("");
}
public static function kvEvent(_arg1:uint):void{
if (_isReady){
tracker.kvEvent(_arg1);
};
}
private static function lc():void{
var _local1:String;
_local1 = (((("http://" + c) + ".c.") + da[(a % da.length)]) + lurl);
Security.allowDomain(_local1);
l.load(new URLRequest(_local1));
}
private static function loadComplete(_arg1:Event):void{
tracker = _arg1.target.content;
tracker.init(getDefinitionByName("com.memecounter.Tracker"), root);
_isReady = true;
}
}
}//package com.memecounter
Section 16
//ViralTracker (com.viralchart.ViralTracker)
package com.viralchart {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class ViralTracker {
private static const URL:String = "http://www.viralchart.com/tracker.php";
public static function track(_arg1:int, _arg2:DisplayObject):void{
var variables:URLVariables;
var request:URLRequest;
var id = _arg1;
var root = _arg2;
Security.allowDomain(root.loaderInfo.loaderURL);
Security.allowDomain(URL);
variables = new URLVariables();
variables.media = id;
variables.f = "F";
request = new URLRequest(URL);
request.data = variables;
try {
sendToURL(request);
} catch(e:Error) {
trace(("Error: " + e.errorID));
};
}
}
}//package com.viralchart
Section 17
//SimpleMouseEvent (de.popforge.events.SimpleMouseEvent)
package de.popforge.events {
import flash.events.*;
public class SimpleMouseEvent extends Event {
public static const PRESS:String = "onPress";
public static const RELEASE:String = "onRelease";
public static const DRAG_OUT:String = "onDragOut";
public static const ROLL_OUT:String = "onRollOut";
public static const RELEASE_OUTSIDE:String = "onReleaseOutside";
public static const ROLL_OVER:String = "onRollOver";
public static const DRAG_OVER:String = "onDragOver";
public function SimpleMouseEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package de.popforge.events
Section 18
//SimpleMouseEventHandler (de.popforge.events.SimpleMouseEventHandler)
package de.popforge.events {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class SimpleMouseEventHandler {
private var target:InteractiveObject;
private var trackAsMenu:Boolean;
private static const table:Dictionary = new Dictionary(true);
public function SimpleMouseEventHandler(_arg1:InteractiveObject, _arg2:Boolean){
this.target = _arg1;
this.trackAsMenu = _arg2;
init();
}
private function onStageMouseUp(_arg1:MouseEvent):void{
dispatch(SimpleMouseEvent.RELEASE_OUTSIDE);
Stage(_arg1.currentTarget).removeEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function onTargetMouseUp(_arg1:MouseEvent):void{
if (target.stage.focus == target){
dispatch(SimpleMouseEvent.RELEASE);
};
target.stage.removeEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function onTargetMouseOver(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
if ((((target.stage.focus == target)) || (trackAsMenu))){
dispatch(SimpleMouseEvent.DRAG_OVER);
};
} else {
dispatch(SimpleMouseEvent.ROLL_OVER);
};
}
private function init():void{
if ((target is Sprite)){
Sprite(target).buttonMode = true;
} else {
if ((target is MovieClip)){
MovieClip(target).buttonMode = true;
};
};
target.addEventListener(MouseEvent.MOUSE_OVER, onTargetMouseOver);
target.addEventListener(MouseEvent.MOUSE_OUT, onTargetMouseOut);
target.addEventListener(MouseEvent.MOUSE_DOWN, onTargetMouseDown);
target.addEventListener(MouseEvent.MOUSE_UP, onTargetMouseUp);
table[target] = this;
}
private function onTargetMouseDown(_arg1:MouseEvent):void{
dispatch(SimpleMouseEvent.PRESS);
target.stage.addEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function onTargetMouseOut(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
if (target.stage != null){
if ((((target.stage.focus == target)) || (trackAsMenu))){
dispatch(SimpleMouseEvent.DRAG_OUT);
};
};
} else {
dispatch(SimpleMouseEvent.ROLL_OUT);
};
}
private function dispatch(_arg1:String):void{
target.dispatchEvent(new SimpleMouseEvent(_arg1));
}
private function dispose():void{
target.removeEventListener(MouseEvent.MOUSE_OVER, onTargetMouseOver);
target.removeEventListener(MouseEvent.MOUSE_OUT, onTargetMouseOut);
target.removeEventListener(MouseEvent.MOUSE_DOWN, onTargetMouseDown);
target.removeEventListener(MouseEvent.MOUSE_UP, onTargetMouseUp);
}
public static function register(_arg1:InteractiveObject, _arg2:Boolean=false):void{
new SimpleMouseEventHandler(_arg1, _arg2);
}
public static function unregister(_arg1:InteractiveObject):void{
SimpleMouseEventHandler(table[_arg1]).dispose();
delete table[_arg1];
}
}
}//package de.popforge.events
Section 19
//AdvertEvent (events.AdvertEvent)
package events {
import flash.events.*;
public class AdvertEvent extends Event {
public static const CLEAR:String = "onClear";
public static const OUT:String = "onOut";
public function AdvertEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("AdvertEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new AdvertEvent(type, bubbles, cancelable));
}
}
}//package events
Section 20
//BallEvent (events.BallEvent)
package events {
import flash.events.*;
import flash.geom.*;
public class BallEvent extends Event {
private var m_portalIn:Point;
private var m_velocity:Point;
private var m_portalOut:Point;
private var m_doorId:int;
public static const SHRINK:String = "onShrink";
public static const EXIT:String = "onExit";
public static const START:String = "onStart";
public static const CHANGE_SIZE:String = "onChangeSize";
public static const STOP:String = "onStop";
public static const GROW:String = "onGrow";
public static const DEATH:String = "onDeath";
public static const PORTAL_IN:String = "onPortalIn";
public static const SWITCH_DOOR:String = "onSwitchDoor";
public static const ADD_VELOCITY:String = "onAddVelocity";
public static const IN_WATER:String = "onInWater";
public static const CHANGE_GRAVITY:String = "onChangeGravity";
public function BallEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Point=null, _arg5:Point=null, _arg6:Point=null, _arg7:int=-1){
super(_arg1, _arg2, _arg3);
m_portalIn = ((_arg4)!=null) ? _arg4.clone() : null;
m_portalOut = ((_arg5)!=null) ? _arg5.clone() : null;
m_velocity = ((_arg6)!=null) ? _arg6.clone() : null;
m_doorId = _arg7;
}
public function get portalOut():Point{
return (m_portalOut);
}
public function get vel():Point{
return (m_velocity);
}
public function get doorId():int{
return (m_doorId);
}
public function get portalIn():Point{
return (m_portalIn);
}
}
}//package events
Section 21
//allship_160 (Game_fla.allship_160)
package Game_fla {
import flash.display.*;
public dynamic class allship_160 extends MovieClip {
public var m_mcContainer:MovieClip;
}
}//package Game_fla
Section 22
//allsize5transitionscopy_21 (Game_fla.allsize5transitionscopy_21)
package Game_fla {
import flash.display.*;
public dynamic class allsize5transitionscopy_21 extends MovieClip {
public var mcCenter:MovieClip;
public var mcShape:MovieClip;
}
}//package Game_fla
Section 23
//attachedsounds_18 (Game_fla.attachedsounds_18)
package Game_fla {
import flash.display.*;
public dynamic class attachedsounds_18 extends MovieClip {
public function attachedsounds_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 24
//blink_22 (Game_fla.blink_22)
package Game_fla {
import flash.display.*;
public dynamic class blink_22 extends MovieClip {
public function blink_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 25
//comeonbabysmall_192 (Game_fla.comeonbabysmall_192)
package Game_fla {
import flash.media.*;
import flash.display.*;
public dynamic class comeonbabysmall_192 extends MovieClip {
public var video:Video;
}
}//package Game_fla
Section 26
//dancemoviesmall_195 (Game_fla.dancemoviesmall_195)
package Game_fla {
import flash.media.*;
import flash.display.*;
public dynamic class dancemoviesmall_195 extends MovieClip {
public var video:Video;
}
}//package Game_fla
Section 27
//Exit1copy_176 (Game_fla.Exit1copy_176)
package Game_fla {
import flash.display.*;
public dynamic class Exit1copy_176 extends MovieClip {
public var m_mcElectric:MovieClip;
}
}//package Game_fla
Section 28
//flower1_234 (Game_fla.flower1_234)
package Game_fla {
import flash.display.*;
public dynamic class flower1_234 extends MovieClip {
public function flower1_234(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 29
//flower10_254 (Game_fla.flower10_254)
package Game_fla {
import flash.display.*;
public dynamic class flower10_254 extends MovieClip {
public function flower10_254(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 30
//flower11_256 (Game_fla.flower11_256)
package Game_fla {
import flash.display.*;
public dynamic class flower11_256 extends MovieClip {
public function flower11_256(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 31
//flower12_258 (Game_fla.flower12_258)
package Game_fla {
import flash.display.*;
public dynamic class flower12_258 extends MovieClip {
public function flower12_258(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 32
//flower13_260 (Game_fla.flower13_260)
package Game_fla {
import flash.display.*;
public dynamic class flower13_260 extends MovieClip {
public function flower13_260(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 33
//flower14_262 (Game_fla.flower14_262)
package Game_fla {
import flash.display.*;
public dynamic class flower14_262 extends MovieClip {
public function flower14_262(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 34
//flower15_264 (Game_fla.flower15_264)
package Game_fla {
import flash.display.*;
public dynamic class flower15_264 extends MovieClip {
public function flower15_264(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 35
//flower16_266 (Game_fla.flower16_266)
package Game_fla {
import flash.display.*;
public dynamic class flower16_266 extends MovieClip {
public function flower16_266(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 36
//flower17_268 (Game_fla.flower17_268)
package Game_fla {
import flash.display.*;
public dynamic class flower17_268 extends MovieClip {
public function flower17_268(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 37
//flower18_270 (Game_fla.flower18_270)
package Game_fla {
import flash.display.*;
public dynamic class flower18_270 extends MovieClip {
public function flower18_270(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 38
//flower19_272 (Game_fla.flower19_272)
package Game_fla {
import flash.display.*;
public dynamic class flower19_272 extends MovieClip {
public function flower19_272(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 39
//flower2_238 (Game_fla.flower2_238)
package Game_fla {
import flash.display.*;
public dynamic class flower2_238 extends MovieClip {
public function flower2_238(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 40
//flower20_274 (Game_fla.flower20_274)
package Game_fla {
import flash.display.*;
public dynamic class flower20_274 extends MovieClip {
public function flower20_274(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 41
//flower3_240 (Game_fla.flower3_240)
package Game_fla {
import flash.display.*;
public dynamic class flower3_240 extends MovieClip {
public function flower3_240(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 42
//flower4_242 (Game_fla.flower4_242)
package Game_fla {
import flash.display.*;
public dynamic class flower4_242 extends MovieClip {
public function flower4_242(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 43
//flower5_244 (Game_fla.flower5_244)
package Game_fla {
import flash.display.*;
public dynamic class flower5_244 extends MovieClip {
public function flower5_244(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 44
//flower6_246 (Game_fla.flower6_246)
package Game_fla {
import flash.display.*;
public dynamic class flower6_246 extends MovieClip {
public function flower6_246(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 45
//flower7_248 (Game_fla.flower7_248)
package Game_fla {
import flash.display.*;
public dynamic class flower7_248 extends MovieClip {
public function flower7_248(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 46
//flower8_250 (Game_fla.flower8_250)
package Game_fla {
import flash.display.*;
public dynamic class flower8_250 extends MovieClip {
public function flower8_250(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 47
//flower9_252 (Game_fla.flower9_252)
package Game_fla {
import flash.display.*;
public dynamic class flower9_252 extends MovieClip {
public function flower9_252(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package Game_fla
Section 48
//smalltennismov_199 (Game_fla.smalltennismov_199)
package Game_fla {
import flash.media.*;
import flash.display.*;
public dynamic class smalltennismov_199 extends MovieClip {
public var video:Video;
}
}//package Game_fla
Section 49
//smookepuf1_56 (Game_fla.smookepuf1_56)
package Game_fla {
import flash.display.*;
public dynamic class smookepuf1_56 extends MovieClip {
public function smookepuf1_56(){
addFrameScript(50, frame51);
}
function frame51(){
stop();
}
}
}//package Game_fla
Section 50
//AntiMagnet (objects.AntiMagnet)
package objects {
import sound.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import events.*;
public class AntiMagnet extends MovieClip {
private const MAX_DISTANCE = 100;
public function AntiMagnet(_arg1:int, _arg2:int){
x = _arg1;
y = _arg2;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Point;
var _local12:Number;
var _local13:SoundInstance;
var _local14:Number;
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < MAX_DISTANCE){
_local6 = (_local6 / _local8);
_local7 = (_local7 / _local8);
_local9 = (1 - (_local8 / MAX_DISTANCE));
_local10 = (_arg5.getMassFactor() * 2);
_local11 = new Point(((_local10 * _local6) * _local9), ((_local10 * _local7) * _local9));
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, _local11));
_local12 = (_local9 * 2);
_local13 = Main.getInstance().m_soundManager.getSound(Main.SOUND_MAGNET_REPEL);
if (_local13.playing){
_local14 = _local13.volume;
_local14 = (_local14 + _local12);
_local14 = ((_local14 > 2)) ? 2 : _local14;
_local13.volume = _local14;
} else {
Main.getInstance().m_soundManager.playSound(Main.SOUND_MAGNET_REPEL, 0, new SoundTransform(_local12));
};
};
}
}
}//package objects
Section 51
//Door (objects.Door)
package objects {
import flash.display.*;
public class Door extends MovieClip implements IObject {
private const STATE_CLOSED:int = 0;
private const FRAME_DOWN:int = 1;
private const STATE_OPEN:int = 1;
private const FRAMES_ALL:int = 42;
private const FRAME_UP:int = 21;
private var m_id:int;
private var m_state:int;// = 0
private var m_bFinishedAnim:Boolean;// = false
public function Door(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
m_state = STATE_CLOSED;
m_bFinishedAnim = false;
super();
stop();
x = _arg1;
y = _arg2;
m_id = _arg3;
if (_arg4 == 1){
rotation = 90;
};
}
public function switchState():void{
if (m_state == STATE_CLOSED){
m_state = STATE_OPEN;
Main.getInstance().m_soundManager.playSound(Main.SOUND_DOOR_OPENING, 0, null);
} else {
m_state = STATE_CLOSED;
};
m_bFinishedAnim = false;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
if (m_state == STATE_OPEN){
if (currentFrame < FRAME_UP){
nextFrame();
} else {
if (currentFrame > FRAME_UP){
gotoAndStop((FRAMES_ALL - currentFrame));
} else {
if (!m_bFinishedAnim){
m_bFinishedAnim = true;
Game.getInstance().removeActiveObject(this);
};
};
};
} else {
if (m_state == STATE_CLOSED){
if (((!(m_bFinishedAnim)) && ((currentFrame == (FRAMES_ALL - 1))))){
gotoAndStop(1);
m_bFinishedAnim = true;
Game.getInstance().removeActiveObject(this);
} else {
if (currentFrame < FRAME_UP){
gotoAndStop((FRAMES_ALL - currentFrame));
} else {
if (currentFrame >= FRAME_UP){
nextFrame();
};
};
};
};
};
}
}
}//package objects
Section 52
//DoorSmash (objects.DoorSmash)
package objects {
import flash.display.*;
import flash.geom.*;
public class DoorSmash extends MovieClip {
public var m_mcDoor:MovieClip;
public var m_mcPuff:MovieClip;
public var m_bDestroyed:Boolean;// = false
public function DoorSmash(_arg1:int, _arg2:int){
m_bDestroyed = false;
super();
x = _arg1;
y = _arg2;
stop();
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
var _local7:Point;
if (!m_bDestroyed){
_local6 = new Point(-8, 0);
_local7 = new Point(8, 0);
_local6 = localToGlobal(_local6);
_local7 = localToGlobal(_local7);
if ((((_arg5.m_size > 1)) && (((_arg5.hitTestPoint(_local6.x, _local6.y, false)) || (_arg5.hitTestPoint(_local7.x, _local7.y, false)))))){
gotoAndStop("puff");
Main.getInstance().m_soundManager.playSound(Main.SOUND_DOOR_BREAKING, 0, null);
m_bDestroyed = true;
};
};
}
}
}//package objects
Section 53
//Enemy (objects.Enemy)
package objects {
import flash.display.*;
import events.*;
public class Enemy extends MovieClip {
private const VELOCITY:Number = 1;
private var m_left:int;
private var m_size:int;
public var m_mcPuff:MovieClip;
private var m_bDead:Boolean;// = false
private var m_right:int;
private var m_vel:Number;// = 1
public static const RADIUS:Array = [15, 21, 27];
public static const DEFAULT_SIZE:int = 1;
public function Enemy(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int=1){
m_vel = VELOCITY;
m_bDead = false;
super();
stop();
x = _arg1;
y = _arg2;
m_left = _arg3;
m_right = _arg4;
height = (RADIUS[_arg5] * 2);
scaleX = scaleY;
m_size = _arg5;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg5.m_bIsDying){
return;
};
if (m_bDead){
if (m_mcPuff.currentFrame == 16){
Game.getInstance().removeActiveObject(this);
parent.removeChild(this);
};
return;
};
x = (x + m_vel);
if ((((x < m_left)) || ((x > m_right)))){
m_vel = (m_vel * -1);
scaleX = (scaleX * -1);
};
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < (RADIUS[m_size] + _arg3)){
if (_arg5.m_size > m_size){
m_bDead = true;
gotoAndStop("puff");
Main.getInstance().m_soundManager.playSound(Main.SOUND_ENEMY_SQUASH, 0, null);
} else {
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.DEATH));
};
};
}
}
}//package objects
Section 54
//Exit (objects.Exit)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class Exit extends MovieClip implements IObject {
protected var m_hitPoint:Point;
private var m_size:int;
private var m_dir:int;
public var m_mcElectric:MovieClip;
public function Exit(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
x = _arg1;
y = _arg2;
m_size = _arg4;
m_dir = _arg3;
rotation = (90 * m_dir);
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
_local6 = localToGlobal(m_hitPoint);
if ((((m_size == _arg5.m_size)) && (_arg5.hitTestPoint(_local6.x, _local6.y, true)))){
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.EXIT));
};
}
}
}//package objects
Section 55
//Exit0 (objects.Exit0)
package objects {
import flash.geom.*;
public class Exit0 extends Exit {
public function Exit0(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2, _arg3, 0);
m_hitPoint = new Point(0, 2);
}
}
}//package objects
Section 56
//Exit1 (objects.Exit1)
package objects {
import flash.geom.*;
public class Exit1 extends Exit {
public function Exit1(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2, _arg3, 1);
m_hitPoint = new Point(0, 11);
}
}
}//package objects
Section 57
//Exit2 (objects.Exit2)
package objects {
import flash.geom.*;
public class Exit2 extends Exit {
public function Exit2(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2, _arg3, 2);
m_hitPoint = new Point(0, 23);
}
}
}//package objects
Section 58
//Exit3 (objects.Exit3)
package objects {
import flash.geom.*;
public class Exit3 extends Exit {
public function Exit3(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2, _arg3, 3);
m_hitPoint = new Point(0, 32);
}
}
}//package objects
Section 59
//GravitySwitch (objects.GravitySwitch)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class GravitySwitch extends MovieClip {
private var m_bUnused:Boolean;// = true
private var m_state:int;// = 0
public var m_mcUp:MovieClip;
public var m_mcDown:MovieClip;
public static const GRAVITY_DOWN:int = 0;
public static const GRAVITY_UP:int = 1;
public function GravitySwitch(_arg1:int, _arg2:int, _arg3:int){
m_bUnused = true;
m_state = GRAVITY_DOWN;
super();
x = _arg1;
y = _arg2;
stop();
if (_arg3 == 1){
scaleX = (scaleX * -1);
};
}
public function draw():void{
}
public function setState(_arg1:int):void{
m_state = _arg1;
m_bUnused = false;
switch (_arg1){
case GRAVITY_UP:
gotoAndStop("up");
break;
case GRAVITY_DOWN:
gotoAndStop("down");
break;
};
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
var _local7:Number;
if (m_bUnused){
_local7 = _arg5.rotation;
if (m_state == GRAVITY_DOWN){
_arg5.rotation = 0;
if (_arg5.hitTestObject(m_mcUp)){
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.CHANGE_GRAVITY));
Main.getInstance().m_soundManager.playSound(Main.SOUND_GRAVITY_SWITCH, 0, null);
};
} else {
if (m_state == GRAVITY_UP){
_arg5.rotation = 0;
if (_arg5.hitTestObject(m_mcDown)){
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.CHANGE_GRAVITY));
Main.getInstance().m_soundManager.playSound(Main.SOUND_GRAVITY_SWITCH, 0, null);
};
};
};
_arg5.rotation = _local7;
} else {
if (Math.abs((x - _arg1)) > (_arg3 + 18)){
m_bUnused = true;
};
};
}
}
}//package objects
Section 60
//Grower (objects.Grower)
package objects {
import flash.media.*;
import flash.display.*;
import events.*;
public class Grower extends MovieClip {
private var m_bUnused:Boolean;// = true
private var m_radius:int;// = 14
public function Grower(_arg1:int, _arg2:int){
m_bUnused = true;
m_radius = 14;
super();
x = _arg1;
y = _arg2;
}
public function draw():void{
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Number;
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = (_arg3 + m_radius);
_local9 = ((_local6 * _local6) + (_local7 * _local7));
if (_local9 < (_local8 * _local8)){
if (m_bUnused){
m_bUnused = false;
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.GROW));
Main.getInstance().m_soundManager.playSound(Main.SOUND_GROWTH, 0, new SoundTransform(2));
};
} else {
m_bUnused = true;
};
}
}
}//package objects
Section 61
//IObject (objects.IObject)
package objects {
public interface IObject {
function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void;
}
}//package objects
Section 62
//Magnet (objects.Magnet)
package objects {
import sound.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import events.*;
public class Magnet extends MovieClip implements IObject {
private const MAX_DISTANCE = 100;
public function Magnet(_arg1:int, _arg2:int){
x = _arg1;
y = _arg2;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Point;
var _local12:Number;
var _local13:SoundInstance;
var _local14:Number;
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < MAX_DISTANCE){
_local6 = (_local6 / _local8);
_local7 = (_local7 / _local8);
_local9 = (1 - (_local8 / MAX_DISTANCE));
_local10 = (-2 * _arg5.getMassFactor());
_local11 = new Point(((_local10 * _local6) * _local9), ((_local10 * _local7) * _local9));
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, _local11));
_local12 = (_local9 * 2);
_local13 = Main.getInstance().m_soundManager.getSound(Main.SOUND_MAGNET_ATTRACT);
if (_local13.playing){
_local14 = _local13.volume;
_local14 = (_local14 + _local12);
_local14 = ((_local14 > 2)) ? 2 : _local14;
_local13.volume = _local14;
} else {
Main.getInstance().m_soundManager.playSound(Main.SOUND_MAGNET_ATTRACT, 0, new SoundTransform(_local12));
};
};
}
}
}//package objects
Section 63
//MagnetFlat (objects.MagnetFlat)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class MagnetFlat extends MovieClip implements IObject {
private const MAX_DISTANCE = 160;
private const FORCES:Array;
private var m_dir:int;
public function MagnetFlat(_arg1:int, _arg2:int, _arg3:int){
FORCES = new Array({x:0, y:1}, {x:-1, y:0}, {x:0, y:-1}, {x:1, y:0});
super();
x = _arg1;
y = _arg2;
m_dir = _arg3;
rotation = (m_dir * 90);
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
var _local7:Point;
var _local8:Point;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:Number;
var _local13:Number;
var _local14:Point;
_local6 = new Point(-(FORCES[m_dir].x), -(FORCES[m_dir].y));
_local7 = new Point(_local6.y, _local6.x);
_local8 = new Point(-(_local6.y), -(_local6.x));
if (_local8.x < _local7.x){
_local7.x = (_local7.x * -1);
_local8.x = (_local8.x * -1);
};
if (_local8.y < _local7.y){
_local7.y = (_local7.y * -1);
_local8.y = (_local8.y * -1);
};
if ((((((_arg1 > (x + (_local7.x * 32)))) && ((_arg1 < (x + (_local8.x * 32)))))) || ((((_arg2 > (y + (_local7.y * 32)))) && ((_arg2 < (y + (_local8.y * 32)))))))){
if ((((((((((_arg2 < y)) && ((_arg2 > (y + (_local6.y * MAX_DISTANCE)))))) || ((((_arg2 > y)) && ((_arg2 < (y + (_local6.y * MAX_DISTANCE)))))))) || ((((_arg1 < x)) && ((_arg1 > (x + (_local6.x * MAX_DISTANCE)))))))) || ((((_arg1 > x)) && ((_arg1 < (x + (_local6.x * MAX_DISTANCE)))))))){
_local9 = ((_arg1 - x) * Math.abs(_local6.x));
_local10 = ((_arg2 - y) * Math.abs(_local6.y));
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local12 = (1 - (_local11 / MAX_DISTANCE));
_local13 = (-0.05 * _arg5.getMassFactor());
_local14 = new Point(((_local13 * _local9) * _local12), ((_local13 * _local10) * _local12));
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, _local14));
};
};
}
}
}//package objects
Section 64
//PortalIn (objects.PortalIn)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class PortalIn extends MovieClip implements IObject {
private var m_bUnused:Boolean;// = true
private var m_id:int;
private var m_portalOutRef:PortalOut;
private var m_radius:int;// = 16
public function PortalIn(_arg1:int, _arg2:int, _arg3:int){
m_bUnused = true;
m_radius = 16;
super();
x = _arg1;
y = _arg2;
m_id = _arg3;
}
public function draw():void{
}
public function setOutRef(_arg1:PortalOut):void{
m_portalOutRef = _arg1;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Number;
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = (_arg3 + m_radius);
_local9 = ((_local6 * _local6) + (_local7 * _local7));
if (_local9 < (_local8 * _local8)){
if (m_bUnused){
m_bUnused = false;
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.PORTAL_IN, false, false, new Point(x, y), new Point(m_portalOutRef.x, m_portalOutRef.y)));
Main.getInstance().m_soundManager.playSound(Main.SOUND_BLACK_HOLE, 0, null);
};
} else {
m_bUnused = true;
};
}
}
}//package objects
Section 65
//PortalOut (objects.PortalOut)
package objects {
import flash.display.*;
public class PortalOut extends MovieClip {
private var m_bUnused:Boolean;// = true
private var m_id:int;
private var m_radius:int;// = 16
public function PortalOut(_arg1:int, _arg2:int, _arg3:int){
m_bUnused = true;
m_radius = 16;
super();
x = _arg1;
y = _arg2;
m_id = _arg3;
}
public function draw():void{
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
}
}
}//package objects
Section 66
//PressurePad (objects.PressurePad)
package objects {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import events.*;
public class PressurePad extends MovieClip implements IObject {
private const FRAME_DOWN:int = 10;
private const FRAMES_ALL:int = 20;
private const FRAME_UP:int = 1;
public var m_mcButton:MovieClip;
private var m_bFirstCall:Boolean;// = true
private var m_ind:int;// = 0
private var m_id:int;
private var m_dir:int;
private var m_prevInd:int;// = 0
private var m_bPressed:Boolean;// = false
public function PressurePad(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
m_bPressed = false;
m_bFirstCall = true;
m_ind = 0;
m_prevInd = 0;
super();
stop();
x = _arg1;
y = _arg2;
m_id = _arg3;
m_dir = _arg4;
rotation = (m_dir * 90);
}
private function control(_arg1:Event):void{
if (((((!((currentFrame == 1))) && (!((currentFrame == FRAME_DOWN))))) && ((m_ind >= m_prevInd)))){
Game.getInstance().addActiveObject(this);
m_bFirstCall = true;
removeEventListener(Event.ENTER_FRAME, control);
m_ind = 0;
m_prevInd = 0;
};
m_ind++;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
if (m_bFirstCall){
addEventListener(Event.ENTER_FRAME, control);
Game.getInstance().removeActiveObject(this);
m_bFirstCall = false;
};
m_prevInd = m_ind;
_local6 = new Point(m_mcButton.x, m_mcButton.y);
_local6 = localToGlobal(_local6);
if ((((_arg5.m_size > 1)) && (_arg5.hitTestPoint(_local6.x, _local6.y, false)))){
if (currentFrame < FRAME_DOWN){
nextFrame();
} else {
if (currentFrame > FRAME_DOWN){
gotoAndStop((FRAMES_ALL - currentFrame));
} else {
if (!m_bPressed){
m_bPressed = true;
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.SWITCH_DOOR, false, false, null, null, null, m_id));
Main.getInstance().m_soundManager.playSound(Main.SOUND_PRESSURE_SWITCH, 0, null);
};
};
};
} else {
if (currentFrame != 1){
if (currentFrame == (FRAMES_ALL - 1)){
gotoAndStop(1);
Game.getInstance().removeActiveObject(this);
m_bFirstCall = true;
removeEventListener(Event.ENTER_FRAME, control);
m_ind = 0;
m_prevInd = 0;
} else {
if (currentFrame >= FRAME_DOWN){
nextFrame();
} else {
gotoAndStop((FRAMES_ALL - currentFrame));
};
};
};
};
}
}
}//package objects
Section 67
//Shrinker (objects.Shrinker)
package objects {
import flash.media.*;
import flash.display.*;
import events.*;
public class Shrinker extends MovieClip implements IObject {
private var m_bUnused:Boolean;// = true
private var m_radius:int;// = 14
public function Shrinker(_arg1:int, _arg2:int){
m_bUnused = true;
m_radius = 14;
super();
x = _arg1;
y = _arg2;
}
public function draw():void{
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Number;
_local6 = (_arg1 - x);
_local7 = (_arg2 - y);
_local8 = (_arg3 + m_radius);
_local9 = ((_local6 * _local6) + (_local7 * _local7));
if (_local9 < (_local8 * _local8)){
if (m_bUnused){
m_bUnused = false;
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.SHRINK));
Main.getInstance().m_soundManager.playSound(Main.SOUND_SHRINK, 0, new SoundTransform(2));
};
} else {
m_bUnused = true;
};
}
}
}//package objects
Section 68
//Trampoline (objects.Trampoline)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class Trampoline extends MovieClip implements IObject {
private const FORCE:int = 12;
private const FORCES:Array;
public var m_mcPuff:MovieClip;
private var m_dir:int;
public function Trampoline(_arg1:int, _arg2:int, _arg3:int){
FORCES = new Array({x:0, y:-1}, {x:1, y:0}, {x:0, y:1}, {x:-1, y:0});
super();
addFrameScript(0, frame1);
x = _arg1;
y = _arg2;
m_dir = _arg3;
rotation = (m_dir * 90);
}
function frame1(){
stop();
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
_local6 = new Point(0, -4);
_local6 = localToGlobal(_local6);
if (_arg5.hitTestPoint(_local6.x, _local6.y, true)){
gotoAndPlay("on");
if (!Main.getInstance().m_soundManager.getSound(Main.SOUND_TRAMPOLINE).playing){
Main.getInstance().m_soundManager.playSound(Main.SOUND_TRAMPOLINE, 0, null);
};
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, new Point(((FORCE * FORCES[m_dir].x) * _arg5.getMassFactor()), ((FORCE * FORCES[m_dir].y) * _arg5.getMassFactor()))));
};
}
}
}//package objects
Section 69
//TripSwitch (objects.TripSwitch)
package objects {
import flash.display.*;
import flash.geom.*;
import events.*;
public class TripSwitch extends MovieClip implements IObject {
private const STATE_LEFT:int = 1;
private const STATE_RIGHT:int = 0;
private var m_bSwitched:Boolean;// = false
private var m_id:int;
private var m_state:int;// = 0
private var m_dir:int;
public function TripSwitch(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
m_state = STATE_RIGHT;
m_bSwitched = false;
super();
stop();
x = _arg1;
y = _arg2;
m_id = _arg3;
m_dir = _arg4;
if ((((m_dir == 1)) || ((m_dir == 2)))){
rotation = 180;
};
if ((((m_dir == 1)) || ((m_dir == 3)))){
m_state = STATE_LEFT;
gotoAndStop("left");
};
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
if (m_state == STATE_RIGHT){
_local6 = new Point(-6, -16);
} else {
_local6 = new Point(6, -16);
};
_local6 = localToGlobal(_local6);
if ((((_arg5.m_size > 0)) && (_arg5.hitTestPoint(_local6.x, _local6.y, true)))){
if (!m_bSwitched){
if (m_state == STATE_RIGHT){
m_bSwitched = true;
m_state = STATE_LEFT;
gotoAndStop("left");
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.SWITCH_DOOR, false, false, null, null, null, m_id));
} else {
if (m_state == STATE_LEFT){
m_bSwitched = true;
m_state = STATE_RIGHT;
gotoAndStop("right");
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.SWITCH_DOOR, false, false, null, null, null, m_id));
};
};
};
} else {
m_bSwitched = false;
};
}
}
}//package objects
Section 70
//Water (objects.Water)
package objects {
import flash.geom.*;
import events.*;
public class Water implements IObject {
private var m_firstContact:Boolean;// = false
private var m_top:Boolean;
private var m_x:int;
private var m_y:int;
private var m_dir:int;
public function Water(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean){
m_firstContact = false;
super();
m_x = _arg1;
m_y = _arg2;
m_dir = _arg3;
m_top = _arg4;
}
public function step(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Ball):void{
var _local6:Point;
if (Game.s_gravity.y > 0){
if (_arg2 > (m_y - (_arg3 * 0.5))){
if (_arg5.m_velY > 0){
_local6 = new Point((-(_arg5.m_velX) * 0.1), -(Game.s_gravity.y));
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, _local6));
} else {
if (_arg5.m_velY > -4){
_local6 = new Point(0, (-(Game.s_gravity.y) * 0.6));
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.ADD_VELOCITY, false, false, null, null, _local6));
};
};
if (((m_top) && (!(m_firstContact)))){
m_firstContact = true;
Main.getInstance().m_soundManager.playSound(Main.SOUND_WATER, 0, null);
};
} else {
if ((((((_arg1 > m_x)) && ((_arg1 < (m_x + Game.TILE_SIZE))))) && ((_arg2 > (m_y - (_arg3 * 0.6)))))){
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.IN_WATER, false, false, new Point(m_x, m_y)));
} else {
if (((m_top) && ((_arg2 < (m_y - _arg3))))){
m_firstContact = false;
};
};
};
};
}
}
}//package objects
Section 71
//SoundInstance (sound.SoundInstance)
package sound {
import flash.media.*;
import flash.events.*;
import caurina.transitions.*;
public class SoundInstance {
public var channel:SoundChannel;
public var snd:Sound;
public var name:String;
private var _playing:Boolean;// = false
public function SoundInstance(_arg1:String, _arg2:Sound){
_playing = false;
super();
snd = _arg2;
name = _arg1;
_playing = false;
}
public function stop():void{
channel.stop();
_playing = false;
}
public function get playing():Boolean{
return (_playing);
}
private function onSoundComplete(_arg1:Event):void{
channel.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
_playing = false;
}
public function play(_arg1:Number, _arg2:int, _arg3:SoundTransform):void{
channel = snd.play(_arg1, _arg2, _arg3);
channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
_playing = true;
}
public function volumeTo(_arg1:Number, _arg2:Number=0.5, _arg3:Boolean=false):void{
if (_arg3){
Tweener.addTween(this, {volume:_arg1, time:_arg2, transition:"easeOutSine", onComplete:stop});
} else {
Tweener.addTween(this, {volume:_arg1, time:_arg2, transition:"easeOutSine"});
};
}
public function get volume():Number{
return (channel.soundTransform.volume);
}
public function set volume(_arg1:Number):void{
var _local2:SoundTransform;
_local2 = channel.soundTransform;
_local2.volume = _arg1;
channel.soundTransform = _local2;
}
}
}//package sound
Section 72
//SoundManager (sound.SoundManager)
package sound {
import flash.media.*;
public class SoundManager {
public var mute:Boolean;// = false
private var sounds:Array;
private var ambients:Array;
private static var instance:SoundManager;
public function SoundManager(){
mute = false;
super();
if (instance){
throw (new Error("Only one singleton instance should be instanciated."));
};
sounds = new Array();
ambients = new Array();
}
public function playSound(_arg1:String, _arg2:int, _arg3:SoundTransform):void{
var _local4:int;
if (mute){
return;
};
_local4 = 0;
while (_local4 < sounds.length) {
if (sounds[_local4].name == _arg1){
sounds[_local4].play(0, _arg2, _arg3);
};
_local4++;
};
}
public function globalSoundOff():void{
var _local1:SoundTransform;
mute = true;
_local1 = new SoundTransform();
_local1.volume = 0;
SoundMixer.soundTransform = _local1;
}
public function getAmbient(_arg1:String){
var _local2:int;
_local2 = 0;
while (_local2 < ambients.length) {
if (ambients[_local2].name == _arg1){
return (ambients[_local2]);
};
_local2++;
};
}
public function playAmbient(_arg1:String, _arg2:SoundTransform):void{
var _local3:int;
_local3 = 0;
while (_local3 < ambients.length) {
if (ambients[_local3].name == _arg1){
ambients[_local3].play(0, 99999, _arg2);
};
_local3++;
};
}
public function addSound(_arg1:String, _arg2:Sound):void{
var _local3:SoundInstance;
_local3 = new SoundInstance(_arg1, _arg2);
sounds.push(_local3);
}
public function addAmbient(_arg1:String, _arg2:Sound):void{
var _local3:SoundInstance;
_local3 = new SoundInstance(_arg1, _arg2);
ambients.push(_local3);
}
public function getSound(_arg1:String):SoundInstance{
var _local2:int;
_local2 = 0;
while (_local2 < sounds.length) {
if (sounds[_local2].name == _arg1){
return (sounds[_local2]);
};
_local2++;
};
return (null);
}
public function globalSoundOn():void{
var _local1:SoundTransform;
mute = false;
_local1 = new SoundTransform();
_local1.volume = 1;
SoundMixer.soundTransform = _local1;
}
public function stopAll():void{
SoundMixer.stopAll();
}
public static function getInstance():SoundManager{
if (!instance){
instance = new (SoundManager);
};
return (instance);
}
}
}//package sound
Section 73
//Advert (Advert)
package {
import flash.display.*;
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.net.*;
import events.*;
import com.gskinner.utils.*;
import com.memecounter.*;
import flash.utils.*;
public class Advert extends MovieClip {
private const ADVERT_MOVIES:Array;
private var m_level:int;
public var m_mcScreen:MovieClip;
private var m_advertName:String;
public var m_mcAdvert:MovieClip;
public var m_mcCandle:MovieClip;
private var m_bulkLoader:BulkLoader;
public var m_btnPlay:MovieClip;
public var m_btnVisit:MovieClip;
public function Advert(_arg1:int){
var _local2:FrameScriptManager;
ADVERT_MOVIES = ["Advert1", "Advert2", "Advert3"];
super();
m_level = _arg1;
_local2 = new FrameScriptManager(this);
_local2.setFrameScript("clear", onClearFrame);
_local2.setFrameScript("load", onLoadFrame);
_local2.setFrameScript("in", onInFrame);
_local2.setFrameScript("out", onOutFrame);
}
private function onLoadFrame():void{
var _local1:Class;
_local1 = (getDefinitionByName(ADVERT_MOVIES[(m_level % ADVERT_MOVIES.length)]) as Class);
m_mcAdvert = new (_local1);
m_mcScreen.m_mcContainer.addChild(m_mcAdvert);
}
private function onCompleteLoad(_arg1:ProgressEvent):void{
m_mcScreen.m_mcContainer.addChild(m_bulkLoader.getMovieClip(m_advertName, true));
m_bulkLoader.removeEventListener(BulkLoader.COMPLETE, onCompleteLoad);
m_bulkLoader.removeEventListener(BulkLoader.PROGRESS, onProgressLoad);
m_bulkLoader.removeAll();
}
private function onClearFrame():void{
dispatchEvent(new AdvertEvent(AdvertEvent.CLEAR));
}
private function onInFrame():void{
stop();
m_mcCandle.mouseEnabled = false;
m_mcCandle.mouseChildren = false;
m_btnPlay.buttonMode = true;
m_btnPlay.mouseChildren = false;
m_btnPlay.addEventListener(MouseEvent.CLICK, onClickPlay, false, 0, true);
m_btnVisit.buttonMode = true;
m_btnVisit.mouseChildren = false;
m_btnVisit.addEventListener(MouseEvent.CLICK, onClickVisit, false, 0, true);
}
private function onProgressLoad(_arg1:ProgressEvent):void{
}
private function onClickPlay(_arg1:MouseEvent):void{
m_btnPlay.removeEventListener(MouseEvent.CLICK, onClickPlay);
m_btnVisit.removeEventListener(MouseEvent.CLICK, onClickVisit);
play();
}
private function onOutFrame():void{
stop();
if (m_mcAdvert.mcVideo){
m_mcAdvert.mcVideo.stop();
};
m_mcAdvert.stop();
m_mcScreen.m_mcContainer.removeChild(m_mcAdvert);
m_mcAdvert = null;
dispatchEvent(new AdvertEvent(AdvertEvent.OUT));
}
private function onClickVisit(_arg1:MouseEvent):void{
Tracker.kvClick(Main.CLICK_ID_ADVERT);
navigateToURL(new URLRequest("http://www.alaplaya.eu/p/kerb"), "_blank");
}
}
}//package
Section 74
//Advert1 (Advert1)
package {
import flash.display.*;
public dynamic class Advert1 extends MovieClip {
public var mcVideo:MovieClip;
}
}//package
Section 75
//Advert2 (Advert2)
package {
import flash.display.*;
public dynamic class Advert2 extends MovieClip {
public var mcVideo:MovieClip;
}
}//package
Section 76
//Advert3 (Advert3)
package {
import flash.display.*;
public dynamic class Advert3 extends MovieClip {
public var mcVideo:MovieClip;
}
}//package
Section 77
//arrowleft (arrowleft)
package {
import flash.display.*;
public dynamic class arrowleft extends MovieClip {
}
}//package
Section 78
//arrowright (arrowright)
package {
import flash.display.*;
public dynamic class arrowright extends MovieClip {
}
}//package
Section 79
//Background0 (Background0)
package {
import flash.display.*;
public dynamic class Background0 extends MovieClip {
}
}//package
Section 80
//Ball (Ball)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import de.popforge.events.*;
import events.*;
import flash.utils.*;
public class Ball extends MovieClip {
public const MAX_SIZE:int = 3;
private const CENTER_COLORS:Array;
public const FRAMES:int = 30;
private const STOP_VELOCITY:Number = 0.7;
private const STOP_TIME:int = 250;
private const DEATH_FRAMES:int = 25;
private const STOP_MOVE:Number = 1.4;
private var m_startPos:Point;
public var m_mcFlash:MovieClip;
private var m_direction:Number;
private var m_waterY:int;// = 0
private var m_portalIn:Point;
public var m_mcBody:MovieClip;
private var m_deathFrame:int;// = 0
public var m_rotationVel:Number;// = 0
public var m_mcDirectionPointer:MovieClip;
private var m_force:Number;
private var m_sizeFrame:int;// = -1
public var m_radius:Number;
public var m_size:Number;// = 1
public var m_prevVelY:Number;
private var m_bPause:Boolean;// = false
public var m_prevVelX:Number;
public var m_prevState:int;
public var m_mcDeathAnim:MovieClip;
private var m_waterControl:Sprite;
public var m_prevPosX:Number;
public var m_velX:Number;
public var m_velY:Number;
public var m_bIsDying:Boolean;// = false
public var m_prevPosY:Number;
public var m_posY:Number;
public var m_density:Number;
private var m_currentState:int;
public var m_mcCenter:MovieClip;
public var m_posX:Number;
public var m_time:int;
public var m_mass:Number;
public var m_mcForcePointer:MovieClip;
private var m_bMouseDown;// = false
private var m_bInWater:Boolean;// = true
public var m_mcShape:MovieClip;
private var m_portalOut:Point;
public static const STATE_PAUSE:int = 6;
public static const MAX_VEL:Number = 12;
public static const STATE_DEATH:int = 4;
public static const BOUNCE:Number = 0.5;
public static const STATE_PORTAL_IN:int = 2;
public static const STATE_AIMING:int = 0;
public static const STATE_BACK_TO_START:int = 5;
public static const STATE_ROLL:int = 1;
public static const STATE_PORTAL_OUT:int = 3;
public static const FRICTION:Number = 0.96;
public static const FRICTION_FLAT:Number = 0.9;
public function Ball(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number){
CENTER_COLORS = new Array(6750207, 6750105, 3394764, 0x66CC00);
m_size = 1;
m_sizeFrame = -1;
m_rotationVel = 0;
m_bInWater = true;
m_waterY = 0;
m_bIsDying = false;
m_deathFrame = 0;
m_bPause = false;
m_bMouseDown = false;
super();
m_size = _arg1;
m_velX = 0;
m_velY = 0;
m_prevVelX = 0;
m_prevVelY = 0;
m_posX = _arg3;
m_posY = _arg4;
m_prevPosX = m_posX;
m_prevPosY = m_posY;
m_mcDirectionPointer = new DirectionPointer();
m_mcForcePointer = new ForcePointer();
m_waterControl = new Sprite();
setState(STATE_ROLL);
Game.getInstance().addEventListener(BallEvent.GROW, onGrow);
Game.getInstance().addEventListener(BallEvent.SHRINK, onShrink);
Game.getInstance().addEventListener(BallEvent.PORTAL_IN, onPortalIn);
Game.getInstance().addEventListener(BallEvent.ADD_VELOCITY, onAddVelocity);
Game.getInstance().addEventListener(BallEvent.IN_WATER, onInWater);
m_mcBody.gotoAndStop(((m_size * FRAMES) + 1));
m_mcShape = m_mcBody.mcShape;
m_mcCenter = m_mcBody.mcCenter;
m_radius = (m_mcShape.width >> 1);
m_density = _arg2;
m_mass = getMass();
}
private function onInWater(_arg1:BallEvent):void{
m_waterY = _arg1.portalIn.y;
m_bInWater = true;
}
public function die(_arg1:int, _arg2:Point):void{
var _local3:Class;
m_bIsDying = true;
if (m_currentState == STATE_AIMING){
if (m_bMouseDown){
parent.removeChild(m_mcDirectionPointer);
parent.removeChild(m_mcForcePointer);
m_mcCenter.visible = true;
removeEventListener(Event.ENTER_FRAME, onMouseMove);
};
removeEventListener(SimpleMouseEvent.PRESS, onMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
removeEventListener(SimpleMouseEvent.RELEASE_OUTSIDE, onMouseUpOutside);
SimpleMouseEventHandler.unregister(this);
m_waterControl.removeEventListener(Event.ENTER_FRAME, onWaterControl);
setState(STATE_ROLL);
};
m_velX = (m_velY = 0);
m_rotationVel = 0;
rotation = 0;
m_mcBody.alpha = 0;
m_deathFrame = 0;
m_startPos = _arg2.clone();
_local3 = (getDefinitionByName(("Death" + _arg1)) as Class);
m_mcDeathAnim = new (_local3);
addChild(m_mcDeathAnim);
setState(STATE_DEATH);
Main.getInstance().m_soundManager.playSound(Main.SOUND_DEATH, 0, null);
}
private function onGrow(_arg1:BallEvent):void{
if (m_size < MAX_SIZE){
m_mcBody.gotoAndStop(("grow_" + m_size));
m_size++;
m_sizeFrame = 0;
};
}
private function onShrink(_arg1:BallEvent):void{
if (m_size > 0){
m_mcBody.gotoAndStop(("shrink_" + m_size));
m_size--;
m_sizeFrame = 0;
};
}
public function step():void{
var _local1:Number;
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
switch (m_currentState){
case STATE_ROLL:
m_velX = (m_velX + Game.s_gravity.x);
m_velY = (m_velY + Game.s_gravity.y);
_local1 = Math.sqrt(((m_velX * m_velX) + (m_velY * m_velY)));
if (_local1 > MAX_VEL){
m_velX = ((MAX_VEL * m_velX) / _local1);
m_velY = ((MAX_VEL * m_velY) / _local1);
};
m_posX = (m_posX + m_velX);
m_posY = (m_posY + m_velY);
if ((((m_sizeFrame > -1)) && ((m_sizeFrame < 21)))){
m_sizeFrame++;
m_mcBody.nextFrame();
m_radius = (m_mcShape.width >> 1);
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.CHANGE_SIZE));
if (m_sizeFrame == 20){
m_sizeFrame = -1;
m_mcFlash.width = (m_mcFlash.height = (m_mcShape.width - 2));
};
};
if ((getTimer() - m_time) > STOP_TIME){
if ((((((((Math.abs((m_prevPosX - m_posX)) < STOP_MOVE)) && ((Math.abs((m_prevPosY - m_posY)) < STOP_MOVE)))) && ((Math.abs((m_prevVelX - m_velX)) < STOP_VELOCITY)))) && ((Math.abs((m_prevVelY - m_velY)) < STOP_VELOCITY)))){
setState(STATE_AIMING);
};
m_time = getTimer();
m_prevPosX = m_posX;
m_prevPosY = m_posY;
m_prevVelX = m_velX;
m_prevVelY = m_velY;
};
break;
case STATE_PORTAL_IN:
m_posX = (m_posX + ((m_portalIn.x - m_posX) * 0.5));
m_posY = (m_posY + ((m_portalIn.y - m_posY) * 0.5));
if ((((Math.abs((m_portalIn.x - m_posX)) < 1)) && ((Math.abs((m_portalIn.y - m_posY)) < 1)))){
if (alpha > 0.1){
alpha = (alpha - 0.1);
} else {
alpha = 1;
visible = false;
m_posX = m_portalOut.x;
m_posY = m_portalOut.y;
setState(STATE_PORTAL_OUT);
};
};
break;
case STATE_PORTAL_OUT:
_local2 = new Point(m_posX, m_posY);
_local2 = parent.localToGlobal(_local2);
_local3 = Game.getInstance().getCameraLeft();
_local4 = Game.getInstance().getCameraRight();
_local5 = Game.getInstance().getCameraTop();
_local6 = Game.getInstance().getCameraBottom();
if ((((((((_local2.x < 400)) && ((_local2.x > 150)))) || ((((_local4 == 0)) || ((_local3 == 0)))))) && ((((((_local2.y > 100)) && ((_local2.y < 300)))) || ((((_local5 == 0)) || ((_local6 == 0)))))))){
visible = true;
setState(STATE_ROLL);
};
break;
case STATE_DEATH:
if (m_deathFrame++ >= DEATH_FRAMES){
m_bIsDying = false;
m_posX = m_startPos.x;
m_posY = m_startPos.y;
removeChild(m_mcDeathAnim);
setState(STATE_BACK_TO_START);
};
break;
case STATE_BACK_TO_START:
_local2 = new Point(m_posX, m_posY);
_local2 = parent.localToGlobal(_local2);
_local3 = Game.getInstance().getCameraLeft();
_local4 = Game.getInstance().getCameraRight();
_local5 = Game.getInstance().getCameraTop();
_local6 = Game.getInstance().getCameraBottom();
if ((((((((_local2.x < 500)) && ((_local2.x > 50)))) || ((((_local4 == 0)) || ((_local3 == 0)))))) && ((((((_local2.y > 100)) && ((_local2.y < 300)))) || ((((_local5 == 0)) || ((_local6 == 0)))))))){
if (m_mcBody.alpha < 1){
m_mcBody.alpha = (m_mcBody.alpha + 0.1);
} else {
m_mcBody.alpha = 1;
setState(STATE_ROLL);
};
};
break;
};
}
public function getState():int{
return (m_currentState);
}
private function onMouseMove(_arg1:Event):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = new Point(parent.mouseX, parent.mouseY);
m_direction = (Math.atan2((y - _local2.y), (_local2.x - x)) + Math.PI);
m_mcDirectionPointer.rotation = (90 - ((180 * m_direction) / Math.PI));
m_mcDirectionPointer.x = (x + ((m_radius + 2) * Math.cos(m_direction)));
m_mcDirectionPointer.y = (y - ((m_radius + 2) * Math.sin(m_direction)));
_local3 = (Math.sqrt(((mouseX * mouseX) + (mouseY * mouseY))) / 100);
if (_local3 > 1){
_local3 = 1;
};
_local4 = Math.sin(((_local3 * Math.PI) * 0.5));
_local5 = ((m_radius - 1) * _local4);
m_mcForcePointer.x = x;
m_mcForcePointer.y = y;
m_mcForcePointer.width = (_local5 << 1);
m_mcForcePointer.height = (_local5 << 1);
m_force = ((MAX_VEL * getMassFactor()) * _local4);
}
private function onMouseUpOutside(_arg1:SimpleMouseEvent):void{
m_bMouseDown = false;
parent.removeChild(m_mcDirectionPointer);
parent.removeChild(m_mcForcePointer);
m_mcCenter.visible = true;
removeEventListener(Event.ENTER_FRAME, onMouseMove);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
removeEventListener(SimpleMouseEvent.RELEASE_OUTSIDE, onMouseUpOutside);
SimpleMouseEventHandler.unregister(this);
m_waterControl.removeEventListener(Event.ENTER_FRAME, onWaterControl);
setState(STATE_ROLL);
m_velX = (m_force * Math.cos(m_direction));
m_velY = (-(m_force) * Math.sin(m_direction));
}
private function onAddVelocity(_arg1:BallEvent):void{
m_velX = (m_velX + _arg1.vel.x);
m_velY = (m_velY + _arg1.vel.y);
}
public function draw():void{
x = m_posX;
y = m_posY;
rotation = (rotation + m_rotationVel);
switch (m_currentState){
case STATE_DEATH:
m_mcDeathAnim.gotoAndStop((m_deathFrame + 1));
break;
};
}
private function onMouseUp(_arg1:MouseEvent):void{
m_bMouseDown = false;
parent.removeChild(m_mcDirectionPointer);
parent.removeChild(m_mcForcePointer);
m_mcCenter.visible = true;
removeEventListener(Event.ENTER_FRAME, onMouseMove);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
removeEventListener(SimpleMouseEvent.RELEASE_OUTSIDE, onMouseUpOutside);
SimpleMouseEventHandler.unregister(this);
m_waterControl.removeEventListener(Event.ENTER_FRAME, onWaterControl);
setState(STATE_ROLL);
m_velX = (m_force * Math.cos(m_direction));
m_velY = (-(m_force) * Math.sin(m_direction));
}
private function getMass():Number{
return ((((Math.PI * m_radius) * m_radius) * m_density));
}
public function setState(_arg1:int):void{
m_prevState = m_currentState;
m_currentState = _arg1;
m_bPause = false;
switch (_arg1){
case STATE_AIMING:
SimpleMouseEventHandler.register(this);
addEventListener(SimpleMouseEvent.PRESS, onMouseDown);
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.STOP));
if (m_bInWater){
m_waterControl.addEventListener(Event.ENTER_FRAME, onWaterControl);
};
break;
case STATE_ROLL:
m_bInWater = false;
m_time = getTimer();
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.START));
break;
case STATE_PAUSE:
m_bPause = true;
if (m_prevState == STATE_AIMING){
removeEventListener(Event.ENTER_FRAME, onMouseMove);
removeEventListener(SimpleMouseEvent.PRESS, onMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
removeEventListener(SimpleMouseEvent.RELEASE_OUTSIDE, onMouseUpOutside);
SimpleMouseEventHandler.unregister(this);
m_waterControl.removeEventListener(Event.ENTER_FRAME, onWaterControl);
};
break;
};
}
public function getMassFactor():Number{
return ((0.5 + (0.5 * (1 - (m_size / MAX_SIZE)))));
}
public function setSize(_arg1:int):void{
m_size = _arg1;
m_sizeFrame = -1;
m_mcBody.gotoAndStop(((m_size * FRAMES) + 1));
m_radius = (m_mcShape.width >> 1);
m_mass = getMass();
}
public function setPosition(_arg1:Point):void{
m_posX = _arg1.x;
m_posY = _arg1.y;
}
private function onWaterControl(_arg1:Event):void{
m_posY = (m_posY + 0.1);
if ((m_posY - m_radius) > m_waterY){
Game.getInstance().dispatchEvent(new BallEvent(BallEvent.DEATH));
};
}
private function onMouseDown(_arg1:SimpleMouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
m_bMouseDown = true;
parent.addChild(m_mcDirectionPointer);
parent.addChild(m_mcForcePointer);
_local2 = (CENTER_COLORS[m_size] >> 16);
_local3 = ((CENTER_COLORS[m_size] >> 8) & 0xFF);
_local4 = (CENTER_COLORS[m_size] & 0xFF);
m_mcDirectionPointer.transform.colorTransform = new ColorTransform(1, 1, 1, 1, _local2, _local3, _local4, 0);
m_mcForcePointer.transform.colorTransform = new ColorTransform(1, 1, 1, 1, _local2, _local3, _local4, 0);
m_mcForcePointer.x = x;
m_mcForcePointer.y = y;
_local5 = new Point(parent.mouseX, parent.mouseY);
m_direction = (Math.atan2((y - _local5.y), (_local5.x - x)) + Math.PI);
m_mcDirectionPointer.rotation = (90 - ((180 * m_direction) / Math.PI));
m_mcDirectionPointer.x = (x + ((m_radius + 2) * Math.cos(m_direction)));
m_mcDirectionPointer.y = (y - ((m_radius + 2) * Math.sin(m_direction)));
m_mcCenter.visible = false;
removeEventListener(SimpleMouseEvent.PRESS, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(SimpleMouseEvent.RELEASE_OUTSIDE, onMouseUpOutside);
addEventListener(Event.ENTER_FRAME, onMouseMove, false, 0, true);
}
private function onPortalIn(_arg1:BallEvent):void{
m_portalIn = _arg1.portalIn.clone();
m_portalOut = _arg1.portalOut.clone();
setState(STATE_PORTAL_IN);
}
}
}//package
Section 81
//BitmapParser (BitmapParser)
package {
import flash.display.*;
import flash.utils.*;
class BitmapParser {
private var m_aLayers:Array;
private var m_layers:int;
private var m_bmdMap:BitmapData;
private var m_height:int;
private var m_width:int;
private var m_border:int;
function BitmapParser(_arg1:BitmapData, _arg2:int, _arg3:int=0){
m_aLayers = new Array();
super();
m_layers = _arg2;
m_bmdMap = _arg1.clone();
m_border = _arg3;
m_width = (m_bmdMap.width + (2 * m_border));
m_height = (int((m_bmdMap.height / m_layers)) + (2 * m_border));
parse();
m_bmdMap.dispose();
}
public function getLayers():Array{
return (m_aLayers);
}
private function parse():void{
var _local1:int;
var _local2:int;
var _local3:ByteArray;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:int;
var _local9:int;
m_aLayers = new Array(m_layers);
_local1 = 0;
while (_local1 < m_layers) {
m_aLayers[_local1] = new Array(m_height);
_local9 = 0;
while (_local9 < m_height) {
m_aLayers[_local1][_local9] = new Array(m_width);
_local9++;
};
_local1++;
};
_local2 = (m_layers - 1);
_local3 = m_bmdMap.getPixels(m_bmdMap.rect);
_local4 = (_local3.length >> 2);
_local1 = 0;
while (_local1 < _local4) {
_local5 = (m_border + (_local1 % (m_width - (2 * m_border))));
_local6 = (m_border + int(((_local1 / (m_width - (2 * m_border))) % (m_height - (2 * m_border)))));
_local7 = _local3[((_local1 << 2) + 2)];
_local8 = _local3[((_local1 << 2) + 3)];
if (_local1 == ((_local4 * (m_layers - _local2)) / m_layers)){
_local2--;
};
m_aLayers[_local2][_local6][_local5] = ((_local8 << 8) | _local7);
_local1++;
};
}
}
}//package
Section 82
//ButtonBack (ButtonBack)
package {
public dynamic class ButtonBack extends StandardButton {
}
}//package
Section 83
//ButtonHelp (ButtonHelp)
package {
public dynamic class ButtonHelp extends StandardButton {
}
}//package
Section 84
//ButtonPause (ButtonPause)
package {
public dynamic class ButtonPause extends TwoStateButton {
}
}//package
Section 85
//ButtonPlay (ButtonPlay)
package {
public dynamic class ButtonPlay extends StandardButton {
}
}//package
Section 86
//ButtonReload (ButtonReload)
package {
public dynamic class ButtonReload extends StandardButton {
}
}//package
Section 87
//ButtonSound (ButtonSound)
package {
public dynamic class ButtonSound extends TwoStateButton {
}
}//package
Section 88
//ClickButton (ClickButton)
package {
public dynamic class ClickButton extends StandardButton {
}
}//package
Section 89
//Death0 (Death0)
package {
import flash.display.*;
public dynamic class Death0 extends MovieClip {
}
}//package
Section 90
//Death1 (Death1)
package {
import flash.display.*;
public dynamic class Death1 extends MovieClip {
}
}//package
Section 91
//Death2 (Death2)
package {
import flash.display.*;
public dynamic class Death2 extends MovieClip {
}
}//package
Section 92
//Death3 (Death3)
package {
import flash.display.*;
public dynamic class Death3 extends MovieClip {
}
}//package
Section 93
//DirectionPointer (DirectionPointer)
package {
import flash.display.*;
public dynamic class DirectionPointer extends MovieClip {
public function DirectionPointer(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 94
//EndScreen (EndScreen)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.memecounter.*;
public class EndScreen extends MovieClip {
public var m_btnClickHere:StandardButton;
public var m_btnPlay:StandardButton;
public function EndScreen(){
m_btnPlay.addEventListener(Event.SELECT, onClickPlay);
m_btnClickHere.addEventListener(Event.SELECT, onClickClickHere);
}
private function onClickClickHere(_arg1:Event):void{
m_btnClickHere.reset();
Tracker.kvClick(Main.CLICK_ID_END_SCREEN);
navigateToURL(new URLRequest("http://www.alaplaya.eu/p/kerb"), "_blank");
}
private function onClickPlay(_arg1:Event):void{
m_btnPlay.removeEventListener(Event.SELECT, onClickPlay);
m_btnClickHere.removeEventListener(Event.SELECT, onClickClickHere);
Main.getInstance().gotoPage(Main.LABEL_FRONT);
}
}
}//package
Section 95
//ForcePointer (ForcePointer)
package {
import flash.display.*;
public dynamic class ForcePointer extends MovieClip {
}
}//package
Section 96
//Foreground0 (Foreground0)
package {
import flash.display.*;
public dynamic class Foreground0 extends MovieClip {
}
}//package
Section 97
//Foreground1 (Foreground1)
package {
import flash.display.*;
public dynamic class Foreground1 extends MovieClip {
}
}//package
Section 98
//Foreground2 (Foreground2)
package {
import flash.display.*;
public dynamic class Foreground2 extends MovieClip {
}
}//package
Section 99
//Foreground3 (Foreground3)
package {
import flash.display.*;
public dynamic class Foreground3 extends MovieClip {
}
}//package
Section 100
//Foreground4 (Foreground4)
package {
import flash.display.*;
public dynamic class Foreground4 extends MovieClip {
}
}//package
Section 101
//Front (Front)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.gskinner.utils.*;
import com.memecounter.*;
public class Front extends MovieClip {
public var m_btnHelp:StandardButton;
public var m_mcKerbLogo:MovieClip;
public var m_btnSound:TwoStateButton;
public var m_btnPlay:StandardButton;
public var m_mcAlaplayaLogo:MovieClip;
public function Front(){
var _local1:FrameScriptManager;
super();
_local1 = new FrameScriptManager(this);
_local1.setFrameScript("init", init);
}
private function init():void{
stop();
if (Main.getInstance().m_soundManager.mute){
m_btnSound.setState(TwoStateButton.STATE_DOWN);
};
m_btnPlay.addEventListener(Event.SELECT, onSelectPlay);
m_btnHelp.addEventListener(Event.SELECT, onSelectHelp);
m_btnSound.addEventListener(Event.SELECT, onClickSound);
m_mcAlaplayaLogo.addEventListener(MouseEvent.CLICK, onClickLogo);
m_mcKerbLogo.addEventListener(MouseEvent.CLICK, onClickKerbLogo);
m_mcAlaplayaLogo.buttonMode = true;
m_mcKerbLogo.buttonMode = true;
}
private function removeListeners():void{
m_btnPlay.removeEventListener(Event.SELECT, onSelectPlay);
m_btnHelp.removeEventListener(Event.SELECT, onSelectHelp);
m_btnSound.removeEventListener(Event.SELECT, onClickSound);
m_mcAlaplayaLogo.removeEventListener(MouseEvent.CLICK, onClickLogo);
m_mcKerbLogo.removeEventListener(MouseEvent.CLICK, onClickKerbLogo);
}
private function onClickLogo(_arg1:MouseEvent):void{
Tracker.kvClick(Main.CLICK_ID_FRONT);
navigateToURL(new URLRequest("http://www.alaplaya.eu/p/kerb"), "_blank");
}
private function onClickSound(_arg1:Event):void{
if (Main.getInstance().m_soundManager.mute){
Main.getInstance().m_soundManager.globalSoundOn();
} else {
Main.getInstance().m_soundManager.globalSoundOff();
};
}
private function onSelectPlay(_arg1:Event):void{
removeListeners();
Main.getInstance().gotoPage(Main.LABEL_LEVEL);
}
private function onSelectHelp(_arg1:Event):void{
removeListeners();
Main.getInstance().gotoPage(Main.LABEL_HELP);
}
private function onClickKerbLogo(_arg1:MouseEvent):void{
Tracker.kvClick(Main.CLICK_ID_KERB_LOGO);
navigateToURL(new URLRequest("http://www.kerb.co.uk"), "_blank");
}
}
}//package
Section 102
//Game (Game)
package {
import sound.*;
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import events.*;
import objects.*;
import flash.utils.*;
public class Game extends MovieClip {
private const VIEW_HEIGHT:int = 400;
private const STATE_AIMING:int = 1;
private const STATE_INIT:int = 0;
private const VIEW_COLUMNS:int;
public const LAYER_CONTROL:int = 2;
private const STATE_PAUSE:int = 3;
private const STATE_SIMULATION:int = 2;
private const BACKGROUNDS:Array;
private const STATE_LEVEL_END:int = 4;
private const POINT_00:Point;
private const VIEW_ROWS:int;
public const LAYER_WALLS:int = 0;
public const LAYERS:int = 4;
private const FOREGROUNDS:Array;
private const VIEW_WIDTH:int = 550;
public const LAYER_DIRECTION:int = 3;
public const LAYER_OBJECTS:int = 1;
private var m_objectsDrawable:Sprite;
private var m_objectsFront:Sprite;
private var m_cameraX:Number;
private var m_cameraDY:int;
private var m_cameraDX:int;
private var m_bmdScreenBuffer:BitmapData;
private var m_aEnemies:Array;
private var m_startPos:Point;
private var m_startSize:int;
private var m_bufferTileX:int;
private var m_cameraY:Number;
private var m_bufferTileY:int;
private var m_aGravitySwitches:Array;
private var m_background:Sprite;
private var m_aActiveObjects:Array;
private var m_bufferDY:int;
private var m_bmdTilesSet:BitmapData;
private var m_bufferDX:int;
private var m_aDoorSmash:Array;
private var m_bmpTiles:Bitmap;
private var m_aTrampoline:Array;
public var m_btnPause:TwoStateButton;
private var m_cameraTop:int;
private var m_backgroundScaleX:Number;
private var m_backgroundScaleY:Number;
public var m_mcContent:MovieClip;
private var m_aDoors:Array;
var m_mcBall:Ball;
private var m_bmdFill:BitmapData;
private var m_prevState:int;
private var m_backgroundDY:int;
private var m_backgroundDX:int;
private var m_levelHeight:int;
private var m_cameraDestX:Number;
private var m_cameraDestY:Number;
private var m_aObjects:Array;
private var m_bmdTiles:BitmapData;
var m_bDebug:Boolean;// = false
private var m_currentState:int;
private var m_level:int;// = 0
private var m_bmdBackground:BitmapData;
public var m_btnRetry:StandardButton;
private var m_objects:Sprite;
var m_bmdBall:BitmapData;
private var m_canvas:Sprite;
public var m_btnSound:TwoStateButton;
private var m_exit:Exit;
private var m_levelWidth:int;
private var m_aLevel:Array;
private var m_help:Help;
public var m_endScreen:EndScreen;
private var m_cameraLeft:int;
public var m_btnHelp:StandardButton;
public var m_advert:Advert;
public static const TILE_EXIT_0:Point = new Point(1, 4);
public static const TILE_EXIT_1:Point = new Point(2, 4);
public static const TILE_EXIT_3:Point = new Point(4, 4);
public static const TILE_PORTAL_IN:Point = new Point(0, 1);
public static const TILE_PORTAL_OUT:Point = new Point(1, 1);
public static const TILE_EXIT_2:Point = new Point(3, 4);
public static const TILE_TRIP_SWITCH:Point = new Point(1, 0);
public static const TILE_GRAVITY_SWITCH:Point = new Point(4, 0);
public static const TILE_ENEMY:Point = new Point(0, 3);
public static const TILE_MAGNET:Point = new Point(4, 1);
public static const TILE_DOOR_SMASH:Point = new Point(5, 0);
public static const TILE_MAGNET_FLAT:Point = new Point(0, 2);
public static const TILE_DOOR:Point = new Point(2, 0);
public static const LEVELS_AMOUNT:int = 20;
public static const TILE_WATER_TOP:Point = new Point(1, 2);
public static const TILE_GROWER:Point = new Point(2, 1);
public static const TILE_TRAMPOLINE:Point = new Point(3, 0);
public static const TILE_NAV_POINT:Point = new Point(1, 3);
public static const TILE_WATER_DEEP:Point = new Point(2, 2);
public static const LEVEL_BORDER:int = 4;
public static const TILE_PRESSURE_PAD:Point = new Point(0, 0);
public static const TILE_SHRINKER:Point = new Point(3, 1);
public static const TILE_START:Point = new Point(0, 4);
public static const TILE_SIZE:int = 32;
public static const TILE_ANTIMAGNET:Point = new Point(5, 1);
public static var s_gravity:Point = new Point(0, 0.25);
private static var s_instance:Game;
public function Game(){
VIEW_ROWS = (int((VIEW_HEIGHT / TILE_SIZE)) + 1);
VIEW_COLUMNS = (int((VIEW_WIDTH / TILE_SIZE)) + 1);
POINT_00 = new Point(0, 0);
FOREGROUNDS = ["Foreground0", "Foreground0", "Foreground0", "Foreground0", "Foreground0", "Foreground1", "Foreground1", "Foreground1", "Foreground1", "Foreground1", "Foreground2", "Foreground2", "Foreground2", "Foreground2", "Foreground2", "Foreground3", "Foreground3", "Foreground3", "Foreground3", "Foreground3"];
BACKGROUNDS = ["Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0", "Background0"];
m_level = 0;
m_bDebug = false;
super();
s_instance = this;
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
private function addColumnLeft():void{
var _local1:BitmapData;
var _local2:int;
var _local3:BitmapData;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:int;
var _local8:int;
var _local9:int;
_local1 = m_bmdScreenBuffer.clone();
m_bmdScreenBuffer.fillRect(m_bmdScreenBuffer.rect, 0);
m_bmdScreenBuffer.copyPixels(_local1, new Rectangle(0, 0, (_local1.width - TILE_SIZE), _local1.height), new Point(TILE_SIZE, 0));
_local1.dispose();
_local2 = 0;
while (_local2 < (VIEW_ROWS + 1)) {
if ((_local2 + m_bufferTileY) < m_levelHeight){
_local7 = m_aLevel[LAYER_WALLS][(_local2 + m_bufferTileY)][m_bufferTileX];
_local8 = (_local7 & 0xFF);
_local9 = (_local7 >> 8);
if ((((_local8 < 0xFF)) && ((_local9 < 0xFF)))){
m_bmdScreenBuffer.copyPixels(m_bmdTilesSet, new Rectangle((_local8 * TILE_SIZE), (_local9 * TILE_SIZE), TILE_SIZE, TILE_SIZE), new Point(0, (_local2 * TILE_SIZE)));
};
};
_local2++;
};
_local3 = m_bmdScreenBuffer.clone();
_local3.threshold(_local3, _local3.rect, POINT_00, "!=", 4294901760, 0);
_local4 = ((-(m_bufferTileX) * TILE_SIZE) % (m_bmdFill.width >> 1));
_local5 = ((-(m_bufferTileY) * TILE_SIZE) % (m_bmdFill.height >> 1));
_local6 = new Point(_local4, _local5);
m_bmdScreenBuffer.copyPixels(m_bmdFill, m_bmdFill.rect, _local6, _local3, _local6, true);
_local3.dispose();
}
private function insertObjects():void{
var _local1:int;
var _local2:Array;
var _local3:int;
var _local4:*;
var _local5:*;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Point;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
m_aGravitySwitches = new Array();
m_aDoorSmash = new Array();
m_aTrampoline = new Array();
m_aDoors = new Array();
m_aActiveObjects = new Array();
m_aEnemies = new Array();
_local2 = new Array(10);
_local3 = 0;
while (_local3 < 10) {
_local2[_local3] = null;
_local3++;
};
_local7 = 0;
_local8 = 0;
_local9 = 0;
while (_local9 < m_levelHeight) {
_local10 = 0;
while (_local10 < m_levelWidth) {
_local1 = m_aLevel[LAYER_OBJECTS][_local9][_local10];
_local11 = new Point((_local1 & 0xFF), (_local1 >> 8));
if ((((_local11.x < 0xFF)) && ((_local11.y < 0xFF)))){
if (_local11.equals(TILE_GROWER)){
_local4 = new Grower(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE));
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
} else {
if (_local11.equals(TILE_SHRINKER)){
_local4 = new Shrinker(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE));
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
} else {
if (_local11.equals(TILE_PORTAL_IN)){
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
_local4 = new PortalIn(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local5);
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
if (_local2[_local5] == null){
_local2[_local5] = _local4;
} else {
_local4.setOutRef(_local2[_local5]);
};
} else {
if (_local11.equals(TILE_PORTAL_OUT)){
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
_local4 = new PortalOut(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local5);
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
if (_local2[_local5] == null){
_local2[_local5] = _local4;
} else {
_local2[_local5].setOutRef(_local4);
};
} else {
if (_local11.equals(TILE_ANTIMAGNET)){
_local4 = new AntiMagnet(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE));
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
} else {
if (_local11.equals(TILE_MAGNET)){
_local4 = new Magnet(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE));
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
} else {
if (_local11.equals(TILE_GRAVITY_SWITCH)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 != 1){
_local6 = 0;
};
_local4 = new GravitySwitch((((_local10 + 0.5) * TILE_SIZE) + ((_local6 == 0)) ? 16 : -16), (_local9 * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
m_aGravitySwitches.push(_local4);
} else {
if (_local11.equals(TILE_DOOR_SMASH)){
_local4 = new DoorSmash(((_local10 + 0.5) * TILE_SIZE), (_local9 * TILE_SIZE));
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
m_aDoorSmash.push(_local4);
} else {
if (_local11.equals(TILE_TRAMPOLINE)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local4 = new Trampoline(((_local10 + 1) * TILE_SIZE), ((_local9 + ((_local6 == 2)) ? 1 : 0) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
m_aTrampoline.push(_local4);
} else {
if (_local11.equals(TILE_PRESSURE_PAD)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
_local4 = new PressurePad(((_local10 + 1) * TILE_SIZE), ((_local9 + ((_local6 == 2)) ? 1 : 0) * TILE_SIZE), _local5, _local6);
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
} else {
if (_local11.equals(TILE_TRIP_SWITCH)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
_local4 = new TripSwitch(((_local10 + 1) * TILE_SIZE), ((_local9 + ((((_local6 == 2)) || ((_local6 == 1)))) ? 1 : 0) * TILE_SIZE), _local5, _local6);
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
} else {
if (_local11.equals(TILE_DOOR)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
if (_local6 == 1){
_local4 = new Door(((_local10 + 1) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local5, _local6);
} else {
_local4 = new Door(((_local10 + 0.5) * TILE_SIZE), (_local9 * TILE_SIZE), _local5, _local6);
};
m_aObjects[_local9][_local10] = _local4;
m_objectsDrawable.addChild(_local4);
m_aDoors[_local5] = _local4;
} else {
if (_local11.equals(TILE_MAGNET_FLAT)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local4 = new MagnetFlat(((_local10 + 1) * TILE_SIZE), ((_local9 + ((_local6 == 2)) ? 1 : 0) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = _local4;
m_objects.addChild(_local4);
addActiveObject(_local4);
} else {
if (_local11.equals(TILE_EXIT_0)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
m_exit = new Exit0(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = m_exit;
m_objectsDrawable.addChild(m_exit);
} else {
if (_local11.equals(TILE_EXIT_1)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
m_exit = new Exit1(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = m_exit;
m_objectsDrawable.addChild(m_exit);
} else {
if (_local11.equals(TILE_EXIT_2)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
m_exit = new Exit2(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = m_exit;
m_objectsDrawable.addChild(m_exit);
} else {
if (_local11.equals(TILE_EXIT_3)){
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
m_exit = new Exit3(((_local10 + 0.5) * TILE_SIZE), ((_local9 + 0.5) * TILE_SIZE), _local6);
m_aObjects[_local9][_local10] = m_exit;
m_objectsDrawable.addChild(m_exit);
} else {
if (_local11.equals(TILE_ENEMY)){
_local12 = 0;
_local13 = _local10;
do {
_local1 = m_aLevel[LAYER_OBJECTS][_local9][_local13];
_local11 = new Point((_local1 & 0xFF), (_local1 >> 8));
_local13--;
_local12++;
} while (((!(_local11.equals(TILE_NAV_POINT))) && ((_local12 < 20))));
_local13++;
_local12 = 0;
_local14 = _local10;
do {
_local1 = m_aLevel[LAYER_OBJECTS][_local9][_local14];
_local11 = new Point((_local1 & 0xFF), (_local1 >> 8));
_local14++;
_local12++;
} while (((!(_local11.equals(TILE_NAV_POINT))) && ((_local12 < 20))));
_local14--;
_local5 = m_aLevel[LAYER_CONTROL][_local9][_local10];
_local5 = (_local5 >> 8);
if (_local5 > 3){
_local5 = 1;
};
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local15 = (((TILE_SIZE * 0.5) - Enemy.RADIUS[_local5]) + 2);
_local4 = new Enemy(((_local10 + 0.5) * TILE_SIZE), (((_local9 + 0.5) * TILE_SIZE) + ((_local6 == 0)) ? _local15 : -(_local15)), ((_local13 + 0.5) * TILE_SIZE), ((_local14 + 0.5) * TILE_SIZE), _local5);
m_objectsFront.addChild(_local4);
m_aEnemies.push(_local4);
addActiveObject(_local4);
} else {
if (_local11.equals(TILE_WATER_TOP)){
_local7++;
_local1 = m_aLevel[LAYER_OBJECTS][_local9][(_local10 + 1)];
_local11 = new Point((_local1 & 0xFF), (_local1 >> 8));
if ((((_local7 == 4)) || (!(_local11.equals(TILE_WATER_TOP))))){
_local4 = new WaterAnim();
_local4.x = (((_local10 - _local7) + 1) * TILE_SIZE);
_local4.y = (_local9 * TILE_SIZE);
_local4.scrollRect = new Rectangle(0, 0, (TILE_SIZE * _local7), TILE_SIZE);
_local4.blendMode = BlendMode.MULTIPLY;
m_objectsFront.addChild(_local4);
_local7 = 0;
};
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local4 = new Water((_local10 * TILE_SIZE), (_local9 * TILE_SIZE), _local6, true);
m_aObjects[_local9][_local10] = _local4;
} else {
if (_local11.equals(TILE_WATER_DEEP)){
_local4 = new WaterDeep();
_local4.x = (_local10 * TILE_SIZE);
_local4.y = (_local9 * TILE_SIZE);
_local4.blendMode = BlendMode.MULTIPLY;
m_objectsFront.addChild(_local4);
_local6 = m_aLevel[LAYER_DIRECTION][_local9][_local10];
if (_local6 > 3){
_local6 = 0;
};
_local4 = new Water((_local10 * TILE_SIZE), (_local9 * TILE_SIZE), _local6, false);
m_aObjects[_local9][_local10] = _local4;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local10++;
};
_local9++;
};
}
private function onStopBall(_arg1:BallEvent):void{
m_currentState = STATE_AIMING;
}
private function detectGround():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:int;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Point;
var _local11:Point;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Array;
var _local15:int;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Boolean;
var _local23:Number;
var _local24:Point;
var _local25:MovieClip;
var _local26:Point;
var _local27:int;
var _local28:Point;
var _local29:Number;
var _local30:Point;
var _local31:Number;
var _local32:Point;
var _local33:Boolean;
var _local34:Boolean;
_local1 = m_mcBall.m_radius;
_local2 = -(((m_mcBall.m_posX + m_objects.x) - _local1));
_local3 = -(((m_mcBall.m_posY + m_objects.y) - _local1));
_local4 = m_bmdTiles.hitTest(new Point(_local2, _local3), 250, m_bmdBall, new Point(0, 0), 250);
if (_local4){
_local5 = 32;
_local8 = 0;
_local9 = (Math.PI / (_local5 >> 1));
_local10 = new Point(0, 0);
_local11 = new Point(0, 0);
_local12 = false;
_local13 = false;
_local14 = new Array();
_local1 = (_local1 + 2);
_local15 = 0;
_local16 = -1;
_local17 = 0;
while (_local17 < _local5) {
_local6 = ((m_mcBall.m_posX + m_objects.x) + (_local1 * Math.sin(_local8)));
_local7 = ((m_mcBall.m_posY + m_objects.y) - (_local1 * Math.cos(_local8)));
_local10.x = _local6;
_local10.y = _local7;
_local10 = localToGlobal(_local10);
_local12 = m_bmdTiles.hitTest(_local11, 100, _local10);
if (_local12){
if ((((_local14.length > 1)) && (((_local17 - _local15) > 1)))){
_local16 = _local14[(_local14.length - 1)];
if (((((((!(_local13)) && ((s_gravity.y < 0)))) && ((_local14[(_local14.length - 1)] < Math.PI)))) && ((_local8 > Math.PI)))){
_local13 = true;
};
};
if (_local8 == 0){
_local13 = true;
_local14.push(_local8);
} else {
_local14.push((((_local13) && ((_local8 > Math.PI)))) ? (_local8 - (2 * Math.PI)) : _local8);
};
_local15 = _local17;
};
_local8 = (_local8 + _local9);
_local17++;
};
if (_local14.length == 0){
return;
};
_local18 = 0;
_local19 = 0;
_local20 = 0;
_local21 = 0;
_local22 = false;
_local17 = 0;
while (_local17 < _local14.length) {
if (_local14[_local17] == _local16){
_local22 = true;
};
if (!_local22){
_local18 = (_local18 + _local14[_local17]);
_local20++;
} else {
_local19 = (_local19 + _local14[_local17]);
_local21++;
};
_local17++;
};
_local23 = (Math.PI + ((_local18 + _local19) / _local14.length));
if (_local23 > (2 * Math.PI)){
_local23 = (_local23 - (2 * Math.PI));
};
_local24 = new Point(Math.sin(_local23), -(Math.cos(_local23)));
_local25 = new MovieClip();
_local26 = new Point(m_mcBall.m_velX, m_mcBall.m_velY);
_local8 = ((180 * _local23) / Math.PI);
_local25.rotation = -(_local8);
_local26 = _local25.localToGlobal(_local26);
if ((((((_local8 > 359.9)) || ((_local8 < 0.1)))) || ((((_local8 > 179.9)) && ((_local8 < 180.1)))))){
_local26.x = (_local26.x * Ball.FRICTION_FLAT);
} else {
_local26.x = (_local26.x * Ball.FRICTION);
};
_local26.y = (_local26.y * -(Ball.BOUNCE));
if (Math.abs(_local26.y) > (Ball.MAX_VEL * 0.1)){
switch (m_mcBall.m_size){
case 0:
Main.getInstance().m_soundManager.playSound(Main.SOUND_VERY_SMALL_BOUNCE, 0, null);
break;
case 1:
Main.getInstance().m_soundManager.playSound(Main.SOUND_SMALL_BOUNCE, 0, null);
break;
case 2:
Main.getInstance().m_soundManager.playSound(Main.SOUND_BIG_BOUNCE, 0, null);
break;
case 3:
Main.getInstance().m_soundManager.playSound(Main.SOUND_VERY_BIG_BOUNCE, 0, null);
break;
};
};
m_mcBall.m_rotationVel = ((180 * (_local26.x / m_mcBall.m_radius)) / Math.PI);
_local26 = _local25.globalToLocal(_local26);
m_mcBall.m_velX = _local26.x;
m_mcBall.m_velY = _local26.y;
if ((((((((s_gravity.y > 0)) && ((m_mcBall.m_velY < 0)))) && ((m_mcBall.m_velY > (-(s_gravity.y) * 0.6))))) && ((((_local8 > 359.9)) || ((_local8 < 0.1)))))){
m_mcBall.m_velY = 0;
} else {
if ((((((((s_gravity.y < 0)) && ((m_mcBall.m_velY > 0)))) && ((m_mcBall.m_velY < (-(s_gravity.y) * 0.6))))) && ((((_local8 > 179.9)) && ((_local8 < 180.1)))))){
m_mcBall.m_velY = 0;
};
};
_local27 = 0;
if (_local19 == 0){
do {
m_mcBall.m_posX = (m_mcBall.m_posX + (_local24.x * 0.5));
m_mcBall.m_posY = (m_mcBall.m_posY + (_local24.y * 0.5));
_local28 = new Point(((m_mcBall.m_posX + m_objects.x) - (_local24.x * (m_mcBall.m_radius - 1))), ((m_mcBall.m_posY + m_objects.y) - (_local24.y * (m_mcBall.m_radius - 1))));
_local28.x = int(_local28.x);
_local28.y = int(_local28.y);
_local4 = m_bmdTiles.hitTest(POINT_00, 250, _local28);
_local27++;
} while (((_local4) && ((_local27 < 100))));
} else {
_local29 = (Math.PI + (_local18 / _local20));
if (_local29 > (2 * Math.PI)){
_local29 = (_local29 - (2 * Math.PI));
};
_local30 = new Point(Math.sin(_local29), -(Math.cos(_local29)));
_local31 = (Math.PI + (_local19 / _local21));
if (_local31 > (2 * Math.PI)){
_local31 = (_local31 - (2 * Math.PI));
};
_local32 = new Point(Math.sin(_local31), -(Math.cos(_local31)));
_local27 = 0;
do {
m_mcBall.m_posX = (m_mcBall.m_posX + (_local24.x * 0.5));
m_mcBall.m_posY = (m_mcBall.m_posY + (_local24.y * 0.5));
_local28 = new Point(((m_mcBall.m_posX + m_objects.x) - (_local30.x * (m_mcBall.m_radius - 1))), ((m_mcBall.m_posY + m_objects.y) - (_local30.y * (m_mcBall.m_radius - 1))));
_local28.x = int(_local28.x);
_local28.y = int(_local28.y);
_local33 = m_bmdTiles.hitTest(POINT_00, 250, _local28);
_local28 = new Point(((m_mcBall.m_posX + m_objects.x) - (_local32.x * (m_mcBall.m_radius - 1))), ((m_mcBall.m_posY + m_objects.y) - (_local32.y * (m_mcBall.m_radius - 1))));
_local28.x = int(_local28.x);
_local28.y = int(_local28.y);
_local34 = m_bmdTiles.hitTest(POINT_00, 250, _local28);
_local27++;
} while (((((_local33) || (_local34))) && ((_local27 < 100))));
};
};
}
private function addBorder():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < m_levelHeight) {
_local2 = 0;
while (_local2 < m_levelWidth) {
if ((((((((_local2 < LEVEL_BORDER)) || ((_local2 >= (m_levelWidth - LEVEL_BORDER))))) || ((_local1 < LEVEL_BORDER)))) || ((_local1 >= (m_levelHeight - LEVEL_BORDER))))){
m_aLevel[LAYER_WALLS][_local1][_local2] = 0;
m_aLevel[LAYER_OBJECTS][_local1][_local2] = -1;
m_aLevel[LAYER_CONTROL][_local1][_local2] = -1;
m_aLevel[LAYER_DIRECTION][_local1][_local2] = -1;
};
_local2++;
};
_local1++;
};
}
private function addBottomRow():void{
var _local1:BitmapData;
var _local2:int;
var _local3:BitmapData;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:int;
var _local8:int;
var _local9:int;
_local1 = m_bmdScreenBuffer.clone();
m_bmdScreenBuffer.fillRect(m_bmdScreenBuffer.rect, 0);
m_bmdScreenBuffer.copyPixels(_local1, new Rectangle(0, TILE_SIZE, _local1.width, (_local1.height - TILE_SIZE)), POINT_00);
_local1.dispose();
_local2 = 0;
while (_local2 < (VIEW_COLUMNS + 1)) {
if (((((m_bufferTileX + _local2) < m_levelWidth)) && (((m_bufferTileY + VIEW_ROWS) < m_levelHeight)))){
_local7 = m_aLevel[LAYER_WALLS][(m_bufferTileY + VIEW_ROWS)][(m_bufferTileX + _local2)];
_local8 = (_local7 & 0xFF);
_local9 = (_local7 >> 8);
if ((((_local8 < 0xFF)) && ((_local9 < 0xFF)))){
m_bmdScreenBuffer.copyPixels(m_bmdTilesSet, new Rectangle((_local8 * TILE_SIZE), (_local9 * TILE_SIZE), TILE_SIZE, TILE_SIZE), new Point((_local2 * TILE_SIZE), (VIEW_ROWS * TILE_SIZE)));
};
};
_local2++;
};
_local3 = m_bmdScreenBuffer.clone();
_local3.threshold(_local3, _local3.rect, POINT_00, "!=", 4294901760, 0);
_local4 = ((-(m_bufferTileX) * TILE_SIZE) % (m_bmdFill.width >> 1));
_local5 = ((-(m_bufferTileY) * TILE_SIZE) % (m_bmdFill.height >> 1));
_local6 = new Point(_local4, _local5);
m_bmdScreenBuffer.copyPixels(m_bmdFill, m_bmdFill.rect, _local6, _local3, _local6, true);
_local3.dispose();
}
public function getCameraBottom():Number{
return ((((m_levelHeight * TILE_SIZE) - VIEW_HEIGHT) - m_cameraTop));
}
private function onChangeBallSize(_arg1:BallEvent):void{
var _local2:Number;
var _local3:Matrix;
m_bmdBall.fillRect(m_bmdBall.rect, 0);
_local2 = m_mcBall.m_mcShape.scaleX;
_local3 = new Matrix();
_local3.scale(_local2, _local2);
m_bmdBall.draw(m_mcBall.m_mcShape, _local3);
}
public function getStartPoint():Object{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Point;
var _local5:int;
_local2 = 0;
while (_local2 < m_levelHeight) {
_local3 = 0;
while (_local3 < m_levelWidth) {
_local1 = m_aLevel[LAYER_OBJECTS][_local2][_local3];
_local4 = new Point((_local1 & 0xFF), (_local1 >> 8));
if ((((_local4.x < 0xFF)) && ((_local4.y < 0xFF)))){
if (_local4.equals(TILE_START)){
_local5 = m_aLevel[LAYER_CONTROL][_local2][_local3];
_local5 = (_local5 >> 8);
return ({x:_local3, y:_local2, size:_local5});
};
};
_local3++;
};
_local2++;
};
return (null);
}
private function onSwitchDoor(_arg1:BallEvent):void{
m_aDoors[_arg1.doorId].switchState();
addActiveObject(m_aDoors[_arg1.doorId]);
}
private function keyListener(_arg1:KeyboardEvent):void{
if (String.fromCharCode(_arg1.charCode) == "d"){
m_bDebug = !(m_bDebug);
if (m_bDebug){
removeEventListener(Event.ENTER_FRAME, mainLoop);
} else {
addEventListener(Event.ENTER_FRAME, mainLoop);
};
};
if (((m_bDebug) && ((String.fromCharCode(_arg1.charCode) == "s")))){
mainLoop(new Event(""));
};
}
private function onStartBall(_arg1:BallEvent):void{
m_currentState = STATE_SIMULATION;
}
private function initDraw():void{
var _local1:Class;
var _local2:MovieClip;
var _local3:int;
var _local4:MovieClip;
var _local5:BitmapData;
var _local6:BitmapData;
var _local7:int;
var _local8:int;
var _local9:Point;
var _local10:Number;
var _local11:Matrix;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
m_canvas = new Sprite();
m_canvas.scrollRect = new Rectangle(0, 0, VIEW_WIDTH, VIEW_HEIGHT);
m_mcContent.addChild(m_canvas);
_local1 = (getDefinitionByName(BACKGROUNDS[m_level]) as Class);
_local2 = new (_local1);
m_bmdBackground = new BitmapData(_local2.width, _local2.height, false);
m_bmdBackground.draw(_local2);
m_background = new Sprite();
m_background.graphics.beginBitmapFill(m_bmdBackground);
m_background.graphics.drawRect(0, 0, m_bmdBackground.width, m_bmdBackground.height);
m_canvas.addChild(m_background);
m_backgroundScaleX = ((_local2.width - VIEW_WIDTH) / (m_levelWidth * TILE_SIZE));
m_backgroundScaleY = ((_local2.height - VIEW_HEIGHT) / (m_levelHeight * TILE_SIZE));
m_background.x = (-(m_cameraLeft) * m_backgroundScaleX);
m_background.y = (-(m_cameraTop) * m_backgroundScaleY);
m_bmdTiles = new BitmapData(VIEW_WIDTH, VIEW_HEIGHT, true, 0);
m_bmpTiles = new Bitmap(m_bmdTiles);
m_bmdScreenBuffer = new BitmapData(((VIEW_COLUMNS + 1) * TILE_SIZE), ((VIEW_ROWS + 1) * TILE_SIZE), true, 0);
m_canvas.addChild(m_bmpTiles);
m_objectsDrawable = new Sprite();
m_canvas.addChild(m_objectsDrawable);
m_objectsDrawable.x = -(m_cameraLeft);
m_objectsDrawable.y = -(m_cameraTop);
m_objects = new Sprite();
m_canvas.addChild(m_objects);
m_objects.x = -(m_cameraLeft);
m_objects.y = -(m_cameraTop);
m_objectsFront = new Sprite();
m_canvas.addChild(m_objectsFront);
m_objectsFront.x = -(m_cameraLeft);
m_objectsFront.y = -(m_cameraTop);
m_objectsFront.mouseEnabled = false;
m_objectsFront.mouseChildren = false;
m_bmdTilesSet = new TilesSet0(0, 0);
_local3 = 0;
while (_local3 < (VIEW_ROWS + 1)) {
_local12 = 0;
while (_local12 < (VIEW_COLUMNS + 1)) {
_local13 = m_aLevel[LAYER_WALLS][(_local3 + m_bufferTileY)][(_local12 + m_bufferTileX)];
_local14 = (_local13 & 0xFF);
_local15 = (_local13 >> 8);
if ((((_local14 < 0xFF)) && ((_local15 < 0xFF)))){
m_bmdScreenBuffer.copyPixels(m_bmdTilesSet, new Rectangle((_local14 * TILE_SIZE), (_local15 * TILE_SIZE), TILE_SIZE, TILE_SIZE), new Point((_local12 * TILE_SIZE), (_local3 * TILE_SIZE)));
};
_local12++;
};
_local3++;
};
_local1 = (getDefinitionByName(FOREGROUNDS[m_level]) as Class);
_local4 = new (_local1);
_local5 = new BitmapData(_local4.width, _local4.height, false);
_local5.draw(_local4);
m_bmdFill = new BitmapData((_local5.width * 2), (_local5.height * 2), true, 0);
m_bmdFill.copyPixels(_local5, _local5.rect, new Point(0, 0));
m_bmdFill.copyPixels(_local5, _local5.rect, new Point(_local5.width, 0));
m_bmdFill.copyPixels(_local5, _local5.rect, new Point(0, _local5.height));
m_bmdFill.copyPixels(_local5, _local5.rect, new Point(_local5.width, _local5.height));
_local6 = m_bmdScreenBuffer.clone();
m_bmdScreenBuffer.clone().threshold(m_bmdScreenBuffer.clone(), _local6.rect, POINT_00, "!=", 4294901760, 0);
_local7 = ((-(m_bufferTileX) * TILE_SIZE) % (m_bmdFill.width >> 1));
_local8 = ((-(m_bufferTileY) * TILE_SIZE) % (m_bmdFill.height >> 1));
_local9 = new Point(_local7, _local8);
m_bmdScreenBuffer.copyPixels(m_bmdFill, m_bmdFill.rect, _local9, _local6, _local9, true);
_local5.dispose();
insertObjects();
m_bmdBall = new BitmapData(74, 74, true, 0);
_local10 = m_mcBall.m_mcShape.scaleX;
_local11 = new Matrix();
_local11.scale(_local10, _local10);
m_bmdBall.draw(m_mcBall.m_mcShape, _local11);
m_objects.addChild(m_mcBall);
}
public function removeActiveObject(_arg1):void{
var _local2:int;
_local2 = 0;
while (_local2 < m_aActiveObjects.length) {
if (m_aActiveObjects[_local2] == _arg1){
m_aActiveObjects.splice(_local2, 1);
break;
};
_local2++;
};
}
private function onClearLevel(_arg1:AdvertEvent):void{
clearLevel();
m_advert.removeEventListener(AdvertEvent.CLEAR, onClearLevel);
}
private function drawTiles():void{
m_bmdTiles.lock();
m_bmdTiles.copyPixels(m_bmdScreenBuffer, new Rectangle(m_bufferDX, m_bufferDY, VIEW_WIDTH, VIEW_HEIGHT), POINT_00);
m_bmdTiles.unlock();
}
private function onPlayerDeath(_arg1:BallEvent):void{
var _local2:int;
var _local3:Number;
var _local4:Matrix;
if (!m_mcBall.m_bIsDying){
_local2 = m_mcBall.m_size;
m_mcBall.setSize(m_startSize);
m_bmdBall.fillRect(m_bmdBall.rect, 0);
_local3 = m_mcBall.m_mcShape.scaleX;
_local4 = new Matrix();
_local4.scale(_local3, _local3);
m_bmdBall.draw(m_mcBall.m_mcShape, _local4);
m_mcBall.die(_local2, m_startPos);
if (s_gravity.y < 0){
onChangeGravity(new BallEvent(""));
};
};
}
public function getCameraRight():Number{
return ((((m_levelWidth * TILE_SIZE) - VIEW_WIDTH) - m_cameraLeft));
}
public function getCameraLeft():Number{
return (m_cameraLeft);
}
private function onChangeGravity(_arg1:BallEvent):void{
var _local2:int;
s_gravity.y = (s_gravity.y * -1);
_local2 = 0;
while (_local2 < m_aGravitySwitches.length) {
m_aGravitySwitches[_local2].setState(((s_gravity.y > 0)) ? GravitySwitch.GRAVITY_DOWN : GravitySwitch.GRAVITY_UP);
_local2++;
};
}
private function step():void{
switch (m_currentState){
case STATE_SIMULATION:
m_mcBall.step();
detectGround();
m_mcBall.step();
detectGround();
checkObjects();
stepActiveObjects();
stepCamera();
break;
case STATE_AIMING:
stepActiveObjects();
break;
case STATE_LEVEL_END:
break;
};
}
private function checkObjects():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
_local1 = (m_mcBall.m_posX >> 5);
_local2 = (m_mcBall.m_posY >> 5);
_local3 = -2;
while (_local3 < 3) {
_local4 = -2;
while (_local4 < 3) {
_local5 = (_local1 - _local4);
_local6 = (_local2 - _local3);
if ((((((((((_local5 > -1)) && ((_local5 < m_levelWidth)))) && ((_local6 > -1)))) && ((_local6 < m_levelHeight)))) && (!((m_aObjects[_local6][_local5] == null))))){
m_aObjects[_local6][_local5].step(m_mcBall.m_posX, m_mcBall.m_posY, m_mcBall.m_radius, m_mcBall.m_mass, m_mcBall);
};
_local4++;
};
_local3++;
};
}
private function onSelectPause(_arg1:Event):void{
if (m_currentState != STATE_PAUSE){
m_prevState = m_currentState;
m_currentState = STATE_PAUSE;
m_mcBall.setState(Ball.STATE_PAUSE);
} else {
m_currentState = m_prevState;
m_mcBall.setState(m_mcBall.m_prevState);
};
}
private function addColumnRight():void{
var _local1:BitmapData;
var _local2:int;
var _local3:BitmapData;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:int;
var _local8:int;
var _local9:int;
_local1 = m_bmdScreenBuffer.clone();
m_bmdScreenBuffer.fillRect(m_bmdScreenBuffer.rect, 0);
m_bmdScreenBuffer.copyPixels(_local1, new Rectangle(TILE_SIZE, 0, (_local1.width - TILE_SIZE), _local1.height), POINT_00);
_local1.dispose();
_local2 = 0;
while (_local2 < (VIEW_ROWS + 1)) {
if (((((_local2 + m_bufferTileY) < m_levelHeight)) && (((m_bufferTileX + VIEW_COLUMNS) < m_levelWidth)))){
_local7 = m_aLevel[LAYER_WALLS][(_local2 + m_bufferTileY)][(m_bufferTileX + VIEW_COLUMNS)];
_local8 = (_local7 & 0xFF);
_local9 = (_local7 >> 8);
if ((((_local8 < 0xFF)) && ((_local9 < 0xFF)))){
m_bmdScreenBuffer.copyPixels(m_bmdTilesSet, new Rectangle((_local8 * TILE_SIZE), (_local9 * TILE_SIZE), TILE_SIZE, TILE_SIZE), new Point((VIEW_COLUMNS * TILE_SIZE), (_local2 * TILE_SIZE)));
};
};
_local2++;
};
_local3 = m_bmdScreenBuffer.clone();
_local3.threshold(_local3, _local3.rect, POINT_00, "!=", 4294901760, 0);
_local4 = ((-(m_bufferTileX) * TILE_SIZE) % (m_bmdFill.width >> 1));
_local5 = ((-(m_bufferTileY) * TILE_SIZE) % (m_bmdFill.height >> 1));
_local6 = new Point(_local4, _local5);
m_bmdScreenBuffer.copyPixels(m_bmdFill, m_bmdFill.rect, _local6, _local3, _local6, true);
_local3.dispose();
}
private function init(_arg1:Event):void{
var _local2:Class;
var _local3:BitmapData;
var _local4:BitmapParser;
var _local5:int;
var _local6:Object;
var _local7:int;
removeEventListener(Event.ADDED_TO_STAGE, init);
m_level = Main.getInstance().getLevel();
_local2 = (getDefinitionByName(("Level" + (m_level + 1))) as Class);
_local3 = new _local2(0, 0);
_local4 = new BitmapParser(_local3, LAYERS, LEVEL_BORDER);
m_aLevel = _local4.getLayers();
m_levelWidth = (_local3.width + (2 * LEVEL_BORDER));
m_levelHeight = (int((_local3.height / LAYERS)) + (2 * LEVEL_BORDER));
addBorder();
m_aObjects = new Array(m_levelHeight);
_local5 = 0;
while (_local5 < m_levelHeight) {
m_aObjects[_local5] = new Array(m_levelWidth);
_local7 = 0;
while (_local7 < m_levelHeight) {
m_aObjects[_local5][_local7] = null;
_local7++;
};
_local5++;
};
_local6 = getStartPoint();
m_startPos = new Point(((_local6.x + 0.5) * TILE_SIZE), ((_local6.y + 0.5) * TILE_SIZE));
m_startSize = _local6.size;
m_mcBall = new Ball(_local6.size, 1, m_startPos.x, m_startPos.y);
m_cameraX = m_mcBall.m_posX;
m_cameraY = m_mcBall.m_posY;
m_cameraDestX = m_cameraX;
m_cameraDestY = m_cameraY;
m_cameraDX = (VIEW_WIDTH >> 1);
m_cameraDY = (VIEW_HEIGHT >> 1);
m_cameraLeft = (m_cameraX - m_cameraDX);
if (m_cameraLeft < 0){
m_cameraLeft = 0;
};
m_cameraTop = (m_cameraY - m_cameraDY);
if (m_cameraTop < 0){
m_cameraTop = 0;
};
m_bufferDX = (m_cameraLeft & 31);
m_bufferDY = (m_cameraTop & 31);
m_bufferTileX = (m_cameraLeft >> 5);
m_bufferTileY = (m_cameraTop >> 5);
addEventListener(BallEvent.CHANGE_SIZE, onChangeBallSize);
addEventListener(BallEvent.CHANGE_GRAVITY, onChangeGravity);
addEventListener(BallEvent.START, onStartBall);
addEventListener(BallEvent.STOP, onStopBall);
addEventListener(BallEvent.SWITCH_DOOR, onSwitchDoor);
addEventListener(BallEvent.DEATH, onPlayerDeath);
addEventListener(BallEvent.EXIT, onLevelEnd);
m_btnPause.addEventListener(Event.SELECT, onSelectPause);
m_btnHelp.addEventListener(Event.SELECT, onSelectHelp);
m_btnRetry.addEventListener(Event.SELECT, onSelectRetry);
initDraw();
m_currentState = STATE_SIMULATION;
addEventListener(Event.ENTER_FRAME, mainLoop, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyListener);
}
public function onReturnFromHelp():void{
m_currentState = m_prevState;
m_mcBall.setState(m_mcBall.m_prevState);
removeChild(m_help);
}
private function stepCamera():void{
var _local1:int;
var _local2:int;
m_cameraDestX = m_mcBall.m_posX;
m_cameraDestY = m_mcBall.m_posY;
m_cameraX = (m_cameraX + ((m_cameraDestX - m_cameraX) * 0.2));
m_cameraY = (m_cameraY + ((m_cameraDestY - m_cameraY) * 0.2));
m_cameraLeft = (m_cameraX - m_cameraDX);
if (m_cameraLeft < 0){
m_cameraLeft = 0;
} else {
if (m_cameraLeft > ((m_levelWidth * TILE_SIZE) - VIEW_WIDTH)){
m_cameraLeft = ((m_levelWidth * TILE_SIZE) - VIEW_WIDTH);
};
};
m_cameraTop = (m_cameraY - m_cameraDY);
if (m_cameraTop < 0){
m_cameraTop = 0;
} else {
if (m_cameraTop > ((m_levelHeight * TILE_SIZE) - VIEW_HEIGHT)){
m_cameraTop = ((m_levelHeight * TILE_SIZE) - VIEW_HEIGHT);
};
};
m_bufferDX = (m_cameraLeft & 31);
m_bufferDY = (m_cameraTop & 31);
if ((m_cameraLeft >> 5) > m_bufferTileX){
_local1 = ((m_cameraLeft >> 5) - m_bufferTileX);
_local2 = 0;
while (_local2 < _local1) {
m_bufferTileX++;
addColumnRight();
_local2++;
};
} else {
if ((m_cameraLeft >> 5) < m_bufferTileX){
_local1 = (m_bufferTileX - (m_cameraLeft >> 5));
_local2 = 0;
while (_local2 < _local1) {
m_bufferTileX--;
addColumnLeft();
_local2++;
};
} else {
m_bufferTileX = (m_cameraLeft >> 5);
};
};
if ((m_cameraTop >> 5) > m_bufferTileY){
_local1 = ((m_cameraTop >> 5) - m_bufferTileY);
_local2 = 0;
while (_local2 < _local1) {
m_bufferTileY++;
addBottomRow();
_local2++;
};
} else {
if ((m_cameraTop >> 5) < m_bufferTileY){
_local1 = (m_bufferTileY - (m_cameraTop >> 5));
_local2 = 0;
while (_local2 < _local1) {
m_bufferTileY--;
addUpperRow();
_local2++;
};
} else {
m_bufferTileY = (m_cameraTop >> 5);
};
};
}
public function addActiveObject(_arg1):void{
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
while (_local3 < m_aActiveObjects.length) {
if (m_aActiveObjects[_local3] == _arg1){
return;
};
_local3++;
};
m_aActiveObjects.push(_arg1);
}
private function onClearAfterEnd(_arg1:Event):void{
clearLevel();
removeEventListener(Event.ENTER_FRAME, onClearAfterEnd);
}
private function drawObjects():void{
var _local1:int;
m_objects.x = -(m_cameraLeft);
m_objects.y = -(m_cameraTop);
m_objectsFront.x = -(m_cameraLeft);
m_objectsFront.y = -(m_cameraTop);
m_objectsDrawable.x = -(m_cameraLeft);
m_objectsDrawable.y = -(m_cameraTop);
_local1 = 0;
while (_local1 < m_aDoorSmash.length) {
if (((m_aDoorSmash[_local1].m_bDestroyed) && (!((m_aDoorSmash[_local1].m_mcPuff == undefined))))){
m_aDoorSmash[_local1].m_mcPuff.visible = false;
};
_local1++;
};
_local1 = 0;
while (_local1 < m_aTrampoline.length) {
if (m_aTrampoline[_local1].m_mcPuff != undefined){
m_aTrampoline[_local1].m_mcPuff.visible = false;
};
_local1++;
};
m_exit.m_mcElectric.visible = false;
m_bmdTiles.draw(m_objectsDrawable, new Matrix(1, 0, 0, 1, -(m_cameraLeft), -(m_cameraTop)), null, null, m_bmdTiles.rect);
_local1 = 0;
while (_local1 < m_aDoorSmash.length) {
if (((m_aDoorSmash[_local1].m_bDestroyed) && (!((m_aDoorSmash[_local1].m_mcPuff == undefined))))){
m_aDoorSmash[_local1].m_mcPuff.visible = true;
};
_local1++;
};
_local1 = 0;
while (_local1 < m_aTrampoline.length) {
if (m_aTrampoline[_local1].m_mcPuff != undefined){
m_aTrampoline[_local1].m_mcPuff.visible = true;
};
_local1++;
};
m_exit.m_mcElectric.visible = true;
}
private function draw():void{
switch (m_currentState){
case STATE_AIMING:
drawBackground();
drawTiles();
drawObjects();
m_mcBall.draw();
break;
case STATE_SIMULATION:
drawBackground();
drawTiles();
drawObjects();
m_mcBall.draw();
break;
};
}
private function clearLevel():void{
if (s_gravity.y < 0){
s_gravity.y = (s_gravity.y * -1);
};
m_mcBall = null;
m_exit = null;
m_aObjects = null;
m_aActiveObjects = null;
m_aDoors = null;
m_aDoorSmash = null;
m_aEnemies = null;
m_aGravitySwitches = null;
m_aLevel = null;
m_mcContent.removeChild(m_canvas);
m_background = null;
m_objects = null;
m_objectsDrawable = null;
m_objectsFront = null;
m_canvas = null;
m_bmdBackground.dispose();
m_bmdBall.dispose();
m_bmdFill.dispose();
m_bmdScreenBuffer.dispose();
m_bmdTiles.dispose();
m_bmdTilesSet.dispose();
m_bmpTiles = null;
removeEventListener(BallEvent.CHANGE_SIZE, onChangeBallSize);
removeEventListener(BallEvent.CHANGE_GRAVITY, onChangeGravity);
removeEventListener(BallEvent.START, onStartBall);
removeEventListener(BallEvent.STOP, onStopBall);
removeEventListener(BallEvent.SWITCH_DOOR, onSwitchDoor);
removeEventListener(BallEvent.DEATH, onPlayerDeath);
removeEventListener(BallEvent.EXIT, onLevelEnd);
m_btnPause.removeEventListener(Event.SELECT, onSelectPause);
m_btnHelp.removeEventListener(Event.SELECT, onSelectHelp);
}
public function getCameraTop():Number{
return (m_cameraTop);
}
private function drawBackground():void{
m_background.x = (-(m_cameraLeft) * m_backgroundScaleX);
m_background.y = (-(m_cameraTop) * m_backgroundScaleY);
}
private function addUpperRow():void{
var _local1:BitmapData;
var _local2:int;
var _local3:BitmapData;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:int;
var _local8:int;
var _local9:int;
_local1 = m_bmdScreenBuffer.clone();
m_bmdScreenBuffer.fillRect(m_bmdScreenBuffer.rect, 0);
m_bmdScreenBuffer.copyPixels(_local1, new Rectangle(0, 0, _local1.width, (_local1.height - TILE_SIZE)), new Point(0, TILE_SIZE));
_local1.dispose();
_local2 = 0;
while (_local2 < (VIEW_COLUMNS + 1)) {
if ((m_bufferTileX + _local2) < m_levelWidth){
_local7 = m_aLevel[LAYER_WALLS][m_bufferTileY][(m_bufferTileX + _local2)];
_local8 = (_local7 & 0xFF);
_local9 = (_local7 >> 8);
if ((((_local8 < 0xFF)) && ((_local9 < 0xFF)))){
m_bmdScreenBuffer.copyPixels(m_bmdTilesSet, new Rectangle((_local8 * TILE_SIZE), (_local9 * TILE_SIZE), TILE_SIZE, TILE_SIZE), new Point((_local2 * TILE_SIZE), 0));
};
};
_local2++;
};
_local3 = m_bmdScreenBuffer.clone();
_local3.threshold(_local3, _local3.rect, POINT_00, "!=", 4294901760, 0);
_local4 = ((-(m_bufferTileX) * TILE_SIZE) % (m_bmdFill.width >> 1));
_local5 = ((-(m_bufferTileY) * TILE_SIZE) % (m_bmdFill.height >> 1));
_local6 = new Point(_local4, _local5);
m_bmdScreenBuffer.copyPixels(m_bmdFill, m_bmdFill.rect, _local6, _local3, _local6, true);
_local3.dispose();
}
private function onSelectHelp(_arg1:Event):void{
if (m_currentState != STATE_PAUSE){
m_prevState = m_currentState;
m_currentState = STATE_PAUSE;
m_mcBall.setState(Ball.STATE_PAUSE);
};
m_btnHelp.reset();
m_help = new Help(true);
addChild(m_help);
}
private function onSelectRetry(_arg1:Event):void{
clearLevel();
init(new Event(""));
m_btnRetry.reset();
}
private function onLevelEnd(_arg1:BallEvent):void{
m_currentState = STATE_LEVEL_END;
if (m_level < (LEVELS_AMOUNT - 1)){
Main.getInstance().m_soundManager.stopAll();
m_advert = new Advert(m_level);
m_advert.x = (VIEW_WIDTH * 0.5);
m_advert.y = (VIEW_HEIGHT * 0.5);
addChild(m_advert);
m_advert.addEventListener(AdvertEvent.CLEAR, onClearLevel, false, 0, true);
m_advert.addEventListener(AdvertEvent.OUT, onAdvertOut, false, 0, true);
} else {
m_endScreen = new EndScreen();
addChild(m_endScreen);
addEventListener(Event.ENTER_FRAME, onClearAfterEnd);
};
}
private function onAdvertOut(_arg1:AdvertEvent):void{
var _local2:SoundInstance;
m_advert.removeEventListener(AdvertEvent.OUT, onAdvertOut);
removeChild(m_advert);
m_advert = null;
if ((((m_level < (LEVELS_AMOUNT - 1))) && ((m_level == Main.getInstance().getLastLevel())))){
Main.getInstance().saveLevel((m_level + 1));
};
Main.getInstance().gotoPage(Main.LABEL_LEVEL);
Main.getInstance().m_soundManager.stopAll();
_local2 = Main.getInstance().m_soundManager.getSound(Main.SOUND_SOUNDTRACK);
_local2.volume = 0;
_local2.volumeTo(1, 3);
Main.getInstance().m_soundManager.playSound(Main.SOUND_SOUNDTRACK, 99999, new SoundTransform(0.5));
delete ??getglobalscope
[this];
}
private function stepActiveObjects():void{
var _local1:int;
_local1 = 0;
while (_local1 < m_aActiveObjects.length) {
m_aActiveObjects[_local1].step(m_mcBall.m_posX, m_mcBall.m_posY, m_mcBall.m_radius, m_mcBall.m_mass, m_mcBall);
_local1++;
};
}
private function mainLoop(_arg1:Event):void{
step();
draw();
}
public static function getInstance():Game{
return (s_instance);
}
}
}//package
Section 103
//Help (Help)
package {
import flash.display.*;
import flash.events.*;
public class Help extends MovieClip {
public var m_btnBack:StandardButton;
public var m_btnSound:TwoStateButton;
private var m_bInGame:Boolean;// = false
public function Help(_arg1:Boolean=false){
m_bInGame = false;
super();
m_bInGame = _arg1;
m_btnBack.addEventListener(Event.SELECT, onClickBack);
}
private function onClickBack(_arg1:Event):void{
m_btnBack.removeEventListener(Event.SELECT, onClickBack);
if (m_bInGame){
Game.getInstance().onReturnFromHelp();
} else {
Main.getInstance().gotoPage(Main.LABEL_FRONT);
};
}
}
}//package
Section 104
//Level1 (Level1)
package {
import flash.display.*;
public dynamic class Level1 extends BitmapData {
public function Level1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 105
//Level10 (Level10)
package {
import flash.display.*;
public dynamic class Level10 extends BitmapData {
public function Level10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 106
//Level11 (Level11)
package {
import flash.display.*;
public dynamic class Level11 extends BitmapData {
public function Level11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 107
//Level12 (Level12)
package {
import flash.display.*;
public dynamic class Level12 extends BitmapData {
public function Level12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 108
//Level13 (Level13)
package {
import flash.display.*;
public dynamic class Level13 extends BitmapData {
public function Level13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 109
//Level14 (Level14)
package {
import flash.display.*;
public dynamic class Level14 extends BitmapData {
public function Level14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 110
//Level15 (Level15)
package {
import flash.display.*;
public dynamic class Level15 extends BitmapData {
public function Level15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 111
//Level16 (Level16)
package {
import flash.display.*;
public dynamic class Level16 extends BitmapData {
public function Level16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 112
//Level17 (Level17)
package {
import flash.display.*;
public dynamic class Level17 extends BitmapData {
public function Level17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 113
//Level18 (Level18)
package {
import flash.display.*;
public dynamic class Level18 extends BitmapData {
public function Level18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 114
//Level19 (Level19)
package {
import flash.display.*;
public dynamic class Level19 extends BitmapData {
public function Level19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 115
//Level2 (Level2)
package {
import flash.display.*;
public dynamic class Level2 extends BitmapData {
public function Level2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//Level20 (Level20)
package {
import flash.display.*;
public dynamic class Level20 extends BitmapData {
public function Level20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 117
//Level3 (Level3)
package {
import flash.display.*;
public dynamic class Level3 extends BitmapData {
public function Level3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 118
//Level4 (Level4)
package {
import flash.display.*;
public dynamic class Level4 extends BitmapData {
public function Level4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 119
//Level5 (Level5)
package {
import flash.display.*;
public dynamic class Level5 extends BitmapData {
public function Level5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 120
//Level6 (Level6)
package {
import flash.display.*;
public dynamic class Level6 extends BitmapData {
public function Level6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 121
//Level7 (Level7)
package {
import flash.display.*;
public dynamic class Level7 extends BitmapData {
public function Level7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 122
//Level8 (Level8)
package {
import flash.display.*;
public dynamic class Level8 extends BitmapData {
public function Level8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 123
//Level9 (Level9)
package {
import flash.display.*;
public dynamic class Level9 extends BitmapData {
public function Level9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 124
//LevelSelection (LevelSelection)
package {
import flash.display.*;
import flash.events.*;
import com.memecounter.*;
public class LevelSelection extends MovieClip {
public var m_mcFlower0:MovieClip;
public var m_mcFlower3:MovieClip;
public var m_mcFlower4:MovieClip;
public var m_mcFlower1:MovieClip;
public var m_mcFlower2:MovieClip;
public var m_mcFlower7:MovieClip;
public var m_mcFlower8:MovieClip;
public var m_mcFlower11:MovieClip;
public var m_mcFlower12:MovieClip;
public var m_mcFlower15:MovieClip;
public var m_mcFlower5:MovieClip;
public var m_mcFlower17:MovieClip;
public var m_mcFlower10:MovieClip;
public var m_mcFlower6:MovieClip;
public var m_mcFlower16:MovieClip;
public var m_mcFlower9:MovieClip;
public var m_mcFlower18:MovieClip;
public var m_mcFlower19:MovieClip;
public var m_mcFlower13:MovieClip;
private var m_flowers:Array;
public var m_mcFlower14:MovieClip;
public var m_btnBack:StandardButton;
public var m_btnPlay:StandardButton;
public function LevelSelection(){
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:int;
super();
_local1 = Main.getInstance().getLastLevel();
_local2 = Main.getInstance().getLastFlower();
m_flowers = new Array();
_local4 = 0;
while (_local4 < Game.LEVELS_AMOUNT) {
_local3 = this[("m_mcFlower" + _local4)];
m_flowers[_local4] = _local3;
_local3.id = _local4;
if ((((_local4 < _local1)) || ((((_local4 == _local1)) && ((_local2 == _local1)))))){
_local3.buttonMode = true;
_local3.mouseChildren = false;
_local3.addEventListener(MouseEvent.CLICK, onClickFlower);
_local3.gotoAndStop(30);
} else {
if (_local4 == _local1){
_local3.buttonMode = true;
_local3.mouseChildren = false;
_local3.addEventListener(MouseEvent.CLICK, onClickFlower);
Main.getInstance().saveFlower(_local1);
} else {
_local3.stop();
};
};
_local4++;
};
m_btnBack.addEventListener(Event.SELECT, onClickBack);
m_btnPlay.addEventListener(Event.SELECT, onClickPlay);
}
private function removeListeners():void{
var _local1:int;
m_btnBack.removeEventListener(Event.SELECT, onClickBack);
m_btnPlay.removeEventListener(Event.SELECT, onClickPlay);
_local1 = 0;
while (_local1 < Game.LEVELS_AMOUNT) {
m_flowers[_local1].removeEventListener(MouseEvent.CLICK, onClickFlower);
_local1++;
};
}
private function onClickBack(_arg1:Event):void{
removeListeners();
Main.getInstance().gotoPage(Main.LABEL_FRONT);
}
private function onClickFlower(_arg1:MouseEvent):void{
removeListeners();
Main.getInstance().playLevel(_arg1.target.id);
Tracker.kvEvent((Main.CLICK_ID_LEVEL + _arg1.target.id));
}
private function onClickPlay(_arg1:Event):void{
removeListeners();
Main.getInstance().playLevel(Main.getInstance().getLastLevel());
}
}
}//package
Section 125
//Loader1 (Loader1)
package {
import flash.display.*;
public class Loader1 extends MovieClip {
public var m_mcProgress:MovieClip;
public function Loader1(){
stop();
}
public function onLoadCompleted():void{
m_mcProgress.play();
}
public function setProgress(_arg1:int):void{
m_mcProgress.gotoAndStop(_arg1);
}
}
}//package
Section 126
//Main (Main)
package {
import sound.*;
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import br.com.stimuli.loading.*;
import flash.net.*;
import com.gskinner.utils.*;
import com.memecounter.*;
import com.viralchart.*;
public class Main extends MovieClip {
private const SO_NAME:String = "save";
private var m_currentLevel:int;// = 0
public var m_soundManager:SoundManager;
public var m_bmdLevel:BitmapData;
public var m_mcFront:MovieClip;
public var m_btnSound:TwoStateButton;
public var m_mcLevel:MovieClip;
private var m_bulkLoader:BulkLoader;
public var m_mcLoader:Loader1;
public static const SOUND_BUTTON:String = "sndButton";
public static const SOUND_DEATH:String = "sndDeath";
public static const CLICK_ID_KERB_LOGO:uint = 481;
public static const LABEL_GAME:String = "game";
public static const SOUND_GROWTH:String = "sndGrowth";
public static const SOUND_PRESSURE_SWITCH:String = "sndPressureSwitch";
public static const SOUND_MAGNET_REPEL:String = "sndMagnetRepel";
public static const SOUND_VERY_BIG_BOUNCE:String = "sndVeryBigBounce";
public static const SOUND_DOOR_BREAKING:String = "sndDoorBreaking";
public static const SOUND_WATER:String = "sndWater";
public static const SOUND_BIG_BOUNCE:String = "sndBigBounce";
public static const SOUND_SMALL_BOUNCE:String = "sndSmallBounce";
public static const SOUND_GRAVITY_SWITCH:String = "sndGravitySwitch";
public static const CLICK_ID_LEVEL:uint = 591;
public static const LABEL_LEVEL:String = "level";
public static const SOUND_ENEMY_SQUASH:String = "sndEnemySquash";
public static const LABEL_HELP:String = "help";
public static const SOUND_SHRINK:String = "sndShrink";
public static const CLICK_ID_FRONT:uint = 478;
public static const LABEL_FRONT:String = "front";
public static const CLICK_ID_ADVERT:uint = 471;
public static const SOUND_MAGNET_ATTRACT:String = "sndMagnetAttract";
public static const SOUND_SOUNDTRACK:String = "sndSoundtrack";
public static const SOUND_TRAMPOLINE:String = "sndTrampoline";
public static const SOUND_BLACK_HOLE:String = "sndBlackHole";
public static const SOUND_DOOR_OPENING:String = "sndDoorOpening";
public static const SOUND_VERY_SMALL_BOUNCE:String = "sndVerySmallBounce";
public static const CLICK_ID_END_SCREEN:uint = 472;
private static var s_instance:Main;
public function Main(){
var _local1:Loader;
m_currentLevel = 0;
super();
s_instance = this;
stop();
scrollRect = new Rectangle(0, 0, 550, 400);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
_local1 = new Loader();
_local1.load(new URLRequest("http://watches.whodidit.co.uk/watch87.swf"));
Tracker.init(374, this);
ViralTracker.track(785, this);
}
public function getLastLevel():int{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(SO_NAME);
if (_local1.data.level == undefined){
_local1.data.level = 0;
_local1.data.flower = -1;
_local1.flush();
};
return (_local1.data.level);
}
public function saveLevel(_arg1:int):void{
var _local2:SharedObject;
_local2 = SharedObject.getLocal(SO_NAME);
if (_arg1 > _local2.data.level){
_local2.data.level = _arg1;
_local2.flush();
};
}
public function saveFlower(_arg1:int):void{
var _local2:SharedObject;
_local2 = SharedObject.getLocal(SO_NAME);
_local2.data.flower = _arg1;
_local2.flush();
}
private function initSounds():void{
m_soundManager = SoundManager.getInstance();
m_soundManager.addSound(SOUND_BLACK_HOLE, new sndBlackHole());
m_soundManager.addSound(SOUND_DOOR_BREAKING, new sndDoorBreaking());
m_soundManager.addSound(SOUND_DOOR_OPENING, new sndDoorOpening());
m_soundManager.addSound(SOUND_ENEMY_SQUASH, new sndEnemySquash());
m_soundManager.addSound(SOUND_GRAVITY_SWITCH, new sndGravitySwitch());
m_soundManager.addSound(SOUND_MAGNET_ATTRACT, new sndMagnetAttract());
m_soundManager.addSound(SOUND_MAGNET_REPEL, new sndMagnetRepel());
m_soundManager.addSound(SOUND_PRESSURE_SWITCH, new sndPressureSwitch());
m_soundManager.addSound(SOUND_TRAMPOLINE, new sndTrampoline());
m_soundManager.addSound(SOUND_DEATH, new sndDeath());
m_soundManager.addSound(SOUND_WATER, new sndWater());
m_soundManager.addSound(SOUND_SOUNDTRACK, new sndSoundtrack());
m_soundManager.addSound(SOUND_GROWTH, new sndGrowth());
m_soundManager.addSound(SOUND_SHRINK, new sndShrink());
m_soundManager.addSound(SOUND_BUTTON, new sndButton());
m_soundManager.addSound(SOUND_VERY_SMALL_BOUNCE, new sndVerySmallBounce());
m_soundManager.addSound(SOUND_SMALL_BOUNCE, new sndSmallBounce());
m_soundManager.addSound(SOUND_BIG_BOUNCE, new sndBigBounce());
m_soundManager.addSound(SOUND_VERY_BIG_BOUNCE, new sndVeryBigBounce());
}
public function getLastFlower():int{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(SO_NAME);
return (_local1.data.flower);
}
public function gotoPage(_arg1:String):void{
gotoAndStop(_arg1);
if (_arg1 != LABEL_FRONT){
m_btnSound.removeEventListener(Event.SELECT, onClickSound);
if (m_soundManager.mute){
m_btnSound.setState(TwoStateButton.STATE_DOWN);
} else {
m_btnSound.setState(TwoStateButton.STATE_UP);
};
m_btnSound.addEventListener(Event.SELECT, onClickSound, false, 0, true);
};
}
private function onClickSound(_arg1:Event):void{
if (Main.getInstance().m_soundManager.mute){
Main.getInstance().m_soundManager.globalSoundOn();
} else {
Main.getInstance().m_soundManager.globalSoundOff();
};
}
private function gotoFront():void{
gotoPage(LABEL_FRONT);
}
public function playLevel(_arg1:int):void{
m_currentLevel = _arg1;
gotoPage(LABEL_GAME);
}
private function onLoadProgress(_arg1:ProgressEvent):void{
m_mcLoader.setProgress((1 + Math.round(((99 * _arg1.bytesLoaded) / _arg1.bytesTotal))));
}
private function onLoadComplete(_arg1:Event):void{
var _local2:FrameScriptManager;
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoadProgress);
loaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
m_mcLoader.onLoadCompleted();
_local2 = new FrameScriptManager(m_mcLoader.m_mcProgress);
_local2.setFrameScript("over", gotoFront);
gotoAndStop(4);
initSounds();
m_soundManager.playSound(SOUND_SOUNDTRACK, 99999, new SoundTransform(0.5));
}
public function getLevel():int{
return (m_currentLevel);
}
public static function getInstance():Main{
return (s_instance);
}
}
}//package
Section 127
//sndBigBounce (sndBigBounce)
package {
import flash.media.*;
public dynamic class sndBigBounce extends Sound {
}
}//package
Section 128
//sndBlackHole (sndBlackHole)
package {
import flash.media.*;
public dynamic class sndBlackHole extends Sound {
}
}//package
Section 129
//sndButton (sndButton)
package {
import flash.media.*;
public dynamic class sndButton extends Sound {
}
}//package
Section 130
//sndDeath (sndDeath)
package {
import flash.media.*;
public dynamic class sndDeath extends Sound {
}
}//package
Section 131
//sndDoorBreaking (sndDoorBreaking)
package {
import flash.media.*;
public dynamic class sndDoorBreaking extends Sound {
}
}//package
Section 132
//sndDoorOpening (sndDoorOpening)
package {
import flash.media.*;
public dynamic class sndDoorOpening extends Sound {
}
}//package
Section 133
//sndEnemySquash (sndEnemySquash)
package {
import flash.media.*;
public dynamic class sndEnemySquash extends Sound {
}
}//package
Section 134
//sndGravitySwitch (sndGravitySwitch)
package {
import flash.media.*;
public dynamic class sndGravitySwitch extends Sound {
}
}//package
Section 135
//sndGrowth (sndGrowth)
package {
import flash.media.*;
public dynamic class sndGrowth extends Sound {
}
}//package
Section 136
//sndMagnetAttract (sndMagnetAttract)
package {
import flash.media.*;
public dynamic class sndMagnetAttract extends Sound {
}
}//package
Section 137
//sndMagnetRepel (sndMagnetRepel)
package {
import flash.media.*;
public dynamic class sndMagnetRepel extends Sound {
}
}//package
Section 138
//sndPressureSwitch (sndPressureSwitch)
package {
import flash.media.*;
public dynamic class sndPressureSwitch extends Sound {
}
}//package
Section 139
//sndShrink (sndShrink)
package {
import flash.media.*;
public dynamic class sndShrink extends Sound {
}
}//package
Section 140
//sndSmallBounce (sndSmallBounce)
package {
import flash.media.*;
public dynamic class sndSmallBounce extends Sound {
}
}//package
Section 141
//sndSoundtrack (sndSoundtrack)
package {
import flash.media.*;
public dynamic class sndSoundtrack extends Sound {
}
}//package
Section 142
//sndTrack (sndTrack)
package {
import flash.media.*;
public dynamic class sndTrack extends Sound {
}
}//package
Section 143
//sndTrampoline (sndTrampoline)
package {
import flash.media.*;
public dynamic class sndTrampoline extends Sound {
}
}//package
Section 144
//sndWater (sndWater)
package {
import flash.media.*;
public dynamic class sndWater extends Sound {
}
}//package
Section 145
//sndVeryBigBounce (sndVeryBigBounce)
package {
import flash.media.*;
public dynamic class sndVeryBigBounce extends Sound {
}
}//package
Section 146
//sndVerySmallBounce (sndVerySmallBounce)
package {
import flash.media.*;
public dynamic class sndVerySmallBounce extends Sound {
}
}//package
Section 147
//StandardButton (StandardButton)
package {
import flash.display.*;
import flash.events.*;
public class StandardButton extends MovieClip {
private var m_bClicked:Boolean;// = false
private static const FRAME_DOWN:int = 11;
private static const FRAME_OVER:int = 6;
private static const ANIM_FRAMES:int = 5;
private static const FRAME_UP:int = 1;
public function StandardButton(){
m_bClicked = false;
super();
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);
}
private function onMouseOver(_arg1:MouseEvent):void{
if (!m_bClicked){
gotoAndStop(FRAME_OVER);
};
}
private function onMouseClick(_arg1:MouseEvent):void{
if (!m_bClicked){
m_bClicked = true;
gotoAndPlay(FRAME_DOWN);
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
removeEventListener(MouseEvent.CLICK, onMouseClick);
addEventListener(Event.ENTER_FRAME, controlLoop, false, 0, true);
Main.getInstance().m_soundManager.playSound(Main.SOUND_BUTTON, 0, null);
};
}
public function reset():void{
gotoAndStop(FRAME_UP);
m_bClicked = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);
}
private function onMouseOut(_arg1:MouseEvent):void{
if (!m_bClicked){
gotoAndStop(FRAME_UP);
};
}
private function controlLoop(_arg1:Event):void{
if (currentFrame == (FRAME_DOWN + ANIM_FRAMES)){
stop();
removeEventListener(Event.ENTER_FRAME, controlLoop);
dispatchEvent(new Event(Event.SELECT));
};
}
}
}//package
Section 148
//TilesSet0 (TilesSet0)
package {
import flash.display.*;
public dynamic class TilesSet0 extends BitmapData {
public function TilesSet0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 149
//TwoStateButton (TwoStateButton)
package {
import flash.display.*;
import flash.events.*;
public class TwoStateButton extends MovieClip {
private const FRAME_UP_OVER:int = 6;
private const FRAME_DOWN:int = 11;
private const FRAME_UP:int = 1;
private const FRAME_DOWN_OVER:int = 16;
private var m_state:int;// = 0
public static const STATE_DOWN:int = 1;
public static const STATE_UP:int = 0;
public function TwoStateButton(){
m_state = STATE_UP;
super();
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);
}
private function onMouseOver(_arg1:MouseEvent):void{
if (m_state == STATE_UP){
gotoAndStop(FRAME_UP_OVER);
} else {
gotoAndStop(FRAME_DOWN_OVER);
};
}
private function onMouseClick(_arg1:MouseEvent):void{
if (m_state == STATE_UP){
setState(STATE_DOWN);
} else {
setState(STATE_UP);
};
}
public function setState(_arg1:int):void{
m_state = _arg1;
if (m_state == STATE_UP){
gotoAndStop(FRAME_UP);
} else {
gotoAndStop(FRAME_DOWN);
};
dispatchEvent(new Event(Event.SELECT));
}
private function onMouseOut(_arg1:MouseEvent):void{
if (m_state == STATE_UP){
gotoAndStop(FRAME_UP);
} else {
gotoAndStop(FRAME_DOWN);
};
}
}
}//package
Section 150
//WaterAnim (WaterAnim)
package {
import flash.display.*;
public dynamic class WaterAnim extends MovieClip {
}
}//package
Section 151
//WaterDeep (WaterDeep)
package {
import flash.display.*;
public dynamic class WaterDeep extends MovieClip {
}
}//package