Section 1
//ImageItem (br.com.stimuli.loading.loadingtypes.ImageItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class ImageItem extends LoadingItem {
public var loader:Loader;
public function ImageItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:Event):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function load():void{
super.load();
loader = new 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, 100, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.load(url, context);
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
override public function isImage():Boolean{
return ((type == BulkLoader.TYPE_IMAGE));
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader.content;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
var _local1:Object;
if (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);
_local1.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function isSWF():Boolean{
return ((type == BulkLoader.TYPE_MOVIECLIP));
}
public function _onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 2
//LoadingItem (br.com.stimuli.loading.loadingtypes.LoadingItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class LoadingItem extends EventDispatcher {
public var _priority:int;// = 0
public var specificAvailableProps:Array;
public var preventCache:Boolean;
public var _responseTime:Number;
public var _uid:String;
public var propertyParsingErrors:Array;
public var maxTries:int;// = 3
public var _bytesLoaded:int;// = 0
public var _type:String;
public var _percentLoaded:Number;
public var _isLoaded:Boolean;
public var context;// = null
public var _totalTime:int;
public var numTries:int;// = 0
public var _additionIndex:int;
public var _bytesTotal:int;// = -1
public var _id:String;
public var _latency:Number;
public var _httpStatus:int;// = -1
public var _content;
public var _isLoading:Boolean;
public var _speed:Number;
public var _startTime:int;
public var _weightPercentLoaded:Number;
public var _bytesRemaining:int;// = 10000000
public var url:URLRequest;
public var status:String;
public var _addedTime:int;
public var _timeToDownload:int;
public var weight:int;// = 1
public static const STATUS_STOPPED:String = "stopped";
public static const STATUS_STARTED:String = "started";
public static const STATUS_ERROR:String = "error";
public static const STATUS_FINISHED:String = "finished";
public function LoadingItem(_arg1:URLRequest, _arg2:String, _arg3:String){
this._type = _arg2;
this.url = _arg1;
if (!specificAvailableProps){
specificAvailableProps = [];
};
this._uid = _arg3;
}
public function stop():void{
if (_isLoaded){
return;
};
status = STATUS_STOPPED;
_isLoading = false;
}
public function onProgressHandler(_arg1):void{
_bytesLoaded = _arg1.bytesLoaded;
_bytesTotal = _arg1.bytesTotal;
_bytesRemaining = (_bytesTotal - bytesLoaded);
_percentLoaded = (_bytesLoaded / _bytesTotal);
_weightPercentLoaded = (_percentLoaded * weight);
dispatchEvent(_arg1);
}
public function isSound():Boolean{
return (false);
}
public function isText():Boolean{
return (false);
}
public function get weightPercentLoaded():Number{
return (_weightPercentLoaded);
}
public function get latency():Number{
return (_latency);
}
public function get content(){
return (_content);
}
public function isXML():Boolean{
return (false);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function load():void{
var _local1:String;
if (preventCache){
_local1 = ((("BulkLoaderNoCache=" + _uid) + "_") + int(((Math.random() * 100) * getTimer())));
if (url.url.indexOf("?") == -1){
url.url = (url.url + ("?" + _local1));
} else {
url.url = (url.url + ("&" + _local1));
};
};
_isLoading = true;
_startTime = getTimer();
}
public function onErrorHandler(_arg1:Event):void{
var _local2:BulkErrorEvent;
numTries++;
status = STATUS_ERROR;
_arg1.stopPropagation();
if (numTries >= maxTries){
_local2 = new BulkErrorEvent(BulkErrorEvent.ERROR);
_local2.errors = [this];
dispatchEvent(_local2);
} else {
status = null;
load();
};
}
public function get startTime():int{
return (_startTime);
}
public function isStreamable():Boolean{
return (false);
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
public function get responseTime():Number{
return (_responseTime);
}
public function get priority():int{
return (_priority);
}
public function get id():String{
return (_id);
}
public 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;
dispatchEvent(_arg1);
_arg1.stopPropagation();
}
public function get totalTime():int{
return (_totalTime);
}
public function get type():String{
return (_type);
}
public function _parseOptions(_arg1:Object):Array{
var _local3:String;
preventCache = _arg1[BulkLoader.PREVENT_CACHING];
_id = _arg1[BulkLoader.ID];
_priority = ((int(_arg1[BulkLoader.PRIORITY])) || (0));
maxTries = ((_arg1[BulkLoader.MAX_TRIES]) || (3));
weight = ((int(_arg1[BulkLoader.WEIGHT])) || (1));
var _local2:Array = BulkLoader.GENERAL_AVAILABLE_PROPS.concat(specificAvailableProps);
propertyParsingErrors = [];
for (_local3 in _arg1) {
if (_local2.indexOf(_local3) == -1){
propertyParsingErrors.push(((((this + ": got a wrong property name: ") + _local3) + ", with value:") + _arg1[_local3]));
};
};
return (propertyParsingErrors);
}
public function get speed():Number{
return (_speed);
}
public function onStartedHandler(_arg1:Event):void{
_responseTime = getTimer();
_latency = BulkLoader.truncateNumber(((_responseTime - _startTime) / 1000));
status = STATUS_STARTED;
dispatchEvent(_arg1);
}
public function isImage():Boolean{
return (false);
}
public function get bytesRemaining():int{
return (_bytesRemaining);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function isLoader():Boolean{
return (false);
}
public function get timeToDownload():int{
return (_timeToDownload);
}
public function get httpStatus():int{
return (_httpStatus);
}
public function get isLoaded():Boolean{
return (_isLoaded);
}
public function getStats():String{
return ((((((((((("Item url:" + url.url) + ", total time: ") + _timeToDownload) + "(s), latency:") + _latency) + "(s), speed: ") + _speed) + " kb/s, size: ") + BulkLoader.truncateNumber((_bytesTotal / 0x0400))) + " kb"));
}
override public function toString():String{
return (((((("LoadingItem url: " + url.url) + ", type:") + _type) + ", status: ") + status));
}
public function isVideo():Boolean{
return (false);
}
public function destroy():void{
_content = null;
}
public function get addedTime():int{
return (_addedTime);
}
public function cleanListeners():void{
}
public function isSWF():Boolean{
return (false);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 3
//SoundItem (br.com.stimuli.loading.loadingtypes.SoundItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class SoundItem extends LoadingItem {
public var loader:Sound;
public function SoundItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:Event):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function isStreamable():Boolean{
return (true);
}
override public function isSound():Boolean{
return (true);
}
override public function load():void{
super.load();
loader = new 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.load(url, context);
}
override public function onStartedHandler(_arg1:Event):void{
_content = loader;
super.onStartedHandler(_arg1);
}
override public function destroy():void{
cleanListeners();
stop();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
};
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 4
//URLItem (br.com.stimuli.loading.loadingtypes.URLItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.net.*;
public class URLItem extends LoadingItem {
public var loader:URLLoader;
public function URLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function load():void{
super.load();
loader = new 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(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.load(url);
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader.data;
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 5
//VideoItem (br.com.stimuli.loading.loadingtypes.VideoItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class VideoItem extends LoadingItem {
var stream:NetStream;
private var dummyEventTrigger:Sprite;
var pausedAtStart:Boolean;// = false
private var _metaData:Object;
private var _canBeginStreaming:Boolean;// = false
private var nc:NetConnection;
private var _checkPolicyFile:Boolean;
public function VideoItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CHECK_POLICY_FILE, BulkLoader.PAUSED_AT_START];
super(_arg1, _arg2, _arg3);
}
public function get checkPolicyFile():Object{
return (_checkPolicyFile);
}
override public function onStartedHandler(_arg1:Event):void{
_content = stream;
if (((pausedAtStart) && (stream))){
stream.pause();
};
super.onStartedHandler(_arg1);
}
override public function stop():void{
try {
if (stream){
stream.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function _parseOptions(_arg1:Object):Array{
pausedAtStart = ((_arg1[BulkLoader.PAUSED_AT_START]) || (false));
_checkPolicyFile = ((_arg1[BulkLoader.CHECK_POLICY_FILE]) || (false));
return (super._parseOptions(_arg1));
}
private function fireCanBeginStreamingEvent():void{
if (_canBeginStreaming){
return;
};
_canBeginStreaming = true;
var _local1:Event = new Event(BulkLoader.CAN_BEGIN_PLAYING);
dispatchEvent(_local1);
}
public function get metaData():Object{
return (_metaData);
}
function onNetStatus(_arg1:NetStatusEvent):void{
var _local2:Event;
if (!stream){
return;
};
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
if (_arg1.info.code == "NetStream.Play.Start"){
_content = stream;
_local2 = new Event(Event.OPEN);
onStartedHandler(_local2);
} else {
if (_arg1.info.code == "NetStream.Play.StreamNotFound"){
onErrorHandler(_arg1);
};
};
}
override public function isStreamable():Boolean{
return (true);
}
override public function load():void{
super.load();
nc = new NetConnection();
nc.connect(null);
stream = new NetStream(nc);
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);
var customClient:Object = new Object();
customClient.onCuePoint = function (... _args):void{
};
customClient.onMetaData = onVideoMetadata;
customClient.onPlayStatus = function (... _args):void{
};
stream.client = customClient;
stream.play(url.url, _checkPolicyFile);
stream.seek(0);
}
function onVideoMetadata(_arg1):void{
_metaData = _arg1;
}
override public function onCompleteHandler(_arg1:Event):void{
_content = stream;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (stream){
stream.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
};
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
dummyEventTrigger = null;
};
}
override public function isVideo():Boolean{
return (true);
}
public function createNetStreamEvent(_arg1:Event):void{
var _local2:Event;
var _local3:Event;
var _local4:ProgressEvent;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if ((((_bytesTotal == _bytesLoaded)) && ((_bytesTotal > 8)))){
if (dummyEventTrigger){
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 {
if (stream){
_local4 = new ProgressEvent(ProgressEvent.PROGRESS, false, false, stream.bytesLoaded, stream.bytesTotal);
if (((((isVideo()) && (metaData))) && (!(_canBeginStreaming)))){
_local5 = (getTimer() - responseTime);
_local6 = (bytesLoaded / (_local5 / 1000));
_local7 = (_bytesRemaining / (_local6 * 0.8));
_local8 = (metaData.duration - stream.bufferLength);
if (_local8 > _local7){
fireCanBeginStreamingEvent();
};
};
super.onProgressHandler(_local4);
};
};
};
}
override public function destroy():void{
if (stream){
};
stop();
cleanListeners();
stream = null;
super.destroy();
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 6
//XMLItem (br.com.stimuli.loading.loadingtypes.XMLItem)
package br.com.stimuli.loading.loadingtypes {
import br.com.stimuli.loading.*;
import flash.events.*;
import flash.net.*;
public class XMLItem extends LoadingItem {
public var loader:URLLoader;
public function XMLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:Event):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function load():void{
super.load();
loader = new 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(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.load(url);
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = new XML(loader.data);
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 7
//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 = new BulkErrorEvent(name, bubbles, cancelable);
_local1.errors = (errors) ? errors.slice() : [];
return (_local1);
}
}
}//package br.com.stimuli.loading
Section 8
//BulkLoader (br.com.stimuli.loading.BulkLoader)
package br.com.stimuli.loading {
import flash.events.*;
import br.com.stimuli.loading.loadingtypes.*;
import flash.media.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class BulkLoader extends EventDispatcher {
public var _itemsTotal:int;// = 0
public var speedAvg:Number;
public var _numConnections:int;// = 7
public var _totalWeight:int;// = 0
public var _bytesTotalCurrent:int;// = 0
public var _itemsLoaded:int;// = 0
public var totalTime:Number;
public var _additionIndex:int;// = 0
public var _bytesTotal:int;// = 0
public var _loadedRatio:Number;// = 0
public var _speed:Number;
public var _lastSpeedCheck:int;
public var _isPaused:Boolean;// = true
public var _isFinished:Boolean;
public var _name:String;
public var _allowsAutoIDFromFileName:Boolean;// = false
public var _contents:Dictionary;
public var _logFunction:Function;
public var _bytesLoaded:int;// = 0
public var _connections:Array;
public var logLevel:int;// = 20
public var _percentLoaded:Number;// = 0
public var _weightPercent:Number;
public var _lastBytesCheck:int;
public var _isRunning:Boolean;
public var _id:int;
public var _items:Array;
public var _stringSubstitutions:Object;
public var avgLatency:Number;
public var _startTime:int;
public var _speedTotal:Number;
public var _endTIme:int;
public static const LOG_INFO:int = 2;
public static const HTTP_STATUS:String = "httpStatus";
public static const CONTEXT:String = "context";
public static const CAN_BEGIN_PLAYING:String = "canBeginPlaying";
public static const TYPE_VIDEO:String = "video";
public static const TYPE_TEXT:String = "text";
public static const TYPE_MOVIECLIP:String = "movieclip";
public static const PREVENT_CACHING:String = "preventCache";
public static const PAUSED_AT_START:String = "pausedAtStart";
public static const TYPE_SOUND:String = "sound";
public static const PROGRESS:String = "progress";
public static const DEFAULT_LOG_LEVEL:int = 20;
public static const ID:String = "id";
public static const CHECK_POLICY_FILE:String = "checkPolicyFile";
public static const COMPLETE:String = "complete";
public static const PRIORITY:String = "priority";
public static const MAX_TRIES:String = "maxTries";
public static const VERSION:String = "rev 196 (0.9.9.4)";
public static const AVAILABLE_TYPES:Array = [TYPE_VIDEO, TYPE_XML, TYPE_TEXT, TYPE_SOUND, TYPE_MOVIECLIP, TYPE_IMAGE];
public static const LOG_VERBOSE:int = 0;
public static const OPEN:String = "open";
public static const LOG_WARNINGS:int = 3;
public static const DEFAULT_NUM_CONNECTIONS:int = 7;
public static const GENERAL_AVAILABLE_PROPS:Array = [WEIGHT, MAX_TRIES, HEADERS, ID, PRIORITY, PREVENT_CACHING, "type"];
public static const LOG_SILENT:int = 10;
public static const ERROR:String = "error";
public static const HEADERS:String = "headers";
public static const LOG_ERRORS:int = 4;
public static const TYPE_IMAGE:String = "image";
public static const TYPE_XML:String = "xml";
public static const WEIGHT:String = "weight";
public static var IMAGE_EXTENSIONS:Array = ["jpg", "jpeg", "gif", "png"];
public static var _customTypesExtensions:Object;
public static var MOVIECLIP_EXTENSIONS:Array = ["swf"];
public static var XML_EXTENSIONS:Array = ["xml"];
public static var _typeClasses:Object = {image:ImageItem, movieclip:ImageItem, xml:XMLItem, video:VideoItem, sound:SoundItem, text:URLItem};
public static var TEXT_EXTENSIONS:Array = ["txt", "js", "php", "asp", "py"];
public static var _instancesCreated:int = 0;
public static var AVAILABLE_EXTENSIONS:Array = ["swf", "jpg", "jpeg", "gif", "png", "flv", "mp3", "xml", "txt", "js"];
public static var SOUND_EXTENSIONS:Array = ["mp3", "f4a", "f4b"];
public static var VIDEO_EXTENSIONS:Array = ["flv", "f4v", "f4p"];
public static var _allLoaders:Object = {};
public function BulkLoader(_arg1:String, _arg2:int=7, _arg3:int=20){
_items = [];
_contents = new Dictionary();
_logFunction = trace;
super();
if (Boolean(_allLoaders[_arg1])){
__debug_print_loaders();
throw (new Error((("BulkLoader with name'" + _arg1) + "' has already been created.")));
};
if (!_arg1){
throw (new Error("Cannot create a BulkLoader instance without a name"));
};
_allLoaders[_arg1] = this;
if (_arg2 > 0){
this._numConnections = _arg2;
};
this.logLevel = _arg3;
_name = _arg1;
_instancesCreated++;
_id = _instancesCreated;
_additionIndex = 0;
}
public function get allowsAutoIDFromFileName():Boolean{
return (_allowsAutoIDFromFileName);
}
public function set allowsAutoIDFromFileName(_arg1:Boolean):void{
_allowsAutoIDFromFileName = _arg1;
}
public function get loadedRatio():Number{
return (_loadedRatio);
}
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 (!_connections){
_connections = [];
};
if ((((_local2.status == LoadingItem.STATUS_FINISHED)) || ((_local2.status == LoadingItem.STATUS_STARTED)))){
return (true);
};
if (_connections.length >= numConnections){
_local3 = _getLeastUrgentOpenedItem();
_removeFromConnections(_local3);
_local3.status = null;
};
_local2._priority = highestPriority;
_loadNext(_local2);
return (true);
}
public function _onItemComplete(_arg1:Event):void{
var _local2:LoadingItem = (_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;
var _local3:Boolean = _loadNext();
var _local4:Boolean = _isAllDoneP();
_itemsLoaded++;
if (_local4){
_onAllLoaded();
};
}
public function _getContentAsType(_arg1, _arg2:Class, _arg3:Boolean=false){
var res:*;
var key = _arg1;
var type = _arg2;
var clearMemory = _arg3;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
var item:LoadingItem = get(key);
if (!item){
return (null);
};
try {
if (((item._isLoaded) || (((item.isStreamable()) && ((item.status == LoadingItem.STATUS_STARTED)))))){
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 set stringSubstitutions(_arg1:Object):void{
_stringSubstitutions = _arg1;
}
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)));
}
public function _removeFromConnections(_arg1):Boolean{
if (!_connections){
return (false);
};
var _local2:int = _connections.indexOf(_arg1);
if (_local2 > -1){
_connections.splice(_local2, 1);
return (true);
};
return (false);
}
public function resume(_arg1):Boolean{
var _local2:LoadingItem = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
_isPaused = false;
if (((_local2) && ((_local2.status == LoadingItem.STATUS_STOPPED)))){
_local2.status = null;
_loadNext();
return (true);
};
return (false);
}
public function _onAllLoaded():void{
if (_isFinished){
return;
};
var _local1:BulkProgressEvent = new BulkProgressEvent(COMPLETE);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
var _local2:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local2.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
_isRunning = false;
_endTIme = getTimer();
totalTime = BulkLoader.truncateNumber(((_endTIme - _startTime) / 1000));
_updateStats();
_connections = [];
getStats();
_isFinished = true;
log("Finished all", LOG_INFO);
dispatchEvent(_local2);
dispatchEvent(_local1);
}
public function removePausedItems():Boolean{
var stoppedLoads:Array = _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 resumeAll():Boolean{
log("Resuming all items", LOG_VERBOSE);
var affected:Boolean;
_items.forEach(function (_arg1:LoadingItem, ... _args):void{
if (_arg1.status == LoadingItem.STATUS_STOPPED){
resume(_arg1);
affected = true;
};
});
_loadNext();
return (affected);
}
public function get isRunning():Boolean{
return (_isRunning);
}
public function getNetStreamMetaData(_arg1:String, _arg2:Boolean=false):Object{
var _local3:NetStream = getNetStream(_arg1, _arg2);
return ((Boolean(_local3)) ? (get(_arg1) as Object).metaData : null);
}
public function get logFunction():Function{
return (_logFunction);
}
public function getProgressForItems(_arg1:Array):BulkProgressEvent{
var _local11:LoadingItem;
var _local13:*;
_bytesLoaded = (_bytesTotal = (_bytesTotalCurrent = 0));
var _local2:Number = 0;
var _local3:int;
var _local4:int;
var _local5:Number = 0;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local12:Array = [];
for each (_local13 in _arg1) {
_local11 = ((_local13 is LoadingItem)) ? _local13 : get(_local13);
if (!_local11){
} else {
_local6++;
_local3 = (_local3 + _local11.weight);
if ((((((_local11.status == LoadingItem.STATUS_STARTED)) || ((_local11.status == LoadingItem.STATUS_FINISHED)))) || ((_local11.status == LoadingItem.STATUS_STOPPED)))){
_local8 = (_local8 + _local11._bytesLoaded);
_local10 = (_local10 + _local11._bytesTotal);
_local5 = (_local5 + ((_local11._bytesLoaded / _local11._bytesTotal) * _local11.weight));
if (_local11.status == LoadingItem.STATUS_FINISHED){
_local7++;
};
_local4++;
};
};
};
if (_local4 != _local6){
_local9 = Number.POSITIVE_INFINITY;
} else {
_local9 = _local10;
};
_local2 = (_local5 / _local3);
if (_local3 == 0){
_local2 = 0;
};
var _local14:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local14.setInfo(_local8, _local9, _local9, _local7, _local6, _local2);
return (_local14);
}
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);
}
public function log(... _args):void{
var _local2:int = (isNaN(_args[(_args.length - 1)])) ? 3 : int(_args.pop());
if (_local2 >= logLevel){
_logFunction(("[BulkLoader] " + _args.join(" ")));
};
}
public function clear():void{
removeAll();
delete _allLoaders[name];
_name = null;
}
public function get speed():Number{
var _local1:int = (getTimer() - _lastSpeedCheck);
var _local2:int = ((bytesLoaded - _lastBytesCheck) / 0x0400);
var _local3:int = (_local2 / (_local1 / 1000));
_lastSpeedCheck = _local1;
_lastBytesCheck = bytesLoaded;
return (_local3);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function _loadNext(_arg1:LoadingItem=null):Boolean{
var checkItem:LoadingItem;
var toLoad = _arg1;
if (_isFinished){
return (false);
};
if (!_connections){
_connections = [];
};
_connections.forEach(function (_arg1:LoadingItem, ... _args):void{
if ((((_arg1.status == LoadingItem.STATUS_ERROR)) && ((_arg1.numTries < _arg1.maxTries)))){
_removeFromConnections(_arg1);
};
});
var next:Boolean;
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 < numConnections){
_connections.push(toLoad);
toLoad.load();
log("Will load item:", toLoad, LOG_INFO);
};
if (_connections.length < numConnections){
_loadNext();
};
};
return (next);
}
public function getSound(_arg1, _arg2:Boolean=false):Sound{
return (Sound(_getContentAsType(_arg1, Sound, _arg2)));
}
public function removeFailedItems():int{
var numCleared:int;
var badItems:Array = _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 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 _local2:LoadingItem;
var _local1:int = int.MIN_VALUE;
for each (_local2 in _items) {
if (_local2.priority > _local1){
_local1 = _local2.priority;
};
};
return (_local1);
}
public function start(_arg1:int=-1):void{
if (_arg1 > 0){
_numConnections = _arg1;
};
if (_connections){
_loadNext();
return;
};
_startTime = getTimer();
_connections = [];
_loadNext();
_isRunning = true;
_lastBytesCheck = 0;
_lastSpeedCheck = getTimer();
_isPaused = false;
}
public function _getLeastUrgentOpenedItem():LoadingItem{
var _local1:LoadingItem = LoadingItem(_connections.sortOn(["priority", "bytesRemaining", "_additionIndex"], [Array.NUMERIC, Array.DESCENDING, Array.NUMERIC, Array.NUMERIC])[0]);
return (_local1);
}
public function get itemsTotal():int{
return (items.length);
}
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 set logFunction(_arg1:Function):void{
_logFunction = _arg1;
}
override public function toString():String{
return (((((("[BulkLoader] name:" + name) + ", itemsTotal: ") + itemsTotal) + ", itemsLoaded: ") + _itemsLoaded));
}
public function sortItemsByPriority():void{
_items.sortOn(["priority", "_additionIndex"], [(Array.NUMERIC | Array.DESCENDING), Array.NUMERIC]);
}
public function get stringSubstitutions():Object{
return (_stringSubstitutions);
}
public function get name():String{
return (_name);
}
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), e.getStackTrace(), LOG_ERRORS);
};
return (false);
}
public function removeAll():void{
var _local1:LoadingItem;
for each (_local1 in _items.slice()) {
remove(_local1);
};
_items = [];
_connections = [];
_contents = new Dictionary();
}
public function _updateStats():void{
var _local4:LoadingItem;
avgLatency = 0;
speedAvg = 0;
var _local1:Number = 0;
var _local2:int;
_speedTotal = 0;
var _local3:Number = 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 reload(_arg1):Boolean{
var _local2:LoadingItem;
if ((_arg1 is LoadingItem)){
_local2 = _arg1;
} else {
_local2 = get(_arg1);
};
if (!_local2){
return (false);
};
_removeFromItems(_local2);
_removeFromConnections(_local2);
_local2.stop();
_local2.cleanListeners();
_local2.status = null;
_isFinished = false;
_local2._addedTime = getTimer();
_local2._additionIndex = _additionIndex++;
_local2.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);
_local2.addEventListener(ERROR, _onItemError, false, 0, true);
_local2.addEventListener(Event.OPEN, _onItemStarted, false, 0, true);
_local2.addEventListener(ProgressEvent.PROGRESS, _onProgress, false, 0, true);
_items.push(_local2);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local2.weight);
sortItemsByPriority();
_isFinished = false;
loadNow(_local2);
return (true);
}
public function _onItemStarted(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
log("Started loading", _local2, LOG_INFO);
dispatchEvent(_arg1);
}
public function add(_arg1, _arg2:Object=null):LoadingItem{
var _local4:String;
var _local6:String;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
if (((!(_arg1)) || (!(String(_arg1))))){
throw (new Error("[BulkLoader] Cannot add an item with a null url"));
};
_arg2 = ((_arg2) || ({}));
if ((_arg1 is String)){
_arg1 = new URLRequest(BulkLoader.substituteURLString(_arg1, _stringSubstitutions));
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)));
};
};
var _local3:LoadingItem = get(_arg2[ID]);
if (_local3){
log((("Add received an already added id: " + _arg2[ID]) + ", not adding a new item"));
return (_local3);
};
if (_arg2["type"]){
_local4 = _arg2["type"].toLowerCase();
if (AVAILABLE_TYPES.indexOf(_local4) == -1){
log("add received an unknown type:", _local4, "and will cast it to text", LOG_WARNINGS);
};
};
if (!_local4){
_local4 = guessType(_arg1.url);
};
_additionIndex++;
_local3 = new _typeClasses[_local4](_arg1, _local4, ((_instancesCreated + "_") + String(_additionIndex)));
if (((!(_arg2["id"])) && (_allowsAutoIDFromFileName))){
_arg2["id"] = getFileName(_arg1.url);
log("Adding automatic id from file name for item:", _local3, (("( id= " + _arg2["id"]) + " )"));
};
var _local5:Array = _local3._parseOptions(_arg2);
for each (_local6 in _local5) {
log(_local6, LOG_WARNINGS);
};
log("Added", _local3, LOG_VERBOSE);
_local3._addedTime = getTimer();
_local3._additionIndex = _additionIndex;
_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;
if (!_isPaused){
_loadNext();
};
return (_local3);
}
public function getText(_arg1, _arg2:Boolean=false):String{
return (String(_getContentAsType(_arg1, String, _arg2)));
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get weightPercent():Number{
return (_weightPercent);
}
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 isFinished():Boolean{
return (_isFinished);
}
public function changeItemPriority(_arg1:String, _arg2:int):Boolean{
var _local3:LoadingItem = 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)));
}
public function getHttpStatus(_arg1):int{
var _local2:LoadingItem = get(_arg1);
if (_local2){
return (_local2.httpStatus);
};
return (-1);
}
public function set itemsLoaded(_arg1:int):void{
_itemsLoaded = _arg1;
}
public function _onProgress(_arg1:Event=null):void{
var _local2:BulkProgressEvent = getProgressForItems(_items);
_bytesLoaded = _local2.bytesLoaded;
_bytesTotal = _local2.bytesTotal;
_weightPercent = _local2.weightPercent;
_percentLoaded = _local2.percentLoaded;
_bytesTotalCurrent = _local2.bytesTotalCurrent;
_loadedRatio = _local2.ratioLoaded;
dispatchEvent(_local2);
}
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 _removeFromItems(_arg1:LoadingItem):Boolean{
var _local2:int = _items.indexOf(_arg1);
if (_local2 > -1){
_items.splice(_local2, 1);
} else {
return (false);
};
if (_arg1._isLoaded){
_itemsLoaded--;
};
_itemsTotal--;
_totalWeight = (_totalWeight - _arg1.weight);
log(("Removing " + _arg1), LOG_VERBOSE);
return (true);
}
public function _isAllDoneP():Boolean{
return (_items.every(function (_arg1:LoadingItem, ... _args):Boolean{
return (_arg1._isLoaded);
}));
}
public function _onItemError(_arg1:BulkErrorEvent):void{
var evt = _arg1;
var item:LoadingItem = (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);
evt.stopPropagation();
var bulkErrorEvent:BulkErrorEvent = new BulkErrorEvent(BulkErrorEvent.ERROR);
bulkErrorEvent.errors = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
});
dispatchEvent(bulkErrorEvent);
}
public function pauseAll():void{
var _local1:LoadingItem;
for each (_local1 in _items) {
pause(_local1);
};
_isRunning = false;
_isPaused = true;
log("Stopping all items", LOG_INFO);
}
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 totalWeight():int{
return (_totalWeight);
}
public function get itemsLoaded():int{
return (_itemsLoaded);
}
public function getMovieClip(_arg1:String, _arg2:Boolean=false):MovieClip{
return (MovieClip(_getContentAsType(_arg1, MovieClip, _arg2)));
}
public function get numConnections():int{
return (_numConnections);
}
public function getStats():String{
var stats:Array = [];
stats.push("\n************************************");
stats.push((("All items loaded(" + itemsTotal) + ")"));
stats.push(("Total time(s): " + totalTime));
stats.push(("Average latency(s): " + truncateNumber(avgLatency)));
stats.push(("Average speed(kb/s): " + truncateNumber(speedAvg)));
stats.push(("Median speed(kb/s): " + truncateNumber(_speedTotal)));
stats.push(("KiloBytes total: " + truncateNumber((bytesTotal / 0x0400))));
var itemsInfo:Array = _items.map(function (_arg1:LoadingItem, ... _args):String{
return (("\t" + _arg1.getStats()));
});
stats.push(itemsInfo.join("\n"));
stats.push("************************************");
var statsString:String = stats.join("\n");
log(statsString, LOG_VERBOSE);
return (statsString);
}
public function pause(_arg1, _arg2:Boolean=false):Boolean{
var _local3:LoadingItem = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
if (!_local3){
return (false);
};
_local3.stop();
log("STOPPED ITEM:", _local3, LOG_INFO);
var _local4:Boolean = _removeFromConnections(_local3);
if (_arg2){
_loadNext();
};
return (_local4);
}
public static function __debug_printStackTrace():void{
try {
throw (new Error("stack trace"));
} catch(e:Error) {
trace(e.getStackTrace());
};
}
public static function pauseAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.pauseAll();
};
}
public static function _hasItemInBulkLoader(_arg1, _arg2:BulkLoader):Boolean{
var _local3:LoadingItem = _arg2.get(_arg1);
if (((_local3) && (_local3._isLoaded))){
return (true);
};
return (false);
}
public static function getUniqueName():String{
return (("BulkLoader-" + _instancesCreated));
}
public static function substituteURLString(_arg1:String, _arg2:Object):String{
var _local9:Object;
var _local10:Object;
var _local12:String;
if (!_arg2){
return (_arg1);
};
var _local3:RegExp = /(?P<var_name>\{\s*[^\}]*\})/g;
var _local4:Object = _local3.exec(_arg1);
var _local5:String = (_local4) ? _local4.var_name : null;
var _local6:Array = [];
var _local7:int;
while (((Boolean(_local4)) && (Boolean(_local4.var_name)))) {
if (_local4.var_name){
_local5 = _local4.var_name;
_local5 = _local5.replace("{", "");
_local5 = _local5.replace("}", "");
_local5 = _local5.replace(/\s*/g, "");
};
_local6.push({start:_local4.index, end:(_local4.index + _local4.var_name.length), changeTo:_arg2[_local5]});
_local7++;
if (_local7 > 400){
break;
};
_local4 = _local3.exec(_arg1);
_local5 = (_local4) ? _local4.var_name : null;
};
if (_local6.length == 0){
return (_arg1);
};
var _local8:Array = [];
var _local11:String = _arg1.substr(0, _local6[0].start);
for each (_local10 in _local6) {
if (_local9){
_local11 = _arg1.substring(_local9.end, _local10.start);
};
_local8.push(_local11);
_local8.push(_local10.changeTo);
_local9 = _local10;
};
_local8.push(_arg1.substring(_local10.end));
return (_local8.join(""));
}
public static function createUniqueNamedLoader(_arg1:int=7, _arg2:int=20):BulkLoader{
return (new BulkLoader(BulkLoader.getUniqueName(), _arg1, _arg2));
}
public static function whichLoaderHasItem(_arg1):BulkLoader{
var _local2:BulkLoader;
for each (_local2 in _allLoaders) {
if (BulkLoader._hasItemInBulkLoader(_arg1, _local2)){
return (_local2);
};
};
return (null);
}
public static function removeAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.removeAll();
_local1.clear();
_local1 = null;
};
_allLoaders = {};
}
public static function __debug_print_num_loaders():void{
var _local2:String;
var _local1:int;
for each (_local2 in BulkLoader._allLoaders) {
_local1++;
};
trace("BulkLoader has ", _local1, "instances");
}
public static function getFileName(_arg1:String):String{
if (_arg1.lastIndexOf("/") == (_arg1.length - 1)){
return (getFileName(_arg1.substring(0, (_arg1.length - 1))));
};
var _local2:int = (_arg1.lastIndexOf("/") + 1);
var _local3:String = _arg1.substring(_local2);
var _local4:int = _local3.indexOf(".");
if (_local4 == -1){
if (_local3.indexOf("?") > -1){
_local4 = _local3.indexOf("?");
} else {
_local4 = _local3.length;
};
};
var _local5:String = _local3.substring(0, _local4);
return (_local5);
}
public static function guessType(_arg1:String):String{
var _local4:String;
var _local5:String;
var _local6:String;
var _local2:String = ((_arg1.indexOf("?") > -1)) ? _arg1.substring(0, _arg1.indexOf("?")) : _arg1;
var _local3:String = _local2.substring((_local2.lastIndexOf(".") + 1)).toLowerCase();
if (!Boolean(_local3)){
_local3 = BulkLoader.TYPE_TEXT;
};
if ((((_local3 == BulkLoader.TYPE_IMAGE)) || ((BulkLoader.IMAGE_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_IMAGE;
} else {
if ((((_local3 == BulkLoader.TYPE_SOUND)) || ((BulkLoader.SOUND_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_SOUND;
} else {
if ((((_local3 == BulkLoader.TYPE_VIDEO)) || ((BulkLoader.VIDEO_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_VIDEO;
} else {
if ((((_local3 == BulkLoader.TYPE_XML)) || ((BulkLoader.XML_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_XML;
} else {
if ((((_local3 == BulkLoader.TYPE_MOVIECLIP)) || ((BulkLoader.MOVIECLIP_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_MOVIECLIP;
} else {
for (_local5 in _customTypesExtensions) {
for each (_local6 in _customTypesExtensions[_local5]) {
if (_local6 == _local3){
_local4 = _local5;
break;
};
if (_local4){
break;
};
};
};
if (!_local4){
_local4 = BulkLoader.TYPE_TEXT;
};
};
};
};
};
};
return (_local4);
}
public static function getLoader(_arg1:String):BulkLoader{
return ((BulkLoader._allLoaders[_arg1] as BulkLoader));
}
public static function registerNewType(_arg1:String, _arg2:String, _arg3:Class):Boolean{
var _local4:Array;
if (_arg1.charAt(0) == "."){
_arg1 = _arg1.substring(1);
};
if (AVAILABLE_TYPES.indexOf(_arg2) == -1){
if (((!(Boolean(_arg3))) || (!((_arg3 is LoadingItem))))){
throw (new Error("[BulkLoader]: When adding a new type and extension, you must determine which class to use"));
};
_typeClasses[_arg2] = _arg3;
if (!_customTypesExtensions[_arg2]){
_customTypesExtensions[_arg2] = [];
AVAILABLE_TYPES.push(_arg2);
};
_customTypesExtensions[_arg2].push(_arg1);
return (true);
};
var _local5:Object = {IMAGE_EXTENSIONS:TYPE_IMAGE, VIDEO_EXTENSIONS:TYPE_VIDEO, SOUND_EXTENSIONS:TYPE_SOUND, TEXT_EXTENSIONS:TYPE_TEXT};
_local4 = _local5[_arg2];
if (((_local4) && ((_local4.indexOf(_arg1) == -1)))){
_local4.push(_arg1);
return (true);
};
return (false);
}
public static function __debug_print_loaders():void{
var instNames:String;
var theNames:Array = [];
for each (instNames in BulkLoader._allLoaders) {
theNames.push(instNames);
};
theNames.sort();
trace("All loaders");
theNames.forEach(function (_arg1, ... _args):void{
trace("\t", _arg1);
});
trace("===========");
}
public static function truncateNumber(_arg1:Number, _arg2:int=2):Number{
var _local3:int = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
}
}//package br.com.stimuli.loading
Section 9
//BulkProgressEvent (br.com.stimuli.loading.BulkProgressEvent)
package br.com.stimuli.loading {
import flash.events.*;
public class BulkProgressEvent extends ProgressEvent {
public var bytesTotalCurrent:int;
public var itemsTotal:int;
public var itemsLoaded:int;
public var _percentLoaded:Number;
public var _weightPercent:Number;
public var _ratioLoaded:Number;
public var name:String;
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;
}
override public function clone():Event{
var _local1:BulkProgressEvent = new BulkProgressEvent(name, bubbles, cancelable);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, itemsLoaded, itemsTotal, weightPercent);
return (_local1);
}
public function get weightPercent():Number{
return (_weightPercent);
}
public function set ratioLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_ratioLoaded = _arg1;
}
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 = ((_arg2 > 0)) ? (_arg1 / _arg2) : 0;
ratioLoaded = ((_arg5 == 0)) ? 0 : (_arg4 / _arg5);
}
public function set percentLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_percentLoaded = _arg1;
}
public function loadingStatus():String{
var _local1:Array = [];
_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(", ")) + ";"));
}
public function get ratioLoaded():Number{
return (_ratioLoaded);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function set weightPercent(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_weightPercent = _arg1;
}
override public function toString():String{
return (super.toString());
}
}
}//package br.com.stimuli.loading
Section 10
//SectionEvent (cartelle.core.events.SectionEvent)
package cartelle.core.events {
import flash.events.*;
public class SectionEvent extends Event {
public static const TRANSITION_OUT_COMPLETE:String = "transitionOutComplete";
public static const TRANSITION_IN_COMPLETE:String = "transitionInComplete";
public static const ASSET_PACK_LOAD_COMPLETE:String = "assetPackLoadComplete";
public function SectionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new SectionEvent(type, bubbles, cancelable));
}
}
}//package cartelle.core.events
Section 11
//Section (cartelle.core.Section)
package cartelle.core {
import cartelle.loading.*;
import flash.events.*;
import flash.display.*;
public class Section extends View {
public var isStandaloneSwf:Boolean;
private var assetPacks:Array;
private var assetPackIds:Array;
public function Section(){
assetPackIds = [];
assetPacks = [];
super();
if ((this.isStandaloneSwf = (this.parent is Stage))){
this.standAloneSWF();
};
if (!AssetPackManager.initialized){
AssetPackManager.initialize();
};
}
public function handleAssetPack(_arg1:AssetPack, _arg2:ProgressStatus=null):void{
this.assetPacks.push(_arg1);
if (((((!(this.initialized)) && (!((this.parent is Loader))))) && ((this.assetPacks.length == this.assetPackIds.length)))){
super.start();
};
}
public function requireAssetPack(_arg1:String):void{
this.assetPackIds.push(_arg1);
}
public function pause():void{
}
override protected function start():void{
if (this.assetPackIds.length == 0){
super.start();
} else {
if (this.assetPackIds.length > 0){
this.loadRequiredPacks();
};
};
}
public function getAssetPack(_arg1:String):AssetPack{
return (AssetPackManager.getAssetPack(_arg1));
}
public function resume():void{
}
override public function destroy():void{
super.destroy();
var _local1:Number = 0;
while (_local1 < this.assetPacks.length) {
this.assetPacks[_local1].clear();
this.assetPacks[_local1] = null;
_local1++;
};
}
public function loadRequiredPacks():void{
var _local1:Number = 0;
while (_local1 < this.assetPackIds.length) {
AssetPackManager.loadToSection(this.assetPackIds[_local1], this);
_local1++;
};
}
override protected function removedFromStageHandler(_arg1:Event):void{
super.removedFromStageHandler(_arg1);
}
public function transitionOut():void{
}
public function getAsset(_arg1:String):AssetPackItem{
var _local3:AssetPack;
var _local2:Number = 0;
while (_local2 < this.assetPacks.length) {
_local3 = AssetPack(this.assetPacks[_local2]);
if (_local3.getAsset(_arg1)){
return (AssetPackItem(_local3.getAsset(_arg1)));
};
_local2++;
};
return (null);
}
public function handleAssetPackItem(_arg1:AssetPackItem):void{
}
public function transitionIn():void{
}
protected function standAloneSWF():void{
}
}
}//package cartelle.core
Section 12
//View (cartelle.core.View)
package cartelle.core {
import flash.events.*;
import flash.display.*;
public class View extends MovieClip {
protected var initialized:Boolean;
public function View(){
this.initialized = false;
this.addEventListener(Event.ADDED_TO_STAGE, this.addedToStageHandler, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, false, 0, true);
}
protected function start():void{
this.initialize();
this.render();
this.initialized = true;
}
protected function render():void{
}
private function addedToStageHandler(_arg1:Event):void{
if (_arg1.target == this){
this.removeEventListener(Event.ADDED_TO_STAGE, this.addedToStageHandler);
this.stage.addEventListener(Event.RESIZE, stageResizeHandler, false, 0, true);
this.stage.addEventListener(Event.RENDER, this.stageRenderHandler, false, 0, true);
this.start();
};
}
protected function removedFromStageHandler(_arg1:Event):void{
this.destroy();
if (_arg1.target == this){
this.removeEventListener(Event.ADDED_TO_STAGE, this.addedToStageHandler);
this.removeEventListener(Event.REMOVED_FROM_STAGE, this.removedFromStageHandler);
this.stage.removeEventListener(Event.RESIZE, stageResizeHandler);
this.stage.removeEventListener(Event.RENDER, this.stageRenderHandler);
};
}
override public function gotoAndPlay(_arg1:Object, _arg2:String=null):void{
super.gotoAndPlay(_arg1, _arg2);
if (this.stage){
this.stage.invalidate();
};
}
protected function initialize():void{
}
private function stageRenderHandler(_arg1:Event):void{
}
protected function stageResizeHandler(_arg1:Event):void{
}
public function destroy():void{
}
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (this.stage){
this.stage.invalidate();
};
}
}
}//package cartelle.core
Section 13
//AssetPackParser (cartelle.loading.parsers.AssetPackParser)
package cartelle.loading.parsers {
import cartelle.loading.*;
public class AssetPackParser {
public function parse(_arg1:XML):Array{
var _local5:XML;
var _local6:String;
var _local7:XMLList;
var _local8:AssetPack;
var _local9:Number;
var _local10:Boolean;
var _local11:AssetPackItem;
var _local2:Array = [];
var _local3:XMLList = _arg1..assetPack;
var _local4:Number = 0;
while (_local4 < _local3.length()) {
_local5 = _local3[_local4];
_local6 = _local3[_local4].@id;
_local7 = _local5..asset;
if (((_local5.@targetId) && ((_local7.length() > 0)))){
_local8 = ((AssetPackManager.getAssetPack(_local6)) || (new AssetPack(_local6)));
_local9 = 0;
while (_local9 < _local7.length()) {
_local10 = ((_local7[_local9].@addContents == "true")) ? true : false;
_local11 = ((_local8.getAsset(_local7[_local9].@id)) || (_local8.addAsset(_local7[_local9].url, _local8.id, _local7[_local9].@id, _local7[_local9])));
_local11.addContents = _local10;
_local11.group = _local7[_local9].@group;
_local9++;
};
};
_local2.push(_local8);
_local4++;
};
return (_local2);
}
}
}//package cartelle.loading.parsers
Section 14
//AssetPack (cartelle.loading.AssetPack)
package cartelle.loading {
import cartelle.core.*;
public class AssetPack {
public var id:String;
public var assets:Array;
public var loaded:Boolean;
public var host:Section;
public var hostItem:AssetPackHostItem;
public function AssetPack(_arg1:String){
assets = [];
super();
this.id = _arg1;
this.loaded = false;
}
public function removeAsset(_arg1:String):void{
var _local2:AssetPackItem = this.getAsset(_arg1);
if (_local2){
AssetPackManager.bulkLoader.removeAll();
_local2.file = null;
_local2.loaded = false;
_local2.uniqueId = null;
_local2 = null;
};
}
public function getGroup(_arg1:String):Array{
var _local4:AssetPackItem;
var _local2:Array = [];
var _local3:Number = 0;
while (_local3 < this.getItems().length) {
_local4 = this.getItems()[_local3];
if (_local4.group == _arg1){
_local2.push(_local4);
};
_local3++;
};
return (_local2);
}
public function isHostItem(_arg1:AssetPackItem):Boolean{
if (((this.hostItem) && ((this.hostItem == _arg1)))){
return (true);
};
return (false);
}
public function checkLoaded():Boolean{
var _local3:AssetPackItem;
var _local1:Boolean;
var _local2:Number = 0;
while (_local2 < this.getItems().length) {
_local3 = AssetPackItem(this.getItems()[_local2]);
if (!_local3.loaded){
_local1 = false;
};
_local2++;
};
return ((this.loaded = _local1));
}
public function addAsset(_arg1:XMLList, _arg2:String, _arg3:String=null, _arg4:XML=null):AssetPackItem{
var _local5:AssetPackItem = new AssetPackItem(_arg1, _arg2, _arg3, _arg4);
_local5.index = this.assets.length;
this.assets.push(_local5);
return (_local5);
}
public function getItems():Array{
var _local1:Array = [];
var _local2:Number = 0;
while (_local2 < this.assets.length) {
_local1.push(this.assets[_local2]);
_local2++;
};
if (this.hostItem){
_local1.push(this.hostItem);
};
return (_local1);
}
public function clear():void{
var _local3:AssetPackItem;
this.host = null;
if (this.hostItem){
this.hostItem.sectionHost = null;
this.hostItem = null;
};
this.loaded = false;
var _local1:Number = this.getItems().length;
var _local2:Number = 0;
while (_local2 < _local1) {
_local3 = this.getItems()[_local2];
this.removeAsset(_local3.id);
_local2++;
};
}
public function getAsset(_arg1:String):AssetPackItem{
var _local3:AssetPackItem;
var _local2:Number = 0;
while (_local2 < assets.length) {
_local3 = assets[_local2];
if (_local3.id == _arg1){
return (_local3);
};
_local2++;
};
return (null);
}
}
}//package cartelle.loading
Section 15
//AssetPackHostItem (cartelle.loading.AssetPackHostItem)
package cartelle.loading {
import cartelle.core.*;
public class AssetPackHostItem extends AssetPackItem {
public var sectionHost:Section;
public function AssetPackHostItem(_arg1:XMLList, _arg2:String, _arg3:Section, _arg4:String=null, _arg5:XML=null){
super(_arg1, _arg2, _arg4, _arg5);
this.sectionHost = _arg3;
}
}
}//package cartelle.loading
Section 16
//AssetPackItem (cartelle.loading.AssetPackItem)
package cartelle.loading {
public class AssetPackItem {
public var uniqueId:String;
public var index:Number;
public var addContents:Boolean;
public var xmlData:XML;
public var id:String;
public var assetPackId:String;
private var urlList:XMLList;
private var _url:String;
private var _loaded:Boolean;
public var file;
public var group:String;
public function AssetPackItem(_arg1:XMLList, _arg2:String, _arg3:String=null, _arg4:XML=null){
this.urlList = _arg1;
this.id = _arg3;
this.assetPackId = _arg2;
this.xmlData = _arg4;
this.loaded = false;
}
public function get loaded():Boolean{
return (this._loaded);
}
public function set loaded(_arg1:Boolean):void{
this._loaded = _arg1;
var _local2:AssetPack = AssetPackManager.getAssetPack(this.assetPackId);
if (_local2){
_local2.checkLoaded();
};
}
public function get url():String{
if (!_loaded){
_url = urlList[Math.floor((Math.random() * urlList.length()))];
};
return (_url);
}
}
}//package cartelle.loading
Section 17
//AssetPackManager (cartelle.loading.AssetPackManager)
package cartelle.loading {
import cartelle.core.*;
import br.com.stimuli.loading.*;
import flash.events.*;
import cartelle.loading.parsers.*;
public class AssetPackManager {
public static var bulkLoader:BulkLoader;
public static var initialized:Boolean = false;
protected static var disp:EventDispatcher;
public static var assetPacks:Object = {};
private static var _uniqueId:Number = 0;
private static function queueCompleteHandler(_arg1:BulkProgressEvent):void{
bulkLoader.removeAll();
dispatchEvent(_arg1);
}
private static function getUniqueId(_arg1:String=""):String{
return ((_arg1 + _uniqueId++));
}
public static function defineDriver(_arg1:String, _arg2:String, _arg3:Section):void{
var _local4:XML = <list><assetPack><asset/></assetPack></list>
;
_local4.assetPack.@id = _arg2;
_local4.assetPack.asset.url = _arg1;
_local4.assetPack.asset.@addContents = "true";
_local4.assetPack.asset.@id = "driver";
addAssetPacksXML(_local4);
_arg3.requireAssetPack(_arg2);
}
public static function dispatchEvent(... _args):void{
if (disp == null){
return;
};
disp.dispatchEvent.apply(null, _args);
}
public static function addAssetPack(_arg1:AssetPack):void{
assetPacks[_arg1.id] = _arg1;
}
private static function queueProgressHandler(_arg1:BulkProgressEvent):void{
dispatchEvent(_arg1);
}
public static function addEventListener(... _args):void{
if (disp == null){
disp = new EventDispatcher();
};
disp.addEventListener.apply(null, _args);
}
public static function initialize():void{
initialized = true;
bulkLoader = new BulkLoader("assetPacks");
bulkLoader.addEventListener(BulkProgressEvent.COMPLETE, queueCompleteHandler, false, 0, true);
bulkLoader.addEventListener(BulkProgressEvent.PROGRESS, queueProgressHandler, false, 0, true);
bulkLoader.addEventListener(BulkErrorEvent.ERROR, errorHandler, false, 0, true);
}
private static function itemProgressHandler(_arg1:ProgressEvent):void{
}
private static function getAssetPackItemById(_arg1:String):AssetPackItem{
var _local2:String;
var _local3:AssetPack;
var _local4:Number;
var _local5:AssetPackItem;
for (_local2 in assetPacks) {
_local3 = assetPacks[_local2];
_local4 = 0;
while (_local4 < _local3.getItems().length) {
_local5 = _local3.getItems()[_local4];
if (_local5.uniqueId == _arg1){
return (_local5);
};
_local4++;
};
};
return (null);
}
private static function loadItem(_arg1:AssetPackItem):void{
bulkLoader.add(_arg1.url, {id:_arg1.uniqueId});
bulkLoader.get(_arg1.uniqueId).addEventListener(ProgressEvent.PROGRESS, itemProgressHandler, false, 0, true);
bulkLoader.get(_arg1.uniqueId).addEventListener(Event.COMPLETE, itemCompleteHandler, false, 0, true);
bulkLoader.start();
}
private static function loadAssetPack(_arg1:AssetPack):void{
var _local3:AssetPackItem;
var _local2:Number = 0;
while (_local2 < _arg1.getItems().length) {
_local3 = _arg1.getItems()[_local2];
if (bulkLoader.get(_local3.uniqueId) == null){
_local3.uniqueId = getUniqueId("assetPackItem_");
loadItem(_local3);
};
_local2++;
};
}
public static function loadToSection(_arg1:String, _arg2:Section):void{
var _local3:AssetPack = getAssetPack(_arg1);
if (_local3){
_local3.host = Section(_arg2);
loadAssetPack(_local3);
};
}
public static function addAssetPacksXML(_arg1:XML):void{
addAssetPacks(new AssetPackParser().parse(_arg1));
}
public static function loadToURL(_arg1:String, _arg2:XMLList, _arg3:Section):void{
var _local5:AssetPackHostItem;
var _local4:AssetPack = getAssetPack(_arg1);
if (_local4){
_local5 = new AssetPackHostItem(_arg2, _arg1, _arg3, "host");
_local4.hostItem = _local5;
loadAssetPack(_local4);
};
}
private static function errorHandler(_arg1:BulkErrorEvent):void{
trace(("ASSET PACK MANAGER : ERROR EVENT : " + _arg1.errors));
}
public static function addAssetPacks(_arg1:Array):void{
var _local2:Number = 0;
while (_local2 < _arg1.length) {
addAssetPack(_arg1[_local2]);
_local2++;
};
}
public static function getAssetPack(_arg1:String):AssetPack{
return (assetPacks[_arg1]);
}
public static function removeEventListener(... _args):void{
if (disp == null){
return;
};
disp.removeEventListener.apply(null, _args);
}
private static function itemCompleteHandler(_arg1:Event):void{
var _local2:AssetPackItem = AssetPackItem(getAssetPackItemById(_arg1.target.id));
var _local3:AssetPack = getAssetPack(_local2.assetPackId);
var _local4:String = _local2.uniqueId;
var _local5:* = _arg1.target.content;
var _local6:ProgressStatus = new ProgressStatus("complete", 1, 1);
bulkLoader.get(_local4).removeEventListener(ProgressEvent.PROGRESS, itemProgressHandler);
bulkLoader.get(_local4).removeEventListener(Event.COMPLETE, itemCompleteHandler);
_local2.file = _local5;
if (_local3.isHostItem(_local2)){
_local3.host = Section(_local3.hostItem.file);
};
_local2.loaded = true;
if (_local2.addContents){
addAssetPacksXML(XML(_local2.file));
loadAssetPack(_local3);
} else {
if (_local3.loaded){
_local3.host.handleAssetPack(_local3, _local6);
if (_local3.hostItem){
_local3.hostItem.sectionHost.handleAssetPack(_local3, _local6);
};
};
if (_local3.host){
_local3.host.loadRequiredPacks();
};
};
}
}
}//package cartelle.loading
Section 18
//ProgressStatus (cartelle.loading.ProgressStatus)
package cartelle.loading {
public class ProgressStatus {
public var total:Number;
public var loaded:Number;
public var message:String;
public function ProgressStatus(_arg1:String, _arg2:Number, _arg3:Number){
this.message = _arg1;
this.loaded = _arg2;
this.total = _arg3;
}
}
}//package cartelle.loading
Section 19
//FormatManager (cartelle.text.FormatManager)
package cartelle.text {
import flash.text.*;
import flash.utils.*;
public class FormatManager {
public function init():void{
}
public static function getFont(_arg1:String):Font{
var _local2:Array = Font.enumerateFonts(false);
var _local3:Number = 0;
while (_local3 < _local2.length) {
if (getQualifiedClassName(Font(_local2[_local3])) == _arg1){
return (Font(_local2[_local3]));
};
_local3++;
};
return (null);
}
}
}//package cartelle.text
Section 20
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_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));
}
}
}//package gs.easing
Section 21
//Quad (gs.easing.Quad)
package gs.easing {
public class Quad {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_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));
}
}
}//package gs.easing
Section 22
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 23
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 1;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array, _arg4:Array, _arg5:Array):void{
var _local6:int;
var _local7:String;
_local6 = (_arg4.length - 1);
while (_local6 > -1) {
if (_arg1[_arg4[_local6].name] != undefined){
_arg4.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg3.length - 1);
while (_local6 > -1) {
if (_arg1[_arg3[_local6][4]] != undefined){
_arg3.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg5.length - 1);
while (_local6 > -1) {
if (_arg1[_arg5[_local6].name] != undefined){
_arg5.splice(_local6, 1);
};
_local6--;
};
for (_local7 in _arg1) {
delete _arg2[_local7];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local9:Object;
var _local10:String;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (((((!((_local8 == _arg1))) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
_local7--;
};
if (_local6.length == 0){
return;
};
if (_local4 == AUTO){
if (_local3.isTV == true){
_local3 = _local3.exposedProps;
};
_local9 = {};
for (_local10 in _local3) {
if ((((((((((((((((((((((((((((((((((((((((((((_local10 == "ease")) || ((_local10 == "delay")))) || ((_local10 == "overwrite")))) || ((_local10 == "onComplete")))) || ((_local10 == "onCompleteParams")))) || ((_local10 == "runBackwards")))) || ((_local10 == "persist")))) || ((_local10 == "onUpdate")))) || ((_local10 == "onUpdateParams")))) || ((_local10 == "timeScale")))) || ((_local10 == "onStart")))) || ((_local10 == "onStartParams")))) || ((_local10 == "renderOnStart")))) || ((_local10 == "proxiedEase")))) || ((_local10 == "easeParams")))) || ((_local10 == "onCompleteAll")))) || ((_local10 == "onCompleteAllParams")))) || ((_local10 == "yoyo")))) || ((_local10 == "loop")))) || ((_local10 == "onCompleteListener")))) || ((_local10 == "onStartListener")))) || ((_local10 == "onUpdateListener")))){
} else {
_local9[_local10] = 1;
if (_local10 == "shortRotate"){
_local9.rotation = 1;
} else {
if (_local10 == "removeTint"){
_local9.tint = 1;
} else {
if (_local10 == "autoAlpha"){
_local9.alpha = 1;
_local9.visible = 1;
};
};
};
};
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].killVars(_local9);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 9.29){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 24
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.filters.*;
import flash.utils.*;
public class TweenFilterLite extends TweenLite {
protected var _matrix:Array;
protected var _hf:Boolean;// = false
protected var _roundProps:Boolean;
protected var _cmf:ColorMatrixFilter;
protected var _filters:Array;
protected var _endMatrix:Array;
protected var _timeScale:Number;
protected var _clrsa:Array;
public static var removeTween:Function = TweenLite.removeTween;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 9.29;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
protected static var _globalTimeScale:Number = 1;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_filters = [];
super(_arg1, _arg2, _arg3);
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenFilterLite)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (TweenLite.version < 9.29){
trace("TweenFilterLite error! Please update your TweenLite class or try deleting your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
}
override public function killVars(_arg1:Object):void{
if (TweenLite.overwriteManager.enabled){
TweenLite.overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, ((_filters) || ([])));
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:int;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:int;
var _local8:String;
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter roundProps ");
_roundProps = Boolean((this.vars.roundProps is Array));
if (_isDisplayObject){
if (this.vars.blurFilter != null){
_local4 = this.vars.blurFilter;
addFilter("blurFilter", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != null){
_local4 = this.vars.glowFilter;
addFilter("glowFilter", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != null){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrixFilter", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[this.tweens.length] = [_matrix, _local3.toString(), _matrix[_local3], (_endMatrix[_local3] - _matrix[_local3]), "colorMatrixFilter"];
};
_local3++;
};
};
if (this.vars.dropShadowFilter != null){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadowFilter", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != null){
_local4 = this.vars.bevelFilter;
addFilter("bevelFilter", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = (_clrsa.length - 1);
while (_local3 > -1) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3--;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
if (_roundProps){
_local3 = (this.vars.roundProps.length - 1);
while (_local3 > -1) {
_local8 = this.vars.roundProps[_local3];
_local7 = (this.tweens.length - 1);
while (_local7 > -1) {
if ((((this.tweens[_local7][1] == _local8)) && ((this.tweens[_local7][0] == this.target)))){
this.tweens[_local7][5] = true;
break;
};
_local7--;
};
_local3--;
};
};
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function get timeScale():Number{
return (_timeScale);
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:int;
var _local8:Array;
var _local9:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
if (!_roundProps){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
} else {
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
if (_local4[5]){
_local6 = (_local4[2] + (_local3 * _local4[3]));
_local7 = ((_local6)<0) ? -1 : 1;
_local4[0][_local4[1]] = ((((_local6 % 1) * _local7))>0.5) ? (int(_local6) + _local7) : int(_local6);
} else {
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
};
_local5--;
};
};
if (_hf){
_local5 = (_clrsa.length - 1);
while (_local5 > -1) {
_local4 = _clrsa[_local5];
_local4.f[_local4.p] = ((((_local4.sr + (_local3 * _local4.cr)) << 16) | ((_local4.sg + (_local3 * _local4.cg)) << 8)) | (_local4.sb + (_local3 * _local4.cb)));
_local5--;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local8 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local9 = (_local8.length - 1);
while (_local9 > -1) {
if ((_local8[_local9] is _filters[_local5].type)){
_local8.splice(_local9, 1, _filters[_local5].filter);
break;
};
_local9--;
};
_local5++;
};
this.target.filters = _local8;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
var _local6:Object = {type:_arg3, name:_arg1};
var _local7:Array = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7[_local7.length] = _local6.filter;
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa[_clrsa.length] = {f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)};
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[this.tweens.length] = [_local6.filter, _local9, _local6.filter[_local9], _local10, _arg1];
};
};
};
_local8++;
};
_filters[_filters.length] = _local6;
_hf = true;
return (_local6);
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenFilterLite)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 25
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
public var gc:Boolean;
protected var _isDisplayObject:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
protected var _specialVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.29;
public static var masterList:Dictionary = new Dictionary(false);
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((_arg1 is DisplayObject));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((((_local3 == "timeScale")) && (!((this.target is TweenLite))))))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number = _arg1.target.progress;
var _local4:Number = (1 - _local3);
var _local5:Object = _arg1.info.color;
var _local6:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local4:Array;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 26
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import gs.events.*;
import flash.utils.*;
public class TweenMax extends TweenFilterLite implements IEventDispatcher {
protected var _callbacks:Object;
protected var _dispatcher:EventDispatcher;
public var pauseTime:Number;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
public static var setGlobalTimeScale:Function = TweenFilterLite.setGlobalTimeScale;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 3.41;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
this.vars.persist = true;
};
if (TweenFilterLite.version < 9.29){
trace("TweenMax error! Please update your TweenFilterLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:Object;
var _local6:int;
var _local7:Object;
var _local8:Array;
var _local9:Array;
var _local4:Number = this.progress;
if (((!((this.vars[_arg1] == undefined))) && (this.initted))){
if (((!(_arg3)) && (!((_local4 == 0))))){
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
if (this.tweens[_local6][4] == _arg1){
this.tweens[_local6][0][this.tweens[_local6][1]] = this.tweens[_local6][2];
};
_local6--;
};
};
_local5 = {};
_local5[_arg1] = 1;
killVars(_local5);
};
this.vars[_arg1] = _arg2;
if (this.initted){
_local7 = this.vars;
_local8 = this.tweens;
_local9 = _subTweens;
this.vars = {};
this.tweens = [];
_subTweens = [];
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
this.vars = _local7;
this.tweens = _local8.concat(this.tweens);
_subTweens = _local9.concat(_subTweens);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Array;
var _local9:Number;
_arg2 = (_arg2 + " hexColors bezier bezierThrough shortRotation orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop onCompleteListener onUpdateListener onStartListener ");
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
var _local8:Function = bezierProxy;
if (this.vars.orientToBezier == true){
this.vars.orientToBezier = [["x", "y", "rotation", 0]];
_local8 = bezierProxy2;
} else {
if ((this.vars.orientToBezier is Array)){
_local8 = bezierProxy2;
};
};
if (((!((this.vars.bezier == undefined))) && ((this.vars.bezier is Array)))){
_local6 = {};
_local7 = this.vars.bezier;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezier", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, false), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (((!((this.vars.bezierThrough == undefined))) && ((this.vars.bezierThrough is Array)))){
_local6 = {};
_local7 = this.vars.bezierThrough;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezierThrough", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, true), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (!isNaN(this.vars.shortRotation)){
_local9 = ((this.vars.shortRotation - this.target.rotation) % 360);
if (((this.vars.shortRotation - this.target.rotation) % 360) != (_local9 % 180)){
_local9 = ((_local9)<0) ? (_local9 + 360) : (_local9 - 360);
};
this.tweens[this.tweens.length] = [this.target, "rotation", this.target.rotation, _local9, "rotation"];
};
if (((!((this.vars.hexColors == undefined))) && ((typeof(this.vars.hexColors) == "object")))){
for (_local3 in this.vars.hexColors) {
addSubTween("hexColors", hexColorsProxy, {r:(this.target[_local3] >> 16), g:((this.target[_local3] >> 8) & 0xFF), b:(this.target[_local3] & 0xFF)}, {r:(this.vars.hexColors[_local3] >> 16), g:((this.vars.hexColors[_local3] >> 8) & 0xFF), b:(this.vars.hexColors[_local3] & 0xFF)}, {prop:_local3, target:this.target});
};
};
super.initTweenVals(true, _arg2);
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
this.enabled = true;
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = (1 / (1 - this.ease((_local1 * this.duration), 0, 1, this.duration)));
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local3 = (_local4[2] + _local4[3]);
_local4[3] = ((_local3 - _local4[0][_local4[1]]) * _local2);
_local4[2] = (_local3 - _local4[3]);
_local5--;
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return ((this.startTime == 999999999999999));
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
if (this.vars[_arg1[_local3]] != null){
_local2[_arg1[_local3]] = 1;
};
_local3--;
};
killVars(_local2);
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
if (this.vars.yoyo == true){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_subTweens = [];
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function sequence(_arg1:Object, _arg2:Array):Array{
var _local3:uint;
while (_local3 < _arg2.length) {
_arg2[_local3].target = _arg1;
_local3++;
};
return (multiSequence(_arg2));
}
public static function bezierProxy(_arg1:Object, _arg2:Number=0):void{
var _local6:int;
var _local7:String;
var _local8:Object;
var _local9:Number;
var _local10:uint;
var _local3:Number = _arg1.target.t;
var _local4:Object = _arg1.info.props;
var _local5:Object = _arg1.info.target;
if (_local3 == 1){
for (_local7 in _local4) {
_local6 = (_local4[_local7].length - 1);
_local5[_local7] = _local4[_local7][_local6].e;
};
} else {
for (_local7 in _local4) {
_local10 = _local4[_local7].length;
if (_local3 < 0){
_local6 = 0;
} else {
if (_local3 >= 1){
_local6 = (_local10 - 1);
} else {
_local6 = int((_local10 * _local3));
};
};
_local9 = ((_local3 - (_local6 * (1 / _local10))) * _local10);
_local8 = _local4[_local7][_local6];
_local5[_local7] = (_local8.s + (_local9 * (((2 * (1 - _local9)) * (_local8.cp - _local8.s)) + (_local9 * (_local8.e - _local8.s)))));
};
};
}
public static function hexColorsProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target[_arg1.info.prop] = uint((((_arg1.target.r << 16) | (_arg1.target.g << 8)) | _arg1.target.b));
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = {s:_local4[0], cp:(_local4[1] - ((_local4[2] - _local4[0]) / 4)), e:_local4[1]};
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = {s:_local4[_local3], cp:(_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)].cp)), e:_local4[(_local3 + 1)]};
_local3++;
};
} else {
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:((_local4[1] + _local4[2]) / 2)};
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = {s:_local5[(_local3 - 2)].e, cp:_local4[_local3], e:((_local4[_local3] + _local4[(_local3 + 1)]) / 2)};
_local3++;
};
_local5[_local5.length] = {s:_local5[(_local5.length - 1)].e, cp:_local4[(_local4.length - 2)], e:_local4[(_local4.length - 1)]};
} else {
if (_local4.length == 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:_local4[2]};
} else {
if (_local4.length == 2){
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
};
};
};
return (_local7);
}
public static function bezierProxy2(_arg1:Object, _arg2:Number=0):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Number;
bezierProxy(_arg1, _arg2);
var _local3:Object = {};
var _local4:Object = _arg1.info.target;
_arg1.info.target = _local3;
_arg1.target.t = (_arg1.target.t + 0.01);
bezierProxy(_arg1);
var _local5:Array = _arg1.info.orientToBezier;
var _local11:uint;
while (_local11 < _local5.length) {
_local9 = _local5[_local11];
_local10 = ((_local9[3]) || (0));
_local7 = (_local3[_local9[0]] - _local4[_local9[0]]);
_local8 = (_local3[_local9[1]] - _local4[_local9[1]]);
_local4[_local9[2]] = ((Math.atan2(_local8, _local7) * _RAD2DEG) + _local10);
_local11++;
};
_arg1.info.target = _local4;
_arg1.target.t = (_arg1.target.t - 0.01);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function multiSequence(_arg1:Array):Array{
var _local6:Object;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:Object;
var _local12:String;
trace("WARNING: TweenMax.multiSequence() and TweenMax.sequence() have been deprecated in favor of the much more powerful and flexible TweenGroup class. See http://blog.greensock.com/tweengroup/ for more details. Future versions of TweenMax may not include sequence() and multiSequence() (to conserve file size).");
var _local2:Dictionary = new Dictionary();
var _local3:Array = [];
var _local4:int = TweenLite.overwriteManager.mode;
var _local5:Number = 0;
_local10 = 0;
while (_local10 < _arg1.length) {
_local6 = _arg1[_local10];
_local9 = ((_local6.time) || (0));
_local11 = {};
for (_local12 in _local6) {
_local11[_local12] = _local6[_local12];
};
delete _local11.time;
_local8 = ((_local11.delay) || (0));
_local11.delay = (_local5 + _local8);
_local7 = _local11.target;
delete _local11.target;
if (_local4 == 1){
if (_local2[_local7] == undefined){
_local2[_local7] = _local11;
} else {
_local11.overwrite = 2;
};
};
_local3[_local3.length] = new TweenMax(_local7, _local9, _local11);
_local5 = (_local5 + (_local9 + _local8));
_local10++;
};
return (_local3);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (!_local2[_local4].gc){
_local3[_local3.length] = _local2[_local4];
};
_local4--;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((_local2[_local3].active) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function callbackProxy(_arg1:Array, _arg2:Array=null):void{
var _local3:uint;
while (_local3 < _arg1.length) {
if (_arg1[_local3] != undefined){
_arg1[_local3].apply(null, _arg2[_local3]);
};
_local3++;
};
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object):Array{
_arg3.runBackwards = true;
return (allTo(_arg1, _arg2, _arg3));
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object):Array{
var _local4:int;
var _local5:Object;
var _local6:String;
var _local7:Number;
var _local8:Object;
trace("WARNING: TweenMax.allTo() and TweenMax.allFrom() have been deprecated in favor of the much more powerful and flexible TweenGroup class. See http://blog.greensock.com/tweengroup/ for more details. Future versions of TweenMax may not include allTo() and allFrom() (to conserve file size).");
if (_arg1.length == 0){
return ([]);
};
var _local9:Array = [];
var _local10:Number = ((_arg3.delayIncrement) || (0));
delete _arg3.delayIncrement;
if (_arg3.onCompleteAll == undefined){
_local8 = _arg3;
} else {
_local8 = {};
for (_local6 in _arg3) {
_local8[_local6] = _arg3[_local6];
};
_local8.onCompleteParams = [[_arg3.onComplete, _arg3.onCompleteAll], [_arg3.onCompleteParams, _arg3.onCompleteAllParams]];
_local8.onComplete = TweenMax.callbackProxy;
delete _arg3.onCompleteAll;
};
delete _arg3.onCompleteAllParams;
if (_local10 == 0){
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
} else {
_local7 = ((_arg3.delay) || (0));
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local5.delay = (_local7 + (_local4 * _local10));
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
_local8.delay = (_local7 + ((_arg1.length - 1) * _local10));
};
_local9[_local9.length] = new TweenMax(_arg1[(_arg1.length - 1)], _arg2, _local8);
if ((_arg3.onCompleteAllListener is Function)){
_local9[(_local9.length - 1)].addEventListener(TweenEvent.COMPLETE, _arg3.onCompleteAllListener);
};
return (_local9);
}
}
}//package gs
Section 27
//Chase (sections.lab.assets.egg.Chase)
package sections.lab.assets.egg {
import flash.events.*;
import gs.*;
import flash.geom.*;
import flash.media.*;
import flash.display.*;
import gs.easing.*;
import flash.utils.*;
import sections.lab.*;
public class Chase extends LabSection {
private var headBMD:BitmapData;
private var intTimer:Timer;
private var tempForce1:Point;
private var tempForce2:Point;
public var mouse:Point;
private var peckSoundChannel:SoundChannel;
private var orgasmSoundChannel:SoundChannel;
private var orgasmSound:Orgasm;
private var eggCursor:EggCursor;
public var bg:MovieClip;
private var isPeckPlaying:Boolean;// = false
private var cursorMove:Boolean;// = false
public var dude:Dude;
private var distanceComparison:uint;
public var dudeHeads:MovieClip;
public var dudeDTOs:Array;
public var dudes:MovieClip;
private var frame:Number;// = 0
private var pushForce:Point;
private var peckSound:Sound;
public function Chase(){
dudeDTOs = [];
tempForce1 = new Point();
tempForce2 = new Point();
pushForce = new Point();
mouse = new Point();
super();
}
override protected function initialize():void{
super.initialize();
this.headBMD = new HeadBMP(20, 20);
this.peckSound = new Peck();
this.peckSoundChannel = new SoundChannel();
this.eggCursor = new EggCursor();
this.cacheAsBitmap = true;
this.dudes = new MovieClip();
this.dudes.cacheAsBitmap = true;
this.dudeHeads = new MovieClip();
this.dudeHeads.cacheAsBitmap = true;
this.orgasmSound = new Orgasm();
this.orgasmSoundChannel = this.orgasmSound.play();
var _local1:SoundTransform = new SoundTransform();
_local1.volume = 0.5;
this.orgasmSoundChannel.soundTransform = _local1;
this.orgasmSoundChannel.addEventListener(Event.SOUND_COMPLETE, orgasmCompleteHandler, false, 0, true);
this.stageResizeHandler(new Event(Event.RESIZE));
}
override protected function stageResizeHandler(_arg1:Event):void{
this.bg.width = stage.stageWidth;
this.bg.height = stage.stageHeight;
}
override protected function render():void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:SoundTransform;
var _local6:Number;
this.mouse.x = stage.mouseX;
this.mouse.y = stage.mouseY;
this.eggCursor.update(this.mouse.x, this.mouse.y);
this.dudes.graphics.clear();
var _local1:Number = 0;
while (_local1 < this.dudeDTOs.length) {
_local2 = (_local1 + 1);
while (_local2 < this.dudeDTOs.length) {
distanceComparison = uint(Point.distance(this.dudeDTOs[_local1], this.dudeDTOs[_local2]));
tempForce1 = this.dudeDTOs[_local1].force;
tempForce2 = this.dudeDTOs[_local2].force;
if ((((distanceComparison < 15)) && (!(this.dudeDTOs[_local1].pecking)))){
this.dudeDTOs[_local1].force = Point.interpolate(tempForce2, this.dudeDTOs[_local1].force, 0.5);
this.dudeDTOs[_local2].force = Point.interpolate(tempForce1, this.dudeDTOs[_local2].force, 0.5);
this.dudeDTOs[_local1].force.normalize(tempForce1.length);
this.dudeDTOs[_local2].force.normalize(tempForce2.length);
if (distanceComparison < 15){
pushForce = this.dudeDTOs[_local1].subtract(this.dudeDTOs[_local2]);
pushForce.normalize(2);
this.dudeDTOs[_local1].impulse(pushForce);
pushForce.x = (pushForce.x * -1);
pushForce.y = (pushForce.y * -1);
this.dudeDTOs[_local2].impulse(pushForce);
} else {
if (distanceComparison < 17){
pushForce = this.dudeDTOs[_local2].subtract(this.dudeDTOs[_local1]);
pushForce.normalize(1);
this.dudeDTOs[_local1].impulse(pushForce);
pushForce.x = (pushForce.x * -1);
pushForce.y = (pushForce.y * -1);
this.dudeDTOs[_local2].impulse(pushForce);
};
};
};
_local2++;
};
distanceComparison = Point.distance(this.dudeDTOs[_local1], mouse);
if (distanceComparison <= 40){
_local3 = 1;
this.dudeDTOs[_local1].force.x = ((this.dudeDTOs[_local1].force.x * _local3) * -1);
this.dudeDTOs[_local1].force.y = ((this.dudeDTOs[_local1].force.y * _local3) * -1);
this.eggCursor.scaleY = (this.eggCursor.scaleX = ((this.eggCursor.scaleX == 1)) ? 0.9 : 1);
if (!this.isPeckPlaying){
this.isPeckPlaying = true;
_local5 = new SoundTransform();
_local6 = Math.floor((Math.random() * 2));
_local5.volume = (Math.random() * 0.2);
this.peckSoundChannel = this.peckSound.play();
this.peckSoundChannel.soundTransform = _local5;
this.peckSoundChannel.removeEventListener(Event.SOUND_COMPLETE, peckSoundCompleteHandler);
this.peckSoundChannel.addEventListener(Event.SOUND_COMPLETE, peckSoundCompleteHandler, false, 0, true);
};
_local4 = (0xFFFFFF * Math.random());
} else {
if (distanceComparison < 1200){
this.dudeDTOs[_local1].pecking = false;
pushForce = mouse.subtract(this.dudeDTOs[_local1]);
pushForce.normalize(0.5);
this.dudeDTOs[_local1].impulse(pushForce);
this.frame++;
};
};
Dude(this.dudeDTOs[_local1]).update();
if (this.dudeDTOs[_local1].x > stage.stageWidth){
this.dudeDTOs[_local1].x = stage.stageWidth;
if (this.dudeDTOs[_local1].force.x > 0){
this.dudeDTOs[_local1].force.x = (this.dudeDTOs[_local1].force.x * -1);
};
} else {
if (this.dudeDTOs[_local1].x < 0){
this.dudeDTOs[_local1].x = 0;
if (this.dudeDTOs[_local1].force.x < 0){
this.dudeDTOs[_local1].force.x = (this.dudeDTOs[_local1].force.x * -1);
};
};
};
if (this.dudeDTOs[_local1].y > stage.stageHeight){
this.dudeDTOs[_local1].y = stage.stageHeight;
if (this.dudeDTOs[_local1].force.y > 0){
this.dudeDTOs[_local1].force.y = (this.dudeDTOs[_local1].force.y * -1);
};
} else {
if (this.dudeDTOs[_local1].y < 0){
this.dudeDTOs[_local1].y = 0;
if (this.dudeDTOs[_local1].force.y < 0){
this.dudeDTOs[_local1].force.y = (this.dudeDTOs[_local1].force.y * -1);
};
};
};
_local1++;
};
this.dudes.graphics.clear();
_local1 = 0;
while (_local1 < this.dudeDTOs.length) {
_local4 = 0xFFFFFF;
this.dudes.graphics.lineStyle(1, _local4, 0.75);
TweenMax.to(this.dudes, 0, {glowFilter:{color:_local4, alpha:1, blurX:5, blurY:5}, overwrite:false});
this.dudes.graphics.moveTo(this.dudeDTOs[_local1].x, this.dudeDTOs[_local1].y);
this.dudeDTOs[_local1].draw();
_local1++;
};
this.cursorMove = false;
if (this.frame > this.dudeDTOs.length){
this.frame = 0;
};
}
private function addEgg():void{
var _local1:Sound = new EggSound();
_local1.play();
this.addChild(this.eggCursor);
this.eggCursor.update(this.mouse.x, this.mouse.y);
}
override public function resume():void{
if (!this.destroyed){
this.intTimer.removeEventListener(TimerEvent.TIMER, renderHandler);
this.intTimer.addEventListener(TimerEvent.TIMER, renderHandler, false, 0, true);
this.intTimer.start();
};
}
private function orgasmCompleteHandler(_arg1:Event):void{
this.createDudes();
this.addEgg();
this.intTimer = new Timer(14);
this.intTimer.addEventListener(TimerEvent.TIMER, renderHandler, false, 0, true);
this.intTimer.start();
}
public function draw(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
var _local4:Number = ((Math.floor((Math.random() * 2)) == 1)) ? 1 : -1;
var _local5:Number = (((Math.random() * 3) + 1) * _local4);
this.dudes.graphics.curveTo(_arg1, (_arg2 + _local5), _arg1, _arg2);
}
private function createDudes():void{
var _local3:Bitmap;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Dude;
var _local1:Sound = new Squish();
_local1.play();
this.addChild(this.dudes);
this.addChild(this.dudeHeads);
var _local2:Number = 0;
while (_local2 < 40) {
_local3 = new Bitmap(headBMD);
_local3.cacheAsBitmap = true;
_local4 = Math.floor((Math.random() * 4));
switch (_local4){
case 0:
_local5 = 0;
_local6 = (Math.random() * stage.stageHeight);
break;
case 1:
_local5 = stage.stageWidth;
_local6 = (Math.random() * stage.stageHeight);
break;
case 2:
_local5 = (Math.random() * stage.stageWidth);
_local6 = 0;
break;
case 3:
_local5 = (Math.random() * stage.stageWidth);
_local6 = stage.stageHeight;
break;
};
_local5 = 300;
_local6 = 300;
_local7 = new Dude(_local5, _local6, this);
_local7.head = new Head();
_local7.head.alpha = 0.5;
_local7.force.x = ((Math.random() * 5) - 2.5);
_local7.force.y = ((Math.random() * 5) - 2.5);
_local7.maxForce = 6;
_local7.minForce = 2;
_local7.friction = 0.98;
this.dudeHeads.addChild(_local7.head);
this.dudeHeads.alpha = 1;
this.dudeDTOs.push(_local7);
_local2++;
};
}
private function renderHandler(_arg1:TimerEvent):void{
this.render();
}
override public function pause():void{
super.pause();
if (this.intTimer){
this.intTimer.removeEventListener(TimerEvent.TIMER, renderHandler);
this.intTimer.stop();
this.intTimer.start();
};
}
override public function destroy():void{
this.intTimer.removeEventListener(TimerEvent.TIMER, renderHandler);
this.intTimer.stop();
this.orgasmSoundChannel.stop();
this.peckSoundChannel.stop();
}
private function peckSoundCompleteHandler(_arg1:Event):void{
this.isPeckPlaying = false;
}
}
}//package sections.lab.assets.egg
Section 28
//Dude (sections.lab.assets.egg.Dude)
package sections.lab.assets.egg {
import flash.geom.*;
import flash.display.*;
public class Dude extends Flocker {
public var head:MovieClip;
public var points:Array;
public var pecking:Boolean;// = false
public var asset:MovieClip;
private var spread:Number;// = 4
private var space:Number;
private var pointLength:Number;
public var canvas:Chase;
private var sDir:Number;// = -1
public function Dude(_arg1:Number, _arg2:Number, _arg3:Chase){
points = [];
super(_arg1, _arg2);
this.pointLength = ((Math.random() * 7) + 3);
this.canvas = _arg3;
this.create(_arg1, _arg2);
}
public function draw():void{
var _local1:Point;
var _local2:Point = new Point(this.points[(this.points.length - 1)].x, this.points[(this.points.length - 1)].y);
_local1 = new Point(this.points[(this.points.length - 2)].x, this.points[(this.points.length - 2)].y);
var _local3:int = (_local2.x - _local1.x);
var _local4:int = ((_local2.y - _local1.y) * -1);
var _local5:Number = (Math.atan((_local4 / _local3)) / (Math.PI / 180));
if (_local3 < 0){
_local5 = (_local5 + 180);
};
if ((((_local3 >= 0)) && ((_local4 < 0)))){
_local5 = (_local5 + 360);
};
this.head.x = this.points[(this.points.length - 1)].x;
this.head.y = this.points[(this.points.length - 1)].y;
this.head.rotation = (_local5 * -1);
var _local6:Number = (this.points.length - 1);
while (_local6 >= 0) {
this.canvas.draw(this.points[_local6].x, this.points[_local6].y, _local6);
_local6--;
};
}
override public function update():void{
var _local1:Number;
if (!this.pecking){
super.update();
_local1 = 1;
while (_local1 < this.points.length) {
this.points[(_local1 - 1)].x = this.points[_local1].x;
this.points[(_local1 - 1)].y = this.points[_local1].y;
_local1++;
};
this.points[(this.points.length - 1)].x = x;
this.points[(this.points.length - 1)].y = y;
};
}
private function create(_arg1:Number, _arg2:Number):void{
var _local3:Number = _arg1;
var _local4:Number = _arg2;
var _local5:Number = 0;
while (_local5 < this.pointLength) {
this.points.unshift(new Point(_local3, _local4));
_local5++;
};
}
}
}//package sections.lab.assets.egg
Section 29
//EggCursor (sections.lab.assets.egg.EggCursor)
package sections.lab.assets.egg {
import cartelle.core.*;
import gs.*;
import flash.display.*;
import gs.easing.*;
public class EggCursor extends View {
public var deltaY:Number;
public var deltaX:Number;
public var asset:MovieClip;
private var oldX:Number;
private var oldY:Number;
public var cursorMove:Boolean;// = false
public static var CURSOR_MOVE:String = "cursorMove";
override protected function initialize():void{
TweenMax.to(this, 0.3, {scaleX:1, scaleY:1, ease:Back.easeOut, alpha:1, glowFilter:{color:0xFFFFFF, alpha:0.5, blurX:10, blurY:10}});
this.scaleX = (this.scaleY = 0);
this.alpha = 0;
this.rotation = 0;
}
public function update(_arg1:Number, _arg2:Number):void{
if ((((Math.abs(deltaX) < 2)) && ((Math.abs(deltaY) < 2)))){
cursorMove = false;
} else {
cursorMove = true;
};
deltaX = (this.oldX - _arg1);
deltaY = (this.oldY - _arg2);
var _local3:Number = (Math.abs(deltaX) / 120);
var _local4:Number = (Math.abs(deltaY) / 120);
var _local5:Number = (1 - Math.max(_local3, _local4));
TweenMax.to(this, 0.2, {x:_arg1, y:_arg2, scaleX:_local5, scaleY:_local5, alpha:1});
this.oldX = _arg1;
this.oldY = _arg2;
}
}
}//package sections.lab.assets.egg
Section 30
//Flocker (sections.lab.assets.egg.Flocker)
package sections.lab.assets.egg {
public class Flocker extends Mass {
var _maxForce:Number;// = 5
var _minForce:Number;// = 0
public function Flocker(_arg1:Number=0, _arg2:Number=0):void{
super(_arg1, _arg2);
}
override public function update():void{
if (force.length < _maxForce){
force.normalize((force.length * 1.01));
};
if (force.length > _maxForce){
force.normalize(_maxForce);
};
if (force.length < _minForce){
force.normalize(_minForce);
};
super.update();
}
public function set minForce(_arg1:Number){
_minForce = _arg1;
}
public function get maxForce(){
return (_maxForce);
}
public function get minForce(){
return (_minForce);
}
public function set maxForce(_arg1:Number){
_maxForce = _arg1;
}
}
}//package sections.lab.assets.egg
Section 31
//Mass (sections.lab.assets.egg.Mass)
package sections.lab.assets.egg {
import flash.geom.*;
public class Mass extends Point {
var _friction:Number;// = 1
public var force:Point;
public function Mass(_arg1:Number=0, _arg2:Number=0):void{
force = new Point();
super(_arg1, _arg2);
}
public function set friction(_arg1:Number):void{
_friction = _arg1;
}
public function impulse(_arg1:Point):void{
force.x = (force.x + _arg1.x);
force.y = (force.y + _arg1.y);
}
public function update():void{
force.x = (force.x * _friction);
force.y = (force.y * _friction);
x = (x + force.x);
y = (y + force.y);
}
public function get friction():Number{
return (_friction);
}
}
}//package sections.lab.assets.egg
Section 32
//LabSection (sections.lab.LabSection)
package sections.lab {
import gs.*;
import gs.easing.*;
import sections.*;
public class LabSection extends CartelleSection {
public var destroyed:Boolean;// = false
private var _tintColor:Number;// = 0
override public function destroy():void{
super.destroy();
this.destroyed = true;
}
public function get tintColor():Number{
return (this._tintColor);
}
override protected function initialize():void{
super.initialize();
}
private function tintComplete():void{
this.transitionInComplete();
}
public function set tintColor(_arg1:Number):void{
this._tintColor = _arg1;
}
override public function transitionIn():void{
TweenFilterLite.to(this, 0, {tint:this.tintColor});
TweenFilterLite.to(this, 1.2, {removeTint:true, onComplete:tintComplete, ease:Quad.easeIn});
}
override protected function standAloneSWF():void{
}
}
}//package sections.lab
Section 33
//MenuEvent (sections.navigation.events.MenuEvent)
package sections.navigation.events {
import flash.events.*;
public class MenuEvent extends Event {
public static var CLOSE_COMPLETE:String = "menuCloseComplete";
public static var MENU_UNLOCK:String = "menuUnLock";
public static var OPEN:String = "menuOpen";
public static var MENU_LOCK:String = "menuLock";
public static var OPEN_COMPLETE:String = "menuOpenComplete";
public static var CLOSE:String = "menuClose";
public function MenuEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new MenuEvent(type, bubbles, cancelable));
}
}
}//package sections.navigation.events
Section 34
//MenuItemEvent (sections.navigation.events.MenuItemEvent)
package sections.navigation.events {
import flash.events.*;
import sections.navigation.*;
public class MenuItemEvent extends Event {
public var menuItem:MenuItem;
public static var SELECT:String = "menuItemSelect";
public function MenuItemEvent(_arg1:String, _arg2:MenuItem, _arg3:Boolean=false, _arg4:Boolean=false){
this.menuItem = _arg2;
super(_arg1, _arg3, _arg4);
}
override public function clone():Event{
return (new MenuItemEvent(type, this.menuItem, bubbles, cancelable));
}
}
}//package sections.navigation.events
Section 35
//MenuItem (sections.navigation.MenuItem)
package sections.navigation {
import cartelle.core.*;
import flash.events.*;
import gs.*;
import flash.text.*;
import flash.media.*;
import flash.display.*;
import sections.navigation.events.*;
import cartelle.text.*;
public class MenuItem extends View {
public var bg:MovieClip;
public var contentURL:String;
public var index:Number;
public var title:String;
public var overBG:MovieClip;
public var imageClip:MovieClip;
public var id:String;
public var textBMP:MovieClip;
public var abbrev:Boolean;// = false
public var color:Number;
public var imageMask:MovieClip;
public var body:String;
private var selected:Boolean;// = false
private var tickSound:Sound;
public var contentId:String;
public var textClips:MovieClip;
public var disabled:String;
public function disable():void{
this.mouseEnabled = false;
}
override public function destroy():void{
this.removeEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
this.removeEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
this.removeEventListener(MouseEvent.CLICK, mouseClickHandler);
this.image.bitmapData.dispose();
super.destroy();
}
public function enable():void{
if (!this.selected){
this.mouseEnabled = true;
};
}
public function get image():Bitmap{
return (Bitmap(this.imageClip.getChildAt(0)));
}
public function deselect():void{
this.selected = false;
this.mouseEnabled = true;
TweenFilterLite.to(this.overBG, 0, {tint:0xFFFFFF, overwrite:false});
}
override protected function initialize():void{
var _local2:Number;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:String;
this.mouseChildren = false;
this.buttonMode = true;
var _local1:TextFormat = new TextFormat();
_local1.font = FormatManager.getFont("GaramondBold").fontName;
this.textClips.titleText.defaultTextFormat = _local1;
this.textClips.titleText.embedFonts = true;
this.textClips.titleText.autoSize = "left";
this.textClips.titleText.text = this.title.toUpperCase();
_local1.font = FormatManager.getFont("HelvHeavy").fontName;
this.textClips.bodyText.defaultTextFormat = _local1;
this.textClips.bodyText.embedFonts = true;
this.textClips.bodyText.y = (this.textClips.titleText.height + 14);
this.textClips.bodyText.height = ((this.textClips.titleText.numLines == 2)) ? 55 : 65;
this.textClips.bodyText.text = this.body;
if (abbrev){
_local2 = ((this.textClips.titleText.numLines == 2)) ? 4 : 6;
_local3 = TextField(this.textClips.bodyText).getLineText(_local2);
_local4 = [];
_local5 = 0;
while (_local5 < _local3.length) {
if (_local3.charAt(_local5) == " "){
_local4.push(_local5);
};
_local5++;
};
_local6 = (_local3.substr(0, _local4[(_local4.length - 2)]) + "... \n");
TextField(this.textClips.bodyText).replaceText(body.indexOf(_local3), (body.indexOf(_local3) + _local3.length), _local6);
trace(_local3);
};
this.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler, false, 0, true);
this.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseClickHandler, false, 0, true);
this.tickSound = new TickSound();
}
private function doMouseOut():void{
this.textClips.titleText.textColor = 0x212121;
this.textClips.bodyText.textColor = 0x7E7E7E;
TweenFilterLite.to(this.overBG, 0, {removeTint:true});
}
private function doMouseOver():void{
TweenFilterLite.to(this.overBG, 0, {tint:0});
this.textClips.titleText.textColor = 0xFFFFFF;
this.textClips.bodyText.textColor = 0xFFFFFF;
this.tickSound.play();
}
public function select():void{
this.selected = true;
this.mouseEnabled = false;
this.textClips.titleText.textColor = 0x212121;
this.textClips.bodyText.textColor = 0x7E7E7E;
TweenFilterLite.to(this.overBG, 0, {tint:0xEEEEEE});
}
private function mouseOutHandler(_arg1:MouseEvent):void{
if (this.mouseEnabled){
this.doMouseOut();
};
}
private function mouseClickHandler(_arg1:MouseEvent):void{
if (this.disabled != "true"){
dispatchEvent(new MenuItemEvent(MenuItemEvent.SELECT, this));
};
}
private function mouseOverHandler(_arg1:MouseEvent):void{
this.doMouseOver();
}
public function set image(_arg1:Bitmap):void{
_arg1.pixelSnapping = PixelSnapping.NEVER;
this.imageClip.addChild(_arg1);
this.imageClip.mask = this.imageMask;
}
override public function toString():String{
return (this.id);
}
}
}//package sections.navigation
Section 36
//TickSound (sections.navigation.TickSound)
package sections.navigation {
import flash.media.*;
public class TickSound extends Sound {
}
}//package sections.navigation
Section 37
//CartelleSection (sections.CartelleSection)
package sections {
import cartelle.loading.*;
import cartelle.core.*;
import flash.events.*;
import sections.navigation.*;
import flash.display.*;
import sections.navigation.events.*;
import cartelle.core.events.*;
public class CartelleSection extends Section {
public function CartelleSection():void{
}
override protected function initialize():void{
trace(("init " + this));
stage.addEventListener(Event.RESIZE, stageResizeHandler, false, 0, true);
}
protected function transitionOutComplete():void{
dispatchEvent(new SectionEvent(SectionEvent.TRANSITION_OUT_COMPLETE));
}
protected function transitionInComplete():void{
dispatchEvent(new SectionEvent(SectionEvent.TRANSITION_IN_COMPLETE));
}
override public function destroy():void{
super.destroy();
}
public function menuCloseCompleteHandler(_arg1:MenuEvent):void{
}
override public function transitionOut():void{
this.visible = false;
transitionOutComplete();
}
override public function transitionIn():void{
this.visible = true;
transitionInComplete();
}
public function handleSWFAddress(_arg1:SWFAddressEvent):void{
}
override protected function standAloneSWF():void{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.frameRate = 30;
AssetPackManager.defineDriver("data/global_config.xml", "appInit", this);
}
public function menuItemSelect(_arg1:MenuItem):void{
}
}
}//package sections
Section 38
//EggSound (EggSound)
package {
import flash.media.*;
public dynamic class EggSound extends Sound {
}
}//package
Section 39
//Head (Head)
package {
import flash.display.*;
public dynamic class Head extends MovieClip {
}
}//package
Section 40
//HeadBMP (HeadBMP)
package {
import flash.display.*;
public dynamic class HeadBMP extends BitmapData {
public function HeadBMP(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 41
//Orgasm (Orgasm)
package {
import flash.media.*;
public dynamic class Orgasm extends Sound {
}
}//package
Section 42
//Peck (Peck)
package {
import flash.media.*;
public dynamic class Peck extends Sound {
}
}//package
Section 43
//Squish (Squish)
package {
import flash.media.*;
public dynamic class Squish extends Sound {
}
}//package
Section 44
//SWFAddress (SWFAddress)
package {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.external.*;
import flash.system.*;
import flash.errors.*;
public class SWFAddress {
public static var onInit:Function;
private static var _initializer:Boolean = _initialize();
private static var _availability:Boolean = ExternalInterface.available;
private static var _timer:Timer = null;
private static var _dispatcher:EventDispatcher = new EventDispatcher();
private static var _strict:Boolean = true;
private static var _value:String = "";
public static var onChange:Function;
private static var _init:Boolean = false;
private static var _initChange:Boolean = false;
public function SWFAddress(){
throw (new IllegalOperationError("SWFAddress cannot be instantiated."));
}
private static function _strictCheck(_arg1:String, _arg2:Boolean):String{
if (SWFAddress.getStrict()){
if (_arg2){
if (_arg1.substr(0, 1) != "/"){
_arg1 = ("/" + _arg1);
};
} else {
if (_arg1 == ""){
_arg1 = "/";
};
};
};
return (_arg1);
}
public static function getTracker():String{
return ((_availability) ? (ExternalInterface.call("SWFAddress.getTracker") as String) : "");
}
public static function hasEventListener(_arg1:String):Boolean{
return (_dispatcher.hasEventListener(_arg1));
}
private static function _check(_arg1:TimerEvent):void{
if ((((((typeof(SWFAddress["onInit"]) == "function")) || (_dispatcher.hasEventListener("init")))) && (!(_init)))){
SWFAddress._setValueInit(_getValue());
SWFAddress._init = true;
};
if ((((typeof(SWFAddress["onChange"]) == "function")) || (_dispatcher.hasEventListener("change")))){
_timer.stop();
SWFAddress._init = true;
SWFAddress._setValueInit(_getValue());
};
}
private static function _setValue(_arg1:String):void{
if ((((_arg1 == "undefined")) || ((_arg1 == null)))){
_arg1 = "";
};
if ((((SWFAddress._value == _arg1)) && (SWFAddress._init))){
return;
};
if (!SWFAddress._initChange){
return;
};
SWFAddress._value = _arg1;
if (!_init){
SWFAddress._init = true;
if ((((typeof(SWFAddress["onInit"]) == "function")) || (_dispatcher.hasEventListener("init")))){
_dispatchEvent(SWFAddressEvent.INIT);
};
};
_dispatchEvent(SWFAddressEvent.CHANGE);
}
public static function getParameterNames():Array{
var _local4:Array;
var _local5:Number;
var _local1:String = SWFAddress.getValue();
var _local2:Number = _local1.indexOf("?");
var _local3:Array = new Array();
if (_local2 != -1){
_local1 = _local1.substr((_local2 + 1));
if (((!((_local1 == ""))) && (!((_local1.indexOf("=") == -1))))){
_local4 = _local1.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local3.push(_local4[_local5].split("=")[0]);
_local5++;
};
};
};
return (_local3);
}
public static function setTitle(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setTitle", _arg1);
};
}
private static function _getValue():String{
var _local1:String;
var _local3:Array;
var _local2:String;
if (_availability){
_local1 = (ExternalInterface.call("SWFAddress.getValue") as String);
_local3 = (ExternalInterface.call("SWFAddress.getIds") as Array);
if (_local3 != null){
_local2 = _local3.toString();
};
};
if ((((_local2 == null)) || (!(_availability)))){
_local1 = SWFAddress._value;
} else {
if ((((_local1 == "undefined")) || ((_local1 == null)))){
_local1 = "";
};
};
return (_strictCheck(((_local1) || ("")), false));
}
public static function up():void{
var _local1:String = SWFAddress.getPath();
SWFAddress.setValue(_local1.substr(0, (_local1.lastIndexOf("/", (_local1.length - 2)) + ((_local1.substr((_local1.length - 1)) == "/")) ? 1 : 0)));
}
public static function resetStatus():void{
if (_availability){
ExternalInterface.call("SWFAddress.resetStatus");
};
}
public static function getBaseURL():String{
var _local1:String;
if (_availability){
_local1 = String(ExternalInterface.call("SWFAddress.getBaseURL"));
};
return (((((((_local1 == null)) || ((_local1 == "null")))) || (!(_availability)))) ? "" : _local1);
}
public static function getTitle():String{
var _local1:String = (_availability) ? (ExternalInterface.call("SWFAddress.getTitle") as String) : "";
if ((((_local1 == "undefined")) || ((_local1 == null)))){
_local1 = "";
};
return (_local1);
}
public static function getPath():String{
var _local1:String = SWFAddress.getValue();
if (_local1.indexOf("?") != -1){
return (_local1.split("?")[0]);
};
return (_local1);
}
public static function href(_arg1:String, _arg2:String="_self"):void{
if (((_availability) && ((Capabilities.playerType == "ActiveX")))){
ExternalInterface.call("SWFAddress.href", _arg1, _arg2);
return;
};
navigateToURL(new URLRequest(_arg1), _arg2);
}
public static function popup(_arg1:String, _arg2:String="popup", _arg3:String="""", _arg4:String=""):void{
if (((_availability) && ((((Capabilities.playerType == "ActiveX")) || (ExternalInterface.call("asual.util.Browser.isSafari")))))){
ExternalInterface.call("SWFAddress.popup", _arg1, _arg2, _arg3, _arg4);
return;
};
navigateToURL(new URLRequest((((((((("javascript:popup=window.open(\"" + _arg1) + "\",\"") + _arg2) + "\",") + _arg3) + ");") + _arg4) + ";void(0);")), "_self");
}
private static function _initialize():Boolean{
if (_availability){
ExternalInterface.addCallback("getSWFAddressValue", function ():String{
return (_value);
});
ExternalInterface.addCallback("setSWFAddressValue", _setValue);
};
if (_timer == null){
_timer = new Timer(10);
_timer.addEventListener(TimerEvent.TIMER, _check);
};
_timer.start();
return (true);
}
public static function setValue(_arg1:String):void{
if ((((_arg1 == "undefined")) || ((_arg1 == null)))){
_arg1 = "";
};
_arg1 = _strictCheck(_arg1, true);
if (SWFAddress._value == _arg1){
return;
};
SWFAddress._value = _arg1;
if (((_availability) && (SWFAddress._init))){
ExternalInterface.call("SWFAddress.setValue", _arg1);
};
_dispatchEvent(SWFAddressEvent.CHANGE);
}
public static function getValue():String{
return (_strictCheck(((_value) || ("")), false));
}
private static function _setValueInit(_arg1:String):void{
SWFAddress._value = _arg1;
if (!_init){
_dispatchEvent(SWFAddressEvent.INIT);
} else {
_dispatchEvent(SWFAddressEvent.CHANGE);
};
_initChange = true;
}
public static function getStrict():Boolean{
var _local1:String;
if (_availability){
_local1 = (ExternalInterface.call("SWFAddress.getStrict") as String);
};
return (((_local1)==null) ? _strict : (_local1 == "true"));
}
public static function dispatchEvent(_arg1:Event):Boolean{
return (_dispatcher.dispatchEvent(_arg1));
}
private static function _dispatchEvent(_arg1:String):void{
if (_dispatcher.hasEventListener(_arg1)){
_dispatcher.dispatchEvent(new SWFAddressEvent(_arg1));
};
_arg1 = (_arg1.substr(0, 1).toUpperCase() + _arg1.substring(1));
if (typeof(SWFAddress[("on" + _arg1)]) == "function"){
var _local2 = SWFAddress;
_local2[("on" + _arg1)]();
};
}
public static function getQueryString():String{
var _local1:String = SWFAddress.getValue();
var _local2:Number = _local1.indexOf("?");
if (((!((_local2 == -1))) && ((_local2 < _local1.length)))){
return (_local1.substr((_local2 + 1)));
};
return ("");
}
public static function forward():void{
if (_availability){
ExternalInterface.call("SWFAddress.forward");
};
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2, false);
}
public static function setStrict(_arg1:Boolean):void{
if (_availability){
ExternalInterface.call("SWFAddress.setStrict", _arg1);
};
_strict = _arg1;
}
public static function setHistory(_arg1:Boolean):void{
if (_availability){
ExternalInterface.call("SWFAddress.setHistory", _arg1);
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function getHistory():Boolean{
return ((_availability) ? (ExternalInterface.call("SWFAddress.getHistory") as Boolean) : false);
}
public static function back():void{
if (_availability){
ExternalInterface.call("SWFAddress.back");
};
}
public static function getStatus():String{
var _local1:String = (_availability) ? (ExternalInterface.call("SWFAddress.getStatus") as String) : "";
if ((((_local1 == "undefined")) || ((_local1 == null)))){
_local1 = "";
};
return (_local1);
}
public static function getParameter(_arg1:String):String{
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local2:String = SWFAddress.getValue();
var _local3:Number = _local2.indexOf("?");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 1));
_local4 = _local2.split("&");
_local6 = _local4.length;
while (_local6--) {
_local5 = _local4[_local6].split("=");
if (_local5[0] == _arg1){
return (_local5[1]);
};
};
};
return ("");
}
public static function setStatus(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setStatus", _arg1);
};
}
public static function go(_arg1:int):void{
if (_availability){
ExternalInterface.call("SWFAddress.go", _arg1);
};
}
public static function getPathNames():Array{
var _local1:String = SWFAddress.getPath();
var _local2:Array = _local1.split("/");
if ((((_local1.substr(0, 1) == "/")) || ((_local1.length == 0)))){
_local2.splice(0, 1);
};
if (_local1.substr((_local1.length - 1), 1) == "/"){
_local2.splice((_local2.length - 1), 1);
};
return (_local2);
}
public static function setTracker(_arg1:String):void{
if (_availability){
ExternalInterface.call("SWFAddress.setTracker", _arg1);
};
}
}
}//package
Section 45
//SWFAddressEvent (SWFAddressEvent)
package {
import flash.events.*;
public class SWFAddressEvent extends Event {
private var _pathNames:Array;
private var _parameters:Object;
private var _path:String;
private var _value:String;
private var _parametersNames:Array;
public static const INIT:String = "init";
public static const CHANGE:String = "change";
public function SWFAddressEvent(_arg1:String){
super(_arg1, false, false);
}
public function get parameters():Object{
var _local1:int;
if (_parameters == null){
_parameters = new Object();
_local1 = 0;
while (_local1 < parametersNames.length) {
_parameters[parametersNames[_local1]] = SWFAddress.getParameter(parametersNames[_local1]);
_local1++;
};
};
return (_parameters);
}
public function get pathNames():Array{
if (_pathNames == null){
_pathNames = SWFAddress.getPathNames();
};
return (_pathNames);
}
public function get path():String{
if (_path == null){
_path = SWFAddress.getPath();
};
return (_path);
}
override public function get currentTarget():Object{
return (SWFAddress);
}
override public function toString():String{
return (formatToString("SWFAddressEvent", "type", "bubbles", "cancelable", "eventPhase", "value", "path", "pathNames", "parameters", "parametersNames"));
}
public function get parametersNames():Array{
if (_parametersNames == null){
_parametersNames = SWFAddress.getParameterNames();
};
return (_parametersNames);
}
override public function get target():Object{
return (SWFAddress);
}
public function get value():String{
if (_value == null){
_value = SWFAddress.getValue();
};
return (_value);
}
override public function get type():String{
return (super.type);
}
override public function clone():Event{
return (new SWFAddressEvent(type));
}
}
}//package
Section 46
//TailMask (TailMask)
package {
import flash.display.*;
public dynamic class TailMask extends MovieClip {
}
}//package