Section 1
//Background (com.gamezhero.api.as3.gui.Background)
package com.gamezhero.api.as3.gui {
import flash.display.*;
public class Background extends MovieClip {
private var _goal:MovieClip;
private var _bg:MovieClip;
public function Background(g:MovieClip){
super();
_goal = g;
_goal.addChild(this);
ini();
iniEvents();
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function clearEvents():void{
}
public function update(w:Number, h:Number):void{
this.x = 0;
this.y = 0;
this.width = (w + 100);
this.height = (h + 100);
}
private function getBg():MovieClip{
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0, 1);
mc.graphics.lineStyle(0, 0, 0);
mc.graphics.moveTo(0, 0);
mc.graphics.lineTo(1000, 0);
mc.graphics.lineTo(1000, 1000);
mc.graphics.lineTo(0, 1000);
mc.graphics.lineTo(0, 0);
mc.graphics.endFill();
return (mc);
}
private function ini():void{
_bg = getBg();
this.addChild(_bg);
}
private function iniEvents():void{
}
}
}//package com.gamezhero.api.as3.gui
Section 2
//Indicator (com.gamezhero.api.as3.gui.Indicator)
package com.gamezhero.api.as3.gui {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
public class Indicator extends MovieClip {
private var _timer:Timer;
private var _goal:MovieClip;
private var _indicator:MovieClip;
private var _dalpha:Number;
private var _info_text:TextField;
private var _arr:Array;
private var _n:uint;// = 10
private var _timer_2:Timer;
private var _current:Number;// = 0
public function Indicator(g:MovieClip){
_dalpha = (360 / _n);
_arr = new Array();
super();
_goal = g;
_goal.addChild(this);
ini();
iniEvents();
}
public function setSize(w:Number, h:Number):void{
this.visible = true;
this.width = w;
this.height = h;
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function getItem():MovieClip{
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFFFFFF, 1);
mc.graphics.lineStyle(0, 0, 0);
mc.graphics.moveTo(32.3, -5.7);
mc.graphics.curveTo(30, -3.3, 30, 0);
mc.graphics.curveTo(30, 3.3, 32.3, 5.6);
mc.graphics.curveTo(34.7, 8, 38.05, 8);
mc.graphics.lineTo(57, 8);
mc.graphics.curveTo(60.3, 8, 62.6, 5.6);
mc.graphics.curveTo(65, 3.3, 65, 0);
mc.graphics.curveTo(65, -3.3, 62.6, -5.7);
mc.graphics.curveTo(60.3, -8, 57, -8);
mc.graphics.lineTo(38.05, -8);
mc.graphics.curveTo(34.7, -8, 32.3, -5.7);
mc.graphics.endFill();
_indicator.addChild(mc);
return (mc);
}
private function clearEvents():void{
_timer.removeEventListener(TimerEvent.TIMER, updateIndicator);
_timer_2.removeEventListener(TimerEvent.TIMER, updateCurrent);
}
public function setPos(x:Number, y:Number):void{
this.visible = true;
this.x = x;
this.y = y;
}
private function updateIndicator(event:TimerEvent=null):void{
var i:uint;
while (i < _n) {
_arr[i].alpha = (_arr[i].alpha - 0.07);
if (_arr[i].alpha <= 0){
_arr[i].alpha = 0;
};
i++;
};
event.updateAfterEvent();
}
public function createInfoText():void{
_info_text = new TextField();
var fontFormat:TextFormat = new TextFormat();
fontFormat.color = 0xFFFFFF;
fontFormat.size = 11;
fontFormat.font = "Arial";
_info_text.defaultTextFormat = fontFormat;
_info_text.autoSize = TextFieldAutoSize.CENTER;
_indicator.addChild(_info_text);
var w:Number = 100;
var h:Number = 20;
w = _info_text.width;
h = _info_text.height;
_info_text.x = (-(w) / 2);
_info_text.y = -10;
}
public function update(w:Number, h:Number):void{
this.visible = true;
this.x = (w / 2);
this.y = (h / 2);
}
private function iniEvents():void{
_timer.addEventListener(TimerEvent.TIMER, updateIndicator);
_timer.start();
_timer_2.addEventListener(TimerEvent.TIMER, updateCurrent);
_timer_2.start();
}
public function setVal(val:String):void{
_info_text.text = val;
}
private function getBorder():MovieClip{
var cr:Number = 10;
var boxWidth:Number = 150;
var boxHeight:Number = 150;
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0x333333, 1);
mc.graphics.moveTo(cr, 0);
mc.graphics.lineTo((boxWidth - cr), 0);
mc.graphics.curveTo(boxWidth, 0, boxWidth, cr);
mc.graphics.lineTo(boxWidth, cr);
mc.graphics.lineTo(boxWidth, (boxHeight - cr));
mc.graphics.curveTo(boxWidth, boxHeight, (boxWidth - cr), boxHeight);
mc.graphics.lineTo((boxWidth - cr), boxHeight);
mc.graphics.lineTo(cr, boxHeight);
mc.graphics.curveTo(0, boxHeight, 0, (boxHeight - cr));
mc.graphics.lineTo(0, (boxHeight - cr));
mc.graphics.lineTo(0, cr);
mc.graphics.curveTo(0, 0, cr, 0);
mc.graphics.lineTo(cr, 0);
mc.graphics.endFill();
_indicator.addChild(mc);
mc.x = (-(mc.width) / 2);
mc.y = (-(mc.height) / 2);
return (mc);
}
private function ini():void{
var fooMc:MovieClip;
this.visible = false;
_timer = new Timer((1000 / 40), 0);
_timer_2 = new Timer((1000 / 20), 0);
_indicator = new MovieClip();
this.addChild(_indicator);
getBorder();
var i:uint;
while (i < _n) {
fooMc = getItem();
fooMc.rotation = (_dalpha * i);
fooMc.alpha = 0.2;
_arr.push(fooMc);
i++;
};
createInfoText();
}
private function updateCurrent(event:TimerEvent=null):void{
_current++;
if (_current >= _arr.length){
_current = 0;
};
_arr[_current].alpha = 1;
event.updateAfterEvent();
}
}
}//package com.gamezhero.api.as3.gui
Section 3
//URL (com.gamezhero.api.as3.utils.URL)
package com.gamezhero.api.as3.utils {
public class URL {
private var _scheme:String;
private var _host:String;
private var _query:String;
private var _path:String;
private var _userinfo:String;
private var _port:String;
private var _url:String;
private var _fragment:String;
private static const PATTERN:RegExp = /^([A-Za-z0-9_+.]{1,8}:\/\/)?([!-~]+@)?([^\/?#:]*)(:[0-9]*)?(\/[^?#]*)?(\?[^#]*)?(\#.*)?/i;
public function URL(url:String):void{
super();
var result:Array = url.match(URL.PATTERN);
_url = result[0];
_scheme = result[1];
_userinfo = result[2];
_host = result[3];
_port = result[4];
_path = result[5];
_query = result[6];
_fragment = result[7];
}
public function get port():int{
return (((_port.length <= 0)) ? undefined : int(_port.substring(1, _port.length)));
}
public function get fragment():String{
return (((_fragment.length <= 0)) ? undefined : _fragment);
}
public function get query():Object{
var _parse:String;
var _intovars:Array;
var i:int;
var _kv:Array;
var ret:Object = {raw:undefined, parsed:undefined};
if (((_query) && ((_query.length > 0)))){
ret.raw = _query;
_parse = _query.substring(1, _query.length);
_intovars = _parse.split("&");
ret.parsed = ((_intovars.length > 0)) ? {} : undefined;
i = 0;
while (i < _intovars.length) {
_kv = _intovars[i].split("=");
ret.parsed[_kv[0]] = _kv[1];
i++;
};
};
return (ret);
}
public function get scheme():String{
return (((_scheme.length <= 0)) ? undefined : _scheme.substring(0, (_scheme.length - 3)));
}
public function get host():String{
return (((_host.length <= 0)) ? undefined : _host);
}
public function get path():String{
return (((_path.length <= 0)) ? undefined : _path);
}
public function get url():String{
return (((_url.length <= 0)) ? undefined : _url);
}
public function get userinfo():Object{
var arr:Array;
var ret:Object = {user:undefined, pass:undefined};
if (_userinfo){
arr = _userinfo.substring(0, (_userinfo.length - 1)).split(":");
ret.user = (arr[0]) ? arr[0] : ret.user;
ret.pass = (arr[1]) ? arr[1] : ret.pas;
};
return (ret);
}
}
}//package com.gamezhero.api.as3.utils
Section 4
//GamePreloader (com.gamezhero.api.as3.GamePreloader)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import com.google.analytics.*;
import com.gamezhero.api.as3.gui.*;
import flash.ui.*;
public class GamePreloader extends MovieClip {
private var _indicator:Indicator;
private var _obj_listener_preloader:Object;
private var _gamezhero_code_preloader:Number;
private var _quality_old:String;
private var _rate_old:Number;
private var _send_name_connection_preloader:String;
private var _recived_name_connection_preloader:String;
private var _obj:Object;
private var _scale_old:String;
private var _preloader_active_flag:Boolean;// = false
private var _urls:Dictionary;
private var _timer:Timer;
private var _loader_preloader_skin:Loader;
private var _bg:Background;
private var _recive_localconnection_preloader:LocalConnection;
private var _error_flag:Boolean;// = false
private var _in_target:String;
private var _align_old:String;
private var _send_localconnection_preloader:LocalConnection;
private var _par:MovieClip;
private var _amount_try:uint;// = 10
private var _in_url:String;// = "null"
private var _tracker:GATracker;
private var _debug_flag:Boolean;// = false
public static const finish:String = "PRELOAD_COMPLETE";
public function GamePreloader(par:MovieClip, iniObject:Object=null){
var par = par;
var iniObject = iniObject;
_timer = new Timer((1000 / 10), 0);
_obj = new Object();
_urls = new Dictionary();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader = new LocalConnection();
_loader_preloader_skin = new Loader();
_obj_listener_preloader = new Object();
super();
_par = par;
_par.addChild(this);
if (iniObject != null){
_obj = iniObject;
};
_debug_flag = _obj["debug"];
//unresolved jump
var _slot1 = e;
_debug_flag = false;
_bg = new Background(this);
_indicator = new Indicator(this);
_gamezhero_code_preloader = new Date().getTime();
_recived_name_connection_preloader = ("_recived_gamezhero_preloader_" + _gamezhero_code_preloader);
_send_name_connection_preloader = ("_send_gamezhero_preloader_" + _gamezhero_code_preloader);
iniLocalConnectionsPreloader();
iniEvents();
iniStage();
iniGoogleAnalitics();
}
private function ioErrorHandler(event:IOErrorEvent=null):void{
beginScenario2();
}
private function preloaderLoaderError(IOErrorEvent:Event=null):void{
beginScenario2();
}
private function preloaderLoaderComplete(event:Event=null):void{
}
private function actionDone(event:TimerEvent=null):void{
var evnt:Event;
this.alpha = (this.alpha - 1);
if (this.alpha <= 1){
this.alpha = 0;
clearEvents();
clearStageEvents();
clearTimers();
setStageSettings();
evnt = new Event(finish);
this.dispatchEvent(evnt);
_indicator.remove();
_bg.remove();
_par.removeChild(this);
};
event.updateAfterEvent();
}
private function gotoAction(event:MouseEvent=null):void{
trace((((("gotoAction 2 " + _in_url) + " ") + _in_target) + " "));
if (_in_url != "null"){
GamezheroGlobal.getURL(_in_url, _in_target);
_in_url = "null";
};
}
private function iniStage(event:Event=null):void{
var event = event;
this.removeEventListener(Event.ENTER_FRAME, iniStage);
getStageSettings();
iniStageSettings();
iniContextMenu();
iniStageEvents();
if (_debug_flag == false){
loadPreloaderSkin();
} else {
beginScenario2();
};
//unresolved jump
var _slot1 = e;
_amount_try--;
if (_amount_try <= 0){
beginScenario2();
} else {
this.addEventListener(Event.ENTER_FRAME, iniStage);
};
}
private function resizeAction(event:Event=null):void{
var obj:Object;
var event = event;
obj = new Object();
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
//unresolved jump
var _slot1 = e;
obj.width = 550;
obj.height = 400;
if ((((_error_flag == false)) && ((_preloader_active_flag == true)))){
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 111, 115]), obj);
//unresolved jump
var _slot1 = e;
beginScenario2();
};
_indicator.update(obj.width, obj.height);
_bg.update(obj.width, obj.height);
}
private function getStageSettings():void{
_scale_old = stage.scaleMode;
_align_old = stage.align;
_rate_old = stage.frameRate;
_quality_old = stage.quality;
}
private function beginScenario2():void{
_error_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.start();
}
private function iniEvents():void{
_par.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_loader_preloader_skin.contentLoaderInfo.addEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_send_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
}
private function updatePreloader2(event:TimerEvent=null):void{
var obj:Object;
var event = event;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal((Math.round((proc * 100)) + " %"));
if (proc >= 1){
action();
};
obj = new Object();
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
//unresolved jump
var _slot1 = e;
obj.width = 550;
obj.height = 400;
event.updateAfterEvent();
}
private function iniContextMenu():void{
var title:String;
var menuItemFoo:ContextMenuItem;
var domain:String = GamezheroGlobal.getDomain(_par.stage);
var game_name:String = GamezheroGlobal.gameName;
_obj.gamezhero_url = (((("http://www.gamezhero.com/?utm_campaign=" + game_name) + "&utm_source=") + domain) + "&utm_medium=preloader");
_obj.gamezhero_menu = {Free Online Games @ Gamezhero.com:(((("http://www.gamezhero.com/?utm_campaign=" + game_name) + "&utm_source=") + domain) + "&utm_medium=context_menu"), Send To Friends:(((((("http://www.gamezhero.com/sendtofriends/" + game_name) + "-onlinegames.html?utm_campaign=") + game_name) + "&utm_source=") + domain) + "&utm_medium=send_to_friends_context_menu"), Put This Game To Your Blog or Site:(((((("http://www.gamezhero.com/freewebsitegames/" + game_name) + "-onlinegames.html?utm_campaign=") + game_name) + "&utm_source=") + domain) + "&utm_medium=free_web_site_games_context")};
var gamezheroMenu:ContextMenu = new ContextMenu();
gamezheroMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = gamezheroMenu.builtInItems;
defaultItems.quality = true;
defaultItems.print = true;
for (title in _obj.gamezhero_menu) {
menuItemFoo = new ContextMenuItem(title);
_urls[menuItemFoo] = _obj.gamezhero_menu[title];
menuItemFoo.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, getURLContextMenu);
gamezheroMenu.customItems.push(menuItemFoo);
};
this.parent.contextMenu = gamezheroMenu;
}
private function getInfo():Object{
var obj:UserInfo = new UserInfo(_par);
return ((obj as Object));
}
private function onStatusRecivePreloader(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniLocalConnectionsPreloader():void{
_obj_listener_preloader = new Object();
_obj_listener_preloader.preloaderOk = function ():void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([105, 110, 105, 80, 114, 101, 108, 111, 97, 100, 101, 114]), getInfo());
beginScenario1();
};
_obj_listener_preloader.preloaderGetUrlAction = function (url:String, target:String):void{
var url = url;
var target = target;
_tracker.trackEvent("preloader", "click", GamezheroGlobal.gameName);
//unresolved jump
var _slot1 = e;
gotoActionIni(url, target);
};
_obj_listener_preloader.finishAction = function (val:Object):void{
action();
};
var dom:String = GamezheroGlobal.toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
_recive_localconnection_preloader.allowInsecureDomain(dom);
_recive_localconnection_preloader.allowDomain(dom);
_recive_localconnection_preloader.client = _obj_listener_preloader;
_recive_localconnection_preloader.connect(_recived_name_connection_preloader);
//unresolved jump
var _slot1 = e;
beginScenario2();
_send_localconnection_preloader.allowInsecureDomain(dom);
_send_localconnection_preloader.allowDomain(dom);
}
private function gotoActionIni(url:String, target:String):void{
trace((((("gotoAction 1 " + url) + " ") + target) + " "));
_in_url = url;
_in_target = target;
gotoAction();
}
private function onStatusSendPreloader(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniGoogleAnalitics():void{
_tracker = new GATracker(this, "UA-262190-1", "AS3", false);
_tracker.trackEvent("preloader", "loading", GamezheroGlobal.gameName);
//unresolved jump
var _slot1 = e;
}
private function getURLContextMenu(evt:ContextMenuEvent=null):void{
GamezheroGlobal.getURL(_urls[evt.target], "_blank");
}
private function iniStageEvents():void{
stage.addEventListener(Event.RESIZE, resizeAction);
resizeAction();
}
public function action(evt:Event=null):void{
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, actionDone);
_timer.start();
}
private function iniStageSettings():void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 20;
stage.quality = StageQuality.HIGH;
}
private function clearEvents():void{
_par.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
this.removeEventListener(Event.ENTER_FRAME, iniStage);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_recive_localconnection_preloader.client = {};
_recive_localconnection_preloader.close();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
_send_localconnection_preloader = new LocalConnection();
}
private function updatePreloader1(event:TimerEvent=null):void{
var obj:Object;
var event = event;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal("Loading...");
obj = new Object();
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
//unresolved jump
var _slot1 = e;
obj.width = 550;
obj.height = 400;
obj.loaded = proc;
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 114, 101, 108, 111, 97, 100, 101, 114]), obj);
event.updateAfterEvent();
}
private function loadPreloaderSkin():void{
var url:String = (GamezheroGlobal.toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + String(_gamezhero_code_preloader));
var request:URLRequest = new URLRequest(url);
_loader_preloader_skin.load(request);
addChild(_loader_preloader_skin);
//unresolved jump
var _slot1 = e;
beginScenario2();
}
private function preloaderLoaderInit(event:Event=null):void{
var foo:Timer = new Timer(200, 1);
foo.addEventListener(TimerEvent.TIMER, checkPreloader);
foo.start();
}
private function checkPreloader(event:TimerEvent=null):void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([112, 114, 101, 108, 111, 97, 100, 101, 114, 73, 115, 79, 107]), null);
}
private function clearStageEvents():void{
stage.removeEventListener(Event.RESIZE, resizeAction);
//unresolved jump
var _slot1 = e;
}
private function onErrorRecivePreloader(infoObject:SecurityErrorEvent=null):void{
beginScenario2();
}
private function moveAction(event:MouseEvent=null):void{
}
private function beginScenario1():void{
_preloader_active_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.start();
resizeAction();
}
private function clearTimers():void{
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.removeEventListener(TimerEvent.TIMER, actionDone);
}
private function onErrorSendPreloader(infoObject:SecurityErrorEvent=null):void{
beginScenario2();
}
private function setStageSettings():void{
stage.scaleMode = _scale_old;
stage.align = _align_old;
stage.frameRate = _rate_old;
stage.quality = _quality_old;
}
}
}//package com.gamezhero.api.as3
Section 5
//GamezheroApi (com.gamezhero.api.as3.GamezheroApi)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.events.*;
import flash.system.*;
public class GamezheroApi {
private static var _score_continue_function:Function;
private static var _preloader_next_step_function:Function;
private static var _preloader_goal:MovieClip;
private static var _score_submit_function:Function;
private static var _score_error_function:Function;
private static var _score_goal:MovieClip;
public function GamezheroApi(){
super();
}
private static function scoreSubmitAction(event:Event=null):void{
_score_submit_function.apply();
}
public static function preloader(target:MovieClip, nextStep:Function):void{
var gamePreloader:GamePreloader;
_preloader_goal = (target as MovieClip);
_preloader_next_step_function = nextStep;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
gamePreloader = new GamePreloader(_preloader_goal, {debug:false});
gamePreloader.addEventListener(GamePreloader.finish, preloaderNextStep);
};
}
public static function ini(gameName:String):void{
Security.allowDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
Security.allowInsecureDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
GamezheroGlobal.gameName = gameName;
}
private static function scoreErrorAction(event:Event=null):void{
_score_error_function.apply();
}
public static function linkSendToFrined():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/sendtofriends/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=send_to_friend"), "_blank");
}
private static function scoreContinueAction(event:Event=null):void{
_score_continue_function.apply();
}
public static function score(target:MovieClip, gameCode:String, scoreValue:Number, scoreX:Number, scoreY:Number, submitAction:Function, continueAction:Function, errorAction:Function, scoreSkin:Object=null):void{
var score_value:Number;
var score_x_pos:Number;
var score_y_pos:Number;
var score_skin:Object;
var scoreGamezheroForm:SubmitArea;
GamezheroGlobal.gameCode = gameCode;
_score_goal = (target as MovieClip);
_score_submit_function = submitAction;
_score_continue_function = continueAction;
_score_error_function = errorAction;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
score_value = scoreValue;
score_x_pos = scoreX;
score_y_pos = scoreY;
score_skin = scoreSkin;
if (score_skin == null){
score_skin = {border:{width:4, color:0xFFFFFF, alpha:100}, background:{topColor:0x999999, bottomColor:0x666666, topAlpha:100, bottomAlpha:100, cornerRadius:10}, language:"ENG"};
};
scoreGamezheroForm = new SubmitArea(_score_goal, score_x_pos, score_y_pos, score_value, score_skin);
scoreGamezheroForm.addEventListener(SubmitArea.SUBMITED, scoreSubmitAction);
scoreGamezheroForm.addEventListener(SubmitArea.CONTINUE, scoreContinueAction);
scoreGamezheroForm.addEventListener(SubmitArea.ERROR, scoreErrorAction);
};
}
private static function preloaderNextStep(event:Event=null):void{
_preloader_next_step_function.apply();
}
public static function linkTopScore():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/topscore/" + GamezheroGlobal.gameName) + "/top100.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=top_score"), "_blank");
}
public static function linkMoreGames():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=more_free_games"), "_blank");
}
public static function linkZorroLogo():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=zorro_logo"), "_blank");
}
public static function linkPublish():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/freewebsitegames/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=free_web_site_games"), "_blank");
}
}
}//package com.gamezhero.api.as3
Section 6
//GamezheroGlobal (com.gamezhero.api.as3.GamezheroGlobal)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.net.*;
import com.gamezhero.api.as3.utils.*;
import flash.external.*;
public class GamezheroGlobal {
public static const SAFARI:String = "safari";
public static const FIREFOX:String = "firefox";
public static const CHROME:String = "chrome";
public static const IE:String = "ie";
public static const OPERA:String = "opera";
public static var gameNameVar:String = "unset";
public static var host:String = "error";
public static var browser:String = "unset";
public static var gameCodeVar:String = "unset";
public function GamezheroGlobal(){
super();
}
public static function getDomain(stage:Stage=null):String{
var url:URL;
var stage = stage;
if (host != "error"){
return (host);
};
url = new URL(stage.loaderInfo.url);
host = url.host;
if (url.host == null){
host = "local";
};
//unresolved jump
var _slot1 = e;
host = "error";
return (host);
}
public static function toText(arr:Array):String{
var st_url:String = "";
var i:Number = 0;
while (i < arr.length) {
st_url = (st_url + String.fromCharCode(arr[i]));
i++;
};
return (st_url);
}
public static function getURL(url:String, window:String):void{
var url_req:URLRequest = new URLRequest(url);
navigateToURL(url_req, window);
}
public static function get gameName():String{
return (gameNameVar);
}
public static function getBrowser():String{
var st:String;
if (browser == "unset"){
if (ExternalInterface.available){
st = ExternalInterface.call("function (){ return navigator['userAgent']}");
st = st.toLowerCase();
if (st.indexOf("firefox") != -1){
browser = FIREFOX;
} else {
if (st.indexOf("chrome") != -1){
browser = CHROME;
} else {
if (st.indexOf("safari") != -1){
browser = SAFARI;
} else {
if (st.indexOf("opera") != -1){
browser = OPERA;
} else {
browser = IE;
};
};
};
};
//unresolved jump
var _slot1 = e;
browser = IE;
} else {
browser = IE;
};
};
return (browser);
}
public static function set gameName(name:String):void{
gameNameVar = name;
}
public static function set gameCode(name:String):void{
gameCodeVar = name;
}
public static function get gameCode():String{
return (gameCodeVar);
}
}
}//package com.gamezhero.api.as3
Section 7
//SubmitArea (com.gamezhero.api.as3.SubmitArea)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import com.gamezhero.api.as3.gui.*;
public class SubmitArea extends MovieClip {
private var reciveLocalConnection_engine:LocalConnection;
private var sendLocalConnection_skin:LocalConnection;
private var score_value:Number;// = 0
private var sendNameConnection_skin:String;
private var x_pos:Number;// = 0
private var y_pos:Number;// = 0
private var _indicator:Indicator;
private var score:Number;
private var goal:MovieClip;
private var skin_mc:MovieClip;
private var loader_skin:Loader;
private var gamezheroCode_engine:Number;
private var engine_mc:MovieClip;
private var skin_info:Object;
private var _loader:URLVariables;
private var reciveLocalConnection_skin:LocalConnection;
private var recivedNameConnection_engine:String;
private var sendLocalConnection_engine:LocalConnection;
private var sendNameConnection_engine:String;
private var _loader_url:String;// = "null"
private var objListenerSkin:Object;
public var versionGame:String;// = "2.0"
private var gamezheroCode_skin:Number;
private var loader_engine:Loader;
private var objListenerEngine:Object;
private var recivedNameConnection_skin:String;
private var infoText:TextField;
public static const SUBMITED:String = "gamezhero_submited";
public static const CONTINUE:String = "gamezhero_continue";
public static const ERROR:String = "gamezhero_error";
public function SubmitArea(g:DisplayObject, x_:Number, y_:Number, score_:Number, skin_:Object){
reciveLocalConnection_skin = new LocalConnection();
sendLocalConnection_skin = new LocalConnection();
reciveLocalConnection_engine = new LocalConnection();
sendLocalConnection_engine = new LocalConnection();
loader_skin = new Loader();
loader_engine = new Loader();
objListenerSkin = new Object();
objListenerEngine = new Object();
_loader = new URLVariables();
super();
gamezheroCode_skin = new Date().getTime();
gamezheroCode_engine = gamezheroCode_skin;
recivedNameConnection_skin = ("_send_gamezhero_skin_" + gamezheroCode_skin);
sendNameConnection_skin = ("_recive_gamezhero_skin_" + gamezheroCode_skin);
recivedNameConnection_engine = ("_send_gamezhero_engine_" + gamezheroCode_engine);
sendNameConnection_engine = ("_recive_gamezhero_engine_" + gamezheroCode_engine);
iniLocalConnectionsSkin();
iniLocalConnectionsEngine();
iniSubmitArea(g, x_, y_, score_, skin_);
iniEvents();
}
private function iniSkin():void{
loader_skin.x = x_pos;
loader_skin.y = y_pos;
infoText.text = "";
_indicator.remove();
//unresolved jump
var _slot1 = e;
sendLocalConnection_skin.send(sendNameConnection_skin, "iniSkin", skin_info);
}
private function loadSkin():void{
infoText.text = "Loading Skin...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 115, 107, 105, 110, 47, 115, 107, 105, 110, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_skin);
var request:URLRequest = new URLRequest(url);
loader_skin.load(request);
addChild(loader_skin);
//unresolved jump
var _slot1 = e;
infoText.text = "Error Loading Skin...";
errorAction();
}
public function submitAction(username:String=""):void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(SUBMITED));
}
private function diactivateAllEvents():void{
loader_skin.contentLoaderInfo.removeEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.removeEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function onStatusReciveEngine(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Engine'";
break;
};
}
public function createInfoText():void{
infoText = new TextField();
infoText.autoSize = TextFieldAutoSize.LEFT;
var fontFormat:TextFormat = new TextFormat();
fontFormat.color = 0xFFFFFF;
fontFormat.size = 11;
fontFormat.font = "Arial";
infoText.defaultTextFormat = fontFormat;
this.addChild(infoText);
infoText.x = 10;
infoText.y = 10;
infoText.visible = false;
}
private function iniEvents():void{
loader_skin.contentLoaderInfo.addEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.addEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function engineLoaderError(IOErrorEvent:Event=null):void{
infoText.text = "Error Loading Engine...";
errorAction();
}
private function onStatusReciveSkin(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Skin'";
break;
};
}
private function engineLoaderInit(event:Event=null):void{
infoText.text = "Check Engine Connection...";
var foo:Timer = new Timer(200, 1);
foo.addEventListener(TimerEvent.TIMER, checkEngine);
foo.start();
}
private function onStatusSendEngine(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Engine'";
break;
};
}
private function checkSkin(event:TimerEvent=null):void{
sendLocalConnection_skin.send(sendNameConnection_skin, "skinIsOk");
}
private function iniLocalConnectionsSkin():void{
objListenerSkin = new Object();
objListenerSkin.skinOk = function ():void{
loadEngine();
};
objListenerSkin.submitAction = function (userName:String):void{
sendLocalConnection_engine.send(sendNameConnection_engine, toText([115, 101, 110, 100, 83, 99, 111, 114, 101]), userName);
};
objListenerSkin.errorInputActin = function ():void{
};
objListenerSkin.continueAction = function ():void{
continueAction();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_skin.allowInsecureDomain(dom);
reciveLocalConnection_skin.allowDomain(dom);
reciveLocalConnection_skin.client = objListenerSkin;
reciveLocalConnection_skin.connect(recivedNameConnection_skin);
sendLocalConnection_skin.allowInsecureDomain(dom);
sendLocalConnection_skin.allowDomain(dom);
}
private function onErrorReciveSkin(infoObject:SecurityErrorEvent=null):void{
errorAction();
}
private function onStatusSendSkin(infoObject:StatusEvent=null):void{
switch (infoObject.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Skin'";
break;
};
}
private function onErrorSendSkin(infoObject:SecurityErrorEvent=null):void{
errorAction();
}
private function skinLoaderInit(event:Event=null):void{
infoText.text = "Check Skin Connection... ";
var foo:Timer = new Timer(200, 1);
foo.addEventListener(TimerEvent.TIMER, checkSkin);
foo.start();
}
public function continueAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(CONTINUE));
}
private function onErrorReciveEngine(infoObject:SecurityErrorEvent=null):void{
errorAction();
}
private function sendScoreAction(event:MouseEvent=null):void{
var request:URLRequest;
if (_loader_url != "null"){
request = new URLRequest(_loader_url);
request.method = URLRequestMethod.POST;
request.data = _loader;
navigateToURL(request, "_blank");
_loader = new URLVariables();
_loader_url = "null";
submitAction();
};
}
private function toText(arr:Array):String{
var st_url:String = "";
var i:Number = 0;
while (i < arr.length) {
st_url = (st_url + String.fromCharCode(arr[i]));
i++;
};
return (st_url);
}
private function iniSubmitArea(g:DisplayObject, x_:Number, y_:Number, score_:Number, skin_:Object):void{
goal = (g as MovieClip);
goal.addChild(this);
x_pos = x_;
y_pos = y_;
score_value = Math.abs(Math.round(score_));
skin_info = skin_;
skin_info.score = score_value;
skin_info.gameName = GamezheroGlobal.gameName;
skin_info.gameCode = GamezheroGlobal.gameCode;
skin_info.domain = GamezheroGlobal.getDomain(goal.stage);
_indicator = new Indicator(goal);
_indicator.setSize(50, 50);
_indicator.setPos(30, 30);
createInfoText();
loadSkin();
}
private function deleteAll():void{
this.removeChild(infoText);
//unresolved jump
var _slot1 = e;
this.removeChild(loader_skin);
//unresolved jump
var _slot1 = e;
this.removeChild(loader_engine);
//unresolved jump
var _slot1 = e;
_indicator.remove();
//unresolved jump
var _slot1 = e;
goal.removeChild(this);
//unresolved jump
var _slot1 = e;
}
private function onErrorSendEngine(infoObject:SecurityErrorEvent=null):void{
errorAction();
}
private function loadEngine():void{
infoText.text = "Loading Engine...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 101, 110, 103, 105, 110, 101, 47, 101, 110, 103, 105, 110, 101, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_engine);
var request:URLRequest = new URLRequest(url);
loader_engine.load(request);
addChild(loader_engine);
//unresolved jump
var _slot1 = e;
infoText.text = "Error Loading Engine...";
errorAction();
}
public function errorAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(ERROR));
}
private function iniLocalConnectionsEngine():void{
objListenerEngine = new Object();
objListenerEngine.engineOk = function ():void{
sendLocalConnection_engine.send(sendNameConnection_engine, "iniEngine", skin_info);
infoText.text = "Engine Connections...";
};
objListenerEngine.engineError = function ():void{
infoText.text = "Error Engine...";
};
objListenerEngine.submitActionDone = function (obj:Object):void{
sendScore(obj);
};
objListenerEngine.engineActivated = function ():void{
iniSkin();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_engine.allowDomain(dom);
reciveLocalConnection_engine.allowInsecureDomain(dom);
reciveLocalConnection_engine.client = objListenerEngine;
reciveLocalConnection_engine.connect(recivedNameConnection_engine);
sendLocalConnection_engine.allowDomain(dom);
sendLocalConnection_engine.allowInsecureDomain(dom);
}
private function moveAction(event:MouseEvent=null):void{
}
private function sendScore(obj:Object):void{
var i:String;
_loader = new URLVariables();
_loader_url = obj.url;
for (i in obj.vars) {
_loader[i] = obj.vars[i];
};
sendScoreAction();
}
private function checkEngine(event:TimerEvent=null):void{
sendLocalConnection_engine.send(sendNameConnection_engine, "engineIsOk");
}
private function fromText(txt:String):Array{
var arr:Array = new Array();
var i:Number = 0;
while (i < txt.length) {
arr.push(txt.charCodeAt(i));
i++;
};
return (arr);
}
private function skinLoaderError(IOErrorEvent:Event=null):void{
infoText.text = "Error Loading Skin...";
errorAction();
}
}
}//package com.gamezhero.api.as3
Section 8
//UserInfo (com.gamezhero.api.as3.UserInfo)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.system.*;
import flash.external.*;
public class UserInfo {
public var flash_domain:String;
private var _stage:Stage;
public var ad_zone:String;// = "preloader"
public var flash_height:Number;
public var flash_vars:Object;
public var referrer:String;
public var flash_url:String;
public var browser:String;
public var href:String;
private var _goal:MovieClip;
public var flash_width:Number;
public var game_name:String;
public var api_version:String;// = "AS3 - v3.0"
public var publisher:String;// = "gamezhero"
public var capabilities:String;
public function UserInfo(g:MovieClip){
var g = g;
_goal = g;
_stage = _goal.stage;
//unresolved jump
var _slot1 = e;
super();
iniInfo();
}
private function iniInfo():void{
var i:String;
this["publisher"] = "gamezhero";
this["ad_zone"] = "preloader";
this["api_version"] = "AS3 - v3.0";
this["flash_vars"] = new Object();
this["capabilities"] = Capabilities.serverString;
if (ExternalInterface.available){
this["href"] = ExternalInterface.call("function (){return document.location.href}");
//unresolved jump
var _slot1 = e;
this["href"] = "-1";
this["browser"] = ExternalInterface.call("function (){var st = ''; for (i in navigator){ if (typeof(navigator[i])!='function'){ st+=i+'='+navigator[i]+'&'; }} return st}");
//unresolved jump
var _slot1 = e;
this["browser"] = "-1";
this["referrer"] = ExternalInterface.call("function (){return document.referrer}");
//unresolved jump
var _slot1 = e;
this["referrer"] = "-1";
} else {
this["href"] = "-1";
this["browser"] = "-1";
this["referrer"] = "-1";
};
this["game_name"] = GamezheroGlobal.gameName;
this["flash_domain"] = GamezheroGlobal.getDomain();
this["flash_width"] = _stage.stageWidth;
this["flash_height"] = _stage.stageHeight;
this["flash_url"] = _stage.root.loaderInfo.url;
//unresolved jump
var _slot1 = e;
for (i in _stage.root.loaderInfo.parameters) {
this["flash_vars"][i] = _stage.root.loaderInfo.parameters[i];
};
//unresolved jump
var _slot1 = e;
}
}
}//package com.gamezhero.api.as3
Section 9
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(empty:Boolean=true, newCampaign:Boolean=false){
super();
_empty = empty;
_new = newCampaign;
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
variables.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
variables.utmcr = utmcr;
};
return (variables);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 10
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
public function CampaignKey(){
super();
}
}
}//package com.google.analytics.campaign
Section 11
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(config:Configuration, debug:DebugConfiguration, buffer:Buffer, domainHash:Number, referrer:String, timeStamp:Number){
super();
_config = config;
_debug = debug;
_buffer = buffer;
_domainHash = domainHash;
_referrer = referrer;
_timeStamp = timeStamp;
}
public function getCampaignInformation(search:String, noSessionInformation:Boolean):CampaignInfo{
var campaignTracker:CampaignTracker;
var oldTracker:CampaignTracker;
var sessionCount:int;
var campInfo:CampaignInfo = new CampaignInfo();
var duplicateCampaign:Boolean;
var campNoOverride:Boolean;
var responseCount:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (campInfo);
};
};
campaignTracker = getTrackerFromSearchString(search);
if (isValid(campaignTracker)){
campNoOverride = hasNoOverride(search);
if (((campNoOverride) && (!(_buffer.hasUTMZ())))){
return (campInfo);
};
};
if (!isValid(campaignTracker)){
campaignTracker = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(campaignTracker)))){
return (campInfo);
};
};
if (((!(isValid(campaignTracker))) && (noSessionInformation))){
campaignTracker = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(campaignTracker)))){
return (campInfo);
};
};
if (!isValid(campaignTracker)){
if (((!(_buffer.hasUTMZ())) && (noSessionInformation))){
campaignTracker = getDirectCampaign();
};
};
if (!isValid(campaignTracker)){
return (campInfo);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
oldTracker = new CampaignTracker();
oldTracker.fromTrackerString(_buffer.utmz.campaignTracking);
duplicateCampaign = (oldTracker.toTrackerString() == campaignTracker.toTrackerString());
responseCount = _buffer.utmz.responseCount;
};
if (((!(duplicateCampaign)) || (noSessionInformation))){
sessionCount = _buffer.utma.sessionCount;
responseCount++;
if (sessionCount == 0){
sessionCount = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = sessionCount;
_buffer.utmz.responseCount = responseCount;
_buffer.utmz.campaignTracking = campaignTracker.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
campInfo = new CampaignInfo(false, true);
} else {
campInfo = new CampaignInfo(false, false);
};
return (campInfo);
}
public function hasNoOverride(search:String):Boolean{
var key:CampaignKey = _config.campaignKey;
if (search == ""){
return (false);
};
var variables:Variables = new Variables(search);
var value:String = "";
if (variables.hasOwnProperty(key.UCNO)){
value = variables[key.UCNO];
switch (value){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(search:String):CampaignTracker{
var organicCampaign:CampaignTracker = getOrganicCampaign();
var camp:CampaignTracker = new CampaignTracker();
var key:CampaignKey = _config.campaignKey;
if (search == ""){
return (camp);
};
var variables:Variables = new Variables(search);
if (variables.hasOwnProperty(key.UCID)){
camp.id = variables[key.UCID];
};
if (variables.hasOwnProperty(key.UCSR)){
camp.source = variables[key.UCSR];
};
if (variables.hasOwnProperty(key.UGCLID)){
camp.clickId = variables[key.UGCLID];
};
if (variables.hasOwnProperty(key.UCCN)){
camp.name = variables[key.UCCN];
} else {
camp.name = "(not set)";
};
if (variables.hasOwnProperty(key.UCMD)){
camp.medium = variables[key.UCMD];
} else {
camp.medium = "(not set)";
};
if (variables.hasOwnProperty(key.UCTR)){
camp.term = variables[key.UCTR];
} else {
if (((organicCampaign) && (!((organicCampaign.term == ""))))){
camp.term = organicCampaign.term;
};
};
if (variables.hasOwnProperty(key.UCCT)){
camp.content = variables[key.UCCT];
};
return (camp);
}
public function getOrganicCampaign():CampaignTracker{
var camp:CampaignTracker;
var tmp:Array;
var currentOrganicSource:OrganicReferrer;
var keyword:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (camp);
};
var ref:URL = new URL(_referrer);
var name:String = "";
if (ref.hostName != ""){
if (ref.hostName.indexOf(".") > -1){
tmp = ref.hostName.split(".");
switch (tmp.length){
case 2:
name = tmp[0];
break;
case 3:
name = tmp[1];
break;
};
};
};
if (_config.organic.match(name)){
currentOrganicSource = _config.organic.getReferrerByName(name);
keyword = _config.organic.getKeywordValue(currentOrganicSource, ref.search);
camp = new CampaignTracker();
camp.source = currentOrganicSource.engine;
camp.name = "(organic)";
camp.medium = "organic";
camp.term = keyword;
};
return (camp);
}
public function getDirectCampaign():CampaignTracker{
var camp:CampaignTracker = new CampaignTracker();
camp.source = "(direct)";
camp.name = "(direct)";
camp.medium = "(none)";
return (camp);
}
public function isIgnoredKeyword(tracker:CampaignTracker):Boolean{
if (((tracker) && ((tracker.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(tracker.term));
};
return (false);
}
public function isIgnoredReferral(tracker:CampaignTracker):Boolean{
if (((tracker) && ((tracker.medium == "referral")))){
return (_config.organic.isIgnoredReferral(tracker.source));
};
return (false);
}
public function isValid(tracker:CampaignTracker):Boolean{
if (((tracker) && (tracker.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var camp:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (camp);
};
var ref:URL = new URL(_referrer);
var hostname:String = ref.hostName;
var content:String = ref.path;
if (hostname.indexOf("www.") == 0){
hostname = hostname.substr(4);
};
camp = new CampaignTracker();
camp.source = hostname;
camp.name = "(referral)";
camp.medium = "referral";
camp.content = content;
return (camp);
}
public static function isInvalidReferrer(referrer:String):Boolean{
var url:URL;
if ((((((referrer == "")) || ((referrer == "-")))) || ((referrer == "0")))){
return (true);
};
if (referrer.indexOf("://") > -1){
url = new URL(referrer);
if ((((url.protocol == Protocols.file)) || ((url.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(referrer:String, config:Configuration):Boolean{
var url:URL = new URL(referrer);
if (url.hostName.indexOf(config.google) > -1){
if (url.search.indexOf((config.googleSearchParam + "=")) > -1){
if (url.path == ("/" + config.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 12
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(id:String="", source:String="", clickId:String="", name:String="", medium:String="", term:String="", content:String=""){
super();
this.id = id;
this.source = source;
this.clickId = clickId;
this.name = name;
this.medium = medium;
this.term = term;
this.content = content;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var data:Array = [];
_addIfNotEmpty(data, "utmcid=", id);
_addIfNotEmpty(data, "utmcsr=", source);
_addIfNotEmpty(data, "utmgclid=", clickId);
_addIfNotEmpty(data, "utmccn=", name);
_addIfNotEmpty(data, "utmcmd=", medium);
_addIfNotEmpty(data, "utmctr=", term);
_addIfNotEmpty(data, "utmcct=", content);
return (data.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(arr:Array, field:String, value:String):void{
if (value != ""){
value = value.split("+").join("%20");
value = value.split(" ").join("%20");
arr.push((field + value));
};
}
public function fromTrackerString(tracker:String):void{
var data:String = tracker.split(CampaignManager.trackingDelimiter).join("&");
var vars:Variables = new Variables(data);
if (vars.hasOwnProperty("utmcid")){
this.id = vars["utmcid"];
};
if (vars.hasOwnProperty("utmcsr")){
this.source = vars["utmcsr"];
};
if (vars.hasOwnProperty("utmccn")){
this.name = vars["utmccn"];
};
if (vars.hasOwnProperty("utmcmd")){
this.medium = vars["utmcmd"];
};
if (vars.hasOwnProperty("utmctr")){
this.term = vars["utmctr"];
};
if (vars.hasOwnProperty("utmcct")){
this.content = vars["utmcct"];
};
if (vars.hasOwnProperty("utmgclid")){
this.clickId = vars["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 13
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(config:Configuration, info:Environment){
super();
_config = config;
_info = info;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var v:Version;
if (_config.detectFlash){
v = _info.flashVersion;
return (((((v.major + ".") + v.minor) + " r") + v.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
variables.utmcs = utmcs;
variables.utmsr = utmsr;
variables.utmsc = utmsc;
variables.utmul = utmul;
variables.utmje = utmje;
variables.utmfl = utmfl;
return (variables);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 14
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _data:Object;
private var _OBJ:Object;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _utma:UTMA;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmx:UTMX;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(config:Configuration, debug:DebugConfiguration, volatile:Boolean=false, data:Object=null){
var prop:String;
super();
_config = config;
_debug = debug;
_data = data;
_volatile = volatile;
if (_volatile){
_OBJ = new Object();
if (_data){
for (prop in _data) {
_OBJ[prop] = _data[prop];
};
};
};
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
flushStatus = _SO.flush();
//unresolved jump
var _slot1 = e;
_debug.warning("Error...Could not write SharedObject to disk");
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmx():UTMX{
if (!hasUTMX()){
_createUMTX();
};
return (_utmx);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function getLinkerUrl(targetUrl:String="", useHash:Boolean=false):String{
var linkerParams:String = toLinkerParams();
var formattedUrl:String = targetUrl;
var urlFields:Array = targetUrl.split("#");
if (linkerParams){
if (useHash){
if (1 >= urlFields.length){
formattedUrl = (formattedUrl + ("#" + linkerParams));
} else {
formattedUrl = (formattedUrl + ("&" + linkerParams));
};
} else {
if (1 >= urlFields.length){
if (targetUrl.indexOf("?") > -1){
formattedUrl = (formattedUrl + "&");
} else {
formattedUrl = (formattedUrl + "?");
};
formattedUrl = (formattedUrl + linkerParams);
} else {
formattedUrl = urlFields[0];
if (targetUrl.indexOf("?") > -1){
formattedUrl = (formattedUrl + "&");
} else {
formattedUrl = (formattedUrl + "?");
};
formattedUrl = (formattedUrl + ((linkerParams + "#") + urlFields[1]));
};
};
};
return (formattedUrl);
}
public function generateCookiesHash():Number{
var value:String = "";
value = (value + utma.valueOf());
value = (value + utmb.valueOf());
value = (value + utmc.valueOf());
value = (value + utmx.valueOf());
value = (value + utmz.valueOf());
value = (value + utmv.valueOf());
return (Utils.generateHash(value));
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMX():Boolean{
if (_utmx){
return (true);
};
return (false);
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _createUMTX():void{
_utmx = new UTMX();
_utmx.proxy = this;
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(timestamp:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + timestamp) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = timestamp;
};
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
private function _onFlushStatus(event:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (event.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
public function toLinkerParams():String{
var output:String = "";
output = (output + utma.toURLString());
output = (output + ("&" + utmb.toURLString()));
output = (output + ("&" + utmc.toURLString()));
output = (output + ("&" + utmx.toURLString()));
output = (output + ("&" + utmz.toURLString()));
output = (output + ("&" + utmv.toURLString()));
output = (output + ("&__utmk=" + generateCookiesHash()));
return (output);
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(name:String, value):void{
if (isVolatile()){
_OBJ[name] = value;
} else {
_SO.data[name] = value;
};
}
public function createSO():void{
var saveSO:Boolean;
UTMZ.defaultTimespan = _config.conversionTimeout;
UTMB.defaultTimespan = _config.sessionTimeout;
if (!_volatile){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
//unresolved jump
var _slot1 = e;
if (_debug.active){
_debug.warning(((("Shared Object " + _config.cookieName) + " failed to be set\nreason: ") + _slot1.message));
};
saveSO = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
saveSO = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (!hasUTMX()){
_createUMTX();
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
saveSO = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
saveSO = true;
};
};
if (saveSO){
save();
};
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 15
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(config:Configuration, info:Environment, formatedReferrer:String, pageURL:String=null, adSense:AdSenseGlobals=null){
super();
_config = config;
_info = info;
_utmr = formatedReferrer;
_pageURL = pageURL;
_adSense = adSense;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
private function _renderPageURL(pageURL:String=""):String{
var pathname:String = _info.locationPath;
var search:String = _info.locationSearch;
if (((!(pageURL)) || ((pageURL == "")))){
pageURL = (pathname + unescape(search));
if (pageURL == ""){
pageURL = "/";
};
};
return (pageURL);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var hid:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
hid = Number(_adSense.hid);
} else {
hid = Math.round((Math.random() * 2147483647));
_adSense.hid = String(hid);
};
return (hid);
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
variables.utmdt = utmdt;
};
variables.utmhid = utmhid;
variables.utmr = utmr;
variables.utmp = utmp;
return (variables);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 16
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(mode:DomainNameMode=null, name:String="", debug:DebugConfiguration=null){
super();
_debug = debug;
if (mode == null){
mode = DomainNameMode.auto;
};
_mode = mode;
if (mode == DomainNameMode.custom){
this.name = name;
} else {
_name = name;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(value:DomainNameMode):void{
_mode = value;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(value:String):void{
if (((!((value.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + value), VisualDebugMode.geek);
};
_name = value;
}
}
}//package com.google.analytics.core
Section 17
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 18
//Ecommerce (com.google.analytics.core.Ecommerce)
package com.google.analytics.core {
import com.google.analytics.debug.*;
import com.google.analytics.ecommerce.*;
public class Ecommerce {
private var _debug:DebugConfiguration;
private var _trans:Array;
public function Ecommerce(debug:DebugConfiguration){
super();
this._debug = debug;
_trans = new Array();
}
public function getTransLength():Number{
return (_trans.length);
}
public function getTransFromArray(i:Number):Transaction{
return (_trans[i]);
}
public function addTransaction(id:String, affiliation:String, total:String, tax:String, shipping:String, city:String, state:String, country:String):Transaction{
var newTrans:Transaction;
newTrans = getTransaction(id);
if (newTrans == null){
newTrans = new Transaction(id, affiliation, total, tax, shipping, city, state, country);
_trans.push(newTrans);
} else {
newTrans.affiliation = affiliation;
newTrans.total = total;
newTrans.tax = tax;
newTrans.shipping = shipping;
newTrans.city = city;
newTrans.state = state;
newTrans.country = country;
};
return (newTrans);
}
public function getTransaction(orderId:String):Transaction{
var i:Number;
i = 0;
while (i < _trans.length) {
if (_trans[i].id == orderId){
return (_trans[i]);
};
i++;
};
return (null);
}
}
}//package com.google.analytics.core
Section 19
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(isEventHit:Boolean, xObject:X10, extObject:X10=null){
super();
_isEventHit = isEventHit;
_x10 = xObject;
_ext10 = extObject;
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
if (_isEventHit){
variables.utmt = utmt;
};
variables.utme = utme;
return (variables);
}
}
}//package com.google.analytics.core
Section 20
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(name:String, parent:GoogleAnalyticsAPI){
super();
this.name = name;
_parent = parent;
}
public function trackEvent(action:String, label:String=null, value:Number=NaN):Boolean{
return (_parent.trackEvent(name, action, label, value));
}
}
}//package com.google.analytics.core
Section 21
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 22
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import flash.system.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(config:Configuration, debug:DebugConfiguration, buffer:Buffer, info:Environment){
super();
_config = config;
_debug = debug;
_buffer = buffer;
_info = info;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(event:IOErrorEvent):void{
var url:String = _lastRequest.url;
var id:String = String((_requests.length - 1));
var msg = (("Gif Request #" + id) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" \"" + url) + "\" does not exists or is unreachable"));
};
_debug.failure(msg);
} else {
_debug.warning(msg);
};
_removeListeners(event.target);
}
public function send(account:String, variables:Variables=null, force:Boolean=false, rateLimit:Boolean=false):void{
var localPath:String;
var localImage:URLRequest;
var remoteImage:URLRequest;
_utmac = account;
if (!variables){
variables = new Variables();
};
variables.URIencode = false;
variables.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
variables.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (force))){
if (rateLimit){
updateToken();
};
if (((((force) || (!(rateLimit)))) || ((_buffer.utmb.token >= 1)))){
if (((!(force)) && (rateLimit))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
variables.utmwv = utmwv;
variables.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
variables.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
variables.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
localPath = _info.locationSWFPath;
if (localPath.lastIndexOf("/") > 0){
localPath = localPath.substring(0, localPath.lastIndexOf("/"));
};
localImage = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
localImage.url = _config.localGIFpath;
} else {
localImage.url = (localPath + _config.localGIFpath);
};
localImage.url = (localImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(localImage);
} else {
sendRequest(localImage);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
remoteImage = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
remoteImage.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
remoteImage.url = _config.remoteGIFpath;
} else {
remoteImage.url = _config.remoteGIFpath;
};
};
variables.utmac = utmac;
variables.utmcc = encodeURIComponent(utmcc);
remoteImage.url = (remoteImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(remoteImage);
} else {
sendRequest(remoteImage);
};
};
};
};
}
public function onSecurityError(event:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(event.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var cookies:Array = [];
if (_buffer.hasUTMA()){
cookies.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
cookies.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
cookies.push((_buffer.utmv.toURLString() + ";"));
};
return (cookies.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(request:URLRequest):void{
var request = request;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
loader.load(request, context);
//unresolved jump
var _slot1 = e;
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
}
private function _removeListeners(target:Object):void{
target.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
target.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var tokenDelta:Number;
var timestamp:Number = new Date().getTime();
tokenDelta = ((timestamp - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + tokenDelta), VisualDebugMode.geek);
};
if (tokenDelta >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + tokenDelta)), _config.bucketCapacity);
_buffer.utmb.lastTime = timestamp;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(url:String):String{
var paths:Array;
if (url.length > 60){
paths = url.split("/");
while (url.length > 60) {
paths.shift();
url = ("../" + paths.join("/"));
};
};
return (url);
}
private function _debugSend(request:URLRequest):void{
var _local3:String;
var data:String = "";
switch (_debug.mode){
case VisualDebugMode.geek:
data = ((("Gif Request #" + _alertcount) + ":\n") + request.url);
break;
case VisualDebugMode.advanced:
_local3 = request.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
data = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
data = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(data, request, this);
_alertcount++;
}
public function onComplete(event:Event):void{
var id:String = event.target.loader.name;
_requests[id].complete();
var msg = (("Gif Request #" + id) + " sent");
var url:String = _requests[id].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" to \"" + url) + "\""));
};
_debug.success(msg);
} else {
_debug.info(msg);
};
_removeListeners(event.target);
}
}
}//package com.google.analytics.core
Section 23
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(config:Configuration, debug:DebugConfiguration, display:DisplayObject, buffer:Buffer){
super();
var delay:Number = config.idleLoop;
var inactivity:Number = config.idleTimeout;
var sessionTimeout:Number = config.sessionTimeout;
_loop = new Timer((delay * 1000));
_session = new Timer((sessionTimeout * 1000), 1);
_debug = debug;
_stage = display.stage;
_buffer = buffer;
_lastMove = getTimer();
_inactivity = (inactivity * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + delay) + "sec , inactivity: ") + inactivity) + "sec, sessionTimeout: ") + sessionTimeout), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(event:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(event:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(event:TimerEvent):void{
var current:int = getTimer();
if ((current - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 24
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
super();
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(keyword:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(keyword)){
return (true);
};
return (false);
}
public function getKeywordValue(or:OrganicReferrer, path:String):String{
var keyword:String = or.keyword;
return (getKeywordValueFromPath(keyword, path));
}
public function isIgnoredReferral(referrer:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(referrer)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(name:String):Boolean{
if (name == ""){
return (false);
};
name = name.toLowerCase();
if (_sourcesEngine[name] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(engine:String, keyword:String):void{
var orgref:OrganicReferrer = new OrganicReferrer(engine, keyword);
if (_sourcesCache[orgref.toString()] == undefined){
_sources.push(orgref);
_sourcesCache[orgref.toString()] = (_sources.length - 1);
if (_sourcesEngine[orgref.engine] == undefined){
_sourcesEngine[orgref.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[orgref.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((orgref.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(referrer:String):void{
if (_ignoredReferralsCache[referrer] == undefined){
_ignoredReferrals.push(referrer);
_ignoredReferralsCache[referrer] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + referrer) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(name:String):OrganicReferrer{
var index:int;
if (match(name)){
index = _sourcesEngine[name][0];
return (_sources[index]);
};
return (null);
}
public function addIgnoredKeyword(keyword:String):void{
if (_ignoredKeywordsCache[keyword] == undefined){
_ignoredKeywords.push(keyword);
_ignoredKeywordsCache[keyword] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + keyword) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(keyword:String, path:String):String{
var value:String;
var vars:Variables;
if (path.indexOf((keyword + "=")) > -1){
if (path.charAt(0) == "?"){
path = path.substr(1);
};
path = path.split("+").join("%20");
vars = new Variables(path);
value = vars[keyword];
};
return (value);
}
}
}//package com.google.analytics.core
Section 25
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(engine:String, keyword:String){
super();
this.engine = engine;
this.keyword = keyword;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(value:String):void{
_engine = value.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(value:String):void{
_keyword = value.toLowerCase();
}
}
}//package com.google.analytics.core
Section 26
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(request:URLRequest){
super();
start = getTimer();
this.request = request;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var data:Array = [];
data.push((("duration: " + duration) + "ms"));
data.push(("url: " + request.url));
return ((("{ " + data.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 27
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 28
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(tracker:GoogleAnalyticsAPI=null){
super();
this.tracker = tracker;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var o:Object;
var name:String;
var args:Array;
var l:int;
var i:int;
if (tracker == null){
return;
};
if (size() > 0){
l = _ar.length;
while (i < l) {
o = _ar.shift();
name = (o.name as String);
args = (o.args as Array);
if (((!((name == null))) && ((name in tracker)))){
(tracker[name] as Function).apply(tracker, args);
};
i++;
};
};
}
public function enqueue(name:String, ... _args):Boolean{
if (name == null){
return (false);
};
_ar.push({name:name, args:_args});
return (true);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
enqueue("link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
enqueue("addOrganic", newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
enqueue("setAllowLinker", enable);
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
enqueue("trackEvent", category, action, label, value);
return (true);
}
public function getLinkerUrl(url:String="", useHash:Boolean=false):String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLinkerUrl' method for the moment."));
};
return ("");
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(pageURL:String=""):void{
enqueue("trackPageview", pageURL);
}
public function setClientInfo(enable:Boolean):void{
enqueue("setClientInfo", enable);
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
enqueue("linkByPost", formObject, useHash);
}
public function setCookieTimeout(newDefaultTimeout:int):void{
enqueue("setCookieTimeout", newDefaultTimeout);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(enable:Boolean):void{
enqueue("setDetectFlash", enable);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(newCampNameKey:String):void{
enqueue("setCampNameKey", newCampNameKey);
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
enqueue("addItem", item, sku, name, category, price, quantity);
}
public function createEventTracker(objName:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setVar(newVal:String):void{
enqueue("setVar", newVal);
}
public function setDomainName(newDomainName:String):void{
enqueue("setDomainName", newDomainName);
}
public function setCampSourceKey(newCampSrcKey:String):void{
enqueue("setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):void{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
}
public function setCampContentKey(newCampContentKey:String):void{
enqueue("setCampContentKey", newCampContentKey);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(enable:Boolean):void{
enqueue("setAllowAnchor", enable);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(newLocalGifPath:String):void{
enqueue("setLocalGifPath", newLocalGifPath);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(newCookiePath:String):void{
enqueue("setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
enqueue("setSampleRate", newRate);
}
public function setDetectTitle(enable:Boolean):void{
enqueue("setDetectTitle", enable);
}
public function setAllowHash(enable:Boolean):void{
enqueue("setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
enqueue("addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
enqueue("setCampNOKey", newCampNOKey);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(newPath:String):void{
enqueue("cookiePathCopy", newPath);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(enable:Boolean):void{
enqueue("setCampaignTrack", enable);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
enqueue("setCampTermKey", newCampTermKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
enqueue("addIgnoredRef", newIgnoredReferrer);
}
public function setCampMediumKey(newCampMedKey:String):void{
enqueue("setCampMediumKey", newCampMedKey);
}
public function setSessionTimeout(newTimeout:int):void{
enqueue("setSessionTimeout", newTimeout);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 29
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
public function TrackerMode(){
super();
}
}
}//package com.google.analytics.core
Section 30
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public function Utils(){
super();
}
public static function trim(raw:String, everything:Boolean=false):String{
var i:int;
var iLeft:int;
var iRight:int;
if (raw == ""){
return ("");
};
var whitespaces:Array = [" ", "\n", "\r", "\t"];
var str:String = raw;
if (everything){
i = 0;
while ((((i < whitespaces.length)) && ((str.indexOf(whitespaces[i]) > -1)))) {
str = str.split(whitespaces[i]).join("");
i++;
};
} else {
iLeft = 0;
while ((((iLeft < str.length)) && ((whitespaces.indexOf(str.charAt(iLeft)) > -1)))) {
iLeft++;
};
str = str.substr(iLeft);
iRight = (str.length - 1);
while ((((iRight >= 0)) && ((whitespaces.indexOf(str.charAt(iRight)) > -1)))) {
iRight--;
};
str = str.substring(0, (iRight + 1));
};
return (str);
}
public static function generateHash(input:String):int{
var pos:int;
var current:int;
var hash = 1;
var leftMost7:int;
if (((!((input == null))) && (!((input == ""))))){
hash = 0;
pos = (input.length - 1);
while (pos >= 0) {
current = input.charCodeAt(pos);
hash = ((((hash << 6) & 268435455) + current) + (current << 14));
leftMost7 = (hash & 266338304);
if (leftMost7 != 0){
hash = (hash ^ (leftMost7 >> 21));
};
pos--;
};
};
return (hash);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(account:String):Boolean{
var rel:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (rel.test(account));
}
}
}//package com.google.analytics.core
Section 31
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\data;Cookie.as:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\data;Cookie.as:Date):void;
function set expiration(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\data;Cookie.as:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 32
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(domainHash:Number=NaN, sessionId:Number=NaN, firstTime:Number=NaN, lastTime:Number=NaN, currentTime:Number=NaN, sessionCount:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.sessionId = sessionId;
this.firstTime = firstTime;
this.lastTime = lastTime;
this.currentTime = currentTime;
this.sessionCount = sessionCount;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(value:Number):void{
_lastTime = value;
update();
}
public function set currentTime(value:Number):void{
_currentTime = value;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set sessionId(value:Number):void{
_sessionId = value;
update();
}
public function set sessionCount(value:Number):void{
_sessionCount = value;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(value:Number):void{
_firstTime = value;
update();
}
}
}//package com.google.analytics.data
Section 33
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(domainHash:Number=NaN, trackCount:Number=NaN, token:Number=NaN, lastTime:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.trackCount = trackCount;
this.token = token;
this.lastTime = lastTime;
}
public function set token(value:Number):void{
_token = value;
update();
}
public function set trackCount(value:Number):void{
_trackCount = value;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set lastTime(value:Number):void{
_lastTime = value;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 34
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(domainHash:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = domainHash;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
}
}//package com.google.analytics.data
Section 35
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(name:String, inURL:String, fields:Array, timespan:Number=0){
super();
this.name = name;
this.inURL = inURL;
this.fields = fields;
_timestamp(timespan);
}
public function isEmpty():Boolean{
var field:String;
var empty:int;
var i:int;
while (i < fields.length) {
field = fields[i];
if ((((this[field] is Number)) && (isNaN(this[field])))){
empty++;
} else {
if ((((this[field] is String)) && ((this[field] == "")))){
empty++;
};
};
i++;
};
if (empty == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(timespan:Number=NaN):void{
if (!isNaN(timespan)){
_timespan = timespan;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var field:String;
var i:int;
while (i < fields.length) {
field = fields[i];
if ((this[field] is Number)){
this[field] = NaN;
} else {
if ((this[field] is String)){
this[field] = "";
};
};
i++;
};
resetTimestamp();
update();
}
public function fromSharedObject(data:Object):void{
var field:String;
var len:int = fields.length;
var i:int;
while (i < len) {
field = fields[i];
if (data[field]){
this[field] = data[field];
};
i++;
};
if (data.creation){
this.creation = data.creation;
};
if (data.expiration){
this.expiration = data.expiration;
};
}
private function _timestamp(timespan:Number):void{
creation = new Date();
_timespan = timespan;
if (timespan > 0){
expiration = new Date((creation.valueOf() + timespan));
};
}
public function isExpired():Boolean{
var current:Date = new Date();
var diff:Number = (expiration.valueOf() - current.valueOf());
if (diff <= 0){
return (true);
};
return (false);
}
public function set expiration(value:Date):void{
_expiration = value;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var field:String;
var value:*;
var testData:Array;
var data:Array = [];
var testOut:String = "";
var i:int;
while (i < fields.length) {
field = fields[i];
value = this[field];
if ((value is String)){
if (value == ""){
value = "-";
data.push(value);
} else {
data.push(value);
};
} else {
if ((value is Number)){
if (value == 0){
data.push(value);
} else {
if (isNaN(value)){
value = "-";
data.push(value);
} else {
data.push(value);
};
};
};
};
i++;
};
if (isEmpty()){
return ("-");
};
return (("" + data.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var field:String;
var value:*;
var data:Object = {};
var i:int;
for (;i < fields.length;i++) {
field = fields[i];
value = this[field];
if ((value is String)){
data[field] = value;
} else {
if (value == 0){
data[field] = value;
} else {
if (isNaN(value)){
continue;
} else {
data[field] = value;
};
};
};
};
data.creation = creation;
data.expiration = expiration;
return (data);
}
public function toString(showTimestamp:Boolean=false):String{
var field:String;
var value:*;
var data:Array = [];
var len:int = fields.length;
var i:int;
for (;i < len;i++) {
field = fields[i];
value = this[field];
if ((value is String)){
data.push((((field + ": \"") + value) + "\""));
} else {
if (value == 0){
data.push(((field + ": ") + value));
} else {
if (isNaN(value)){
continue;
} else {
data.push(((field + ": ") + value));
};
};
};
};
var str = (((name.toUpperCase() + " {") + data.join(", ")) + "}");
if (showTimestamp){
str = (str + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (str);
}
public function set creation(value:Date):void{
_creation = value;
}
}
}//package com.google.analytics.data
Section 36
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(hash:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = hash;
}
public function set hash(value:Number):void{
_hash = value;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 37
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(domainHash:Number=NaN, value:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.value = value;
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set value(value:String):void{
_value = value;
update();
}
}
}//package com.google.analytics.data
Section 38
//UTMX (com.google.analytics.data.UTMX)
package com.google.analytics.data {
public class UTMX extends UTMCookie {
private var _value:String;
public function UTMX(){
super("utmx", "__utmx", ["value"], 0);
_value = "-";
}
public function get value():String{
return (_value);
}
public function set value(value:String):void{
_value = value;
}
}
}//package com.google.analytics.data
Section 39
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(domainHash:Number=NaN, campaignCreation:Number=NaN, campaignSessions:Number=NaN, responseCount:Number=NaN, campaignTracking:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.campaignCreation = campaignCreation;
this.campaignSessions = campaignSessions;
this.responseCount = responseCount;
this.campaignTracking = campaignTracking;
}
public function set responseCount(value:Number):void{
_responseCount = value;
update();
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set campaignCreation(value:Number):void{
_campaignCreation = value;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(value:Number):void{
_campaignSessions = value;
update();
}
public function set campaignTracking(value:String):void{
_campaignTracking = value;
update();
}
}
}//package com.google.analytics.data
Section 40
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(projectId:Number, type:String, num:Number, value:String):void{
if (!hasProject(projectId)){
_projectData[projectId] = {};
};
if (_projectData[projectId][type] == undefined){
_projectData[projectId][type] = [];
};
_projectData[projectId][type][num] = value;
_hasData = (_hasData + 1);
}
private function _renderProject(project:Object):String{
var i:int;
var data:Array;
var result:String = "";
var needTypeQualifier:Boolean;
var l:int = _set.length;
i = 0;
while (i < l) {
data = project[_set[i]];
if (data){
if (needTypeQualifier){
result = (result + _set[i]);
};
result = (result + _renderDataType(data));
needTypeQualifier = false;
} else {
needTypeQualifier = true;
};
i++;
};
return (result);
}
public function hasProject(projectId:Number):Boolean{
return (_projectData[projectId]);
}
public function clearKey(projectId:Number):void{
_clearInternal(projectId, _key);
}
private function _renderDataType(data:Array):String{
var str:String;
var i:int;
var result:Array = [];
i = 0;
while (i < data.length) {
if (data[i] != undefined){
str = "";
if (((!((i == _minimum))) && ((data[(i - 1)] == undefined)))){
str = (str + i.toString());
str = (str + _delimNumValue);
};
str = (str + _escapeExtensibleValue(data[i]));
result.push(str);
};
i++;
};
return (((_delimBegin + result.join(_delimSet)) + _delimEnd));
}
public function getKey(projectId:Number, num:Number):String{
return ((_getInternal(projectId, _key, num) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(extObject:X10=null):String{
var projectId:String;
if (!extObject){
return (renderUrlString());
};
var result:Array = [extObject.renderUrlString()];
for (projectId in _projectData) {
if (((hasProject(Number(projectId))) && (!(extObject.hasProject(Number(projectId)))))){
result.push((projectId + _renderProject(_projectData[projectId])));
};
};
return (result.join(""));
}
public function setValue(projectId:Number, num:Number, value:Number):Boolean{
if (((((!((Math.round(value) == value))) || (isNaN(value)))) || ((value == Infinity)))){
return (false);
};
_setInternal(projectId, _value, num, value.toString());
return (true);
}
public function renderUrlString():String{
var projectId:String;
var result:Array = [];
for (projectId in _projectData) {
if (hasProject(Number(projectId))){
result.push((projectId + _renderProject(_projectData[projectId])));
};
};
return (result.join(""));
}
private function _getInternal(projectId:Number, type:String, num:Number):Object{
if (((hasProject(projectId)) && (!((_projectData[projectId][type] == undefined))))){
return (_projectData[projectId][type][num]);
};
return (undefined);
}
public function setKey(projectId:Number, num:Number, value:String):Boolean{
_setInternal(projectId, _key, num, value);
return (true);
}
public function clearValue(projectId:Number):void{
_clearInternal(projectId, _value);
}
private function _clearInternal(projectId:Number, type:String):void{
var isEmpty:Boolean;
var i:int;
var l:int;
if (((hasProject(projectId)) && (!((_projectData[projectId][type] == undefined))))){
_projectData[projectId][type] = undefined;
isEmpty = true;
l = _set.length;
i = 0;
while (i < l) {
if (_projectData[projectId][_set[i]] != undefined){
isEmpty = false;
break;
};
i++;
};
if (isEmpty){
_projectData[projectId] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(projectId:Number, num:Number){
var value:* = _getInternal(projectId, _value, num);
if (value == null){
return (null);
};
return (Number(value));
}
private function _escapeExtensibleValue(value:String):String{
var i:int;
var c:String;
var escaped:String;
var result:String = "";
i = 0;
while (i < value.length) {
c = value.charAt(i);
escaped = _escapeCharMap[c];
if (escaped){
result = (result + escaped);
} else {
result = (result + c);
};
i++;
};
return (result);
}
}
}//package com.google.analytics.data
Section 41
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.text.*;
import flash.net.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
super();
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(data:String):void{
_sheet.parseCSS(data);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 42
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(text:String, actions:Array, tag:String="uiAlert", color:uint=0, alignement:Align=null, stickToEdge:Boolean=false, actionOnNextLine:Boolean=true){
if (color == 0){
color = Style.alertColor;
};
if (alignement == null){
alignement = Align.center;
};
super(text, tag, color, alignement, stickToEdge);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = actionOnNextLine;
_actions = [];
var i:int;
while (i < actions.length) {
actions[i].container = this;
_actions.push(actions[i]);
i++;
};
}
private function _defineActions():void{
var action:AlertAction;
var str:String = "";
if (actionOnNextLine){
str = (str + "\n");
} else {
str = (str + " |");
};
str = (str + " ");
var actions:Array = [];
var i:int;
while (i < _actions.length) {
action = _actions[i];
actions.push((((("<a href=\"event:" + action.activator) + "\">") + action.name) + "</a>"));
i++;
};
str = (str + actions.join(" | "));
appendText(str, "uiAlertAction");
}
protected function isValidAction(action:String):Boolean{
var i:int;
while (i < _actions.length) {
if (action == _actions[i].activator){
return (true);
};
i++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(name:String):AlertAction{
var i:int;
while (i < _actions.length) {
if (name == _actions[i].activator){
return (_actions[i]);
};
i++;
};
return (null);
}
protected function spaces(num:int):String{
var str:String = "";
var spc:String = " ";
var i:int;
while (i < (num + 1)) {
str = (str + spc);
i++;
};
return (str);
}
override public function onLink(event:TextEvent):void{
var action:AlertAction;
if (isValidAction(event.text)){
action = getAction(event.text);
if (action){
action.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 43
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(name:String, activator:String, callback){
super();
this.name = name;
this.activator = activator;
_callback = callback;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 44
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 45
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public function Background(){
super();
}
public static function drawRounded(target, g:Graphics, width:uint=0, height:uint=0):void{
var W:uint;
var H:uint;
var R:uint = Style.roundedCorner;
if ((((width > 0)) && ((height > 0)))){
W = width;
H = height;
} else {
W = target.width;
H = target.height;
};
if (((target.stickToEdge) && (!((target.alignement == Align.none))))){
switch (target.alignement){
case Align.top:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, R, R);
break;
case Align.topLeft:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, 0, R);
break;
case Align.topRight:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, R, 0);
break;
case Align.bottom:
g.drawRoundRectComplex(0, 0, W, H, R, R, 0, 0);
break;
case Align.bottomLeft:
g.drawRoundRectComplex(0, 0, W, H, 0, R, 0, 0);
break;
case Align.bottomRight:
g.drawRoundRectComplex(0, 0, W, H, R, 0, 0, 0);
break;
case Align.left:
g.drawRoundRectComplex(0, 0, W, H, 0, R, 0, R);
break;
case Align.right:
g.drawRoundRectComplex(0, 0, W, H, R, 0, R, 0);
break;
case Align.center:
g.drawRoundRect(0, 0, W, H, R, R);
break;
};
} else {
g.drawRoundRect(0, 0, W, H, R, R);
};
}
}
}//package com.google.analytics.debug
Section 46
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint;
public function Debug(color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
if (alignement == null){
alignement = Align.bottom;
};
super("", "uiLabel", color, alignement, stickToEdge);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(message:String):void{
write(message, true);
}
private function _getLinesToDisplay(direction:int=0):Array{
var lines:Array;
var start:uint;
var end:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + direction);
} else {
if ((((_linediff > 0)) && ((direction < 0)))){
_linediff = (_linediff + direction);
};
};
start = ((_lines.length - maxLines) + _linediff);
end = (start + maxLines);
lines = _lines.slice(start, end);
} else {
lines = _lines;
};
return (lines);
}
private function onKey(event:KeyboardEvent=null):void{
var lines:Array;
switch (event.keyCode){
case Keyboard.DOWN:
lines = _getLinesToDisplay(1);
break;
case Keyboard.UP:
lines = _getLinesToDisplay(-1);
break;
default:
lines = null;
};
if (lines == null){
return;
};
text = lines.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
} else {
};
return (!NULL!);
}
public function write(message:String, bold:Boolean=false):void{
var inputLines:Array;
if (message.indexOf("") > -1){
inputLines = message.split("\n");
} else {
inputLines = [message];
};
var pre:String = "";
var post:String = "";
if (bold){
pre = "<b>";
post = "</b>";
};
var i:int;
while (i < inputLines.length) {
_lines.push(((pre + inputLines[i]) + post));
i++;
};
var lines:Array = _getLinesToDisplay();
text = lines.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 47
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import flash.net.*;
import flash.utils.*;
import com.google.analytics.core.*;
public class DebugConfiguration {
public var showHideKey:Number;// = 32
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;// = 8
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(value:Boolean):void{
_verbose = value;
}
public function set mode(value):void{
if ((value is String)){
switch (value){
case "geek":
value = VisualDebugMode.geek;
break;
case "advanced":
value = VisualDebugMode.advanced;
break;
case "basic":
default:
value = VisualDebugMode.basic;
};
};
_mode = value;
}
public function success(message:String):void{
if (layout){
layout.createSuccessAlert(message);
};
if (traceOutput){
trace((("[+] " + message) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(message);
};
if (traceOutput){
trace((("## " + message) + " ##"));
};
}
private function _filter(mode:VisualDebugMode=null):Boolean{
return (((mode) && ((int(mode) >= int(this.mode)))));
}
public function failure(message:String):void{
if (layout){
layout.createFailureAlert(message);
};
if (traceOutput){
trace((("[-] " + message) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(value:Boolean):void{
_active = value;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(message:String):void{
var msgs:Array;
var j:int;
var messages:Array = [];
var pre0:String = "";
var pre1:String = "";
if (this.mode == VisualDebugMode.geek){
pre0 = (getTimer() + " - ");
pre1 = (new Array(pre0.length).join(" ") + " ");
};
if (message.indexOf("\n") > -1){
msgs = message.split("\n");
j = 0;
while (j < msgs.length) {
if (msgs[j] == ""){
} else {
if (j == 0){
messages.push((pre0 + msgs[j]));
} else {
messages.push((pre1 + msgs[j]));
};
};
j++;
};
} else {
messages.push((pre0 + message));
};
var len:int = messages.length;
var i:int;
while (i < len) {
trace(messages[i]);
i++;
};
}
public function alert(message:String):void{
if (layout){
layout.createAlert(message);
};
if (traceOutput){
trace((("!! " + message) + " !!"));
};
}
public function info(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(message);
};
if (traceOutput){
trace(message);
};
}
public function alertGifRequest(message:String, request:URLRequest, ref:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(message, request, ref);
};
if (traceOutput){
trace(((">> " + message) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 48
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(debug:DebugConfiguration, text:String, actions:Array){
var alignement:Align = Align.bottomLeft;
var stickToEdge:Boolean;
var actionOnNextLine:Boolean;
if (debug.verbose){
text = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + text);
alignement = Align.center;
stickToEdge = false;
actionOnNextLine = true;
};
super(text, actions, "uiFailure", Style.failureColor, alignement, stickToEdge, actionOnNextLine);
}
}
}//package com.google.analytics.debug
Section 49
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(text:String, actions:Array){
super(text, actions);
}
}
}//package com.google.analytics.debug
Section 50
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import flash.net.*;
import com.google.analytics.core.*;
public interface ILayout {
function createAlert(:String):void;
function addToStage(:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(:String):void;
function createFailureAlert(:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 51
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(text:String="", timeout:uint=3000){
super(text, "uiInfo", Style.infoColor, Align.top, true);
if (timeout > 0){
_timer = new Timer(timeout, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(event:TextEvent):void{
switch (event.text){
case "hide":
close();
break;
};
}
public function onComplete(event:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 52
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(text:String="", tag:String="uiLabel", color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
super();
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = text;
_tag = tag;
if (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (color == 0){
color = Style.backgroundColor;
};
_color = color;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var g:Graphics = _background.graphics;
g.clear();
g.beginFill(_color);
var W:uint = _textField.width;
var H:uint = _textField.height;
if (forcedWidth > 0){
W = forcedWidth;
};
Background.drawRounded(this, g, W, H);
g.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(value:String, newtag:String=""):void{
if (value == ""){
return;
};
if (newtag == ""){
newtag = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + newtag) + "\">") + value) + "</span>"));
_text = (_text + value);
_draw();
resize();
}
public function set text(value:String):void{
if (value == ""){
value = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + value) + "</span>");
_text = value;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(value:String):void{
_tag = value;
text = "";
}
public function onLink(event:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 53
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.google.analytics.core.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(debug:DebugConfiguration, display:DisplayObject){
super();
_display = display;
_debug = debug;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(event:KeyboardEvent=null):void{
switch (event.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(message:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasWarning = true;
var w:Warning = new Warning(message, _debug.warningTimeout);
addToPanel("analytics", w);
w.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function bringToFront(visual:DisplayObject):void{
_display.stage.setChildIndex(visual, (_display.stage.numChildren - 1));
}
public function createFailureAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var fa:Alert = new FailureAlert(_debug, message, [actionClose]);
addToPanel("analytics", fa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function init():void{
var spaces = 10;
var W:uint = (_display.stage.stageWidth - (spaces * 2));
var H:uint = (_display.stage.stageHeight - (spaces * 2));
var mp:Panel = new Panel("analytics", W, H);
mp.alignement = Align.top;
mp.stickToEdge = false;
mp.title = ("Google Analytics v" + GATracker.version);
_mainPanel = mp;
addToStage(mp);
bringToFront(mp);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(name:String, visual:DisplayObject):void{
var panel:Panel;
var d:DisplayObject = _display.stage.getChildByName(name);
if (d){
panel = (d as Panel);
panel.addData(visual);
} else {
trace((("panel \"" + name) + "\" not found"));
};
}
private function _clearInfo(event:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(message:String, maxCharPerLine:int=0):String{
var line:String;
var CRLF:String = "\n";
var output:Array = [];
var lines:Array = message.split(CRLF);
if (maxCharPerLine == 0){
maxCharPerLine = _maxCharPerLine;
};
var i:int;
while (i < lines.length) {
line = lines[i];
while (line.length > maxCharPerLine) {
output.push(line.substr(0, maxCharPerLine));
line = line.substring(maxCharPerLine);
};
output.push(line);
i++;
};
return (output.join(CRLF));
}
private function _clearGRAlert(event:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var sa:Alert = new SuccessAlert(_debug, message, [actionClose]);
addToPanel("analytics", sa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(message:String):void{
message = _filterMaxChars(message);
var a:Alert = new Alert(message, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", a);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function createInfo(message:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasInfo = true;
var i:Info = new Info(message, _debug.infoTimeout);
addToPanel("analytics", i);
i.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(message);
};
}
public function createGIFRequestAlert(message:String, request:URLRequest, ref:GIFRequest):void{
var message = message;
var request = request;
var ref = ref;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(visual:DisplayObject):void{
_display.stage.addChild(visual);
}
private function _clearWarning(event:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(name:String, width:uint, height:uint):void{
var p:Panel = new Panel(name, width, height);
p.alignement = Align.center;
p.stickToEdge = false;
addToStage(p);
bringToFront(p);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 54
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(top:int=0, bottom:int=0, left:int=0, right:int=0){
super();
this.top = top;
this.bottom = bottom;
this.left = left;
this.right = right;
}
}
}//package com.google.analytics.debug
Section 55
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(name:String, width:uint, height:uint, backgroundColor:uint=0, borderColor:uint=0, baseAlpha:Number=0.3, alignement:Align=null, stickToEdge:Boolean=false){
super();
_name = name;
this.name = name;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = width;
forcedHeight = height;
this.baseAlpha = baseAlpha;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = width;
_data.forcedHeight = height;
_data.mouseEnabled = false;
_title = new Label(name, "uiLabel", 0xFFFFFF, Align.topLeft, stickToEdge);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (backgroundColor == 0){
backgroundColor = Style.backgroundColor;
};
_backgroundColor = backgroundColor;
if (borderColor == 0){
borderColor = Style.borderColor;
};
_borderColor = borderColor;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(event:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(value:Boolean):void{
_stickToEdge = value;
_title.stickToEdge = value;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var W:uint;
var H:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
W = forcedWidth;
H = forcedHeight;
} else {
W = _title.width;
H = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = W;
forcedHeight = H;
};
var g0:Graphics = _background.graphics;
g0.clear();
g0.beginFill(_backgroundColor);
Background.drawRounded(this, g0, W, H);
g0.endFill();
var g01:Graphics = _data.graphics;
g01.clear();
g01.beginFill(_backgroundColor, 0);
Background.drawRounded(this, g01, W, H);
g01.endFill();
var g1:Graphics = _border.graphics;
g1.clear();
g1.lineStyle(0.1, _borderColor);
Background.drawRounded(this, g1, W, H);
g1.endFill();
var g2:Graphics = _mask.graphics;
g2.clear();
g2.beginFill(_backgroundColor);
Background.drawRounded(this, g2, (W + 1), (H + 1));
g2.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(child:DisplayObject):void{
_data.addChild(child);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(value:String):void{
_title.text = value;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 56
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 57
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(debug:DebugConfiguration, text:String, actions:Array){
var alignement:Align = Align.bottomLeft;
var stickToEdge:Boolean;
var actionOnNextLine:Boolean;
if (debug.verbose){
text = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + text);
alignement = Align.center;
stickToEdge = false;
actionOnNextLine = true;
};
super(text, actions, "uiSuccess", Style.successColor, alignement, stickToEdge, actionOnNextLine);
}
}
}//package com.google.analytics.debug
Section 58
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(alignTarget:DisplayObject=null){
super();
listenResize = false;
alignement = Align.none;
this.alignTarget = alignTarget;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(event:Event):void{
layout();
resize();
}
protected function dispose():void{
var d:DisplayObject;
var i:int;
while (i < numChildren) {
d = getChildAt(i);
if (d){
removeChild(d);
};
i++;
};
}
public function set forcedHeight(value:uint):void{
_forcedHeight = value;
}
public function set forcedWidth(value:uint):void{
_forcedWidth = value;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(alignement:Align, target:DisplayObject=null):void{
var H:uint;
var W:uint;
var X:uint;
var Y:uint;
var t:UISprite;
if (target == null){
if ((parent is Stage)){
target = this.stage;
} else {
target = parent;
};
};
if (target == this.stage){
if (this.stage == null){
return;
};
H = this.stage.stageHeight;
W = this.stage.stageWidth;
X = 0;
Y = 0;
} else {
t = (target as UISprite);
if (t.forcedHeight){
H = t.forcedHeight;
} else {
H = t.height;
};
if (t.forcedWidth){
W = t.forcedWidth;
} else {
W = t.width;
};
X = 0;
Y = 0;
};
switch (alignement){
case Align.top:
x = ((W / 2) - (forcedWidth / 2));
y = (Y + margin.top);
break;
case Align.bottom:
x = ((W / 2) - (forcedWidth / 2));
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (X + margin.left);
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((X + W) - forcedWidth) - margin.right);
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((W / 2) - (forcedWidth / 2));
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (X + margin.left);
y = (Y + margin.top);
break;
case Align.topRight:
x = (((X + W) - forcedWidth) - margin.right);
y = (Y + margin.top);
break;
case Align.bottomLeft:
x = (X + margin.left);
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((X + W) - forcedWidth) - margin.right);
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((alignement == Align.none))))){
target.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = alignement;
this.alignTarget = target;
}
private function _onRemovedFromStage(event:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(event:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 59
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(text:String="", timeout:uint=3000){
super(text, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (timeout > 0){
_timer = new Timer(timeout, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(event:TextEvent):void{
switch (event.text){
case "hide":
close();
break;
};
}
public function onComplete(event:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 60
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 61
//Item (com.google.analytics.ecommerce.Item)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Item {
private var _price:String;
private var _id:String;
private var _sku:String;
private var _category:String;
private var _quantity:String;
private var _name:String;
public function Item(id:String, sku:String, name:String, category:String, price:String, quantity:String){
super();
this._id = id;
this._sku = sku;
this._name = name;
this._category = category;
this._price = price;
this._quantity = quantity;
}
public function set sku(value:String):void{
_sku = value;
}
public function get price():String{
return (_price);
}
public function get name():String{
return (_name);
}
public function get quantity():String{
return (_quantity);
}
public function set name(value:String):void{
_name = value;
}
public function set price(value:String):void{
_price = value;
}
public function get id():String{
return (_id);
}
public function get sku():String{
return (_sku);
}
public function set quantity(value:String):void{
_quantity = value;
}
public function toGifParams():Variables{
var vars:Variables = new Variables();
vars.URIencode = true;
vars.post = ["utmt", "utmtid", "utmipc", "utmipn", "utmiva", "utmipr", "utmiqt"];
vars.utmt = "item";
vars.utmtid = _id;
vars.utmipc = _sku;
vars.utmipn = _name;
vars.utmiva = _category;
vars.utmipr = _price;
vars.utmiqt = _quantity;
return (vars);
}
public function set id(value:String):void{
_id = value;
}
public function set category(value:String):void{
_category = value;
}
public function get category():String{
return (_category);
}
}
}//package com.google.analytics.ecommerce
Section 62
//Transaction (com.google.analytics.ecommerce.Transaction)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Transaction {
private var _items:Array;
private var _total:String;
private var _vars:Variables;
private var _shipping:String;
private var _city:String;
private var _state:String;
private var _country:String;
private var _tax:String;
private var _affiliation:String;
private var _id:String;
public function Transaction(id:String, affiliation:String, total:String, tax:String, shipping:String, city:String, state:String, country:String){
super();
this._id = id;
this._affiliation = affiliation;
this._total = total;
this._tax = tax;
this._shipping = shipping;
this._city = city;
this._state = state;
this._country = country;
_items = new Array();
}
public function get total():String{
return (_total);
}
public function getItemFromArray(i:Number):Item{
return (_items[i]);
}
public function set total(value:String):void{
_total = value;
}
public function getItem(sku:String):Item{
var i:Number;
i = 0;
while (i < _items.length) {
if (_items[i].sku == sku){
return (_items[i]);
};
i++;
};
return (null);
}
public function getItemsLength():Number{
return (_items.length);
}
public function addItem(sku:String, name:String, category:String, price:String, quantity:String):void{
var newItem:Item;
newItem = getItem(sku);
if (newItem == null){
newItem = new Item(_id, sku, name, category, price, quantity);
_items.push(newItem);
} else {
newItem.name = name;
newItem.category = category;
newItem.price = price;
newItem.quantity = quantity;
};
}
public function set shipping(value:String):void{
_shipping = value;
}
public function get country():String{
return (_country);
}
public function get state():String{
return (_state);
}
public function set tax(value:String):void{
_tax = value;
}
public function set affiliation(value:String):void{
_affiliation = value;
}
public function set state(value:String):void{
_state = value;
}
public function get id():String{
return (_id);
}
public function get tax():String{
return (_tax);
}
public function toGifParams():Variables{
var vars:Variables = new Variables();
vars.URIencode = true;
vars.utmt = "tran";
vars.utmtid = id;
vars.utmtst = affiliation;
vars.utmtto = total;
vars.utmttx = tax;
vars.utmtsp = shipping;
vars.utmtci = city;
vars.utmtrg = state;
vars.utmtco = country;
vars.post = ["utmtid", "utmtst", "utmtto", "utmttx", "utmtsp", "utmtci", "utmtrg", "utmtco"];
return (vars);
}
public function get affiliation():String{
return (_affiliation);
}
public function get city():String{
return (_city);
}
public function get shipping():String{
return (_shipping);
}
public function set id(value:String):void{
_id = value;
}
public function set city(value:String):void{
_city = value;
}
public function set country(value:String):void{
_country = value;
}
}
}//package com.google.analytics.ecommerce
Section 63
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(type:String, tracker:AnalyticsTracker, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.tracker = tracker;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 64
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(debug:DebugConfiguration){
super(debug);
}
public function set vid(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", value);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", value);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", value);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 65
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(debug:DebugConfiguration){
super(debug);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var obj:Object = call(cache_properties_js);
if (obj){
_host = obj.host;
_language = obj.language;
_characterSet = obj.characterSet;
_colorDepth = obj.colorDepth;
_location = obj.location;
_pathname = obj.pathname;
_protocol = obj.protocol;
_search = obj.search;
_referrer = obj.referrer;
_title = obj.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var lang:String = getProperty("navigator.language");
if (lang == null){
lang = getProperty("navigator.browserLanguage");
};
_language = lang;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var cs:String = getProperty("document.characterSet");
if (cs == null){
cs = getProperty("document.charset");
};
_characterSet = cs;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 66
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import flash.system.*;
import com.google.analytics.debug.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(debug:DebugConfiguration){
super();
_debug = debug;
}
public function getProperty(name:String){
return (call((name + ".valueOf")));
}
public function hasProperty(path:String):Boolean{
return (call(hasProperty_js, path));
}
public function setProperty(path:String, value):void{
call(setProperty_js, path, value);
}
public function executeBlock(data:String):void{
var data = data;
if (isAvailable()){
ExternalInterface.call(data);
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + _slot1.message));
};
};
}
public function getPropertyString(name:String):String{
return (call((name + ".toString")));
}
public function setPropertyByReference(path:String, target:String):void{
call(setPropertyRef_js, path, target);
}
public function call(functionName:String, ... _args){
var output:String;
var functionName = functionName;
var args = _args;
if (isAvailable()){
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + _slot1.message));
};
};
return (null);
}
public function isAvailable():Boolean{
var available:Boolean = ExternalInterface.available;
if (((available) && ((Capabilities.playerType == "External")))){
available = false;
};
if (((((!(available)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (available);
}
}
}//package com.google.analytics.external
Section 67
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import flash.system.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(url:String="", app:String="", version:String="", debug:DebugConfiguration=null, dom:HTMLDOM=null){
var v:Version;
super();
if (app == ""){
if (isAIR()){
app = "AIR";
} else {
app = "Flash";
};
};
if (version == ""){
v = flashVersion;
} else {
v = Version.fromString(version);
};
_url = url;
_appName = app;
_appVersion = v;
_debug = debug;
_dom = dom;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _search:String = _dom.search;
if (_search){
return (_search);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var v:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (v);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _charset:String;
if (System.useCodePage){
_charset = _dom.characterSet;
if (_charset){
return (_charset);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var color:String;
switch (Capabilities.screenColor){
case "bw":
color = "1";
break;
case "gray":
color = "2";
break;
case "color":
default:
color = "24";
};
var _colorDepth:String = _dom.colorDepth;
if (_colorDepth){
color = _colorDepth;
};
return (color);
}
private function _findProtocol():void{
var URL:String;
var test:String;
var p:Protocols = Protocols.none;
if (_url != ""){
URL = _url.toLowerCase();
test = URL.substr(0, 5);
switch (test){
case "file:":
p = Protocols.file;
break;
case "http:":
p = Protocols.HTTP;
break;
case "https":
if (URL.charAt(5) == ":"){
p = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _proto:String = _dom.protocol;
var proto:String = (p.toString() + ":").toLowerCase();
if (((((_proto) && (!((_proto == proto))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + proto) + ", DOM=") + _proto));
};
_protocol = p;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var p:String = Capabilities.manufacturer;
return (p.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(value:String):void{
_appName = value;
userAgent.applicationProduct = value;
}
function set url(value:String):void{
_url = value;
}
public function get referrer():String{
var _referrer:String = _dom.referrer;
if (_referrer){
return (_referrer);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _lang:String = _dom.language;
var lang:String = Capabilities.language;
if (_lang){
if ((((_lang.length > lang.length)) && ((_lang.substr(0, lang.length) == lang)))){
lang = _lang;
};
};
return (lang);
}
public function get domainName():String{
var URL:String;
var str:String;
var end:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
URL = _url.toLowerCase();
if (protocol == Protocols.HTTP){
str = URL.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
str = URL.split("https://").join("");
};
};
end = str.indexOf("/");
if (end > -1){
str = str.substring(0, end);
};
return (str);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(custom:UserAgent):void{
_userAgent = custom;
}
public function set appVersion(value:Version):void{
_appVersion = value;
userAgent.applicationVersion = value.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _pathname:String = _dom.pathname;
if (_pathname){
return (_pathname);
};
return ("");
}
public function get documentTitle():String{
var _title:String = _dom.title;
if (_title){
return (_title);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 68
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 69
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
public function Timespan(){
super();
}
}
}//package com.google.analytics.utils
Section 70
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(url:String=""){
super();
_url = url.toLowerCase();
}
public function get domain():String{
var parts:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
parts = hostName.split(".");
switch (parts.length){
case 2:
return (hostName);
case 3:
if (parts[1] == "co"){
return (hostName);
};
parts.shift();
return (parts.join("."));
case 4:
parts.shift();
return (parts.join("."));
};
};
return ("");
}
public function get path():String{
var _path:String = _url;
if (_path.indexOf("://") > -1){
_path = _path.split("://")[1];
};
if (_path.indexOf(hostName) == 0){
_path = _path.substr(hostName.length);
};
if (_path.indexOf("?") > -1){
_path = _path.split("?")[0];
};
if (_path.charAt(0) != "/"){
_path = ("/" + _path);
};
return (_path);
}
public function get protocol():Protocols{
var proto:String = _url.split("://")[0];
switch (proto){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var hostname:String = _url;
if (hostname.indexOf("://") > -1){
hostname = hostname.split("://")[1];
};
if (hostname.indexOf("/") > -1){
hostname = hostname.split("/")[0];
};
if (hostname.indexOf("?") > -1){
hostname = hostname.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (hostname);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _search:String = _url;
if (_search.indexOf("://") > -1){
_search = _search.split("://")[1];
};
if (_search.indexOf(hostName) == 0){
_search = _search.substr(hostName.length);
};
if (_search.indexOf("?") > -1){
_search = _search.split("?")[1];
} else {
_search = "";
};
return (_search);
}
}
}//package com.google.analytics.utils
Section 71
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import flash.system.*;
import com.google.analytics.core.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(localInfo:Environment, product:String="", version:String=""){
super();
_localInfo = localInfo;
applicationProduct = product;
_version = Version.fromString(version);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var vp:String = "";
if (_localInfo.isAIR()){
vp = (vp + "AIR");
} else {
vp = (vp + "FlashPlayer");
};
vp = (vp + "/");
vp = (vp + _version.toString(3));
return (vp);
}
public function toString():String{
var UA:String = "";
UA = (UA + applicationProductToken);
if (applicationComment != ""){
UA = (UA + (" " + applicationComment));
};
if (tamarinProductToken != ""){
UA = (UA + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
UA = (UA + (" " + vendorProductToken));
};
return (UA);
}
public function get applicationComment():String{
var comment:Array = [];
comment.push(_localInfo.platform);
comment.push(_localInfo.playerType);
if (!UserAgent.minimal){
comment.push(_localInfo.operatingSystem);
comment.push(_localInfo.language);
};
if (Capabilities.isDebugger){
comment.push("DEBUG");
};
if (comment.length > 0){
return ((("(" + comment.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(value:String):void{
_version = Version.fromString(value);
}
public function get applicationProductToken():String{
var token:String = applicationProduct;
if (applicationVersion != ""){
token = (token + ("/" + applicationVersion));
};
return (token);
}
public function set applicationProduct(value:String):void{
_applicationProduct = value;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 72
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(source:String=null, pre:Array=null, post:Array=null){
pre = [];
post = [];
super();
if (source){
decode(source);
};
if (pre){
this.pre = pre;
};
if (post){
this.post = post;
};
}
private function _join(vars:Variables):void{
var prop:String;
if (!vars){
return;
};
for (prop in vars) {
this[prop] = vars[prop];
};
}
public function join(... _args):void{
var l:int = _args.length;
var i:int;
while (i < l) {
if (!(_args[i] is Variables)){
} else {
_join(_args[i]);
};
i++;
};
}
public function toString():String{
var value:String;
var p:String;
var component:String;
var i:int;
var j:int;
var priority:String;
var last:String;
var data:Array = [];
for (p in this) {
value = this[p];
if (URIencode){
value = encodeURI(value);
};
data.push(((p + "=") + value));
};
if (sort){
data.sort();
};
if (pre.length > 0){
pre.reverse();
i = 0;
while (i < pre.length) {
priority = pre[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(priority) == 0){
data.unshift(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
pre.reverse();
};
if (post.length > 0){
i = 0;
while (i < post.length) {
last = post[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(last) == 0){
data.push(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
};
return (data.join("&"));
}
public function decode(source:String):void{
var data:Array;
var prop:String;
var name:String;
var value:String;
var tmp:Array;
if (source == ""){
return;
};
if (source.charAt(0) == "?"){
source = source.substr(1, source.length);
};
if (source.indexOf("&") > -1){
data = source.split("&");
} else {
data = [source];
};
var i:int;
while (i < data.length) {
prop = data[i];
if (prop.indexOf("=") > -1){
tmp = prop.split("=");
name = tmp[0];
value = decodeURI(tmp[1]);
this[name] = value;
};
i++;
};
}
public function toURLVariables():URLVariables{
var p:String;
var urlvars:URLVariables = new URLVariables();
for (p in this) {
urlvars[p] = this[p];
};
return (urlvars);
}
}
}//package com.google.analytics.utils
Section 73
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(major:uint=0, minor:uint=0, build:uint=0, revision:uint=0){
var v:Version;
super();
if ((((((((major > _maxMajor)) && ((minor == 0)))) && ((build == 0)))) && ((revision == 0)))){
v = Version.fromNumber(major);
major = v.major;
minor = v.minor;
build = v.build;
revision = v.revision;
};
this.major = major;
this.minor = minor;
this.build = build;
this.revision = revision;
}
public function toString(fields:int=0):String{
var arr:Array;
if ((((fields <= 0)) || ((fields > 4)))){
fields = getFields();
};
switch (fields){
case 1:
arr = [major];
break;
case 2:
arr = [major, minor];
break;
case 3:
arr = [major, minor, build];
break;
case 4:
default:
arr = [major, minor, build, revision];
};
return (arr.join(_separator));
}
public function set revision(value:uint):void{
_revision = Math.min(value, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(value:uint):void{
_build = Math.min(value, _maxBuild);
}
public function set minor(value:uint):void{
_minor = Math.min(value, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(value:uint):void{
_major = Math.min(value, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var f = 4;
if (revision == 0){
f--;
};
if ((((f == 3)) && ((build == 0)))){
f--;
};
if ((((f == 2)) && ((minor == 0)))){
f--;
};
return (f);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(o):Boolean{
if (!(o is Version)){
return (false);
};
if ((((((((o.major == major)) && ((o.minor == minor)))) && ((o.build == build)))) && ((o.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(value:String="", separator:String="."):Version{
var values:Array;
var v:Version = new (Version);
if ((((value == "")) || ((value == null)))){
return (v);
};
if (value.indexOf(separator) > -1){
values = value.split(separator);
v.major = parseInt(values[0]);
v.minor = parseInt(values[1]);
v.build = parseInt(values[2]);
v.revision = parseInt(values[3]);
} else {
v.major = parseInt(value);
};
return (v);
}
public static function fromNumber(value:Number=0):Version{
var v:Version = new (Version);
if (((((((((((isNaN(value)) || ((value == 0)))) || ((value < 0)))) || ((value == Number.MAX_VALUE)))) || ((value == Number.POSITIVE_INFINITY)))) || ((value == Number.NEGATIVE_INFINITY)))){
return (v);
};
v.major = (value >>> 28);
v.minor = ((value & 251658240) >>> 24);
v.build = ((value & 0xFF0000) >>> 16);
v.revision = (value & 0xFFFF);
return (v);
}
}
}//package com.google.analytics.utils
Section 74
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(account:String, debug:DebugConfiguration, jsproxy:JavascriptProxy){
var msg0:String;
var msg1:String;
var msg2:String;
super();
_account = account;
_debug = debug;
_proxy = jsproxy;
if (!_checkGAJS()){
msg0 = "";
msg0 = (msg0 + "ga.js not found, be sure to check if\n");
msg0 = (msg0 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
msg0 = (msg0 + "is included in the HTML.");
_debug.warning(msg0);
throw (new Error(msg0));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
msg1 = "";
msg1 = (msg1 + "The Google Analytics tracking code was not found on the container page\n");
msg1 = (msg1 + "we create it");
_debug.info(msg1, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(account)){
_createTrackingObject(account);
} else {
if (_checkTrackingObject(account)){
_linkTrackingObject(account);
} else {
msg2 = "";
msg2 = (msg2 + (("JS Object \"" + account) + "\" doesn't exist in DOM\n"));
msg2 = (msg2 + "Bridge object not created.");
_debug.warning(msg2);
throw (new Error(msg2));
};
};
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_debug.info((((("link( " + targetUrl) + ", ") + useHash) + " )"));
_call("_link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_call("_addOrganic", newOrganicEngine);
}
public function setAllowLinker(enable:Boolean):void{
_debug.info((("setAllowLinker( " + enable) + " )"));
_call("_setAllowLinker", enable);
}
public function getLinkerUrl(url:String="", useHash:Boolean=false):String{
_debug.info((((("getLinkerUrl(" + url) + ", ") + useHash) + ")"));
return (_call("_getLinkerUrl", url, useHash));
}
private function _linkTrackingObject(path:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, path);
}
public function setClientInfo(enable:Boolean):void{
_debug.info((("setClientInfo( " + enable) + " )"));
_call("_setClientInfo", enable);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
var param = 2;
if (((label) && (!((label == ""))))){
param = 3;
};
if ((((param == 3)) && (!(isNaN(value))))){
param = 4;
};
switch (param){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label, value));
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label));
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
return (_call("_trackEvent", category, action));
};
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_debug.info((("setCookieTimeout( " + newDefaultTimeout) + " )"));
_call("_setCookieTimeout", newDefaultTimeout);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
_call("_trackPageview", pageURL);
}
private function _checkValidTrackingObject(account:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, account));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning((((("linkByPost( " + formObject) + ", ") + useHash) + " ) not implemented"));
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _call(functionName:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + functionName));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(account:String):Boolean{
var hasObj:Boolean = _proxy.hasProperty(account);
var isTracker:Boolean = _proxy.hasProperty((account + "._getAccount"));
return (((hasObj) && (isTracker)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(newCampNameKey:String):void{
_debug.info((("setCampNameKey( " + newCampNameKey) + " )"));
_call("_setCampNameKey", newCampNameKey);
}
public function setDetectFlash(enable:Boolean):void{
_debug.info((("setDetectFlash( " + enable) + " )"));
_call("_setDetectFlash", enable);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_debug.info((("addItem( " + [item, sku, name, category, price, quantity].join(", ")) + " )"));
_call("_addItem", item, sku, name, category, price, quantity);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(newVal:String):void{
_debug.info((("setVar( " + newVal) + " )"));
_call("_setVar", newVal);
}
public function setDomainName(newDomainName:String):void{
_debug.info((("setDomainName( " + newDomainName) + " )"));
_call("_setDomainName", newDomainName);
}
public function hasTrackingAccount(account:String):Boolean{
if (Utils.validateAccount(account)){
return (_checkValidTrackingObject(account));
};
return (_checkTrackingObject(account));
}
public function setCampSourceKey(newCampSrcKey:String):void{
_debug.info((("setCampSourceKey( " + newCampSrcKey) + " )"));
_call("_setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):void{
_debug.info((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " )"));
_call("_addTrans", orderId, affiliation, total, tax, shipping, city, state, country);
}
public function setCampContentKey(newCampContentKey:String):void{
_debug.info((("setCampContentKey( " + newCampContentKey) + " )"));
_call("_setCampContentKey", newCampContentKey);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(enable:Boolean):void{
_debug.info((("setAllowAnchor( " + enable) + " )"));
_call("_setAllowAnchor", enable);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_debug.info((("setLocalGifPath( " + newLocalGifPath) + " )"));
_call("_setLocalGifPath", newLocalGifPath);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(newCookiePath:String):void{
_debug.info((("setCookiePath( " + newCookiePath) + " )"));
_call("_setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
_debug.info((("setSampleRate( " + newRate) + " )"));
_call("_setSampleRate", newRate);
}
public function setAllowHash(enable:Boolean):void{
_debug.info((("setAllowHash( " + enable) + " )"));
_call("_setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_call("_addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
_debug.info((("setCampNOKey( " + newCampNOKey) + " )"));
_call("_setCampNOKey", newCampNOKey);
}
public function cookiePathCopy(newPath:String):void{
_debug.info((("cookiePathCopy( " + newPath) + " )"));
_call("_cookiePathCopy", newPath);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(enable:Boolean):void{
_debug.info((("setDetectTitle( " + enable) + " )"));
_call("_setDetectTitle", enable);
}
private function _createTrackingObject(account:String):void{
_proxy.call(_createTrackingObject_js, account);
}
public function setCampaignTrack(enable:Boolean):void{
_debug.info((("setCampaignTrack( " + enable) + " )"));
_call("_setCampaignTrack", enable);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
_debug.info((("setCampTermKey( " + newCampTermKey) + " )"));
_call("_setCampTermKey", newCampTermKey);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(newCampMedKey:String):void{
_debug.info((("setCampMediumKey( " + newCampMedKey) + " )"));
_call("_setCampMediumKey", newCampMedKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_call("_addIgnoredRef", newIgnoredReferrer);
}
public function setSessionTimeout(newTimeout:int):void{
_debug.info((("setSessionTimeout( " + newTimeout) + " )"));
_call("_setSessionTimeout", newTimeout);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 75
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(debug:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = debug;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(engine:String, keyword:String):void{
var engine = engine;
var keyword = keyword;
_organic.addSource(engine, keyword);
//unresolved jump
var _slot1 = e;
if (((_debug) && (_debug.active))){
_debug.warning(_slot1.message);
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(value:Number):void{
if (value <= 0){
value = 0.1;
};
if (value > 1){
value = 1;
};
value = Number(value.toFixed(2));
_sampleRate = value;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 76
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function setDetectTitle(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function setLocalRemoteServerMode():void;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function setAllowLinker(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function setCampNameKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function clearIgnoredRef():void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void;
function getDetectFlash():Boolean;
function setCampaignTrack(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function createEventTracker(void:String):EventTracker;
function setCookieTimeout(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:int):void;
function setAllowAnchor(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String=""):void;
function setLocalGifPath(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function getVersion():String;
function getLocalGifPath():String;
function getServiceMode():ServerOperationMode;
function setVar(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredRef(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function setClientInfo(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function setCookiePath(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function setSampleRate(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Number):void;
function setSessionTimeout(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:int):void;
function setRemoteServerMode():void;
function setDomainName(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredOrganic(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function setAllowHash(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function getClientInfo():Boolean;
function cookiePathCopy(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics\v4;GoogleAnalyticsAPI.as:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 77
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import flash.net.*;
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.ecommerce.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _ecom:Ecommerce;
private var _account:String;
public function Tracker(account:String, config:Configuration, debug:DebugConfiguration, info:Environment, buffer:Buffer, gifRequest:GIFRequest, adSense:AdSenseGlobals, ecom:Ecommerce){
var msg:String;
super();
_account = account;
_config = config;
_debug = debug;
_info = info;
_buffer = buffer;
_gifRequest = gifRequest;
_adSense = adSense;
_ecom = ecom;
if (!Utils.validateAccount(account)){
msg = (("Account \"" + account) + "\" is not valid.");
_debug.warning(msg);
throw (new Error(msg));
};
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_config.organic.addSource(newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
_config.allowLinker = enable;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function getLinkerUrl(targetUrl:String="", useHash:Boolean=false):String{
_initData();
_debug.info((((("getLinkerUrl( " + targetUrl) + ", ") + useHash.toString()) + " )"));
return (_buffer.getLinkerUrl(targetUrl, useHash));
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
_initData();
var success:Boolean;
var params = 2;
if (((!((category == ""))) && (!((action == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, category);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, action);
if (label){
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, label);
params = 3;
};
if (!isNaN(value)){
success = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, value);
params = 4;
};
if (success){
_debug.info(((("valid event tracking call\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
success = false;
};
switch (params){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
};
return (success);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(pageURL);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + pageURL) + " ) failed"));
};
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_config.conversionTimeout = newDefaultTimeout;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
var i:Number;
var j:Number;
var curTrans:Transaction;
_initData();
var searchStrings:Array = new Array();
if (_takeSample()){
i = 0;
while (i < _ecom.getTransLength()) {
curTrans = _ecom.getTransFromArray(i);
searchStrings.push(curTrans.toGifParams());
j = 0;
while (j < curTrans.getItemsLength()) {
searchStrings.push(curTrans.getItemFromArray(j).toGifParams());
j++;
};
i++;
};
i = 0;
while (i < searchStrings.length) {
_gifRequest.send(_account, searchStrings[i]);
i++;
};
};
}
public function setClientInfo(enable:Boolean):void{
_config.detectClientInfo = enable;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning("linkByPost not implemented in AS3 mode");
}
private function _initData():void{
var data0:String;
var data:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
data0 = "";
data0 = (data0 + "_initData 0");
data0 = (data0 + ("\ndomain name: " + _config.domainName));
data0 = (data0 + ("\ndomain hash: " + _domainHash));
data0 = (data0 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(data0, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
_debug.info(("Search: " + _info.locationSearch));
_debug.info(("CampaignTrackig: " + _buffer.utmz.campaignTracking));
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
data = "";
data = (data + "_initData (misc)");
data = (data + ("\nflash version: " + _info.flashVersion.toString(4)));
data = (data + ("\nprotocol: " + _info.protocol));
data = (data + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
data = (data + ("\nlanguage: " + _info.language));
data = (data + ("\ndomain hash: " + _getDomainHash()));
data = (data + ("\nuser-agent: " + _info.userAgent));
_debug.info(data, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(opt_xObj:X10=null):void{
var searchVariables:Variables;
var eventInfo:EventInfo;
var eventvars:Variables;
var generalvars:Variables;
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
eventInfo = new EventInfo(true, _x10Module, opt_xObj);
eventvars = eventInfo.toVariables();
generalvars = _renderMetricsSearchVariables();
searchVariables.join(eventvars, generalvars);
_gifRequest.send(_account, searchVariables, false, true);
};
}
public function setDetectFlash(enable:Boolean):void{
_config.detectFlash = enable;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(newCampNameKey:String):void{
_config.campaignKey.UCCN = newCampNameKey;
var msg = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCN]"));
} else {
_debug.info(msg);
};
}
private function _formatReferrer():String{
var domainName:String;
var ref:URL;
var dom:URL;
var referrer:String = _info.referrer;
if ((((referrer == "")) || ((referrer == "localhost")))){
referrer = "-";
} else {
domainName = _info.domainName;
ref = new URL(referrer);
dom = new URL(("http://" + domainName));
if (ref.hostName == domainName){
return ("-");
};
if (dom.domain == ref.domain){
if (dom.subDomain != ref.subDomain){
referrer = "0";
};
};
if ((((referrer.charAt(0) == "[")) && (referrer.charAt((referrer.length - 1))))){
referrer = "-";
};
};
_debug.info(("formated referrer: " + referrer), VisualDebugMode.advanced);
return (referrer);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(id:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
var parentTrans:Transaction;
parentTrans = _ecom.getTransaction(id);
if (parentTrans == null){
parentTrans = _ecom.addTransaction(id, "", "", "", "", "", "", "");
};
parentTrans.addItem(sku, name, category, price.toString(), quantity.toString());
if (_debug.active){
_debug.info((("addItem( " + [id, sku, name, category, price, quantity].join(", ")) + " )"));
};
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(newVal:String):void{
var variables:Variables;
if (((!((newVal == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = encodeURI(newVal);
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + newVal) + " )"));
if (_takeSample()){
variables = new Variables();
variables.utmt = "var";
_gifRequest.send(_account, variables);
};
} else {
_debug.warning((("setVar \"" + newVal) + "\" is ignored"));
};
}
public function setDomainName(newDomainName:String):void{
if (newDomainName == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (newDomainName == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = newDomainName;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var domainName:String;
if (_config.domain.mode == DomainNameMode.auto){
domainName = _info.domainName;
if (domainName.substring(0, 4) == "www."){
domainName = domainName.substring(4);
};
_config.domain.name = domainName;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):void{
_ecom.addTransaction(orderId, affiliation, total.toString(), tax.toString(), shipping.toString(), city, state, country);
if (_debug.active){
_debug.info((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " );"));
};
}
private function _renderMetricsSearchVariables(pageURL:String=""):Variables{
var campvars:Variables;
var variables:Variables = new Variables();
variables.URIencode = true;
var docInfo:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, pageURL, _adSense);
_debug.info(("docInfo: " + docInfo.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
campvars = _campaignInfo.toVariables();
};
var browservars:Variables = _browserInfo.toVariables();
variables.join(docInfo.toVariables(), browservars, campvars);
return (variables);
}
public function setCampContentKey(newCampContentKey:String):void{
_config.campaignKey.UCCT = newCampContentKey;
var msg = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCT]"));
} else {
_debug.info(msg);
};
}
private function _handleCookie():void{
var data0:String;
var data1:String;
var vid:Array;
var data2:String;
if (_config.allowLinker){
};
_buffer.createSO();
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
data0 = "";
data0 = (data0 + "AdSense sid found\n");
data0 = (data0 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data0, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
data1 = "";
data1 = (data1 + "AdSense sid found (new visitor)\n");
data1 = (data1 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data1, VisualDebugMode.geek);
};
};
if (_adSense.vid){
vid = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(vid[0]);
_buffer.utma.firstTime = Number(vid[1]);
if (_debug.verbose){
data2 = "";
data2 = (data2 + "AdSense vid found (new visitor)\n");
data2 = (data2 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(vid[0])) + ")\n"));
data2 = (data2 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(vid[1])) + ")"));
_debug.info(data2, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(newCampSrcKey:String):void{
_config.campaignKey.UCSR = newCampSrcKey;
var msg = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCSR]"));
} else {
_debug.info(msg);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_config.localGIFpath = newLocalGifPath;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(enable:Boolean):void{
_config.allowAnchor = enable;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var domainName:String = _config.domainName;
var g0 = (domainName.indexOf("www.google.") < 0);
var g1 = (domainName.indexOf(".google.") < 0);
var g2 = (domainName.indexOf("google.") < 0);
var g4 = (domainName.indexOf("google.org") > -1);
return (((((((((g0) || (g1))) || (g2))) || (!((_config.cookiePath == "/"))))) || (g4)));
}
public function setSampleRate(newRate:Number):void{
if (newRate < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = newRate;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(newCookiePath:String):void{
_config.cookiePath = newCookiePath;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(enable:Boolean):void{
_config.allowDomainHash = enable;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var hash:String = "";
hash = (hash + _info.appName);
hash = (hash + _info.appVersion);
hash = (hash + _info.language);
hash = (hash + _info.platform);
hash = (hash + _info.userAgent.toString());
hash = (hash + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
hash = (hash + _info.referrer);
return (Utils.generateHash(hash));
}
public function setCampNOKey(newCampNOKey:String):void{
_config.campaignKey.UCNO = newCampNOKey;
var msg = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCNO]"));
} else {
_debug.info(msg);
};
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_config.organic.addIgnoredKeyword(newIgnoredOrganicKeyword);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(newPath:String):void{
_debug.warning((("cookiePathCopy( " + newPath) + " ) not implemented"));
}
public function setDetectTitle(enable:Boolean):void{
_config.detectTitle = enable;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(newCampTermKey:String):void{
_config.campaignKey.UCTR = newCampTermKey;
var msg = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCTR]"));
} else {
_debug.info(msg);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(pageURL:String=""):void{
var searchVariables:Variables;
var x10vars:Variables;
var generalvars:Variables;
var eventInfo:EventInfo;
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
eventInfo = new EventInfo(false, _x10Module);
x10vars = eventInfo.toVariables();
};
generalvars = _renderMetricsSearchVariables(pageURL);
searchVariables.join(x10vars, generalvars);
_gifRequest.send(_account, searchVariables);
};
}
public function setCampaignTrack(enable:Boolean):void{
_config.campaignTracking = enable;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_config.organic.addIgnoredReferral(newIgnoredReferrer);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(newCampMedKey:String):void{
_config.campaignKey.UCMD = newCampMedKey;
var msg = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCMD]"));
} else {
_debug.info(msg);
};
}
private function _getUniqueSessionId():Number{
var sessionID:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + sessionID), VisualDebugMode.geek);
return (sessionID);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(newTimeout:int):void{
_config.sessionTimeout = newTimeout;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
var targetUrl = targetUrl;
var useHash = useHash;
_initData();
var out:String = _buffer.getLinkerUrl(targetUrl, useHash);
var request:URLRequest = new URLRequest(out);
_debug.info((("link( " + [targetUrl, useHash].join(",")) + " )"));
navigateToURL(request, "_top");
//unresolved jump
var _slot1 = e;
_debug.warning(("An error occured in link() msg: " + _slot1.message));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 78
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics;AnalyticsTracker.as:String):void;
function get config():Configuration;
function get mode():String;
function set config(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics;AnalyticsTracker.as:Configuration):void;
function set mode(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics;AnalyticsTracker.as:String):void;
function set debug(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics;AnalyticsTracker.as:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(D:\MY\Flash\Projects\SVI\SVI-Flex\src;com\google\analytics;AnalyticsTracker.as:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 79
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
public function API(){
super();
}
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 80
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.display.*;
import flash.events.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _ecom:Ecommerce;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(display:DisplayObject, account:String, mode:String="AS3", visualDebug:Boolean=false, config:Configuration=null, debug:DebugConfiguration=null){
super();
_display = display;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = account;
this.mode = mode;
this.visualDebug = visualDebug;
if (!debug){
this.debug = new DebugConfiguration();
};
if (!config){
this.config = new Configuration(debug);
};
if (autobuild){
_factory();
};
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_tracker.link(targetUrl, useHash);
}
public function addOrganic(Layout:String, Layout:String):void{
_tracker.addOrganic(Layout, Layout);
}
public function setAllowLinker(enable:Boolean):void{
_tracker.setAllowLinker(enable);
}
public function trackEvent(TrackerCache:String, TrackerCache:String, TrackerCache:String=null, TrackerCache:Number=NaN):Boolean{
return (_tracker.trackEvent(TrackerCache, TrackerCache, TrackerCache, TrackerCache));
}
public function getLinkerUrl(url:String="", useHash:Boolean=false):String{
return (_tracker.getLinkerUrl(url, useHash));
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_tracker.setCookieTimeout(newDefaultTimeout);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(pageURL:String=""):void{
_tracker.trackPageview(pageURL);
}
public function setClientInfo(Layout:Boolean):void{
_tracker.setClientInfo(Layout);
}
public function get account():String{
return (_account);
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_tracker.linkByPost(formObject, useHash);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(event:Event):Boolean{
return (_eventDispatcher.dispatchEvent(event));
}
public function get config():Configuration{
return (_config);
}
public function set mode(value:String):void{
_mode = value;
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
_eventDispatcher.removeEventListener(type, listener, useCapture);
}
public function setDetectFlash(Layout:Boolean):void{
_tracker.setDetectFlash(Layout);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(newCampNameKey:String):void{
_tracker.setCampNameKey(newCampNameKey);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_tracker.addItem(item, sku, name, category, price, quantity);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(value:String):void{
_account = value;
}
public function setVar(newVal:String):void{
_tracker.setVar(newVal);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
_eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function setDomainName(newDomainName:String):void{
_tracker.setDomainName(newDomainName);
}
public function createEventTracker(useCapture:String):EventTracker{
return (_tracker.createEventTracker(useCapture));
}
public function setCampSourceKey(newCampSrcKey:String):void{
_tracker.setCampSourceKey(newCampSrcKey);
}
public function set config(value:Configuration):void{
_config = value;
}
public function addTrans(Layout:String, Layout:String, Layout:Number, Layout:Number, Layout:Number, Layout:String, Layout:String, Layout:String):void{
_tracker.addTrans(Layout, Layout, Layout, Layout, Layout, Layout, Layout, Layout);
}
public function setCampContentKey(newCampContentKey:String):void{
_tracker.setCampContentKey(newCampContentKey);
}
public function willTrigger(type:String):Boolean{
return (_eventDispatcher.willTrigger(type));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(enable:Boolean):void{
_tracker.setAllowAnchor(enable);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(value:DebugConfiguration):void{
_debug = value;
}
public function setLocalGifPath(Layout:String):void{
_tracker.setLocalGifPath(Layout);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(newRate:Number):void{
_tracker.setSampleRate(newRate);
}
public function setCookiePath(newCookiePath:String):void{
_tracker.setCookiePath(newCookiePath);
}
public function setAllowHash(enable:Boolean):void{
_tracker.setAllowHash(enable);
}
public function addIgnoredOrganic(Layout:String):void{
_tracker.addIgnoredOrganic(Layout);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(newPath:String):void{
_tracker.cookiePathCopy(newPath);
}
private function _factory():void{
var activeTracker:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var cache:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
activeTracker = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
activeTracker = _trackerFactory();
};
if (!cache.isEmpty()){
cache.tracker = activeTracker;
cache.flush();
};
_tracker = activeTracker;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(newCampTermKey:String):void{
_tracker.setCampTermKey(newCampTermKey);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_ecom = new Ecommerce(_debug);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense, _ecom));
}
public function setCampNOKey(newCampNOKey:String):void{
_tracker.setCampNOKey(newCampNOKey);
}
public function setDetectTitle(Layout:Boolean):void{
_tracker.setDetectTitle(Layout);
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(enable:Boolean):void{
_tracker.setCampaignTrack(enable);
}
public function addIgnoredRef(Layout:String):void{
_tracker.addIgnoredRef(Layout);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function set visualDebug(value:Boolean):void{
_visualDebug = value;
}
public function setCampMediumKey(newCampMedKey:String):void{
_tracker.setCampMediumKey(newCampMedKey);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(type:String):Boolean{
return (_eventDispatcher.hasEventListener(type));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(newTimeout:int):void{
_tracker.setSessionTimeout(newTimeout);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 81
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public function MochiAd(){
super();
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
var sendHostProgress:Boolean;
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
finished = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (this.root == null){
finished = true;
};
if (finished){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(server:String):String{
var hostname:String = server.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (hostname);
};
Security.allowDomain("*");
Security.allowDomain(hostname);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(hostname);
return (hostname);
}
public static function unload(clip:Object):Boolean{
if (((clip.clip) && (clip.clip._mochiad))){
clip = clip.clip;
};
if (clip.origFrameRate != undefined){
clip.stage.frameRate = clip.origFrameRate;
};
if (!clip._mochiad){
return (false);
};
if (clip._mochiad._containerLCName != undefined){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
};
if (clip._mochiad.onUnload){
clip._mochiad.onUnload();
};
delete clip._mochiad_loaded;
delete clip._mochiad;
return (true);
}
public static function showInterLevelAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = (msec - 250);
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (finished){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(options:Object, defaults:Object):Object{
var k:String;
var pairs:Array;
var i:Number;
var kv:Array;
var optcopy:Object = {};
for (k in defaults) {
optcopy[k] = defaults[k];
};
if (options){
for (k in options) {
optcopy[k] = options[k];
};
};
if (optcopy.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
options = optcopy.clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
if (optcopy.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (optcopy);
}
public static function _cleanup(mc:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = mc;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
lc.client = null;
lc.close();
//unresolved jump
var _slot1 = e;
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(options:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = options;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
//unresolved jump
var _slot1 = e;
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (io:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(base:Object, methodName:String, argsArray:Array):Object{
var nameArray:Array = methodName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
if (typeof(base[nameArray[i]]) == "function"){
return (base[nameArray[i]].apply(base, argsArray));
};
return (undefined);
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number):MovieClip{
var mc:MovieClip = new MovieClip();
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
parent[name] = mc;
mc["_name"] = name;
return (mc);
}
public static function _getRes(options:Object, clip:Object):Array{
var xy:Array;
var b:Object = clip.getBounds(clip.root);
var w:Number = 0;
var h:Number = 0;
if (typeof(options.res) != "undefined"){
xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = (b.xMax - b.xMin);
h = (b.yMax - b.yMin);
};
if ((((w == 0)) || ((h == 0)))){
w = clip.stage.stageWidth;
h = clip.stage.stageHeight;
};
return ([w, h]);
}
public static function adShowing(mc:Object):void{
mc.origFrameRate = mc.stage.frameRate;
mc.stage.frameRate = 30;
}
public static function getValue(base:Object, objectName:String):Object{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
return (base[nameArray[i]]);
}
public static function rpc(clip:Object, callbackID:Number, arg:Object):void{
var _local4:Object;
var _local5:Object;
switch (arg.id){
case "setValue":
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case "getValue":
_local4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + arg.id));
};
}
public static function setValue(base:Object, objectName:String, value:Object):void{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return;
};
base = base[nameArray[i]];
i++;
};
base[nameArray[i]] = value;
}
public static function showPreGameAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (percent:Number):void{
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = (w - 20);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (ev:Event):void{
ev.target.removeEventListener(ev.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s:String):Object{
trace(("[MOCHIAD rpcTestFn] " + s));
return (s);
};
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (lc_name:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _clip:Object = this.parent.parent.root;
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
var clip_total:Number = _clip.loaderInfo.bytesTotal;
var clip_loaded:Number = _clip.loaderInfo.bytesLoaded;
if (complete){
clip_loaded = Math.max(1, clip_loaded);
clip_total = clip_loaded;
};
var clip_pcnt:Number = ((100 * clip_loaded) / clip_total);
var ad_pcnt:Number = ((100 * elapsed) / chk.ad_msec);
var _inside:Object = this._mochiad_bar._inside;
var pcnt:Number = Math.min(100, Math.min(((clip_pcnt) || (0)), ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside.scaleX = (pcnt * 0.01);
options.ad_progress(pcnt);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((elapsed > chk.ad_timeout)) && ((clip_pcnt == 100)))){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (((complete) && (finished))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}
public static function showTimedAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}
public static function doOnEnterFrame(mc:MovieClip):void{
var mc = mc;
var f:Function = function (ev:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
ev.target.removeEventListener(ev.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 82
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiCoins(){
super();
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("coins_saveUserProperties", properties);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:options});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(options:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
}
}//package mochi.as3
Section 83
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function reencode():void{
var newEncode:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function set value(v:Number):void{
setValue(v);
}
public function toString():String{
var s:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 84
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 85
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var s:Object;
var args:Object = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function endGame():void{
var delta:Number = (new Date().time - gameStart);
trigger("end_game", {time:delta});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(kind:String, obj:Object=null):void{
if (obj == null){
obj = {};
} else {
if (obj["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
obj["kind"] = kind;
};
};
MochiServices.send("events_triggerEvent", {eventObject:obj}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var delta:Number = (new Date().time - levelStart);
trigger("end_level", {time:delta});
}
}
}//package mochi.as3
Section 86
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
var so:Object = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(score) != score){
trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated"));
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (((((args) && ((args.error == true)))) && (onErrorHandler))){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiServices.warnID(boardID, true);
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi.as3
Section 87
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var methodName:String;
var pkg = pkg;
var cb:String = pkg.callbackID;
var cblst:Object = _clip._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_clip._queue.push({methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_clip._nextcallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var b:int;
var loader:Loader;
var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var footer:Array = [0, 64, 0, 0, 0];
var mc:MovieClip = new MovieClip();
var lc:LocalConnection = new LocalConnection();
var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
var ba:ByteArray = new ByteArray();
var cpool:ByteArray = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4);
var fileLength:uint = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
var rect:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(bid:String, leaderboard:Boolean):void{
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var i:Number = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
request = _clip._queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _clip._callbacks[request.callbackID];
};
delete _clip._callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String = pkg.target;
var event:String = pkg.event;
switch (target){
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync":
servicesSync.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var pairs:Array;
var i:Number;
var kv:Array;
var opts:Object = {};
var options:String = clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (container != null){
if ((container is Sprite)){
_container = container;
};
};
if (doAdd){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var clip = clip;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (ev:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
var servicesURL:String = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var req:URLRequest = new URLRequest(servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number, doAdd:Boolean=true):MovieClip{
var parent = parent;
var name = name;
var depth = depth;
var doAdd = doAdd;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
parent[name] = mc;
//unresolved jump
var _slot1 = e;
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
mc["_name"] = name;
return (mc);
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 88
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
super();
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
if (_syncContainer[name] == value){
return;
};
var n:String = name.toString();
_syncContainer[n] = value;
MochiServices.send("sync_propUpdate", {name:n, value:value});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
return (_syncContainer[name]);
}
public function triggerEvent(eventType:String, args:Object):void{
switch (eventType){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[args.name] = args.value;
break;
};
}
}
}//package mochi.as3
Section 89
//IAutomationObject (mx.automation.IAutomationObject)
package mx.automation {
import flash.events.*;
public interface IAutomationObject {
function createAutomationIDPart(:IAutomationObject):Object;
function get automationName():String;
function get showInAutomationHierarchy():Boolean;
function set automationName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:String):void;
function getAutomationChildAt(delegate:int):IAutomationObject;
function get automationDelegate():Object;
function get automationTabularData():Object;
function resolveAutomationIDPart(Object:Object):Array;
function replayAutomatableEvent(void:Event):Boolean;
function set automationDelegate(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void;
function get automationValue():Array;
function get numAutomationChildren():int;
function set showInAutomationHierarchy(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void;
}
}//package mx.automation
Section 90
//Binding (mx.binding.Binding)
package mx.binding {
import flash.utils.*;
public class Binding {
mx_internal var destFunc:Function;
mx_internal var srcFunc:Function;
mx_internal var destString:String;
mx_internal var document:Object;
private var hasHadValue:Boolean;
mx_internal var disabledRequests:Dictionary;
mx_internal var isExecuting:Boolean;
mx_internal var isHandlingEvent:Boolean;
public var twoWayCounterpart:Binding;
private var wrappedFunctionSuccessful:Boolean;
mx_internal var _isEnabled:Boolean;
public var uiComponentWatcher:int;
private var lastValue:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Binding(document:Object, srcFunc:Function, destFunc:Function, destString:String){
super();
this.document = document;
this.srcFunc = srcFunc;
this.destFunc = destFunc;
this.destString = destString;
_isEnabled = true;
isExecuting = false;
isHandlingEvent = false;
hasHadValue = false;
uiComponentWatcher = -1;
BindingManager.addBinding(document, destString, this);
}
private function registerDisabledExecute(o:Object):void{
if (o != null){
disabledRequests = ((disabledRequests)!=null) ? disabledRequests : new Dictionary(true);
disabledRequests[o] = true;
};
}
protected function wrapFunctionCall(thisArg:Object, wrappedFunction:Function, object:Object=null, ... _args):Object{
var result:Object;
var thisArg = thisArg;
var wrappedFunction = wrappedFunction;
var object = object;
var args = _args;
wrappedFunctionSuccessful = false;
result = wrappedFunction.apply(thisArg, args);
wrappedFunctionSuccessful = true;
return (result);
//unresolved jump
var _slot1 = itemPendingError;
_slot1.addResponder(new EvalBindingResponder(this, object));
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = rangeError;
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = error;
if (((((((((!((_slot1.errorID == 1006))) && (!((_slot1.errorID == 1009))))) && (!((_slot1.errorID == 1010))))) && (!((_slot1.errorID == 1055))))) && (!((_slot1.errorID == 1069))))){
throw (_slot1);
} else {
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
};
return (null);
}
public function watcherFired(commitEvent:Boolean, cloneIndex:int):void{
var commitEvent = commitEvent;
var cloneIndex = cloneIndex;
if (isHandlingEvent){
return;
};
try {
try {
isHandlingEvent = true;
execute(cloneIndex);
} finally {
};
} finally {
isHandlingEvent = false;
};
}
private function nodeSeqEqual(x:XMLList, y:XMLList):Boolean{
var i:uint;
var n:uint = x.length();
if (n == y.length()){
i = 0;
while ((((i < n)) && ((x[i] === y[i])))) {
i++;
};
return ((i == n));
//unresolved jump
};
return (false);
}
mx_internal function set isEnabled(value:Boolean):void{
_isEnabled = value;
if (value){
processDisabledRequests();
};
}
private function processDisabledRequests():void{
var key:Object;
if (disabledRequests != null){
for (key in disabledRequests) {
execute(key);
};
disabledRequests = null;
};
}
public function execute(o:Object=null):void{
var o = o;
if (!isEnabled){
if (o != null){
registerDisabledExecute(o);
};
return;
};
if (((isExecuting) || (((twoWayCounterpart) && (twoWayCounterpart.isExecuting))))){
hasHadValue = true;
return;
};
try {
try {
isExecuting = true;
wrapFunctionCall(this, innerExecute, o);
} finally {
};
} finally {
isExecuting = false;
};
}
mx_internal function get isEnabled():Boolean{
return (_isEnabled);
}
private function innerExecute():void{
var value:Object = wrapFunctionCall(document, srcFunc);
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", srcFunc result = ") + value));
};
if (((hasHadValue) || (wrappedFunctionSuccessful))){
if (((!((((((lastValue is XML)) && (lastValue.hasComplexContent()))) && ((lastValue === value))))) && (!((((((((lastValue is XMLList)) && (lastValue.hasComplexContent()))) && ((value is XMLList)))) && (nodeSeqEqual((lastValue as XMLList), (value as XMLList)))))))){
destFunc.call(document, value);
lastValue = value;
hasHadValue = true;
};
};
}
}
}//package mx.binding
Section 91
//BindingManager (mx.binding.BindingManager)
package mx.binding {
public class BindingManager {
mx_internal static const VERSION:String = "3.2.0.3958";
static var debugDestinationStrings:Object = {};
public function BindingManager(){
super();
}
public static function executeBindings(document:Object, destStr:String, destObj:Object):void{
var binding:String;
if (((!(destStr)) || ((destStr == "")))){
return;
};
if (((((((document) && ((((document is IBindingClient)) || (document.hasOwnProperty("_bindingsByDestination")))))) && (document._bindingsByDestination))) && (document._bindingsBeginWithWord[getFirstWord(destStr)]))){
for (binding in document._bindingsByDestination) {
if (binding.charAt(0) == destStr.charAt(0)){
if ((((((binding.indexOf((destStr + ".")) == 0)) || ((binding.indexOf((destStr + "[")) == 0)))) || ((binding == destStr)))){
document._bindingsByDestination[binding].execute(destObj);
};
};
};
};
}
public static function addBinding(document:Object, destStr:String, b:Binding):void{
if (!document._bindingsByDestination){
document._bindingsByDestination = {};
document._bindingsBeginWithWord = {};
};
document._bindingsByDestination[destStr] = b;
document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
}
public static function debugBinding(destinationString:String):void{
debugDestinationStrings[destinationString] = true;
}
private static function getFirstWord(destStr:String):String{
var indexPeriod:int = destStr.indexOf(".");
var indexBracket:int = destStr.indexOf("[");
if (indexPeriod == indexBracket){
return (destStr);
};
var minIndex:int = Math.min(indexPeriod, indexBracket);
if (minIndex == -1){
minIndex = Math.max(indexPeriod, indexBracket);
};
return (destStr.substr(0, minIndex));
}
public static function setEnabled(document:Object, isEnabled:Boolean):void{
var bindings:Array;
var i:uint;
var binding:Binding;
if ((((document is IBindingClient)) && (document._bindings))){
bindings = (document._bindings as Array);
i = 0;
while (i < bindings.length) {
binding = bindings[i];
binding.isEnabled = isEnabled;
i++;
};
};
}
}
}//package mx.binding
Section 92
//EvalBindingResponder (mx.binding.EvalBindingResponder)
package mx.binding {
import mx.rpc.*;
public class EvalBindingResponder implements IResponder {
private var binding:Binding;
private var object:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EvalBindingResponder(binding:Binding, object:Object){
super();
this.binding = binding;
this.object = object;
}
public function fault(data:Object):void{
}
public function result(data:Object):void{
binding.execute(object);
}
}
}//package mx.binding
Section 93
//IBindingClient (mx.binding.IBindingClient)
package mx.binding {
public interface IBindingClient {
}
}//package mx.binding
Section 94
//ItemPendingError (mx.collections.errors.ItemPendingError)
package mx.collections.errors {
import mx.rpc.*;
public class ItemPendingError extends Error {
private var _responders:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ItemPendingError(message:String){
super(message);
}
public function get responders():Array{
return (_responders);
}
public function addResponder(responder:IResponder):void{
if (!_responders){
_responders = [];
};
_responders.push(responder);
}
}
}//package mx.collections.errors
Section 95
//ConstraintError (mx.containers.errors.ConstraintError)
package mx.containers.errors {
public class ConstraintError extends Error {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintError(message:String){
super(message);
}
}
}//package mx.containers.errors
Section 96
//ApplicationLayout (mx.containers.utilityClasses.ApplicationLayout)
package mx.containers.utilityClasses {
import mx.core.*;
public class ApplicationLayout extends BoxLayout {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ApplicationLayout(){
super();
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var paddingLeft:Number;
var paddingTop:Number;
var oX:Number;
var oY:Number;
var n:int;
var i:int;
var child:IFlexDisplayObject;
super.updateDisplayList(unscaledWidth, unscaledHeight);
var target:Container = super.target;
if (((((target.horizontalScrollBar) && ((getHorizontalAlignValue() > 0)))) || (((target.verticalScrollBar) && ((getVerticalAlignValue() > 0)))))){
paddingLeft = target.getStyle("paddingLeft");
paddingTop = target.getStyle("paddingTop");
oX = 0;
oY = 0;
n = target.numChildren;
i = 0;
while (i < n) {
child = IFlexDisplayObject(target.getChildAt(i));
if (child.x < paddingLeft){
oX = Math.max(oX, (paddingLeft - child.x));
};
if (child.y < paddingTop){
oY = Math.max(oY, (paddingTop - child.y));
};
i++;
};
if (((!((oX == 0))) || (!((oY == 0))))){
i = 0;
while (i < n) {
child = IFlexDisplayObject(target.getChildAt(i));
child.move((child.x + oX), (child.y + oY));
i++;
};
};
};
}
}
}//package mx.containers.utilityClasses
Section 97
//BoxLayout (mx.containers.utilityClasses.BoxLayout)
package mx.containers.utilityClasses {
import mx.core.*;
import mx.controls.scrollClasses.*;
import mx.containers.*;
public class BoxLayout extends Layout {
public var direction:String;// = "vertical"
mx_internal static const VERSION:String = "3.2.0.3958";
public function BoxLayout(){
super();
}
private function isVertical():Boolean{
return (!((direction == BoxDirection.HORIZONTAL)));
}
mx_internal function getHorizontalAlignValue():Number{
var horizontalAlign:String = target.getStyle("horizontalAlign");
if (horizontalAlign == "center"){
return (0.5);
};
if (horizontalAlign == "right"){
return (1);
};
return (0);
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var gap:Number;
var numChildrenWithOwnSpace:int;
var excessSpace:Number;
var top:Number;
var left:Number;
var i:int;
var obj:IUIComponent;
var child:IUIComponent;
var percentWidth:Number;
var percentHeight:Number;
var width:Number;
var height:Number;
var target:Container = super.target;
var n:int = target.numChildren;
if (n == 0){
return;
};
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var paddingLeft:Number = target.getStyle("paddingLeft");
var paddingTop:Number = target.getStyle("paddingTop");
var horizontalAlign:Number = getHorizontalAlignValue();
var verticalAlign:Number = getVerticalAlignValue();
var mw:Number = ((((target.scaleX > 0)) && (!((target.scaleX == 1))))) ? (target.minWidth / Math.abs(target.scaleX)) : target.minWidth;
var mh:Number = ((((target.scaleY > 0)) && (!((target.scaleY == 1))))) ? (target.minHeight / Math.abs(target.scaleY)) : target.minHeight;
var w:Number = ((Math.max(unscaledWidth, mw) - vm.right) - vm.left);
var h:Number = ((Math.max(unscaledHeight, mh) - vm.bottom) - vm.top);
var horizontalScrollBar:ScrollBar = target.horizontalScrollBar;
var verticalScrollBar:ScrollBar = target.verticalScrollBar;
if (n == 1){
child = IUIComponent(target.getChildAt(0));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (percentWidth){
width = Math.max(child.minWidth, Math.min(child.maxWidth, ((percentWidth)>=100) ? w : ((w * percentWidth) / 100)));
} else {
width = child.getExplicitOrMeasuredWidth();
};
if (percentHeight){
height = Math.max(child.minHeight, Math.min(child.maxHeight, ((percentHeight)>=100) ? h : ((h * percentHeight) / 100)));
} else {
height = child.getExplicitOrMeasuredHeight();
};
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
w = (w + verticalScrollBar.minWidth);
};
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
h = (h + horizontalScrollBar.minHeight);
};
left = (((w - child.width) * horizontalAlign) + paddingLeft);
top = (((h - child.height) * verticalAlign) + paddingTop);
child.move(Math.floor(left), Math.floor(top));
} else {
if (isVertical()){
gap = target.getStyle("verticalGap");
numChildrenWithOwnSpace = n;
i = 0;
while (i < n) {
if (!IUIComponent(target.getChildAt(i)).includeInLayout){
numChildrenWithOwnSpace--;
};
i++;
};
excessSpace = Flex.flexChildHeightsProportionally(target, (h - ((numChildrenWithOwnSpace - 1) * gap)), w);
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
excessSpace = (excessSpace + horizontalScrollBar.minHeight);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
w = (w + verticalScrollBar.minWidth);
};
top = (paddingTop + (excessSpace * verticalAlign));
i = 0;
while (i < n) {
obj = IUIComponent(target.getChildAt(i));
left = (((w - obj.width) * horizontalAlign) + paddingLeft);
obj.move(Math.floor(left), Math.floor(top));
if (obj.includeInLayout){
top = (top + (obj.height + gap));
};
i++;
};
} else {
gap = target.getStyle("horizontalGap");
numChildrenWithOwnSpace = n;
i = 0;
while (i < n) {
if (!IUIComponent(target.getChildAt(i)).includeInLayout){
numChildrenWithOwnSpace--;
};
i++;
};
excessSpace = Flex.flexChildWidthsProportionally(target, (w - ((numChildrenWithOwnSpace - 1) * gap)), h);
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
h = (h + horizontalScrollBar.minHeight);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
excessSpace = (excessSpace + verticalScrollBar.minWidth);
};
left = (paddingLeft + (excessSpace * horizontalAlign));
i = 0;
while (i < n) {
obj = IUIComponent(target.getChildAt(i));
top = (((h - obj.height) * verticalAlign) + paddingTop);
obj.move(Math.floor(left), Math.floor(top));
if (obj.includeInLayout){
left = (left + (obj.width + gap));
};
i++;
};
};
};
}
mx_internal function getVerticalAlignValue():Number{
var verticalAlign:String = target.getStyle("verticalAlign");
if (verticalAlign == "middle"){
return (0.5);
};
if (verticalAlign == "bottom"){
return (1);
};
return (0);
}
mx_internal function heightPadding(numChildren:Number):Number{
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var padding:Number = (vm.top + vm.bottom);
if ((((numChildren > 1)) && (isVertical()))){
padding = (padding + (target.getStyle("verticalGap") * (numChildren - 1)));
};
return (padding);
}
mx_internal function widthPadding(numChildren:Number):Number{
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var padding:Number = (vm.left + vm.right);
if ((((numChildren > 1)) && ((isVertical() == false)))){
padding = (padding + (target.getStyle("horizontalGap") * (numChildren - 1)));
};
return (padding);
}
override public function measure():void{
var target:Container;
var wPadding:Number;
var hPadding:Number;
var child:IUIComponent;
var wPref:Number;
var hPref:Number;
target = super.target;
var isVertical:Boolean = isVertical();
var minWidth:Number = 0;
var minHeight:Number = 0;
var preferredWidth:Number = 0;
var preferredHeight:Number = 0;
var n:int = target.numChildren;
var numChildrenWithOwnSpace:int = n;
var i:int;
while (i < n) {
child = IUIComponent(target.getChildAt(i));
if (!child.includeInLayout){
numChildrenWithOwnSpace--;
} else {
wPref = child.getExplicitOrMeasuredWidth();
hPref = child.getExplicitOrMeasuredHeight();
if (isVertical){
minWidth = Math.max((isNaN(child.percentWidth)) ? wPref : child.minWidth, minWidth);
preferredWidth = Math.max(wPref, preferredWidth);
minHeight = (minHeight + (isNaN(child.percentHeight)) ? hPref : child.minHeight);
preferredHeight = (preferredHeight + hPref);
} else {
minWidth = (minWidth + (isNaN(child.percentWidth)) ? wPref : child.minWidth);
preferredWidth = (preferredWidth + wPref);
minHeight = Math.max((isNaN(child.percentHeight)) ? hPref : child.minHeight, minHeight);
preferredHeight = Math.max(hPref, preferredHeight);
};
};
i++;
};
wPadding = widthPadding(numChildrenWithOwnSpace);
hPadding = heightPadding(numChildrenWithOwnSpace);
target.measuredMinWidth = (minWidth + wPadding);
target.measuredMinHeight = (minHeight + hPadding);
target.measuredWidth = (preferredWidth + wPadding);
target.measuredHeight = (preferredHeight + hPadding);
}
}
}//package mx.containers.utilityClasses
Section 98
//CanvasLayout (mx.containers.utilityClasses.CanvasLayout)
package mx.containers.utilityClasses {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import mx.events.*;
import flash.utils.*;
import mx.containers.errors.*;
public class CanvasLayout extends Layout {
private var colSpanChildren:Array;
private var constraintRegionsInUse:Boolean;// = false
private var rowSpanChildren:Array;
private var constraintCache:Dictionary;
private var _contentArea:Rectangle;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var r:Rectangle = new Rectangle();
public function CanvasLayout(){
colSpanChildren = [];
rowSpanChildren = [];
constraintCache = new Dictionary(true);
super();
}
private function parseConstraints(child:IUIComponent=null):ChildConstraintInfo{
var left:Number;
var right:Number;
var horizontalCenter:Number;
var top:Number;
var bottom:Number;
var verticalCenter:Number;
var baseline:Number;
var leftBoundary:String;
var rightBoundary:String;
var hcBoundary:String;
var topBoundary:String;
var bottomBoundary:String;
var vcBoundary:String;
var baselineBoundary:String;
var temp:Array;
var i:int;
var col:ConstraintColumn;
var found:Boolean;
var row:ConstraintRow;
var constraints:LayoutConstraints = getLayoutConstraints(child);
if (!constraints){
return (null);
};
while (true) {
temp = parseConstraintExp(constraints.left);
if (!temp){
left = NaN;
} else {
if (temp.length == 1){
left = Number(temp[0]);
} else {
leftBoundary = temp[0];
left = temp[1];
};
};
temp = parseConstraintExp(constraints.right);
if (!temp){
right = NaN;
} else {
if (temp.length == 1){
right = Number(temp[0]);
} else {
rightBoundary = temp[0];
right = temp[1];
};
};
temp = parseConstraintExp(constraints.horizontalCenter);
if (!temp){
horizontalCenter = NaN;
} else {
if (temp.length == 1){
horizontalCenter = Number(temp[0]);
} else {
hcBoundary = temp[0];
horizontalCenter = temp[1];
};
};
temp = parseConstraintExp(constraints.top);
if (!temp){
top = NaN;
} else {
if (temp.length == 1){
top = Number(temp[0]);
} else {
topBoundary = temp[0];
top = temp[1];
};
};
temp = parseConstraintExp(constraints.bottom);
if (!temp){
bottom = NaN;
} else {
if (temp.length == 1){
bottom = Number(temp[0]);
} else {
bottomBoundary = temp[0];
bottom = temp[1];
};
};
temp = parseConstraintExp(constraints.verticalCenter);
if (!temp){
verticalCenter = NaN;
} else {
if (temp.length == 1){
verticalCenter = Number(temp[0]);
} else {
vcBoundary = temp[0];
verticalCenter = temp[1];
};
};
temp = parseConstraintExp(constraints.baseline);
if (!temp){
baseline = NaN;
} else {
if (temp.length == 1){
baseline = Number(temp[0]);
} else {
baselineBoundary = temp[0];
baseline = temp[1];
};
};
break;
};
var colEntry:ContentColumnChild = new ContentColumnChild();
var pushEntry:Boolean;
var leftIndex:Number = 0;
var rightIndex:Number = 0;
var hcIndex:Number = 0;
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
if (col.id == leftBoundary){
colEntry.leftCol = col;
colEntry.leftOffset = left;
leftIndex = i;
colEntry.left = leftIndex;
pushEntry = true;
};
if (col.id == rightBoundary){
colEntry.rightCol = col;
colEntry.rightOffset = right;
rightIndex = (i + 1);
colEntry.right = rightIndex;
pushEntry = true;
};
if (col.id == hcBoundary){
colEntry.hcCol = col;
colEntry.hcOffset = horizontalCenter;
hcIndex = (i + 1);
colEntry.hc = hcIndex;
pushEntry = true;
};
};
i++;
};
if (pushEntry){
colEntry.child = child;
if (((((((colEntry.leftCol) && (!(colEntry.rightCol)))) || (((colEntry.rightCol) && (!(colEntry.leftCol)))))) || (colEntry.hcCol))){
colEntry.span = 1;
} else {
colEntry.span = (rightIndex - leftIndex);
};
found = false;
i = 0;
while (i < colSpanChildren.length) {
if (colEntry.child == colSpanChildren[i].child){
found = true;
break;
};
i++;
};
if (!found){
colSpanChildren.push(colEntry);
};
};
pushEntry = false;
var rowEntry:ContentRowChild = new ContentRowChild();
var topIndex:Number = 0;
var bottomIndex:Number = 0;
var vcIndex:Number = 0;
var baselineIndex:Number = 0;
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
if (row.id == topBoundary){
rowEntry.topRow = row;
rowEntry.topOffset = top;
topIndex = i;
rowEntry.top = topIndex;
pushEntry = true;
};
if (row.id == bottomBoundary){
rowEntry.bottomRow = row;
rowEntry.bottomOffset = bottom;
bottomIndex = (i + 1);
rowEntry.bottom = bottomIndex;
pushEntry = true;
};
if (row.id == vcBoundary){
rowEntry.vcRow = row;
rowEntry.vcOffset = verticalCenter;
vcIndex = (i + 1);
rowEntry.vc = vcIndex;
pushEntry = true;
};
if (row.id == baselineBoundary){
rowEntry.baselineRow = row;
rowEntry.baselineOffset = baseline;
baselineIndex = (i + 1);
rowEntry.baseline = baselineIndex;
pushEntry = true;
};
};
i++;
};
if (pushEntry){
rowEntry.child = child;
if (((((((((rowEntry.topRow) && (!(rowEntry.bottomRow)))) || (((rowEntry.bottomRow) && (!(rowEntry.topRow)))))) || (rowEntry.vcRow))) || (rowEntry.baselineRow))){
rowEntry.span = 1;
} else {
rowEntry.span = (bottomIndex - topIndex);
};
found = false;
i = 0;
while (i < rowSpanChildren.length) {
if (rowEntry.child == rowSpanChildren[i].child){
found = true;
break;
};
i++;
};
if (!found){
rowSpanChildren.push(rowEntry);
};
};
var info:ChildConstraintInfo = new ChildConstraintInfo(left, right, horizontalCenter, top, bottom, verticalCenter, baseline, leftBoundary, rightBoundary, hcBoundary, topBoundary, bottomBoundary, vcBoundary, baselineBoundary);
constraintCache[child] = info;
return (info);
}
private function bound(a:Number, min:Number, max:Number):Number{
if (a < min){
a = min;
} else {
if (a > max){
a = max;
} else {
a = Math.floor(a);
};
};
return (a);
}
private function shareRowSpace(entry:ContentRowChild, availableHeight:Number):Number{
var tempTopHeight:Number;
var tempBtmHeight:Number;
var share:Number;
var topRow:ConstraintRow = entry.topRow;
var bottomRow:ConstraintRow = entry.bottomRow;
var child:IUIComponent = entry.child;
var topHeight:Number = 0;
var bottomHeight:Number = 0;
var top:Number = (entry.topOffset) ? entry.topOffset : 0;
var bottom:Number = (entry.bottomOffset) ? entry.bottomOffset : 0;
if (((topRow) && (topRow.height))){
topHeight = (topHeight + topRow.height);
} else {
if (((bottomRow) && (!(topRow)))){
topRow = IConstraintLayout(target).constraintRows[(entry.bottom - 2)];
if (((topRow) && (topRow.height))){
topHeight = (topHeight + topRow.height);
};
};
};
if (((bottomRow) && (bottomRow.height))){
bottomHeight = (bottomHeight + bottomRow.height);
} else {
if (((topRow) && (!(bottomRow)))){
bottomRow = IConstraintLayout(target).constraintRows[(entry.top + 1)];
if (((bottomRow) && (bottomRow.height))){
bottomHeight = (bottomHeight + bottomRow.height);
};
};
};
if (((topRow) && (isNaN(topRow.height)))){
topRow.setActualHeight(Math.max(0, topRow.maxHeight));
};
if (((bottomRow) && (isNaN(bottomRow.height)))){
bottomRow.setActualHeight(Math.max(0, bottomRow.height));
};
var childHeight:Number = child.getExplicitOrMeasuredHeight();
if (childHeight){
if (!entry.topRow){
if (childHeight > topHeight){
tempBtmHeight = ((childHeight - topHeight) + bottom);
} else {
tempBtmHeight = (childHeight + bottom);
};
};
if (!entry.bottomRow){
if (childHeight > bottomHeight){
tempTopHeight = ((childHeight - bottomHeight) + top);
} else {
tempTopHeight = (childHeight + top);
};
};
if (((entry.topRow) && (entry.bottomRow))){
share = (childHeight / Number(entry.span));
if ((share + top) < topHeight){
tempTopHeight = topHeight;
tempBtmHeight = ((childHeight - (topHeight - top)) + bottom);
} else {
tempTopHeight = (share + top);
};
if ((share + bottom) < bottomHeight){
tempBtmHeight = bottomHeight;
tempTopHeight = ((childHeight - (bottomHeight - bottom)) + top);
} else {
tempBtmHeight = (share + bottom);
};
};
tempBtmHeight = bound(tempBtmHeight, bottomRow.minHeight, bottomRow.maxHeight);
bottomRow.setActualHeight(tempBtmHeight);
availableHeight = (availableHeight - tempBtmHeight);
tempTopHeight = bound(tempTopHeight, topRow.minHeight, topRow.maxHeight);
topRow.setActualHeight(tempTopHeight);
availableHeight = (availableHeight - tempTopHeight);
};
return (availableHeight);
}
private function parseConstraintExp(val:String):Array{
if (!val){
return (null);
};
var temp:String = val.replace(/:/g, " ");
var args:Array = temp.split(/\s+/);
return (args);
}
private function measureColumnsAndRows():void{
var i:int;
var k:int;
var cc:ConstraintColumn;
var cr:ConstraintRow;
var spaceToDistribute:Number;
var w:Number;
var h:Number;
var remainingSpace:Number;
var colEntry:ContentColumnChild;
var rowEntry:ContentRowChild;
var cols:Array = IConstraintLayout(target).constraintColumns;
var rows:Array = IConstraintLayout(target).constraintRows;
if ((((!(rows.length) > 0)) && ((!(cols.length) > 0)))){
constraintRegionsInUse = false;
return;
};
constraintRegionsInUse = true;
var canvasX:Number = 0;
var canvasY:Number = 0;
var vm:EdgeMetrics = Container(target).viewMetrics;
var availableWidth:Number = ((Container(target).width - vm.left) - vm.right);
var availableHeight:Number = ((Container(target).height - vm.top) - vm.bottom);
var fixedSize:Array = [];
var percentageSize:Array = [];
var contentSize:Array = [];
if (cols.length > 0){
i = 0;
while (i < cols.length) {
cc = cols[i];
if (!isNaN(cc.percentWidth)){
percentageSize.push(cc);
} else {
if (((!(isNaN(cc.width))) && (!(cc.mx_internal::contentSize)))){
fixedSize.push(cc);
} else {
contentSize.push(cc);
cc.mx_internal::contentSize = true;
};
};
i++;
};
i = 0;
while (i < fixedSize.length) {
cc = ConstraintColumn(fixedSize[i]);
availableWidth = (availableWidth - cc.width);
i++;
};
if (contentSize.length > 0){
if (colSpanChildren.length > 0){
colSpanChildren.sortOn("span");
k = 0;
while (k < colSpanChildren.length) {
colEntry = colSpanChildren[k];
if (colEntry.span == 1){
if (colEntry.hcCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.hcCol)]);
} else {
if (colEntry.leftCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.leftCol)]);
} else {
if (colEntry.rightCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.rightCol)]);
};
};
};
w = colEntry.child.getExplicitOrMeasuredWidth();
if (colEntry.hcOffset){
w = (w + colEntry.hcOffset);
} else {
if (colEntry.leftOffset){
w = (w + colEntry.leftOffset);
};
if (colEntry.rightOffset){
w = (w + colEntry.rightOffset);
};
};
if (!isNaN(cc.width)){
w = Math.max(cc.width, w);
};
w = bound(w, cc.minWidth, cc.maxWidth);
cc.setActualWidth(w);
availableWidth = (availableWidth - cc.width);
} else {
availableWidth = shareColumnSpace(colEntry, availableWidth);
};
k++;
};
colSpanChildren = [];
};
i = 0;
while (i < contentSize.length) {
cc = contentSize[i];
if (!cc.width){
w = bound(0, cc.minWidth, 0);
cc.setActualWidth(w);
};
i++;
};
};
remainingSpace = availableWidth;
i = 0;
while (i < percentageSize.length) {
cc = ConstraintColumn(percentageSize[i]);
if (remainingSpace <= 0){
w = 0;
} else {
w = Math.round(((remainingSpace * cc.percentWidth) / 100));
};
w = bound(w, cc.minWidth, cc.maxWidth);
cc.setActualWidth(w);
availableWidth = (availableWidth - w);
i++;
};
i = 0;
while (i < cols.length) {
cc = ConstraintColumn(cols[i]);
cc.x = canvasX;
canvasX = (canvasX + cc.width);
i++;
};
};
fixedSize = [];
percentageSize = [];
contentSize = [];
if (rows.length > 0){
i = 0;
while (i < rows.length) {
cr = rows[i];
if (!isNaN(cr.percentHeight)){
percentageSize.push(cr);
} else {
if (((!(isNaN(cr.height))) && (!(cr.mx_internal::contentSize)))){
fixedSize.push(cr);
} else {
contentSize.push(cr);
cr.mx_internal::contentSize = true;
};
};
i++;
};
i = 0;
while (i < fixedSize.length) {
cr = ConstraintRow(fixedSize[i]);
availableHeight = (availableHeight - cr.height);
i++;
};
if (contentSize.length > 0){
if (rowSpanChildren.length > 0){
rowSpanChildren.sortOn("span");
k = 0;
while (k < rowSpanChildren.length) {
rowEntry = rowSpanChildren[k];
if (rowEntry.span == 1){
if (rowEntry.vcRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.vcRow)]);
} else {
if (rowEntry.baselineRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.baselineRow)]);
} else {
if (rowEntry.topRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.topRow)]);
} else {
if (rowEntry.bottomRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.bottomRow)]);
};
};
};
};
h = rowEntry.child.getExplicitOrMeasuredHeight();
if (rowEntry.baselineOffset){
h = (h + rowEntry.baselineOffset);
} else {
if (rowEntry.vcOffset){
h = (h + rowEntry.vcOffset);
} else {
if (rowEntry.topOffset){
h = (h + rowEntry.topOffset);
};
if (rowEntry.bottomOffset){
h = (h + rowEntry.bottomOffset);
};
};
};
if (!isNaN(cr.height)){
h = Math.max(cr.height, h);
};
h = bound(h, cr.minHeight, cr.maxHeight);
cr.setActualHeight(h);
availableHeight = (availableHeight - cr.height);
} else {
availableHeight = shareRowSpace(rowEntry, availableHeight);
};
k++;
};
rowSpanChildren = [];
};
i = 0;
while (i < contentSize.length) {
cr = ConstraintRow(contentSize[i]);
if (!cr.height){
h = bound(0, cr.minHeight, 0);
cr.setActualHeight(h);
};
i++;
};
};
remainingSpace = availableHeight;
i = 0;
while (i < percentageSize.length) {
cr = ConstraintRow(percentageSize[i]);
if (remainingSpace <= 0){
h = 0;
} else {
h = Math.round(((remainingSpace * cr.percentHeight) / 100));
};
h = bound(h, cr.minHeight, cr.maxHeight);
cr.setActualHeight(h);
availableHeight = (availableHeight - h);
i++;
};
i = 0;
while (i < rows.length) {
cr = rows[i];
cr.y = canvasY;
canvasY = (canvasY + cr.height);
i++;
};
};
}
private function child_moveHandler(event:MoveEvent):void{
if ((event.target is IUIComponent)){
if (!IUIComponent(event.target).includeInLayout){
return;
};
};
var target:Container = super.target;
if (target){
target.invalidateSize();
target.invalidateDisplayList();
_contentArea = null;
};
}
private function applyAnchorStylesDuringMeasure(child:IUIComponent, r:Rectangle):void{
var i:int;
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return;
};
var childInfo:ChildConstraintInfo = constraintCache[constraintChild];
if (!childInfo){
childInfo = parseConstraints(child);
};
var left:Number = childInfo.left;
var right:Number = childInfo.right;
var horizontalCenter:Number = childInfo.hc;
var top:Number = childInfo.top;
var bottom:Number = childInfo.bottom;
var verticalCenter:Number = childInfo.vc;
var cols:Array = IConstraintLayout(target).constraintColumns;
var rows:Array = IConstraintLayout(target).constraintRows;
var holder:Number = 0;
if (!(cols.length) > 0){
if (!isNaN(horizontalCenter)){
r.x = Math.round((((target.width - child.width) / 2) + horizontalCenter));
} else {
if (((!(isNaN(left))) && (!(isNaN(right))))){
r.x = left;
r.width = (r.width + right);
} else {
if (!isNaN(left)){
r.x = left;
} else {
if (!isNaN(right)){
r.x = 0;
r.width = (r.width + right);
};
};
};
};
} else {
r.x = 0;
i = 0;
while (i < cols.length) {
holder = (holder + ConstraintColumn(cols[i]).width);
i++;
};
r.width = holder;
};
if (!(rows.length) > 0){
if (!isNaN(verticalCenter)){
r.y = Math.round((((target.height - child.height) / 2) + verticalCenter));
} else {
if (((!(isNaN(top))) && (!(isNaN(bottom))))){
r.y = top;
r.height = (r.height + bottom);
} else {
if (!isNaN(top)){
r.y = top;
} else {
if (!isNaN(bottom)){
r.y = 0;
r.height = (r.height + bottom);
};
};
};
};
} else {
holder = 0;
r.y = 0;
i = 0;
while (i < rows.length) {
holder = (holder + ConstraintRow(rows[i]).height);
i++;
};
r.height = holder;
};
}
override public function measure():void{
var target:Container;
var vm:EdgeMetrics;
var contentArea:Rectangle;
var child:IUIComponent;
var col:ConstraintColumn;
var row:ConstraintRow;
target = super.target;
var w:Number = 0;
var h:Number = 0;
var i:Number = 0;
vm = target.viewMetrics;
i = 0;
while (i < target.numChildren) {
child = (target.getChildAt(i) as IUIComponent);
parseConstraints(child);
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
col.mx_internal::_width = NaN;
};
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
row.mx_internal::_height = NaN;
};
i++;
};
measureColumnsAndRows();
_contentArea = null;
contentArea = measureContentArea();
target.measuredWidth = ((contentArea.width + vm.left) + vm.right);
target.measuredHeight = ((contentArea.height + vm.top) + vm.bottom);
}
private function target_childRemoveHandler(event:ChildExistenceChangedEvent):void{
DisplayObject(event.relatedObject).removeEventListener(MoveEvent.MOVE, child_moveHandler);
delete constraintCache[event.relatedObject];
}
override public function set target(value:Container):void{
var i:int;
var n:int;
var target:Container = super.target;
if (value != target){
if (target){
target.removeEventListener(ChildExistenceChangedEvent.CHILD_ADD, target_childAddHandler);
target.removeEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, target_childRemoveHandler);
n = target.numChildren;
i = 0;
while (i < n) {
DisplayObject(target.getChildAt(i)).removeEventListener(MoveEvent.MOVE, child_moveHandler);
i++;
};
};
if (value){
value.addEventListener(ChildExistenceChangedEvent.CHILD_ADD, target_childAddHandler);
value.addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, target_childRemoveHandler);
n = value.numChildren;
i = 0;
while (i < n) {
DisplayObject(value.getChildAt(i)).addEventListener(MoveEvent.MOVE, child_moveHandler);
i++;
};
};
super.target = value;
};
}
private function measureContentArea():Rectangle{
var i:int;
var cols:Array;
var rows:Array;
var child:IUIComponent;
var childConstraints:LayoutConstraints;
var cx:Number;
var cy:Number;
var pw:Number;
var ph:Number;
var rightEdge:Number;
var bottomEdge:Number;
if (_contentArea){
return (_contentArea);
};
_contentArea = new Rectangle();
var n:int = target.numChildren;
if ((((n == 0)) && (constraintRegionsInUse))){
cols = IConstraintLayout(target).constraintColumns;
rows = IConstraintLayout(target).constraintRows;
if (cols.length > 0){
_contentArea.right = (cols[(cols.length - 1)].x + cols[(cols.length - 1)].width);
} else {
_contentArea.right = 0;
};
if (rows.length > 0){
_contentArea.bottom = (rows[(rows.length - 1)].y + rows[(rows.length - 1)].height);
} else {
_contentArea.bottom = 0;
};
};
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
childConstraints = getLayoutConstraints(child);
if (!child.includeInLayout){
} else {
cx = child.x;
cy = child.y;
pw = child.getExplicitOrMeasuredWidth();
ph = child.getExplicitOrMeasuredHeight();
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (((!(isNaN(child.percentWidth))) || (((((childConstraints) && (!(isNaN(childConstraints.left))))) && (!(isNaN(childConstraints.right))))))){
pw = child.minWidth;
};
} else {
if (((!(isNaN(child.percentWidth))) || (((((((childConstraints) && (!(isNaN(childConstraints.left))))) && (!(isNaN(childConstraints.right))))) && (isNaN(child.explicitWidth)))))){
pw = child.minWidth;
};
};
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (((!(isNaN(child.percentHeight))) || (((((childConstraints) && (!(isNaN(childConstraints.top))))) && (!(isNaN(childConstraints.bottom))))))){
ph = child.minHeight;
};
} else {
if (((!(isNaN(child.percentHeight))) || (((((((childConstraints) && (!(isNaN(childConstraints.top))))) && (!(isNaN(childConstraints.bottom))))) && (isNaN(child.explicitHeight)))))){
ph = child.minHeight;
};
};
r.x = cx;
r.y = cy;
r.width = pw;
r.height = ph;
applyAnchorStylesDuringMeasure(child, r);
cx = r.x;
cy = r.y;
pw = r.width;
ph = r.height;
if (isNaN(cx)){
cx = child.x;
};
if (isNaN(cy)){
cy = child.y;
};
rightEdge = cx;
bottomEdge = cy;
if (isNaN(pw)){
pw = child.width;
};
if (isNaN(ph)){
ph = child.height;
};
rightEdge = (rightEdge + pw);
bottomEdge = (bottomEdge + ph);
_contentArea.right = Math.max(_contentArea.right, rightEdge);
_contentArea.bottom = Math.max(_contentArea.bottom, bottomEdge);
};
i++;
};
return (_contentArea);
}
private function shareColumnSpace(entry:ContentColumnChild, availableWidth:Number):Number{
var tempLeftWidth:Number;
var tempRightWidth:Number;
var share:Number;
var leftCol:ConstraintColumn = entry.leftCol;
var rightCol:ConstraintColumn = entry.rightCol;
var child:IUIComponent = entry.child;
var leftWidth:Number = 0;
var rightWidth:Number = 0;
var right:Number = (entry.rightOffset) ? entry.rightOffset : 0;
var left:Number = (entry.leftOffset) ? entry.leftOffset : 0;
if (((leftCol) && (leftCol.width))){
leftWidth = (leftWidth + leftCol.width);
} else {
if (((rightCol) && (!(leftCol)))){
leftCol = IConstraintLayout(target).constraintColumns[(entry.right - 2)];
if (((leftCol) && (leftCol.width))){
leftWidth = (leftWidth + leftCol.width);
};
};
};
if (((rightCol) && (rightCol.width))){
rightWidth = (rightWidth + rightCol.width);
} else {
if (((leftCol) && (!(rightCol)))){
rightCol = IConstraintLayout(target).constraintColumns[(entry.left + 1)];
if (((rightCol) && (rightCol.width))){
rightWidth = (rightWidth + rightCol.width);
};
};
};
if (((leftCol) && (isNaN(leftCol.width)))){
leftCol.setActualWidth(Math.max(0, leftCol.maxWidth));
};
if (((rightCol) && (isNaN(rightCol.width)))){
rightCol.setActualWidth(Math.max(0, rightCol.maxWidth));
};
var childWidth:Number = child.getExplicitOrMeasuredWidth();
if (childWidth){
if (!entry.leftCol){
if (childWidth > leftWidth){
tempRightWidth = ((childWidth - leftWidth) + right);
} else {
tempRightWidth = (childWidth + right);
};
};
if (!entry.rightCol){
if (childWidth > rightWidth){
tempLeftWidth = ((childWidth - rightWidth) + left);
} else {
tempLeftWidth = (childWidth + left);
};
};
if (((entry.leftCol) && (entry.rightCol))){
share = (childWidth / Number(entry.span));
if ((share + left) < leftWidth){
tempLeftWidth = leftWidth;
tempRightWidth = ((childWidth - (leftWidth - left)) + right);
} else {
tempLeftWidth = (share + left);
};
if ((share + right) < rightWidth){
tempRightWidth = rightWidth;
tempLeftWidth = ((childWidth - (rightWidth - right)) + left);
} else {
tempRightWidth = (share + right);
};
};
tempLeftWidth = bound(tempLeftWidth, leftCol.minWidth, leftCol.maxWidth);
leftCol.setActualWidth(tempLeftWidth);
availableWidth = (availableWidth - tempLeftWidth);
tempRightWidth = bound(tempRightWidth, rightCol.minWidth, rightCol.maxWidth);
rightCol.setActualWidth(tempRightWidth);
availableWidth = (availableWidth - tempRightWidth);
};
return (availableWidth);
}
private function getLayoutConstraints(child:IUIComponent):LayoutConstraints{
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return (null);
};
var constraints:LayoutConstraints = new LayoutConstraints();
constraints.baseline = constraintChild.getConstraintValue("baseline");
constraints.bottom = constraintChild.getConstraintValue("bottom");
constraints.horizontalCenter = constraintChild.getConstraintValue("horizontalCenter");
constraints.left = constraintChild.getConstraintValue("left");
constraints.right = constraintChild.getConstraintValue("right");
constraints.top = constraintChild.getConstraintValue("top");
constraints.verticalCenter = constraintChild.getConstraintValue("verticalCenter");
return (constraints);
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var i:int;
var child:IUIComponent;
var col:ConstraintColumn;
var row:ConstraintRow;
var target:Container = super.target;
var n:int = target.numChildren;
target.mx_internal::doingLayout = false;
var vm:EdgeMetrics = target.viewMetrics;
target.mx_internal::doingLayout = true;
var viewableWidth:Number = ((unscaledWidth - vm.left) - vm.right);
var viewableHeight:Number = ((unscaledHeight - vm.top) - vm.bottom);
if ((((IConstraintLayout(target).constraintColumns.length > 0)) || ((IConstraintLayout(target).constraintRows.length > 0)))){
constraintRegionsInUse = true;
};
if (constraintRegionsInUse){
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
parseConstraints(child);
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
col.mx_internal::_width = NaN;
};
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
row.mx_internal::_height = NaN;
};
i++;
};
measureColumnsAndRows();
};
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
applyAnchorStylesDuringUpdateDisplayList(viewableWidth, viewableHeight, child);
i++;
};
}
private function applyAnchorStylesDuringUpdateDisplayList(availableWidth:Number, availableHeight:Number, child:IUIComponent=null):void{
var i:int;
var w:Number;
var h:Number;
var x:Number;
var y:Number;
var message:String;
var vcHolder:Number;
var hcHolder:Number;
var vcY:Number;
var hcX:Number;
var baselineY:Number;
var matchLeft:Boolean;
var matchRight:Boolean;
var matchHC:Boolean;
var col:ConstraintColumn;
var matchTop:Boolean;
var matchBottom:Boolean;
var matchVC:Boolean;
var matchBaseline:Boolean;
var row:ConstraintRow;
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return;
};
var childInfo:ChildConstraintInfo = parseConstraints(child);
var left:Number = childInfo.left;
var right:Number = childInfo.right;
var horizontalCenter:Number = childInfo.hc;
var top:Number = childInfo.top;
var bottom:Number = childInfo.bottom;
var verticalCenter:Number = childInfo.vc;
var baseline:Number = childInfo.baseline;
var leftBoundary:String = childInfo.leftBoundary;
var rightBoundary:String = childInfo.rightBoundary;
var hcBoundary:String = childInfo.hcBoundary;
var topBoundary:String = childInfo.topBoundary;
var bottomBoundary:String = childInfo.bottomBoundary;
var vcBoundary:String = childInfo.vcBoundary;
var baselineBoundary:String = childInfo.baselineBoundary;
var checkWidth:Boolean;
var checkHeight:Boolean;
var parentBoundariesLR:Boolean = ((((!(hcBoundary)) && (!(leftBoundary)))) && (!(rightBoundary)));
var parentBoundariesTB:Boolean = ((((((!(vcBoundary)) && (!(topBoundary)))) && (!(bottomBoundary)))) && (!(baselineBoundary)));
var leftHolder:Number = 0;
var rightHolder:Number = availableWidth;
var topHolder:Number = 0;
var bottomHolder:Number = availableHeight;
if (!parentBoundariesLR){
matchLeft = (leftBoundary) ? true : false;
matchRight = (rightBoundary) ? true : false;
matchHC = (hcBoundary) ? true : false;
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = ConstraintColumn(IConstraintLayout(target).constraintColumns[i]);
if (matchLeft){
if (leftBoundary == col.id){
leftHolder = col.x;
matchLeft = false;
};
};
if (matchRight){
if (rightBoundary == col.id){
rightHolder = (col.x + col.width);
matchRight = false;
};
};
if (matchHC){
if (hcBoundary == col.id){
hcHolder = col.width;
hcX = col.x;
matchHC = false;
};
};
i++;
};
if (matchLeft){
message = resourceManager.getString("containers", "columnNotFound", [leftBoundary]);
throw (new ConstraintError(message));
};
if (matchRight){
message = resourceManager.getString("containers", "columnNotFound", [rightBoundary]);
throw (new ConstraintError(message));
};
if (matchHC){
message = resourceManager.getString("containers", "columnNotFound", [hcBoundary]);
throw (new ConstraintError(message));
};
} else {
if (!parentBoundariesLR){
message = resourceManager.getString("containers", "noColumnsFound");
throw (new ConstraintError(message));
};
};
availableWidth = Math.round((rightHolder - leftHolder));
if (((!(isNaN(left))) && (!(isNaN(right))))){
w = ((availableWidth - left) - right);
if (w < child.minWidth){
w = child.minWidth;
};
} else {
if (!isNaN(child.percentWidth)){
w = ((child.percentWidth / 100) * availableWidth);
w = bound(w, child.minWidth, child.maxWidth);
checkWidth = true;
} else {
w = child.getExplicitOrMeasuredWidth();
};
};
if (((!(parentBoundariesTB)) && ((IConstraintLayout(target).constraintRows.length > 0)))){
matchTop = (topBoundary) ? true : false;
matchBottom = (bottomBoundary) ? true : false;
matchVC = (vcBoundary) ? true : false;
matchBaseline = (baselineBoundary) ? true : false;
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = ConstraintRow(IConstraintLayout(target).constraintRows[i]);
if (matchTop){
if (topBoundary == row.id){
topHolder = row.y;
matchTop = false;
};
};
if (matchBottom){
if (bottomBoundary == row.id){
bottomHolder = (row.y + row.height);
matchBottom = false;
};
};
if (matchVC){
if (vcBoundary == row.id){
vcHolder = row.height;
vcY = row.y;
matchVC = false;
};
};
if (matchBaseline){
if (baselineBoundary == row.id){
baselineY = row.y;
matchBaseline = false;
};
};
i++;
};
if (matchTop){
message = resourceManager.getString("containers", "rowNotFound", [topBoundary]);
throw (new ConstraintError(message));
};
if (matchBottom){
message = resourceManager.getString("containers", "rowNotFound", [bottomBoundary]);
throw (new ConstraintError(message));
};
if (matchVC){
message = resourceManager.getString("containers", "rowNotFound", [vcBoundary]);
throw (new ConstraintError(message));
};
if (matchBaseline){
message = resourceManager.getString("containers", "rowNotFound", [baselineBoundary]);
throw (new ConstraintError(message));
};
} else {
if (((!(parentBoundariesTB)) && (!((IConstraintLayout(target).constraintRows.length > 0))))){
message = resourceManager.getString("containers", "noRowsFound");
throw (new ConstraintError(message));
};
};
availableHeight = Math.round((bottomHolder - topHolder));
if (((!(isNaN(top))) && (!(isNaN(bottom))))){
h = ((availableHeight - top) - bottom);
if (h < child.minHeight){
h = child.minHeight;
};
} else {
if (!isNaN(child.percentHeight)){
h = ((child.percentHeight / 100) * availableHeight);
h = bound(h, child.minHeight, child.maxHeight);
checkHeight = true;
} else {
h = child.getExplicitOrMeasuredHeight();
};
};
if (!isNaN(horizontalCenter)){
if (hcBoundary){
x = Math.round(((((hcHolder - w) / 2) + horizontalCenter) + hcX));
} else {
x = Math.round((((availableWidth - w) / 2) + horizontalCenter));
};
} else {
if (!isNaN(left)){
if (leftBoundary){
x = (leftHolder + left);
} else {
x = left;
};
} else {
if (!isNaN(right)){
if (rightBoundary){
x = ((rightHolder - right) - w);
} else {
x = ((availableWidth - right) - w);
};
};
};
};
if (!isNaN(baseline)){
if (baselineBoundary){
y = ((baselineY - child.baselinePosition) + baseline);
} else {
y = baseline;
};
};
if (!isNaN(verticalCenter)){
if (vcBoundary){
y = Math.round(((((vcHolder - h) / 2) + verticalCenter) + vcY));
} else {
y = Math.round((((availableHeight - h) / 2) + verticalCenter));
};
} else {
if (!isNaN(top)){
if (topBoundary){
y = (topHolder + top);
} else {
y = top;
};
} else {
if (!isNaN(bottom)){
if (bottomBoundary){
y = ((bottomHolder - bottom) - h);
} else {
y = ((availableHeight - bottom) - h);
};
};
};
};
x = (isNaN(x)) ? child.x : x;
y = (isNaN(y)) ? child.y : y;
child.move(x, y);
if (checkWidth){
if ((x + w) > availableWidth){
w = Math.max((availableWidth - x), child.minWidth);
};
};
if (checkHeight){
if ((y + h) > availableHeight){
h = Math.max((availableHeight - y), child.minHeight);
};
};
if (((!(isNaN(w))) && (!(isNaN(h))))){
child.setActualSize(w, h);
};
}
private function target_childAddHandler(event:ChildExistenceChangedEvent):void{
DisplayObject(event.relatedObject).addEventListener(MoveEvent.MOVE, child_moveHandler);
}
}
}//package mx.containers.utilityClasses
import mx.core.*;
class LayoutConstraints {
public var baseline;
public var left;
public var bottom;
public var top;
public var horizontalCenter;
public var verticalCenter;
public var right;
private function LayoutConstraints():void{
super();
}
}
class ChildConstraintInfo {
public var baseline:Number;
public var left:Number;
public var baselineBoundary:String;
public var leftBoundary:String;
public var hcBoundary:String;
public var top:Number;
public var right:Number;
public var topBoundary:String;
public var rightBoundary:String;
public var bottom:Number;
public var vc:Number;
public var bottomBoundary:String;
public var vcBoundary:String;
public var hc:Number;
private function ChildConstraintInfo(left:Number, right:Number, hc:Number, top:Number, bottom:Number, vc:Number, baseline:Number, leftBoundary:String=null, rightBoundary:String=null, hcBoundary:String=null, topBoundary:String=null, bottomBoundary:String=null, vcBoundary:String=null, baselineBoundary:String=null):void{
super();
this.left = left;
this.right = right;
this.hc = hc;
this.top = top;
this.bottom = bottom;
this.vc = vc;
this.baseline = baseline;
this.leftBoundary = leftBoundary;
this.rightBoundary = rightBoundary;
this.hcBoundary = hcBoundary;
this.topBoundary = topBoundary;
this.bottomBoundary = bottomBoundary;
this.vcBoundary = vcBoundary;
this.baselineBoundary = baselineBoundary;
}
}
class ContentColumnChild {
public var rightCol:ConstraintColumn;
public var hcCol:ConstraintColumn;
public var left:Number;
public var child:IUIComponent;
public var rightOffset:Number;
public var span:Number;
public var hcOffset:Number;
public var leftCol:ConstraintColumn;
public var leftOffset:Number;
public var hc:Number;
public var right:Number;
private function ContentColumnChild():void{
super();
}
}
class ContentRowChild {
public var topRow:ConstraintRow;
public var topOffset:Number;
public var baseline:Number;
public var baselineRow:ConstraintRow;
public var span:Number;
public var top:Number;
public var vcOffset:Number;
public var child:IUIComponent;
public var bottomOffset:Number;
public var bottom:Number;
public var vc:Number;
public var bottomRow:ConstraintRow;
public var vcRow:ConstraintRow;
public var baselineOffset:Number;
private function ContentRowChild():void{
super();
}
}
Section 99
//ConstraintColumn (mx.containers.utilityClasses.ConstraintColumn)
package mx.containers.utilityClasses {
import mx.core.*;
import flash.events.*;
public class ConstraintColumn extends EventDispatcher implements IMXMLObject {
private var _container:IInvalidating;
private var _explicitMinWidth:Number;
mx_internal var _width:Number;
mx_internal var contentSize:Boolean;// = false
private var _percentWidth:Number;
private var _explicitWidth:Number;
private var _explicitMaxWidth:Number;
private var _x:Number;
private var _id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintColumn(){
super();
}
public function get container():IInvalidating{
return (_container);
}
public function get width():Number{
return (_width);
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set container(value:IInvalidating):void{
_container = value;
}
public function set maxWidth(value:Number):void{
if (_explicitMaxWidth != value){
_explicitMaxWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("maxWidthChanged"));
};
}
public function set width(value:Number):void{
if (explicitWidth != value){
explicitWidth = value;
if (_width != value){
_width = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("widthChanged"));
};
};
}
public function get maxWidth():Number{
return (_explicitMaxWidth);
}
public function get minWidth():Number{
return (_explicitMinWidth);
}
public function get id():String{
return (_id);
}
public function initialized(document:Object, id:String):void{
this.id = id;
if (((!(this.width)) && (!(this.percentWidth)))){
contentSize = true;
};
}
public function set explicitWidth(value:Number):void{
if (_explicitWidth == value){
return;
};
if (!isNaN(value)){
_percentWidth = NaN;
};
_explicitWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("explicitWidthChanged"));
}
public function setActualWidth(w:Number):void{
if (_width != w){
_width = w;
dispatchEvent(new Event("widthChanged"));
};
}
public function set minWidth(value:Number):void{
if (_explicitMinWidth != value){
_explicitMinWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("minWidthChanged"));
};
}
public function set percentWidth(value:Number):void{
if (_percentWidth == value){
return;
};
if (!isNaN(value)){
_explicitWidth = NaN;
};
_percentWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("percentWidthChanged"));
}
public function set x(value:Number):void{
if (value != _x){
_x = value;
dispatchEvent(new Event("xChanged"));
};
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function set id(value:String):void{
_id = value;
}
public function get x():Number{
return (_x);
}
}
}//package mx.containers.utilityClasses
Section 100
//ConstraintRow (mx.containers.utilityClasses.ConstraintRow)
package mx.containers.utilityClasses {
import mx.core.*;
import flash.events.*;
public class ConstraintRow extends EventDispatcher implements IMXMLObject {
private var _container:IInvalidating;
mx_internal var _height:Number;
private var _explicitMinHeight:Number;
private var _y:Number;
private var _percentHeight:Number;
private var _explicitMaxHeight:Number;
mx_internal var contentSize:Boolean;// = false
private var _explicitHeight:Number;
private var _id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintRow(){
super();
}
public function get container():IInvalidating{
return (_container);
}
public function set container(value:IInvalidating):void{
_container = value;
}
public function set y(value:Number):void{
if (value != _y){
_y = value;
dispatchEvent(new Event("yChanged"));
};
}
public function set height(value:Number):void{
if (explicitHeight != value){
explicitHeight = value;
if (_height != value){
_height = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("heightChanged"));
};
};
}
public function set maxHeight(value:Number):void{
if (_explicitMaxHeight != value){
_explicitMaxHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("maxHeightChanged"));
};
}
public function setActualHeight(h:Number):void{
if (_height != h){
_height = h;
dispatchEvent(new Event("heightChanged"));
};
}
public function get minHeight():Number{
return (_explicitMinHeight);
}
public function get id():String{
return (_id);
}
public function set percentHeight(value:Number):void{
if (_percentHeight == value){
return;
};
if (!isNaN(value)){
_explicitHeight = NaN;
};
_percentHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
}
public function initialized(document:Object, id:String):void{
this.id = id;
if (((!(this.height)) && (!(this.percentHeight)))){
contentSize = true;
};
}
public function get percentHeight():Number{
return (_percentHeight);
}
public function get height():Number{
return (_height);
}
public function get maxHeight():Number{
return (_explicitMaxHeight);
}
public function set minHeight(value:Number):void{
if (_explicitMinHeight != value){
_explicitMinHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("minHeightChanged"));
};
}
public function set id(value:String):void{
_id = value;
}
public function get y():Number{
return (_y);
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function set explicitHeight(value:Number):void{
if (_explicitHeight == value){
return;
};
if (!isNaN(value)){
_percentHeight = NaN;
};
_explicitHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("explicitHeightChanged"));
}
}
}//package mx.containers.utilityClasses
Section 101
//Flex (mx.containers.utilityClasses.Flex)
package mx.containers.utilityClasses {
import mx.core.*;
public class Flex {
mx_internal static const VERSION:String = "3.2.0.3958";
public function Flex(){
super();
}
public static function flexChildWidthsProportionally(parent:Container, spaceForChildren:Number, h:Number):Number{
var childInfoArray:Array;
var childInfo:FlexChildInfo;
var child:IUIComponent;
var i:int;
var percentWidth:Number;
var percentHeight:Number;
var height:Number;
var width:Number;
var spaceToDistribute:Number = spaceForChildren;
var totalPercentWidth:Number = 0;
childInfoArray = [];
var n:int = parent.numChildren;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (((!(isNaN(percentHeight))) && (child.includeInLayout))){
height = Math.max(child.minHeight, Math.min(child.maxHeight, ((percentHeight)>=100) ? h : ((h * percentHeight) / 100)));
} else {
height = child.getExplicitOrMeasuredHeight();
};
if (((!(isNaN(percentWidth))) && (child.includeInLayout))){
totalPercentWidth = (totalPercentWidth + percentWidth);
childInfo = new FlexChildInfo();
childInfo.percent = percentWidth;
childInfo.min = child.minWidth;
childInfo.max = child.maxWidth;
childInfo.height = height;
childInfo.child = child;
childInfoArray.push(childInfo);
} else {
width = child.getExplicitOrMeasuredWidth();
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (child.includeInLayout){
spaceToDistribute = (spaceToDistribute - child.width);
};
};
i++;
};
if (totalPercentWidth){
spaceToDistribute = flexChildrenProportionally(spaceForChildren, spaceToDistribute, totalPercentWidth, childInfoArray);
n = childInfoArray.length;
i = 0;
while (i < n) {
childInfo = childInfoArray[i];
child = childInfo.child;
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(childInfo.size), Math.floor(childInfo.height));
} else {
child.setActualSize(childInfo.size, childInfo.height);
};
i++;
};
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
distributeExtraWidth(parent, spaceForChildren);
};
};
return (spaceToDistribute);
}
public static function distributeExtraHeight(parent:Container, spaceForChildren:Number):void{
var i:int;
var percentHeight:Number;
var child:IUIComponent;
var childHeight:Number;
var wantSpace:Number;
var n:int = parent.numChildren;
var wantToGrow:Boolean;
var spaceToDistribute:Number = spaceForChildren;
var spaceUsed:Number = 0;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
if (!child.includeInLayout){
} else {
childHeight = child.height;
percentHeight = child.percentHeight;
spaceUsed = (spaceUsed + childHeight);
if (!isNaN(percentHeight)){
wantSpace = Math.ceil(((percentHeight / 100) * spaceForChildren));
if (wantSpace > childHeight){
wantToGrow = true;
};
};
};
i++;
};
if (!wantToGrow){
return;
};
spaceToDistribute = (spaceToDistribute - spaceUsed);
var stillFlexibleComponents:Boolean;
while (((stillFlexibleComponents) && ((spaceToDistribute > 0)))) {
stillFlexibleComponents = false;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
childHeight = child.height;
percentHeight = child.percentHeight;
if (((((!(isNaN(percentHeight))) && (child.includeInLayout))) && ((childHeight < child.maxHeight)))){
wantSpace = Math.ceil(((percentHeight / 100) * spaceForChildren));
if (wantSpace > childHeight){
child.setActualSize(child.width, (childHeight + 1));
spaceToDistribute--;
stillFlexibleComponents = true;
if (spaceToDistribute == 0){
return;
};
};
};
i++;
};
};
}
public static function distributeExtraWidth(parent:Container, spaceForChildren:Number):void{
var i:int;
var percentWidth:Number;
var child:IUIComponent;
var childWidth:Number;
var wantSpace:Number;
var n:int = parent.numChildren;
var wantToGrow:Boolean;
var spaceToDistribute:Number = spaceForChildren;
var spaceUsed:Number = 0;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
if (!child.includeInLayout){
} else {
childWidth = child.width;
percentWidth = child.percentWidth;
spaceUsed = (spaceUsed + childWidth);
if (!isNaN(percentWidth)){
wantSpace = Math.ceil(((percentWidth / 100) * spaceForChildren));
if (wantSpace > childWidth){
wantToGrow = true;
};
};
};
i++;
};
if (!wantToGrow){
return;
};
spaceToDistribute = (spaceToDistribute - spaceUsed);
var stillFlexibleComponents:Boolean;
while (((stillFlexibleComponents) && ((spaceToDistribute > 0)))) {
stillFlexibleComponents = false;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
childWidth = child.width;
percentWidth = child.percentWidth;
if (((((!(isNaN(percentWidth))) && (child.includeInLayout))) && ((childWidth < child.maxWidth)))){
wantSpace = Math.ceil(((percentWidth / 100) * spaceForChildren));
if (wantSpace > childWidth){
child.setActualSize((childWidth + 1), child.height);
spaceToDistribute--;
stillFlexibleComponents = true;
if (spaceToDistribute == 0){
return;
};
};
};
i++;
};
};
}
public static function flexChildrenProportionally(spaceForChildren:Number, spaceToDistribute:Number, totalPercent:Number, childInfoArray:Array):Number{
var flexConsumed:Number;
var done:Boolean;
var spacePerPercent:*;
var i:*;
var childInfo:*;
var size:*;
var min:*;
var max:*;
var numChildren:int = childInfoArray.length;
var unused:Number = (spaceToDistribute - ((spaceForChildren * totalPercent) / 100));
if (unused > 0){
spaceToDistribute = (spaceToDistribute - unused);
};
do {
flexConsumed = 0;
done = true;
spacePerPercent = (spaceToDistribute / totalPercent);
i = 0;
while (i < numChildren) {
childInfo = childInfoArray[i];
size = (childInfo.percent * spacePerPercent);
if (size < childInfo.min){
min = childInfo.min;
childInfo.size = min;
--numChildren;
childInfoArray[i] = childInfoArray[numChildren];
childInfoArray[numChildren] = childInfo;
totalPercent = (totalPercent - childInfo.percent);
spaceToDistribute = (spaceToDistribute - min);
done = false;
break;
} else {
if (size > childInfo.max){
max = childInfo.max;
childInfo.size = max;
--numChildren;
childInfoArray[i] = childInfoArray[numChildren];
childInfoArray[numChildren] = childInfo;
totalPercent = (totalPercent - childInfo.percent);
spaceToDistribute = (spaceToDistribute - max);
done = false;
break;
} else {
childInfo.size = size;
flexConsumed = (flexConsumed + size);
};
};
i++;
};
} while (!(done));
return (Math.max(0, Math.floor((spaceToDistribute - flexConsumed))));
}
public static function flexChildHeightsProportionally(parent:Container, spaceForChildren:Number, w:Number):Number{
var childInfo:FlexChildInfo;
var child:IUIComponent;
var i:int;
var percentWidth:Number;
var percentHeight:Number;
var width:Number;
var height:Number;
var spaceToDistribute:Number = spaceForChildren;
var totalPercentHeight:Number = 0;
var childInfoArray:Array = [];
var n:int = parent.numChildren;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (((!(isNaN(percentWidth))) && (child.includeInLayout))){
width = Math.max(child.minWidth, Math.min(child.maxWidth, ((percentWidth)>=100) ? w : ((w * percentWidth) / 100)));
} else {
width = child.getExplicitOrMeasuredWidth();
};
if (((!(isNaN(percentHeight))) && (child.includeInLayout))){
totalPercentHeight = (totalPercentHeight + percentHeight);
childInfo = new FlexChildInfo();
childInfo.percent = percentHeight;
childInfo.min = child.minHeight;
childInfo.max = child.maxHeight;
childInfo.width = width;
childInfo.child = child;
childInfoArray.push(childInfo);
} else {
height = child.getExplicitOrMeasuredHeight();
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (child.includeInLayout){
spaceToDistribute = (spaceToDistribute - child.height);
};
};
i++;
};
if (totalPercentHeight){
spaceToDistribute = flexChildrenProportionally(spaceForChildren, spaceToDistribute, totalPercentHeight, childInfoArray);
n = childInfoArray.length;
i = 0;
while (i < n) {
childInfo = childInfoArray[i];
child = childInfo.child;
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(childInfo.width), Math.floor(childInfo.size));
} else {
child.setActualSize(childInfo.width, childInfo.size);
};
i++;
};
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
distributeExtraHeight(parent, spaceForChildren);
};
};
return (spaceToDistribute);
}
}
}//package mx.containers.utilityClasses
Section 102
//FlexChildInfo (mx.containers.utilityClasses.FlexChildInfo)
package mx.containers.utilityClasses {
import mx.core.*;
public class FlexChildInfo {
public var flex:Number;// = 0
public var preferred:Number;// = 0
public var percent:Number;
public var width:Number;
public var height:Number;
public var size:Number;// = 0
public var max:Number;
public var min:Number;
public var child:IUIComponent;
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexChildInfo(){
super();
}
}
}//package mx.containers.utilityClasses
Section 103
//IConstraintLayout (mx.containers.utilityClasses.IConstraintLayout)
package mx.containers.utilityClasses {
public interface IConstraintLayout {
function get constraintColumns():Array;
function set constraintRows(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void;
function get constraintRows():Array;
function set constraintColumns(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void;
}
}//package mx.containers.utilityClasses
Section 104
//Layout (mx.containers.utilityClasses.Layout)
package mx.containers.utilityClasses {
import mx.core.*;
import mx.resources.*;
public class Layout {
private var _target:Container;
protected var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Layout(){
resourceManager = ResourceManager.getInstance();
super();
}
public function get target():Container{
return (_target);
}
public function set target(value:Container):void{
_target = value;
}
public function measure():void{
}
public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
}
}//package mx.containers.utilityClasses
Section 105
//BoxDirection (mx.containers.BoxDirection)
package mx.containers {
public final class BoxDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function BoxDirection(){
super();
}
}
}//package mx.containers
Section 106
//DataGridListData (mx.controls.dataGridClasses.DataGridListData)
package mx.controls.dataGridClasses {
import mx.core.*;
import mx.controls.listClasses.*;
public class DataGridListData extends BaseListData {
public var dataField:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function DataGridListData(text:String, dataField:String, columnIndex:int, uid:String, owner:IUIComponent, rowIndex:int=0){
super(text, uid, owner, rowIndex, columnIndex);
this.dataField = dataField;
}
}
}//package mx.controls.dataGridClasses
Section 107
//BaseListData (mx.controls.listClasses.BaseListData)
package mx.controls.listClasses {
import mx.core.*;
public class BaseListData {
private var _uid:String;
public var owner:IUIComponent;
public var label:String;
public var rowIndex:int;
public var columnIndex:int;
mx_internal static const VERSION:String = "3.2.0.3958";
public function BaseListData(label:String, uid:String, owner:IUIComponent, rowIndex:int=0, columnIndex:int=0){
super();
this.label = label;
this.uid = uid;
this.owner = owner;
this.rowIndex = rowIndex;
this.columnIndex = columnIndex;
}
public function set uid(value:String):void{
_uid = value;
}
public function get uid():String{
return (_uid);
}
}
}//package mx.controls.listClasses
Section 108
//IDropInListItemRenderer (mx.controls.listClasses.IDropInListItemRenderer)
package mx.controls.listClasses {
public interface IDropInListItemRenderer {
function get listData():BaseListData;
function set listData(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\controls\listClasses;IDropInListItemRenderer.as:BaseListData):void;
}
}//package mx.controls.listClasses
Section 109
//IListItemRenderer (mx.controls.listClasses.IListItemRenderer)
package mx.controls.listClasses {
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.styles.*;
public interface IListItemRenderer extends IDataRenderer, IEventDispatcher, IFlexDisplayObject, ILayoutManagerClient, ISimpleStyleClient, IUIComponent {
}
}//package mx.controls.listClasses
Section 110
//ScrollBar (mx.controls.scrollClasses.ScrollBar)
package mx.controls.scrollClasses {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.*;
import flash.ui.*;
import flash.utils.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
private var _pageScrollSize:Number;// = 0
mx_internal var scrollTrack:Button;
mx_internal var downArrow:Button;
mx_internal var scrollThumb:ScrollThumb;
private var trackScrollRepeatDirection:int;
private var _minScrollPosition:Number;// = 0
private var trackPosition:Number;
private var _pageSize:Number;// = 0
mx_internal var _minHeight:Number;// = 32
private var _maxScrollPosition:Number;// = 0
private var trackScrollTimer:Timer;
mx_internal var upArrow:Button;
private var _lineScrollSize:Number;// = 1
private var _scrollPosition:Number;// = 0
private var trackScrolling:Boolean;// = false
mx_internal var isScrolling:Boolean;
mx_internal var oldPosition:Number;
mx_internal var _minWidth:Number;// = 16
mx_internal static const VERSION:String = "3.2.0.3958";
public static const THICKNESS:Number = 16;
public function ScrollBar(){
super();
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
invalidateDisplayList();
}
public function set lineScrollSize(value:Number):void{
_lineScrollSize = value;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
mx_internal function dispatchScrollEvent(oldPosition:Number, detail:String):void{
var event:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
event.detail = detail;
event.position = scrollPosition;
event.delta = (scrollPosition - oldPosition);
event.direction = direction;
dispatchEvent(event);
}
private function downArrow_buttonDownHandler(event:FlexEvent):void{
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
lineScroll(1);
}
private function scrollTrack_mouseDownHandler(event:MouseEvent):void{
if (!(((event.target == this)) || ((event.target == scrollTrack)))){
return;
};
trackScrolling = true;
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.addEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true);
sbRoot.addEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true);
sbRoot.addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, scrollTrack_mouseLeaveHandler);
systemManager.deployMouseShields(true);
var pt:Point = new Point(event.localX, event.localY);
pt = event.target.localToGlobal(pt);
pt = globalToLocal(pt);
trackPosition = pt.y;
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
trackScrollRepeatDirection = (((scrollThumb.y + scrollThumb.height) < pt.y)) ? 1 : ((scrollThumb.y > pt.y)) ? -1 : 0;
pageScroll(trackScrollRepeatDirection);
if (!trackScrollTimer){
trackScrollTimer = new Timer(getStyle("repeatDelay"), 1);
trackScrollTimer.addEventListener(TimerEvent.TIMER, trackScrollTimerHandler);
};
trackScrollTimer.start();
}
public function set minScrollPosition(value:Number):void{
_minScrollPosition = value;
invalidateDisplayList();
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
mx_internal function get linePlusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.LINE_DOWN : ScrollEventDetail.LINE_RIGHT);
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
protected function get thumbStyleFilters():Object{
return (null);
}
override public function set doubleClickEnabled(value:Boolean):void{
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
mx_internal function get virtualHeight():Number{
return (unscaledHeight);
}
public function set scrollPosition(value:Number):void{
var denom:Number;
var y:Number;
var x:Number;
_scrollPosition = value;
if (scrollThumb){
if (!cacheAsBitmap){
cacheHeuristic = (scrollThumb.cacheHeuristic = true);
};
if (!isScrolling){
value = Math.min(value, maxScrollPosition);
value = Math.max(value, minScrollPosition);
denom = (maxScrollPosition - minScrollPosition);
y = ((((denom == 0)) || (isNaN(denom)))) ? 0 : ((((value - minScrollPosition) * (trackHeight - scrollThumb.height)) / denom) + trackY);
x = (((virtualWidth - scrollThumb.width) / 2) + getStyle("thumbOffset"));
scrollThumb.move(Math.round(x), Math.round(y));
};
};
}
protected function get downArrowStyleFilters():Object{
return (null);
}
public function get pageSize():Number{
return (_pageSize);
}
public function set pageScrollSize(value:Number):void{
_pageScrollSize = value;
}
public function set maxScrollPosition(value:Number):void{
_maxScrollPosition = value;
invalidateDisplayList();
}
mx_internal function pageScroll(direction:int):void{
var oldPosition:Number;
var detail:String;
var delta:Number = ((_pageScrollSize)!=0) ? _pageScrollSize : pageSize;
var newPos:Number = (_scrollPosition + (direction * delta));
if (newPos > maxScrollPosition){
newPos = maxScrollPosition;
} else {
if (newPos < minScrollPosition){
newPos = minScrollPosition;
};
};
if (newPos != scrollPosition){
oldPosition = scrollPosition;
scrollPosition = newPos;
detail = ((direction < 0)) ? pageMinusDetail : pagePlusDetail;
dispatchScrollEvent(oldPosition, detail);
};
}
override protected function createChildren():void{
super.createChildren();
if (!scrollTrack){
scrollTrack = new Button();
scrollTrack.focusEnabled = false;
scrollTrack.skinName = "trackSkin";
scrollTrack.upSkinName = "trackUpSkin";
scrollTrack.overSkinName = "trackOverSkin";
scrollTrack.downSkinName = "trackDownSkin";
scrollTrack.disabledSkinName = "trackDisabledSkin";
if ((scrollTrack is ISimpleStyleClient)){
ISimpleStyleClient(scrollTrack).styleName = this;
};
addChild(scrollTrack);
scrollTrack.validateProperties();
};
if (!upArrow){
upArrow = new Button();
upArrow.enabled = false;
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
upArrow.upSkinName = "upArrowUpSkin";
upArrow.overSkinName = "upArrowOverSkin";
upArrow.downSkinName = "upArrowDownSkin";
upArrow.disabledSkinName = "upArrowDisabledSkin";
upArrow.skinName = "upArrowSkin";
upArrow.upIconName = "";
upArrow.overIconName = "";
upArrow.downIconName = "";
upArrow.disabledIconName = "";
addChild(upArrow);
upArrow.styleName = new StyleProxy(this, upArrowStyleFilters);
upArrow.validateProperties();
upArrow.addEventListener(FlexEvent.BUTTON_DOWN, upArrow_buttonDownHandler);
};
if (!downArrow){
downArrow = new Button();
downArrow.enabled = false;
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
downArrow.upSkinName = "downArrowUpSkin";
downArrow.overSkinName = "downArrowOverSkin";
downArrow.downSkinName = "downArrowDownSkin";
downArrow.disabledSkinName = "downArrowDisabledSkin";
downArrow.skinName = "downArrowSkin";
downArrow.upIconName = "";
downArrow.overIconName = "";
downArrow.downIconName = "";
downArrow.disabledIconName = "";
addChild(downArrow);
downArrow.styleName = new StyleProxy(this, downArrowStyleFilters);
downArrow.validateProperties();
downArrow.addEventListener(FlexEvent.BUTTON_DOWN, downArrow_buttonDownHandler);
};
}
private function scrollTrack_mouseOverHandler(event:MouseEvent):void{
if (!(((event.target == this)) || ((event.target == scrollTrack)))){
return;
};
if (trackScrolling){
trackScrollTimer.start();
};
}
private function get minDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.AT_TOP : ScrollEventDetail.AT_LEFT);
}
mx_internal function isScrollBarKey(key:uint):Boolean{
var oldPosition:Number;
if (key == Keyboard.HOME){
if (scrollPosition != 0){
oldPosition = scrollPosition;
scrollPosition = 0;
dispatchScrollEvent(oldPosition, minDetail);
};
return (true);
} else {
if (key == Keyboard.END){
if (scrollPosition < maxScrollPosition){
oldPosition = scrollPosition;
scrollPosition = maxScrollPosition;
dispatchScrollEvent(oldPosition, maxDetail);
};
return (true);
};
};
return (false);
}
mx_internal function get lineMinusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.LINE_UP : ScrollEventDetail.LINE_LEFT);
}
mx_internal function get pageMinusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.PAGE_UP : ScrollEventDetail.PAGE_LEFT);
}
private function get maxDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.AT_BOTTOM : ScrollEventDetail.AT_RIGHT);
}
private function scrollTrack_mouseLeaveHandler(event:Event):void{
trackScrolling = false;
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.removeEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true);
sbRoot.removeEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true);
sbRoot.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, scrollTrack_mouseLeaveHandler);
systemManager.deployMouseShields(false);
if (trackScrollTimer){
trackScrollTimer.reset();
};
if (event.target != scrollTrack){
return;
};
var detail:String = ((oldPosition > scrollPosition)) ? pageMinusDetail : pagePlusDetail;
dispatchScrollEvent(oldPosition, detail);
oldPosition = NaN;
}
protected function get upArrowStyleFilters():Object{
return (null);
}
private function get trackHeight():Number{
return ((virtualHeight - (upArrow.getExplicitOrMeasuredHeight() + downArrow.getExplicitOrMeasuredHeight())));
}
public function get pageScrollSize():Number{
return (_pageScrollSize);
}
override protected function measure():void{
super.measure();
upArrow.validateSize();
downArrow.validateSize();
scrollTrack.validateSize();
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
_minWidth = (scrollThumb) ? scrollThumb.getExplicitOrMeasuredWidth() : 0;
_minWidth = Math.max(scrollTrack.getExplicitOrMeasuredWidth(), upArrow.getExplicitOrMeasuredWidth(), downArrow.getExplicitOrMeasuredWidth(), _minWidth);
} else {
_minWidth = upArrow.getExplicitOrMeasuredWidth();
};
_minHeight = (upArrow.getExplicitOrMeasuredHeight() + downArrow.getExplicitOrMeasuredHeight());
}
mx_internal function lineScroll(direction:int):void{
var oldPosition:Number;
var detail:String;
var delta:Number = _lineScrollSize;
var newPos:Number = (_scrollPosition + (direction * delta));
if (newPos > maxScrollPosition){
newPos = maxScrollPosition;
} else {
if (newPos < minScrollPosition){
newPos = minScrollPosition;
};
};
if (newPos != scrollPosition){
oldPosition = scrollPosition;
scrollPosition = newPos;
detail = ((direction < 0)) ? lineMinusDetail : linePlusDetail;
dispatchScrollEvent(oldPosition, detail);
};
}
public function setScrollProperties(pageSize:Number, minScrollPosition:Number, maxScrollPosition:Number, pageScrollSize:Number=0):void{
var thumbHeight:Number;
this.pageSize = pageSize;
_pageScrollSize = ((pageScrollSize)>0) ? pageScrollSize : pageSize;
this.minScrollPosition = Math.max(minScrollPosition, 0);
this.maxScrollPosition = Math.max(maxScrollPosition, 0);
_scrollPosition = Math.max(this.minScrollPosition, _scrollPosition);
_scrollPosition = Math.min(this.maxScrollPosition, _scrollPosition);
if (((((this.maxScrollPosition - this.minScrollPosition) > 0)) && (enabled))){
upArrow.enabled = true;
downArrow.enabled = true;
scrollTrack.enabled = true;
addEventListener(MouseEvent.MOUSE_DOWN, scrollTrack_mouseDownHandler);
addEventListener(MouseEvent.MOUSE_OVER, scrollTrack_mouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, scrollTrack_mouseOutHandler);
if (!scrollThumb){
scrollThumb = new ScrollThumb();
scrollThumb.focusEnabled = false;
addChildAt(scrollThumb, getChildIndex(downArrow));
scrollThumb.styleName = new StyleProxy(this, thumbStyleFilters);
scrollThumb.upSkinName = "thumbUpSkin";
scrollThumb.overSkinName = "thumbOverSkin";
scrollThumb.downSkinName = "thumbDownSkin";
scrollThumb.iconName = "thumbIcon";
scrollThumb.skinName = "thumbSkin";
};
thumbHeight = ((trackHeight < 0)) ? 0 : Math.round(((pageSize / ((this.maxScrollPosition - this.minScrollPosition) + pageSize)) * trackHeight));
if (thumbHeight < scrollThumb.minHeight){
if (trackHeight < scrollThumb.minHeight){
scrollThumb.visible = false;
} else {
thumbHeight = scrollThumb.minHeight;
scrollThumb.visible = true;
scrollThumb.setActualSize(scrollThumb.measuredWidth, scrollThumb.minHeight);
};
} else {
scrollThumb.visible = true;
scrollThumb.setActualSize(scrollThumb.measuredWidth, thumbHeight);
};
scrollThumb.setRange((upArrow.getExplicitOrMeasuredHeight() + 0), ((virtualHeight - downArrow.getExplicitOrMeasuredHeight()) - scrollThumb.height), this.minScrollPosition, this.maxScrollPosition);
scrollPosition = Math.max(Math.min(scrollPosition, this.maxScrollPosition), this.minScrollPosition);
} else {
upArrow.enabled = false;
downArrow.enabled = false;
scrollTrack.enabled = false;
if (scrollThumb){
scrollThumb.visible = false;
};
};
}
private function trackScrollTimerHandler(event:Event):void{
if (trackScrollRepeatDirection == 1){
if ((scrollThumb.y + scrollThumb.height) > trackPosition){
return;
};
};
if (trackScrollRepeatDirection == -1){
if (scrollThumb.y < trackPosition){
return;
};
};
pageScroll(trackScrollRepeatDirection);
if (((trackScrollTimer) && ((trackScrollTimer.repeatCount == 1)))){
trackScrollTimer.delay = getStyle("repeatInterval");
trackScrollTimer.repeatCount = 0;
};
}
private function upArrow_buttonDownHandler(event:FlexEvent):void{
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
lineScroll(-1);
}
public function set pageSize(value:Number):void{
_pageSize = value;
}
private function get trackY():Number{
return (upArrow.getExplicitOrMeasuredHeight());
}
private function scrollTrack_mouseOutHandler(event:MouseEvent):void{
if (trackScrolling){
trackScrollTimer.stop();
};
}
private function scrollTrack_mouseUpHandler(event:MouseEvent):void{
scrollTrack_mouseLeaveHandler(event);
}
private function scrollTrack_mouseMoveHandler(event:MouseEvent):void{
var pt:Point;
if (trackScrolling){
pt = new Point(event.stageX, event.stageY);
pt = globalToLocal(pt);
trackPosition = pt.y;
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
if ($height == 1){
return;
};
if (!upArrow){
return;
};
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (cacheAsBitmap){
cacheHeuristic = (scrollThumb.cacheHeuristic = false);
};
upArrow.setActualSize(upArrow.getExplicitOrMeasuredWidth(), upArrow.getExplicitOrMeasuredHeight());
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
upArrow.move(((virtualWidth - upArrow.width) / 2), 0);
} else {
upArrow.move(0, 0);
};
scrollTrack.setActualSize(scrollTrack.getExplicitOrMeasuredWidth(), virtualHeight);
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
scrollTrack.x = ((virtualWidth - scrollTrack.width) / 2);
};
scrollTrack.y = 0;
downArrow.setActualSize(downArrow.getExplicitOrMeasuredWidth(), downArrow.getExplicitOrMeasuredHeight());
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
downArrow.move(((virtualWidth - downArrow.width) / 2), (virtualHeight - downArrow.getExplicitOrMeasuredHeight()));
} else {
downArrow.move(0, (virtualHeight - downArrow.getExplicitOrMeasuredHeight()));
};
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, _pageScrollSize);
scrollPosition = _scrollPosition;
}
mx_internal function get pagePlusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.PAGE_DOWN : ScrollEventDetail.PAGE_RIGHT);
}
mx_internal function get virtualWidth():Number{
return (unscaledWidth);
}
public function set direction(value:String):void{
_direction = value;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("directionChanged"));
}
public function get direction():String{
return (_direction);
}
}
}//package mx.controls.scrollClasses
Section 111
//ScrollBarDirection (mx.controls.scrollClasses.ScrollBarDirection)
package mx.controls.scrollClasses {
public final class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollBarDirection(){
super();
}
}
}//package mx.controls.scrollClasses
Section 112
//ScrollThumb (mx.controls.scrollClasses.ScrollThumb)
package mx.controls.scrollClasses {
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.controls.*;
public class ScrollThumb extends Button {
private var lastY:Number;
private var datamin:Number;
private var ymax:Number;
private var ymin:Number;
private var datamax:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollThumb(){
super();
explicitMinHeight = 10;
stickyHighlighting = true;
}
private function stopDragThumb():void{
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.isScrolling = false;
scrollBar.dispatchScrollEvent(scrollBar.oldPosition, ScrollEventDetail.THUMB_POSITION);
scrollBar.oldPosition = NaN;
systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
}
override protected function mouseDownHandler(event:MouseEvent):void{
super.mouseDownHandler(event);
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.oldPosition = scrollBar.scrollPosition;
lastY = event.localY;
systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
}
private function mouseMoveHandler(event:MouseEvent):void{
if (ymin == ymax){
return;
};
var pt:Point = new Point(event.stageX, event.stageY);
pt = globalToLocal(pt);
var scrollMove:Number = (pt.y - lastY);
scrollMove = (scrollMove + y);
if (scrollMove < ymin){
scrollMove = ymin;
} else {
if (scrollMove > ymax){
scrollMove = ymax;
};
};
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.isScrolling = true;
$y = scrollMove;
var oldPosition:Number = scrollBar.scrollPosition;
var pos:Number = (Math.round((((datamax - datamin) * (y - ymin)) / (ymax - ymin))) + datamin);
scrollBar.scrollPosition = pos;
scrollBar.dispatchScrollEvent(oldPosition, ScrollEventDetail.THUMB_TRACK);
event.updateAfterEvent();
}
override mx_internal function buttonReleased():void{
super.buttonReleased();
stopDragThumb();
}
mx_internal function setRange(ymin:Number, ymax:Number, datamin:Number, datamax:Number):void{
this.ymin = ymin;
this.ymax = ymax;
this.datamin = datamin;
this.datamax = datamax;
}
}
}//package mx.controls.scrollClasses
Section 113
//Button (mx.controls.Button)
package mx.controls {
import flash.display.*;
import flash.text.*;
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.listClasses.*;
import flash.ui.*;
import flash.utils.*;
import mx.controls.dataGridClasses.*;
public class Button extends UIComponent implements IDataRenderer, IDropInListItemRenderer, IFocusManagerComponent, IListItemRenderer, IFontContextComponent, IButton {
mx_internal var _emphasized:Boolean;// = false
mx_internal var extraSpacing:Number;// = 20
private var icons:Array;
public var selectedField:String;// = null
private var labelChanged:Boolean;// = false
private var skinMeasuredWidth:Number;
mx_internal var checkedDefaultSkin:Boolean;// = false
private var autoRepeatTimer:Timer;
mx_internal var disabledIconName:String;// = "disabledIcon"
mx_internal var disabledSkinName:String;// = "disabledSkin"
mx_internal var checkedDefaultIcon:Boolean;// = false
public var stickyHighlighting:Boolean;// = false
private var enabledChanged:Boolean;// = false
mx_internal var selectedUpIconName:String;// = "selectedUpIcon"
mx_internal var selectedUpSkinName:String;// = "selectedUpSkin"
mx_internal var upIconName:String;// = "upIcon"
mx_internal var upSkinName:String;// = "upSkin"
mx_internal var centerContent:Boolean;// = true
mx_internal var buttonOffset:Number;// = 0
private var skinMeasuredHeight:Number;
private var oldUnscaledWidth:Number;
mx_internal var downIconName:String;// = "downIcon"
mx_internal var _labelPlacement:String;// = "right"
mx_internal var downSkinName:String;// = "downSkin"
mx_internal var _toggle:Boolean;// = false
private var _phase:String;// = "up"
private var toolTipSet:Boolean;// = false
private var _data:Object;
mx_internal var currentIcon:IFlexDisplayObject;
mx_internal var currentSkin:IFlexDisplayObject;
mx_internal var overIconName:String;// = "overIcon"
mx_internal var selectedDownIconName:String;// = "selectedDownIcon"
mx_internal var overSkinName:String;// = "overSkin"
mx_internal var iconName:String;// = "icon"
mx_internal var skinName:String;// = "skin"
mx_internal var selectedDownSkinName:String;// = "selectedDownSkin"
private var skins:Array;
private var selectedSet:Boolean;
private var _autoRepeat:Boolean;// = false
private var styleChangedFlag:Boolean;// = true
mx_internal var selectedOverIconName:String;// = "selectedOverIcon"
private var _listData:BaseListData;
mx_internal var selectedOverSkinName:String;// = "selectedOverSkin"
protected var textField:IUITextField;
private var labelSet:Boolean;
mx_internal var defaultIconUsesStates:Boolean;// = false
mx_internal var defaultSkinUsesStates:Boolean;// = false
mx_internal var toggleChanged:Boolean;// = false
private var emphasizedChanged:Boolean;// = false
private var _label:String;// = ""
mx_internal var _selected:Boolean;// = false
mx_internal var selectedDisabledIconName:String;// = "selectedDisabledIcon"
mx_internal var selectedDisabledSkinName:String;// = "selectedDisabledSkin"
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var createAccessibilityImplementation:Function;
mx_internal static var TEXT_WIDTH_PADDING:Number = 6;
public function Button(){
skins = [];
icons = [];
super();
mouseChildren = false;
addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
addEventListener(MouseEvent.CLICK, clickHandler);
}
private function previousVersion_measure():void{
var bm:EdgeMetrics;
var lineMetrics:TextLineMetrics;
var paddingLeft:Number;
var paddingRight:Number;
var paddingTop:Number;
var paddingBottom:Number;
var horizontalGap:Number;
super.measure();
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = lineMetrics.width;
textHeight = lineMetrics.height;
paddingLeft = getStyle("paddingLeft");
paddingRight = getStyle("paddingRight");
paddingTop = getStyle("paddingTop");
paddingBottom = getStyle("paddingBottom");
textWidth = (textWidth + ((paddingLeft + paddingRight) + getStyle("textIndent")));
textHeight = (textHeight + (paddingTop + paddingBottom));
};
bm = currentSkin["borderMetrics"];
//unresolved jump
var _slot1 = e;
bm = new EdgeMetrics(3, 3, 3, 3);
var tempCurrentIcon:IFlexDisplayObject = getCurrentIcon();
var iconWidth:Number = (tempCurrentIcon) ? tempCurrentIcon.width : 0;
var iconHeight:Number = (tempCurrentIcon) ? tempCurrentIcon.height : 0;
var w:Number = 0;
var h:Number = 0;
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
w = (textWidth + iconWidth);
if (iconWidth != 0){
horizontalGap = getStyle("horizontalGap");
w = (w + (horizontalGap - 2));
};
h = Math.max(textHeight, (iconHeight + 6));
} else {
w = Math.max(textWidth, iconWidth);
h = (textHeight + iconHeight);
if (iconHeight != 0){
h = (h + getStyle("verticalGap"));
};
};
if (bm){
w = (w + (bm.left + bm.right));
h = (h + (bm.top + bm.bottom));
};
if (((label) && (!((label.length == 0))))){
w = (w + extraSpacing);
} else {
w = (w + 6);
};
if (((currentSkin) && (((isNaN(skinMeasuredWidth)) || (isNaN(skinMeasuredHeight)))))){
skinMeasuredWidth = currentSkin.measuredWidth;
skinMeasuredHeight = currentSkin.measuredHeight;
};
if (!isNaN(skinMeasuredWidth)){
w = Math.max(skinMeasuredWidth, w);
};
if (!isNaN(skinMeasuredHeight)){
h = Math.max(skinMeasuredHeight, h);
};
measuredMinWidth = (measuredWidth = w);
measuredMinHeight = (measuredHeight = h);
}
public function get label():String{
return (_label);
}
mx_internal function getCurrentIconName():String{
var tempIconName:String;
if (!enabled){
tempIconName = (selected) ? selectedDisabledIconName : disabledIconName;
} else {
if (phase == ButtonPhase.UP){
tempIconName = (selected) ? selectedUpIconName : upIconName;
} else {
if (phase == ButtonPhase.OVER){
tempIconName = (selected) ? selectedOverIconName : overIconName;
} else {
if (phase == ButtonPhase.DOWN){
tempIconName = (selected) ? selectedDownIconName : downIconName;
};
};
};
};
return (tempIconName);
}
protected function mouseUpHandler(event:MouseEvent):void{
if (!enabled){
return;
};
phase = ButtonPhase.OVER;
buttonReleased();
if (!toggle){
event.updateAfterEvent();
};
}
override protected function adjustFocusRect(object:DisplayObject=null):void{
super.adjustFocusRect((currentSkin) ? this : DisplayObject(currentIcon));
}
mx_internal function set phase(value:String):void{
_phase = value;
invalidateSize();
invalidateDisplayList();
}
mx_internal function viewIconForPhase(tempIconName:String):IFlexDisplayObject{
var newIcon:IFlexDisplayObject;
var sizeIcon:Boolean;
var stateName:String;
var newIconClass:Class = Class(getStyle(tempIconName));
if (!newIconClass){
newIconClass = Class(getStyle(iconName));
if (defaultIconUsesStates){
tempIconName = iconName;
};
if (((!(checkedDefaultIcon)) && (newIconClass))){
newIcon = IFlexDisplayObject(new (newIconClass));
if (((!((newIcon is IProgrammaticSkin))) && ((newIcon is IStateClient)))){
defaultIconUsesStates = true;
tempIconName = iconName;
};
if (newIcon){
checkedDefaultIcon = true;
};
};
};
newIcon = IFlexDisplayObject(getChildByName(tempIconName));
if (newIcon == null){
if (newIconClass != null){
newIcon = IFlexDisplayObject(new (newIconClass));
newIcon.name = tempIconName;
if ((newIcon is ISimpleStyleClient)){
ISimpleStyleClient(newIcon).styleName = this;
};
addChild(DisplayObject(newIcon));
sizeIcon = false;
if ((newIcon is IInvalidating)){
IInvalidating(newIcon).validateNow();
sizeIcon = true;
} else {
if ((newIcon is IProgrammaticSkin)){
IProgrammaticSkin(newIcon).validateDisplayList();
sizeIcon = true;
};
};
if (((newIcon) && ((newIcon is IUIComponent)))){
IUIComponent(newIcon).enabled = enabled;
};
if (sizeIcon){
newIcon.setActualSize(newIcon.measuredWidth, newIcon.measuredHeight);
};
icons.push(newIcon);
};
};
if (currentIcon != null){
currentIcon.visible = false;
};
currentIcon = newIcon;
if (((defaultIconUsesStates) && ((currentIcon is IStateClient)))){
stateName = "";
if (!enabled){
stateName = (selected) ? "selectedDisabled" : "disabled";
} else {
if (phase == ButtonPhase.UP){
stateName = (selected) ? "selectedUp" : "up";
} else {
if (phase == ButtonPhase.OVER){
stateName = (selected) ? "selectedOver" : "over";
} else {
if (phase == ButtonPhase.DOWN){
stateName = (selected) ? "selectedDown" : "down";
};
};
};
};
IStateClient(currentIcon).currentState = stateName;
};
if (currentIcon != null){
currentIcon.visible = true;
};
return (newIcon);
}
mx_internal function viewSkinForPhase(tempSkinName:String, stateName:String):void{
var newSkin:IFlexDisplayObject;
var labelColor:Number;
var styleableSkin:ISimpleStyleClient;
var newSkinClass:Class = Class(getStyle(tempSkinName));
if (!newSkinClass){
newSkinClass = Class(getStyle(skinName));
if (defaultSkinUsesStates){
tempSkinName = skinName;
};
if (((!(checkedDefaultSkin)) && (newSkinClass))){
newSkin = IFlexDisplayObject(new (newSkinClass));
if (((!((newSkin is IProgrammaticSkin))) && ((newSkin is IStateClient)))){
defaultSkinUsesStates = true;
tempSkinName = skinName;
};
if (newSkin){
checkedDefaultSkin = true;
};
};
};
newSkin = IFlexDisplayObject(getChildByName(tempSkinName));
if (!newSkin){
if (newSkinClass){
newSkin = IFlexDisplayObject(new (newSkinClass));
newSkin.name = tempSkinName;
styleableSkin = (newSkin as ISimpleStyleClient);
if (styleableSkin){
styleableSkin.styleName = this;
};
addChild(DisplayObject(newSkin));
newSkin.setActualSize(unscaledWidth, unscaledHeight);
if ((((newSkin is IInvalidating)) && (initialized))){
IInvalidating(newSkin).validateNow();
} else {
if ((((newSkin is IProgrammaticSkin)) && (initialized))){
IProgrammaticSkin(newSkin).validateDisplayList();
};
};
skins.push(newSkin);
};
};
if (currentSkin){
currentSkin.visible = false;
};
currentSkin = newSkin;
if (((defaultSkinUsesStates) && ((currentSkin is IStateClient)))){
IStateClient(currentSkin).currentState = stateName;
};
if (currentSkin){
currentSkin.visible = true;
};
if (enabled){
if (phase == ButtonPhase.OVER){
labelColor = textField.getStyle("textRollOverColor");
} else {
if (phase == ButtonPhase.DOWN){
labelColor = textField.getStyle("textSelectedColor");
} else {
labelColor = textField.getStyle("color");
};
};
textField.setColor(labelColor);
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
protected function rollOverHandler(event:MouseEvent):void{
if (phase == ButtonPhase.UP){
if (event.buttonDown){
return;
};
phase = ButtonPhase.OVER;
event.updateAfterEvent();
} else {
if (phase == ButtonPhase.OVER){
phase = ButtonPhase.DOWN;
event.updateAfterEvent();
if (autoRepeatTimer){
autoRepeatTimer.start();
};
};
};
}
override protected function createChildren():void{
super.createChildren();
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.styleName = this;
addChild(DisplayObject(textField));
};
}
mx_internal function setSelected(value:Boolean, isProgrammatic:Boolean=false):void{
if (_selected != value){
_selected = value;
invalidateDisplayList();
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (toggle){
dispatchEvent(new Event(Event.CHANGE));
};
} else {
if (((toggle) && (!(isProgrammatic)))){
dispatchEvent(new Event(Event.CHANGE));
};
};
dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
};
}
private function autoRepeatTimer_timerDelayHandler(event:Event):void{
if (!enabled){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
if (autoRepeat){
autoRepeatTimer.reset();
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.delay = getStyle("repeatInterval");
autoRepeatTimer.addEventListener(TimerEvent.TIMER, autoRepeatTimer_timerHandler);
autoRepeatTimer.start();
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set selected(value:Boolean):void{
selectedSet = true;
setSelected(value, true);
}
override protected function focusOutHandler(event:FocusEvent):void{
super.focusOutHandler(event);
if (phase != ButtonPhase.UP){
phase = ButtonPhase.UP;
};
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function set autoRepeat(value:Boolean):void{
_autoRepeat = value;
if (value){
autoRepeatTimer = new Timer(1);
} else {
autoRepeatTimer = null;
};
}
mx_internal function changeIcons():void{
var n:int = icons.length;
var i:int;
while (i < n) {
removeChild(icons[i]);
i++;
};
icons = [];
checkedDefaultIcon = false;
defaultIconUsesStates = false;
}
public function set data(value:Object):void{
var newSelected:*;
var newLabel:*;
_data = value;
if (((((_listData) && ((_listData is DataGridListData)))) && (!((DataGridListData(_listData).dataField == null))))){
newSelected = _data[DataGridListData(_listData).dataField];
newLabel = "";
} else {
if (_listData){
if (selectedField){
newSelected = _data[selectedField];
};
newLabel = _listData.label;
} else {
newSelected = _data;
};
};
if (((!((newSelected === undefined))) && (!(selectedSet)))){
selected = (newSelected as Boolean);
selectedSet = false;
};
if (((!((newLabel === undefined))) && (!(labelSet)))){
label = newLabel;
labelSet = false;
};
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}
mx_internal function getCurrentIcon():IFlexDisplayObject{
var tempIconName:String = getCurrentIconName();
if (!tempIconName){
return (null);
};
return (viewIconForPhase(tempIconName));
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
public function get emphasized():Boolean{
return (_emphasized);
}
public function get listData():BaseListData{
return (_listData);
}
mx_internal function layoutContents(unscaledWidth:Number, unscaledHeight:Number, offset:Boolean):void{
var lineMetrics:TextLineMetrics;
var moveEvent:MoveEvent;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
previousVersion_layoutContents(unscaledWidth, unscaledHeight, offset);
return;
};
var labelWidth:Number = 0;
var labelHeight:Number = 0;
var labelX:Number = 0;
var labelY:Number = 0;
var iconWidth:Number = 0;
var iconHeight:Number = 0;
var iconX:Number = 0;
var iconY:Number = 0;
var horizontalGap:Number = 0;
var verticalGap:Number = 0;
var paddingLeft:Number = getStyle("paddingLeft");
var paddingRight:Number = getStyle("paddingRight");
var paddingTop:Number = getStyle("paddingTop");
var paddingBottom:Number = getStyle("paddingBottom");
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = (lineMetrics.width + TEXT_WIDTH_PADDING);
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
} else {
lineMetrics = measureText("Wj");
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
};
var n:Number = (offset) ? buttonOffset : 0;
var textAlign:String = getStyle("textAlign");
var viewWidth:Number = unscaledWidth;
var viewHeight:Number = unscaledHeight;
var bm:EdgeMetrics = (((((currentSkin) && ((currentSkin is IBorder)))) && (!((currentSkin is IFlexAsset))))) ? IBorder(currentSkin).borderMetrics : null;
if (bm){
viewWidth = (viewWidth - (bm.left + bm.right));
viewHeight = (viewHeight - (bm.top + bm.bottom));
};
if (currentIcon){
iconWidth = currentIcon.width;
iconHeight = currentIcon.height;
};
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
horizontalGap = getStyle("horizontalGap");
if ((((iconWidth == 0)) || ((textWidth == 0)))){
horizontalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(Math.min(((((viewWidth - iconWidth) - horizontalGap) - paddingLeft) - paddingRight), textWidth), 0);
textField.width = labelWidth;
} else {
labelWidth = 0;
textField.width = labelWidth;
};
labelHeight = Math.min(viewHeight, textHeight);
textField.height = labelHeight;
if (textAlign == "left"){
labelX = (labelX + paddingLeft);
} else {
if (textAlign == "right"){
labelX = (labelX + ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingRight));
} else {
labelX = (labelX + (((((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingLeft) - paddingRight) / 2) + paddingLeft));
};
};
if (labelPlacement == ButtonLabelPlacement.RIGHT){
labelX = (labelX + (iconWidth + horizontalGap));
iconX = (labelX - (iconWidth + horizontalGap));
} else {
iconX = ((labelX + labelWidth) + horizontalGap);
};
iconY = (((((viewHeight - iconHeight) - paddingTop) - paddingBottom) / 2) + paddingTop);
labelY = (((((viewHeight - labelHeight) - paddingTop) - paddingBottom) / 2) + paddingTop);
} else {
verticalGap = getStyle("verticalGap");
if ((((iconHeight == 0)) || ((label == "")))){
verticalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(((viewWidth - paddingLeft) - paddingRight), 0);
textField.width = labelWidth;
labelHeight = Math.min(((((viewHeight - iconHeight) - paddingTop) - paddingBottom) - verticalGap), textHeight);
textField.height = labelHeight;
} else {
labelWidth = 0;
textField.width = labelWidth;
labelHeight = 0;
textField.height = labelHeight;
};
labelX = paddingLeft;
if (textAlign == "left"){
iconX = (iconX + paddingLeft);
} else {
if (textAlign == "right"){
iconX = (iconX + Math.max(((viewWidth - iconWidth) - paddingRight), paddingLeft));
} else {
iconX = (iconX + (((((viewWidth - iconWidth) - paddingLeft) - paddingRight) / 2) + paddingLeft));
};
};
if (labelPlacement == ButtonLabelPlacement.TOP){
labelY = (labelY + (((((((viewHeight - labelHeight) - iconHeight) - paddingTop) - paddingBottom) - verticalGap) / 2) + paddingTop));
iconY = (iconY + ((labelY + labelHeight) + verticalGap));
} else {
iconY = (iconY + (((((((viewHeight - labelHeight) - iconHeight) - paddingTop) - paddingBottom) - verticalGap) / 2) + paddingTop));
labelY = (labelY + ((iconY + iconHeight) + verticalGap));
};
};
var buffX:Number = n;
var buffY:Number = n;
if (bm){
buffX = (buffX + bm.left);
buffY = (buffY + bm.top);
};
textField.x = Math.round((labelX + buffX));
textField.y = Math.round((labelY + buffY));
if (currentIcon){
iconX = (iconX + buffX);
iconY = (iconY + buffY);
moveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = currentIcon.x;
moveEvent.oldY = currentIcon.y;
currentIcon.x = Math.round(iconX);
currentIcon.y = Math.round(iconY);
currentIcon.dispatchEvent(moveEvent);
};
if (currentSkin){
setChildIndex(DisplayObject(currentSkin), (numChildren - 1));
};
if (currentIcon){
setChildIndex(DisplayObject(currentIcon), (numChildren - 1));
};
if (textField){
setChildIndex(DisplayObject(textField), (numChildren - 1));
};
}
protected function mouseDownHandler(event:MouseEvent):void{
if (!enabled){
return;
};
systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
buttonPressed();
event.updateAfterEvent();
}
override protected function keyDownHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
buttonPressed();
};
}
protected function rollOutHandler(event:MouseEvent):void{
if (phase == ButtonPhase.OVER){
phase = ButtonPhase.UP;
event.updateAfterEvent();
} else {
if ((((phase == ButtonPhase.DOWN)) && (!(stickyHighlighting)))){
phase = ButtonPhase.OVER;
event.updateAfterEvent();
if (autoRepeatTimer){
autoRepeatTimer.stop();
};
};
};
}
mx_internal function get phase():String{
return (_phase);
}
override public function set enabled(value:Boolean):void{
if (super.enabled == value){
return;
};
super.enabled = value;
enabledChanged = true;
invalidateProperties();
invalidateDisplayList();
}
override protected function measure():void{
var lineMetrics:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
previousVersion_measure();
return;
};
super.measure();
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = (lineMetrics.width + TEXT_WIDTH_PADDING);
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
};
var tempCurrentIcon:IFlexDisplayObject = getCurrentIcon();
var iconWidth:Number = (tempCurrentIcon) ? tempCurrentIcon.width : 0;
var iconHeight:Number = (tempCurrentIcon) ? tempCurrentIcon.height : 0;
var w:Number = 0;
var h:Number = 0;
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
w = (textWidth + iconWidth);
if (((textWidth) && (iconWidth))){
w = (w + getStyle("horizontalGap"));
};
h = Math.max(textHeight, iconHeight);
} else {
w = Math.max(textWidth, iconWidth);
h = (textHeight + iconHeight);
if (((textHeight) && (iconHeight))){
h = (h + getStyle("verticalGap"));
};
};
if (((textWidth) || (iconWidth))){
w = (w + (getStyle("paddingLeft") + getStyle("paddingRight")));
h = (h + (getStyle("paddingTop") + getStyle("paddingBottom")));
};
var bm:EdgeMetrics = (((((currentSkin) && ((currentSkin is IBorder)))) && (!((currentSkin is IFlexAsset))))) ? IBorder(currentSkin).borderMetrics : null;
if (bm){
w = (w + (bm.left + bm.right));
h = (h + (bm.top + bm.bottom));
};
if (((currentSkin) && (((isNaN(skinMeasuredWidth)) || (isNaN(skinMeasuredHeight)))))){
skinMeasuredWidth = currentSkin.measuredWidth;
skinMeasuredHeight = currentSkin.measuredHeight;
};
if (!isNaN(skinMeasuredWidth)){
w = Math.max(skinMeasuredWidth, w);
};
if (!isNaN(skinMeasuredHeight)){
h = Math.max(skinMeasuredHeight, h);
};
measuredMinWidth = (measuredWidth = w);
measuredMinHeight = (measuredHeight = h);
}
public function get toggle():Boolean{
return (_toggle);
}
mx_internal function buttonReleased():void{
systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
if (autoRepeatTimer){
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerHandler);
autoRepeatTimer.reset();
};
}
mx_internal function buttonPressed():void{
phase = ButtonPhase.DOWN;
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
if (autoRepeat){
autoRepeatTimer.delay = getStyle("repeatDelay");
autoRepeatTimer.addEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.start();
};
}
override protected function keyUpHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
buttonReleased();
if (phase == ButtonPhase.DOWN){
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
phase = ButtonPhase.UP;
};
}
public function get selected():Boolean{
return (_selected);
}
public function set labelPlacement(value:String):void{
_labelPlacement = value;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("labelPlacementChanged"));
}
protected function clickHandler(event:MouseEvent):void{
if (!enabled){
event.stopImmediatePropagation();
return;
};
if (toggle){
setSelected(!(selected));
event.updateAfterEvent();
};
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
public function set toggle(value:Boolean):void{
_toggle = value;
toggleChanged = true;
invalidateProperties();
invalidateDisplayList();
dispatchEvent(new Event("toggleChanged"));
}
override public function get baselinePosition():Number{
var t:String;
var lineMetrics:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
t = label;
if (!t){
t = "Wj";
};
validateNow();
if (((!(label)) && ((((labelPlacement == ButtonLabelPlacement.TOP)) || ((labelPlacement == ButtonLabelPlacement.BOTTOM)))))){
lineMetrics = measureText(t);
return ((((measuredHeight - lineMetrics.height) / 2) + lineMetrics.ascent));
};
return ((textField.y + measureText(t).ascent));
};
if (!validateBaselinePosition()){
return (NaN);
};
return ((textField.y + textField.baselinePosition));
}
public function get data():Object{
return (_data);
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
mx_internal function viewSkin():void{
var tempSkinName:String;
var stateName:String;
if (!enabled){
tempSkinName = (selected) ? selectedDisabledSkinName : disabledSkinName;
stateName = (selected) ? "selectedDisabled" : "disabled";
} else {
if (phase == ButtonPhase.UP){
tempSkinName = (selected) ? selectedUpSkinName : upSkinName;
stateName = (selected) ? "selectedUp" : "up";
} else {
if (phase == ButtonPhase.OVER){
tempSkinName = (selected) ? selectedOverSkinName : overSkinName;
stateName = (selected) ? "selectedOver" : "over";
} else {
if (phase == ButtonPhase.DOWN){
tempSkinName = (selected) ? selectedDownSkinName : downSkinName;
stateName = (selected) ? "selectedDown" : "down";
};
};
};
};
viewSkinForPhase(tempSkinName, stateName);
}
override public function styleChanged(styleProp:String):void{
styleChangedFlag = true;
super.styleChanged(styleProp);
if (((!(styleProp)) || ((styleProp == "styleName")))){
changeSkins();
changeIcons();
if (initialized){
viewSkin();
viewIcon();
};
} else {
if (styleProp.toLowerCase().indexOf("skin") != -1){
changeSkins();
} else {
if (styleProp.toLowerCase().indexOf("icon") != -1){
changeIcons();
invalidateSize();
};
};
};
}
public function set emphasized(value:Boolean):void{
_emphasized = value;
emphasizedChanged = true;
invalidateDisplayList();
}
mx_internal function viewIcon():void{
var tempIconName:String = getCurrentIconName();
viewIconForPhase(tempIconName);
}
override public function set toolTip(value:String):void{
super.toolTip = value;
if (value){
toolTipSet = true;
} else {
toolTipSet = false;
invalidateDisplayList();
};
}
override protected function commitProperties():void{
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
removeChild(DisplayObject(textField));
textField = null;
};
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.styleName = this;
addChild(DisplayObject(textField));
enabledChanged = true;
toggleChanged = true;
};
if (!initialized){
viewSkin();
viewIcon();
};
if (enabledChanged){
textField.enabled = enabled;
if (((currentIcon) && ((currentIcon is IUIComponent)))){
IUIComponent(currentIcon).enabled = enabled;
};
enabledChanged = false;
};
if (toggleChanged){
if (!toggle){
selected = false;
};
toggleChanged = false;
};
}
mx_internal function changeSkins():void{
var n:int = skins.length;
var i:int;
while (i < n) {
removeChild(skins[i]);
i++;
};
skins = [];
skinMeasuredWidth = NaN;
skinMeasuredHeight = NaN;
checkedDefaultSkin = false;
defaultSkinUsesStates = false;
if (((initialized) && ((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)))){
viewSkin();
invalidateSize();
};
}
private function autoRepeatTimer_timerHandler(event:Event):void{
if (!enabled){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
}
private function previousVersion_layoutContents(unscaledWidth:Number, unscaledHeight:Number, offset:Boolean):void{
var lineMetrics:TextLineMetrics;
var disp:Number;
var moveEvent:MoveEvent;
var labelWidth:Number = 0;
var labelHeight:Number = 0;
var labelX:Number = 0;
var labelY:Number = 0;
var iconWidth:Number = 0;
var iconHeight:Number = 0;
var iconX:Number = 0;
var iconY:Number = 0;
var horizontalGap:Number = 2;
var verticalGap:Number = 2;
var paddingLeft:Number = getStyle("paddingLeft");
var paddingRight:Number = getStyle("paddingRight");
var paddingTop:Number = getStyle("paddingTop");
var paddingBottom:Number = getStyle("paddingBottom");
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
if (lineMetrics.width > 0){
textWidth = (((paddingLeft + paddingRight) + getStyle("textIndent")) + lineMetrics.width);
};
textHeight = lineMetrics.height;
} else {
lineMetrics = measureText("Wj");
textHeight = lineMetrics.height;
};
var n:Number = (offset) ? buttonOffset : 0;
var textAlign:String = getStyle("textAlign");
var bm:EdgeMetrics = (((currentSkin) && ((currentSkin is IRectangularBorder)))) ? IRectangularBorder(currentSkin).borderMetrics : null;
var viewWidth:Number = unscaledWidth;
var viewHeight:Number = ((unscaledHeight - paddingTop) - paddingBottom);
if (bm){
viewWidth = (viewWidth - (bm.left + bm.right));
viewHeight = (viewHeight - (bm.top + bm.bottom));
};
if (currentIcon){
iconWidth = currentIcon.width;
iconHeight = currentIcon.height;
};
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
horizontalGap = getStyle("horizontalGap");
if ((((iconWidth == 0)) || ((textWidth == 0)))){
horizontalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(((((viewWidth - iconWidth) - horizontalGap) - paddingLeft) - paddingRight), 0);
textField.width = labelWidth;
} else {
labelWidth = 0;
textField.width = labelWidth;
};
labelHeight = Math.min((viewHeight + 2), (textHeight + UITextField.TEXT_HEIGHT_PADDING));
textField.height = labelHeight;
if (labelPlacement == ButtonLabelPlacement.RIGHT){
labelX = (iconWidth + horizontalGap);
if (centerContent){
if (textAlign == "left"){
labelX = (labelX + paddingLeft);
} else {
if (textAlign == "right"){
labelX = (labelX + ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingLeft));
} else {
disp = ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) / 2);
labelX = (labelX + Math.max(disp, paddingLeft));
};
};
};
iconX = (labelX - (iconWidth + horizontalGap));
if (!centerContent){
labelX = (labelX + paddingLeft);
};
} else {
labelX = ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingRight);
if (centerContent){
if (textAlign == "left"){
labelX = 2;
} else {
if (textAlign == "right"){
labelX--;
} else {
if (labelX > 0){
labelX = (labelX / 2);
};
};
};
};
iconX = ((labelX + labelWidth) + horizontalGap);
};
labelY = 0;
iconY = labelY;
if (centerContent){
iconY = (Math.round(((viewHeight - iconHeight) / 2)) + paddingTop);
labelY = (Math.round(((viewHeight - labelHeight) / 2)) + paddingTop);
} else {
labelY = (labelY + (Math.max(0, ((viewHeight - labelHeight) / 2)) + paddingTop));
iconY = (iconY + (Math.max(0, (((viewHeight - iconHeight) / 2) - 1)) + paddingTop));
};
} else {
verticalGap = getStyle("verticalGap");
if ((((iconHeight == 0)) || ((textHeight == 0)))){
verticalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.min(viewWidth, (textWidth + UITextField.TEXT_WIDTH_PADDING));
textField.width = labelWidth;
labelHeight = Math.min(((viewHeight - iconHeight) + 1), (textHeight + 5));
textField.height = labelHeight;
} else {
labelWidth = 0;
textField.width = labelWidth;
labelHeight = 0;
textField.height = labelHeight;
};
labelX = ((viewWidth - labelWidth) / 2);
iconX = ((viewWidth - iconWidth) / 2);
if (labelPlacement == ButtonLabelPlacement.TOP){
labelY = (((viewHeight - labelHeight) - iconHeight) - verticalGap);
if (((centerContent) && ((labelY > 0)))){
labelY = (labelY / 2);
};
labelY = (labelY + paddingTop);
iconY = (((labelY + labelHeight) + verticalGap) - 3);
} else {
labelY = ((iconHeight + verticalGap) + paddingTop);
if (centerContent){
labelY = (labelY + (((((viewHeight - labelHeight) - iconHeight) - verticalGap) / 2) + 1));
};
iconY = (((labelY - iconHeight) - verticalGap) + 3);
};
};
var buffX:Number = n;
var buffY:Number = n;
if (bm){
buffX = (buffX + bm.left);
buffY = (buffY + bm.top);
};
textField.x = (labelX + buffX);
textField.y = (labelY + buffY);
if (currentIcon){
iconX = (iconX + buffX);
iconY = (iconY + buffY);
moveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = currentIcon.x;
moveEvent.oldY = currentIcon.y;
currentIcon.x = Math.round(iconX);
currentIcon.y = Math.round(iconY);
currentIcon.dispatchEvent(moveEvent);
};
if (currentSkin){
setChildIndex(DisplayObject(currentSkin), (numChildren - 1));
};
if (currentIcon){
setChildIndex(DisplayObject(currentIcon), (numChildren - 1));
};
if (textField){
setChildIndex(DisplayObject(textField), (numChildren - 1));
};
}
private function systemManager_mouseUpHandler(event:MouseEvent):void{
if (contains(DisplayObject(event.target))){
return;
};
phase = ButtonPhase.UP;
buttonReleased();
event.updateAfterEvent();
}
public function set label(value:String):void{
labelSet = true;
if (_label != value){
_label = value;
labelChanged = true;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("labelChanged"));
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var skin:IFlexDisplayObject;
var truncated:Boolean;
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (emphasizedChanged){
changeSkins();
emphasizedChanged = false;
};
var n:int = skins.length;
var i:int;
while (i < n) {
skin = IFlexDisplayObject(skins[i]);
skin.setActualSize(unscaledWidth, unscaledHeight);
i++;
};
viewSkin();
viewIcon();
layoutContents(unscaledWidth, unscaledHeight, (phase == ButtonPhase.DOWN));
if ((((((((oldUnscaledWidth > unscaledWidth)) || (!((textField.text == label))))) || (labelChanged))) || (styleChangedFlag))){
textField.text = label;
truncated = textField.truncateToFit();
if (!toolTipSet){
if (truncated){
super.toolTip = label;
} else {
super.toolTip = null;
};
};
styleChangedFlag = false;
labelChanged = false;
};
oldUnscaledWidth = unscaledWidth;
}
private function stage_mouseLeaveHandler(event:Event):void{
phase = ButtonPhase.UP;
buttonReleased();
}
public function set listData(value:BaseListData):void{
_listData = value;
}
}
}//package mx.controls
Section 114
//ButtonLabelPlacement (mx.controls.ButtonLabelPlacement)
package mx.controls {
public final class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
public function ButtonLabelPlacement(){
super();
}
}
}//package mx.controls
Section 115
//ButtonPhase (mx.controls.ButtonPhase)
package mx.controls {
public final class ButtonPhase {
public static const DOWN:String = "down";
public static const OVER:String = "over";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const UP:String = "up";
public function ButtonPhase(){
super();
}
}
}//package mx.controls
Section 116
//HScrollBar (mx.controls.HScrollBar)
package mx.controls {
import mx.controls.scrollClasses.*;
import flash.ui.*;
public class HScrollBar extends ScrollBar {
mx_internal static const VERSION:String = "3.2.0.3958";
public function HScrollBar(){
super();
super.direction = ScrollBarDirection.HORIZONTAL;
scaleX = -1;
rotation = -90;
}
override mx_internal function get virtualHeight():Number{
return (unscaledWidth);
}
override protected function measure():void{
super.measure();
measuredWidth = _minHeight;
measuredHeight = _minWidth;
}
override public function get minHeight():Number{
return (_minWidth);
}
override mx_internal function get virtualWidth():Number{
return (unscaledHeight);
}
override public function get minWidth():Number{
return (_minHeight);
}
override mx_internal function isScrollBarKey(key:uint):Boolean{
if (key == Keyboard.LEFT){
lineScroll(-1);
return (true);
};
if (key == Keyboard.RIGHT){
lineScroll(1);
return (true);
};
return (super.isScrollBarKey(key));
}
override public function set direction(value:String):void{
}
}
}//package mx.controls
Section 117
//IFlexContextMenu (mx.controls.IFlexContextMenu)
package mx.controls {
import flash.display.*;
public interface IFlexContextMenu {
function setContextMenu(:InteractiveObject):void;
function unsetContextMenu(:InteractiveObject):void;
}
}//package mx.controls
Section 118
//Label (mx.controls.Label)
package mx.controls {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.controls.listClasses.*;
public class Label extends UIComponent implements IDataRenderer, IDropInListItemRenderer, IListItemRenderer, IFontContextComponent {
private var _selectable:Boolean;// = false
private var _text:String;// = ""
private var _data:Object;
mx_internal var htmlTextChanged:Boolean;// = false
private var _tabIndex:int;// = -1
private var _textWidth:Number;
private var explicitHTMLText:String;// = null
private var enabledChanged:Boolean;// = false
private var condenseWhiteChanged:Boolean;// = false
private var _listData:BaseListData;
private var _textHeight:Number;
protected var textField:IUITextField;
private var _htmlText:String;// = ""
private var _condenseWhite:Boolean;// = false
mx_internal var textChanged:Boolean;// = false
public var truncateToFit:Boolean;// = true
private var textSet:Boolean;
private var selectableChanged:Boolean;
private var toolTipSet:Boolean;// = false
mx_internal static const VERSION:String = "3.2.0.3958";
public function Label(){
super();
tabChildren = true;
}
override public function set enabled(value:Boolean):void{
if (value == enabled){
return;
};
super.enabled = value;
enabledChanged = true;
invalidateProperties();
}
private function textField_textFieldStyleChangeHandler(event:Event):void{
textFieldChanged(true);
}
override public function get baselinePosition():Number{
var t:String;
var lineMetrics:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (!textField){
return (NaN);
};
validateNow();
t = (isHTML) ? explicitHTMLText : text;
if (t == ""){
t = " ";
};
lineMetrics = (isHTML) ? measureHTMLText(t) : measureText(t);
return ((textField.y + lineMetrics.ascent));
};
if (!validateBaselinePosition()){
return (NaN);
};
return ((textField.y + textField.baselinePosition));
}
public function set condenseWhite(value:Boolean):void{
if (value == _condenseWhite){
return;
};
_condenseWhite = value;
condenseWhiteChanged = true;
if (isHTML){
htmlTextChanged = true;
};
invalidateProperties();
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("condenseWhiteChanged"));
}
public function get textWidth():Number{
return (_textWidth);
}
override protected function createChildren():void{
super.createChildren();
if (!textField){
createTextField(-1);
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
private function measureTextFieldBounds(s:String):Rectangle{
var lineMetrics:TextLineMetrics = (isHTML) ? measureHTMLText(s) : measureText(s);
return (new Rectangle(0, 0, (lineMetrics.width + UITextField.TEXT_WIDTH_PADDING), (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING)));
}
mx_internal function getMinimumText(t:String):String{
if (((!(t)) || ((t.length < 2)))){
t = "Wj";
};
return (t);
}
private function textFieldChanged(styleChangeOnly:Boolean):void{
var changed1:Boolean;
var changed2:Boolean;
if (!styleChangeOnly){
changed1 = !((_text == textField.text));
_text = textField.text;
};
changed2 = !((_htmlText == textField.htmlText));
_htmlText = textField.htmlText;
if (changed1){
dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
};
if (changed2){
dispatchEvent(new Event("htmlTextChanged"));
};
_textWidth = textField.textWidth;
_textHeight = textField.textHeight;
}
public function get data():Object{
return (_data);
}
public function get text():String{
return (_text);
}
mx_internal function removeTextField():void{
if (textField){
textField.removeEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler);
textField.removeEventListener("textInsert", textField_textModifiedHandler);
textField.removeEventListener("textReplace", textField_textModifiedHandler);
removeChild(DisplayObject(textField));
textField = null;
};
}
public function get textHeight():Number{
return (_textHeight);
}
mx_internal function get styleSheet():StyleSheet{
return (textField.styleSheet);
}
public function set selectable(value:Boolean):void{
if (value == selectable){
return;
};
_selectable = value;
selectableChanged = true;
invalidateProperties();
}
override public function get tabIndex():int{
return (_tabIndex);
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override public function set toolTip(value:String):void{
super.toolTip = value;
toolTipSet = !((value == null));
}
mx_internal function createTextField(childIndex:int):void{
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.enabled = enabled;
textField.ignorePadding = true;
textField.selectable = selectable;
textField.styleName = this;
textField.addEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler);
textField.addEventListener("textInsert", textField_textModifiedHandler);
textField.addEventListener("textReplace", textField_textModifiedHandler);
if (childIndex == -1){
addChild(DisplayObject(textField));
} else {
addChildAt(DisplayObject(textField), childIndex);
};
};
}
override protected function commitProperties():void{
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
removeTextField();
condenseWhiteChanged = true;
enabledChanged = true;
selectableChanged = true;
textChanged = true;
};
if (!textField){
createTextField(-1);
};
if (condenseWhiteChanged){
textField.condenseWhite = _condenseWhite;
condenseWhiteChanged = false;
};
textField.tabIndex = tabIndex;
if (enabledChanged){
textField.enabled = enabled;
enabledChanged = false;
};
if (selectableChanged){
textField.selectable = _selectable;
selectableChanged = false;
};
if (((textChanged) || (htmlTextChanged))){
if (isHTML){
textField.htmlText = explicitHTMLText;
} else {
textField.text = _text;
};
textFieldChanged(false);
textChanged = false;
htmlTextChanged = false;
};
}
public function get condenseWhite():Boolean{
return (_condenseWhite);
}
public function set listData(value:BaseListData):void{
_listData = value;
}
private function get isHTML():Boolean{
return (!((explicitHTMLText == null)));
}
public function get selectable():Boolean{
return (_selectable);
}
public function set text(value:String):void{
textSet = true;
if (!value){
value = "";
};
if (((!(isHTML)) && ((value == _text)))){
return;
};
_text = value;
textChanged = true;
_htmlText = null;
explicitHTMLText = null;
invalidateProperties();
invalidateSize();
invalidateDisplayList();
dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
}
public function set data(value:Object):void{
var newText:*;
_data = value;
if (_listData){
newText = _listData.label;
} else {
if (_data != null){
if ((_data is String)){
newText = String(_data);
} else {
newText = _data.toString();
};
};
};
if (((!((newText === undefined))) && (!(textSet)))){
text = newText;
textSet = false;
};
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}
override protected function measure():void{
super.measure();
var t:String = (isHTML) ? explicitHTMLText : text;
t = getMinimumText(t);
var textFieldBounds:Rectangle = measureTextFieldBounds(t);
measuredMinWidth = (measuredWidth = ((textFieldBounds.width + getStyle("paddingLeft")) + getStyle("paddingRight")));
measuredMinHeight = (measuredHeight = ((textFieldBounds.height + getStyle("paddingTop")) + getStyle("paddingBottom")));
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
private function textField_textModifiedHandler(event:Event):void{
textFieldChanged(false);
}
public function get listData():BaseListData{
return (_listData);
}
mx_internal function set styleSheet(value:StyleSheet):void{
textField.styleSheet = value;
}
public function set htmlText(value:String):void{
textSet = true;
if (!value){
value = "";
};
if (((isHTML) && ((value == explicitHTMLText)))){
return;
};
_htmlText = value;
htmlTextChanged = true;
_text = null;
explicitHTMLText = value;
invalidateProperties();
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("htmlTextChanged"));
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var truncated:Boolean;
super.updateDisplayList(unscaledWidth, unscaledHeight);
var paddingLeft:Number = getStyle("paddingLeft");
var paddingTop:Number = getStyle("paddingTop");
var paddingRight:Number = getStyle("paddingRight");
var paddingBottom:Number = getStyle("paddingBottom");
textField.setActualSize(((unscaledWidth - paddingLeft) - paddingRight), ((unscaledHeight - paddingTop) - paddingBottom));
textField.x = paddingLeft;
textField.y = paddingTop;
var t:String = (isHTML) ? explicitHTMLText : text;
var textFieldBounds:Rectangle = measureTextFieldBounds(t);
if (truncateToFit){
if (isHTML){
truncated = (textFieldBounds.width > textField.width);
} else {
textField.text = _text;
truncated = textField.truncateToFit();
};
if (!toolTipSet){
super.toolTip = (truncated) ? text : null;
};
};
}
public function get htmlText():String{
return (_htmlText);
}
public function getLineMetrics(lineIndex:int):TextLineMetrics{
return ((textField) ? textField.getLineMetrics(lineIndex) : null);
}
override public function set tabIndex(value:int):void{
_tabIndex = value;
invalidateProperties();
}
}
}//package mx.controls
Section 119
//ToolTip (mx.controls.ToolTip)
package mx.controls {
import flash.display.*;
import flash.text.*;
import mx.core.*;
import mx.styles.*;
public class ToolTip extends UIComponent implements IToolTip, IFontContextComponent {
private var textChanged:Boolean;
private var _text:String;
protected var textField:IUITextField;
mx_internal var border:IFlexDisplayObject;
mx_internal static const VERSION:String = "3.2.0.3958";
public static var maxWidth:Number = 300;
public function ToolTip(){
super();
mouseEnabled = false;
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((((styleProp == "borderStyle")) || ((styleProp == "styleName")))) || ((styleProp == null)))){
invalidateDisplayList();
};
}
override protected function commitProperties():void{
var index:int;
var textFormat:TextFormat;
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
index = getChildIndex(DisplayObject(textField));
removeTextField();
createTextField(index);
invalidateSize();
textChanged = true;
};
if (textChanged){
textFormat = textField.getTextFormat();
textFormat.leftMargin = 0;
textFormat.rightMargin = 0;
textField.defaultTextFormat = textFormat;
textField.text = _text;
textChanged = false;
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
override protected function createChildren():void{
var borderClass:Class;
super.createChildren();
if (!border){
borderClass = getStyle("borderSkin");
border = new (borderClass);
if ((border is ISimpleStyleClient)){
ISimpleStyleClient(border).styleName = this;
};
addChild(DisplayObject(border));
};
createTextField(-1);
}
override protected function measure():void{
var heightSlop:Number;
super.measure();
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
heightSlop = (topInset + bottomInset);
textField.wordWrap = false;
if ((textField.textWidth + widthSlop) > ToolTip.maxWidth){
textField.width = (ToolTip.maxWidth - widthSlop);
textField.wordWrap = true;
};
measuredWidth = (textField.width + widthSlop);
measuredHeight = (textField.height + heightSlop);
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
public function set text(value:String):void{
_text = value;
textChanged = true;
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function get text():String{
return (_text);
}
mx_internal function removeTextField():void{
if (textField){
removeChild(DisplayObject(textField));
textField = null;
};
}
mx_internal function createTextField(childIndex:int):void{
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.autoSize = TextFieldAutoSize.LEFT;
textField.mouseEnabled = false;
textField.multiline = true;
textField.selectable = false;
textField.wordWrap = false;
textField.styleName = this;
if (childIndex == -1){
addChild(DisplayObject(textField));
} else {
addChildAt(DisplayObject(textField), childIndex);
};
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
var heightSlop:Number = (topInset + bottomInset);
border.setActualSize(unscaledWidth, unscaledHeight);
textField.move(leftInset, topInset);
textField.setActualSize((unscaledWidth - widthSlop), (unscaledHeight - heightSlop));
}
private function get borderMetrics():EdgeMetrics{
if ((border is IRectangularBorder)){
return (IRectangularBorder(border).borderMetrics);
};
return (EdgeMetrics.EMPTY);
}
}
}//package mx.controls
Section 120
//VScrollBar (mx.controls.VScrollBar)
package mx.controls {
import mx.controls.scrollClasses.*;
import flash.ui.*;
public class VScrollBar extends ScrollBar {
mx_internal static const VERSION:String = "3.2.0.3958";
public function VScrollBar(){
super();
super.direction = ScrollBarDirection.VERTICAL;
}
override protected function measure():void{
super.measure();
measuredWidth = _minWidth;
measuredHeight = _minHeight;
}
override public function get minHeight():Number{
return (_minHeight);
}
override mx_internal function isScrollBarKey(key:uint):Boolean{
if (key == Keyboard.UP){
lineScroll(-1);
return (true);
};
if (key == Keyboard.DOWN){
lineScroll(1);
return (true);
};
if (key == Keyboard.PAGE_UP){
pageScroll(-1);
return (true);
};
if (key == Keyboard.PAGE_DOWN){
pageScroll(1);
return (true);
};
return (super.isScrollBarKey(key));
}
override public function get minWidth():Number{
return (_minWidth);
}
override public function set direction(value:String):void{
}
}
}//package mx.controls
Section 121
//Application (mx.core.Application)
package mx.core {
import flash.display.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.effects.*;
import mx.containers.utilityClasses.*;
import flash.ui.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public class Application extends LayoutContainer {
public var preloader:Object;
public var pageTitle:String;
private var resizeWidth:Boolean;// = true
private var _applicationViewMetrics:EdgeMetrics;
mx_internal var _parameters:Object;
private var processingCreationQueue:Boolean;// = false
public var scriptRecursionLimit:int;
private var resizeHandlerAdded:Boolean;// = false
private var preloadObj:Object;
public var usePreloader:Boolean;
mx_internal var _url:String;
private var _viewSourceURL:String;
public var resetHistory:Boolean;// = true
public var historyManagementEnabled:Boolean;// = true
public var scriptTimeLimit:Number;
public var frameRate:Number;
private var creationQueue:Array;
private var resizeHeight:Boolean;// = true
public var controlBar:IUIComponent;
private var viewSourceCMI:ContextMenuItem;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var useProgressiveLayout:Boolean = false;
public function Application(){
creationQueue = [];
name = "application";
UIComponentGlobals.layoutManager = ILayoutManager(Singleton.getInstance("mx.managers::ILayoutManager"));
UIComponentGlobals.layoutManager.usePhasedInstantiation = true;
if (!ApplicationGlobals.application){
ApplicationGlobals.application = this;
};
super();
layoutObject = new ApplicationLayout();
layoutObject.target = this;
boxLayoutClass = ApplicationLayout;
showInAutomationHierarchy = true;
}
public function set viewSourceURL(value:String):void{
_viewSourceURL = value;
}
override public function set percentWidth(value:Number):void{
super.percentWidth = value;
invalidateDisplayList();
}
override public function prepareToPrint(target:IFlexDisplayObject):Object{
var objData:Object = {};
if (target == this){
objData.width = width;
objData.height = height;
objData.verticalScrollPosition = verticalScrollPosition;
objData.horizontalScrollPosition = horizontalScrollPosition;
objData.horizontalScrollBarVisible = !((horizontalScrollBar == null));
objData.verticalScrollBarVisible = !((verticalScrollBar == null));
objData.whiteBoxVisible = !((whiteBox == null));
setActualSize(measuredWidth, measuredHeight);
horizontalScrollPosition = 0;
verticalScrollPosition = 0;
if (horizontalScrollBar){
horizontalScrollBar.visible = false;
};
if (verticalScrollBar){
verticalScrollBar.visible = false;
};
if (whiteBox){
whiteBox.visible = false;
};
updateDisplayList(unscaledWidth, unscaledHeight);
};
objData.scrollRect = super.prepareToPrint(target);
return (objData);
}
override protected function measure():void{
var controlWidth:Number;
super.measure();
var bm:EdgeMetrics = borderMetrics;
if (((controlBar) && (controlBar.includeInLayout))){
controlWidth = ((controlBar.getExplicitOrMeasuredWidth() + bm.left) + bm.right);
measuredWidth = Math.max(measuredWidth, controlWidth);
measuredMinWidth = Math.max(measuredMinWidth, controlWidth);
};
}
override public function getChildIndex(child:DisplayObject):int{
if (((controlBar) && ((child == controlBar)))){
return (-1);
};
return (super.getChildIndex(child));
}
private function resizeHandler(event:Event):void{
var w:Number;
var h:Number;
if (resizeWidth){
if (isNaN(percentWidth)){
w = DisplayObject(systemManager).width;
} else {
super.percentWidth = Math.max(percentWidth, 0);
super.percentWidth = Math.min(percentWidth, 100);
w = ((percentWidth * screen.width) / 100);
};
if (!isNaN(explicitMaxWidth)){
w = Math.min(w, explicitMaxWidth);
};
if (!isNaN(explicitMinWidth)){
w = Math.max(w, explicitMinWidth);
};
} else {
w = width;
};
if (resizeHeight){
if (isNaN(percentHeight)){
h = DisplayObject(systemManager).height;
} else {
super.percentHeight = Math.max(percentHeight, 0);
super.percentHeight = Math.min(percentHeight, 100);
h = ((percentHeight * screen.height) / 100);
};
if (!isNaN(explicitMaxHeight)){
h = Math.min(h, explicitMaxHeight);
};
if (!isNaN(explicitMinHeight)){
h = Math.max(h, explicitMinHeight);
};
} else {
h = height;
};
if (((!((w == width))) || (!((h == height))))){
invalidateProperties();
invalidateSize();
};
setActualSize(w, h);
invalidateDisplayList();
}
private function initManagers(sm:ISystemManager):void{
if (sm.isTopLevel()){
focusManager = new FocusManager(this);
sm.activate(this);
};
}
override public function initialize():void{
var properties:Object;
var sm:ISystemManager = systemManager;
_url = sm.loaderInfo.url;
_parameters = sm.loaderInfo.parameters;
initManagers(sm);
_descriptor = null;
if (documentDescriptor){
creationPolicy = documentDescriptor.properties.creationPolicy;
if ((((creationPolicy == null)) || ((creationPolicy.length == 0)))){
creationPolicy = ContainerCreationPolicy.AUTO;
};
properties = documentDescriptor.properties;
if (properties.width != null){
width = properties.width;
delete properties.width;
};
if (properties.height != null){
height = properties.height;
delete properties.height;
};
documentDescriptor.events = null;
};
initContextMenu();
super.initialize();
addEventListener(Event.ADDED, addedHandler);
if (((sm.isTopLevelRoot()) && ((Capabilities.isDebugger == true)))){
setInterval(debugTickler, 1500);
};
}
override public function set percentHeight(value:Number):void{
super.percentHeight = value;
invalidateDisplayList();
}
override public function get id():String{
if (((((!(super.id)) && ((this == Application.application)))) && (ExternalInterface.available))){
return (ExternalInterface.objectID);
};
return (super.id);
}
override mx_internal function setUnscaledWidth(value:Number):void{
invalidateProperties();
super.setUnscaledWidth(value);
}
private function debugTickler():void{
var i:int;
}
private function doNextQueueItem(event:FlexEvent=null):void{
processingCreationQueue = true;
Application.useProgressiveLayout = true;
callLater(processNextQueueItem);
}
private function initContextMenu():void{
var caption:String;
if (flexContextMenu != null){
if ((systemManager is InteractiveObject)){
InteractiveObject(systemManager).contextMenu = contextMenu;
};
return;
};
var defaultMenu:ContextMenu = new ContextMenu();
defaultMenu.hideBuiltInItems();
defaultMenu.builtInItems.print = true;
if (_viewSourceURL){
caption = resourceManager.getString("core", "viewSource");
viewSourceCMI = new ContextMenuItem(caption, true);
viewSourceCMI.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelectHandler);
defaultMenu.customItems.push(viewSourceCMI);
};
contextMenu = defaultMenu;
if ((systemManager is InteractiveObject)){
InteractiveObject(systemManager).contextMenu = defaultMenu;
};
}
private function addedHandler(event:Event):void{
if ((((event.target == this)) && ((creationQueue.length > 0)))){
doNextQueueItem();
};
}
public function get viewSourceURL():String{
return (_viewSourceURL);
}
override mx_internal function get usePadding():Boolean{
return (!((layout == ContainerLayout.ABSOLUTE)));
}
override mx_internal function setUnscaledHeight(value:Number):void{
invalidateProperties();
super.setUnscaledHeight(value);
}
mx_internal function dockControlBar(controlBar:IUIComponent, dock:Boolean):void{
var controlBar = controlBar;
var dock = dock;
if (dock){
removeChild(DisplayObject(controlBar));
//unresolved jump
var _slot1 = e;
return;
rawChildren.addChildAt(DisplayObject(controlBar), firstChildIndex);
setControlBar(controlBar);
} else {
rawChildren.removeChild(DisplayObject(controlBar));
//unresolved jump
var _slot1 = e;
return;
setControlBar(null);
addChildAt(DisplayObject(controlBar), 0);
};
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((styleProp == "backgroundColor")) && ((getStyle("backgroundImage") == getStyle("defaultBackgroundImage"))))){
clearStyle("backgroundImage");
};
}
override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
super.layoutChrome(unscaledWidth, unscaledHeight);
if (!doingLayout){
createBorder();
};
var bm:EdgeMetrics = borderMetrics;
var thickness:Number = getStyle("borderThickness");
var em:EdgeMetrics = new EdgeMetrics();
em.left = (bm.left - thickness);
em.top = (bm.top - thickness);
em.right = (bm.right - thickness);
em.bottom = (bm.bottom - thickness);
if (((controlBar) && (controlBar.includeInLayout))){
if ((controlBar is IInvalidating)){
IInvalidating(controlBar).invalidateDisplayList();
};
controlBar.setActualSize((width - (em.left + em.right)), controlBar.getExplicitOrMeasuredHeight());
controlBar.move(em.left, em.top);
};
}
protected function menuItemSelectHandler(event:Event):void{
navigateToURL(new URLRequest(_viewSourceURL), "_blank");
}
private function printCreationQueue():void{
var child:Object;
var msg:String = "";
var n:Number = creationQueue.length;
var i:int;
while (i < n) {
child = creationQueue[i];
msg = (msg + (((((" [" + i) + "] ") + child.id) + " ") + child.index));
i++;
};
}
override protected function resourcesChanged():void{
super.resourcesChanged();
if (viewSourceCMI){
viewSourceCMI.caption = resourceManager.getString("core", "viewSource");
};
}
override protected function commitProperties():void{
super.commitProperties();
resizeWidth = isNaN(explicitWidth);
resizeHeight = isNaN(explicitHeight);
if (((resizeWidth) || (resizeHeight))){
resizeHandler(new Event(Event.RESIZE));
if (!resizeHandlerAdded){
systemManager.addEventListener(Event.RESIZE, resizeHandler, false, 0, true);
resizeHandlerAdded = true;
};
} else {
if (resizeHandlerAdded){
systemManager.removeEventListener(Event.RESIZE, resizeHandler);
resizeHandlerAdded = false;
};
};
}
override public function set toolTip(value:String):void{
}
public function addToCreationQueue(id:Object, preferredIndex:int=-1, callbackFunc:Function=null, parent:IFlexDisplayObject=null):void{
var insertIndex:int;
var pointerIndex:int;
var pointerLevel:int;
var parentLevel:int;
var queueLength:int = creationQueue.length;
var queueObj:Object = {};
var insertedItem:Boolean;
queueObj.id = id;
queueObj.parent = parent;
queueObj.callbackFunc = callbackFunc;
queueObj.index = preferredIndex;
var i:int;
while (i < queueLength) {
pointerIndex = creationQueue[i].index;
pointerLevel = (creationQueue[i].parent) ? creationQueue[i].parent.nestLevel : 0;
if (queueObj.index != -1){
if ((((pointerIndex == -1)) || ((queueObj.index < pointerIndex)))){
insertIndex = i;
insertedItem = true;
break;
};
} else {
parentLevel = (queueObj.parent) ? queueObj.parent.nestLevel : 0;
if ((((pointerIndex == -1)) && ((pointerLevel < parentLevel)))){
insertIndex = i;
insertedItem = true;
break;
};
};
i++;
};
if (!insertedItem){
creationQueue.push(queueObj);
insertedItem = true;
} else {
creationQueue.splice(insertIndex, 0, queueObj);
};
if (((initialized) && (!(processingCreationQueue)))){
doNextQueueItem();
};
}
override mx_internal function initThemeColor():Boolean{
var tc:Object;
var rc:Number;
var sc:Number;
var globalSelector:CSSStyleDeclaration;
var result:Boolean = super.initThemeColor();
if (!result){
globalSelector = StyleManager.getStyleDeclaration("global");
if (globalSelector){
tc = globalSelector.getStyle("themeColor");
rc = globalSelector.getStyle("rollOverColor");
sc = globalSelector.getStyle("selectionColor");
};
if (((((tc) && (isNaN(rc)))) && (isNaN(sc)))){
setThemeColor(tc);
};
result = true;
};
return (result);
}
override public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
if (target == this){
setActualSize(obj.width, obj.height);
if (horizontalScrollBar){
horizontalScrollBar.visible = obj.horizontalScrollBarVisible;
};
if (verticalScrollBar){
verticalScrollBar.visible = obj.verticalScrollBarVisible;
};
if (whiteBox){
whiteBox.visible = obj.whiteBoxVisible;
};
horizontalScrollPosition = obj.horizontalScrollPosition;
verticalScrollPosition = obj.verticalScrollPosition;
updateDisplayList(unscaledWidth, unscaledHeight);
};
super.finishPrint(obj.scrollRect, target);
}
private function processNextQueueItem():void{
var queueItem:Object;
var nextChild:IUIComponent;
if (EffectManager.effectsPlaying.length > 0){
callLater(processNextQueueItem);
} else {
if (creationQueue.length > 0){
queueItem = creationQueue.shift();
nextChild = ((queueItem.id is String)) ? document[queueItem.id] : queueItem.id;
if ((nextChild is Container)){
Container(nextChild).createComponentsFromDescriptors(true);
};
if ((((nextChild is Container)) && ((Container(nextChild).creationPolicy == ContainerCreationPolicy.QUEUED)))){
doNextQueueItem();
} else {
nextChild.addEventListener("childrenCreationComplete", doNextQueueItem);
};
//unresolved jump
var _slot1 = e;
processNextQueueItem();
} else {
processingCreationQueue = false;
Application.useProgressiveLayout = false;
};
};
}
override public function set label(value:String):void{
}
public function get parameters():Object{
return (_parameters);
}
override public function get viewMetrics():EdgeMetrics{
if (!_applicationViewMetrics){
_applicationViewMetrics = new EdgeMetrics();
};
var vm:EdgeMetrics = _applicationViewMetrics;
var o:EdgeMetrics = super.viewMetrics;
var thickness:Number = getStyle("borderThickness");
vm.left = o.left;
vm.top = o.top;
vm.right = o.right;
vm.bottom = o.bottom;
if (((controlBar) && (controlBar.includeInLayout))){
vm.top = (vm.top - thickness);
vm.top = (vm.top + Math.max(controlBar.getExplicitOrMeasuredHeight(), thickness));
};
return (vm);
}
public function get url():String{
return (_url);
}
override public function set icon(value:Class):void{
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
createBorder();
}
private function setControlBar(newControlBar:IUIComponent):void{
if (newControlBar == controlBar){
return;
};
if (((controlBar) && ((controlBar is IStyleClient)))){
IStyleClient(controlBar).clearStyle("cornerRadius");
IStyleClient(controlBar).clearStyle("docked");
};
controlBar = newControlBar;
if (((controlBar) && ((controlBar is IStyleClient)))){
IStyleClient(controlBar).setStyle("cornerRadius", 0);
IStyleClient(controlBar).setStyle("docked", true);
};
invalidateSize();
invalidateDisplayList();
invalidateViewMetricsAndPadding();
}
override public function set tabIndex(value:int):void{
}
public static function get application():Object{
return (ApplicationGlobals.application);
}
}
}//package mx.core
Section 122
//ApplicationGlobals (mx.core.ApplicationGlobals)
package mx.core {
public class ApplicationGlobals {
public static var application:Object;
public function ApplicationGlobals(){
super();
}
}
}//package mx.core
Section 123
//ComponentDescriptor (mx.core.ComponentDescriptor)
package mx.core {
public class ComponentDescriptor {
public var events:Object;
public var type:Class;
public var document:Object;
private var _properties:Object;
public var propertiesFactory:Function;
public var id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ComponentDescriptor(descriptorProperties:Object){
var p:String;
super();
for (p in descriptorProperties) {
this[p] = descriptorProperties[p];
};
}
public function toString():String{
return (("ComponentDescriptor_" + id));
}
public function invalidateProperties():void{
_properties = null;
}
public function get properties():Object{
var cd:Array;
var n:int;
var i:int;
if (_properties){
return (_properties);
};
if (propertiesFactory != null){
_properties = propertiesFactory.call(document);
};
if (_properties){
cd = _properties.childDescriptors;
if (cd){
n = cd.length;
i = 0;
while (i < n) {
cd[i].document = document;
i++;
};
};
} else {
_properties = {};
};
return (_properties);
}
}
}//package mx.core
Section 124
//Container (mx.core.Container)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.*;
import mx.graphics.*;
import mx.controls.scrollClasses.*;
import mx.binding.*;
import mx.controls.listClasses.*;
import flash.ui.*;
import flash.utils.*;
public class Container extends UIComponent implements IContainer, IDataRenderer, IFocusManagerContainer, IListItemRenderer, IRawChildrenContainer {
private var forceLayout:Boolean;// = false
private var _numChildrenCreated:int;// = -1
private var _horizontalLineScrollSize:Number;// = 5
mx_internal var border:IFlexDisplayObject;
protected var actualCreationPolicy:String;
private var _viewMetricsAndPadding:EdgeMetrics;
private var _creatingContentPane:Boolean;// = false
private var _childRepeaters:Array;
private var scrollableWidth:Number;// = 0
private var _childDescriptors:Array;
private var _rawChildren:ContainerRawChildrenList;
private var _data:Object;
private var _verticalPageScrollSize:Number;// = 0
private var _viewMetrics:EdgeMetrics;
private var _verticalScrollBar:ScrollBar;
private var scrollPropertiesChanged:Boolean;// = false
private var changedStyles:String;// = null
private var scrollPositionChanged:Boolean;// = true
private var _defaultButton:IFlexDisplayObject;
private var mouseEventReferenceCount:int;// = 0
private var _focusPane:Sprite;
protected var whiteBox:Shape;
private var _forceClippingCount:int;
private var _horizontalPageScrollSize:Number;// = 0
private var _creationPolicy:String;
private var _creationIndex:int;// = -1
private var _clipContent:Boolean;// = true
private var _verticalScrollPosition:Number;// = 0
private var _autoLayout:Boolean;// = true
private var _icon:Class;// = null
mx_internal var doingLayout:Boolean;// = false
private var _horizontalScrollBar:ScrollBar;
private var numChildrenBefore:int;
private var viewableHeight:Number;// = 0
private var viewableWidth:Number;// = 0
mx_internal var contentPane:Sprite;// = null
private var _createdComponents:Array;
private var _firstChildIndex:int;// = 0
private var scrollableHeight:Number;// = 0
private var _verticalLineScrollSize:Number;// = 5
private var _horizontalScrollPosition:Number;// = 0
mx_internal var _horizontalScrollPolicy:String;// = "auto"
private var verticalScrollPositionPending:Number;
mx_internal var _verticalScrollPolicy:String;// = "auto"
private var horizontalScrollPositionPending:Number;
mx_internal var _numChildren:int;// = 0
private var recursionFlag:Boolean;// = true
private var _label:String;// = ""
mx_internal var blocker:Sprite;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const MULTIPLE_PROPERTIES:String = "<MULTIPLE>";
public function Container(){
super();
tabChildren = true;
tabEnabled = false;
showInAutomationHierarchy = false;
}
public function set verticalScrollPolicy(value:String):void{
if (_verticalScrollPolicy != value){
_verticalScrollPolicy = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalScrollPolicyChanged"));
};
}
private function createContentPaneAndScrollbarsIfNeeded():Boolean{
var bounds:Rectangle;
var changed:Boolean;
if (_clipContent){
bounds = getScrollableRect();
changed = createScrollbarsIfNeeded(bounds);
if (border){
updateBackgroundImageRect();
};
return (changed);
} else {
changed = createOrDestroyScrollbars(false, false, false);
bounds = getScrollableRect();
scrollableWidth = bounds.right;
scrollableHeight = bounds.bottom;
if (((changed) && (border))){
updateBackgroundImageRect();
};
};
return (changed);
}
override protected function initializationComplete():void{
}
mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array{
return (super.getObjectsUnderPoint(pt));
}
public function set creatingContentPane(value:Boolean):void{
_creatingContentPane = value;
}
public function set clipContent(value:Boolean):void{
if (_clipContent != value){
_clipContent = value;
invalidateDisplayList();
};
}
protected function scrollChildren():void{
if (!contentPane){
return;
};
var vm:EdgeMetrics = viewMetrics;
var x:Number = 0;
var y:Number = 0;
var w:Number = ((unscaledWidth - vm.left) - vm.right);
var h:Number = ((unscaledHeight - vm.top) - vm.bottom);
if (_clipContent){
x = (x + _horizontalScrollPosition);
if (horizontalScrollBar){
w = viewableWidth;
};
y = (y + _verticalScrollPosition);
if (verticalScrollBar){
h = viewableHeight;
};
} else {
w = scrollableWidth;
h = scrollableHeight;
};
var sr:Rectangle = getScrollableRect();
if ((((((((((((((x == 0)) && ((y == 0)))) && ((w >= sr.right)))) && ((h >= sr.bottom)))) && ((sr.left >= 0)))) && ((sr.top >= 0)))) && ((_forceClippingCount <= 0)))){
contentPane.scrollRect = null;
contentPane.opaqueBackground = null;
contentPane.cacheAsBitmap = false;
} else {
contentPane.scrollRect = new Rectangle(x, y, w, h);
};
if (focusPane){
focusPane.scrollRect = contentPane.scrollRect;
};
if (((((border) && ((border is IRectangularBorder)))) && (IRectangularBorder(border).hasBackgroundImage))){
IRectangularBorder(border).layoutBackgroundImage();
};
}
override public function set doubleClickEnabled(value:Boolean):void{
var n:int;
var i:int;
var child:InteractiveObject;
super.doubleClickEnabled = value;
if (contentPane){
n = contentPane.numChildren;
i = 0;
while (i < n) {
child = (contentPane.getChildAt(i) as InteractiveObject);
if (child){
child.doubleClickEnabled = value;
};
i++;
};
};
}
override public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:ISimpleStyleClient;
var n:int = super.numChildren;
var i:int;
while (i < n) {
if (((((contentPane) || ((i < _firstChildIndex)))) || ((i >= (_firstChildIndex + _numChildren))))){
child = (super.getChildAt(i) as ISimpleStyleClient);
if (child){
child.styleChanged(styleProp);
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(styleProp, recursive);
};
};
};
i++;
};
if (recursive){
changedStyles = (((!((changedStyles == null))) || ((styleProp == null)))) ? MULTIPLE_PROPERTIES : styleProp;
invalidateProperties();
};
}
mx_internal function get createdComponents():Array{
return (_createdComponents);
}
public function get childDescriptors():Array{
return (_childDescriptors);
}
override public function get contentMouseY():Number{
if (contentPane){
return (contentPane.mouseY);
};
return (super.contentMouseY);
}
mx_internal function get childRepeaters():Array{
return (_childRepeaters);
}
override public function contains(child:DisplayObject):Boolean{
if (contentPane){
return (contentPane.contains(child));
};
return (super.contains(child));
}
override public function get contentMouseX():Number{
if (contentPane){
return (contentPane.mouseX);
};
return (super.contentMouseX);
}
mx_internal function set createdComponents(value:Array):void{
_createdComponents = value;
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function validateSize(recursive:Boolean=false):void{
var n:int;
var i:int;
var child:DisplayObject;
if ((((autoLayout == false)) && ((forceLayout == false)))){
if (recursive){
n = super.numChildren;
i = 0;
while (i < n) {
child = super.getChildAt(i);
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).validateSize(true);
};
i++;
};
};
adjustSizesForScaleChanges();
} else {
super.validateSize(recursive);
};
}
public function get rawChildren():IChildList{
if (!_rawChildren){
_rawChildren = new ContainerRawChildrenList(this);
};
return (_rawChildren);
}
override public function getChildAt(index:int):DisplayObject{
if (contentPane){
return (contentPane.getChildAt(index));
};
return (super.getChildAt((_firstChildIndex + index)));
}
override protected function attachOverlay():void{
rawChildren_addChild(overlay);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
if ((((((((((((((((type == MouseEvent.CLICK)) || ((type == MouseEvent.DOUBLE_CLICK)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == MouseEvent.MOUSE_MOVE)))) || ((type == MouseEvent.MOUSE_OVER)))) || ((type == MouseEvent.MOUSE_OUT)))) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_WHEEL)))){
if ((((mouseEventReferenceCount < 2147483647)) && ((mouseEventReferenceCount++ == 0)))){
setStyle("mouseShield", true);
setStyle("mouseShieldChildren", true);
};
};
}
override public function localToContent(point:Point):Point{
if (!contentPane){
return (point);
};
point = localToGlobal(point);
return (globalToContent(point));
}
public function executeChildBindings(recurse:Boolean):void{
var child:IUIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = IUIComponent(getChildAt(i));
if ((child is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(child).executeBindings(recurse);
};
i++;
};
}
protected function createBorder():void{
var borderClass:Class;
if (((!(border)) && (isBorderNeeded()))){
borderClass = getStyle("borderSkin");
if (borderClass != null){
border = new (borderClass);
border.name = "border";
if ((border is IUIComponent)){
IUIComponent(border).enabled = enabled;
};
if ((border is ISimpleStyleClient)){
ISimpleStyleClient(border).styleName = this;
};
rawChildren.addChildAt(DisplayObject(border), 0);
invalidateDisplayList();
};
};
}
public function get verticalScrollPosition():Number{
if (!isNaN(verticalScrollPositionPending)){
return (verticalScrollPositionPending);
};
return (_verticalScrollPosition);
}
public function get horizontalScrollPosition():Number{
if (!isNaN(horizontalScrollPositionPending)){
return (horizontalScrollPositionPending);
};
return (_horizontalScrollPosition);
}
protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
if (border){
updateBackgroundImageRect();
border.move(0, 0);
border.setActualSize(unscaledWidth, unscaledHeight);
};
}
mx_internal function set childRepeaters(value:Array):void{
_childRepeaters = value;
}
override public function get focusPane():Sprite{
return (_focusPane);
}
public function set creationIndex(value:int):void{
_creationIndex = value;
}
public function get viewMetrics():EdgeMetrics{
var bm:EdgeMetrics = borderMetrics;
var verticalScrollBarIncluded:Boolean = ((!((verticalScrollBar == null))) && (((doingLayout) || ((verticalScrollPolicy == ScrollPolicy.ON)))));
var horizontalScrollBarIncluded:Boolean = ((!((horizontalScrollBar == null))) && (((doingLayout) || ((horizontalScrollPolicy == ScrollPolicy.ON)))));
if (((!(verticalScrollBarIncluded)) && (!(horizontalScrollBarIncluded)))){
return (bm);
};
if (!_viewMetrics){
_viewMetrics = bm.clone();
} else {
_viewMetrics.left = bm.left;
_viewMetrics.right = bm.right;
_viewMetrics.top = bm.top;
_viewMetrics.bottom = bm.bottom;
};
if (verticalScrollBarIncluded){
_viewMetrics.right = (_viewMetrics.right + verticalScrollBar.minWidth);
};
if (horizontalScrollBarIncluded){
_viewMetrics.bottom = (_viewMetrics.bottom + horizontalScrollBar.minHeight);
};
return (_viewMetrics);
}
public function set verticalScrollBar(value:ScrollBar):void{
_verticalScrollBar = value;
}
public function set verticalScrollPosition(value:Number):void{
if (_verticalScrollPosition == value){
return;
};
_verticalScrollPosition = value;
scrollPositionChanged = true;
if (!initialized){
verticalScrollPositionPending = value;
};
invalidateDisplayList();
dispatchEvent(new Event("viewChanged"));
}
private function createOrDestroyScrollbars(needHorizontal:Boolean, needVertical:Boolean, needContentPane:Boolean):Boolean{
var fm:IFocusManager;
var horizontalScrollBarStyleName:String;
var verticalScrollBarStyleName:String;
var g:Graphics;
var changed:Boolean;
if (((((needHorizontal) || (needVertical))) || (needContentPane))){
createContentPane();
};
if (needHorizontal){
if (!horizontalScrollBar){
horizontalScrollBar = new HScrollBar();
horizontalScrollBar.name = "horizontalScrollBar";
horizontalScrollBarStyleName = getStyle("horizontalScrollBarStyleName");
if (((horizontalScrollBarStyleName) && ((horizontalScrollBar is ISimpleStyleClient)))){
ISimpleStyleClient(horizontalScrollBar).styleName = horizontalScrollBarStyleName;
};
rawChildren.addChild(DisplayObject(horizontalScrollBar));
horizontalScrollBar.lineScrollSize = horizontalLineScrollSize;
horizontalScrollBar.pageScrollSize = horizontalPageScrollSize;
horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, horizontalScrollBar_scrollHandler);
horizontalScrollBar.enabled = enabled;
if ((horizontalScrollBar is IInvalidating)){
IInvalidating(horizontalScrollBar).validateNow();
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
if (!verticalScrollBar){
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
};
} else {
if (horizontalScrollBar){
horizontalScrollBar.removeEventListener(ScrollEvent.SCROLL, horizontalScrollBar_scrollHandler);
rawChildren.removeChild(DisplayObject(horizontalScrollBar));
horizontalScrollBar = null;
viewableWidth = (scrollableWidth = 0);
if (_horizontalScrollPosition != 0){
_horizontalScrollPosition = 0;
scrollPositionChanged = true;
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
fm = focusManager;
if (((!(verticalScrollBar)) && (((!(fm)) || (!((fm.getFocus() == this))))))){
removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
};
};
if (needVertical){
if (!verticalScrollBar){
verticalScrollBar = new VScrollBar();
verticalScrollBar.name = "verticalScrollBar";
verticalScrollBarStyleName = getStyle("verticalScrollBarStyleName");
if (((verticalScrollBarStyleName) && ((verticalScrollBar is ISimpleStyleClient)))){
ISimpleStyleClient(verticalScrollBar).styleName = verticalScrollBarStyleName;
};
rawChildren.addChild(DisplayObject(verticalScrollBar));
verticalScrollBar.lineScrollSize = verticalLineScrollSize;
verticalScrollBar.pageScrollSize = verticalPageScrollSize;
verticalScrollBar.addEventListener(ScrollEvent.SCROLL, verticalScrollBar_scrollHandler);
verticalScrollBar.enabled = enabled;
if ((verticalScrollBar is IInvalidating)){
IInvalidating(verticalScrollBar).validateNow();
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
if (!horizontalScrollBar){
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
};
} else {
if (verticalScrollBar){
verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, verticalScrollBar_scrollHandler);
rawChildren.removeChild(DisplayObject(verticalScrollBar));
verticalScrollBar = null;
viewableHeight = (scrollableHeight = 0);
if (_verticalScrollPosition != 0){
_verticalScrollPosition = 0;
scrollPositionChanged = true;
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
fm = focusManager;
if (((!(horizontalScrollBar)) && (((!(fm)) || (!((fm.getFocus() == this))))))){
removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
};
};
if (((horizontalScrollBar) && (verticalScrollBar))){
if (!whiteBox){
whiteBox = new FlexShape();
whiteBox.name = "whiteBox";
g = whiteBox.graphics;
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, verticalScrollBar.minWidth, horizontalScrollBar.minHeight);
g.endFill();
rawChildren.addChild(whiteBox);
};
} else {
if (whiteBox){
rawChildren.removeChild(whiteBox);
whiteBox = null;
};
};
return (changed);
}
override protected function keyDownHandler(event:KeyboardEvent):void{
var direction:String;
var oldPos:Number;
var focusObj:Object = getFocus();
if ((focusObj is TextField)){
return;
};
if (verticalScrollBar){
direction = ScrollEventDirection.VERTICAL;
oldPos = verticalScrollPosition;
switch (event.keyCode){
case Keyboard.DOWN:
verticalScrollPosition = (verticalScrollPosition + verticalLineScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.LINE_DOWN);
event.stopPropagation();
break;
case Keyboard.UP:
verticalScrollPosition = (verticalScrollPosition - verticalLineScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.LINE_UP);
event.stopPropagation();
break;
case Keyboard.PAGE_UP:
verticalScrollPosition = (verticalScrollPosition - verticalPageScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.PAGE_UP);
event.stopPropagation();
break;
case Keyboard.PAGE_DOWN:
verticalScrollPosition = (verticalScrollPosition + verticalPageScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.PAGE_DOWN);
event.stopPropagation();
break;
case Keyboard.HOME:
verticalScrollPosition = verticalScrollBar.minScrollPosition;
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.AT_TOP);
event.stopPropagation();
break;
case Keyboard.END:
verticalScrollPosition = verticalScrollBar.maxScrollPosition;
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.AT_BOTTOM);
event.stopPropagation();
break;
};
};
if (horizontalScrollBar){
direction = ScrollEventDirection.HORIZONTAL;
oldPos = horizontalScrollPosition;
switch (event.keyCode){
case Keyboard.LEFT:
horizontalScrollPosition = (horizontalScrollPosition - horizontalLineScrollSize);
dispatchScrollEvent(direction, oldPos, horizontalScrollPosition, ScrollEventDetail.LINE_LEFT);
event.stopPropagation();
break;
case Keyboard.RIGHT:
horizontalScrollPosition = (horizontalScrollPosition + horizontalLineScrollSize);
dispatchScrollEvent(direction, oldPos, horizontalScrollPosition, ScrollEventDetail.LINE_RIGHT);
event.stopPropagation();
break;
};
};
}
public function get icon():Class{
return (_icon);
}
private function createOrDestroyBlocker():void{
var o:DisplayObject;
var sm:ISystemManager;
if (enabled){
if (blocker){
rawChildren.removeChild(blocker);
blocker = null;
};
} else {
if (!blocker){
blocker = new FlexSprite();
blocker.name = "blocker";
blocker.mouseEnabled = true;
rawChildren.addChild(blocker);
blocker.addEventListener(MouseEvent.CLICK, blocker_clickHandler);
o = (focusManager) ? DisplayObject(focusManager.getFocus()) : null;
while (o) {
if (o == this){
sm = systemManager;
if (((sm) && (sm.stage))){
sm.stage.focus = null;
};
break;
};
o = o.parent;
};
};
};
}
private function horizontalScrollBar_scrollHandler(event:Event):void{
var oldPos:Number;
if ((event is ScrollEvent)){
oldPos = horizontalScrollPosition;
horizontalScrollPosition = horizontalScrollBar.scrollPosition;
dispatchScrollEvent(ScrollEventDirection.HORIZONTAL, oldPos, horizontalScrollPosition, ScrollEvent(event).detail);
};
}
public function createComponentFromDescriptor(descriptor:ComponentDescriptor, recurse:Boolean):IFlexDisplayObject{
var p:String;
var rChild:IRepeaterClient;
var scChild:IStyleClient;
var eventName:String;
var eventHandler:String;
var childDescriptor:UIComponentDescriptor = UIComponentDescriptor(descriptor);
var childProperties:Object = childDescriptor.properties;
if (((((((!((numChildrenBefore == 0))) || (!((numChildrenCreated == -1))))) && ((childDescriptor.instanceIndices == null)))) && (hasChildMatchingDescriptor(childDescriptor)))){
return (null);
};
UIComponentGlobals.layoutManager.usePhasedInstantiation = true;
var childType:Class = childDescriptor.type;
var child:IDeferredInstantiationUIComponent = new (childType);
child.id = childDescriptor.id;
if (((child.id) && (!((child.id == ""))))){
child.name = child.id;
};
child.descriptor = childDescriptor;
if (((childProperties.childDescriptors) && ((child is Container)))){
Container(child)._childDescriptors = childProperties.childDescriptors;
delete childProperties.childDescriptors;
};
for (p in childProperties) {
child[p] = childProperties[p];
};
if ((child is Container)){
Container(child).recursionFlag = recurse;
};
if (childDescriptor.instanceIndices){
if ((child is IRepeaterClient)){
rChild = IRepeaterClient(child);
rChild.instanceIndices = childDescriptor.instanceIndices;
rChild.repeaters = childDescriptor.repeaters;
rChild.repeaterIndices = childDescriptor.repeaterIndices;
};
};
if ((child is IStyleClient)){
scChild = IStyleClient(child);
if (childDescriptor.stylesFactory != null){
if (!scChild.styleDeclaration){
scChild.styleDeclaration = new CSSStyleDeclaration();
};
scChild.styleDeclaration.factory = childDescriptor.stylesFactory;
};
};
var childEvents:Object = childDescriptor.events;
if (childEvents){
for (eventName in childEvents) {
eventHandler = childEvents[eventName];
child.addEventListener(eventName, childDescriptor.document[eventHandler]);
};
};
var childEffects:Array = childDescriptor.effects;
if (childEffects){
child.registerEffects(childEffects);
};
if ((child is IRepeaterClient)){
IRepeaterClient(child).initializeRepeaterArrays(this);
};
child.createReferenceOnParentDocument(IFlexDisplayObject(childDescriptor.document));
if (!child.document){
child.document = childDescriptor.document;
};
if ((child is IRepeater)){
if (!childRepeaters){
childRepeaters = [];
};
childRepeaters.push(child);
child.executeBindings();
IRepeater(child).initializeRepeater(this, recurse);
} else {
addChild(DisplayObject(child));
child.executeBindings();
if ((((creationPolicy == ContainerCreationPolicy.QUEUED)) || ((creationPolicy == ContainerCreationPolicy.NONE)))){
child.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
return (child);
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
if (horizontalScrollBar){
horizontalScrollBar.enabled = value;
};
if (verticalScrollBar){
verticalScrollBar.enabled = value;
};
invalidateProperties();
}
public function set horizontalScrollBar(value:ScrollBar):void{
_horizontalScrollBar = value;
}
mx_internal function get usePadding():Boolean{
return (true);
}
override public function get baselinePosition():Number{
var child:IUIComponent;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if ((((getStyle("verticalAlign") == "top")) && ((numChildren > 0)))){
child = (getChildAt(0) as IUIComponent);
if (child){
return ((child.y + child.baselinePosition));
};
};
return (super.baselinePosition);
};
if (!validateBaselinePosition()){
return (NaN);
};
var lineMetrics:TextLineMetrics = measureText("Wj");
if (height < (((2 * viewMetrics.top) + 4) + lineMetrics.ascent)){
return (int((height + ((lineMetrics.ascent - height) / 2))));
};
return (((viewMetrics.top + 2) + lineMetrics.ascent));
}
override public function getChildByName(name:String):DisplayObject{
var child:DisplayObject;
var index:int;
if (contentPane){
return (contentPane.getChildByName(name));
};
child = super.getChildByName(name);
if (!child){
return (null);
};
index = (super.getChildIndex(child) - _firstChildIndex);
if ((((index < 0)) || ((index >= _numChildren)))){
return (null);
};
return (child);
}
public function get verticalLineScrollSize():Number{
return (_verticalLineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
if (formerParent == this){
index = ((index)==numChildren) ? (index - 1) : index;
};
formerParent.removeChild(child);
};
addingChild(child);
if (contentPane){
contentPane.addChildAt(child, index);
} else {
$addChildAt(child, (_firstChildIndex + index));
};
childAdded(child);
if ((((child is UIComponent)) && (UIComponent(child).isDocument))){
BindingManager.setEnabled(child, true);
};
return (child);
}
public function get maxVerticalScrollPosition():Number{
return ((verticalScrollBar) ? verticalScrollBar.maxScrollPosition : Math.max((scrollableHeight - viewableHeight), 0));
}
public function set horizontalScrollPosition(value:Number):void{
if (_horizontalScrollPosition == value){
return;
};
_horizontalScrollPosition = value;
scrollPositionChanged = true;
if (!initialized){
horizontalScrollPositionPending = value;
};
invalidateDisplayList();
dispatchEvent(new Event("viewChanged"));
}
mx_internal function invalidateViewMetricsAndPadding():void{
_viewMetricsAndPadding = null;
}
public function get horizontalLineScrollSize():Number{
return (_horizontalLineScrollSize);
}
override public function set focusPane(o:Sprite):void{
var oldInvalidateSizeFlag:Boolean = invalidateSizeFlag;
var oldInvalidateDisplayListFlag:Boolean = invalidateDisplayListFlag;
invalidateSizeFlag = true;
invalidateDisplayListFlag = true;
if (o){
rawChildren.addChild(o);
o.x = 0;
o.y = 0;
o.scrollRect = null;
_focusPane = o;
} else {
rawChildren.removeChild(_focusPane);
_focusPane = null;
};
if (((o) && (contentPane))){
o.x = contentPane.x;
o.y = contentPane.y;
o.scrollRect = contentPane.scrollRect;
};
invalidateSizeFlag = oldInvalidateSizeFlag;
invalidateDisplayListFlag = oldInvalidateDisplayListFlag;
}
private function updateBackgroundImageRect():void{
var rectBorder:IRectangularBorder = (border as IRectangularBorder);
if (!rectBorder){
return;
};
if ((((viewableWidth == 0)) && ((viewableHeight == 0)))){
rectBorder.backgroundImageBounds = null;
return;
};
var vm:EdgeMetrics = viewMetrics;
var bkWidth:Number = (viewableWidth) ? viewableWidth : ((unscaledWidth - vm.left) - vm.right);
var bkHeight:Number = (viewableHeight) ? viewableHeight : ((unscaledHeight - vm.top) - vm.bottom);
if (getStyle("backgroundAttachment") == "fixed"){
rectBorder.backgroundImageBounds = new Rectangle(vm.left, vm.top, bkWidth, bkHeight);
} else {
rectBorder.backgroundImageBounds = new Rectangle(vm.left, vm.top, Math.max(scrollableWidth, bkWidth), Math.max(scrollableHeight, bkHeight));
};
}
private function blocker_clickHandler(event:Event):void{
event.stopPropagation();
}
private function mouseWheelHandler(event:MouseEvent):void{
var scrollDirection:int;
var lineScrollSize:int;
var scrollAmount:Number;
var oldPosition:Number;
if (verticalScrollBar){
event.stopPropagation();
scrollDirection = ((event.delta <= 0)) ? 1 : -1;
lineScrollSize = (verticalScrollBar) ? verticalScrollBar.lineScrollSize : 1;
scrollAmount = Math.max(Math.abs(event.delta), lineScrollSize);
oldPosition = verticalScrollPosition;
verticalScrollPosition = (verticalScrollPosition + ((3 * scrollAmount) * scrollDirection));
dispatchScrollEvent(ScrollEventDirection.VERTICAL, oldPosition, verticalScrollPosition, ((event.delta <= 0)) ? ScrollEventDetail.LINE_UP : ScrollEventDetail.LINE_DOWN);
};
}
public function get defaultButton():IFlexDisplayObject{
return (_defaultButton);
}
mx_internal function createContentPane():void{
var childIndex:int;
var child:IUIComponent;
if (contentPane){
return;
};
creatingContentPane = true;
var n:int = numChildren;
var newPane:Sprite = new FlexSprite();
newPane.name = "contentPane";
newPane.tabChildren = true;
if (border){
childIndex = (rawChildren.getChildIndex(DisplayObject(border)) + 1);
if ((((border is IRectangularBorder)) && (IRectangularBorder(border).hasBackgroundImage))){
childIndex++;
};
} else {
childIndex = 0;
};
rawChildren.addChildAt(newPane, childIndex);
var i:int;
while (i < n) {
child = IUIComponent(super.getChildAt(_firstChildIndex));
newPane.addChild(DisplayObject(child));
child.parentChanged(newPane);
_numChildren--;
i++;
};
contentPane = newPane;
creatingContentPane = false;
contentPane.visible = true;
}
public function set verticalPageScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_verticalPageScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalPageScrollSizeChanged"));
}
mx_internal function setDocumentDescriptor(desc:UIComponentDescriptor):void{
var message:String;
if (processedDescriptors){
return;
};
if (((_documentDescriptor) && (_documentDescriptor.properties.childDescriptors))){
if (desc.properties.childDescriptors){
message = resourceManager.getString("core", "multipleChildSets_ClassAndSubclass");
throw (new Error(message));
};
} else {
_documentDescriptor = desc;
_documentDescriptor.document = this;
};
}
private function verticalScrollBar_scrollHandler(event:Event):void{
var oldPos:Number;
if ((event is ScrollEvent)){
oldPos = verticalScrollPosition;
verticalScrollPosition = verticalScrollBar.scrollPosition;
dispatchScrollEvent(ScrollEventDirection.VERTICAL, oldPos, verticalScrollPosition, ScrollEvent(event).detail);
};
}
public function get creationPolicy():String{
return (_creationPolicy);
}
public function set icon(value:Class):void{
_icon = value;
dispatchEvent(new Event("iconChanged"));
}
private function dispatchScrollEvent(direction:String, oldPosition:Number, newPosition:Number, detail:String):void{
var event:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
event.direction = direction;
event.position = newPosition;
event.delta = (newPosition - oldPosition);
event.detail = detail;
dispatchEvent(event);
}
public function get label():String{
return (_label);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
public function get borderMetrics():EdgeMetrics{
return ((((border) && ((border is IRectangularBorder)))) ? IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY);
}
private function creationCompleteHandler(event:FlexEvent):void{
numChildrenCreated--;
if (numChildrenCreated <= 0){
dispatchEvent(new FlexEvent("childrenCreationComplete"));
};
}
override public function contentToLocal(point:Point):Point{
if (!contentPane){
return (point);
};
point = contentToGlobal(point);
return (globalToLocal(point));
}
override public function removeChild(child:DisplayObject):DisplayObject{
var n:int;
var i:int;
if ((((child is IDeferredInstantiationUIComponent)) && (IDeferredInstantiationUIComponent(child).descriptor))){
if (createdComponents){
n = createdComponents.length;
i = 0;
while (i < n) {
if (createdComponents[i] === child){
createdComponents.splice(i, 1);
};
i++;
};
};
};
removingChild(child);
if ((((child is UIComponent)) && (UIComponent(child).isDocument))){
BindingManager.setEnabled(child, false);
};
if (contentPane){
contentPane.removeChild(child);
} else {
$removeChild(child);
};
childRemoved(child);
return (child);
}
final mx_internal function get $numChildren():int{
return (super.numChildren);
}
mx_internal function get numRepeaters():int{
return ((childRepeaters) ? childRepeaters.length : 0);
}
mx_internal function set numChildrenCreated(value:int):void{
_numChildrenCreated = value;
}
public function get creatingContentPane():Boolean{
return (_creatingContentPane);
}
public function get clipContent():Boolean{
return (_clipContent);
}
mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{
return (super.getChildIndex(child));
}
override public function regenerateStyleCache(recursive:Boolean):void{
var n:int;
var i:int;
var child:DisplayObject;
super.regenerateStyleCache(recursive);
if (contentPane){
n = contentPane.numChildren;
i = 0;
while (i < n) {
child = getChildAt(i);
if (((recursive) && ((child is UIComponent)))){
if (UIComponent(child).inheritingStyles != UIComponent.STYLE_UNINITIALIZED){
UIComponent(child).regenerateStyleCache(recursive);
};
} else {
if ((((child is IUITextField)) && (IUITextField(child).inheritingStyles))){
StyleProtoChain.initTextField(IUITextField(child));
};
};
i++;
};
};
}
override public function getChildIndex(child:DisplayObject):int{
var index:int;
if (contentPane){
return (contentPane.getChildIndex(child));
};
index = (super.getChildIndex(child) - _firstChildIndex);
return (index);
}
mx_internal function rawChildren_contains(child:DisplayObject):Boolean{
return (super.contains(child));
}
mx_internal function getScrollableRect():Rectangle{
var child:DisplayObject;
var left:Number = 0;
var top:Number = 0;
var right:Number = 0;
var bottom:Number = 0;
var n:int = numChildren;
var i:int;
while (i < n) {
child = getChildAt(i);
if ((((child is IUIComponent)) && (!(IUIComponent(child).includeInLayout)))){
} else {
left = Math.min(left, child.x);
top = Math.min(top, child.y);
if (!isNaN(child.width)){
right = Math.max(right, (child.x + child.width));
};
if (!isNaN(child.height)){
bottom = Math.max(bottom, (child.y + child.height));
};
};
i++;
};
var vm:EdgeMetrics = viewMetrics;
var bounds:Rectangle = new Rectangle();
bounds.left = left;
bounds.top = top;
bounds.right = right;
bounds.bottom = bottom;
if (usePadding){
bounds.right = (bounds.right + getStyle("paddingRight"));
bounds.bottom = (bounds.bottom + getStyle("paddingBottom"));
};
return (bounds);
}
override protected function createChildren():void{
var mainApp:Application;
super.createChildren();
createBorder();
createOrDestroyScrollbars((horizontalScrollPolicy == ScrollPolicy.ON), (verticalScrollPolicy == ScrollPolicy.ON), (((horizontalScrollPolicy == ScrollPolicy.ON)) || ((verticalScrollPolicy == ScrollPolicy.ON))));
if (creationPolicy != null){
actualCreationPolicy = creationPolicy;
} else {
if ((parent is Container)){
if (Container(parent).actualCreationPolicy == ContainerCreationPolicy.QUEUED){
actualCreationPolicy = ContainerCreationPolicy.AUTO;
} else {
actualCreationPolicy = Container(parent).actualCreationPolicy;
};
};
};
if (actualCreationPolicy == ContainerCreationPolicy.NONE){
actualCreationPolicy = ContainerCreationPolicy.AUTO;
} else {
if (actualCreationPolicy == ContainerCreationPolicy.QUEUED){
mainApp = (parentApplication) ? Application(parentApplication) : Application(Application.application);
mainApp.addToCreationQueue(this, creationIndex, null, this);
} else {
if (recursionFlag){
createComponentsFromDescriptors();
};
};
};
if (autoLayout == false){
forceLayout = true;
};
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
}
override public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
BindingManager.executeBindings(bindingsHost, id, this);
if (recurse){
executeChildBindings(recurse);
};
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
var oldIndex:int;
var eventOldIndex:int = oldIndex;
var eventNewIndex:int = newIndex;
if (contentPane){
contentPane.setChildIndex(child, newIndex);
if (((_autoLayout) || (forceLayout))){
invalidateDisplayList();
};
} else {
oldIndex = super.getChildIndex(child);
newIndex = (newIndex + _firstChildIndex);
if (newIndex == oldIndex){
return;
};
super.setChildIndex(child, newIndex);
invalidateDisplayList();
eventOldIndex = (oldIndex - _firstChildIndex);
eventNewIndex = (newIndex - _firstChildIndex);
};
var event:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.CHILD_INDEX_CHANGE);
event.relatedObject = child;
event.oldIndex = eventOldIndex;
event.newIndex = eventNewIndex;
dispatchEvent(event);
dispatchEvent(new Event("childrenChanged"));
}
override public function globalToContent(point:Point):Point{
if (contentPane){
return (contentPane.globalToLocal(point));
};
return (globalToLocal(point));
}
mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject{
var index:int = rawChildren_getChildIndex(child);
return (rawChildren_removeChildAt(index));
}
mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{
var oldIndex:int = super.getChildIndex(child);
super.setChildIndex(child, newIndex);
if ((((oldIndex < _firstChildIndex)) && ((newIndex >= _firstChildIndex)))){
_firstChildIndex--;
} else {
if ((((oldIndex >= _firstChildIndex)) && ((newIndex <= _firstChildIndex)))){
_firstChildIndex++;
};
};
dispatchEvent(new Event("childrenChanged"));
}
public function set verticalLineScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_verticalLineScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalLineScrollSizeChanged"));
}
mx_internal function rawChildren_getChildAt(index:int):DisplayObject{
return (super.getChildAt(index));
}
public function get creationIndex():int{
return (_creationIndex);
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
public function get viewMetricsAndPadding():EdgeMetrics{
if (((((_viewMetricsAndPadding) && (((!(horizontalScrollBar)) || ((horizontalScrollPolicy == ScrollPolicy.ON)))))) && (((!(verticalScrollBar)) || ((verticalScrollPolicy == ScrollPolicy.ON)))))){
return (_viewMetricsAndPadding);
};
if (!_viewMetricsAndPadding){
_viewMetricsAndPadding = new EdgeMetrics();
};
var o:EdgeMetrics = _viewMetricsAndPadding;
var vm:EdgeMetrics = viewMetrics;
o.left = (vm.left + getStyle("paddingLeft"));
o.right = (vm.right + getStyle("paddingRight"));
o.top = (vm.top + getStyle("paddingTop"));
o.bottom = (vm.bottom + getStyle("paddingBottom"));
return (o);
}
override public function addChild(child:DisplayObject):DisplayObject{
return (addChildAt(child, numChildren));
}
public function set horizontalPageScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_horizontalPageScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalPageScrollSizeChanged"));
}
override mx_internal function childAdded(child:DisplayObject):void{
dispatchEvent(new Event("childrenChanged"));
var event:ChildExistenceChangedEvent = new ChildExistenceChangedEvent(ChildExistenceChangedEvent.CHILD_ADD);
event.relatedObject = child;
dispatchEvent(event);
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
super.childAdded(child);
}
public function set horizontalScrollPolicy(value:String):void{
if (_horizontalScrollPolicy != value){
_horizontalScrollPolicy = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalScrollPolicyChanged"));
};
}
private function layoutCompleteHandler(event:FlexEvent):void{
UIComponentGlobals.layoutManager.removeEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler);
forceLayout = false;
var needToScrollChildren:Boolean;
if (!isNaN(horizontalScrollPositionPending)){
if (horizontalScrollPositionPending < 0){
horizontalScrollPositionPending = 0;
} else {
if (horizontalScrollPositionPending > maxHorizontalScrollPosition){
horizontalScrollPositionPending = maxHorizontalScrollPosition;
};
};
if (((horizontalScrollBar) && (!((horizontalScrollBar.scrollPosition == horizontalScrollPositionPending))))){
_horizontalScrollPosition = horizontalScrollPositionPending;
horizontalScrollBar.scrollPosition = horizontalScrollPositionPending;
needToScrollChildren = true;
};
horizontalScrollPositionPending = NaN;
};
if (!isNaN(verticalScrollPositionPending)){
if (verticalScrollPositionPending < 0){
verticalScrollPositionPending = 0;
} else {
if (verticalScrollPositionPending > maxVerticalScrollPosition){
verticalScrollPositionPending = maxVerticalScrollPosition;
};
};
if (((verticalScrollBar) && (!((verticalScrollBar.scrollPosition == verticalScrollPositionPending))))){
_verticalScrollPosition = verticalScrollPositionPending;
verticalScrollBar.scrollPosition = verticalScrollPositionPending;
needToScrollChildren = true;
};
verticalScrollPositionPending = NaN;
};
if (needToScrollChildren){
scrollChildren();
};
}
public function createComponentsFromDescriptors(recurse:Boolean=true):void{
var component:IFlexDisplayObject;
numChildrenBefore = numChildren;
createdComponents = [];
var n:int = (childDescriptors) ? childDescriptors.length : 0;
var i:int;
while (i < n) {
component = createComponentFromDescriptor(childDescriptors[i], recurse);
createdComponents.push(component);
i++;
};
if ((((creationPolicy == ContainerCreationPolicy.QUEUED)) || ((creationPolicy == ContainerCreationPolicy.NONE)))){
UIComponentGlobals.layoutManager.usePhasedInstantiation = false;
};
numChildrenCreated = (numChildren - numChildrenBefore);
processedDescriptors = true;
}
override mx_internal function fillOverlay(overlay:UIComponent, color:uint, targetArea:RoundedRectangle=null):void{
var vm:EdgeMetrics = viewMetrics;
var cornerRadius:Number = 0;
if (!targetArea){
targetArea = new RoundedRectangle(vm.left, vm.top, ((unscaledWidth - vm.right) - vm.left), ((unscaledHeight - vm.bottom) - vm.top), cornerRadius);
};
if (((((((((isNaN(targetArea.x)) || (isNaN(targetArea.y)))) || (isNaN(targetArea.width)))) || (isNaN(targetArea.height)))) || (isNaN(targetArea.cornerRadius)))){
return;
};
var g:Graphics = overlay.graphics;
g.clear();
g.beginFill(color);
g.drawRoundRect(targetArea.x, targetArea.y, targetArea.width, targetArea.height, (targetArea.cornerRadius * 2), (targetArea.cornerRadius * 2));
g.endFill();
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
if ((((((((((((((((type == MouseEvent.CLICK)) || ((type == MouseEvent.DOUBLE_CLICK)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == MouseEvent.MOUSE_MOVE)))) || ((type == MouseEvent.MOUSE_OVER)))) || ((type == MouseEvent.MOUSE_OUT)))) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_WHEEL)))){
if ((((mouseEventReferenceCount > 0)) && ((--mouseEventReferenceCount == 0)))){
setStyle("mouseShield", false);
setStyle("mouseShieldChildren", false);
};
};
}
mx_internal function rawChildren_removeChildAt(index:int):DisplayObject{
var child:DisplayObject = super.getChildAt(index);
super.removingChild(child);
$removeChildAt(index);
super.childRemoved(child);
if ((((_firstChildIndex < index)) && ((index < (_firstChildIndex + _numChildren))))){
_numChildren--;
} else {
if ((((_numChildren == 0)) || ((index < _firstChildIndex)))){
_firstChildIndex--;
};
};
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("childrenChanged"));
return (child);
}
public function set data(value:Object):void{
_data = value;
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
invalidateDisplayList();
}
override public function removeChildAt(index:int):DisplayObject{
return (removeChild(getChildAt(index)));
}
private function isBorderNeeded():Boolean{
var c:Class = getStyle("borderSkin");
if (c != getDefinitionByName("mx.skins.halo::HaloBorder")){
return (true);
};
//unresolved jump
var _slot1 = e;
return (true);
var v:Object = getStyle("borderStyle");
if (v){
if (((!((v == "none"))) || ((((v == "none")) && (getStyle("mouseShield")))))){
return (true);
};
};
v = getStyle("backgroundColor");
if (((!((v === null))) && (!((v === ""))))){
return (true);
};
v = getStyle("backgroundImage");
return (((!((v == null))) && (!((v == "")))));
}
public function set autoLayout(value:Boolean):void{
var p:IInvalidating;
_autoLayout = value;
if (value){
invalidateSize();
invalidateDisplayList();
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
}
public function get verticalPageScrollSize():Number{
return (_verticalPageScrollSize);
}
public function getChildren():Array{
var results:Array = [];
var n:int = numChildren;
var i:int;
while (i < n) {
results.push(getChildAt(i));
i++;
};
return (results);
}
private function createScrollbarsIfNeeded(bounds:Rectangle):Boolean{
var newScrollableWidth:Number = bounds.right;
var newScrollableHeight:Number = bounds.bottom;
var newViewableWidth:Number = unscaledWidth;
var newViewableHeight:Number = unscaledHeight;
var hasNegativeCoords:Boolean = (((bounds.left < 0)) || ((bounds.top < 0)));
var vm:EdgeMetrics = viewMetrics;
if (scaleX != 1){
newViewableWidth = (newViewableWidth + (1 / Math.abs(scaleX)));
};
if (scaleY != 1){
newViewableHeight = (newViewableHeight + (1 / Math.abs(scaleY)));
};
newViewableWidth = Math.floor(newViewableWidth);
newViewableHeight = Math.floor(newViewableHeight);
newScrollableWidth = Math.floor(newScrollableWidth);
newScrollableHeight = Math.floor(newScrollableHeight);
if (((horizontalScrollBar) && (!((horizontalScrollPolicy == ScrollPolicy.ON))))){
newViewableHeight = (newViewableHeight - horizontalScrollBar.minHeight);
};
if (((verticalScrollBar) && (!((verticalScrollPolicy == ScrollPolicy.ON))))){
newViewableWidth = (newViewableWidth - verticalScrollBar.minWidth);
};
newViewableWidth = (newViewableWidth - (vm.left + vm.right));
newViewableHeight = (newViewableHeight - (vm.top + vm.bottom));
var needHorizontal = (horizontalScrollPolicy == ScrollPolicy.ON);
var needVertical = (verticalScrollPolicy == ScrollPolicy.ON);
var needContentPane:Boolean = ((((((((((needHorizontal) || (needVertical))) || (hasNegativeCoords))) || (!((overlay == null))))) || ((vm.left > 0)))) || ((vm.top > 0)));
if (newViewableWidth < newScrollableWidth){
needContentPane = true;
if ((((((horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((((unscaledHeight - vm.top) - vm.bottom) >= 18)))) && ((((unscaledWidth - vm.left) - vm.right) >= 32)))){
needHorizontal = true;
};
};
if (newViewableHeight < newScrollableHeight){
needContentPane = true;
if ((((((verticalScrollPolicy == ScrollPolicy.AUTO)) && ((((unscaledWidth - vm.left) - vm.right) >= 18)))) && ((((unscaledHeight - vm.top) - vm.bottom) >= 32)))){
needVertical = true;
};
};
if (((((((((((((((needHorizontal) && (needVertical))) && ((horizontalScrollPolicy == ScrollPolicy.AUTO)))) && ((verticalScrollPolicy == ScrollPolicy.AUTO)))) && (horizontalScrollBar))) && (verticalScrollBar))) && (((newViewableWidth + verticalScrollBar.minWidth) >= newScrollableWidth)))) && (((newViewableHeight + horizontalScrollBar.minHeight) >= newScrollableHeight)))){
needVertical = false;
needHorizontal = needVertical;
} else {
if (((((((((needHorizontal) && (!(needVertical)))) && (verticalScrollBar))) && ((horizontalScrollPolicy == ScrollPolicy.AUTO)))) && (((newViewableWidth + verticalScrollBar.minWidth) >= newScrollableWidth)))){
needHorizontal = false;
};
};
var changed:Boolean = createOrDestroyScrollbars(needHorizontal, needVertical, needContentPane);
if (((((!((scrollableWidth == newScrollableWidth))) || (!((viewableWidth == newViewableWidth))))) || (changed))){
if (horizontalScrollBar){
horizontalScrollBar.setScrollProperties(newViewableWidth, 0, (newScrollableWidth - newViewableWidth), horizontalPageScrollSize);
scrollPositionChanged = true;
};
viewableWidth = newViewableWidth;
scrollableWidth = newScrollableWidth;
};
if (((((!((scrollableHeight == newScrollableHeight))) || (!((viewableHeight == newViewableHeight))))) || (changed))){
if (verticalScrollBar){
verticalScrollBar.setScrollProperties(newViewableHeight, 0, (newScrollableHeight - newViewableHeight), verticalPageScrollSize);
scrollPositionChanged = true;
};
viewableHeight = newViewableHeight;
scrollableHeight = newScrollableHeight;
};
return (changed);
}
override mx_internal function removingChild(child:DisplayObject):void{
super.removingChild(child);
child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
var event:ChildExistenceChangedEvent = new ChildExistenceChangedEvent(ChildExistenceChangedEvent.CHILD_REMOVE);
event.relatedObject = child;
dispatchEvent(event);
}
mx_internal function get numChildrenCreated():int{
return (_numChildrenCreated);
}
mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{
if ((((_firstChildIndex < index)) && ((index < ((_firstChildIndex + _numChildren) + 1))))){
_numChildren++;
} else {
if (index <= _firstChildIndex){
_firstChildIndex++;
};
};
super.addingChild(child);
$addChildAt(child, index);
super.childAdded(child);
dispatchEvent(new Event("childrenChanged"));
return (child);
}
private function hasChildMatchingDescriptor(descriptor:UIComponentDescriptor):Boolean{
var i:int;
var child:IUIComponent;
var id:String = descriptor.id;
if (((!((id == null))) && ((document[id] == null)))){
return (false);
};
var n:int = numChildren;
i = 0;
while (i < n) {
child = IUIComponent(getChildAt(i));
if ((((child is IDeferredInstantiationUIComponent)) && ((IDeferredInstantiationUIComponent(child).descriptor == descriptor)))){
return (true);
};
i++;
};
if (childRepeaters){
n = childRepeaters.length;
i = 0;
while (i < n) {
if (IDeferredInstantiationUIComponent(childRepeaters[i]).descriptor == descriptor){
return (true);
};
i++;
};
};
return (false);
}
mx_internal function rawChildren_getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
override public function validateDisplayList():void{
var vm:EdgeMetrics;
var w:Number;
var h:Number;
var bgColor:Object;
var blockerAlpha:Number;
var widthToBlock:Number;
var heightToBlock:Number;
if (((_autoLayout) || (forceLayout))){
doingLayout = true;
super.validateDisplayList();
doingLayout = false;
} else {
layoutChrome(unscaledWidth, unscaledHeight);
};
invalidateDisplayListFlag = true;
if (createContentPaneAndScrollbarsIfNeeded()){
if (((_autoLayout) || (forceLayout))){
doingLayout = true;
super.validateDisplayList();
doingLayout = false;
};
createContentPaneAndScrollbarsIfNeeded();
};
if (clampScrollPositions()){
scrollChildren();
};
if (contentPane){
vm = viewMetrics;
if (overlay){
overlay.x = 0;
overlay.y = 0;
overlay.width = unscaledWidth;
overlay.height = unscaledHeight;
};
if (((horizontalScrollBar) || (verticalScrollBar))){
if (((verticalScrollBar) && ((verticalScrollPolicy == ScrollPolicy.ON)))){
vm.right = (vm.right - verticalScrollBar.minWidth);
};
if (((horizontalScrollBar) && ((horizontalScrollPolicy == ScrollPolicy.ON)))){
vm.bottom = (vm.bottom - horizontalScrollBar.minHeight);
};
if (horizontalScrollBar){
w = ((unscaledWidth - vm.left) - vm.right);
if (verticalScrollBar){
w = (w - verticalScrollBar.minWidth);
};
horizontalScrollBar.setActualSize(w, horizontalScrollBar.minHeight);
horizontalScrollBar.move(vm.left, ((unscaledHeight - vm.bottom) - horizontalScrollBar.minHeight));
};
if (verticalScrollBar){
h = ((unscaledHeight - vm.top) - vm.bottom);
if (horizontalScrollBar){
h = (h - horizontalScrollBar.minHeight);
};
verticalScrollBar.setActualSize(verticalScrollBar.minWidth, h);
verticalScrollBar.move(((unscaledWidth - vm.right) - verticalScrollBar.minWidth), vm.top);
};
if (whiteBox){
whiteBox.x = verticalScrollBar.x;
whiteBox.y = horizontalScrollBar.y;
};
};
contentPane.x = vm.left;
contentPane.y = vm.top;
if (focusPane){
focusPane.x = vm.left;
focusPane.y = vm.top;
};
scrollChildren();
};
invalidateDisplayListFlag = false;
if (blocker){
vm = viewMetrics;
bgColor = (enabled) ? null : getStyle("backgroundDisabledColor");
if ((((bgColor === null)) || (isNaN(Number(bgColor))))){
bgColor = getStyle("backgroundColor");
};
if ((((bgColor === null)) || (isNaN(Number(bgColor))))){
bgColor = 0xFFFFFF;
};
blockerAlpha = getStyle("disabledOverlayAlpha");
if (isNaN(blockerAlpha)){
blockerAlpha = 0.6;
};
blocker.x = vm.left;
blocker.y = vm.top;
widthToBlock = (unscaledWidth - (vm.left + vm.right));
heightToBlock = (unscaledHeight - (vm.top + vm.bottom));
blocker.graphics.clear();
blocker.graphics.beginFill(uint(bgColor), blockerAlpha);
blocker.graphics.drawRect(0, 0, widthToBlock, heightToBlock);
blocker.graphics.endFill();
rawChildren.setChildIndex(blocker, (rawChildren.numChildren - 1));
};
}
public function set horizontalLineScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_horizontalLineScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalLineScrollSizeChanged"));
}
override public function initialize():void{
var props:*;
var message:String;
if (((((isDocument) && (documentDescriptor))) && (!(processedDescriptors)))){
props = documentDescriptor.properties;
if (((props) && (props.childDescriptors))){
if (_childDescriptors){
message = resourceManager.getString("core", "multipleChildSets_ClassAndInstance");
throw (new Error(message));
};
_childDescriptors = props.childDescriptors;
};
};
super.initialize();
}
mx_internal function set forceClipping(value:Boolean):void{
if (_clipContent){
if (value){
_forceClippingCount++;
} else {
_forceClippingCount--;
};
createContentPane();
scrollChildren();
};
}
public function removeAllChildren():void{
while (numChildren > 0) {
removeChildAt(0);
};
}
override public function contentToGlobal(point:Point):Point{
if (contentPane){
return (contentPane.localToGlobal(point));
};
return (localToGlobal(point));
}
public function get horizontalPageScrollSize():Number{
return (_horizontalPageScrollSize);
}
override mx_internal function childRemoved(child:DisplayObject):void{
super.childRemoved(child);
invalidateSize();
invalidateDisplayList();
if (!contentPane){
_numChildren--;
if (_numChildren == 0){
_firstChildIndex = super.numChildren;
};
};
if (((contentPane) && (!(autoLayout)))){
forceLayout = true;
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
};
dispatchEvent(new Event("childrenChanged"));
}
public function set defaultButton(value:IFlexDisplayObject):void{
_defaultButton = value;
ContainerGlobals.focusedContainer = null;
}
public function get data():Object{
return (_data);
}
override public function get numChildren():int{
return ((contentPane) ? contentPane.numChildren : _numChildren);
}
public function get autoLayout():Boolean{
return (_autoLayout);
}
override public function styleChanged(styleProp:String):void{
var horizontalScrollBarStyleName:String;
var verticalScrollBarStyleName:String;
var allStyles:Boolean = (((styleProp == null)) || ((styleProp == "styleName")));
if (((allStyles) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateDisplayList();
};
if (((allStyles) || ((styleProp == "borderSkin")))){
if (border){
rawChildren.removeChild(DisplayObject(border));
border = null;
createBorder();
};
};
if (((((((((((allStyles) || ((styleProp == "borderStyle")))) || ((styleProp == "backgroundColor")))) || ((styleProp == "backgroundImage")))) || ((styleProp == "mouseShield")))) || ((styleProp == "mouseShieldChildren")))){
createBorder();
};
super.styleChanged(styleProp);
if (((allStyles) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateViewMetricsAndPadding();
};
if (((allStyles) || ((styleProp == "horizontalScrollBarStyleName")))){
if (((horizontalScrollBar) && ((horizontalScrollBar is ISimpleStyleClient)))){
horizontalScrollBarStyleName = getStyle("horizontalScrollBarStyleName");
ISimpleStyleClient(horizontalScrollBar).styleName = horizontalScrollBarStyleName;
};
};
if (((allStyles) || ((styleProp == "verticalScrollBarStyleName")))){
if (((verticalScrollBar) && ((verticalScrollBar is ISimpleStyleClient)))){
verticalScrollBarStyleName = getStyle("verticalScrollBarStyleName");
ISimpleStyleClient(verticalScrollBar).styleName = verticalScrollBarStyleName;
};
};
}
override protected function commitProperties():void{
var styleProp:String;
super.commitProperties();
if (changedStyles){
styleProp = ((changedStyles == MULTIPLE_PROPERTIES)) ? null : changedStyles;
super.notifyStyleChangeInChildren(styleProp, true);
changedStyles = null;
};
createOrDestroyBlocker();
}
override public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
if (obj){
contentPane.scrollRect = Rectangle(obj);
};
super.finishPrint(obj, target);
}
public function get maxHorizontalScrollPosition():Number{
return ((horizontalScrollBar) ? horizontalScrollBar.maxScrollPosition : Math.max((scrollableWidth - viewableWidth), 0));
}
public function set creationPolicy(value:String):void{
_creationPolicy = value;
setActualCreationPolicies(value);
}
public function set label(value:String):void{
_label = value;
dispatchEvent(new Event("labelChanged"));
}
private function clampScrollPositions():Boolean{
var changed:Boolean;
if (_horizontalScrollPosition < 0){
_horizontalScrollPosition = 0;
changed = true;
} else {
if (_horizontalScrollPosition > maxHorizontalScrollPosition){
_horizontalScrollPosition = maxHorizontalScrollPosition;
changed = true;
};
};
if (((horizontalScrollBar) && (!((horizontalScrollBar.scrollPosition == _horizontalScrollPosition))))){
horizontalScrollBar.scrollPosition = _horizontalScrollPosition;
};
if (_verticalScrollPosition < 0){
_verticalScrollPosition = 0;
changed = true;
} else {
if (_verticalScrollPosition > maxVerticalScrollPosition){
_verticalScrollPosition = maxVerticalScrollPosition;
changed = true;
};
};
if (((verticalScrollBar) && (!((verticalScrollBar.scrollPosition == _verticalScrollPosition))))){
verticalScrollBar.scrollPosition = _verticalScrollPosition;
};
return (changed);
}
override public function prepareToPrint(target:IFlexDisplayObject):Object{
var rect:Rectangle = (((contentPane) && (contentPane.scrollRect))) ? contentPane.scrollRect : null;
if (rect){
contentPane.scrollRect = null;
};
super.prepareToPrint(target);
return (rect);
}
mx_internal function get firstChildIndex():int{
return (_firstChildIndex);
}
mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject{
if (_numChildren == 0){
_firstChildIndex++;
};
super.addingChild(child);
$addChild(child);
super.childAdded(child);
dispatchEvent(new Event("childrenChanged"));
return (child);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var backgroundColor:Object;
var backgroundAlpha:Number;
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutChrome(unscaledWidth, unscaledHeight);
if (scrollPositionChanged){
clampScrollPositions();
scrollChildren();
scrollPositionChanged = false;
};
if (scrollPropertiesChanged){
if (horizontalScrollBar){
horizontalScrollBar.lineScrollSize = horizontalLineScrollSize;
horizontalScrollBar.pageScrollSize = horizontalPageScrollSize;
};
if (verticalScrollBar){
verticalScrollBar.lineScrollSize = verticalLineScrollSize;
verticalScrollBar.pageScrollSize = verticalPageScrollSize;
};
scrollPropertiesChanged = false;
};
if (((contentPane) && (contentPane.scrollRect))){
backgroundColor = (enabled) ? null : getStyle("backgroundDisabledColor");
if ((((backgroundColor === null)) || (isNaN(Number(backgroundColor))))){
backgroundColor = getStyle("backgroundColor");
};
backgroundAlpha = getStyle("backgroundAlpha");
if (((((((!(_clipContent)) || (isNaN(Number(backgroundColor))))) || ((backgroundColor === "")))) || (((!(((horizontalScrollBar) || (verticalScrollBar)))) && (!(cacheAsBitmap)))))){
backgroundColor = null;
} else {
if (((getStyle("backgroundImage")) || (getStyle("background")))){
backgroundColor = null;
} else {
if (backgroundAlpha != 1){
backgroundColor = null;
};
};
};
contentPane.opaqueBackground = backgroundColor;
contentPane.cacheAsBitmap = !((backgroundColor == null));
};
}
override mx_internal function addingChild(child:DisplayObject):void{
var uiChild:IUIComponent = IUIComponent(child);
super.addingChild(child);
invalidateSize();
invalidateDisplayList();
if (!contentPane){
if (_numChildren == 0){
_firstChildIndex = super.numChildren;
};
_numChildren++;
};
if (((contentPane) && (!(autoLayout)))){
forceLayout = true;
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
};
}
mx_internal function setActualCreationPolicies(policy:String):void{
var child:IFlexDisplayObject;
var childContainer:Container;
actualCreationPolicy = policy;
var childPolicy:String = policy;
if (policy == ContainerCreationPolicy.QUEUED){
childPolicy = ContainerCreationPolicy.AUTO;
};
var n:int = numChildren;
var i:int;
while (i < n) {
child = IFlexDisplayObject(getChildAt(i));
if ((child is Container)){
childContainer = Container(child);
if (childContainer.creationPolicy == null){
childContainer.setActualCreationPolicies(childPolicy);
};
};
i++;
};
}
}
}//package mx.core
Section 125
//ContainerCreationPolicy (mx.core.ContainerCreationPolicy)
package mx.core {
public final class ContainerCreationPolicy {
public static const ALL:String = "all";
public static const QUEUED:String = "queued";
public static const NONE:String = "none";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const AUTO:String = "auto";
public function ContainerCreationPolicy(){
super();
}
}
}//package mx.core
Section 126
//ContainerGlobals (mx.core.ContainerGlobals)
package mx.core {
import flash.display.*;
import mx.managers.*;
public class ContainerGlobals {
public static var focusedContainer:InteractiveObject;
public function ContainerGlobals(){
super();
}
public static function checkFocus(oldObj:InteractiveObject, newObj:InteractiveObject):void{
var fm:IFocusManager;
var defButton:IButton;
var objParent:InteractiveObject = newObj;
var currObj:InteractiveObject = newObj;
var lastUIComp:IUIComponent;
if (((!((newObj == null))) && ((oldObj == newObj)))){
return;
};
while (currObj) {
if (currObj.parent){
objParent = currObj.parent;
} else {
objParent = null;
};
if ((currObj is IUIComponent)){
lastUIComp = IUIComponent(currObj);
};
currObj = objParent;
if (((((currObj) && ((currObj is IContainer)))) && (IContainer(currObj).defaultButton))){
break;
};
};
if (((!((ContainerGlobals.focusedContainer == currObj))) || ((((ContainerGlobals.focusedContainer == null)) && ((currObj == null)))))){
if (!currObj){
currObj = InteractiveObject(lastUIComp);
};
if (((currObj) && ((currObj is IContainer)))){
fm = IContainer(currObj).focusManager;
if (!fm){
return;
};
defButton = (IContainer(currObj).defaultButton as IButton);
if (defButton){
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = (defButton as IButton);
} else {
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = null;
};
};
};
}
}
}//package mx.core
Section 127
//ContainerLayout (mx.core.ContainerLayout)
package mx.core {
public final class ContainerLayout {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
public static const ABSOLUTE:String = "absolute";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ContainerLayout(){
super();
}
}
}//package mx.core
Section 128
//ContainerRawChildrenList (mx.core.ContainerRawChildrenList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public class ContainerRawChildrenList implements IChildList {
private var owner:Container;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ContainerRawChildrenList(owner:Container){
super();
this.owner = owner;
}
public function addChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_addChild(child));
}
public function getChildIndex(child:DisplayObject):int{
return (owner.mx_internal::rawChildren_getChildIndex(child));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, newIndex);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_removeChildAt(index));
}
public function get numChildren():int{
return (owner.mx_internal::$numChildren);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
return (owner.mx_internal::rawChildren_addChildAt(child, index));
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function contains(child:DisplayObject):Boolean{
return (owner.mx_internal::rawChildren_contains(child));
}
public function removeChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_removeChild(child));
}
public function getChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_getChildAt(index));
}
}
}//package mx.core
Section 129
//DragSource (mx.core.DragSource)
package mx.core {
public class DragSource {
private var formatHandlers:Object;
private var dataHolder:Object;
private var _formats:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function DragSource(){
dataHolder = {};
formatHandlers = {};
_formats = [];
super();
}
public function hasFormat(format:String):Boolean{
var n:int = _formats.length;
var i:int;
while (i < n) {
if (_formats[i] == format){
return (true);
};
i++;
};
return (false);
}
public function addData(data:Object, format:String):void{
_formats.push(format);
dataHolder[format] = data;
}
public function dataForFormat(format:String):Object{
var data:Object = dataHolder[format];
if (data){
return (data);
};
if (formatHandlers[format]){
return (formatHandlers[format]());
};
return (null);
}
public function addHandler(handler:Function, format:String):void{
_formats.push(format);
formatHandlers[format] = handler;
}
public function get formats():Array{
return (_formats);
}
}
}//package mx.core
Section 130
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 131
//EmbeddedFont (mx.core.EmbeddedFont)
package mx.core {
public class EmbeddedFont {
private var _fontName:String;
private var _fontStyle:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EmbeddedFont(fontName:String, bold:Boolean, italic:Boolean){
super();
_fontName = fontName;
_fontStyle = EmbeddedFontRegistry.getFontStyle(bold, italic);
}
public function get fontStyle():String{
return (_fontStyle);
}
public function get fontName():String{
return (_fontName);
}
}
}//package mx.core
Section 132
//EmbeddedFontRegistry (mx.core.EmbeddedFontRegistry)
package mx.core {
import flash.text.*;
import flash.utils.*;
public class EmbeddedFontRegistry implements IEmbeddedFontRegistry {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var fonts:Object = {};
private static var instance:IEmbeddedFontRegistry;
public function EmbeddedFontRegistry(){
super();
}
public function getAssociatedModuleFactory(font:EmbeddedFont, defaultModuleFactory:IFlexModuleFactory):IFlexModuleFactory{
var found:int;
var iter:Object;
var fontDictionary:Dictionary = fonts[createFontKey(font)];
if (fontDictionary){
found = fontDictionary[defaultModuleFactory];
if (found){
return (defaultModuleFactory);
};
for (iter in fontDictionary) {
return ((iter as IFlexModuleFactory));
};
};
return (null);
}
public function deregisterFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var count:int;
var obj:Object;
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (fontDictionary != null){
delete fontDictionary[moduleFactory];
count = 0;
for (obj in fontDictionary) {
count++;
};
if (count == 0){
delete fonts[fontKey];
};
};
}
public function getFonts():Array{
var key:String;
var fontArray:Array = [];
for (key in fonts) {
fontArray.push(createEmbeddedFont(key));
};
return (fontArray);
}
public function registerFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (!fontDictionary){
fontDictionary = new Dictionary(true);
fonts[fontKey] = fontDictionary;
};
fontDictionary[moduleFactory] = 1;
}
public static function registerFonts(fonts:Object, moduleFactory:IFlexModuleFactory):void{
var f:Object;
var fontObj:Object;
var fieldIter:String;
var bold:Boolean;
var italic:Boolean;
var fontRegistry:IEmbeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
for (f in fonts) {
fontObj = fonts[f];
for (fieldIter in fontObj) {
if (fontObj[fieldIter] == false){
} else {
if (fieldIter == "regular"){
bold = false;
italic = false;
} else {
if (fieldIter == "boldItalic"){
bold = true;
italic = true;
} else {
if (fieldIter == "bold"){
bold = true;
italic = false;
} else {
if (fieldIter == "italic"){
bold = false;
italic = true;
};
};
};
};
fontRegistry.registerFont(new EmbeddedFont(String(f), bold, italic), moduleFactory);
};
};
};
}
public static function getInstance():IEmbeddedFontRegistry{
if (!instance){
instance = new (EmbeddedFontRegistry);
};
return (instance);
}
public static function getFontStyle(bold:Boolean, italic:Boolean):String{
var style:String = FontStyle.REGULAR;
if (((bold) && (italic))){
style = FontStyle.BOLD_ITALIC;
} else {
if (bold){
style = FontStyle.BOLD;
} else {
if (italic){
style = FontStyle.ITALIC;
};
};
};
return (style);
}
private static function createFontKey(font:EmbeddedFont):String{
return ((font.fontName + font.fontStyle));
}
private static function createEmbeddedFont(key:String):EmbeddedFont{
var fontName:String;
var fontBold:Boolean;
var fontItalic:Boolean;
var index:int = endsWith(key, FontStyle.REGULAR);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, false));
};
index = endsWith(key, FontStyle.BOLD);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, false));
};
index = endsWith(key, FontStyle.BOLD_ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, true));
};
index = endsWith(key, FontStyle.ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, true));
};
return (new EmbeddedFont("", false, false));
}
private static function endsWith(s:String, match:String):int{
var index:int = s.lastIndexOf(match);
if ((((index > 0)) && (((index + match.length) == s.length)))){
return (index);
};
return (-1);
}
}
}//package mx.core
Section 133
//EventPriority (mx.core.EventPriority)
package mx.core {
public final class EventPriority {
public static const DEFAULT:int = 0;
public static const BINDING:int = 100;
public static const DEFAULT_HANDLER:int = -50;
public static const EFFECT:int = -100;
public static const CURSOR_MANAGEMENT:int = 200;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EventPriority(){
super();
}
}
}//package mx.core
Section 134
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexLoader(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 135
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexShape(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 136
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexSprite(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 137
//FlexTextField (mx.core.FlexTextField)
package mx.core {
import flash.text.*;
import mx.utils.*;
public class FlexTextField extends TextField {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexTextField(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 138
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.2.0.3958";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
public function FlexVersion(){
super();
}
mx_internal static function changeCompatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
_compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function set compatibilityVersion(value:uint):void{
var s:String;
if (value == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_READ);
};
_compatibilityVersion = value;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(value:Function):void{
_compatibilityErrorFunction = value;
}
public static function set compatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var major:uint = ((compatibilityVersion >> 24) & 0xFF);
var minor:uint = ((compatibilityVersion >> 16) & 0xFF);
var update:uint = (compatibilityVersion & 0xFFFF);
return (((((major.toString() + ".") + minor.toString()) + ".") + update.toString()));
}
}
}//package mx.core
Section 139
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 140
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 141
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function getChildByName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject;
function removeChildAt(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function getChildIndex(:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(child:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function addChild(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function contains(flash.display:DisplayObject):Boolean;
}
}//package mx.core
Section 142
//IConstraintClient (mx.core.IConstraintClient)
package mx.core {
public interface IConstraintClient {
function setConstraintValue(_arg1:String, _arg2):void;
function getConstraintValue(*:String);
}
}//package mx.core
Section 143
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import mx.managers.*;
public interface IContainer extends IUIComponent {
function set hitArea(mx.core:IContainer/mx.core:IContainer:graphics/get:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(Graphics:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set creatingContentPane(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(value:DisplayObject):int;
function set doubleClickEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getObjectsUnderPoint(lockCenter:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get numChildren():int;
function contains(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(mx.core:IContainer/mx.core:IContainer:graphics/get:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getChildAt(Graphics:int):DisplayObject;
function set soundTransform(mx.core:IContainer/mx.core:IContainer:graphics/get:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(mx.core:IContainer/mx.core:IContainer:graphics/get:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(Graphics:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set buttonMode(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(Graphics:DisplayObject):DisplayObject;
function set tabIndex(mx.core:IContainer/mx.core:IContainer:graphics/get:int):void;
function addChild(Graphics:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean;
}
}//package mx.core
Section 144
//IDataRenderer (mx.core.IDataRenderer)
package mx.core {
public interface IDataRenderer {
function get data():Object;
function set data(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IDataRenderer.as:Object):void;
}
}//package mx.core
Section 145
//IDeferredInstantiationUIComponent (mx.core.IDeferredInstantiationUIComponent)
package mx.core {
public interface IDeferredInstantiationUIComponent extends IUIComponent {
function set cacheHeuristic(:Boolean):void;
function createReferenceOnParentDocument(:IFlexDisplayObject):void;
function get cachePolicy():String;
function set id(:String):void;
function registerEffects(:Array):void;
function executeBindings(:Boolean=false):void;
function get id():String;
function deleteReferenceOnParentDocument(:IFlexDisplayObject):void;
function set descriptor(:UIComponentDescriptor):void;
function get descriptor():UIComponentDescriptor;
}
}//package mx.core
Section 146
//IEmbeddedFontRegistry (mx.core.IEmbeddedFontRegistry)
package mx.core {
public interface IEmbeddedFontRegistry {
function getAssociatedModuleFactory(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):IFlexModuleFactory;
function registerFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function deregisterFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function getFonts():Array;
}
}//package mx.core
Section 147
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 148
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 149
//IFlexModule (mx.core.IFlexModule)
package mx.core {
public interface IFlexModule {
function set moduleFactory(:IFlexModuleFactory):void;
function get moduleFactory():IFlexModuleFactory;
}
}//package mx.core
Section 150
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 151
//IFontContextComponent (mx.core.IFontContextComponent)
package mx.core {
public interface IFontContextComponent {
function get fontContext():IFlexModuleFactory;
function set fontContext(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IFontContextComponent.as:IFlexModuleFactory):void;
}
}//package mx.core
Section 152
//IIMESupport (mx.core.IIMESupport)
package mx.core {
public interface IIMESupport {
function set imeMode(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IIMESupport.as:String):void;
function get imeMode():String;
}
}//package mx.core
Section 153
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 154
//IMXMLObject (mx.core.IMXMLObject)
package mx.core {
public interface IMXMLObject {
function initialized(_arg1:Object, _arg2:String):void;
}
}//package mx.core
Section 155
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 156
//IPropertyChangeNotifier (mx.core.IPropertyChangeNotifier)
package mx.core {
import flash.events.*;
public interface IPropertyChangeNotifier extends IEventDispatcher, IUID {
}
}//package mx.core
Section 157
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 158
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 159
//IRepeater (mx.core.IRepeater)
package mx.core {
public interface IRepeater {
function get container():IContainer;
function set startingIndex(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
function get startingIndex():int;
function set recycleChildren(mx.core:IRepeater/mx.core:IRepeater:container/get:Boolean):void;
function get currentItem():Object;
function get count():int;
function get recycleChildren():Boolean;
function executeChildBindings():void;
function set dataProvider(mx.core:IRepeater/mx.core:IRepeater:container/get:Object):void;
function initializeRepeater(_arg1:IContainer, _arg2:Boolean):void;
function get currentIndex():int;
function get dataProvider():Object;
function set count(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
}
}//package mx.core
Section 160
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 161
//IStateClient (mx.core.IStateClient)
package mx.core {
public interface IStateClient {
function get currentState():String;
function set currentState(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void;
}
}//package mx.core
Section 162
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup)
package mx.core {
import flash.events.*;
public interface ISWFBridgeGroup {
function getChildBridgeProvider(mx.core:ISWFBridgeGroup/mx.core:ISWFBridgeGroup:parentBridge/get:IEventDispatcher):ISWFBridgeProvider;
function removeChildBridge(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function get parentBridge():IEventDispatcher;
function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void;
function set parentBridge(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function containsBridge(IEventDispatcher:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 163
//ISWFBridgeProvider (mx.core.ISWFBridgeProvider)
package mx.core {
import flash.events.*;
public interface ISWFBridgeProvider {
function get childAllowsParent():Boolean;
function get swfBridge():IEventDispatcher;
function get parentAllowsChild():Boolean;
}
}//package mx.core
Section 164
//ISWFLoader (mx.core.ISWFLoader)
package mx.core {
import flash.geom.*;
public interface ISWFLoader extends ISWFBridgeProvider {
function getVisibleApplicationRect(mx.core:ISWFLoader/mx.core:ISWFLoader:loadForCompatibility/get:Boolean=false):Rectangle;
function set loadForCompatibility(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISWFLoader.as:Boolean):void;
function get loadForCompatibility():Boolean;
}
}//package mx.core
Section 165
//ITextFieldFactory (mx.core.ITextFieldFactory)
package mx.core {
import flash.text.*;
public interface ITextFieldFactory {
function createTextField(:IFlexModuleFactory):TextField;
}
}//package mx.core
Section 166
//IToolTip (mx.core.IToolTip)
package mx.core {
import flash.geom.*;
public interface IToolTip extends IUIComponent {
function set text(mx.core:IToolTip/mx.core:IToolTip:screen/get:String):void;
function get screen():Rectangle;
function get text():String;
}
}//package mx.core
Section 167
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Sprite):void;
function get enabled():Boolean;
function set enabled(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function set isPopUp(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(Number:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get minHeight():Number;
function set percentWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Array):void;
function set explicitWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set measuredMinHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function set includeInLayout(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set explicitHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:ISystemManager):void;
function set document(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 168
//IUID (mx.core.IUID)
package mx.core {
public interface IUID {
function get uid():String;
function set uid(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IUID.as:String):void;
}
}//package mx.core
Section 169
//IUITextField (mx.core.IUITextField)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.managers.*;
import mx.styles.*;
public interface IUITextField extends IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUIComponent {
function replaceText(_arg1:int, _arg2:int, _arg3:String):void;
function get doubleClickEnabled():Boolean;
function get nestLevel():int;
function get caretIndex():int;
function set doubleClickEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxScrollH():int;
function set nestLevel(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get numLines():int;
function get scrollH():int;
function setColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get maxScrollV():int;
function getImageReference(mx.core:IUITextField/mx.core:IUITextField:antiAliasType/set:String):DisplayObject;
function get scrollV():int;
function get border():Boolean;
function get text():String;
function get styleSheet():StyleSheet;
function getCharBoundaries(String:int):Rectangle;
function get background():Boolean;
function set scrollH(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function getFirstCharInParagraph(value:int):int;
function get type():String;
function replaceSelectedText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set borderColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get alwaysShowSelection():Boolean;
function get sharpness():Number;
function get tabIndex():int;
function get textColor():uint;
function set defaultTextFormat(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:TextFormat):void;
function get condenseWhite():Boolean;
function get displayAsPassword():Boolean;
function get autoSize():String;
function setSelection(_arg1:int, _arg2:int):void;
function set scrollV(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function set useRichTextClipboard(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get selectionBeginIndex():int;
function get selectable():Boolean;
function set border(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set multiline(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set background(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set embedFonts(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set text(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get selectionEndIndex():int;
function set mouseWheelEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function appendText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get antiAliasType():String;
function set styleSheet(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:StyleSheet):void;
function set nonInheritingStyles(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function set textColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get wordWrap():Boolean;
function getLineIndexAtPoint(_arg1:Number, _arg2:Number):int;
function get htmlText():String;
function set tabIndex(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get thickness():Number;
function getLineIndexOfChar(value:int):int;
function get bottomScrollV():int;
function set restrict(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set alwaysShowSelection(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function getTextFormat(_arg1:int=-1, _arg2:int=-1):TextFormat;
function set sharpness(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function set type(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function setTextFormat(_arg1:TextFormat, _arg2:int=-1, _arg3:int=-1):void;
function set gridFitType(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getUITextFormat():UITextFormat;
function set inheritingStyles(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function setFocus():void;
function get borderColor():uint;
function set condenseWhite(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get textWidth():Number;
function getLineOffset(value:int):int;
function set displayAsPassword(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set autoSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get defaultTextFormat():TextFormat;
function get useRichTextClipboard():Boolean;
function get nonZeroTextHeight():Number;
function set backgroundColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get embedFonts():Boolean;
function set selectable(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get multiline():Boolean;
function set maxChars(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get textHeight():Number;
function get nonInheritingStyles():Object;
function getLineText(mx.core:IUITextField/mx.core:IUITextField:alwaysShowSelection/get:int):String;
function set focusRect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function get mouseWheelEnabled():Boolean;
function get restrict():String;
function getParagraphLength(value:int):int;
function set mouseEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get gridFitType():String;
function get inheritingStyles():Object;
function set ignorePadding(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set antiAliasType(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get backgroundColor():uint;
function getCharIndexAtPoint(_arg1:Number, _arg2:Number):int;
function set tabEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxChars():int;
function get focusRect():Object;
function get ignorePadding():Boolean;
function get mouseEnabled():Boolean;
function get length():int;
function set wordWrap(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get tabEnabled():Boolean;
function set thickness(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function getLineLength(value:int):int;
function truncateToFit(:String=null):Boolean;
function set htmlText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getLineMetrics(antiAliasType:int):TextLineMetrics;
function getStyle(*:String);
}
}//package mx.core
Section 170
//LayoutContainer (mx.core.LayoutContainer)
package mx.core {
import flash.events.*;
import mx.containers.utilityClasses.*;
import mx.containers.*;
public class LayoutContainer extends Container implements IConstraintLayout {
private var _constraintColumns:Array;
protected var layoutObject:Layout;
private var _layout:String;// = "vertical"
private var processingCreationQueue:Boolean;// = false
protected var boxLayoutClass:Class;
private var resizeHandlerAdded:Boolean;// = false
private var preloadObj:Object;
private var creationQueue:Array;
private var _constraintRows:Array;
protected var canvasLayoutClass:Class;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var useProgressiveLayout:Boolean = false;
public function LayoutContainer(){
layoutObject = new BoxLayout();
canvasLayoutClass = CanvasLayout;
boxLayoutClass = BoxLayout;
creationQueue = [];
_constraintColumns = [];
_constraintRows = [];
super();
layoutObject.target = this;
}
public function get constraintColumns():Array{
return (_constraintColumns);
}
override mx_internal function get usePadding():Boolean{
return (!((layout == ContainerLayout.ABSOLUTE)));
}
override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
super.layoutChrome(unscaledWidth, unscaledHeight);
if (!doingLayout){
createBorder();
};
}
public function set constraintColumns(value:Array):void{
var n:int;
var i:int;
if (value != _constraintColumns){
n = value.length;
i = 0;
while (i < n) {
ConstraintColumn(value[i]).container = this;
i++;
};
_constraintColumns = value;
invalidateSize();
invalidateDisplayList();
};
}
public function set layout(value:String):void{
if (_layout != value){
_layout = value;
if (layoutObject){
layoutObject.target = null;
};
if (_layout == ContainerLayout.ABSOLUTE){
layoutObject = new canvasLayoutClass();
} else {
layoutObject = new boxLayoutClass();
if (_layout == ContainerLayout.VERTICAL){
BoxLayout(layoutObject).direction = BoxDirection.VERTICAL;
} else {
BoxLayout(layoutObject).direction = BoxDirection.HORIZONTAL;
};
};
if (layoutObject){
layoutObject.target = this;
};
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("layoutChanged"));
};
}
public function get constraintRows():Array{
return (_constraintRows);
}
override protected function measure():void{
super.measure();
layoutObject.measure();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
createBorder();
}
public function get layout():String{
return (_layout);
}
public function set constraintRows(value:Array):void{
var n:int;
var i:int;
if (value != _constraintRows){
n = value.length;
i = 0;
while (i < n) {
ConstraintRow(value[i]).container = this;
i++;
};
_constraintRows = value;
invalidateSize();
invalidateDisplayList();
};
}
}
}//package mx.core
Section 171
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 172
//ResourceModuleRSLItem (mx.core.ResourceModuleRSLItem)
package mx.core {
import flash.events.*;
import mx.events.*;
import mx.resources.*;
public class ResourceModuleRSLItem extends RSLItem {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ResourceModuleRSLItem(url:String){
super(url);
}
private function resourceErrorHandler(event:ResourceEvent):void{
var errorEvent:IOErrorEvent = new IOErrorEvent(IOErrorEvent.IO_ERROR);
errorEvent.text = event.errorText;
super.itemErrorHandler(errorEvent);
}
override public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var resourceManager:IResourceManager = ResourceManager.getInstance();
var eventDispatcher:IEventDispatcher = resourceManager.loadResourceModule(url);
eventDispatcher.addEventListener(ResourceEvent.PROGRESS, itemProgressHandler);
eventDispatcher.addEventListener(ResourceEvent.COMPLETE, itemCompleteHandler);
eventDispatcher.addEventListener(ResourceEvent.ERROR, resourceErrorHandler);
}
}
}//package mx.core
Section 173
//RSLItem (mx.core.RSLItem)
package mx.core {
import flash.display.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import flash.net.*;
import mx.utils.*;
public class RSLItem {
protected var chainedSecurityErrorHandler:Function;
public var total:uint;// = 0
public var loaded:uint;// = 0
private var completed:Boolean;// = false
protected var chainedRSLErrorHandler:Function;
protected var chainedIOErrorHandler:Function;
protected var chainedCompleteHandler:Function;
private var errorText:String;
protected var chainedProgressHandler:Function;
public var urlRequest:URLRequest;
public var rootURL:String;
protected var url:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RSLItem(url:String, rootURL:String=null){
super();
this.url = url;
this.rootURL = rootURL;
}
public function itemProgressHandler(event:ProgressEvent):void{
loaded = event.bytesLoaded;
total = event.bytesTotal;
if (chainedProgressHandler != null){
chainedProgressHandler(event);
};
}
public function itemErrorHandler(event:ErrorEvent):void{
errorText = decodeURI(event.text);
completed = true;
loaded = 0;
total = 0;
trace(errorText);
if ((((event.type == IOErrorEvent.IO_ERROR)) && (!((chainedIOErrorHandler == null))))){
chainedIOErrorHandler(event);
} else {
if ((((event.type == SecurityErrorEvent.SECURITY_ERROR)) && (!((chainedSecurityErrorHandler == null))))){
chainedSecurityErrorHandler(event);
} else {
if ((((event.type == RSLEvent.RSL_ERROR)) && (!((chainedRSLErrorHandler == null))))){
chainedRSLErrorHandler(event);
};
};
};
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var loader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext();
urlRequest = new URLRequest(LoaderUtil.createAbsoluteURL(rootURL, url));
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, itemProgressHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, itemCompleteHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, itemErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, itemErrorHandler);
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loader.load(urlRequest, loaderContext);
}
public function itemCompleteHandler(event:Event):void{
completed = true;
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
}
}
}//package mx.core
Section 174
//RSLListLoader (mx.core.RSLListLoader)
package mx.core {
import flash.events.*;
public class RSLListLoader {
private var chainedSecurityErrorHandler:Function;
private var chainedIOErrorHandler:Function;
private var rslList:Array;
private var chainedRSLErrorHandler:Function;
private var chainedCompleteHandler:Function;
private var currentIndex:int;// = 0
private var chainedProgressHandler:Function;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RSLListLoader(rslList:Array){
rslList = [];
super();
this.rslList = rslList;
}
private function loadNext():void{
if (!isDone()){
currentIndex++;
if (currentIndex < rslList.length){
rslList[currentIndex].load(chainedProgressHandler, listCompleteHandler, listIOErrorHandler, listSecurityErrorHandler, chainedRSLErrorHandler);
};
};
}
public function getIndex():int{
return (currentIndex);
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
currentIndex = -1;
loadNext();
}
private function listCompleteHandler(event:Event):void{
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
loadNext();
}
public function isDone():Boolean{
return ((currentIndex >= rslList.length));
}
private function listSecurityErrorHandler(event:Event):void{
if (chainedSecurityErrorHandler != null){
chainedSecurityErrorHandler(event);
};
}
public function getItemCount():int{
return (rslList.length);
}
public function getItem(index:int):RSLItem{
if ((((index < 0)) || ((index >= rslList.length)))){
return (null);
};
return (rslList[index]);
}
private function listIOErrorHandler(event:Event):void{
if (chainedIOErrorHandler != null){
chainedIOErrorHandler(event);
};
}
}
}//package mx.core
Section 175
//ScrollPolicy (mx.core.ScrollPolicy)
package mx.core {
public final class ScrollPolicy {
public static const AUTO:String = "auto";
public static const ON:String = "on";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OFF:String = "off";
public function ScrollPolicy(){
super();
}
}
}//package mx.core
Section 176
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var classMap:Object = {};
public function Singleton(){
super();
}
public static function registerClass(interfaceName:String, clazz:Class):void{
var c:Class = classMap[interfaceName];
if (!c){
classMap[interfaceName] = clazz;
};
}
public static function getClass(interfaceName:String):Class{
return (classMap[interfaceName]);
}
public static function getInstance(interfaceName:String):Object{
var c:Class = classMap[interfaceName];
if (!c){
throw (new Error((("No class registered for interface '" + interfaceName) + "'.")));
};
return (c["getInstance"]());
}
}
}//package mx.core
Section 177
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SpriteAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 178
//SWFBridgeGroup (mx.core.SWFBridgeGroup)
package mx.core {
import mx.managers.*;
import flash.events.*;
import flash.utils.*;
public class SWFBridgeGroup implements ISWFBridgeGroup {
private var _parentBridge:IEventDispatcher;
private var _childBridges:Dictionary;
private var _groupOwner:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SWFBridgeGroup(owner:ISystemManager){
super();
_groupOwner = owner;
}
public function getChildBridgeProvider(bridge:IEventDispatcher):ISWFBridgeProvider{
if (!_childBridges){
return (null);
};
return (ISWFBridgeProvider(_childBridges[bridge]));
}
public function removeChildBridge(bridge:IEventDispatcher):void{
var iter:Object;
if (((!(_childBridges)) || (!(bridge)))){
return;
};
for (iter in _childBridges) {
if (iter == bridge){
delete _childBridges[iter];
};
};
}
public function get parentBridge():IEventDispatcher{
return (_parentBridge);
}
public function containsBridge(bridge:IEventDispatcher):Boolean{
var iter:Object;
if (((parentBridge) && ((parentBridge == bridge)))){
return (true);
};
for (iter in _childBridges) {
if (bridge == iter){
return (true);
};
};
return (false);
}
public function set parentBridge(bridge:IEventDispatcher):void{
_parentBridge = bridge;
}
public function addChildBridge(bridge:IEventDispatcher, bridgeProvider:ISWFBridgeProvider):void{
if (!_childBridges){
_childBridges = new Dictionary();
};
_childBridges[bridge] = bridgeProvider;
}
public function getChildBridges():Array{
var iter:Object;
var bridges:Array = [];
for (iter in _childBridges) {
bridges.push(iter);
};
return (bridges);
}
}
}//package mx.core
Section 179
//TextFieldFactory (mx.core.TextFieldFactory)
package mx.core {
import flash.text.*;
import flash.utils.*;
public class TextFieldFactory implements ITextFieldFactory {
private var textFields:Dictionary;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:ITextFieldFactory;
public function TextFieldFactory(){
textFields = new Dictionary(true);
super();
}
public function createTextField(moduleFactory:IFlexModuleFactory):TextField{
var iter:Object;
var textField:TextField;
var textFieldDictionary:Dictionary = textFields[moduleFactory];
if (textFieldDictionary){
for (iter in textFieldDictionary) {
textField = TextField(iter);
break;
};
};
if (!textField){
if (moduleFactory){
textField = TextField(moduleFactory.create("flash.text.TextField"));
} else {
textField = new TextField();
};
if (!textFieldDictionary){
textFieldDictionary = new Dictionary(true);
};
textFieldDictionary[textField] = 1;
textFields[moduleFactory] = textFieldDictionary;
};
return (textField);
}
public static function getInstance():ITextFieldFactory{
if (!instance){
instance = new (TextFieldFactory);
};
return (instance);
}
}
}//package mx.core
Section 180
//UIComponent (mx.core.UIComponent)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.managers.*;
import mx.automation.*;
import flash.events.*;
import mx.events.*;
import mx.resources.*;
import mx.styles.*;
import mx.controls.*;
import mx.states.*;
import mx.effects.*;
import mx.graphics.*;
import mx.binding.*;
import mx.validators.*;
import mx.utils.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
public class UIComponent extends FlexSprite implements IAutomationObject, IChildList, IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule, IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier, IRepeaterClient, ISimpleStyleClient, IStyleClient, IToolTipManagerClient, IUIComponent, IValidatorListener, IStateClient, IConstraintClient {
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var errorStringChanged:Boolean;// = false
mx_internal var overlay:UIComponent;
mx_internal var automaticRadioButtonGroups:Object;
private var _currentState:String;
private var _isPopUp:Boolean;
private var _repeaters:Array;
private var _systemManager:ISystemManager;
private var _measuredWidth:Number;// = 0
private var methodQueue:Array;
mx_internal var _width:Number;
private var _tweeningProperties:Array;
private var _validationSubField:String;
private var _endingEffectInstances:Array;
mx_internal var saveBorderColor:Boolean;// = true
mx_internal var overlayColor:uint;
mx_internal var overlayReferenceCount:int;// = 0
private var hasFontContextBeenSaved:Boolean;// = false
private var _repeaterIndices:Array;
private var oldExplicitWidth:Number;
mx_internal var _descriptor:UIComponentDescriptor;
private var _initialized:Boolean;// = false
private var _focusEnabled:Boolean;// = true
private var cacheAsBitmapCount:int;// = 0
private var requestedCurrentState:String;
private var listeningForRender:Boolean;// = false
mx_internal var invalidateDisplayListFlag:Boolean;// = false
private var oldScaleX:Number;// = 1
private var oldScaleY:Number;// = 1
mx_internal var _explicitMaxHeight:Number;
mx_internal var invalidatePropertiesFlag:Boolean;// = false
private var hasFocusRect:Boolean;// = false
mx_internal var invalidateSizeFlag:Boolean;// = false
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _styleDeclaration:CSSStyleDeclaration;
private var _resourceManager:IResourceManager;
mx_internal var _affectedProperties:Object;
mx_internal var _documentDescriptor:UIComponentDescriptor;
private var _processedDescriptors:Boolean;// = false
mx_internal var origBorderColor:Number;
private var _focusManager:IFocusManager;
private var _cachePolicy:String;// = "auto"
private var _measuredHeight:Number;// = 0
private var _id:String;
private var _owner:DisplayObjectContainer;
public var transitions:Array;
mx_internal var _parent:DisplayObjectContainer;
private var _measuredMinWidth:Number;// = 0
private var oldMinWidth:Number;
private var _explicitWidth:Number;
private var _enabled:Boolean;// = false
public var states:Array;
private var _mouseFocusEnabled:Boolean;// = true
private var oldHeight:Number;// = 0
private var _currentStateChanged:Boolean;
private var cachedTextFormat:UITextFormat;
mx_internal var _height:Number;
private var _automationDelegate:IAutomationObject;
private var _percentWidth:Number;
private var _automationName:String;// = null
private var _isEffectStarted:Boolean;// = false
private var _styleName:Object;
private var lastUnscaledWidth:Number;
mx_internal var _document:Object;
mx_internal var _errorString:String;// = ""
private var oldExplicitHeight:Number;
private var _nestLevel:int;// = 0
private var _systemManagerDirty:Boolean;// = false
private var _explicitHeight:Number;
mx_internal var _toolTip:String;
private var _filters:Array;
private var _focusPane:Sprite;
private var playStateTransition:Boolean;// = true
private var _nonInheritingStyles:Object;
private var _showInAutomationHierarchy:Boolean;// = true
private var _moduleFactory:IFlexModuleFactory;
private var preventDrawFocus:Boolean;// = false
private var oldX:Number;// = 0
private var oldY:Number;// = 0
private var _instanceIndices:Array;
private var _visible:Boolean;// = true
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
mx_internal var _effectsStarted:Array;
mx_internal var _explicitMinWidth:Number;
private var lastUnscaledHeight:Number;
mx_internal var _explicitMaxWidth:Number;
private var _measuredMinHeight:Number;// = 0
private var _uid:String;
private var _currentTransitionEffect:IEffect;
private var _updateCompletePendingFlag:Boolean;// = false
private var oldMinHeight:Number;
private var _flexContextMenu:IFlexContextMenu;
mx_internal var _explicitMinHeight:Number;
private var _percentHeight:Number;
private var oldEmbeddedFontContext:IFlexModuleFactory;// = null
private var oldWidth:Number;// = 0
public static const DEFAULT_MEASURED_WIDTH:Number = 160;
public static const DEFAULT_MAX_WIDTH:Number = 10000;
public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22;
public static const DEFAULT_MAX_HEIGHT:Number = 10000;
public static const DEFAULT_MEASURED_HEIGHT:Number = 22;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40;
mx_internal static var dispatchEventHook:Function;
private static var fakeMouseY:QName = new QName(mx_internal, "_mouseY");
mx_internal static var createAccessibilityImplementation:Function;
mx_internal static var STYLE_UNINITIALIZED:Object = {};
private static var fakeMouseX:QName = new QName(mx_internal, "_mouseX");
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
public function UIComponent(){
methodQueue = [];
_resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
states = [];
transitions = [];
_effectsStarted = [];
_affectedProperties = {};
_endingEffectInstances = [];
super();
focusRect = false;
tabEnabled = (this is IFocusManagerComponent);
tabChildren = false;
enabled = true;
$visible = false;
addEventListener(Event.ADDED, addedHandler);
addEventListener(Event.REMOVED, removedHandler);
if ((this is IFocusManagerComponent)){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
resourcesChanged();
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
_width = super.width;
_height = super.height;
}
override public function get filters():Array{
return ((_filters) ? _filters : super.filters);
}
public function get toolTip():String{
return (_toolTip);
}
private function transition_effectEndHandler(event:EffectEvent):void{
_currentTransitionEffect = null;
}
public function get nestLevel():int{
return (_nestLevel);
}
protected function adjustFocusRect(obj:DisplayObject=null):void{
var rectCol:Number;
var thickness:Number;
var pt:Point;
var rotRad:Number;
if (!obj){
obj = this;
};
if (((isNaN(obj.width)) || (isNaN(obj.height)))){
return;
};
var fm:IFocusManager = focusManager;
if (!fm){
return;
};
var focusObj:IFlexDisplayObject = IFlexDisplayObject(getFocusObject());
if (focusObj){
if (((errorString) && (!((errorString == ""))))){
rectCol = getStyle("errorColor");
} else {
rectCol = getStyle("themeColor");
};
thickness = getStyle("focusThickness");
if ((focusObj is IStyleClient)){
IStyleClient(focusObj).setStyle("focusColor", rectCol);
};
focusObj.setActualSize((obj.width + (2 * thickness)), (obj.height + (2 * thickness)));
if (rotation){
rotRad = ((rotation * Math.PI) / 180);
pt = new Point((obj.x - (thickness * (Math.cos(rotRad) - Math.sin(rotRad)))), (obj.y - (thickness * (Math.cos(rotRad) + Math.sin(rotRad)))));
DisplayObject(focusObj).rotation = rotation;
} else {
pt = new Point((obj.x - thickness), (obj.y - thickness));
};
if (obj.parent == this){
pt.x = (pt.x + x);
pt.y = (pt.y + y);
};
pt = parent.localToGlobal(pt);
pt = parent.globalToLocal(pt);
focusObj.move(pt.x, pt.y);
if ((focusObj is IInvalidating)){
IInvalidating(focusObj).validateNow();
} else {
if ((focusObj is IProgrammaticSkin)){
IProgrammaticSkin(focusObj).validateNow();
};
};
};
}
mx_internal function setUnscaledWidth(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleX));
if (_explicitWidth == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentWidth = NaN;
};
_explicitWidth = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
private function isOnDisplayList():Boolean{
var p:DisplayObjectContainer;
p = (_parent) ? _parent : super.parent;
//unresolved jump
var _slot1 = e;
return (true);
return ((p) ? true : false);
}
public function set nestLevel(value:int):void{
var childList:IChildList;
var n:int;
var i:int;
var ui:ILayoutManagerClient;
var textField:IUITextField;
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
updateCallbacks();
childList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
n = childList.numChildren;
i = 0;
while (i < n) {
ui = (childList.getChildAt(i) as ILayoutManagerClient);
if (ui){
ui.nestLevel = (value + 1);
} else {
textField = (childList.getChildAt(i) as IUITextField);
if (textField){
textField.nestLevel = (value + 1);
};
};
i++;
};
};
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function callLaterDispatcher(event:Event):void{
var callLaterErrorEvent:DynamicEvent;
var event = event;
UIComponentGlobals.callLaterDispatcherCount++;
if (!UIComponentGlobals.catchCallLaterExceptions){
callLaterDispatcher2(event);
} else {
callLaterDispatcher2(event);
//unresolved jump
var _slot1 = e;
callLaterErrorEvent = new DynamicEvent("callLaterError");
callLaterErrorEvent.error = _slot1;
systemManager.dispatchEvent(callLaterErrorEvent);
};
UIComponentGlobals.callLaterDispatcherCount--;
}
public function getStyle(styleProp:String){
return ((StyleManager.inheritingStyles[styleProp]) ? _inheritingStyles[styleProp] : _nonInheritingStyles[styleProp]);
}
final mx_internal function get $width():Number{
return (super.width);
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, (Math.PI / 2), x, y);
return (UIComponentGlobals.tempMatrix);
}
public function setCurrentState(stateName:String, playTransition:Boolean=true):void{
if (((!((stateName == currentState))) && (!(((isBaseState(stateName)) && (isBaseState(currentState))))))){
requestedCurrentState = stateName;
playStateTransition = playTransition;
if (initialized){
commitCurrentState();
} else {
_currentStateChanged = true;
addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
}
private function getBaseStates(state:State):Array{
var baseStates:Array = [];
while (((state) && (state.basedOn))) {
baseStates.push(state.basedOn);
state = getState(state.basedOn);
};
return (baseStates);
}
public function set minHeight(value:Number):void{
if (explicitMinHeight == value){
return;
};
explicitMinHeight = value;
}
protected function isOurFocus(target:DisplayObject):Boolean{
return ((target == this));
}
public function get errorString():String{
return (_errorString);
}
mx_internal function setUnscaledHeight(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleY));
if (_explicitHeight == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentHeight = NaN;
};
_explicitHeight = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
final mx_internal function set $width(value:Number):void{
super.width = value;
}
public function getVisibleRect(targetParent:DisplayObject=null):Rectangle{
if (!targetParent){
targetParent = DisplayObject(systemManager);
};
var pt:Point = new Point(x, y);
var thisParent:DisplayObject = ($parent) ? $parent : parent;
pt = thisParent.localToGlobal(pt);
var bounds:Rectangle = new Rectangle(pt.x, pt.y, width, height);
var current:DisplayObject = this;
var currentRect:Rectangle = new Rectangle();
do {
if ((current is UIComponent)){
if (UIComponent(current).$parent){
current = UIComponent(current).$parent;
} else {
current = UIComponent(current).parent;
};
} else {
current = current.parent;
};
if (((current) && (current.scrollRect))){
currentRect = current.scrollRect.clone();
pt = current.localToGlobal(currentRect.topLeft);
currentRect.x = pt.x;
currentRect.y = pt.y;
bounds = bounds.intersection(currentRect);
};
} while (((current) && (!((current == targetParent)))));
return (bounds);
}
public function invalidateDisplayList():void{
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (((isOnDisplayList()) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
};
}
mx_internal function initThemeColor():Boolean{
var tc:Object;
var rc:Number;
var sc:Number;
var classSelector:Object;
var typeSelectors:Array;
var i:int;
var typeSelector:CSSStyleDeclaration;
var styleName:Object = _styleName;
if (_styleDeclaration){
tc = _styleDeclaration.getStyle("themeColor");
rc = _styleDeclaration.getStyle("rollOverColor");
sc = _styleDeclaration.getStyle("selectionColor");
};
if ((((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))) && (((styleName) && (!((styleName is ISimpleStyleClient))))))){
classSelector = ((styleName is String)) ? StyleManager.getStyleDeclaration(("." + styleName)) : styleName;
if (classSelector){
tc = classSelector.getStyle("themeColor");
rc = classSelector.getStyle("rollOverColor");
sc = classSelector.getStyle("selectionColor");
};
};
if ((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))){
typeSelectors = getClassStyleDeclarations();
i = 0;
while (i < typeSelectors.length) {
typeSelector = typeSelectors[i];
if (typeSelector){
tc = typeSelector.getStyle("themeColor");
rc = typeSelector.getStyle("rollOverColor");
sc = typeSelector.getStyle("selectionColor");
};
if (((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))){
break;
};
i++;
};
};
if (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (isNaN(rc)))) && (isNaN(sc)))){
setThemeColor(tc);
return (true);
};
return (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (!(isNaN(rc))))) && (!(isNaN(sc)))));
}
override public function get scaleX():Number{
return (_scaleX);
}
public function get uid():String{
if (!_uid){
_uid = toString();
};
return (_uid);
}
override public function get mouseX():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseX] === undefined)))){
return (super.mouseX);
};
return (globalToLocal(new Point(root[fakeMouseX], 0)).x);
}
override public function stopDrag():void{
super.stopDrag();
invalidateProperties();
dispatchEvent(new Event("xChanged"));
dispatchEvent(new Event("yChanged"));
}
public function get focusPane():Sprite{
return (_focusPane);
}
public function set tweeningProperties(value:Array):void{
_tweeningProperties = value;
}
public function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, 0, x, y);
return (UIComponentGlobals.tempMatrix);
}
public function get isDocument():Boolean{
return ((document == this));
}
public function set validationSubField(value:String):void{
_validationSubField = value;
}
override public function get scaleY():Number{
return (_scaleY);
}
protected function keyDownHandler(event:KeyboardEvent):void{
}
protected function createInFontContext(classObj:Class):Object{
hasFontContextBeenSaved = true;
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
oldEmbeddedFontContext = getFontContext(fontName, bold, italic);
var obj:Object = createInModuleContext((oldEmbeddedFontContext) ? oldEmbeddedFontContext : moduleFactory, getQualifiedClassName(classObj));
if (obj == null){
obj = new (classObj);
};
return (obj);
}
public function get screen():Rectangle{
var sm:ISystemManager = systemManager;
return ((sm) ? sm.screen : null);
}
protected function focusInHandler(event:FocusEvent):void{
var fm:IFocusManager;
if (isOurFocus(DisplayObject(event.target))){
fm = focusManager;
if (((fm) && (fm.showFocusIndicator))){
drawFocus(true);
};
ContainerGlobals.checkFocus(event.relatedObject, this);
};
}
public function hasFontContextChanged():Boolean{
if (!hasFontContextBeenSaved){
return (false);
};
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
var embeddedFont:EmbeddedFont = getEmbeddedFont(fontName, bold, italic);
var fontContext:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
return (!((fontContext == oldEmbeddedFontContext)));
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
override public function get x():Number{
return (super.x);
}
override public function get y():Number{
return (super.y);
}
override public function get visible():Boolean{
return (_visible);
}
mx_internal function addOverlay(color:uint, targetArea:RoundedRectangle=null):void{
if (!overlay){
overlayColor = color;
overlay = new UIComponent();
overlay.name = "overlay";
overlay.$visible = true;
fillOverlay(overlay, color, targetArea);
attachOverlay();
if (!targetArea){
addEventListener(ResizeEvent.RESIZE, overlay_resizeHandler);
};
overlay.x = 0;
overlay.y = 0;
invalidateDisplayList();
overlayReferenceCount = 1;
} else {
overlayReferenceCount++;
};
dispatchEvent(new ChildExistenceChangedEvent(ChildExistenceChangedEvent.OVERLAY_CREATED, true, false, overlay));
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set explicitMinHeight(value:Number):void{
if (_explicitMinHeight == value){
return;
};
_explicitMinHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinHeightChanged"));
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
mx_internal function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function stylesInitialized():void{
}
public function set errorString(value:String):void{
var oldValue:String = _errorString;
_errorString = value;
ToolTipManager.registerErrorString(this, oldValue, value);
errorStringChanged = true;
invalidateProperties();
dispatchEvent(new Event("errorStringChanged"));
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
final mx_internal function set $height(value:Number):void{
super.height = value;
}
protected function keyUpHandler(event:KeyboardEvent):void{
}
final mx_internal function $removeChild(child:DisplayObject):DisplayObject{
return (super.removeChild(child));
}
override public function set scaleX(value:Number):void{
if (_scaleX == value){
return;
};
_scaleX = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleXChanged"));
}
override public function set scaleY(value:Number):void{
if (_scaleY == value){
return;
};
_scaleY = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleYChanged"));
}
public function set uid(uid:String):void{
this._uid = uid;
}
public function createAutomationIDPart(child:IAutomationObject):Object{
if (automationDelegate){
return (automationDelegate.createAutomationIDPart(child));
};
return (null);
}
public function getAutomationChildAt(index:int):IAutomationObject{
if (automationDelegate){
return (automationDelegate.getAutomationChildAt(index));
};
return (null);
}
mx_internal function get isEffectStarted():Boolean{
return (_isEffectStarted);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
override public function get mouseY():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseY] === undefined)))){
return (super.mouseY);
};
return (globalToLocal(new Point(0, root[fakeMouseY])).y);
}
public function setActualSize(w:Number, h:Number):void{
var changed:Boolean;
if (_width != w){
_width = w;
dispatchEvent(new Event("widthChanged"));
changed = true;
};
if (_height != h){
_height = h;
dispatchEvent(new Event("heightChanged"));
changed = true;
};
if (changed){
invalidateDisplayList();
dispatchResizeEvent();
};
}
private function focusObj_resizeHandler(event:ResizeEvent):void{
adjustFocusRect();
}
mx_internal function adjustSizesForScaleChanges():void{
var scalingFactor:Number;
var xScale:Number = scaleX;
var yScale:Number = scaleY;
if (xScale != oldScaleX){
scalingFactor = Math.abs((xScale / oldScaleX));
if (explicitMinWidth){
explicitMinWidth = (explicitMinWidth * scalingFactor);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactor);
};
if (explicitMaxWidth){
explicitMaxWidth = (explicitMaxWidth * scalingFactor);
};
oldScaleX = xScale;
};
if (yScale != oldScaleY){
scalingFactor = Math.abs((yScale / oldScaleY));
if (explicitMinHeight){
explicitMinHeight = (explicitMinHeight * scalingFactor);
};
if (explicitHeight){
explicitHeight = (explicitHeight * scalingFactor);
};
if (explicitMaxHeight){
explicitMaxHeight = (explicitMaxHeight * scalingFactor);
};
oldScaleY = yScale;
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane.mask = null;
_focusPane = null;
};
}
public function determineTextFormatFromStyles():UITextFormat{
var font:String;
var textFormat:UITextFormat = cachedTextFormat;
if (!textFormat){
font = StringUtil.trimArrayElements(_inheritingStyles.fontFamily, ",");
textFormat = new UITextFormat(getNonNullSystemManager(), font);
textFormat.moduleFactory = moduleFactory;
textFormat.align = _inheritingStyles.textAlign;
textFormat.bold = (_inheritingStyles.fontWeight == "bold");
textFormat.color = (enabled) ? _inheritingStyles.color : _inheritingStyles.disabledColor;
textFormat.font = font;
textFormat.indent = _inheritingStyles.textIndent;
textFormat.italic = (_inheritingStyles.fontStyle == "italic");
textFormat.kerning = _inheritingStyles.kerning;
textFormat.leading = _nonInheritingStyles.leading;
textFormat.leftMargin = _nonInheritingStyles.paddingLeft;
textFormat.letterSpacing = _inheritingStyles.letterSpacing;
textFormat.rightMargin = _nonInheritingStyles.paddingRight;
textFormat.size = _inheritingStyles.fontSize;
textFormat.underline = (_nonInheritingStyles.textDecoration == "underline");
textFormat.antiAliasType = _inheritingStyles.fontAntiAliasType;
textFormat.gridFitType = _inheritingStyles.fontGridFitType;
textFormat.sharpness = _inheritingStyles.fontSharpness;
textFormat.thickness = _inheritingStyles.fontThickness;
cachedTextFormat = textFormat;
};
return (textFormat);
}
public function validationResultHandler(event:ValidationResultEvent):void{
var msg:String;
var result:ValidationResult;
var i:int;
if (event.type == ValidationResultEvent.VALID){
if (errorString != ""){
errorString = "";
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
} else {
if (((((!((validationSubField == null))) && (!((validationSubField == ""))))) && (event.results))){
i = 0;
while (i < event.results.length) {
result = event.results[i];
if (result.subField == validationSubField){
if (result.isError){
msg = result.errorMessage;
} else {
if (errorString != ""){
errorString = "";
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
};
break;
};
i++;
};
} else {
if (((event.results) && ((event.results.length > 0)))){
msg = event.results[0].errorMessage;
};
};
if (((msg) && (!((errorString == msg))))){
errorString = msg;
dispatchEvent(new FlexEvent(FlexEvent.INVALID));
};
};
}
public function invalidateProperties():void{
if (!invalidatePropertiesFlag){
invalidatePropertiesFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
};
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
private function focusObj_scrollHandler(event:Event):void{
adjustFocusRect();
}
final mx_internal function get $x():Number{
return (super.x);
}
final mx_internal function get $y():Number{
return (super.y);
}
public function setConstraintValue(constraintName:String, value):void{
setStyle(constraintName, value);
}
protected function resourcesChanged():void{
}
public function registerEffects(effects:Array):void{
var event:String;
var n:int = effects.length;
var i:int;
while (i < n) {
event = EffectManager.getEventForEffectTrigger(effects[i]);
if (((!((event == null))) && (!((event == ""))))){
addEventListener(event, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
i++;
};
}
public function get explicitMinWidth():Number{
return (_explicitMinWidth);
}
private function filterChangeHandler(event:Event):void{
super.filters = _filters;
}
override public function set visible(value:Boolean):void{
setVisible(value);
}
public function set explicitHeight(value:Number):void{
if (_explicitHeight == value){
return;
};
if (!isNaN(value)){
_percentHeight = NaN;
};
_explicitHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitHeightChanged"));
}
override public function set x(value:Number):void{
if (super.x == value){
return;
};
super.x = value;
invalidateProperties();
dispatchEvent(new Event("xChanged"));
}
public function set showInAutomationHierarchy(value:Boolean):void{
_showInAutomationHierarchy = value;
}
override public function set y(value:Number):void{
if (super.y == value){
return;
};
super.y = value;
invalidateProperties();
dispatchEvent(new Event("yChanged"));
}
private function resourceManager_changeHandler(event:Event):void{
resourcesChanged();
}
public function set systemManager(value:ISystemManager):void{
_systemManager = value;
_systemManagerDirty = false;
}
mx_internal function getFocusObject():DisplayObject{
var fm:IFocusManager = focusManager;
if (((!(fm)) || (!(fm.focusPane)))){
return (null);
};
return (((fm.focusPane.numChildren == 0)) ? null : fm.focusPane.getChildAt(0));
}
public function set percentWidth(value:Number):void{
if (_percentWidth == value){
return;
};
if (!isNaN(value)){
_explicitWidth = NaN;
};
_percentWidth = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
override public function addChild(child:DisplayObject):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
var index:int = (((overlayReferenceCount) && (!((child == overlay))))) ? Math.max(0, (super.numChildren - 1)) : super.numChildren;
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get document():Object{
return (_document);
}
public function set mouseFocusEnabled(value:Boolean):void{
_mouseFocusEnabled = value;
}
final mx_internal function $addChild(child:DisplayObject):DisplayObject{
return (super.addChild(child));
}
mx_internal function setThemeColor(value:Object):void{
var newValue:Number;
if ((newValue is String)){
newValue = parseInt(String(value));
} else {
newValue = Number(value);
};
if (isNaN(newValue)){
newValue = StyleManager.getColorName(value);
};
var newValueS:Number = ColorUtil.adjustBrightness2(newValue, 50);
var newValueR:Number = ColorUtil.adjustBrightness2(newValue, 70);
setStyle("selectionColor", newValueS);
setStyle("rollOverColor", newValueR);
}
public function get explicitMaxWidth():Number{
return (_explicitMaxWidth);
}
public function get id():String{
return (_id);
}
override public function get height():Number{
return (_height);
}
public function set minWidth(value:Number):void{
if (explicitMinWidth == value){
return;
};
explicitMinWidth = value;
}
public function set currentState(value:String):void{
setCurrentState(value, true);
}
public function getRepeaterItem(whichRepeater:int=-1):Object{
var repeaterArray:Array = repeaters;
if (whichRepeater == -1){
whichRepeater = (repeaterArray.length - 1);
};
return (repeaterArray[whichRepeater].getItemAt(repeaterIndices[whichRepeater]));
}
public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
BindingManager.executeBindings(bindingsHost, id, this);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
mx_internal function getFontContext(fontName:String, bold:Boolean, italic:Boolean):IFlexModuleFactory{
return (embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(fontName, bold, italic), moduleFactory));
}
public function get instanceIndex():int{
return ((_instanceIndices) ? _instanceIndices[(_instanceIndices.length - 1)] : -1);
}
public function set measuredWidth(value:Number):void{
_measuredWidth = value;
}
public function effectFinished(effectInst:IEffectInstance):void{
_endingEffectInstances.push(effectInst);
invalidateProperties();
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler, false, 0, true);
}
mx_internal function set isEffectStarted(value:Boolean):void{
_isEffectStarted = value;
}
mx_internal function fillOverlay(overlay:UIComponent, color:uint, targetArea:RoundedRectangle=null):void{
if (!targetArea){
targetArea = new RoundedRectangle(0, 0, unscaledWidth, unscaledHeight, 0);
};
var g:Graphics = overlay.graphics;
g.clear();
g.beginFill(color);
g.drawRoundRect(targetArea.x, targetArea.y, targetArea.width, targetArea.height, (targetArea.cornerRadius * 2), (targetArea.cornerRadius * 2));
g.endFill();
}
public function get instanceIndices():Array{
return ((_instanceIndices) ? _instanceIndices.slice(0) : null);
}
mx_internal function childAdded(child:DisplayObject):void{
if ((child is UIComponent)){
if (!UIComponent(child).initialized){
UIComponent(child).initialize();
};
} else {
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
};
}
public function globalToContent(point:Point):Point{
return (globalToLocal(point));
}
mx_internal function removingChild(child:DisplayObject):void{
}
mx_internal function getEffectsForProperty(propertyName:String):Array{
return (((_affectedProperties[propertyName])!=undefined) ? _affectedProperties[propertyName] : []);
}
override public function removeChildAt(index:int):DisplayObject{
var child:DisplayObject = getChildAt(index);
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
protected function measure():void{
measuredMinWidth = 0;
measuredMinHeight = 0;
measuredWidth = 0;
measuredHeight = 0;
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
mx_internal function getNonNullSystemManager():ISystemManager{
var sm:ISystemManager = systemManager;
if (!sm){
sm = ISystemManager(SystemManager.getSWFRoot(this));
};
if (!sm){
return (SystemManagerGlobals.topLevelSystemManagers[0]);
};
return (sm);
}
protected function get unscaledWidth():Number{
return ((width / Math.abs(scaleX)));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
if (value){
dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
};
}
private function processEffectFinished(effectInsts:Array):void{
var j:int;
var effectInst:IEffectInstance;
var removedInst:IEffectInstance;
var aProps:Array;
var k:int;
var propName:String;
var l:int;
var i:int = (_effectsStarted.length - 1);
while (i >= 0) {
j = 0;
while (j < effectInsts.length) {
effectInst = effectInsts[j];
if (effectInst == _effectsStarted[i]){
removedInst = _effectsStarted[i];
_effectsStarted.splice(i, 1);
aProps = removedInst.effect.getAffectedProperties();
k = 0;
while (k < aProps.length) {
propName = aProps[k];
if (_affectedProperties[propName] != undefined){
l = 0;
while (l < _affectedProperties[propName].length) {
if (_affectedProperties[propName][l] == effectInst){
_affectedProperties[propName].splice(l, 1);
break;
};
l++;
};
if (_affectedProperties[propName].length == 0){
delete _affectedProperties[propName];
};
};
k++;
};
break;
};
j++;
};
i--;
};
isEffectStarted = ((_effectsStarted.length > 0)) ? true : false;
if (((effectInst) && (effectInst.hideFocusRing))){
preventDrawFocus = false;
};
}
private function commitCurrentState():void{
var event:StateChangeEvent;
var transition:IEffect = (playStateTransition) ? getTransition(_currentState, requestedCurrentState) : null;
var commonBaseState:String = findCommonBaseState(_currentState, requestedCurrentState);
var oldState:String = (_currentState) ? _currentState : "";
var destination:State = getState(requestedCurrentState);
if (_currentTransitionEffect){
_currentTransitionEffect.end();
};
initializeState(requestedCurrentState);
if (transition){
transition.captureStartValues();
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGING);
event.oldState = oldState;
event.newState = (requestedCurrentState) ? requestedCurrentState : "";
dispatchEvent(event);
if (isBaseState(_currentState)){
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
};
removeState(_currentState, commonBaseState);
_currentState = requestedCurrentState;
if (isBaseState(currentState)){
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
} else {
applyState(_currentState, commonBaseState);
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGE);
event.oldState = oldState;
event.newState = (_currentState) ? _currentState : "";
dispatchEvent(event);
if (transition){
UIComponentGlobals.layoutManager.validateNow();
_currentTransitionEffect = transition;
transition.addEventListener(EffectEvent.EFFECT_END, transition_effectEndHandler);
transition.play();
};
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
private function dispatchResizeEvent():void{
var resizeEvent:ResizeEvent = new ResizeEvent(ResizeEvent.RESIZE);
resizeEvent.oldWidth = oldWidth;
resizeEvent.oldHeight = oldHeight;
dispatchEvent(resizeEvent);
oldWidth = width;
oldHeight = height;
}
public function set maxWidth(value:Number):void{
if (explicitMaxWidth == value){
return;
};
explicitMaxWidth = value;
}
public function validateDisplayList():void{
var sm:ISystemManager;
var unscaledWidth:Number;
var unscaledHeight:Number;
if (invalidateDisplayListFlag){
sm = (parent as ISystemManager);
if (sm){
if ((((sm is SystemManagerProxy)) || ((((sm == systemManager.topLevelSystemManager)) && (!((sm.document == this))))))){
setActualSize(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
};
};
unscaledWidth = ((scaleX == 0)) ? 0 : (width / scaleX);
unscaledHeight = ((scaleY == 0)) ? 0 : (height / scaleY);
if (Math.abs((unscaledWidth - lastUnscaledWidth)) < 1E-5){
unscaledWidth = lastUnscaledWidth;
};
if (Math.abs((unscaledHeight - lastUnscaledHeight)) < 1E-5){
unscaledHeight = lastUnscaledHeight;
};
updateDisplayList(unscaledWidth, unscaledHeight);
lastUnscaledWidth = unscaledWidth;
lastUnscaledHeight = unscaledHeight;
invalidateDisplayListFlag = false;
};
}
public function contentToGlobal(point:Point):Point{
return (localToGlobal(point));
}
public function resolveAutomationIDPart(criteria:Object):Array{
if (automationDelegate){
return (automationDelegate.resolveAutomationIDPart(criteria));
};
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function setFocus():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (UIComponentGlobals.callLaterDispatcherCount == 0){
sm.stage.focus = this;
UIComponentGlobals.nextFocusObject = null;
} else {
UIComponentGlobals.nextFocusObject = this;
sm.addEventListener(FlexEvent.ENTER_FRAME, setFocusLater);
};
} else {
UIComponentGlobals.nextFocusObject = this;
callLater(setFocusLater);
};
}
private function getTransition(oldState:String, newState:String):IEffect{
var t:Transition;
var result:IEffect;
var priority:int;
if (!transitions){
return (null);
};
if (!oldState){
oldState = "";
};
if (!newState){
newState = "";
};
var i:int;
while (i < transitions.length) {
t = transitions[i];
if ((((((t.fromState == "*")) && ((t.toState == "*")))) && ((priority < 1)))){
result = t.effect;
priority = 1;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == "*")))) && ((priority < 2)))){
result = t.effect;
priority = 2;
} else {
if ((((((t.fromState == "*")) && ((t.toState == newState)))) && ((priority < 3)))){
result = t.effect;
priority = 3;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == newState)))) && ((priority < 4)))){
result = t.effect;
priority = 4;
break;
};
};
};
};
i++;
};
return (result);
}
public function set initialized(value:Boolean):void{
_initialized = value;
if (value){
setVisible(_visible, true);
dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
};
}
final mx_internal function set $y(value:Number):void{
super.y = value;
}
public function owns(child:DisplayObject):Boolean{
var child = child;
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
if (childList.contains(child)){
return (true);
};
while (((child) && (!((child == this))))) {
if ((child is IUIComponent)){
child = IUIComponent(child).owner;
} else {
child = child.parent;
};
};
//unresolved jump
var _slot1 = e;
return (false);
return ((child == this));
}
public function setVisible(value:Boolean, noEvent:Boolean=false):void{
_visible = value;
if (!initialized){
return;
};
if ($visible == value){
return;
};
$visible = value;
if (!noEvent){
dispatchEvent(new FlexEvent((value) ? FlexEvent.SHOW : FlexEvent.HIDE));
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
public function deleteReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var stack:Array;
var n:int;
var i:int;
var j:int;
var s:Object;
var event:PropertyChangeEvent;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = null;
} else {
r = parentDocument[id];
if (!r){
return;
};
stack = [];
stack.push(r);
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!s){
return;
};
r = s;
stack.push(r);
i++;
};
r.splice(indices[(n - 1)], 1);
j = (stack.length - 1);
while (j > 0) {
if (stack[j].length == 0){
stack[(j - 1)].splice(indices[j], 1);
};
j--;
};
if ((((stack.length > 0)) && ((stack[0].length == 0)))){
parentDocument[id] = null;
} else {
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
};
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function effectStarted(effectInst:IEffectInstance):void{
var propName:String;
_effectsStarted.push(effectInst);
var aProps:Array = effectInst.effect.getAffectedProperties();
var j:int;
while (j < aProps.length) {
propName = aProps[j];
if (_affectedProperties[propName] == undefined){
_affectedProperties[propName] = [];
};
_affectedProperties[propName].push(effectInst);
j++;
};
isEffectStarted = true;
if (effectInst.hideFocusRing){
preventDrawFocus = true;
drawFocus(false);
};
}
final mx_internal function set $x(value:Number):void{
super.x = value;
}
private function applyState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
if (state.basedOn != lastState){
applyState(state.basedOn, lastState);
};
overrides = state.overrides;
i = 0;
while (i < overrides.length) {
overrides[i].apply(this);
i++;
};
state.dispatchEnterState();
};
}
protected function commitProperties():void{
var scalingFactorX:Number;
var scalingFactorY:Number;
if (_scaleX != oldScaleX){
scalingFactorX = Math.abs((_scaleX / oldScaleX));
if (!isNaN(explicitMinWidth)){
explicitMinWidth = (explicitMinWidth * scalingFactorX);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactorX);
};
if (!isNaN(explicitMaxWidth)){
explicitMaxWidth = (explicitMaxWidth * scalingFactorX);
};
_width = (_width * scalingFactorX);
super.scaleX = (oldScaleX = _scaleX);
};
if (_scaleY != oldScaleY){
scalingFactorY = Math.abs((_scaleY / oldScaleY));
if (!isNaN(explicitMinHeight)){
explicitMinHeight = (explicitMinHeight * scalingFactorY);
};
if (!isNaN(explicitHeight)){
explicitHeight = (explicitHeight * scalingFactorY);
};
if (!isNaN(explicitMaxHeight)){
explicitMaxHeight = (explicitMaxHeight * scalingFactorY);
};
_height = (_height * scalingFactorY);
super.scaleY = (oldScaleY = _scaleY);
};
if (((!((x == oldX))) || (!((y == oldY))))){
dispatchMoveEvent();
};
if (((!((width == oldWidth))) || (!((height == oldHeight))))){
dispatchResizeEvent();
};
if (errorStringChanged){
errorStringChanged = false;
setBorderColorForErrorString();
};
}
public function get percentHeight():Number{
return (_percentHeight);
}
override public function get width():Number{
return (_width);
}
final mx_internal function get $parent():DisplayObjectContainer{
return (super.parent);
}
public function set explicitMinWidth(value:Number):void{
if (_explicitMinWidth == value){
return;
};
_explicitMinWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinWidthChanged"));
}
public function get isPopUp():Boolean{
return (_isPopUp);
}
private function measureSizes():Boolean{
var scalingFactor:Number;
var newValue:Number;
var xScale:Number;
var yScale:Number;
var changed:Boolean;
if (!invalidateSizeFlag){
return (changed);
};
if (((isNaN(explicitWidth)) || (isNaN(explicitHeight)))){
xScale = Math.abs(scaleX);
yScale = Math.abs(scaleY);
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth / xScale);
_measuredWidth = (_measuredWidth / xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight / yScale);
_measuredHeight = (_measuredHeight / yScale);
};
measure();
invalidateSizeFlag = false;
if (((!(isNaN(explicitMinWidth))) && ((measuredWidth < explicitMinWidth)))){
measuredWidth = explicitMinWidth;
};
if (((!(isNaN(explicitMaxWidth))) && ((measuredWidth > explicitMaxWidth)))){
measuredWidth = explicitMaxWidth;
};
if (((!(isNaN(explicitMinHeight))) && ((measuredHeight < explicitMinHeight)))){
measuredHeight = explicitMinHeight;
};
if (((!(isNaN(explicitMaxHeight))) && ((measuredHeight > explicitMaxHeight)))){
measuredHeight = explicitMaxHeight;
};
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth * xScale);
_measuredWidth = (_measuredWidth * xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight * yScale);
_measuredHeight = (_measuredHeight * yScale);
};
} else {
invalidateSizeFlag = false;
_measuredMinWidth = 0;
_measuredMinHeight = 0;
};
adjustSizesForScaleChanges();
if (isNaN(oldMinWidth)){
oldMinWidth = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
oldMinHeight = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
oldExplicitWidth = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
oldExplicitHeight = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
changed = true;
} else {
newValue = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
if (newValue != oldMinWidth){
oldMinWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
if (newValue != oldMinHeight){
oldMinHeight = newValue;
changed = true;
};
newValue = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
if (newValue != oldExplicitWidth){
oldExplicitWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
if (newValue != oldExplicitHeight){
oldExplicitHeight = newValue;
changed = true;
};
};
return (changed);
}
public function get automationTabularData():Object{
if (automationDelegate){
return (automationDelegate.automationTabularData);
};
return (null);
}
public function validateNow():void{
UIComponentGlobals.layoutManager.validateClient(this);
}
public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
}
public function get repeaters():Array{
return ((_repeaters) ? _repeaters.slice(0) : []);
}
private function dispatchMoveEvent():void{
var moveEvent:MoveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = oldX;
moveEvent.oldY = oldY;
dispatchEvent(moveEvent);
oldX = x;
oldY = y;
}
public function drawFocus(isFocused:Boolean):void{
var focusOwner:DisplayObjectContainer;
var focusClass:Class;
if (!parent){
return;
};
var focusObj:DisplayObject = getFocusObject();
var focusPane:Sprite = (focusManager) ? focusManager.focusPane : null;
if (((isFocused) && (!(preventDrawFocus)))){
focusOwner = focusPane.parent;
if (focusOwner != parent){
if (focusOwner){
if ((focusOwner is ISystemManager)){
ISystemManager(focusOwner).focusPane = null;
} else {
IUIComponent(focusOwner).focusPane = null;
};
};
if ((parent is ISystemManager)){
ISystemManager(parent).focusPane = focusPane;
} else {
IUIComponent(parent).focusPane = focusPane;
};
};
focusClass = getStyle("focusSkin");
if (((focusObj) && (!((focusObj is focusClass))))){
focusPane.removeChild(focusObj);
focusObj = null;
};
if (!focusObj){
focusObj = new (focusClass);
focusObj.name = "focus";
focusPane.addChild(focusObj);
};
if ((focusObj is ILayoutManagerClient)){
ILayoutManagerClient(focusObj).nestLevel = nestLevel;
};
if ((focusObj is ISimpleStyleClient)){
ISimpleStyleClient(focusObj).styleName = this;
};
addEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
addEventListener(MoveEvent.MOVE, focusObj_moveHandler);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
addEventListener(Event.REMOVED, focusObj_removedHandler, true);
focusObj.visible = true;
hasFocusRect = true;
adjustFocusRect();
} else {
if (hasFocusRect){
hasFocusRect = false;
if (focusObj){
focusObj.visible = false;
};
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler);
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
removeEventListener(Event.REMOVED, focusObj_removedHandler, true);
};
};
}
public function get flexContextMenu():IFlexContextMenu{
return (_flexContextMenu);
}
private function get indexedID():String{
var s:String = id;
var indices:Array = instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
return (s);
}
public function get measuredMinHeight():Number{
return (_measuredMinHeight);
}
mx_internal function addingChild(child:DisplayObject):void{
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = (document) ? document : ApplicationGlobals.application;
};
if ((((child is UIComponent)) && ((UIComponent(child).moduleFactory == null)))){
if (moduleFactory != null){
UIComponent(child).moduleFactory = moduleFactory;
} else {
if ((((document is IFlexModule)) && (!((document.moduleFactory == null))))){
UIComponent(child).moduleFactory = document.moduleFactory;
} else {
if ((((parent is UIComponent)) && (!((UIComponent(parent).moduleFactory == null))))){
UIComponent(child).moduleFactory = UIComponent(parent).moduleFactory;
};
};
};
};
if ((((((child is IFontContextComponent)) && ((!(child) is UIComponent)))) && ((IFontContextComponent(child).fontContext == null)))){
IFontContextComponent(child).fontContext = moduleFactory;
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
} else {
if ((child is IUITextField)){
IUITextField(child).nestLevel = (nestLevel + 1);
};
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
} else {
if ((((child is IUITextField)) && (IUITextField(child).inheritingStyles))){
StyleProtoChain.initTextField(IUITextField(child));
};
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if ((child is UIComponent)){
UIComponent(child).initThemeColor();
};
if ((child is UIComponent)){
UIComponent(child).stylesInitialized();
};
}
public function set repeaterIndices(value:Array):void{
_repeaterIndices = value;
}
protected function initializationComplete():void{
processedDescriptors = true;
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
var child:UIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as UIComponent);
if (!child){
} else {
if ((((child.moduleFactory == null)) || ((child.moduleFactory == _moduleFactory)))){
child.moduleFactory = factory;
};
};
i++;
};
_moduleFactory = factory;
}
private function focusObj_removedHandler(event:Event):void{
if (event.target != this){
return;
};
var focusObject:DisplayObject = getFocusObject();
if (focusObject){
focusObject.visible = false;
};
}
mx_internal function updateCallbacks():void{
if (invalidateDisplayListFlag){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
if (invalidateSizeFlag){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
if (invalidatePropertiesFlag){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
if (((systemManager) && (((_systemManager.stage) || (_systemManager.useSWFBridge()))))){
if ((((methodQueue.length > 0)) && (!(listeningForRender)))){
_systemManager.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
_systemManager.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (_systemManager.stage){
_systemManager.stage.invalidate();
};
};
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_styleDeclaration = value;
}
override public function set doubleClickEnabled(value:Boolean):void{
var childList:IChildList;
var child:InteractiveObject;
super.doubleClickEnabled = value;
if ((this is IRawChildrenContainer)){
childList = IRawChildrenContainer(this).rawChildren;
} else {
childList = IChildList(this);
};
var i:int;
while (i < childList.numChildren) {
child = (childList.getChildAt(i) as InteractiveObject);
if (child){
child.doubleClickEnabled = value;
};
i++;
};
}
public function prepareToPrint(target:IFlexDisplayObject):Object{
return (null);
}
public function get minHeight():Number{
if (!isNaN(explicitMinHeight)){
return (explicitMinHeight);
};
return (measuredMinHeight);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:ISimpleStyleClient;
cachedTextFormat = null;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as ISimpleStyleClient);
if (child){
child.styleChanged(styleProp);
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(styleProp, recursive);
};
};
i++;
};
}
public function get contentMouseX():Number{
return (mouseX);
}
public function get contentMouseY():Number{
return (mouseY);
}
public function get tweeningProperties():Array{
return (_tweeningProperties);
}
public function set explicitMaxWidth(value:Number):void{
if (_explicitMaxWidth == value){
return;
};
_explicitMaxWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxWidthChanged"));
}
public function set document(value:Object):void{
var child:IUIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as IUIComponent);
if (!child){
} else {
if ((((child.document == _document)) || ((child.document == ApplicationGlobals.application)))){
child.document = value;
};
};
i++;
};
_document = value;
}
public function validateSize(recursive:Boolean=false):void{
var i:int;
var child:DisplayObject;
var sizeChanging:Boolean;
var p:IInvalidating;
if (recursive){
i = 0;
while (i < numChildren) {
child = getChildAt(i);
if ((child is ILayoutManagerClient)){
(child as ILayoutManagerClient).validateSize(true);
};
i++;
};
};
if (invalidateSizeFlag){
sizeChanging = measureSizes();
if (((sizeChanging) && (includeInLayout))){
invalidateDisplayList();
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
};
}
public function get validationSubField():String{
return (_validationSubField);
}
override public function dispatchEvent(event:Event):Boolean{
if (dispatchEventHook != null){
dispatchEventHook(event, this);
};
return (super.dispatchEvent(event));
}
public function set id(value:String):void{
_id = value;
}
private function overlay_resizeHandler(event:Event):void{
fillOverlay(overlay, overlayColor, null);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
final mx_internal function get $height():Number{
return (super.height);
}
protected function attachOverlay():void{
addChild(overlay);
}
public function get explicitMinHeight():Number{
return (_explicitMinHeight);
}
override public function set height(value:Number):void{
var p:IInvalidating;
if (explicitHeight != value){
explicitHeight = value;
invalidateSize();
};
if (_height != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_height = value;
dispatchEvent(new Event("heightChanged"));
};
}
public function get numAutomationChildren():int{
if (automationDelegate){
return (automationDelegate.numAutomationChildren);
};
return (0);
}
public function get parentApplication():Object{
var p:UIComponent;
var o:Object = systemManager.document;
if (o == this){
p = (o.systemManager.parent as UIComponent);
o = (p) ? p.systemManager.document : null;
};
return (o);
}
public function localToContent(point:Point):Point{
return (point);
}
public function get repeaterIndex():int{
return ((_repeaterIndices) ? _repeaterIndices[(_repeaterIndices.length - 1)] : -1);
}
private function removeState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
state.dispatchExitState();
overrides = state.overrides;
i = overrides.length;
while (i) {
overrides[(i - 1)].remove(this);
i--;
};
if (state.basedOn != lastState){
removeState(state.basedOn, lastState);
};
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "styleName"){
styleName = newValue;
return;
};
if (EffectManager.getEventForEffectTrigger(styleProp) != ""){
EffectManager.setStyle(styleProp, this);
};
var isInheritingStyle:Boolean = StyleManager.isInheritingStyle(styleProp);
var isProtoChainInitialized = !((inheritingStyles == UIComponent.STYLE_UNINITIALIZED));
var valueChanged = !((getStyle(styleProp) == newValue));
if (!_styleDeclaration){
_styleDeclaration = new CSSStyleDeclaration();
_styleDeclaration.setStyle(styleProp, newValue);
if (isProtoChainInitialized){
regenerateStyleCache(isInheritingStyle);
};
} else {
_styleDeclaration.setStyle(styleProp, newValue);
};
if (((isProtoChainInitialized) && (valueChanged))){
styleChanged(styleProp);
notifyStyleChangeInChildren(styleProp, isInheritingStyle);
};
}
public function get showInAutomationHierarchy():Boolean{
return (_showInAutomationHierarchy);
}
public function get systemManager():ISystemManager{
var r:DisplayObject;
var o:DisplayObjectContainer;
var ui:IUIComponent;
if (((!(_systemManager)) || (_systemManagerDirty))){
r = root;
if ((_systemManager is SystemManagerProxy)){
} else {
if (((r) && (!((r is Stage))))){
_systemManager = (r as ISystemManager);
} else {
if (r){
_systemManager = (Stage(r).getChildAt(0) as ISystemManager);
} else {
o = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
_systemManager = ui.systemManager;
break;
} else {
if ((o is ISystemManager)){
_systemManager = (o as ISystemManager);
break;
};
};
o = o.parent;
};
};
};
};
_systemManagerDirty = false;
};
return (_systemManager);
}
private function isBaseState(stateName:String):Boolean{
return (((!(stateName)) || ((stateName == ""))));
}
public function set enabled(value:Boolean):void{
_enabled = value;
cachedTextFormat = null;
invalidateDisplayList();
dispatchEvent(new Event("enabledChanged"));
}
public function set focusEnabled(value:Boolean):void{
_focusEnabled = value;
}
public function get minWidth():Number{
if (!isNaN(explicitMinWidth)){
return (explicitMinWidth);
};
return (measuredMinWidth);
}
private function setFocusLater(event:Event=null):void{
var sm:ISystemManager = systemManager;
if (((sm) && (sm.stage))){
sm.stage.removeEventListener(Event.ENTER_FRAME, setFocusLater);
if (UIComponentGlobals.nextFocusObject){
sm.stage.focus = UIComponentGlobals.nextFocusObject;
};
UIComponentGlobals.nextFocusObject = null;
};
}
public function get currentState():String{
return ((_currentStateChanged) ? requestedCurrentState : _currentState);
}
public function initializeRepeaterArrays(parent:IRepeaterClient):void{
if (((((((parent) && (parent.instanceIndices))) && (((!(parent.isDocument)) || (!((parent == descriptor.document))))))) && (!(_instanceIndices)))){
_instanceIndices = parent.instanceIndices;
_repeaters = parent.repeaters;
_repeaterIndices = parent.repeaterIndices;
};
}
public function get baselinePosition():Number{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (NaN);
};
if (!validateBaselinePosition()){
return (NaN);
};
var lineMetrics:TextLineMetrics = measureText("Wj");
if (height < ((2 + lineMetrics.ascent) + 2)){
return (int((height + ((lineMetrics.ascent - height) / 2))));
};
return ((2 + lineMetrics.ascent));
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function set instanceIndices(value:Array):void{
_instanceIndices = value;
}
public function set cachePolicy(value:String):void{
if (_cachePolicy != value){
_cachePolicy = value;
if (value == UIComponentCachePolicy.OFF){
cacheAsBitmap = false;
} else {
if (value == UIComponentCachePolicy.ON){
cacheAsBitmap = true;
} else {
cacheAsBitmap = (cacheAsBitmapCount > 0);
};
};
};
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([]);
}
private function addedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is ISystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
if (((overlayReferenceCount) && (!((child == overlay))))){
index = Math.min(index, Math.max(0, (super.numChildren - 1)));
};
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get maxWidth():Number{
return ((isNaN(explicitMaxWidth)) ? DEFAULT_MAX_WIDTH : explicitMaxWidth);
}
override public function set alpha(value:Number):void{
super.alpha = value;
dispatchEvent(new Event("alphaChanged"));
}
private function removedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
_systemManagerDirty = true;
}
public function callLater(method:Function, args:Array=null):void{
methodQueue.push(new MethodQueueElement(method, args));
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (!listeningForRender){
sm.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (sm.stage){
sm.stage.invalidate();
};
};
}
public function get initialized():Boolean{
return (_initialized);
}
private function callLaterDispatcher2(event:Event):void{
var mqe:MethodQueueElement;
if (UIComponentGlobals.callLaterSuspendCount > 0){
return;
};
var sm:ISystemManager = systemManager;
if (((((sm) && (((sm.stage) || (sm.useSWFBridge()))))) && (listeningForRender))){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
var queue:Array = methodQueue;
methodQueue = [];
var n:int = queue.length;
var i:int;
while (i < n) {
mqe = MethodQueueElement(queue[i]);
mqe.method.apply(null, mqe.args);
i++;
};
}
public function measureHTMLText(htmlText:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureHTMLText(htmlText));
}
public function set descriptor(value:UIComponentDescriptor):void{
_descriptor = value;
}
private function getState(stateName:String):State{
if (((!(states)) || (isBaseState(stateName)))){
return (null);
};
var i:int;
while (i < states.length) {
if (states[i].name == stateName){
return (states[i]);
};
i++;
};
var message:String = resourceManager.getString("core", "stateUndefined", [stateName]);
throw (new ArgumentError(message));
}
public function validateProperties():void{
if (invalidatePropertiesFlag){
commitProperties();
invalidatePropertiesFlag = false;
};
}
mx_internal function get documentDescriptor():UIComponentDescriptor{
return (_documentDescriptor);
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("includeInLayoutChanged"));
};
}
public function getClassStyleDeclarations():Array{
var myApplicationDomain:ApplicationDomain;
var cache:Array;
var myRoot:DisplayObject;
var s:CSSStyleDeclaration;
var factory:IFlexModuleFactory = ModuleManager.getAssociatedFactory(this);
if (factory != null){
myApplicationDomain = ApplicationDomain(factory.info()["currentDomain"]);
} else {
myRoot = SystemManager.getSWFRoot(this);
if (!myRoot){
return ([]);
};
myApplicationDomain = myRoot.loaderInfo.applicationDomain;
};
var className:String = getQualifiedClassName(this);
className = className.replace("::", ".");
cache = StyleManager.typeSelectorCache[className];
if (cache){
return (cache);
};
var decls:Array = [];
var classNames:Array = [];
var caches:Array = [];
var declcache:Array = [];
while (((((!((className == null))) && (!((className == "mx.core.UIComponent"))))) && (!((className == "mx.core.UITextField"))))) {
cache = StyleManager.typeSelectorCache[className];
if (cache){
decls = decls.concat(cache);
break;
};
s = StyleManager.getStyleDeclaration(className);
if (s){
decls.unshift(s);
classNames.push(className);
caches.push(classNames);
declcache.push(decls);
decls = [];
classNames = [];
} else {
classNames.push(className);
};
className = getQualifiedSuperclassName(myApplicationDomain.getDefinition(className));
className = className.replace("::", ".");
continue;
var _slot1 = e;
className = null;
};
caches.push(classNames);
declcache.push(decls);
decls = [];
while (caches.length) {
classNames = caches.pop();
decls = decls.concat(declcache.pop());
while (classNames.length) {
StyleManager.typeSelectorCache[classNames.pop()] = decls;
};
};
return (decls);
}
public function set measuredMinWidth(value:Number):void{
_measuredMinWidth = value;
}
private function initializeState(stateName:String):void{
var state:State = getState(stateName);
while (state) {
state.initialize();
state = getState(state.basedOn);
};
}
mx_internal function initProtoChain():void{
var classSelector:CSSStyleDeclaration;
var inheritChain:Object;
var typeSelector:CSSStyleDeclaration;
if (styleName){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((((styleName is IFlexDisplayObject)) || ((styleName is IStyleClient)))){
StyleProtoChain.initProtoChainForUIComponentStyleName(this);
return;
};
if ((styleName is String)){
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
};
var nonInheritChain:Object = StyleManager.stylesRoot;
if (((nonInheritChain) && (nonInheritChain.effects))){
registerEffects(nonInheritChain.effects);
};
var p:IStyleClient = (parent as IStyleClient);
if (p){
inheritChain = p.inheritingStyles;
if (inheritChain == UIComponent.STYLE_UNINITIALIZED){
inheritChain = nonInheritChain;
};
} else {
if (isPopUp){
if ((((((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)) && (_owner))) && ((_owner is IStyleClient)))){
inheritChain = IStyleClient(_owner).inheritingStyles;
} else {
inheritChain = ApplicationGlobals.application.inheritingStyles;
};
} else {
inheritChain = StyleManager.stylesRoot;
};
};
var typeSelectors:Array = getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, this);
if (typeSelector.effects){
registerEffects(typeSelector.effects);
};
i++;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, this);
if (classSelector.effects){
registerEffects(classSelector.effects);
};
};
inheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(inheritChain, this) : inheritChain;
nonInheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(nonInheritChain, this) : nonInheritChain;
}
public function get repeaterIndices():Array{
return ((_repeaterIndices) ? _repeaterIndices.slice() : []);
}
override public function removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
private function focusObj_moveHandler(event:MoveEvent):void{
adjustFocusRect();
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_styleDeclaration);
}
override public function get doubleClickEnabled():Boolean{
return (super.doubleClickEnabled);
}
public function contentToLocal(point:Point):Point{
return (point);
}
private function creationCompleteHandler(event:FlexEvent):void{
if (_currentStateChanged){
_currentStateChanged = false;
commitCurrentState();
validateNow();
};
removeEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
}
public function set measuredHeight(value:Number):void{
_measuredHeight = value;
}
protected function createChildren():void{
}
public function get activeEffects():Array{
return (_effectsStarted);
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
if (((overlayReferenceCount) && (!((child == overlay))))){
newIndex = Math.min(newIndex, Math.max(0, (super.numChildren - 2)));
};
super.setChildIndex(child, newIndex);
}
public function regenerateStyleCache(recursive:Boolean):void{
var child:DisplayObject;
initProtoChain();
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
var n:int = childList.numChildren;
var i:int;
while (i < n) {
child = childList.getChildAt(i);
if ((child is IStyleClient)){
if (IStyleClient(child).inheritingStyles != UIComponent.STYLE_UNINITIALIZED){
IStyleClient(child).regenerateStyleCache(recursive);
};
} else {
if ((child is IUITextField)){
if (IUITextField(child).inheritingStyles){
StyleProtoChain.initTextField(IUITextField(child));
};
};
};
i++;
};
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function focusOutHandler(event:FocusEvent):void{
if (isOurFocus(DisplayObject(event.target))){
drawFocus(false);
};
}
public function getFocus():InteractiveObject{
var sm:ISystemManager = systemManager;
if (!sm){
return (null);
};
if (UIComponentGlobals.nextFocusObject){
return (UIComponentGlobals.nextFocusObject);
};
return (sm.stage.focus);
}
public function endEffectsStarted():void{
var len:int = _effectsStarted.length;
var i:int;
while (i < len) {
_effectsStarted[i].end();
i++;
};
}
protected function get unscaledHeight():Number{
return ((height / Math.abs(scaleY)));
}
public function get enabled():Boolean{
return (_enabled);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
override public function set cacheAsBitmap(value:Boolean):void{
super.cacheAsBitmap = value;
cacheAsBitmapCount = (value) ? 1 : 0;
}
mx_internal function removeOverlay():void{
if ((((((overlayReferenceCount > 0)) && ((--overlayReferenceCount == 0)))) && (overlay))){
removeEventListener("resize", overlay_resizeHandler);
if (super.getChildByName("overlay")){
$removeChild(overlay);
};
overlay = null;
};
}
public function set cacheHeuristic(value:Boolean):void{
if (_cachePolicy == UIComponentCachePolicy.AUTO){
if (value){
cacheAsBitmapCount++;
} else {
if (cacheAsBitmapCount != 0){
cacheAsBitmapCount--;
};
};
super.cacheAsBitmap = !((cacheAsBitmapCount == 0));
};
}
public function get cachePolicy():String{
return (_cachePolicy);
}
public function set maxHeight(value:Number):void{
if (explicitMaxHeight == value){
return;
};
explicitMaxHeight = value;
}
public function getConstraintValue(constraintName:String){
return (getStyle(constraintName));
}
public function set focusManager(value:IFocusManager):void{
_focusManager = value;
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function get descriptor():UIComponentDescriptor{
return (_descriptor);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get cursorManager():ICursorManager{
var cm:ICursorManager;
var o:DisplayObject = parent;
while (o) {
if ((((o is IUIComponent)) && (("cursorManager" in o)))){
cm = o["cursorManager"];
return (cm);
};
o = o.parent;
};
return (CursorManager.getInstance());
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredMinWidth():Number{
return (_measuredMinWidth);
}
public function createReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var n:int;
var i:int;
var event:PropertyChangeEvent;
var s:Object;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = this;
} else {
r = parentDocument[id];
if (!(r is Array)){
r = (parentDocument[id] = []);
};
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!(s is Array)){
s = (r[indices[i]] = []);
};
r = s;
i++;
};
r[indices[(n - 1)]] = this;
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
}
public function get repeater():IRepeater{
return ((_repeaters) ? _repeaters[(_repeaters.length - 1)] : null);
}
public function set isPopUp(value:Boolean):void{
_isPopUp = value;
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function initialize():void{
if (initialized){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.PREINITIALIZE));
createChildren();
childrenCreated();
initializeAccessibility();
initializationComplete();
}
override public function set width(value:Number):void{
var p:IInvalidating;
if (explicitWidth != value){
explicitWidth = value;
invalidateSize();
};
if (_width != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_width = value;
dispatchEvent(new Event("widthChanged"));
};
}
public function set percentHeight(value:Number):void{
if (_percentHeight == value){
return;
};
if (!isNaN(value)){
_explicitHeight = NaN;
};
_percentHeight = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
final mx_internal function set $visible(value:Boolean):void{
super.visible = value;
}
private function findCommonBaseState(state1:String, state2:String):String{
var firstState:State = getState(state1);
var secondState:State = getState(state2);
if (((!(firstState)) || (!(secondState)))){
return ("");
};
if (((isBaseState(firstState.basedOn)) && (isBaseState(secondState.basedOn)))){
return ("");
};
var firstBaseStates:Array = getBaseStates(firstState);
var secondBaseStates:Array = getBaseStates(secondState);
var commonBase:String = "";
while (firstBaseStates[(firstBaseStates.length - 1)] == secondBaseStates[(secondBaseStates.length - 1)]) {
commonBase = firstBaseStates.pop();
secondBaseStates.pop();
if (((!(firstBaseStates.length)) || (!(secondBaseStates.length)))){
break;
};
};
if (((firstBaseStates.length) && ((firstBaseStates[(firstBaseStates.length - 1)] == secondState.name)))){
commonBase = secondState.name;
} else {
if (((secondBaseStates.length) && ((secondBaseStates[(secondBaseStates.length - 1)] == firstState.name)))){
commonBase = firstState.name;
};
};
return (commonBase);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
if (IUIComponent(child).document != child){
IUIComponent(child).document = null;
};
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
public function get maxHeight():Number{
return ((isNaN(explicitMaxHeight)) ? DEFAULT_MAX_HEIGHT : explicitMaxHeight);
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function set explicitMaxHeight(value:Number):void{
if (_explicitMaxHeight == value){
return;
};
_explicitMaxHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxHeightChanged"));
}
public function get focusManager():IFocusManager{
if (_focusManager){
return (_focusManager);
};
var o:DisplayObject = parent;
while (o) {
if ((o is IFocusManagerContainer)){
return (IFocusManagerContainer(o).focusManager);
};
o = o.parent;
};
return (null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (inheritingStyles == UIComponent.STYLE_UNINITIALIZED){
return;
};
regenerateStyleCache(true);
initThemeColor();
styleChanged("styleName");
notifyStyleChangeInChildren("styleName", true);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
protected function get resourceManager():IResourceManager{
return (_resourceManager);
}
mx_internal function validateBaselinePosition():Boolean{
var w:Number;
var h:Number;
if (!parent){
return (false);
};
if ((((width == 0)) && ((height == 0)))){
validateNow();
w = getExplicitOrMeasuredWidth();
h = getExplicitOrMeasuredHeight();
setActualSize(w, h);
};
validateNow();
return (true);
}
mx_internal function cancelAllCallLaters():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (listeningForRender){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
};
methodQueue.splice(0);
}
private function updateCompleteHandler(event:FlexEvent):void{
UIComponentGlobals.layoutManager.removeEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
processEffectFinished(_endingEffectInstances);
_endingEffectInstances = [];
}
public function styleChanged(styleProp:String):void{
if ((((this is IFontContextComponent)) && (hasFontContextChanged()))){
invalidateProperties();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateSize();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || ((styleProp == "themeColor")))){
initThemeColor();
};
invalidateDisplayList();
if ((parent is IInvalidating)){
if (StyleManager.isParentSizeInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateSize();
};
if (StyleManager.isParentDisplayListInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateDisplayList();
};
};
}
final mx_internal function get $visible():Boolean{
return (super.visible);
}
public function drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object=null, c:Object=null, alpha:Object=null, rot:Object=null, gradient:String=null, ratios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var matrix:Matrix;
var holeR:Object;
var g:Graphics = graphics;
if (((!(w)) || (!(h)))){
return;
};
if (c !== null){
if ((c is Array)){
if ((alpha is Array)){
alphas = (alpha as Array);
} else {
alphas = [alpha, alpha];
};
if (!ratios){
ratios = [0, 0xFF];
};
matrix = null;
if (rot){
if ((rot is Matrix)){
matrix = Matrix(rot);
} else {
matrix = new Matrix();
if ((rot is Number)){
matrix.createGradientBox(w, h, ((Number(rot) * Math.PI) / 180), x, y);
} else {
matrix.createGradientBox(rot.w, rot.h, rot.r, rot.x, rot.y);
};
};
};
if (gradient == GradientType.RADIAL){
g.beginGradientFill(GradientType.RADIAL, (c as Array), alphas, ratios, matrix);
} else {
g.beginGradientFill(GradientType.LINEAR, (c as Array), alphas, ratios, matrix);
};
} else {
g.beginFill(Number(c), Number(alpha));
};
};
if (!r){
g.drawRect(x, y, w, h);
} else {
if ((r is Number)){
ellipseSize = (Number(r) * 2);
g.drawRoundRect(x, y, w, h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, w, h, r.tl, r.tr, r.bl, r.br);
};
};
if (hole){
holeR = hole.r;
if ((holeR is Number)){
ellipseSize = (Number(holeR) * 2);
g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br);
};
};
if (c !== null){
g.endFill();
};
}
public function move(x:Number, y:Number):void{
var changed:Boolean;
if (x != super.x){
super.x = x;
dispatchEvent(new Event("xChanged"));
changed = true;
};
if (y != super.y){
super.y = y;
dispatchEvent(new Event("yChanged"));
changed = true;
};
if (changed){
dispatchMoveEvent();
};
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
dispatchEvent(new Event("toolTipChanged"));
}
public function set repeaters(value:Array):void{
_repeaters = value;
}
public function get explicitMaxHeight():Number{
return (_explicitMaxHeight);
}
public function measureText(text:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureText(text));
}
public function get styleName():Object{
return (_styleName);
}
protected function createInModuleContext(moduleFactory:IFlexModuleFactory, className:String):Object{
var newObject:Object;
if (moduleFactory){
newObject = moduleFactory.create(className);
};
return (newObject);
}
public function get parentDocument():Object{
var p:IUIComponent;
var sm:ISystemManager;
if (document == this){
p = (parent as IUIComponent);
if (p){
return (p.document);
};
sm = (parent as ISystemManager);
if (sm){
return (sm.document);
};
return (null);
//unresolved jump
};
return (document);
}
protected function childrenCreated():void{
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function set flexContextMenu(value:IFlexContextMenu):void{
if (_flexContextMenu){
_flexContextMenu.unsetContextMenu(this);
};
_flexContextMenu = value;
if (value != null){
_flexContextMenu.setContextMenu(this);
};
}
public function set explicitWidth(value:Number):void{
if (_explicitWidth == value){
return;
};
if (!isNaN(value)){
_percentWidth = NaN;
};
_explicitWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitWidthChanged"));
}
private function setBorderColorForErrorString():void{
if (((!(_errorString)) || ((_errorString.length == 0)))){
if (!isNaN(origBorderColor)){
setStyle("borderColor", origBorderColor);
saveBorderColor = true;
};
} else {
if (saveBorderColor){
saveBorderColor = false;
origBorderColor = getStyle("borderColor");
};
setStyle("borderColor", getStyle("errorColor"));
};
styleChanged("themeColor");
var focusManager:IFocusManager = focusManager;
var focusObj:DisplayObject = (focusManager) ? DisplayObject(focusManager.getFocus()) : null;
if (((((focusManager) && (focusManager.showFocusIndicator))) && ((focusObj == this)))){
drawFocus(true);
};
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
if (!invalidateSizeFlag){
invalidateSizeFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
};
}
public function set measuredMinHeight(value:Number):void{
_measuredMinHeight = value;
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
override public function set filters(value:Array):void{
var n:int;
var i:int;
var e:IEventDispatcher;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.removeEventListener("change", filterChangeHandler);
};
i++;
};
};
_filters = value;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.addEventListener("change", filterChangeHandler);
};
i++;
};
};
super.filters = _filters;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
public static function resumeBackgroundProcessing():void{
var sm:ISystemManager;
if (UIComponentGlobals.callLaterSuspendCount > 0){
UIComponentGlobals.callLaterSuspendCount--;
if (UIComponentGlobals.callLaterSuspendCount == 0){
sm = SystemManagerGlobals.topLevelSystemManagers[0];
if (((sm) && (sm.stage))){
sm.stage.invalidate();
};
};
};
}
public static function suspendBackgroundProcessing():void{
UIComponentGlobals.callLaterSuspendCount++;
}
}
}//package mx.core
class MethodQueueElement {
public var method:Function;
public var args:Array;
private function MethodQueueElement(method:Function, args:Array=null){
super();
this.method = method;
this.args = args;
}
}
Section 181
//UIComponentCachePolicy (mx.core.UIComponentCachePolicy)
package mx.core {
public final class UIComponentCachePolicy {
public static const AUTO:String = "auto";
public static const ON:String = "on";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OFF:String = "off";
public function UIComponentCachePolicy(){
super();
}
}
}//package mx.core
Section 182
//UIComponentDescriptor (mx.core.UIComponentDescriptor)
package mx.core {
public class UIComponentDescriptor extends ComponentDescriptor {
mx_internal var instanceIndices:Array;
public var stylesFactory:Function;
public var effects:Array;
mx_internal var repeaters:Array;
mx_internal var repeaterIndices:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function UIComponentDescriptor(descriptorProperties:Object){
super(descriptorProperties);
}
override public function toString():String{
return (("UIComponentDescriptor_" + id));
}
}
}//package mx.core
Section 183
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public function UIComponentGlobals(){
super();
}
public static function set catchCallLaterExceptions(value:Boolean):void{
_catchCallLaterExceptions = value;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(value:Boolean):void{
designTime = value;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 184
//UITextField (mx.core.UITextField)
package mx.core {
import flash.display.*;
import flash.text.*;
import mx.managers.*;
import mx.automation.*;
import flash.events.*;
import mx.resources.*;
import mx.styles.*;
import mx.utils.*;
import flash.utils.*;
public class UITextField extends FlexTextField implements IAutomationObject, IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUITextField {
private var _enabled:Boolean;// = true
private var untruncatedText:String;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var cachedTextFormat:TextFormat;
private var _automationDelegate:IAutomationObject;
private var _automationName:String;
private var _styleName:Object;
private var _document:Object;
mx_internal var _toolTip:String;
private var _nestLevel:int;// = 0
private var _explicitHeight:Number;
private var _moduleFactory:IFlexModuleFactory;
private var _initialized:Boolean;// = false
private var _nonInheritingStyles:Object;
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
private var invalidateDisplayListFlag:Boolean;// = true
mx_internal var explicitColor:uint;// = 4294967295
private var _processedDescriptors:Boolean;// = true
private var _updateCompletePendingFlag:Boolean;// = false
private var explicitHTMLText:String;// = null
mx_internal var _parent:DisplayObjectContainer;
private var _imeMode:String;// = null
private var resourceManager:IResourceManager;
mx_internal var styleChangedFlag:Boolean;// = true
private var _ignorePadding:Boolean;// = true
private var _owner:DisplayObjectContainer;
private var _explicitWidth:Number;
mx_internal static const TEXT_WIDTH_PADDING:int = 5;
mx_internal static const TEXT_HEIGHT_PADDING:int = 4;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var truncationIndicatorResource:String;
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
mx_internal static var debuggingBorders:Boolean = false;
public function UITextField(){
resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
super();
super.text = "";
focusRect = false;
selectable = false;
tabEnabled = false;
if (debuggingBorders){
border = true;
};
if (!truncationIndicatorResource){
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
};
addEventListener(Event.CHANGE, changeHandler);
addEventListener("textFieldStyleChange", textFieldStyleChangeHandler);
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
}
public function set imeMode(value:String):void{
_imeMode = value;
}
public function get nestLevel():int{
return (_nestLevel);
}
private function textFieldStyleChangeHandler(event:Event):void{
if (explicitHTMLText != null){
super.htmlText = explicitHTMLText;
};
}
public function truncateToFit(truncationIndicator:String=null):Boolean{
var s:String;
if (!truncationIndicator){
truncationIndicator = truncationIndicatorResource;
};
validateNow();
var originalText:String = super.text;
untruncatedText = originalText;
var w:Number = width;
if (((!((originalText == ""))) && (((textWidth + TEXT_WIDTH_PADDING) > (w + 1E-14))))){
var _local5 = originalText;
super.text = _local5;
s = _local5;
originalText.slice(0, Math.floor(((w / (textWidth + TEXT_WIDTH_PADDING)) * originalText.length)));
while ((((s.length > 1)) && (((textWidth + TEXT_WIDTH_PADDING) > w)))) {
s = s.slice(0, -1);
super.text = (s + truncationIndicator);
};
return (true);
};
return (false);
}
public function set nestLevel(value:int):void{
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
StyleProtoChain.initTextField(this);
styleChangedFlag = true;
validateNow();
};
}
public function get minHeight():Number{
return (0);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
public function getStyle(styleProp:String){
if (StyleManager.inheritingStyles[styleProp]){
return ((inheritingStyles) ? inheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
//unresolved jump
};
return ((nonInheritingStyles) ? nonInheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function setColor(color:uint):void{
explicitColor = color;
styleChangedFlag = true;
invalidateDisplayListFlag = true;
validateNow();
}
override public function replaceText(beginIndex:int, endIndex:int, newText:String):void{
super.replaceText(beginIndex, endIndex, newText);
dispatchEvent(new Event("textReplace"));
}
private function creatingSystemManager():ISystemManager{
return ((((!((moduleFactory == null))) && ((moduleFactory is ISystemManager)))) ? ISystemManager(moduleFactory) : systemManager);
}
public function set document(value:Object):void{
_document = value;
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
public function get explicitMinHeight():Number{
return (NaN);
}
public function get focusPane():Sprite{
return (null);
}
public function getTextStyles():TextFormat{
var textFormat:TextFormat = new TextFormat();
textFormat.align = getStyle("textAlign");
textFormat.bold = (getStyle("fontWeight") == "bold");
if (enabled){
if (explicitColor == StyleManager.NOT_A_COLOR){
textFormat.color = getStyle("color");
} else {
textFormat.color = explicitColor;
};
} else {
textFormat.color = getStyle("disabledColor");
};
textFormat.font = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
textFormat.indent = getStyle("textIndent");
textFormat.italic = (getStyle("fontStyle") == "italic");
textFormat.kerning = getStyle("kerning");
textFormat.leading = getStyle("leading");
textFormat.leftMargin = (ignorePadding) ? 0 : getStyle("paddingLeft");
textFormat.letterSpacing = getStyle("letterSpacing");
textFormat.rightMargin = (ignorePadding) ? 0 : getStyle("paddingRight");
textFormat.size = getStyle("fontSize");
textFormat.underline = (getStyle("textDecoration") == "underline");
cachedTextFormat = textFormat;
return (textFormat);
}
override public function set text(value:String):void{
if (!value){
value = "";
};
if (((!(isHTML)) && ((super.text == value)))){
return;
};
super.text = value;
explicitHTMLText = null;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function get showInAutomationHierarchy():Boolean{
return (true);
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get systemManager():ISystemManager{
var ui:IUIComponent;
var o:DisplayObject = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
return (ui.systemManager);
};
o = o.parent;
};
return (null);
}
public function setStyle(styleProp:String, value):void{
}
public function get percentWidth():Number{
return (NaN);
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get baselinePosition():Number{
var tlm:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
tlm = getLineMetrics(0);
return (((height - 4) - tlm.descent));
};
if (!parent){
return (NaN);
};
var isEmpty = (text == "");
if (isEmpty){
super.text = "Wj";
};
tlm = getLineMetrics(0);
if (isEmpty){
super.text = "";
};
return ((2 + tlm.ascent));
}
public function set enabled(value:Boolean):void{
mouseEnabled = value;
_enabled = value;
styleChanged("color");
}
public function get minWidth():Number{
return (0);
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([""]);
}
public function get tweeningProperties():Array{
return (null);
}
public function get measuredWidth():Number{
validateNow();
if (!stage){
return ((textWidth + TEXT_WIDTH_PADDING));
};
return (((textWidth * transform.concatenatedMatrix.d) + TEXT_WIDTH_PADDING));
}
public function set tweeningProperties(value:Array):void{
}
public function createAutomationIDPart(child:IAutomationObject):Object{
return (null);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
public function setActualSize(w:Number, h:Number):void{
if (width != w){
width = w;
};
if (height != h){
height = h;
};
}
public function get numAutomationChildren():int{
return (0);
}
public function set focusPane(value:Sprite):void{
}
public function getAutomationChildAt(index:int):IAutomationObject{
return (null);
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is SystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function get maxWidth():Number{
return (UIComponent.DEFAULT_MAX_WIDTH);
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function get initialized():Boolean{
return (_initialized);
}
public function invalidateDisplayList():void{
invalidateDisplayListFlag = true;
}
public function invalidateProperties():void{
}
override public function insertXMLText(beginIndex:int, endIndex:int, richText:String, pasting:Boolean=false):void{
super.insertXMLText(beginIndex, endIndex, richText, pasting);
dispatchEvent(new Event("textInsert"));
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
}
override public function set htmlText(value:String):void{
if (!value){
value = "";
};
if (((isHTML) && ((super.htmlText == value)))){
return;
};
if (((cachedTextFormat) && ((styleSheet == null)))){
defaultTextFormat = cachedTextFormat;
};
super.htmlText = value;
explicitHTMLText = value;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function set showInAutomationHierarchy(value:Boolean):void{
}
private function resourceManager_changeHandler(event:Event):void{
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
if (untruncatedText != null){
super.text = untruncatedText;
truncateToFit();
};
}
public function set measuredMinWidth(value:Number):void{
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
public function get explicitMinWidth():Number{
return (NaN);
}
public function set percentWidth(value:Number):void{
}
public function get imeMode():String{
return (_imeMode);
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
public function set systemManager(value:ISystemManager):void{
}
public function get explicitMaxWidth():Number{
return (NaN);
}
public function get document():Object{
return (_document);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
public function get enabled():Boolean{
return (_enabled);
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
public function get automationTabularData():Object{
return (null);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
public function get measuredMinWidth():Number{
return (0);
}
public function set isPopUp(value:Boolean):void{
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredHeight():Number{
validateNow();
if (!stage){
return ((textHeight + TEXT_HEIGHT_PADDING));
};
return (((textHeight * transform.concatenatedMatrix.a) + TEXT_HEIGHT_PADDING));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function setFocus():void{
systemManager.stage.focus = this;
}
public function initialize():void{
}
public function set percentHeight(value:Number):void{
}
public function resolveAutomationIDPart(criteria:Object):Array{
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getUITextFormat():UITextFormat{
validateNow();
var textFormat:UITextFormat = new UITextFormat(creatingSystemManager());
textFormat.moduleFactory = moduleFactory;
textFormat.copyFrom(getTextFormat());
textFormat.antiAliasType = antiAliasType;
textFormat.gridFitType = gridFitType;
textFormat.sharpness = sharpness;
textFormat.thickness = thickness;
return (textFormat);
}
private function changeHandler(event:Event):void{
explicitHTMLText = null;
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
public function get nonZeroTextHeight():Number{
var result:Number;
if (super.text == ""){
super.text = "Wj";
result = textHeight;
super.text = "";
return (result);
};
return (textHeight);
}
public function owns(child:DisplayObject):Boolean{
return ((child == this));
}
override public function setTextFormat(format:TextFormat, beginIndex:int=-1, endIndex:int=-1):void{
if (styleSheet){
return;
};
super.setTextFormat(format, beginIndex, endIndex);
dispatchEvent(new Event("textFormatChange"));
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function setVisible(visible:Boolean, noEvent:Boolean=false):void{
this.visible = visible;
}
public function get maxHeight():Number{
return (UIComponent.DEFAULT_MAX_HEIGHT);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
public function get isPopUp():Boolean{
return (false);
}
public function set ignorePadding(value:Boolean):void{
_ignorePadding = value;
styleChanged(null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (parent){
StyleProtoChain.initTextField(this);
styleChanged("styleName");
};
}
public function styleChanged(styleProp:String):void{
styleChangedFlag = true;
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (("callLater" in parent)){
Object(parent).callLater(validateNow);
};
};
}
public function get percentHeight():Number{
return (NaN);
}
private function get isHTML():Boolean{
return (!((explicitHTMLText == null)));
}
public function get explicitMaxHeight():Number{
return (NaN);
}
public function get styleName():Object{
return (_styleName);
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function validateNow():void{
var textFormat:TextFormat;
var embeddedFont:EmbeddedFont;
var fontModuleFactory:IFlexModuleFactory;
var sm:ISystemManager;
if (!parent){
return;
};
if (((!(isNaN(explicitWidth))) && (!((super.width == explicitWidth))))){
super.width = ((explicitWidth)>4) ? explicitWidth : 4;
};
if (((!(isNaN(explicitHeight))) && (!((super.height == explicitHeight))))){
super.height = explicitHeight;
};
if (styleChangedFlag){
textFormat = getTextStyles();
if (textFormat.font){
embeddedFont = getEmbeddedFont(textFormat.font, textFormat.bold, textFormat.italic);
fontModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
if (fontModuleFactory != null){
embedFonts = true;
} else {
sm = creatingSystemManager();
embedFonts = ((!((sm == null))) && (sm.isFontFaceEmbedded(textFormat)));
};
} else {
embedFonts = getStyle("embedFonts");
};
if (getStyle("fontAntiAliasType") != undefined){
antiAliasType = getStyle("fontAntiAliasType");
gridFitType = getStyle("fontGridFitType");
sharpness = getStyle("fontSharpness");
thickness = getStyle("fontThickness");
};
if (!styleSheet){
super.setTextFormat(textFormat);
defaultTextFormat = textFormat;
};
dispatchEvent(new Event("textFieldStyleChange"));
};
styleChangedFlag = false;
invalidateDisplayListFlag = false;
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
}
public function move(x:Number, y:Number):void{
if (this.x != x){
this.x = x;
};
if (this.y != y){
this.y = y;
};
}
public function get toolTip():String{
return (_toolTip);
}
public function get ignorePadding():Boolean{
return (_ignorePadding);
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
invalidateDisplayListFlag = true;
}
public function set measuredMinHeight(value:Number):void{
}
public function get measuredMinHeight():Number{
return (0);
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
_moduleFactory = factory;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
}
}//package mx.core
Section 185
//UITextFormat (mx.core.UITextFormat)
package mx.core {
import flash.text.*;
import mx.managers.*;
public class UITextFormat extends TextFormat {
private var systemManager:ISystemManager;
public var sharpness:Number;
public var gridFitType:String;
public var antiAliasType:String;
public var thickness:Number;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var _moduleFactory:IFlexModuleFactory;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
private static var _textFieldFactory:ITextFieldFactory;
public function UITextFormat(systemManager:ISystemManager, font:String=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null){
this.systemManager = systemManager;
super(font, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading);
}
public function set moduleFactory(value:IFlexModuleFactory):void{
_moduleFactory = value;
}
mx_internal function copyFrom(source:TextFormat):void{
font = source.font;
size = source.size;
color = source.color;
bold = source.bold;
italic = source.italic;
underline = source.underline;
url = source.url;
target = source.target;
align = source.align;
leftMargin = source.leftMargin;
rightMargin = source.rightMargin;
indent = source.indent;
leading = source.leading;
letterSpacing = source.letterSpacing;
blockIndent = source.blockIndent;
bullet = source.bullet;
display = source.display;
indent = source.indent;
kerning = source.kerning;
tabStops = source.tabStops;
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function measureText(text:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(text, false, roundUp));
}
private function measure(s:String, html:Boolean, roundUp:Boolean):TextLineMetrics{
if (!s){
s = "";
};
var embeddedFont:Boolean;
var fontModuleFactory:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(font, bold, italic), moduleFactory);
embeddedFont = !((fontModuleFactory == null));
if (fontModuleFactory == null){
fontModuleFactory = systemManager;
};
var measurementTextField:TextField;
measurementTextField = TextField(textFieldFactory.createTextField(fontModuleFactory));
if (html){
measurementTextField.htmlText = "";
} else {
measurementTextField.text = "";
};
measurementTextField.defaultTextFormat = this;
if (font){
measurementTextField.embedFonts = ((embeddedFont) || (((!((systemManager == null))) && (systemManager.isFontFaceEmbedded(this)))));
} else {
measurementTextField.embedFonts = false;
};
measurementTextField.antiAliasType = antiAliasType;
measurementTextField.gridFitType = gridFitType;
measurementTextField.sharpness = sharpness;
measurementTextField.thickness = thickness;
if (html){
measurementTextField.htmlText = s;
} else {
measurementTextField.text = s;
};
var lineMetrics:TextLineMetrics = measurementTextField.getLineMetrics(0);
if (indent != null){
lineMetrics.width = (lineMetrics.width + indent);
};
if (roundUp){
lineMetrics.width = Math.ceil(lineMetrics.width);
lineMetrics.height = Math.ceil(lineMetrics.height);
};
return (lineMetrics);
}
public function measureHTMLText(htmlText:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(htmlText, true, roundUp));
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
private static function get textFieldFactory():ITextFieldFactory{
if (!_textFieldFactory){
_textFieldFactory = ITextFieldFactory(Singleton.getInstance("mx.core::ITextFieldFactory"));
};
return (_textFieldFactory);
}
}
}//package mx.core
Section 186
//AddRemoveEffectTargetFilter (mx.effects.effectClasses.AddRemoveEffectTargetFilter)
package mx.effects.effectClasses {
import mx.effects.*;
public class AddRemoveEffectTargetFilter extends EffectTargetFilter {
public var add:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function AddRemoveEffectTargetFilter(){
super();
filterProperties = ["parent"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
if (add){
return ((((props.start["parent"] == null)) && (!((props.end["parent"] == null)))));
};
return (((!((props.start["parent"] == null))) && ((props.end["parent"] == null))));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 187
//HideShowEffectTargetFilter (mx.effects.effectClasses.HideShowEffectTargetFilter)
package mx.effects.effectClasses {
import mx.effects.*;
public class HideShowEffectTargetFilter extends EffectTargetFilter {
public var show:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function HideShowEffectTargetFilter(){
super();
filterProperties = ["visible"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
return ((props.end["visible"] == show));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 188
//PropertyChanges (mx.effects.effectClasses.PropertyChanges)
package mx.effects.effectClasses {
public class PropertyChanges {
public var target:Object;
public var start:Object;
public var end:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function PropertyChanges(target:Object){
end = {};
start = {};
super();
this.target = target;
}
}
}//package mx.effects.effectClasses
Section 189
//TweenEffectInstance (mx.effects.effectClasses.TweenEffectInstance)
package mx.effects.effectClasses {
import mx.core.*;
import mx.events.*;
import mx.effects.*;
public class TweenEffectInstance extends EffectInstance {
private var _seekTime:Number;// = 0
public var easingFunction:Function;
public var tween:Tween;
mx_internal var needToLayout:Boolean;// = false
mx_internal static const VERSION:String = "3.2.0.3958";
public function TweenEffectInstance(target:Object){
super(target);
}
override public function stop():void{
super.stop();
if (tween){
tween.stop();
};
}
mx_internal function applyTweenStartValues():void{
if (duration > 0){
onTweenUpdate(tween.getCurrentValue(0));
};
}
override public function get playheadTime():Number{
if (tween){
return ((tween.playheadTime + super.playheadTime));
};
return (0);
}
protected function createTween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1):Tween{
var newTween:Tween = new Tween(listener, startValue, endValue, duration, minFps);
newTween.addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
if (easingFunction != null){
newTween.easingFunction = easingFunction;
};
if (_seekTime > 0){
newTween.seek(_seekTime);
};
newTween.playReversed = playReversed;
return (newTween);
}
private function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override public function end():void{
stopRepeat = true;
if (delayTimer){
delayTimer.reset();
};
if (tween){
tween.endTween();
tween = null;
};
}
override public function reverse():void{
super.reverse();
if (tween){
tween.reverse();
};
super.playReversed = !(playReversed);
}
override mx_internal function set playReversed(value:Boolean):void{
super.playReversed = value;
if (tween){
tween.playReversed = value;
};
}
override public function resume():void{
super.resume();
if (tween){
tween.resume();
};
}
public function onTweenEnd(value:Object):void{
onTweenUpdate(value);
tween = null;
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
finishRepeat();
}
public function onTweenUpdate(value:Object):void{
}
override public function pause():void{
super.pause();
if (tween){
tween.pause();
};
}
public function seek(playheadTime:Number):void{
if (tween){
tween.seek(playheadTime);
} else {
_seekTime = playheadTime;
};
}
}
}//package mx.effects.effectClasses
Section 190
//ZoomInstance (mx.effects.effectClasses.ZoomInstance)
package mx.effects.effectClasses {
import flash.events.*;
import mx.events.*;
import mx.effects.*;
public class ZoomInstance extends TweenEffectInstance {
private var newY:Number;
public var originY:Number;
private var origX:Number;
private var origY:Number;
public var originX:Number;
private var origPercentHeight:Number;
public var zoomWidthFrom:Number;
public var zoomWidthTo:Number;
private var newX:Number;
public var captureRollEvents:Boolean;
private var origPercentWidth:Number;
public var zoomHeightFrom:Number;
private var origScaleX:Number;
public var zoomHeightTo:Number;
private var origScaleY:Number;
private var scaledOriginX:Number;
private var scaledOriginY:Number;
private var show:Boolean;// = true
private var _mouseHasMoved:Boolean;// = false
mx_internal static const VERSION:String = "3.2.0.3958";
public function ZoomInstance(target:Object){
super(target);
}
override public function finishEffect():void{
if (captureRollEvents){
target.removeEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.removeEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.removeEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
super.finishEffect();
}
private function getScaleFromWidth(value:Number):Number{
return ((value / (target.width / Math.abs(target.scaleX))));
}
override public function initEffect(event:Event):void{
super.initEffect(event);
if ((((event.type == FlexEvent.HIDE)) || ((event.type == Event.REMOVED)))){
show = false;
};
}
private function getScaleFromHeight(value:Number):Number{
return ((value / (target.height / Math.abs(target.scaleY))));
}
private function applyPropertyChanges():void{
var useSize:Boolean;
var useScale:Boolean;
var values:PropertyChanges = propertyChanges;
if (values){
useSize = false;
useScale = false;
if (values.end["scaleX"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? target.scaleX : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? values.end["scaleX"] : zoomWidthTo;
useScale = true;
};
if (values.end["scaleY"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? target.scaleY : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? values.end["scaleY"] : zoomHeightTo;
useScale = true;
};
if (useScale){
return;
};
if (values.end["width"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? getScaleFromWidth(target.width) : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? getScaleFromWidth(values.end["width"]) : zoomWidthTo;
useSize = true;
};
if (values.end["height"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? getScaleFromHeight(target.height) : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? getScaleFromHeight(values.end["height"]) : zoomHeightTo;
useSize = true;
};
if (useSize){
return;
};
if (values.end["visible"] !== undefined){
show = values.end["visible"];
};
};
}
private function mouseEventHandler(event:MouseEvent):void{
if (event.type == MouseEvent.MOUSE_MOVE){
_mouseHasMoved = true;
} else {
if ((((event.type == MouseEvent.ROLL_OUT)) || ((event.type == MouseEvent.ROLL_OVER)))){
if (!_mouseHasMoved){
event.stopImmediatePropagation();
};
_mouseHasMoved = false;
};
};
}
override public function play():void{
super.play();
applyPropertyChanges();
if (((((((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))) && (isNaN(zoomHeightFrom)))) && (isNaN(zoomHeightTo)))){
if (show){
zoomWidthFrom = (zoomHeightFrom = 0);
zoomWidthTo = target.scaleX;
zoomHeightTo = target.scaleY;
} else {
zoomWidthFrom = target.scaleX;
zoomHeightFrom = target.scaleY;
zoomWidthTo = (zoomHeightTo = 0);
};
} else {
if (((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))){
zoomWidthFrom = (zoomWidthTo = target.scaleX);
} else {
if (((isNaN(zoomHeightFrom)) && (isNaN(zoomHeightTo)))){
zoomHeightFrom = (zoomHeightTo = target.scaleY);
};
};
if (isNaN(zoomWidthFrom)){
zoomWidthFrom = target.scaleX;
} else {
if (isNaN(zoomWidthTo)){
zoomWidthTo = ((zoomWidthFrom)==1) ? 0 : 1;
};
};
if (isNaN(zoomHeightFrom)){
zoomHeightFrom = target.scaleY;
} else {
if (isNaN(zoomHeightTo)){
zoomHeightTo = ((zoomHeightFrom)==1) ? 0 : 1;
};
};
};
if (zoomWidthFrom < 0.01){
zoomWidthFrom = 0.01;
};
if (zoomWidthTo < 0.01){
zoomWidthTo = 0.01;
};
if (zoomHeightFrom < 0.01){
zoomHeightFrom = 0.01;
};
if (zoomHeightTo < 0.01){
zoomHeightTo = 0.01;
};
origScaleX = target.scaleX;
origScaleY = target.scaleY;
newX = (origX = target.x);
newY = (origY = target.y);
if (isNaN(originX)){
scaledOriginX = (target.width / 2);
} else {
scaledOriginX = (originX * origScaleX);
};
if (isNaN(originY)){
scaledOriginY = (target.height / 2);
} else {
scaledOriginY = (originY * origScaleY);
};
scaledOriginX = Number(scaledOriginX.toFixed(1));
scaledOriginY = Number(scaledOriginY.toFixed(1));
origPercentWidth = target.percentWidth;
if (!isNaN(origPercentWidth)){
target.width = target.width;
};
origPercentHeight = target.percentHeight;
if (!isNaN(origPercentHeight)){
target.height = target.height;
};
tween = createTween(this, [zoomWidthFrom, zoomHeightFrom], [zoomWidthTo, zoomHeightTo], duration);
if (captureRollEvents){
target.addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.addEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
}
override public function onTweenEnd(value:Object):void{
var curWidth:Number;
var curHeight:Number;
if (!isNaN(origPercentWidth)){
curWidth = target.width;
target.percentWidth = origPercentWidth;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._width = curWidth;
};
};
if (!isNaN(origPercentHeight)){
curHeight = target.height;
target.percentHeight = origPercentHeight;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._height = curHeight;
};
};
super.onTweenEnd(value);
if (hideOnEffectEnd){
EffectManager.suspendEventHandling();
target.scaleX = origScaleX;
target.scaleY = origScaleY;
target.move(origX, origY);
EffectManager.resumeEventHandling();
};
}
override public function onTweenUpdate(value:Object):void{
EffectManager.suspendEventHandling();
if (Math.abs((newX - target.x)) > 0.1){
origX = (origX + (Number(target.x.toFixed(1)) - newX));
};
if (Math.abs((newY - target.y)) > 0.1){
origY = (origY + (Number(target.y.toFixed(1)) - newY));
};
target.scaleX = value[0];
target.scaleY = value[1];
var ratioX:Number = (value[0] / origScaleX);
var ratioY:Number = (value[1] / origScaleY);
var newOriginX:Number = (scaledOriginX * ratioX);
var newOriginY:Number = (scaledOriginY * ratioY);
newX = ((scaledOriginX - newOriginX) + origX);
newY = ((scaledOriginY - newOriginY) + origY);
newX = Number(newX.toFixed(1));
newY = Number(newY.toFixed(1));
target.move(newX, newY);
if (tween){
tween.needToLayout = true;
} else {
needToLayout = true;
};
EffectManager.resumeEventHandling();
}
}
}//package mx.effects.effectClasses
Section 191
//Effect (mx.effects.Effect)
package mx.effects {
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.effects.effectClasses.*;
import flash.utils.*;
public class Effect extends EventDispatcher implements IEffect {
private var _perElementOffset:Number;// = 0
private var _hideFocusRing:Boolean;// = false
private var _customFilter:EffectTargetFilter;
public var repeatCount:int;// = 1
public var suspendBackgroundProcessing:Boolean;// = false
public var startDelay:int;// = 0
private var _relevantProperties:Array;
private var _callValidateNow:Boolean;// = false
mx_internal var applyActualDimensions:Boolean;// = true
private var _filter:String;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var durationExplicitlySet:Boolean;// = false
public var repeatDelay:int;// = 0
private var _targets:Array;
mx_internal var propertyChangesArray:Array;
mx_internal var filterObject:EffectTargetFilter;
protected var endValuesCaptured:Boolean;// = false
public var instanceClass:Class;
private var _duration:Number;// = 500
private var isPaused:Boolean;// = false
private var _relevantStyles:Array;
private var _instances:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Effect(target:Object=null){
_instances = [];
instanceClass = IEffectInstance;
_relevantStyles = [];
_targets = [];
super();
this.target = target;
}
public function get targets():Array{
return (_targets);
}
public function set targets(value:Array):void{
var n:int = value.length;
var i:int = (n - 1);
while (i > 0) {
if (value[i] == null){
value.splice(i, 1);
};
i--;
};
_targets = value;
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
var instance:IEffectInstance;
var n:int = _instances.length;
var i:int = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.stop();
};
i--;
};
}
public function captureStartValues():void{
var n:int;
var i:int;
if (targets.length > 0){
propertyChangesArray = [];
_callValidateNow = true;
n = targets.length;
i = 0;
while (i < n) {
propertyChangesArray.push(new PropertyChanges(targets[i]));
i++;
};
propertyChangesArray = captureValues(propertyChangesArray, true);
};
endValuesCaptured = false;
}
mx_internal function captureValues(propChanges:Array, setStartValues:Boolean):Array{
var valueMap:Object;
var target:Object;
var n:int;
var i:int;
var m:int;
var j:int;
var effectProps:Array = (filterObject) ? mergeArrays(relevantProperties, filterObject.filterProperties) : relevantProperties;
if (((effectProps) && ((effectProps.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = effectProps.length;
j = 0;
while (j < m) {
valueMap[effectProps[j]] = getValueFromTarget(target, effectProps[j]);
j++;
};
i++;
};
};
var styles:Array = (filterObject) ? mergeArrays(relevantStyles, filterObject.filterStyles) : relevantStyles;
if (((styles) && ((styles.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = styles.length;
j = 0;
while (j < m) {
valueMap[styles[j]] = target.getStyle(styles[j]);
j++;
};
i++;
};
};
return (propChanges);
}
protected function getValueFromTarget(target:Object, property:String){
if ((property in target)){
return (target[property]);
};
return (undefined);
}
public function set target(value:Object):void{
_targets.splice(0);
if (value){
_targets[0] = value;
};
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set perElementOffset(value:Number):void{
_perElementOffset = value;
}
public function resume():void{
var n:int;
var i:int;
if (((isPlaying) && (isPaused))){
isPaused = false;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).resume();
i++;
};
};
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
public function play(targets:Array=null, playReversedFromEnd:Boolean=false):Array{
var newInstance:IEffectInstance;
if ((((targets == null)) && (!((propertyChangesArray == null))))){
if (_callValidateNow){
LayoutManager.getInstance().validateNow();
};
if (!endValuesCaptured){
propertyChangesArray = captureValues(propertyChangesArray, false);
};
propertyChangesArray = stripUnchangedValues(propertyChangesArray);
applyStartValues(propertyChangesArray, this.targets);
};
var newInstances:Array = createInstances(targets);
var n:int = newInstances.length;
var i:int;
while (i < n) {
newInstance = IEffectInstance(newInstances[i]);
Object(newInstance).playReversed = playReversedFromEnd;
newInstance.startEffect();
i++;
};
return (newInstances);
}
public function captureEndValues():void{
propertyChangesArray = captureValues(propertyChangesArray, false);
endValuesCaptured = true;
}
protected function filterInstance(propChanges:Array, target:Object):Boolean{
if (filterObject){
return (filterObject.filterInstance(propChanges, effectTargetHost, target));
};
return (true);
}
public function get customFilter():EffectTargetFilter{
return (_customFilter);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set relevantProperties(value:Array):void{
_relevantProperties = value;
}
public function captureMoreStartValues(targets:Array):void{
var additionalPropertyChangesArray:Array;
var i:int;
if (targets.length > 0){
additionalPropertyChangesArray = [];
i = 0;
while (i < targets.length) {
additionalPropertyChangesArray.push(new PropertyChanges(targets[i]));
i++;
};
additionalPropertyChangesArray = captureValues(additionalPropertyChangesArray, true);
propertyChangesArray = propertyChangesArray.concat(additionalPropertyChangesArray);
};
}
public function deleteInstance(instance:IEffectInstance):void{
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
var n:int = _instances.length;
var i:int;
while (i < n) {
if (_instances[i] === instance){
_instances.splice(i, 1);
};
i++;
};
}
public function get filter():String{
return (_filter);
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function get target():Object{
if (_targets.length > 0){
return (_targets[0]);
};
return (null);
}
public function get duration():Number{
return (_duration);
}
public function set customFilter(value:EffectTargetFilter):void{
_customFilter = value;
filterObject = value;
}
public function get perElementOffset():Number{
return (_perElementOffset);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get isPlaying():Boolean{
return (((_instances) && ((_instances.length > 0))));
}
protected function effectEndHandler(event:EffectEvent):void{
var instance:IEffectInstance = IEffectInstance(event.effectInstance);
deleteInstance(instance);
dispatchEvent(event);
}
public function get relevantProperties():Array{
if (_relevantProperties){
return (_relevantProperties);
};
return (getAffectedProperties());
}
public function createInstance(target:Object=null):IEffectInstance{
var n:int;
var i:int;
if (!target){
target = this.target;
};
var newInstance:IEffectInstance;
var props:PropertyChanges;
var create:Boolean;
var setPropsArray:Boolean;
if (propertyChangesArray){
setPropsArray = true;
create = filterInstance(propertyChangesArray, target);
};
if (create){
newInstance = IEffectInstance(new instanceClass(target));
initInstance(newInstance);
if (setPropsArray){
n = propertyChangesArray.length;
i = 0;
while (i < n) {
if (propertyChangesArray[i].target == target){
newInstance.propertyChanges = propertyChangesArray[i];
};
i++;
};
};
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
_instances.push(newInstance);
if (triggerEvent){
newInstance.initEffect(triggerEvent);
};
};
return (newInstance);
}
protected function effectStartHandler(event:EffectEvent):void{
dispatchEvent(event);
}
public function getAffectedProperties():Array{
return ([]);
}
public function set relevantStyles(value:Array):void{
_relevantStyles = value;
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
protected function applyValueToTarget(target:Object, property:String, value, props:Object):void{
var target = target;
var property = property;
var value = value;
var props = props;
if ((property in target)){
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "height")))){
target.setActualSize(target.width, value);
} else {
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "width")))){
target.setActualSize(value, target.height);
} else {
target[property] = value;
};
};
//unresolved jump
var _slot1 = e;
};
}
protected function initInstance(instance:IEffectInstance):void{
instance.duration = duration;
Object(instance).durationExplicitlySet = durationExplicitlySet;
instance.effect = this;
instance.effectTargetHost = effectTargetHost;
instance.hideFocusRing = hideFocusRing;
instance.repeatCount = repeatCount;
instance.repeatDelay = repeatDelay;
instance.startDelay = startDelay;
instance.suspendBackgroundProcessing = suspendBackgroundProcessing;
}
mx_internal function applyStartValues(propChanges:Array, targets:Array):void{
var m:int;
var j:int;
var target:Object;
var apply:Boolean;
var effectProps:Array = relevantProperties;
var n:int = propChanges.length;
var i:int;
while (i < n) {
target = propChanges[i].target;
apply = false;
m = targets.length;
j = 0;
while (j < m) {
if (targets[j] == target){
apply = filterInstance(propChanges, target);
break;
};
j++;
};
if (apply){
m = effectProps.length;
j = 0;
while (j < m) {
if ((((effectProps[j] in propChanges[i].start)) && ((effectProps[j] in target)))){
applyValueToTarget(target, effectProps[j], propChanges[i].start[effectProps[j]], propChanges[i].start);
};
j++;
};
m = relevantStyles.length;
j = 0;
while (j < m) {
if ((relevantStyles[j] in propChanges[i].start)){
target.setStyle(relevantStyles[j], propChanges[i].start[relevantStyles[j]]);
};
j++;
};
};
i++;
};
}
public function end(effectInstance:IEffectInstance=null):void{
var n:int;
var i:int;
var instance:IEffectInstance;
if (effectInstance){
effectInstance.end();
} else {
n = _instances.length;
i = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.end();
};
i--;
};
};
}
public function get relevantStyles():Array{
return (_relevantStyles);
}
public function createInstances(targets:Array=null):Array{
var newInstance:IEffectInstance;
if (!targets){
targets = this.targets;
};
var newInstances:Array = [];
var n:int = targets.length;
var offsetDelay:Number = 0;
var i:int;
while (i < n) {
newInstance = createInstance(targets[i]);
if (newInstance){
newInstance.startDelay = (newInstance.startDelay + offsetDelay);
offsetDelay = (offsetDelay + perElementOffset);
newInstances.push(newInstance);
};
i++;
};
triggerEvent = null;
return (newInstances);
}
public function pause():void{
var n:int;
var i:int;
if (((isPlaying) && (!(isPaused)))){
isPaused = true;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).pause();
i++;
};
};
}
public function set filter(value:String):void{
if (!customFilter){
_filter = value;
switch (value){
case "add":
case "remove":
filterObject = new AddRemoveEffectTargetFilter();
AddRemoveEffectTargetFilter(filterObject).add = (value == "add");
break;
case "hide":
case "show":
filterObject = new HideShowEffectTargetFilter();
HideShowEffectTargetFilter(filterObject).show = (value == "show");
break;
case "move":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["x", "y"];
break;
case "resize":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["width", "height"];
break;
case "addItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {added:true};
break;
case "removeItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {removed:true};
break;
case "replacedItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replaced:true};
break;
case "replacementItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replacement:true};
break;
default:
filterObject = null;
break;
};
};
}
public function reverse():void{
var n:int;
var i:int;
if (isPlaying){
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).reverse();
i++;
};
};
}
private static function mergeArrays(a1:Array, a2:Array):Array{
var i2:int;
var addIt:Boolean;
var i1:int;
if (a2){
i2 = 0;
while (i2 < a2.length) {
addIt = true;
i1 = 0;
while (i1 < a1.length) {
if (a1[i1] == a2[i2]){
addIt = false;
break;
};
i1++;
};
if (addIt){
a1.push(a2[i2]);
};
i2++;
};
};
return (a1);
}
private static function stripUnchangedValues(propChanges:Array):Array{
var prop:Object;
var i:int;
while (i < propChanges.length) {
for (prop in propChanges[i].start) {
if ((((propChanges[i].start[prop] == propChanges[i].end[prop])) || ((((((((typeof(propChanges[i].start[prop]) == "number")) && ((typeof(propChanges[i].end[prop]) == "number")))) && (isNaN(propChanges[i].start[prop])))) && (isNaN(propChanges[i].end[prop])))))){
delete propChanges[i].start[prop];
delete propChanges[i].end[prop];
};
};
i++;
};
return (propChanges);
}
}
}//package mx.effects
Section 192
//EffectInstance (mx.effects.EffectInstance)
package mx.effects {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.effects.effectClasses.*;
import flash.utils.*;
public class EffectInstance extends EventDispatcher implements IEffectInstance {
private var _hideFocusRing:Boolean;
private var delayStartTime:Number;// = 0
mx_internal var stopRepeat:Boolean;// = false
private var playCount:int;// = 0
private var _repeatCount:int;// = 0
private var _suspendBackgroundProcessing:Boolean;// = false
mx_internal var delayTimer:Timer;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var parentCompositeEffectInstance:EffectInstance;
mx_internal var durationExplicitlySet:Boolean;// = false
private var _effect:IEffect;
private var _target:Object;
mx_internal var hideOnEffectEnd:Boolean;// = false
private var _startDelay:int;// = 0
private var delayElapsedTime:Number;// = 0
private var _repeatDelay:int;// = 0
private var _propertyChanges:PropertyChanges;
private var _duration:Number;// = 500
private var _playReversed:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EffectInstance(target:Object){
super();
this.target = target;
}
public function get playheadTime():Number{
return ((((Math.max((playCount - 1), 0) * duration) + (Math.max((playCount - 2), 0) * repeatDelay)) + (playReversed) ? 0 : startDelay));
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function finishEffect():void{
playCount = 0;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
};
if ((target is UIComponent)){
UIComponent(target).effectFinished(this);
};
EffectManager.effectFinished(this);
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function finishRepeat():void{
if (((((!(stopRepeat)) && (!((playCount == 0))))) && ((((playCount < repeatCount)) || ((repeatCount == 0)))))){
if (repeatDelay > 0){
delayTimer = new Timer(repeatDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
} else {
finishEffect();
};
}
mx_internal function get playReversed():Boolean{
return (_playReversed);
}
public function set effect(value:IEffect):void{
_effect = value;
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
mx_internal function set playReversed(value:Boolean):void{
_playReversed = value;
}
public function resume():void{
if (((((delayTimer) && (!(delayTimer.running)))) && (!(isNaN(delayElapsedTime))))){
delayTimer.delay = (playReversed) ? delayElapsedTime : (delayTimer.delay - delayElapsedTime);
delayTimer.start();
};
}
public function get propertyChanges():PropertyChanges{
return (_propertyChanges);
}
public function set target(value:Object):void{
_target = value;
}
public function get repeatCount():int{
return (_repeatCount);
}
mx_internal function playWithNoDuration():void{
duration = 0;
repeatCount = 1;
repeatDelay = 0;
startDelay = 0;
startEffect();
}
public function get startDelay():int{
return (_startDelay);
}
mx_internal function get actualDuration():Number{
var value:Number = NaN;
if (repeatCount > 0){
value = (((duration * repeatCount) + ((repeatDelay * repeatCount) - 1)) + startDelay);
};
return (value);
}
public function play():void{
playCount++;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
};
}
public function get suspendBackgroundProcessing():Boolean{
return (_suspendBackgroundProcessing);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set repeatDelay(value:int):void{
_repeatDelay = value;
}
public function set propertyChanges(value:PropertyChanges):void{
_propertyChanges = value;
}
mx_internal function eventHandler(event:Event):void{
if ((((event.type == FlexEvent.SHOW)) && ((hideOnEffectEnd == true)))){
hideOnEffectEnd = false;
event.target.removeEventListener(FlexEvent.SHOW, eventHandler);
};
}
public function set repeatCount(value:int):void{
_repeatCount = value;
}
private function delayTimerHandler(event:TimerEvent):void{
delayTimer.reset();
delayStartTime = NaN;
delayElapsedTime = NaN;
play();
}
public function set suspendBackgroundProcessing(value:Boolean):void{
_suspendBackgroundProcessing = value;
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function set startDelay(value:int):void{
_startDelay = value;
}
public function get effect():IEffect{
return (_effect);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get target():Object{
return (_target);
}
public function startEffect():void{
EffectManager.effectStarted(this);
if ((target is UIComponent)){
UIComponent(target).effectStarted(this);
};
if ((((startDelay > 0)) && (!(playReversed)))){
delayTimer = new Timer(startDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
}
public function get repeatDelay():int{
return (_repeatDelay);
}
public function get duration():Number{
if (((!(durationExplicitlySet)) && (parentCompositeEffectInstance))){
return (parentCompositeEffectInstance.duration);
};
return (_duration);
}
public function initEffect(event:Event):void{
triggerEvent = event;
switch (event.type){
case "resizeStart":
case "resizeEnd":
if (!durationExplicitlySet){
duration = 250;
};
break;
case FlexEvent.HIDE:
target.setVisible(true, true);
hideOnEffectEnd = true;
target.addEventListener(FlexEvent.SHOW, eventHandler);
break;
};
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
public function end():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function reverse():void{
if (repeatCount > 0){
playCount = ((repeatCount - playCount) + 1);
};
}
public function pause():void{
if (((((delayTimer) && (delayTimer.running))) && (!(isNaN(delayStartTime))))){
delayTimer.stop();
delayElapsedTime = (getTimer() - delayStartTime);
};
}
}
}//package mx.effects
Section 193
//EffectManager (mx.effects.EffectManager)
package mx.effects {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.resources.*;
import flash.utils.*;
public class EffectManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _resourceManager:IResourceManager;
private static var effects:Dictionary = new Dictionary(true);
mx_internal static var effectsPlaying:Array = [];
private static var targetsInfo:Array = [];
private static var effectTriggersForEvent:Object = {};
mx_internal static var lastEffectCreated:Effect;
private static var eventHandlingSuspendCount:Number = 0;
private static var eventsForEffectTriggers:Object = {};
public function EffectManager(){
super();
}
public static function suspendEventHandling():void{
eventHandlingSuspendCount++;
}
mx_internal static function registerEffectTrigger(name:String, event:String):void{
var strLen:Number;
if (name != ""){
if (event == ""){
strLen = name.length;
if ((((strLen > 6)) && ((name.substring((strLen - 6)) == "Effect")))){
event = name.substring(0, (strLen - 6));
};
};
if (event != ""){
effectTriggersForEvent[event] = name;
eventsForEffectTriggers[name] = event;
};
};
}
private static function removedEffectHandler(target:DisplayObject, parent:DisplayObjectContainer, index:int, eventObj:Event):void{
suspendEventHandling();
parent.addChildAt(target, index);
resumeEventHandling();
createAndPlayEffect(eventObj, target);
}
private static function createAndPlayEffect(eventObj:Event, target:Object):void{
var n:int;
var i:int;
var m:int;
var j:int;
var message:String;
var type:String;
var tweeningProperties:Array;
var effectProperties:Array;
var affectedProps:Array;
var runningInstances:Array;
var otherInst:EffectInstance;
var effectInst:Effect = createEffectForType(target, eventObj.type);
if (!effectInst){
return;
};
if ((((effectInst is Zoom)) && ((eventObj.type == MoveEvent.MOVE)))){
message = resourceManager.getString("effects", "incorrectTrigger");
throw (new Error(message));
};
if (target.initialized == false){
type = eventObj.type;
if ((((((((((type == MoveEvent.MOVE)) || ((type == ResizeEvent.RESIZE)))) || ((type == FlexEvent.SHOW)))) || ((type == FlexEvent.HIDE)))) || ((type == Event.CHANGE)))){
effectInst = null;
return;
};
};
if ((effectInst.target is IUIComponent)){
tweeningProperties = IUIComponent(effectInst.target).tweeningProperties;
if (((tweeningProperties) && ((tweeningProperties.length > 0)))){
effectProperties = effectInst.getAffectedProperties();
n = tweeningProperties.length;
m = effectProperties.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (tweeningProperties[i] == effectProperties[j]){
effectInst = null;
return;
};
j++;
};
i++;
};
};
};
if ((((effectInst.target is UIComponent)) && (UIComponent(effectInst.target).isEffectStarted))){
affectedProps = effectInst.getAffectedProperties();
i = 0;
while (i < affectedProps.length) {
runningInstances = effectInst.target.getEffectsForProperty(affectedProps[i]);
if (runningInstances.length > 0){
if (eventObj.type == ResizeEvent.RESIZE){
return;
};
j = 0;
while (j < runningInstances.length) {
otherInst = runningInstances[j];
if ((((eventObj.type == FlexEvent.SHOW)) && (otherInst.hideOnEffectEnd))){
otherInst.target.removeEventListener(FlexEvent.SHOW, otherInst.eventHandler);
otherInst.hideOnEffectEnd = false;
};
otherInst.end();
j++;
};
};
i++;
};
};
effectInst.triggerEvent = eventObj;
effectInst.addEventListener(EffectEvent.EFFECT_END, EffectManager.effectEndHandler);
lastEffectCreated = effectInst;
var instances:Array = effectInst.play();
n = instances.length;
i = 0;
while (i < n) {
effectsPlaying.push(new EffectNode(effectInst, instances[i]));
i++;
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.suspendBackgroundProcessing();
};
}
public static function endEffectsForTarget(target:IUIComponent):void{
var otherInst:EffectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
otherInst = effectsPlaying[i].instance;
if (otherInst.target == target){
otherInst.end();
};
i--;
};
}
private static function cacheOrUncacheTargetAsBitmap(target:IUIComponent, effectStart:Boolean=true, bitmapEffect:Boolean=true):void{
var n:int;
var i:int;
var info:Object;
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
info = targetsInfo[i];
break;
};
i++;
};
if (!info){
info = {target:target, bitmapEffectsCount:0, vectorEffectsCount:0};
targetsInfo.push(info);
};
if (effectStart){
if (bitmapEffect){
info.bitmapEffectsCount++;
if ((((info.vectorEffectsCount == 0)) && ((target is IDeferredInstantiationUIComponent)))){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
} else {
if ((((((info.vectorEffectsCount++ == 0)) && ((target is IDeferredInstantiationUIComponent)))) && ((IDeferredInstantiationUIComponent(target).cachePolicy == UIComponentCachePolicy.AUTO)))){
target.cacheAsBitmap = false;
};
};
} else {
if (bitmapEffect){
if (info.bitmapEffectsCount != 0){
info.bitmapEffectsCount--;
};
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = false;
};
} else {
if (info.vectorEffectsCount != 0){
if ((((--info.vectorEffectsCount == 0)) && (!((info.bitmapEffectsCount == 0))))){
n = info.bitmapEffectsCount;
i = 0;
while (i < n) {
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
i++;
};
};
};
};
if ((((info.bitmapEffectsCount == 0)) && ((info.vectorEffectsCount == 0)))){
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
targetsInfo.splice(i, 1);
break;
};
i++;
};
};
};
}
mx_internal static function eventHandler(eventObj:Event):void{
var focusEventObj:FocusEvent;
var targ:DisplayObject;
var i:int;
var parent:DisplayObjectContainer;
var index:int;
if (!(eventObj.currentTarget is IFlexDisplayObject)){
return;
};
if (eventHandlingSuspendCount > 0){
return;
};
if ((((eventObj is FocusEvent)) && ((((eventObj.type == FocusEvent.FOCUS_OUT)) || ((eventObj.type == FocusEvent.FOCUS_IN)))))){
focusEventObj = FocusEvent(eventObj);
if (((focusEventObj.relatedObject) && (((focusEventObj.currentTarget.contains(focusEventObj.relatedObject)) || ((focusEventObj.currentTarget == focusEventObj.relatedObject)))))){
return;
};
};
if ((((((eventObj.type == Event.ADDED)) || ((eventObj.type == Event.REMOVED)))) && (!((eventObj.target == eventObj.currentTarget))))){
return;
};
if (eventObj.type == Event.REMOVED){
if ((eventObj.target is UIComponent)){
if (UIComponent(eventObj.target).initialized == false){
return;
};
if (UIComponent(eventObj.target).isEffectStarted){
i = 0;
while (i < UIComponent(eventObj.target)._effectsStarted.length) {
if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == Event.REMOVED){
return;
};
i++;
};
};
};
targ = (eventObj.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
index = parent.getChildIndex(targ);
if (index >= 0){
if ((targ is UIComponent)){
UIComponent(targ).callLater(removedEffectHandler, [targ, parent, index, eventObj]);
};
};
};
};
} else {
createAndPlayEffect(eventObj, eventObj.currentTarget);
};
}
mx_internal static function endBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, true);
}
private static function animateSameProperty(a:Effect, b:Effect, c:EffectInstance):Boolean{
var aProps:Array;
var bProps:Array;
var n:int;
var m:int;
var i:int;
var j:int;
if (a.target == c.target){
aProps = a.getAffectedProperties();
bProps = b.getAffectedProperties();
n = aProps.length;
m = bProps.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (aProps[i] == bProps[j]){
return (true);
};
j++;
};
i++;
};
};
return (false);
}
mx_internal static function effectFinished(effect:EffectInstance):void{
delete effects[effect];
}
mx_internal static function effectsInEffect():Boolean{
var i:*;
for (i in effects) {
return (true);
};
return (false);
}
mx_internal static function effectEndHandler(event:EffectEvent):void{
var targ:DisplayObject;
var parent:DisplayObjectContainer;
var effectInst:IEffectInstance = event.effectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
if (effectsPlaying[i].instance == effectInst){
effectsPlaying.splice(i, 1);
break;
};
i--;
};
if (Object(effectInst).hideOnEffectEnd == true){
effectInst.target.removeEventListener(FlexEvent.SHOW, Object(effectInst).eventHandler);
effectInst.target.setVisible(false, true);
};
if (((effectInst.triggerEvent) && ((effectInst.triggerEvent.type == Event.REMOVED)))){
targ = (effectInst.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
suspendEventHandling();
parent.removeChild(targ);
resumeEventHandling();
};
};
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.resumeBackgroundProcessing();
};
}
mx_internal static function startBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, true);
}
mx_internal static function setStyle(styleProp:String, target):void{
var eventName:String = eventsForEffectTriggers[styleProp];
if (((!((eventName == null))) && (!((eventName == ""))))){
target.addEventListener(eventName, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
}
mx_internal static function getEventForEffectTrigger(effectTrigger:String):String{
var effectTrigger = effectTrigger;
if (eventsForEffectTriggers){
return (eventsForEffectTriggers[effectTrigger]);
//unresolved jump
var _slot1 = e;
return ("");
};
return ("");
}
mx_internal static function createEffectForType(target:Object, type:String):Effect{
var cls:Class;
var effectObj:Effect;
var doc:Object;
var target = target;
var type = type;
var trigger:String = effectTriggersForEvent[type];
if (trigger == ""){
trigger = (type + "Effect");
};
var value:Object = target.getStyle(trigger);
if (!value){
return (null);
};
if ((value is Class)){
cls = Class(value);
return (new cls(target));
};
if ((value is String)){
doc = target.parentDocument;
if (!doc){
doc = ApplicationGlobals.application;
};
effectObj = doc[value];
} else {
if ((value is Effect)){
effectObj = Effect(value);
};
};
if (effectObj){
effectObj.target = target;
return (effectObj);
};
//unresolved jump
var _slot1 = e;
var effectClass:Class = Class(target.systemManager.getDefinitionByName(("mx.effects." + value)));
if (effectClass){
return (new effectClass(target));
};
return (null);
}
mx_internal static function effectStarted(effect:EffectInstance):void{
effects[effect] = 1;
}
public static function resumeEventHandling():void{
eventHandlingSuspendCount--;
}
mx_internal static function startVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, false);
}
mx_internal static function endVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, false);
}
private static function get resourceManager():IResourceManager{
if (!_resourceManager){
_resourceManager = ResourceManager.getInstance();
};
return (_resourceManager);
}
}
}//package mx.effects
class EffectNode {
public var factory:Effect;
public var instance:EffectInstance;
private function EffectNode(factory:Effect, instance:EffectInstance){
super();
this.factory = factory;
this.instance = instance;
}
}
Section 194
//EffectTargetFilter (mx.effects.EffectTargetFilter)
package mx.effects {
import mx.effects.effectClasses.*;
public class EffectTargetFilter {
public var filterFunction:Function;
public var filterStyles:Array;
public var filterProperties:Array;
public var requiredSemantics:Object;// = null
mx_internal static const VERSION:String = "3.2.0.3958";
public function EffectTargetFilter(){
filterFunction = defaultFilterFunctionEx;
filterProperties = [];
filterStyles = [];
super();
}
protected function defaultFilterFunctionEx(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
var prop:String;
if (requiredSemantics){
for (prop in requiredSemantics) {
if (!semanticsProvider){
return (false);
};
if (semanticsProvider.getRendererSemanticValue(target, prop) != requiredSemantics[prop]){
return (false);
};
};
return (true);
};
return (defaultFilterFunction(propChanges, target));
}
protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var triggers:Array;
var m:int;
var j:int;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
triggers = filterProperties.concat(filterStyles);
m = triggers.length;
j = 0;
while (j < m) {
if (((!((props.start[triggers[j]] === undefined))) && (!((props.end[triggers[j]] == props.start[triggers[j]]))))){
return (true);
};
j++;
};
};
i++;
};
return (false);
}
public function filterInstance(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
if (filterFunction.length == 2){
return (filterFunction(propChanges, target));
};
return (filterFunction(propChanges, semanticsProvider, target));
}
}
}//package mx.effects
Section 195
//IAbstractEffect (mx.effects.IAbstractEffect)
package mx.effects {
import flash.events.*;
public interface IAbstractEffect extends IEventDispatcher {
}
}//package mx.effects
Section 196
//IEffect (mx.effects.IEffect)
package mx.effects {
import flash.events.*;
public interface IEffect extends IAbstractEffect {
function captureMoreStartValues(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function get triggerEvent():Event;
function set targets(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function captureStartValues():void;
function get hideFocusRing():Boolean;
function get customFilter():EffectTargetFilter;
function get effectTargetHost():IEffectTargetHost;
function set triggerEvent(mx.effects:IEffect/mx.effects:IEffect:className/get:Event):void;
function set hideFocusRing(mx.effects:IEffect/mx.effects:IEffect:className/get:Boolean):void;
function captureEndValues():void;
function get target():Object;
function set customFilter(mx.effects:IEffect/mx.effects:IEffect:className/get:EffectTargetFilter):void;
function get duration():Number;
function get perElementOffset():Number;
function get targets():Array;
function set effectTargetHost(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectTargetHost):void;
function get relevantStyles():Array;
function set relevantProperties(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function set target(mx.effects:IEffect/mx.effects:IEffect:className/get:Object):void;
function get className():String;
function get isPlaying():Boolean;
function deleteInstance(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance):void;
function set duration(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function createInstances(EffectTargetFilter:Array=null):Array;
function end(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance=null):void;
function set perElementOffset(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function resume():void;
function stop():void;
function set filter(mx.effects:IEffect/mx.effects:IEffect:className/get:String):void;
function createInstance(void:Object=null):IEffectInstance;
function play(_arg1:Array=null, _arg2:Boolean=false):Array;
function pause():void;
function get relevantProperties():Array;
function get filter():String;
function reverse():void;
function getAffectedProperties():Array;
function set relevantStyles(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
}
}//package mx.effects
Section 197
//IEffectInstance (mx.effects.IEffectInstance)
package mx.effects {
import flash.events.*;
import mx.effects.effectClasses.*;
public interface IEffectInstance {
function get playheadTime():Number;
function get triggerEvent():Event;
function set triggerEvent(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function get hideFocusRing():Boolean;
function initEffect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function set startDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effectTargetHost():IEffectTargetHost;
function finishEffect():void;
function set hideFocusRing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function finishRepeat():void;
function set repeatDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effect():IEffect;
function startEffect():void;
function get duration():Number;
function get target():Object;
function get startDelay():int;
function stop():void;
function set effectTargetHost(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffectTargetHost):void;
function set propertyChanges(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:PropertyChanges):void;
function set effect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffect):void;
function get className():String;
function set duration(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Number):void;
function set target(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Object):void;
function end():void;
function resume():void;
function get propertyChanges():PropertyChanges;
function set repeatCount(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function reverse():void;
function get repeatCount():int;
function pause():void;
function get repeatDelay():int;
function set suspendBackgroundProcessing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function play():void;
function get suspendBackgroundProcessing():Boolean;
}
}//package mx.effects
Section 198
//IEffectTargetHost (mx.effects.IEffectTargetHost)
package mx.effects {
public interface IEffectTargetHost {
function unconstrainRenderer(:Object):void;
function removeDataEffectItem(:Object):void;
function getRendererSemanticValue(_arg1:Object, _arg2:String):Object;
function addDataEffectItem(:Object):void;
}
}//package mx.effects
Section 199
//Tween (mx.effects.Tween)
package mx.effects {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var started:Boolean;// = false
private var previousUpdateTime:Number;
public var duration:Number;// = 3000
private var id:int;
private var arrayMode:Boolean;
private var _isPlaying:Boolean;// = true
private var startValue:Object;
public var listener:Object;
private var userEquation:Function;
mx_internal var needToLayout:Boolean;// = false
private var updateFunction:Function;
private var _doSeek:Boolean;// = false
mx_internal var startTime:Number;
private var endFunction:Function;
private var endValue:Object;
private var _doReverse:Boolean;// = false
private var _playheadTime:Number;// = 0
private var _invertValues:Boolean;// = false
private var maxDelay:Number;// = 87.5
mx_internal static const VERSION:String = "3.2.0.3958";
private static var timer:Timer = null;
private static var interval:Number = 10;
mx_internal static var activeTweens:Array = [];
mx_internal static var intervalTime:Number = NAN;
public function Tween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1, updateFunction:Function=null, endFunction:Function=null){
userEquation = defaultEasingFunction;
super();
if (!listener){
return;
};
if ((startValue is Array)){
arrayMode = true;
};
this.listener = listener;
this.startValue = startValue;
this.endValue = endValue;
if (((!(isNaN(duration))) && (!((duration == -1))))){
this.duration = duration;
};
if (((!(isNaN(minFps))) && (!((minFps == -1))))){
maxDelay = (1000 / minFps);
};
this.updateFunction = updateFunction;
this.endFunction = endFunction;
if (duration == 0){
id = -1;
endTween();
} else {
Tween.addTween(this);
};
}
mx_internal function get playheadTime():Number{
return (_playheadTime);
}
public function stop():void{
if (id >= 0){
Tween.removeTweenAt(id);
};
}
mx_internal function get playReversed():Boolean{
return (_invertValues);
}
mx_internal function set playReversed(value:Boolean):void{
_invertValues = value;
}
public function resume():void{
_isPlaying = true;
startTime = (intervalTime - _playheadTime);
if (_doReverse){
reverse();
_doReverse = false;
};
}
public function setTweenHandlers(updateFunction:Function, endFunction:Function):void{
this.updateFunction = updateFunction;
this.endFunction = endFunction;
}
private function defaultEasingFunction(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c / 2) * (Math.sin((Math.PI * ((t / d) - 0.5))) + 1)) + b));
}
public function set easingFunction(value:Function):void{
userEquation = value;
}
public function endTween():void{
var event:TweenEvent = new TweenEvent(TweenEvent.TWEEN_END);
var value:Object = getCurrentValue(duration);
event.value = value;
dispatchEvent(event);
if (endFunction != null){
endFunction(value);
} else {
listener.onTweenEnd(value);
};
if (id >= 0){
Tween.removeTweenAt(id);
};
}
public function reverse():void{
if (_isPlaying){
_doReverse = false;
seek((duration - _playheadTime));
_invertValues = !(_invertValues);
} else {
_doReverse = !(_doReverse);
};
}
mx_internal function getCurrentValue(currentTime:Number):Object{
var returnArray:Array;
var n:int;
var i:int;
if (duration == 0){
return (endValue);
};
if (_invertValues){
currentTime = (duration - currentTime);
};
if (arrayMode){
returnArray = [];
n = startValue.length;
i = 0;
while (i < n) {
returnArray[i] = userEquation(currentTime, startValue[i], (endValue[i] - startValue[i]), duration);
i++;
};
return (returnArray);
//unresolved jump
};
return (userEquation(currentTime, startValue, (Number(endValue) - Number(startValue)), duration));
}
mx_internal function doInterval():Boolean{
var currentTime:Number;
var currentValue:Object;
var event:TweenEvent;
var startEvent:TweenEvent;
var tweenEnded:Boolean;
previousUpdateTime = intervalTime;
if (((_isPlaying) || (_doSeek))){
currentTime = (intervalTime - startTime);
_playheadTime = currentTime;
currentValue = getCurrentValue(currentTime);
if ((((currentTime >= duration)) && (!(_doSeek)))){
endTween();
tweenEnded = true;
} else {
if (!started){
startEvent = new TweenEvent(TweenEvent.TWEEN_START);
dispatchEvent(startEvent);
started = true;
};
event = new TweenEvent(TweenEvent.TWEEN_UPDATE);
event.value = currentValue;
dispatchEvent(event);
if (updateFunction != null){
updateFunction(currentValue);
} else {
listener.onTweenUpdate(currentValue);
};
};
_doSeek = false;
};
return (tweenEnded);
}
public function pause():void{
_isPlaying = false;
}
public function seek(playheadTime:Number):void{
var clockTime:Number = intervalTime;
previousUpdateTime = clockTime;
startTime = (clockTime - playheadTime);
_doSeek = true;
}
mx_internal static function removeTween(tween:Tween):void{
removeTweenAt(tween.id);
}
private static function addTween(tween:Tween):void{
tween.id = activeTweens.length;
activeTweens.push(tween);
if (!timer){
timer = new Timer(interval);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timer.start();
};
if (isNaN(intervalTime)){
intervalTime = getTimer();
};
tween.startTime = (tween.previousUpdateTime = intervalTime);
}
private static function timerHandler(event:TimerEvent):void{
var tween:Tween;
var needToLayout:Boolean;
var oldTime:Number = intervalTime;
intervalTime = getTimer();
var n:int = activeTweens.length;
var i:int = n;
while (i >= 0) {
tween = Tween(activeTweens[i]);
if (tween){
tween.needToLayout = false;
tween.doInterval();
if (tween.needToLayout){
needToLayout = true;
};
};
i--;
};
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
event.updateAfterEvent();
}
private static function removeTweenAt(index:int):void{
var curTween:Tween;
if ((((index >= activeTweens.length)) || ((index < 0)))){
return;
};
activeTweens.splice(index, 1);
var n:int = activeTweens.length;
var i:int = index;
while (i < n) {
curTween = Tween(activeTweens[i]);
curTween.id--;
i++;
};
if (n == 0){
intervalTime = NaN;
timer.reset();
};
}
}
}//package mx.effects
Section 200
//TweenEffect (mx.effects.TweenEffect)
package mx.effects {
import flash.events.*;
import mx.events.*;
import mx.effects.effectClasses.*;
public class TweenEffect extends Effect {
public var easingFunction:Function;// = null
mx_internal static const VERSION:String = "3.2.0.3958";
public function TweenEffect(target:Object=null){
super(target);
instanceClass = TweenEffectInstance;
}
protected function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override protected function initInstance(instance:IEffectInstance):void{
super.initInstance(instance);
TweenEffectInstance(instance).easingFunction = easingFunction;
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
}
}
}//package mx.effects
Section 201
//Zoom (mx.effects.Zoom)
package mx.effects {
import mx.effects.effectClasses.*;
public class Zoom extends TweenEffect {
public var zoomHeightFrom:Number;
public var zoomWidthTo:Number;
public var originX:Number;
public var zoomHeightTo:Number;
public var originY:Number;
public var captureRollEvents:Boolean;
public var zoomWidthFrom:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var AFFECTED_PROPERTIES:Array = ["scaleX", "scaleY", "x", "y", "width", "height"];
public function Zoom(target:Object=null){
super(target);
instanceClass = ZoomInstance;
applyActualDimensions = false;
relevantProperties = ["scaleX", "scaleY", "width", "height", "visible"];
}
override protected function initInstance(instance:IEffectInstance):void{
var zoomInstance:ZoomInstance;
super.initInstance(instance);
zoomInstance = ZoomInstance(instance);
zoomInstance.zoomWidthFrom = zoomWidthFrom;
zoomInstance.zoomWidthTo = zoomWidthTo;
zoomInstance.zoomHeightFrom = zoomHeightFrom;
zoomInstance.zoomHeightTo = zoomHeightTo;
zoomInstance.originX = originX;
zoomInstance.originY = originY;
zoomInstance.captureRollEvents = captureRollEvents;
}
override public function getAffectedProperties():Array{
return (AFFECTED_PROPERTIES);
}
}
}//package mx.effects
Section 202
//ChildExistenceChangedEvent (mx.events.ChildExistenceChangedEvent)
package mx.events {
import flash.display.*;
import flash.events.*;
public class ChildExistenceChangedEvent extends Event {
public var relatedObject:DisplayObject;
public static const CHILD_REMOVE:String = "childRemove";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OVERLAY_CREATED:String = "overlayCreated";
public static const CHILD_ADD:String = "childAdd";
public function ChildExistenceChangedEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, relatedObject:DisplayObject=null){
super(type, bubbles, cancelable);
this.relatedObject = relatedObject;
}
override public function clone():Event{
return (new ChildExistenceChangedEvent(type, bubbles, cancelable, relatedObject));
}
}
}//package mx.events
Section 203
//DragEvent (mx.events.DragEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class DragEvent extends MouseEvent {
public var draggedItem:Object;
public var action:String;
public var dragInitiator:IUIComponent;
public var dragSource:DragSource;
public static const DRAG_DROP:String = "dragDrop";
public static const DRAG_COMPLETE:String = "dragComplete";
public static const DRAG_EXIT:String = "dragExit";
public static const DRAG_ENTER:String = "dragEnter";
public static const DRAG_START:String = "dragStart";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DRAG_OVER:String = "dragOver";
public function DragEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=true, dragInitiator:IUIComponent=null, dragSource:DragSource=null, action:String=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false){
super(type, bubbles, cancelable);
this.dragInitiator = dragInitiator;
this.dragSource = dragSource;
this.action = action;
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
}
override public function clone():Event{
var cloneEvent:DragEvent = new DragEvent(type, bubbles, cancelable, dragInitiator, dragSource, action, ctrlKey, altKey, shiftKey);
cloneEvent.relatedObject = this.relatedObject;
cloneEvent.localX = this.localX;
cloneEvent.localY = this.localY;
return (cloneEvent);
}
}
}//package mx.events
Section 204
//DynamicEvent (mx.events.DynamicEvent)
package mx.events {
import flash.events.*;
public dynamic class DynamicEvent extends Event {
mx_internal static const VERSION:String = "3.2.0.3958";
public function DynamicEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
var p:String;
var event:DynamicEvent = new DynamicEvent(type, bubbles, cancelable);
for (p in this) {
event[p] = this[p];
};
return (event);
}
}
}//package mx.events
Section 205
//EffectEvent (mx.events.EffectEvent)
package mx.events {
import flash.events.*;
import mx.effects.*;
public class EffectEvent extends Event {
public var effectInstance:IEffectInstance;
public static const EFFECT_START:String = "effectStart";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EFFECT_END:String = "effectEnd";
public function EffectEvent(eventType:String, bubbles:Boolean=false, cancelable:Boolean=false, effectInstance:IEffectInstance=null){
super(eventType, bubbles, cancelable);
this.effectInstance = effectInstance;
}
override public function clone():Event{
return (new EffectEvent(type, bubbles, cancelable, effectInstance));
}
}
}//package mx.events
Section 206
//EventListenerRequest (mx.events.EventListenerRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class EventListenerRequest extends SWFBridgeRequest {
private var _priority:int;
private var _useWeakReference:Boolean;
private var _eventType:String;
private var _useCapture:Boolean;
public static const REMOVE_EVENT_LISTENER_REQUEST:String = "removeEventListenerRequest";
public static const ADD_EVENT_LISTENER_REQUEST:String = "addEventListenerRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public function EventListenerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=true, eventType:String=null, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false){
super(type, false, false);
_eventType = eventType;
_useCapture = useCapture;
_priority = priority;
_useWeakReference = useWeakReference;
}
public function get priority():int{
return (_priority);
}
public function get useWeakReference():Boolean{
return (_useWeakReference);
}
public function get eventType():String{
return (_eventType);
}
override public function clone():Event{
return (new EventListenerRequest(type, bubbles, cancelable, eventType, useCapture, priority, useWeakReference));
}
public function get useCapture():Boolean{
return (_useCapture);
}
public static function marshal(event:Event):EventListenerRequest{
var eventObj:Object = event;
return (new EventListenerRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.eventType, eventObj.useCapture, eventObj.priority, eventObj.useWeakReference));
}
}
}//package mx.events
Section 207
//FlexEvent (mx.events.FlexEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class FlexEvent extends Event {
public static const ADD:String = "add";
public static const TRANSFORM_CHANGE:String = "transformChange";
public static const ENTER_FRAME:String = "flexEventEnterFrame";
public static const INIT_COMPLETE:String = "initComplete";
public static const REMOVE:String = "remove";
public static const BUTTON_DOWN:String = "buttonDown";
public static const EXIT_STATE:String = "exitState";
public static const CREATION_COMPLETE:String = "creationComplete";
public static const REPEAT:String = "repeat";
public static const LOADING:String = "loading";
public static const RENDER:String = "flexEventRender";
public static const REPEAT_START:String = "repeatStart";
public static const INITIALIZE:String = "initialize";
public static const ENTER_STATE:String = "enterState";
public static const URL_CHANGED:String = "urlChanged";
public static const REPEAT_END:String = "repeatEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const HIDE:String = "hide";
public static const ENTER:String = "enter";
public static const PRELOADER_DONE:String = "preloaderDone";
public static const CURSOR_UPDATE:String = "cursorUpdate";
public static const PREINITIALIZE:String = "preinitialize";
public static const INVALID:String = "invalid";
public static const IDLE:String = "idle";
public static const VALID:String = "valid";
public static const DATA_CHANGE:String = "dataChange";
public static const APPLICATION_COMPLETE:String = "applicationComplete";
public static const VALUE_COMMIT:String = "valueCommit";
public static const UPDATE_COMPLETE:String = "updateComplete";
public static const INIT_PROGRESS:String = "initProgress";
public static const SHOW:String = "show";
public function FlexEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
return (new FlexEvent(type, bubbles, cancelable));
}
}
}//package mx.events
Section 208
//FlexMouseEvent (mx.events.FlexMouseEvent)
package mx.events {
import flash.display.*;
import flash.events.*;
public class FlexMouseEvent extends MouseEvent {
public static const MOUSE_DOWN_OUTSIDE:String = "mouseDownOutside";
public static const MOUSE_WHEEL_OUTSIDE:String = "mouseWheelOutside";
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, localX:Number=0, localY:Number=0, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0){
super(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);
}
override public function clone():Event{
return (new FlexMouseEvent(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta));
}
}
}//package mx.events
Section 209
//FocusRequestDirection (mx.events.FocusRequestDirection)
package mx.events {
public final class FocusRequestDirection {
public static const BACKWARD:String = "backward";
public static const FORWARD:String = "forward";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BOTTOM:String = "bottom";
public static const TOP:String = "top";
public function FocusRequestDirection(){
super();
}
}
}//package mx.events
Section 210
//IndexChangedEvent (mx.events.IndexChangedEvent)
package mx.events {
import flash.display.*;
import flash.events.*;
public class IndexChangedEvent extends Event {
public var newIndex:Number;
public var triggerEvent:Event;
public var relatedObject:DisplayObject;
public var oldIndex:Number;
public static const HEADER_SHIFT:String = "headerShift";
public static const CHANGE:String = "change";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const CHILD_INDEX_CHANGE:String = "childIndexChange";
public function IndexChangedEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, relatedObject:DisplayObject=null, oldIndex:Number=-1, newIndex:Number=-1, triggerEvent:Event=null){
super(type, bubbles, cancelable);
this.relatedObject = relatedObject;
this.oldIndex = oldIndex;
this.newIndex = newIndex;
this.triggerEvent = triggerEvent;
}
override public function clone():Event{
return (new IndexChangedEvent(type, bubbles, cancelable, relatedObject, oldIndex, newIndex, triggerEvent));
}
}
}//package mx.events
Section 211
//InterManagerRequest (mx.events.InterManagerRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class InterManagerRequest extends Event {
public var value:Object;
public var name:String;
public static const TOOLTIP_MANAGER_REQUEST:String = "tooltipManagerRequest";
public static const SYSTEM_MANAGER_REQUEST:String = "systemManagerRequest";
public static const INIT_MANAGER_REQUEST:String = "initManagerRequest";
public static const DRAG_MANAGER_REQUEST:String = "dragManagerRequest";
public static const CURSOR_MANAGER_REQUEST:String = "cursorManagerRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public function InterManagerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, name:String=null, value:Object=null){
super(type, bubbles, cancelable);
this.name = name;
this.value = value;
}
override public function clone():Event{
var cloneEvent:InterManagerRequest = new InterManagerRequest(type, bubbles, cancelable, name, value);
return (cloneEvent);
}
}
}//package mx.events
Section 212
//InvalidateRequestData (mx.events.InvalidateRequestData)
package mx.events {
import mx.core.*;
public final class InvalidateRequestData {
public static const SIZE:uint = 4;
public static const PROPERTIES:uint = 2;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DISPLAY_LIST:uint = 1;
public function InvalidateRequestData(){
super();
}
}
}//package mx.events
Section 213
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null, module:IModuleInfo=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
this._module = module;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 214
//MoveEvent (mx.events.MoveEvent)
package mx.events {
import flash.events.*;
public class MoveEvent extends Event {
public var oldX:Number;
public var oldY:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const MOVE:String = "move";
public function MoveEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldX:Number=NaN, oldY:Number=NaN){
super(type, bubbles, cancelable);
this.oldX = oldX;
this.oldY = oldY;
}
override public function clone():Event{
return (new MoveEvent(type, bubbles, cancelable, oldX, oldY));
}
}
}//package mx.events
Section 215
//PropertyChangeEvent (mx.events.PropertyChangeEvent)
package mx.events {
import flash.events.*;
public class PropertyChangeEvent extends Event {
public var newValue:Object;
public var kind:String;
public var property:Object;
public var oldValue:Object;
public var source:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const PROPERTY_CHANGE:String = "propertyChange";
public function PropertyChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, kind:String=null, property:Object=null, oldValue:Object=null, newValue:Object=null, source:Object=null){
super(type, bubbles, cancelable);
this.kind = kind;
this.property = property;
this.oldValue = oldValue;
this.newValue = newValue;
this.source = source;
}
override public function clone():Event{
return (new PropertyChangeEvent(type, bubbles, cancelable, kind, property, oldValue, newValue, source));
}
public static function createUpdateEvent(source:Object, property:Object, oldValue:Object, newValue:Object):PropertyChangeEvent{
var event:PropertyChangeEvent = new PropertyChangeEvent(PROPERTY_CHANGE);
event.kind = PropertyChangeEventKind.UPDATE;
event.oldValue = oldValue;
event.newValue = newValue;
event.source = source;
event.property = property;
return (event);
}
}
}//package mx.events
Section 216
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind)
package mx.events {
public final class PropertyChangeEventKind {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const UPDATE:String = "update";
public static const DELETE:String = "delete";
public function PropertyChangeEventKind(){
super();
}
}
}//package mx.events
Section 217
//ResizeEvent (mx.events.ResizeEvent)
package mx.events {
import flash.events.*;
public class ResizeEvent extends Event {
public var oldHeight:Number;
public var oldWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const RESIZE:String = "resize";
public function ResizeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldWidth:Number=NaN, oldHeight:Number=NaN){
super(type, bubbles, cancelable);
this.oldWidth = oldWidth;
this.oldHeight = oldHeight;
}
override public function clone():Event{
return (new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight));
}
}
}//package mx.events
Section 218
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 219
//RSLEvent (mx.events.RSLEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
import flash.net.*;
public class RSLEvent extends ProgressEvent {
public var errorText:String;
public var rslIndex:int;
public var rslTotal:int;
public var url:URLRequest;
public static const RSL_PROGRESS:String = "rslProgress";
public static const RSL_ERROR:String = "rslError";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const RSL_COMPLETE:String = "rslComplete";
public function RSLEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:int=-1, bytesTotal:int=-1, rslIndex:int=-1, rslTotal:int=-1, url:URLRequest=null, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.rslIndex = rslIndex;
this.rslTotal = rslTotal;
this.url = url;
this.errorText = errorText;
}
override public function clone():Event{
return (new RSLEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, rslIndex, rslTotal, url, errorText));
}
}
}//package mx.events
Section 220
//SandboxMouseEvent (mx.events.SandboxMouseEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SandboxMouseEvent extends Event {
public var buttonDown:Boolean;
public var altKey:Boolean;
public var ctrlKey:Boolean;
public var shiftKey:Boolean;
public static const CLICK_SOMEWHERE:String = "clickSomewhere";
public static const MOUSE_UP_SOMEWHERE:String = "mouseUpSomewhere";
public static const DOUBLE_CLICK_SOMEWHERE:String = "coubleClickSomewhere";
public static const MOUSE_WHEEL_SOMEWHERE:String = "mouseWheelSomewhere";
public static const MOUSE_DOWN_SOMEWHERE:String = "mouseDownSomewhere";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const MOUSE_MOVE_SOMEWHERE:String = "mouseMoveSomewhere";
public function SandboxMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false){
super(type, bubbles, cancelable);
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
this.buttonDown = buttonDown;
}
override public function clone():Event{
return (new SandboxMouseEvent(type, bubbles, cancelable, ctrlKey, altKey, shiftKey, buttonDown));
}
public static function marshal(event:Event):SandboxMouseEvent{
var eventObj:Object = event;
return (new SandboxMouseEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.ctrlKey, eventObj.altKey, eventObj.shiftKey, eventObj.buttonDown));
}
}
}//package mx.events
Section 221
//ScrollEvent (mx.events.ScrollEvent)
package mx.events {
import flash.events.*;
public class ScrollEvent extends Event {
public var detail:String;
public var delta:Number;
public var position:Number;
public var direction:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const SCROLL:String = "scroll";
public function ScrollEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, detail:String=null, position:Number=NaN, direction:String=null, delta:Number=NaN){
super(type, bubbles, cancelable);
this.detail = detail;
this.position = position;
this.direction = direction;
this.delta = delta;
}
override public function clone():Event{
return (new ScrollEvent(type, bubbles, cancelable, detail, position, direction, delta));
}
}
}//package mx.events
Section 222
//ScrollEventDetail (mx.events.ScrollEventDetail)
package mx.events {
public final class ScrollEventDetail {
public static const LINE_UP:String = "lineUp";
public static const AT_RIGHT:String = "atRight";
public static const PAGE_UP:String = "pageUp";
public static const LINE_DOWN:String = "lineDown";
public static const PAGE_DOWN:String = "pageDown";
public static const AT_LEFT:String = "atLeft";
public static const PAGE_RIGHT:String = "pageRight";
public static const THUMB_POSITION:String = "thumbPosition";
public static const AT_TOP:String = "atTop";
public static const LINE_LEFT:String = "lineLeft";
public static const AT_BOTTOM:String = "atBottom";
public static const LINE_RIGHT:String = "lineRight";
public static const THUMB_TRACK:String = "thumbTrack";
public static const PAGE_LEFT:String = "pageLeft";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollEventDetail(){
super();
}
}
}//package mx.events
Section 223
//ScrollEventDirection (mx.events.ScrollEventDirection)
package mx.events {
public final class ScrollEventDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollEventDirection(){
super();
}
}
}//package mx.events
Section 224
//StateChangeEvent (mx.events.StateChangeEvent)
package mx.events {
import flash.events.*;
public class StateChangeEvent extends Event {
public var newState:String;
public var oldState:String;
public static const CURRENT_STATE_CHANGING:String = "currentStateChanging";
public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
mx_internal static const VERSION:String = "3.2.0.3958";
public function StateChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldState:String=null, newState:String=null){
super(type, bubbles, cancelable);
this.oldState = oldState;
this.newState = newState;
}
override public function clone():Event{
return (new StateChangeEvent(type, bubbles, cancelable, oldState, newState));
}
}
}//package mx.events
Section 225
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 226
//SWFBridgeEvent (mx.events.SWFBridgeEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SWFBridgeEvent extends Event {
public var data:Object;
public static const BRIDGE_FOCUS_MANAGER_ACTIVATE:String = "bridgeFocusManagerActivate";
public static const BRIDGE_WINDOW_ACTIVATE:String = "bridgeWindowActivate";
public static const BRIDGE_WINDOW_DEACTIVATE:String = "brdigeWindowDeactivate";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BRIDGE_NEW_APPLICATION:String = "bridgeNewApplication";
public static const BRIDGE_APPLICATION_UNLOADING:String = "bridgeApplicationUnloading";
public static const BRIDGE_APPLICATION_ACTIVATE:String = "bridgeApplicationActivate";
public function SWFBridgeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object=null){
super(type, bubbles, cancelable);
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeEvent(type, bubbles, cancelable, data));
}
public static function marshal(event:Event):SWFBridgeEvent{
var eventObj:Object = event;
return (new SWFBridgeEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.data));
}
}
}//package mx.events
Section 227
//SWFBridgeRequest (mx.events.SWFBridgeRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SWFBridgeRequest extends Event {
public var requestor:IEventDispatcher;
public var data:Object;
public static const SHOW_MOUSE_CURSOR_REQUEST:String = "showMouseCursorRequest";
public static const DEACTIVATE_POP_UP_REQUEST:String = "deactivatePopUpRequest";
public static const SET_ACTUAL_SIZE_REQUEST:String = "setActualSizeRequest";
public static const MOVE_FOCUS_REQUEST:String = "moveFocusRequest";
public static const GET_VISIBLE_RECT_REQUEST:String = "getVisibleRectRequest";
public static const ADD_POP_UP_PLACE_HOLDER_REQUEST:String = "addPopUpPlaceHolderRequest";
public static const REMOVE_POP_UP_PLACE_HOLDER_REQUEST:String = "removePopUpPlaceHolderRequest";
public static const RESET_MOUSE_CURSOR_REQUEST:String = "resetMouseCursorRequest";
public static const ADD_POP_UP_REQUEST:String = "addPopUpRequest";
public static const GET_SIZE_REQUEST:String = "getSizeRequest";
public static const SHOW_MODAL_WINDOW_REQUEST:String = "showModalWindowRequest";
public static const ACTIVATE_FOCUS_REQUEST:String = "activateFocusRequest";
public static const DEACTIVATE_FOCUS_REQUEST:String = "deactivateFocusRequest";
public static const HIDE_MOUSE_CURSOR_REQUEST:String = "hideMouseCursorRequest";
public static const ACTIVATE_POP_UP_REQUEST:String = "activatePopUpRequest";
public static const IS_BRIDGE_CHILD_REQUEST:String = "isBridgeChildRequest";
public static const CAN_ACTIVATE_POP_UP_REQUEST:String = "canActivateRequestPopUpRequest";
public static const HIDE_MODAL_WINDOW_REQUEST:String = "hideModalWindowRequest";
public static const INVALIDATE_REQUEST:String = "invalidateRequest";
public static const SET_SHOW_FOCUS_INDICATOR_REQUEST:String = "setShowFocusIndicatorRequest";
public static const CREATE_MODAL_WINDOW_REQUEST:String = "createModalWindowRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const REMOVE_POP_UP_REQUEST:String = "removePopUpRequest";
public function SWFBridgeRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, requestor:IEventDispatcher=null, data:Object=null){
super(type, bubbles, cancelable);
this.requestor = requestor;
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeRequest(type, bubbles, cancelable, requestor, data));
}
public static function marshal(event:Event):SWFBridgeRequest{
var eventObj:Object = event;
return (new SWFBridgeRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.requestor, eventObj.data));
}
}
}//package mx.events
Section 228
//ToolTipEvent (mx.events.ToolTipEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ToolTipEvent extends Event {
public var toolTip:IToolTip;
public static const TOOL_TIP_SHOWN:String = "toolTipShown";
public static const TOOL_TIP_CREATE:String = "toolTipCreate";
public static const TOOL_TIP_SHOW:String = "toolTipShow";
public static const TOOL_TIP_HIDE:String = "toolTipHide";
public static const TOOL_TIP_END:String = "toolTipEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const TOOL_TIP_START:String = "toolTipStart";
public function ToolTipEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, toolTip:IToolTip=null){
super(type, bubbles, cancelable);
this.toolTip = toolTip;
}
override public function clone():Event{
return (new ToolTipEvent(type, bubbles, cancelable, toolTip));
}
}
}//package mx.events
Section 229
//TweenEvent (mx.events.TweenEvent)
package mx.events {
import flash.events.*;
public class TweenEvent extends Event {
public var value:Object;
public static const TWEEN_END:String = "tweenEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const TWEEN_UPDATE:String = "tweenUpdate";
public static const TWEEN_START:String = "tweenStart";
public function TweenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, value:Object=null){
super(type, bubbles, cancelable);
this.value = value;
}
override public function clone():Event{
return (new TweenEvent(type, bubbles, cancelable, value));
}
}
}//package mx.events
Section 230
//ValidationResultEvent (mx.events.ValidationResultEvent)
package mx.events {
import flash.events.*;
public class ValidationResultEvent extends Event {
public var results:Array;
public var field:String;
public static const INVALID:String = "invalid";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const VALID:String = "valid";
public function ValidationResultEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, field:String=null, results:Array=null){
super(type, bubbles, cancelable);
this.field = field;
this.results = results;
}
public function get message():String{
var msg:String = "";
var n:int = results.length;
var i:int;
while (i < n) {
if (results[i].isError){
msg = (msg + ((msg == "")) ? "" : "\n");
msg = (msg + results[i].errorMessage);
};
i++;
};
return (msg);
}
override public function clone():Event{
return (new ValidationResultEvent(type, bubbles, cancelable, field, results));
}
}
}//package mx.events
Section 231
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function RectangularDropShadow(){
super();
}
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(value:Number):void{
if (_brRadius != value){
_brRadius = value;
changed = true;
};
}
public function set color(value:int):void{
if (_color != value){
_color = value;
changed = true;
};
}
public function drawShadow(g:Graphics, x:Number, y:Number, width:Number, height:Number):void{
var tlWidth:Number;
var tlHeight:Number;
var trWidth:Number;
var trHeight:Number;
var blWidth:Number;
var blHeight:Number;
var brWidth:Number;
var brHeight:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
width = Math.ceil(width);
height = Math.ceil(height);
var leftThickness:int = (leftShadow) ? leftShadow.width : 0;
var rightThickness:int = (rightShadow) ? rightShadow.width : 0;
var topThickness:int = (topShadow) ? topShadow.height : 0;
var bottomThickness:int = (bottomShadow) ? bottomShadow.height : 0;
var widthThickness:int = (leftThickness + rightThickness);
var heightThickness:int = (topThickness + bottomThickness);
var maxCornerHeight:Number = ((height + heightThickness) / 2);
var maxCornerWidth:Number = ((width + widthThickness) / 2);
var matrix:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
tlWidth = Math.min((tlRadius + widthThickness), maxCornerWidth);
tlHeight = Math.min((tlRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (y - topThickness), tlWidth, tlHeight);
g.endFill();
};
if (((rightShadow) || (topShadow))){
trWidth = Math.min((trRadius + widthThickness), maxCornerWidth);
trHeight = Math.min((trRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - trWidth), (y - topThickness), trWidth, trHeight);
g.endFill();
};
if (((leftShadow) || (bottomShadow))){
blWidth = Math.min((blRadius + widthThickness), maxCornerWidth);
blHeight = Math.min((blRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (((y + height) + bottomThickness) - blHeight), blWidth, blHeight);
g.endFill();
};
if (((rightShadow) || (bottomShadow))){
brWidth = Math.min((brRadius + widthThickness), maxCornerWidth);
brHeight = Math.min((brRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - brWidth), (((y + height) + bottomThickness) - brHeight), brWidth, brHeight);
g.endFill();
};
if (leftShadow){
matrix.tx = (x - leftThickness);
matrix.ty = 0;
g.beginBitmapFill(leftShadow, matrix);
g.drawRect((x - leftThickness), ((y - topThickness) + tlHeight), leftThickness, ((((height + topThickness) + bottomThickness) - tlHeight) - blHeight));
g.endFill();
};
if (rightShadow){
matrix.tx = (x + width);
matrix.ty = 0;
g.beginBitmapFill(rightShadow, matrix);
g.drawRect((x + width), ((y - topThickness) + trHeight), rightThickness, ((((height + topThickness) + bottomThickness) - trHeight) - brHeight));
g.endFill();
};
if (topShadow){
matrix.tx = 0;
matrix.ty = (y - topThickness);
g.beginBitmapFill(topShadow, matrix);
g.drawRect(((x - leftThickness) + tlWidth), (y - topThickness), ((((width + leftThickness) + rightThickness) - tlWidth) - trWidth), topThickness);
g.endFill();
};
if (bottomShadow){
matrix.tx = 0;
matrix.ty = (y + height);
g.beginBitmapFill(bottomShadow, matrix);
g.drawRect(((x - leftThickness) + blWidth), (y + height), ((((width + leftThickness) + rightThickness) - blWidth) - brWidth), bottomThickness);
g.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var roundRectWidth:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var roundRectHeight:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((roundRectWidth < 0)) || ((roundRectHeight < 0)))){
return;
};
var roundRect:Shape = new FlexShape();
var g:Graphics = roundRect.graphics;
g.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, roundRectWidth, roundRectHeight, tlRadius, trRadius, blRadius, brRadius);
g.endFill();
var roundRectBitmap:BitmapData = new BitmapData(roundRectWidth, roundRectHeight, true, 0);
roundRectBitmap.draw(roundRect, new Matrix());
var filter:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
filter.knockout = true;
var inputRect:Rectangle = new Rectangle(0, 0, roundRectWidth, roundRectHeight);
var outputRect:Rectangle = roundRectBitmap.generateFilterRect(inputRect, filter);
var leftThickness:Number = (inputRect.left - outputRect.left);
var rightThickness:Number = (outputRect.right - inputRect.right);
var topThickness:Number = (inputRect.top - outputRect.top);
var bottomThickness:Number = (outputRect.bottom - inputRect.bottom);
shadow = new BitmapData(outputRect.width, outputRect.height);
shadow.applyFilter(roundRectBitmap, inputRect, new Point(leftThickness, topThickness), filter);
var origin:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle();
if (leftThickness > 0){
rect.x = 0;
rect.y = ((tlRadius + topThickness) + bottomThickness);
rect.width = leftThickness;
rect.height = 1;
leftShadow = new BitmapData(leftThickness, 1);
leftShadow.copyPixels(shadow, rect, origin);
} else {
leftShadow = null;
};
if (rightThickness > 0){
rect.x = (shadow.width - rightThickness);
rect.y = ((trRadius + topThickness) + bottomThickness);
rect.width = rightThickness;
rect.height = 1;
rightShadow = new BitmapData(rightThickness, 1);
rightShadow.copyPixels(shadow, rect, origin);
} else {
rightShadow = null;
};
if (topThickness > 0){
rect.x = ((tlRadius + leftThickness) + rightThickness);
rect.y = 0;
rect.width = 1;
rect.height = topThickness;
topShadow = new BitmapData(1, topThickness);
topShadow.copyPixels(shadow, rect, origin);
} else {
topShadow = null;
};
if (bottomThickness > 0){
rect.x = ((blRadius + leftThickness) + rightThickness);
rect.y = (shadow.height - bottomThickness);
rect.width = 1;
rect.height = bottomThickness;
bottomShadow = new BitmapData(1, bottomThickness);
bottomShadow.copyPixels(shadow, rect, origin);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(value:Number):void{
if (_angle != value){
_angle = value;
changed = true;
};
}
public function set trRadius(value:Number):void{
if (_trRadius != value){
_trRadius = value;
changed = true;
};
}
public function set tlRadius(value:Number):void{
if (_tlRadius != value){
_tlRadius = value;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(value:Number):void{
if (_distance != value){
_distance = value;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(value:Number):void{
if (_alpha != value){
_alpha = value;
changed = true;
};
}
public function set blRadius(value:Number):void{
if (_blRadius != value){
_blRadius = value;
changed = true;
};
}
}
}//package mx.graphics
Section 232
//RoundedRectangle (mx.graphics.RoundedRectangle)
package mx.graphics {
import flash.geom.*;
import mx.core.*;
public class RoundedRectangle extends Rectangle {
public var cornerRadius:Number;// = 0
mx_internal static const VERSION:String = "3.2.0.3958";
public function RoundedRectangle(x:Number=0, y:Number=0, width:Number=0, height:Number=0, cornerRadius:Number=0){
super(x, y, width, height);
this.cornerRadius = cornerRadius;
}
}
}//package mx.graphics
Section 233
//PriorityQueue (mx.managers.layoutClasses.PriorityQueue)
package mx.managers.layoutClasses {
import flash.display.*;
import mx.core.*;
import mx.managers.*;
public class PriorityQueue {
private var maxPriority:int;// = -1
private var arrayOfArrays:Array;
private var minPriority:int;// = 0
mx_internal static const VERSION:String = "3.2.0.3958";
public function PriorityQueue(){
arrayOfArrays = [];
super();
}
public function addObject(obj:Object, priority:int):void{
if (!arrayOfArrays[priority]){
arrayOfArrays[priority] = [];
};
arrayOfArrays[priority].push(obj);
if (maxPriority < minPriority){
minPriority = (maxPriority = priority);
} else {
if (priority < minPriority){
minPriority = priority;
};
if (priority > maxPriority){
maxPriority = priority;
};
};
}
public function removeSmallest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
return (null);
};
};
obj = arrayOfArrays[minPriority].shift();
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
break;
};
};
};
return (obj);
}
public function removeLargestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var max:int = maxPriority;
var min:int = client.nestLevel;
while (min <= max) {
if (((arrayOfArrays[max]) && ((arrayOfArrays[max].length > 0)))){
i = 0;
while (i < arrayOfArrays[max].length) {
if (contains(DisplayObject(client), arrayOfArrays[max][i])){
obj = arrayOfArrays[max][i];
arrayOfArrays[max].splice(i, 1);
return (obj);
};
i++;
};
max--;
} else {
if (max == maxPriority){
maxPriority--;
};
max--;
if (max < min){
break;
};
};
};
return (obj);
}
public function isEmpty():Boolean{
return ((minPriority > maxPriority));
}
public function removeLargest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
return (null);
};
};
obj = arrayOfArrays[maxPriority].shift();
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
break;
};
};
};
return (obj);
}
public function removeSmallestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var min:int = client.nestLevel;
while (min <= maxPriority) {
if (((arrayOfArrays[min]) && ((arrayOfArrays[min].length > 0)))){
i = 0;
while (i < arrayOfArrays[min].length) {
if (contains(DisplayObject(client), arrayOfArrays[min][i])){
obj = arrayOfArrays[min][i];
arrayOfArrays[min].splice(i, 1);
return (obj);
};
i++;
};
min++;
} else {
if (min == minPriority){
minPriority++;
};
min++;
if (min > maxPriority){
break;
};
};
};
return (obj);
}
public function removeAll():void{
arrayOfArrays.splice(0);
minPriority = 0;
maxPriority = -1;
}
private function contains(parent:DisplayObject, child:DisplayObject):Boolean{
var rawChildren:IChildList;
if ((parent is IRawChildrenContainer)){
rawChildren = IRawChildrenContainer(parent).rawChildren;
return (rawChildren.contains(child));
};
if ((parent is DisplayObjectContainer)){
return (DisplayObjectContainer(parent).contains(child));
};
return ((parent == child));
}
}
}//package mx.managers.layoutClasses
Section 234
//EventProxy (mx.managers.systemClasses.EventProxy)
package mx.managers.systemClasses {
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.utils.*;
public class EventProxy extends EventDispatcher {
private var systemManager:ISystemManager;
public function EventProxy(systemManager:ISystemManager){
super();
this.systemManager = systemManager;
}
public function marshalListener(event:Event):void{
var me:MouseEvent;
var mme:SandboxMouseEvent;
if ((event is MouseEvent)){
me = (event as MouseEvent);
mme = new SandboxMouseEvent(EventUtil.mouseEventMap[event.type], false, false, me.ctrlKey, me.altKey, me.shiftKey, me.buttonDown);
systemManager.dispatchEventFromSWFBridges(mme, null, true, true);
};
}
}
}//package mx.managers.systemClasses
Section 235
//PlaceholderData (mx.managers.systemClasses.PlaceholderData)
package mx.managers.systemClasses {
import flash.events.*;
public class PlaceholderData {
public var bridge:IEventDispatcher;
public var data:Object;
public var id:String;
public function PlaceholderData(id:String, bridge:IEventDispatcher, data:Object){
super();
this.id = id;
this.bridge = bridge;
this.data = data;
}
}
}//package mx.managers.systemClasses
Section 236
//RemotePopUp (mx.managers.systemClasses.RemotePopUp)
package mx.managers.systemClasses {
public class RemotePopUp {
public var window:Object;
public var bridge:Object;
public function RemotePopUp(window:Object, bridge:Object){
super();
this.window = window;
this.bridge = bridge;
}
}
}//package mx.managers.systemClasses
Section 237
//StageEventProxy (mx.managers.systemClasses.StageEventProxy)
package mx.managers.systemClasses {
import flash.display.*;
import flash.events.*;
public class StageEventProxy {
private var listener:Function;
public function StageEventProxy(listener:Function){
super();
this.listener = listener;
}
public function stageListener(event:Event):void{
if ((event.target is Stage)){
listener(event);
};
}
}
}//package mx.managers.systemClasses
Section 238
//CursorManager (mx.managers.CursorManager)
package mx.managers {
import mx.core.*;
public class CursorManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const NO_CURSOR:int = 0;
private static var _impl:ICursorManager;
private static var implClassDependency:CursorManagerImpl;
public function CursorManager(){
super();
}
public static function set currentCursorYOffset(value:Number):void{
impl.currentCursorYOffset = value;
}
mx_internal static function registerToUseBusyCursor(source:Object):void{
impl.registerToUseBusyCursor(source);
}
public static function get currentCursorID():int{
return (impl.currentCursorID);
}
public static function getInstance():ICursorManager{
return (impl);
}
public static function removeBusyCursor():void{
impl.removeBusyCursor();
}
public static function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
return (impl.setCursor(cursorClass, priority, xOffset, yOffset));
}
public static function set currentCursorID(value:int):void{
impl.currentCursorID = value;
}
mx_internal static function unRegisterToUseBusyCursor(source:Object):void{
impl.unRegisterToUseBusyCursor(source);
}
private static function get impl():ICursorManager{
if (!_impl){
_impl = ICursorManager(Singleton.getInstance("mx.managers::ICursorManager"));
};
return (_impl);
}
public static function removeAllCursors():void{
impl.removeAllCursors();
}
public static function setBusyCursor():void{
impl.setBusyCursor();
}
public static function showCursor():void{
impl.showCursor();
}
public static function hideCursor():void{
impl.hideCursor();
}
public static function removeCursor(cursorID:int):void{
impl.removeCursor(cursorID);
}
public static function get currentCursorXOffset():Number{
return (impl.currentCursorXOffset);
}
public static function get currentCursorYOffset():Number{
return (impl.currentCursorYOffset);
}
public static function set currentCursorXOffset(value:Number):void{
impl.currentCursorXOffset = value;
}
}
}//package mx.managers
Section 239
//CursorManagerImpl (mx.managers.CursorManagerImpl)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import flash.ui.*;
public class CursorManagerImpl implements ICursorManager {
private var showSystemCursor:Boolean;// = false
private var nextCursorID:int;// = 1
private var systemManager:ISystemManager;// = null
private var cursorList:Array;
private var _currentCursorYOffset:Number;// = 0
private var cursorHolder:Sprite;
private var currentCursor:DisplayObject;
private var sandboxRoot:IEventDispatcher;// = null
private var showCustomCursor:Boolean;// = false
private var listenForContextMenu:Boolean;// = false
private var _currentCursorID:int;// = 0
private var initialized:Boolean;// = false
private var overTextField:Boolean;// = false
private var _currentCursorXOffset:Number;// = 0
private var busyCursorList:Array;
private var overLink:Boolean;// = false
private var sourceArray:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:ICursorManager;
public function CursorManagerImpl(systemManager:ISystemManager=null){
cursorList = [];
busyCursorList = [];
sourceArray = [];
super();
if (((instance) && (!(systemManager)))){
throw (new Error("Instance already exists."));
};
if (systemManager){
this.systemManager = (systemManager as ISystemManager);
} else {
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
};
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST, marshalCursorManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
public function set currentCursorYOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorYOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
}
public function get currentCursorXOffset():Number{
return (_currentCursorXOffset);
}
public function removeCursor(cursorID:int):void{
var i:Object;
var me:InterManagerRequest;
var item:CursorQueueItem;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeCursor";
me.value = cursorID;
sandboxRoot.dispatchEvent(me);
return;
};
for (i in cursorList) {
item = cursorList[i];
if (item.cursorID == cursorID){
cursorList.splice(i, 1);
showCurrentCursor();
break;
};
};
}
public function get currentCursorID():int{
return (_currentCursorID);
}
private function marshalMouseMoveHandler(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (cursorHolder.visible){
cursorHolder.visible = false;
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
if (cursorRequest.data){
Mouse.show();
};
};
}
public function set currentCursorID(value:int):void{
var me:InterManagerRequest;
_currentCursorID = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
};
}
public function removeAllCursors():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeAllCursors";
sandboxRoot.dispatchEvent(me);
return;
};
cursorList.splice(0);
showCurrentCursor();
}
private function priorityCompare(a:CursorQueueItem, b:CursorQueueItem):int{
if (a.priority < b.priority){
return (-1);
};
if (a.priority == b.priority){
return (0);
};
return (1);
}
public function setBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
var cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
var busyCursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursor");
busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW));
}
public function showCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = true;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "showCursor";
sandboxRoot.dispatchEvent(me);
};
}
private function findSource(target:Object):int{
var n:int = sourceArray.length;
var i:int;
while (i < n) {
if (sourceArray[i] === target){
return (i);
};
i++;
};
return (-1);
}
private function showCurrentCursor():void{
var app:InteractiveObject;
var sm:InteractiveObject;
var item:CursorQueueItem;
var me:InterManagerRequest;
var pt:Point;
if (cursorList.length > 0){
if (!initialized){
cursorHolder = new FlexSprite();
cursorHolder.name = "cursorHolder";
cursorHolder.mouseEnabled = false;
cursorHolder.mouseChildren = false;
systemManager.addChildToSandboxRoot("cursorChildren", cursorHolder);
initialized = true;
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
sandboxRoot.dispatchEvent(me);
};
item = cursorList[0];
if (currentCursorID == CursorManager.NO_CURSOR){
Mouse.hide();
};
if (item.cursorID != currentCursorID){
if (cursorHolder.numChildren > 0){
cursorHolder.removeChildAt(0);
};
currentCursor = new item.cursorClass();
if (currentCursor){
if ((currentCursor is InteractiveObject)){
InteractiveObject(currentCursor).mouseEnabled = false;
};
if ((currentCursor is DisplayObjectContainer)){
DisplayObjectContainer(currentCursor).mouseChildren = false;
};
cursorHolder.addChild(currentCursor);
if (!listenForContextMenu){
app = (systemManager.document as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
listenForContextMenu = true;
};
sm = (systemManager as InteractiveObject);
if (((sm) && (sm.contextMenu))){
sm.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
listenForContextMenu = true;
};
};
if ((systemManager is SystemManager)){
pt = new Point((SystemManager(systemManager).mouseX + item.x), (SystemManager(systemManager).mouseY + item.y));
pt = SystemManager(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
} else {
if ((systemManager is DisplayObject)){
pt = new Point((DisplayObject(systemManager).mouseX + item.x), (DisplayObject(systemManager).mouseY + item.y));
pt = DisplayObject(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = (DisplayObject(systemManager).mouseX + item.x);
cursorHolder.y = (DisplayObject(systemManager).mouseY + item.y);
} else {
cursorHolder.x = item.x;
cursorHolder.y = item.y;
};
};
if (systemManager.useSWFBridge()){
sandboxRoot.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
} else {
systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
};
sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false, EventPriority.CURSOR_MANAGEMENT);
};
currentCursorID = item.cursorID;
currentCursorXOffset = item.x;
currentCursorYOffset = item.y;
};
} else {
if (currentCursorID != CursorManager.NO_CURSOR){
currentCursorID = CursorManager.NO_CURSOR;
currentCursorXOffset = 0;
currentCursorYOffset = 0;
if (systemManager.useSWFBridge()){
sandboxRoot.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
} else {
systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
};
sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false);
cursorHolder.removeChild(currentCursor);
if (listenForContextMenu){
app = (systemManager.document as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
};
sm = (systemManager as InteractiveObject);
if (((sm) && (sm.contextMenu))){
sm.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
};
listenForContextMenu = false;
};
};
Mouse.show();
};
}
public function get currentCursorYOffset():Number{
return (_currentCursorYOffset);
}
private function contextMenu_menuSelectHandler(event:ContextMenuEvent):void{
showCustomCursor = true;
sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
}
public function hideCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = false;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "hideCursor";
sandboxRoot.dispatchEvent(me);
};
}
private function marshalCursorManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "initialized":
initialized = marshalEvent.value;
break;
case "currentCursorID":
_currentCursorID = marshalEvent.value;
break;
case "currentCursorXOffset":
_currentCursorXOffset = marshalEvent.value;
break;
case "currentCursorYOffset":
_currentCursorYOffset = marshalEvent.value;
break;
case "showCursor":
if (cursorHolder){
cursorHolder.visible = true;
};
break;
case "hideCursor":
if (cursorHolder){
cursorHolder.visible = false;
};
break;
case "setCursor":
if (cursorHolder){
marshalEvent.value = setCursor.apply(this, marshalEvent.value);
};
break;
case "removeCursor":
if (cursorHolder){
removeCursor.apply(this, [marshalEvent.value]);
};
break;
case "removeAllCursors":
if (cursorHolder){
removeAllCursors();
};
break;
case "setBusyCursor":
if (cursorHolder){
setBusyCursor();
};
break;
case "removeBusyCursor":
if (cursorHolder){
removeBusyCursor();
};
break;
case "registerToUseBusyCursor":
if (cursorHolder){
registerToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "unRegisterToUseBusyCursor":
if (cursorHolder){
unRegisterToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "update":
if (cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
me.value = true;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
};
}
public function registerToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "registerToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
source.addEventListener(Event.COMPLETE, completeHandler);
source.addEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
private function completeHandler(event:Event):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex != -1){
sourceArray.splice(sourceIndex, 1);
removeBusyCursor();
};
}
public function removeBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
if (busyCursorList.length > 0){
removeCursor(int(busyCursorList.pop()));
};
}
public function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setCursor";
me.value = [cursorClass, priority, xOffset, yOffset];
sandboxRoot.dispatchEvent(me);
return ((me.value as int));
};
var cursorID:int = nextCursorID++;
var item:CursorQueueItem = new CursorQueueItem();
item.cursorID = cursorID;
item.cursorClass = cursorClass;
item.priority = priority;
item.x = xOffset;
item.y = yOffset;
if (systemManager){
item.systemManager = systemManager;
} else {
item.systemManager = ApplicationGlobals.application.systemManager;
};
cursorList.push(item);
cursorList.sort(priorityCompare);
showCurrentCursor();
return (cursorID);
}
private function progressHandler(event:ProgressEvent):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex == -1){
sourceArray.push(event.target);
setBusyCursor();
};
}
private function mouseMoveHandler(event:MouseEvent):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
var pt:Point = new Point(event.stageX, event.stageY);
pt = cursorHolder.parent.globalToLocal(pt);
pt.x = (pt.x + currentCursorXOffset);
pt.y = (pt.y + currentCursorYOffset);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
var target:Object = event.target;
if (((((!(overTextField)) && ((target is TextField)))) && ((target.type == TextFieldType.INPUT)))){
overTextField = true;
showSystemCursor = true;
} else {
if (((overTextField) && (!((((target is TextField)) && ((target.type == TextFieldType.INPUT))))))){
overTextField = false;
showCustomCursor = true;
} else {
showCustomCursor = true;
};
};
if (showSystemCursor){
showSystemCursor = false;
cursorHolder.visible = false;
Mouse.show();
};
if (showCustomCursor){
showCustomCursor = false;
cursorHolder.visible = true;
Mouse.hide();
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
}
public function unRegisterToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "unRegisterToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
source.removeEventListener(Event.COMPLETE, completeHandler);
source.removeEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
private function mouseOverHandler(event:MouseEvent):void{
sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
mouseMoveHandler(event);
}
public function set currentCursorXOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorXOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
};
}
public static function getInstance():ICursorManager{
if (!instance){
instance = new (CursorManagerImpl);
};
return (instance);
}
}
}//package mx.managers
class CursorQueueItem {
public var priority:int;// = 2
public var cursorClass:Class;// = null
public var cursorID:int;// = 0
public var x:Number;
public var y:Number;
public var systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
private function CursorQueueItem(){
super();
}
}
Section 240
//CursorManagerPriority (mx.managers.CursorManagerPriority)
package mx.managers {
public final class CursorManagerPriority {
public static const HIGH:int = 1;
public static const MEDIUM:int = 2;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const LOW:int = 3;
public function CursorManagerPriority(){
super();
}
}
}//package mx.managers
Section 241
//FocusManager (mx.managers.FocusManager)
package mx.managers {
import flash.display.*;
import flash.text.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.ui.*;
import flash.system.*;
public class FocusManager implements IFocusManager {
private var lastActiveFocusManager:FocusManager;
private var _showFocusIndicator:Boolean;// = false
private var focusableCandidates:Array;
private var LARGE_TAB_INDEX:int;// = 99999
private var browserFocusComponent:InteractiveObject;
private var calculateCandidates:Boolean;// = true
private var _lastFocus:IFocusManagerComponent;
private var lastAction:String;
private var focusSetLocally:Boolean;
private var focusableObjects:Array;
private var swfBridgeGroup:SWFBridgeGroup;
private var defButton:IButton;
private var _form:IFocusManagerContainer;
private var popup:Boolean;
private var focusChanged:Boolean;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:IButton;
private var fauxFocus:DisplayObject;
private var _focusPane:Sprite;
private var skipBridge:IEventDispatcher;
public var browserMode:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const FROM_INDEX_UNSPECIFIED:int = -2;
public function FocusManager(container:IFocusManagerContainer, popup:Boolean=false){
var sm:ISystemManager;
var bridge:IEventDispatcher;
var container = container;
var popup = popup;
super();
this.popup = popup;
browserMode = (((Capabilities.playerType == "ActiveX")) && (!(popup)));
container.focusManager = this;
_form = container;
focusableObjects = [];
focusPane = new FlexSprite();
focusPane.name = "focusPane";
addFocusables(DisplayObject(container));
container.addEventListener(Event.ADDED, addedHandler);
container.addEventListener(Event.REMOVED, removedHandler);
container.addEventListener(FlexEvent.SHOW, showHandler);
container.addEventListener(FlexEvent.HIDE, hideHandler);
if ((container.systemManager is SystemManager)){
if (container != SystemManager(container.systemManager).application){
container.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
container.systemManager.addFocusManager(container);
sm = form.systemManager;
swfBridgeGroup = new SWFBridgeGroup(sm);
if (!popup){
swfBridgeGroup.parentBridge = sm.swfBridgeGroup.parentBridge;
};
if (sm.useSWFBridge()){
sm.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, removeFromParentBridge);
bridge = swfBridgeGroup.parentBridge;
if (bridge){
bridge.addEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.addEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
};
if (((bridge) && (!((form.systemManager is SystemManagerProxy))))){
bridge.addEventListener(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST, focusRequestActivateHandler);
bridge.addEventListener(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST, focusRequestDeactivateHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
};
container.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
};
//unresolved jump
var _slot1 = e;
}
private function dispatchSetShowFocusIndicatorRequest(value:Boolean, skip:IEventDispatcher):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, false, false, null, value);
dispatchEventFromSWFBridges(request, skip);
}
private function creationCompleteHandler(event:FlexEvent):void{
if (((DisplayObject(form).visible) && (!(activated)))){
form.systemManager.activate(form);
};
}
private function addFocusables(o:DisplayObject, skipTopLevel:Boolean=false):void{
var addToFocusables:Boolean;
var focusable:IFocusManagerComponent;
var doc:DisplayObjectContainer;
var rawChildren:IChildList;
var i:int;
var o = o;
var skipTopLevel = skipTopLevel;
if ((((o is IFocusManagerComponent)) && (!(skipTopLevel)))){
addToFocusables = false;
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
addToFocusables = true;
};
};
};
if (addToFocusables){
if (focusableObjects.indexOf(o) == -1){
focusableObjects.push(o);
calculateCandidates = true;
};
o.addEventListener("tabEnabledChange", tabEnabledChangeHandler);
o.addEventListener("tabIndexChange", tabIndexChangeHandler);
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener("tabChildrenChange", tabChildrenChangeHandler);
if (doc.tabChildren){
if ((o is IRawChildrenContainer)){
rawChildren = IRawChildrenContainer(o).rawChildren;
i = 0;
for (;i < rawChildren.numChildren;(i = (i + 1))) {
addFocusables(rawChildren.getChildAt(i));
continue;
var _slot1 = error;
};
} else {
i = 0;
for (;i < doc.numChildren;(i = (i + 1))) {
addFocusables(doc.getChildAt(i));
continue;
var _slot1 = error;
};
};
};
};
}
private function tabEnabledChangeHandler(event:Event):void{
calculateCandidates = true;
var o:InteractiveObject = InteractiveObject(event.target);
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
if (focusableObjects[i] == o){
break;
};
i++;
};
if (o.tabEnabled){
if ((((i == n)) && (isTabVisible(o)))){
if (focusableObjects.indexOf(o) == -1){
focusableObjects.push(o);
};
};
} else {
if (i < n){
focusableObjects.splice(i, 1);
};
};
}
private function mouseFocusChangeHandler(event:FocusEvent):void{
var tf:TextField;
if ((((((event.relatedObject == null)) && (("isRelatedObjectInaccessible" in event)))) && ((event["isRelatedObjectInaccessible"] == true)))){
return;
};
if ((event.relatedObject is TextField)){
tf = (event.relatedObject as TextField);
if ((((tf.type == "input")) || (tf.selectable))){
return;
};
};
event.preventDefault();
}
public function addSWFBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
if (!owner){
return;
};
var sm:ISystemManager = _form.systemManager;
if (focusableObjects.indexOf(owner) == -1){
focusableObjects.push(owner);
calculateCandidates = true;
};
swfBridgeGroup.addChildBridge(bridge, ISWFBridgeProvider(owner));
bridge.addEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.addEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
}
private function getChildIndex(parent:DisplayObjectContainer, child:DisplayObject):int{
var parent = parent;
var child = child;
return (parent.getChildIndex(child));
//unresolved jump
var _slot1 = e;
if ((parent is IRawChildrenContainer)){
return (IRawChildrenContainer(parent).rawChildren.getChildIndex(child));
};
throw (_slot1);
throw (new Error("FocusManager.getChildIndex failed"));
}
private function bridgeEventActivateHandler(event:Event):void{
if ((event is SWFBridgeEvent)){
return;
};
lastActiveFocusManager = null;
_lastFocus = null;
dispatchActivatedFocusManagerEvent(IEventDispatcher(event.target));
}
private function focusOutHandler(event:FocusEvent):void{
var target:InteractiveObject = InteractiveObject(event.target);
}
private function isValidFocusCandidate(o:DisplayObject, g:String):Boolean{
var tg:IFocusManagerGroup;
if (!isEnabledAndVisible(o)){
return (false);
};
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
if (g == tg.groupName){
return (false);
};
};
return (true);
}
private function removeFocusables(o:DisplayObject, dontRemoveTabChildrenHandler:Boolean):void{
var i:int;
if ((o is DisplayObjectContainer)){
if (!dontRemoveTabChildrenHandler){
o.removeEventListener("tabChildrenChange", tabChildrenChangeHandler);
};
i = 0;
while (i < focusableObjects.length) {
if (isParent(DisplayObjectContainer(o), focusableObjects[i])){
if (focusableObjects[i] == _lastFocus){
_lastFocus.drawFocus(false);
_lastFocus = null;
};
focusableObjects[i].removeEventListener("tabEnabledChange", tabEnabledChangeHandler);
focusableObjects[i].removeEventListener("tabIndexChange", tabIndexChangeHandler);
focusableObjects.splice(i, 1);
i--;
calculateCandidates = true;
};
i++;
};
};
}
private function addedHandler(event:Event):void{
var target:DisplayObject = DisplayObject(event.target);
if (target.stage){
addFocusables(DisplayObject(event.target));
};
}
private function tabChildrenChangeHandler(event:Event):void{
if (event.target != event.currentTarget){
return;
};
calculateCandidates = true;
var o:DisplayObjectContainer = DisplayObjectContainer(event.target);
if (o.tabChildren){
addFocusables(o, true);
} else {
removeFocusables(o, true);
};
}
private function sortByDepth(aa:DisplayObject, bb:DisplayObject):Number{
var index:int;
var tmp:String;
var tmp2:String;
var val1:String = "";
var val2:String = "";
var zeros:String = "0000";
var a:DisplayObject = DisplayObject(aa);
var b:DisplayObject = DisplayObject(bb);
while (((!((a == DisplayObject(form)))) && (a.parent))) {
index = getChildIndex(a.parent, a);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val1 = (tmp2 + val1);
a = a.parent;
};
while (((!((b == DisplayObject(form)))) && (b.parent))) {
index = getChildIndex(b.parent, b);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val2 = (tmp2 + val2);
b = b.parent;
};
return (((val1 > val2)) ? 1 : ((val1 < val2)) ? -1 : 0);
}
mx_internal function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent("click"));
}
public function getFocus():IFocusManagerComponent{
var o:InteractiveObject = form.systemManager.stage.focus;
return (findFocusManagerComponent(o));
}
private function deactivateHandler(event:Event):void{
}
private function setFocusToBottom():void{
setFocusToNextIndex(focusableObjects.length, true);
}
private function tabIndexChangeHandler(event:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var c:InteractiveObject;
focusableCandidates = [];
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
c = focusableObjects[i];
if (((((c.tabIndex) && (!(isNaN(Number(c.tabIndex)))))) && ((c.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(c);
i++;
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(event:FocusEvent):void{
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
showFocusIndicator = true;
focusChanged = false;
if ((((event.keyCode == Keyboard.TAB)) && (!(event.isDefaultPrevented())))){
if (browserFocusComponent){
if (browserFocusComponent.tabIndex == LARGE_TAB_INDEX){
browserFocusComponent.tabIndex = -1;
};
browserFocusComponent = null;
if (SystemManager(form.systemManager).useSWFBridge()){
moveFocusToParent(event.shiftKey);
if (focusChanged){
event.preventDefault();
};
};
return;
};
setFocusToNextObject(event);
if (focusChanged){
event.preventDefault();
};
};
}
private function getNextFocusManagerComponent2(backward:Boolean=false, fromObject:DisplayObject=null, fromIndex:int=-2):FocusInfo{
var o:DisplayObject;
var g:String;
var tg:IFocusManagerGroup;
if (focusableObjects.length == 0){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var i:int = fromIndex;
if (fromIndex == FROM_INDEX_UNSPECIFIED){
o = fromObject;
if (!o){
o = form.systemManager.stage.focus;
};
o = DisplayObject(findFocusManagerComponent2(InteractiveObject(o)));
g = "";
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
g = tg.groupName;
};
i = getIndexOfFocusedObject(o);
};
var bSearchAll:Boolean;
var start:int = i;
if (i == -1){
if (backward){
i = focusableCandidates.length;
};
bSearchAll = true;
};
var j:int = getIndexOfNextObject(i, backward, bSearchAll, g);
var wrapped:Boolean;
if (backward){
if (j >= i){
wrapped = true;
};
} else {
if (j <= i){
wrapped = true;
};
};
var focusInfo:FocusInfo = new FocusInfo();
focusInfo.displayObject = findFocusManagerComponent2(focusableCandidates[j]);
focusInfo.wrapped = wrapped;
return (focusInfo);
}
private function getIndexOfFocusedObject(o:DisplayObject):int{
var iui:IUIComponent;
if (!o){
return (-1);
};
var n:int = focusableCandidates.length;
var i:int;
i = 0;
while (i < n) {
if (focusableCandidates[i] == o){
return (i);
};
i++;
};
i = 0;
while (i < n) {
iui = (focusableCandidates[i] as IUIComponent);
if (((iui) && (iui.owns(o)))){
return (i);
};
i++;
};
return (-1);
}
private function focusRequestActivateHandler(event:Event):void{
skipBridge = IEventDispatcher(event.target);
activate();
skipBridge = null;
}
private function removeFromParentBridge(event:Event):void{
var bridge:IEventDispatcher;
var sm:ISystemManager = form.systemManager;
if (sm.useSWFBridge()){
sm.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, removeFromParentBridge);
bridge = swfBridgeGroup.parentBridge;
if (bridge){
bridge.removeEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.removeEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
};
if (((bridge) && (!((form.systemManager is SystemManagerProxy))))){
bridge.removeEventListener(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST, focusRequestActivateHandler);
bridge.removeEventListener(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST, focusRequestDeactivateHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
};
};
}
private function getParentBridge():IEventDispatcher{
if (swfBridgeGroup){
return (swfBridgeGroup.parentBridge);
};
return (null);
}
private function setFocusToComponent(o:Object, shiftKey:Boolean):void{
var request:SWFBridgeRequest;
var sandboxBridge:IEventDispatcher;
focusChanged = false;
if (o){
if ((((o is ISWFLoader)) && (ISWFLoader(o).swfBridge))){
request = new SWFBridgeRequest(SWFBridgeRequest.MOVE_FOCUS_REQUEST, false, true, null, (shiftKey) ? FocusRequestDirection.BOTTOM : FocusRequestDirection.TOP);
sandboxBridge = ISWFLoader(o).swfBridge;
if (sandboxBridge){
sandboxBridge.dispatchEvent(request);
focusChanged = request.data;
};
} else {
if ((o is IFocusManagerComplexComponent)){
IFocusManagerComplexComponent(o).assignFocus((shiftKey) ? "bottom" : "top");
focusChanged = true;
} else {
if ((o is IFocusManagerComponent)){
setFocus(IFocusManagerComponent(o));
focusChanged = true;
};
};
};
};
}
private function focusRequestMoveHandler(event:Event):void{
var startingPosition:DisplayObject;
if ((event is SWFBridgeRequest)){
return;
};
focusSetLocally = false;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if ((((request.data == FocusRequestDirection.TOP)) || ((request.data == FocusRequestDirection.BOTTOM)))){
if (focusableObjects.length == 0){
moveFocusToParent(((request.data == FocusRequestDirection.TOP)) ? false : true);
event["data"] = focusChanged;
return;
};
if (request.data == FocusRequestDirection.TOP){
setFocusToTop();
} else {
setFocusToBottom();
};
event["data"] = focusChanged;
} else {
startingPosition = DisplayObject(_form.systemManager.swfBridgeGroup.getChildBridgeProvider(IEventDispatcher(event.target)));
moveFocus((request.data as String), startingPosition);
event["data"] = focusChanged;
};
if (focusSetLocally){
dispatchActivatedFocusManagerEvent(null);
lastActiveFocusManager = this;
};
}
public function get nextTabIndex():int{
return ((getMaxTabIndex() + 1));
}
private function dispatchActivatedFocusManagerEvent(skip:IEventDispatcher=null):void{
if (lastActiveFocusManager == this){
return;
};
var event:SWFBridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE);
dispatchEventFromSWFBridges(event, skip);
}
private function focusRequestDeactivateHandler(event:Event):void{
skipBridge = IEventDispatcher(event.target);
deactivate();
skipBridge = null;
}
public function get focusPane():Sprite{
return (_focusPane);
}
private function keyDownHandler(event:KeyboardEvent):void{
var o:DisplayObject;
var g:String;
var i:int;
var j:int;
var tg:IFocusManagerGroup;
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
if ((sm is SystemManager)){
SystemManager(sm).idleCounter = 0;
};
if (event.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (browserMode){
if ((((event.keyCode == Keyboard.TAB)) && ((focusableCandidates.length > 0)))){
o = fauxFocus;
if (!o){
o = form.systemManager.stage.focus;
};
o = DisplayObject(findFocusManagerComponent2(InteractiveObject(o)));
g = "";
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
g = tg.groupName;
};
i = getIndexOfFocusedObject(o);
j = getIndexOfNextObject(i, event.shiftKey, false, g);
if (event.shiftKey){
if (j >= i){
browserFocusComponent = getBrowserFocusComponent(event.shiftKey);
if (browserFocusComponent.tabIndex == -1){
browserFocusComponent.tabIndex = 0;
};
};
} else {
if (j <= i){
browserFocusComponent = getBrowserFocusComponent(event.shiftKey);
if (browserFocusComponent.tabIndex == -1){
browserFocusComponent.tabIndex = LARGE_TAB_INDEX;
};
};
};
};
};
if (((((((defaultButtonEnabled) && ((event.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
defButton.callLater(sendDefaultButtonEvent);
};
}
private function mouseDownHandler(event:MouseEvent):void{
if (event.isDefaultPrevented()){
return;
};
var sm:ISystemManager = form.systemManager;
var o:DisplayObject = getTopLevelFocusTarget(InteractiveObject(event.target));
if (!o){
return;
};
showFocusIndicator = false;
if (((((!((o == _lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((o is TextField))))){
setFocus(IFocusManagerComponent(o));
} else {
if (_lastFocus){
if (((((!(_lastFocus)) && ((o is IEventDispatcher)))) && (SystemManager(form.systemManager).useSWFBridge()))){
IEventDispatcher(o).dispatchEvent(new FocusEvent(FocusEvent.FOCUS_IN));
};
};
};
lastAction = "MOUSEDOWN";
dispatchActivatedFocusManagerEvent(null);
lastActiveFocusManager = this;
}
private function focusInHandler(event:FocusEvent):void{
var x:IButton;
var target:InteractiveObject = InteractiveObject(event.target);
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
if (isParent(DisplayObjectContainer(form), target)){
_lastFocus = findFocusManagerComponent(InteractiveObject(target));
if ((_lastFocus is IButton)){
x = (_lastFocus as IButton);
if (defButton){
defButton.emphasized = false;
defButton = x;
x.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
public function toString():String{
return ((Object(form).toString() + ".focusManager"));
}
public function deactivate():void{
var sm:ISystemManager = form.systemManager;
if (sm){
if (sm.isTopLevelRoot()){
sm.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
sm.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
sm.stage.removeEventListener(Event.ACTIVATE, activateHandler);
sm.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
} else {
sm.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
sm.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
sm.removeEventListener(Event.ACTIVATE, activateHandler);
sm.removeEventListener(Event.DEACTIVATE, deactivateHandler);
};
};
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
dispatchEventFromSWFBridges(new SWFBridgeRequest(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST), skipBridge);
}
private function findFocusManagerComponent2(o:InteractiveObject):DisplayObject{
var o = o;
while (o) {
if ((((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))) || ((o is ISWFLoader)))){
return (o);
};
o = o.parent;
};
//unresolved jump
var _slot1 = error;
return (null);
}
private function getIndexOfNextObject(i:int, shiftKey:Boolean, bSearchAll:Boolean, groupName:String):int{
var o:DisplayObject;
var tg1:IFocusManagerGroup;
var j:int;
var obj:DisplayObject;
var tg2:IFocusManagerGroup;
var n:int = focusableCandidates.length;
var start:int = i;
while (true) {
if (shiftKey){
i--;
} else {
i++;
};
if (bSearchAll){
if (((shiftKey) && ((i < 0)))){
break;
};
if (((!(shiftKey)) && ((i == n)))){
break;
};
} else {
i = ((i + n) % n);
if (start == i){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[i], groupName)){
o = DisplayObject(findFocusManagerComponent2(focusableCandidates[i]));
if ((o is IFocusManagerGroup)){
tg1 = IFocusManagerGroup(o);
j = 0;
while (j < focusableCandidates.length) {
obj = focusableCandidates[j];
if ((obj is IFocusManagerGroup)){
tg2 = IFocusManagerGroup(obj);
if ((((tg2.groupName == tg1.groupName)) && (tg2.selected))){
if (((!((InteractiveObject(obj).tabIndex == InteractiveObject(o).tabIndex))) && (!(tg1.selected)))){
return (getIndexOfNextObject(i, shiftKey, bSearchAll, groupName));
};
i = j;
break;
};
};
j++;
};
};
return (i);
};
};
return (i);
}
public function moveFocus(direction:String, fromDisplayObject:DisplayObject=null):void{
if (direction == FocusRequestDirection.TOP){
setFocusToTop();
return;
};
if (direction == FocusRequestDirection.BOTTOM){
setFocusToBottom();
return;
};
var keyboardEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN);
keyboardEvent.keyCode = Keyboard.TAB;
keyboardEvent.shiftKey = ((direction)==FocusRequestDirection.FORWARD) ? false : true;
fauxFocus = fromDisplayObject;
keyDownHandler(keyboardEvent);
var focusEvent:FocusEvent = new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE);
focusEvent.keyCode = Keyboard.TAB;
focusEvent.shiftKey = ((direction)==FocusRequestDirection.FORWARD) ? false : true;
keyFocusChangeHandler(focusEvent);
fauxFocus = null;
}
private function getMaxTabIndex():int{
var t:Number;
var z:Number = 0;
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
t = focusableObjects[i].tabIndex;
if (!isNaN(t)){
z = Math.max(z, t);
};
i++;
};
return (z);
}
private function isParent(p:DisplayObjectContainer, o:DisplayObject):Boolean{
if ((p is IRawChildrenContainer)){
return (IRawChildrenContainer(p).rawChildren.contains(o));
};
return (p.contains(o));
}
private function showHandler(event:Event):void{
form.systemManager.activate(form);
}
mx_internal function set form(value:IFocusManagerContainer):void{
_form = value;
}
public function setFocus(o:IFocusManagerComponent):void{
o.setFocus();
focusSetLocally = true;
}
public function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent{
return ((findFocusManagerComponent2(o) as IFocusManagerComponent));
}
public function removeSWFBridge(bridge:IEventDispatcher):void{
var index:int;
var sm:ISystemManager = _form.systemManager;
var displayObject:DisplayObject = DisplayObject(swfBridgeGroup.getChildBridgeProvider(bridge));
if (displayObject){
index = focusableObjects.indexOf(displayObject);
if (index != -1){
focusableObjects.splice(index, 1);
calculateCandidates = true;
};
} else {
throw (new Error());
};
bridge.removeEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.removeEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
swfBridgeGroup.removeChildBridge(bridge);
}
private function sortFocusableObjectsTabIndex():void{
var c:IFocusManagerComponent;
focusableCandidates = [];
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
c = (focusableObjects[i] as IFocusManagerComponent);
if (((((((c) && (c.tabIndex))) && (!(isNaN(Number(c.tabIndex)))))) || ((focusableObjects[i] is ISWFLoader)))){
focusableCandidates.push(focusableObjects[i]);
};
i++;
};
focusableCandidates.sort(sortByTabIndex);
}
public function set defaultButton(value:IButton):void{
var button:IButton = (value) ? IButton(value) : null;
if (button != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = button;
defButton = button;
if (button){
button.emphasized = true;
};
};
}
private function setFocusToNextObject(event:FocusEvent):void{
focusChanged = false;
if (focusableObjects.length == 0){
return;
};
var focusInfo:FocusInfo = getNextFocusManagerComponent2(event.shiftKey, fauxFocus);
if (((!(popup)) && (focusInfo.wrapped))){
if (getParentBridge()){
moveFocusToParent(event.shiftKey);
return;
};
};
setFocusToComponent(focusInfo.displayObject, event.shiftKey);
}
private function getTopLevelFocusTarget(o:InteractiveObject):InteractiveObject{
while (o != InteractiveObject(form)) {
if ((((((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))) && (IFocusManagerComponent(o).mouseFocusEnabled))) && (((o is IUIComponent)) ? IUIComponent(o).enabled : true))){
return (o);
};
if ((o.parent is ISWFLoader)){
if (ISWFLoader(o.parent).swfBridge){
return (null);
};
};
o = o.parent;
if (o == null){
break;
};
};
return (null);
}
private function addedToStageHandler(event:Event):void{
_form.removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
if (focusableObjects.length == 0){
addFocusables(DisplayObject(_form));
calculateCandidates = true;
};
}
private function hideHandler(event:Event):void{
form.systemManager.deactivate(form);
}
private function isEnabledAndVisible(o:DisplayObject):Boolean{
var formParent:DisplayObjectContainer = DisplayObject(form).parent;
while (o != formParent) {
if ((o is IUIComponent)){
if (!IUIComponent(o).enabled){
return (false);
};
};
if (!o.visible){
return (false);
};
o = o.parent;
};
return (true);
}
public function hideFocus():void{
if (showFocusIndicator){
showFocusIndicator = false;
if (_lastFocus){
_lastFocus.drawFocus(false);
};
};
}
private function getBrowserFocusComponent(shiftKey:Boolean):InteractiveObject{
var index:int;
var focusComponent:InteractiveObject = form.systemManager.stage.focus;
if (!focusComponent){
index = (shiftKey) ? 0 : (focusableCandidates.length - 1);
focusComponent = focusableCandidates[index];
};
return (focusComponent);
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function moveFocusToParent(shiftKey:Boolean):Boolean{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.MOVE_FOCUS_REQUEST, false, true, null, (shiftKey) ? FocusRequestDirection.BACKWARD : FocusRequestDirection.FORWARD);
var sandboxBridge:IEventDispatcher = _form.systemManager.swfBridgeGroup.parentBridge;
sandboxBridge.dispatchEvent(request);
focusChanged = request.data;
return (focusChanged);
}
public function set focusPane(value:Sprite):void{
_focusPane = value;
}
mx_internal function get form():IFocusManagerContainer{
return (_form);
}
private function removedHandler(event:Event):void{
var i:int;
var o:DisplayObject = DisplayObject(event.target);
if ((o is IFocusManagerComponent)){
i = 0;
while (i < focusableObjects.length) {
if (o == focusableObjects[i]){
if (o == _lastFocus){
_lastFocus.drawFocus(false);
_lastFocus = null;
};
o.removeEventListener("tabEnabledChange", tabEnabledChangeHandler);
o.removeEventListener("tabIndexChange", tabIndexChangeHandler);
focusableObjects.splice(i, 1);
calculateCandidates = true;
break;
};
i++;
};
};
removeFocusables(o, false);
}
private function dispatchEventFromSWFBridges(event:Event, skip:IEventDispatcher=null):void{
var clone:Event;
var parentBridge:IEventDispatcher;
var sm:ISystemManager = form.systemManager;
if (!popup){
parentBridge = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
clone = event.clone();
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = parentBridge;
};
parentBridge.dispatchEvent(clone);
};
};
var children:Array = swfBridgeGroup.getChildBridges();
var i:int;
while (i < children.length) {
if (children[i] != skip){
clone = event.clone();
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = IEventDispatcher(children[i]);
};
IEventDispatcher(children[i]).dispatchEvent(clone);
};
i++;
};
}
public function get defaultButton():IButton{
return (_defaultButton);
}
private function activateHandler(event:Event):void{
if (((_lastFocus) && (!(browserMode)))){
_lastFocus.setFocus();
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
if (!showFocusIndicator){
showFocusIndicator = true;
if (_lastFocus){
_lastFocus.drawFocus(true);
};
};
}
public function getNextFocusManagerComponent(backward:Boolean=false):IFocusManagerComponent{
return ((getNextFocusManagerComponent2(false, fauxFocus) as IFocusManagerComponent));
}
private function setShowFocusIndicatorRequestHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
_showFocusIndicator = request.data;
dispatchSetShowFocusIndicatorRequest(_showFocusIndicator, IEventDispatcher(event.target));
}
private function setFocusToTop():void{
setFocusToNextIndex(-1, false);
}
private function isTabVisible(o:DisplayObject):Boolean{
var s:DisplayObject = DisplayObject(form.systemManager);
if (!s){
return (false);
};
var p:DisplayObjectContainer = o.parent;
while (((p) && (!((p == s))))) {
if (!p.tabChildren){
return (false);
};
p = p.parent;
};
return (true);
}
mx_internal function get lastFocus():IFocusManagerComponent{
return (_lastFocus);
}
public function set defaultButtonEnabled(value:Boolean):void{
_defaultButtonEnabled = value;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
public function set showFocusIndicator(value:Boolean):void{
var changed = !((_showFocusIndicator == value));
_showFocusIndicator = value;
if (((((changed) && (!(popup)))) && (form.systemManager.swfBridgeGroup))){
dispatchSetShowFocusIndicatorRequest(value, null);
};
}
private function sortByTabIndex(a:InteractiveObject, b:InteractiveObject):int{
var aa:int = a.tabIndex;
var bb:int = b.tabIndex;
if (aa == -1){
aa = int.MAX_VALUE;
};
if (bb == -1){
bb = int.MAX_VALUE;
};
return (((aa > bb)) ? 1 : ((aa < bb)) ? -1 : sortByDepth(DisplayObject(a), DisplayObject(b)));
}
public function activate():void{
if (activated){
return;
};
var sm:ISystemManager = form.systemManager;
if (sm){
if (sm.isTopLevelRoot()){
sm.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
sm.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
sm.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
sm.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
} else {
sm.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
sm.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
sm.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
sm.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
};
};
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (_lastFocus){
setFocus(_lastFocus);
};
dispatchEventFromSWFBridges(new SWFBridgeRequest(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST), skipBridge);
}
private function setFocusToNextIndex(index:int, shiftKey:Boolean):void{
if (focusableObjects.length == 0){
return;
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var focusInfo:FocusInfo = getNextFocusManagerComponent2(shiftKey, null, index);
if (((!(popup)) && (focusInfo.wrapped))){
if (getParentBridge()){
moveFocusToParent(shiftKey);
return;
};
};
setFocusToComponent(focusInfo.displayObject, shiftKey);
}
}
}//package mx.managers
import flash.display.*;
class FocusInfo {
public var displayObject:DisplayObject;
public var wrapped:Boolean;
private function FocusInfo(){
super();
}
}
Section 242
//ICursorManager (mx.managers.ICursorManager)
package mx.managers {
public interface ICursorManager {
function removeAllCursors():void;
function set currentCursorYOffset(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
function removeBusyCursor():void;
function unRegisterToUseBusyCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function hideCursor():void;
function get currentCursorID():int;
function registerToUseBusyCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function setBusyCursor():void;
function showCursor():void;
function set currentCursorID(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function setCursor(_arg1:Class, _arg2:int=2, _arg3:Number=0, _arg4:Number=0):int;
function removeCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function get currentCursorXOffset():Number;
function get currentCursorYOffset():Number;
function set currentCursorXOffset(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
}
}//package mx.managers
Section 243
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void;
function set focusPane(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void;
function set showFocusIndicator(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function moveFocus(_arg1:String, _arg2:DisplayObject=null):void;
function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function removeSWFBridge(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IEventDispatcher):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 244
//IFocusManagerComplexComponent (mx.managers.IFocusManagerComplexComponent)
package mx.managers {
public interface IFocusManagerComplexComponent extends IFocusManagerComponent {
function assignFocus(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComplexComponent.as:String):void;
function get hasFocusableContent():Boolean;
}
}//package mx.managers
Section 245
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function drawFocus(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package mx.managers
Section 246
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.display.*;
import flash.events.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerContainer.as:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(mx.managers:DisplayObject):Boolean;
}
}//package mx.managers
Section 247
//IFocusManagerGroup (mx.managers.IFocusManagerGroup)
package mx.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function get selected():Boolean;
function set groupName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:String):void;
function set selected(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:Boolean):void;
}
}//package mx.managers
Section 248
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function set usePhasedInstantiation(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void;
function invalidateSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
}
}//package mx.managers
Section 249
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function set initialized(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void;
function set nestLevel(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void;
function set processedDescriptors(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
}
}//package mx.managers
Section 250
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void;
function get toolTipChildren():IChildList;
function useSWFBridge():Boolean;
function isFontFaceEmbedded(flash.display:TextFormat):Boolean;
function deployMouseShields(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Boolean):void;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function dispatchEventFromSWFBridges(_arg1:Event, _arg2:IEventDispatcher=null, _arg3:Boolean=false, _arg4:Boolean=false):void;
function getSandboxRoot():DisplayObject;
function get swfBridgeGroup():ISWFBridgeGroup;
function removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function addChildToSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function get document():Object;
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function addChildBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function getTopLevelRoot():DisplayObject;
function removeChildBridge(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IEventDispatcher):void;
function isDisplayObjectInABridgedApplication(flash.display:DisplayObject):Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function getDefinitionByName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ISystemManager.as:String):Object;
function activate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function deactivate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:int):void;
function isTopLevel():Boolean;
function isTopLevelRoot():Boolean;
function get numModalWindows():int;
function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get stage():Stage;
function getVisibleApplicationRect(value:Rectangle=null):Rectangle;
}
}//package mx.managers
Section 251
//IToolTipManager2 (mx.managers.IToolTipManager2)
package mx.managers {
import flash.display.*;
import mx.core.*;
import mx.effects.*;
public interface IToolTipManager2 {
function registerToolTip(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function get enabled():Boolean;
function set enabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Boolean):void;
function get scrubDelay():Number;
function set hideEffect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
function createToolTip(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String=null, _arg5:IUIComponent=null):IToolTip;
function set scrubDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function set hideDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get currentTarget():DisplayObject;
function set showDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get showDelay():Number;
function get showEffect():IAbstractEffect;
function get hideDelay():Number;
function get currentToolTip():IToolTip;
function get hideEffect():IAbstractEffect;
function set currentToolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function get toolTipClass():Class;
function registerErrorString(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function destroyToolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set toolTipClass(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Class):void;
function sizeTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set currentTarget(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:DisplayObject):void;
function set showEffect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
}
}//package mx.managers
Section 252
//IToolTipManagerClient (mx.managers.IToolTipManagerClient)
package mx.managers {
import mx.core.*;
public interface IToolTipManagerClient extends IFlexDisplayObject {
function get toolTip():String;
function set toolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void;
}
}//package mx.managers
Section 253
//LayoutManager (mx.managers.LayoutManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.managers.layoutClasses.*;
public class LayoutManager extends EventDispatcher implements ILayoutManager {
private var invalidateClientPropertiesFlag:Boolean;// = false
private var invalidateDisplayListQueue:PriorityQueue;
private var updateCompleteQueue:PriorityQueue;
private var invalidateDisplayListFlag:Boolean;// = false
private var invalidateClientSizeFlag:Boolean;// = false
private var invalidateSizeQueue:PriorityQueue;
private var originalFrameRate:Number;
private var invalidatePropertiesFlag:Boolean;// = false
private var invalidatePropertiesQueue:PriorityQueue;
private var invalidateSizeFlag:Boolean;// = false
private var callLaterPending:Boolean;// = false
private var _usePhasedInstantiation:Boolean;// = false
private var callLaterObject:UIComponent;
private var targetLevel:int;// = 2147483647
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:LayoutManager;
public function LayoutManager(){
updateCompleteQueue = new PriorityQueue();
invalidatePropertiesQueue = new PriorityQueue();
invalidateSizeQueue = new PriorityQueue();
invalidateDisplayListQueue = new PriorityQueue();
super();
}
public function set usePhasedInstantiation(value:Boolean):void{
var sm:ISystemManager;
var stage:Stage;
var value = value;
if (_usePhasedInstantiation != value){
_usePhasedInstantiation = value;
sm = SystemManagerGlobals.topLevelSystemManagers[0];
stage = SystemManagerGlobals.topLevelSystemManagers[0].stage;
if (stage){
if (value){
originalFrameRate = stage.frameRate;
stage.frameRate = 1000;
} else {
stage.frameRate = originalFrameRate;
};
};
//unresolved jump
var _slot1 = e;
};
}
private function waitAFrame():void{
callLaterObject.callLater(doPhasedInstantiation);
}
public function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean=false):void{
var obj:ILayoutManagerClient;
var i:int;
var done:Boolean;
var oldTargetLevel:int = targetLevel;
if (targetLevel == int.MAX_VALUE){
targetLevel = target.nestLevel;
};
while (!(done)) {
done = true;
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
invalidateClientPropertiesFlag = false;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
invalidateClientSizeFlag = false;
};
if (!skipDisplayList){
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
if (invalidateClientSizeFlag){
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
if (obj){
invalidateSizeQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
};
};
if (oldTargetLevel == int.MAX_VALUE){
targetLevel = int.MAX_VALUE;
if (!skipDisplayList){
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
while (obj) {
if (!obj.initialized){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
};
};
};
}
private function validateProperties():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
};
}
public function invalidateProperties(obj:ILayoutManagerClient):void{
if (((!(invalidatePropertiesFlag)) && (ApplicationGlobals.application.systemManager))){
invalidatePropertiesFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientPropertiesFlag = true;
};
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
}
public function invalidateDisplayList(obj:ILayoutManagerClient):void{
if (((!(invalidateDisplayListFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateDisplayListFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
} else {
if (((!(invalidateDisplayListFlag)) && (!(ApplicationGlobals.application.systemManager)))){
};
};
invalidateDisplayListQueue.addObject(obj, obj.nestLevel);
}
private function validateDisplayList():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
}
public function validateNow():void{
var infiniteLoopGuard:int;
if (!usePhasedInstantiation){
infiniteLoopGuard = 0;
while (((callLaterPending) && ((infiniteLoopGuard < 100)))) {
doPhasedInstantiation();
};
};
}
private function validateSize():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
};
}
private function doPhasedInstantiation():void{
var obj:ILayoutManagerClient;
if (usePhasedInstantiation){
if (invalidatePropertiesFlag){
validateProperties();
ApplicationGlobals.application.dispatchEvent(new Event("validatePropertiesComplete"));
} else {
if (invalidateSizeFlag){
validateSize();
ApplicationGlobals.application.dispatchEvent(new Event("validateSizeComplete"));
} else {
if (invalidateDisplayListFlag){
validateDisplayList();
ApplicationGlobals.application.dispatchEvent(new Event("validateDisplayListComplete"));
};
};
};
} else {
if (invalidatePropertiesFlag){
validateProperties();
};
if (invalidateSizeFlag){
validateSize();
};
if (invalidateDisplayListFlag){
validateDisplayList();
};
};
if (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag))){
callLaterObject.callLater(doPhasedInstantiation);
} else {
usePhasedInstantiation = false;
callLaterPending = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
while (obj) {
if (((!(obj.initialized)) && (obj.processedDescriptors))){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
};
dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
};
}
public function isInvalid():Boolean{
return (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag)));
}
public function get usePhasedInstantiation():Boolean{
return (_usePhasedInstantiation);
}
public function invalidateSize(obj:ILayoutManagerClient):void{
if (((!(invalidateSizeFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateSizeFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientSizeFlag = true;
};
invalidateSizeQueue.addObject(obj, obj.nestLevel);
}
public static function getInstance():LayoutManager{
if (!instance){
instance = new (LayoutManager);
};
return (instance);
}
}
}//package mx.managers
Section 254
//PopUpManagerChildList (mx.managers.PopUpManagerChildList)
package mx.managers {
import mx.core.*;
public final class PopUpManagerChildList {
public static const PARENT:String = "parent";
public static const APPLICATION:String = "application";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const POPUP:String = "popup";
public function PopUpManagerChildList(){
super();
}
}
}//package mx.managers
Section 255
//SystemChildrenList (mx.managers.SystemChildrenList)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
public class SystemChildrenList implements IChildList {
private var lowerBoundReference:QName;
private var upperBoundReference:QName;
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemChildrenList(owner:SystemManager, lowerBoundReference:QName, upperBoundReference:QName){
super();
this.owner = owner;
this.lowerBoundReference = lowerBoundReference;
this.upperBoundReference = upperBoundReference;
}
public function getChildAt(index:int):DisplayObject{
var _local3 = owner;
var retval:DisplayObject = _local3.mx_internal::rawChildren_getChildAt((owner[lowerBoundReference] + index));
return (retval);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
var _local3 = owner;
var child:DisplayObject = _local3.mx_internal::rawChildren_removeChildAt((index + owner[lowerBoundReference]));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
return (child);
}
public function getChildIndex(child:DisplayObject):int{
var retval:int = owner.mx_internal::rawChildren_getChildIndex(child);
retval = (retval - owner[lowerBoundReference]);
return (retval);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var _local3 = owner;
_local3.mx_internal::rawChildren_addChildAt(child, (owner[lowerBoundReference] + index));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (child);
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, (owner[lowerBoundReference] + newIndex));
}
public function get numChildren():int{
return ((owner[upperBoundReference] - owner[lowerBoundReference]));
}
public function contains(child:DisplayObject):Boolean{
var childIndex:int;
if (((!((child == owner))) && (owner.mx_internal::rawChildren_contains(child)))){
while (child.parent != owner) {
child = child.parent;
};
childIndex = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((childIndex >= owner[lowerBoundReference])) && ((childIndex < owner[upperBoundReference])))){
return (true);
};
};
return (false);
}
public function removeChild(child:DisplayObject):DisplayObject{
var index:int = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((owner[lowerBoundReference] <= index)) && ((index < owner[upperBoundReference])))){
var _local3 = owner;
_local3.mx_internal::rawChildren_removeChild(child);
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
return (child);
}
public function addChild(child:DisplayObject):DisplayObject{
var _local2 = owner;
_local2.mx_internal::rawChildren_addChildAt(child, owner[upperBoundReference]);
_local2 = owner;
var _local3 = upperBoundReference;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
return (child);
}
}
}//package mx.managers
Section 256
//SystemManager (mx.managers.SystemManager)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
import mx.managers.systemClasses.*;
import mx.events.*;
import mx.styles.*;
import mx.resources.*;
import flash.system.*;
import mx.preloaders.*;
import flash.utils.*;
import mx.messaging.config.*;
import mx.utils.*;
public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager, ISWFBridgeProvider {
private var _stage:Stage;
mx_internal var nestLevel:int;// = 0
private var currentSandboxEvent:Event;
private var forms:Array;
private var mouseCatcher:Sprite;
private var _height:Number;
private var dispatchingToSystemManagers:Boolean;// = false
private var preloader:Preloader;
private var lastFrame:int;
private var _document:Object;
private var strongReferenceProxies:Dictionary;
private var _rawChildren:SystemRawChildrenList;
private var _topLevelSystemManager:ISystemManager;
private var _toolTipIndex:int;// = 0
private var _explicitHeight:Number;
private var idToPlaceholder:Object;
private var _swfBridgeGroup:ISWFBridgeGroup;
private var _toolTipChildren:SystemChildrenList;
private var form:Object;
private var _width:Number;
private var initialized:Boolean;// = false
private var _focusPane:Sprite;
private var _fontList:Object;// = null
private var isStageRoot:Boolean;// = true
private var _popUpChildren:SystemChildrenList;
private var rslSizes:Array;// = null
private var _topMostIndex:int;// = 0
private var nextFrameTimer:Timer;// = null
mx_internal var topLevel:Boolean;// = true
private var weakReferenceProxies:Dictionary;
private var _cursorIndex:int;// = 0
private var isBootstrapRoot:Boolean;// = false
mx_internal var _mouseY;
private var _numModalWindows:int;// = 0
mx_internal var _mouseX;
private var _screen:Rectangle;
mx_internal var idleCounter:int;// = 0
private var _cursorChildren:SystemChildrenList;
private var initCallbackFunctions:Array;
private var bridgeToFocusManager:Dictionary;
private var _noTopMostIndex:int;// = 0
private var _applicationIndex:int;// = 1
private var isDispatchingResizeEvent:Boolean;
private var idleTimer:Timer;
private var doneExecutingInitCallbacks:Boolean;// = false
private var _explicitWidth:Number;
private var eventProxy:EventProxy;
mx_internal var topLevelWindow:IUIComponent;
private static const IDLE_THRESHOLD:Number = 1000;
private static const IDLE_INTERVAL:Number = 100;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var lastSystemManager:SystemManager;
mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
public function SystemManager(){
initCallbackFunctions = [];
forms = [];
weakReferenceProxies = new Dictionary(true);
strongReferenceProxies = new Dictionary(false);
super();
if (stage){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
if ((((SystemManagerGlobals.topLevelSystemManagers.length > 0)) && (!(stage)))){
topLevel = false;
};
if (!stage){
isStageRoot = false;
};
if (topLevel){
SystemManagerGlobals.topLevelSystemManagers.push(this);
};
lastSystemManager = this;
var compiledLocales:Array = info()["compiledLocales"];
ResourceBundle.locale = (((!((compiledLocales == null))) && ((compiledLocales.length > 0)))) ? compiledLocales[0] : "en_US";
executeCallbacks();
stop();
if (((topLevel) && (!((currentFrame == 1))))){
throw (new Error((("The SystemManager constructor was called when the currentFrame was at " + currentFrame) + " Please add this SWF to bug 129782.")));
};
if (((root) && (root.loaderInfo))){
root.loaderInfo.addEventListener(Event.INIT, initHandler);
};
}
private function removeEventListenerFromSandboxes(type:String, listener:Function, useCapture:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, false, false, type, useCapture);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.removeEventListener(type, listener, useCapture);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
if (children[i] != skip){
IEventDispatcher(children[i]).removeEventListener(type, listener, useCapture);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
mx_internal function addingChild(child:DisplayObject):void{
var obj:DisplayObjectContainer;
var newNestLevel = 1;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is ILayoutManagerClient)){
newNestLevel = (ILayoutManagerClient(obj).nestLevel + 1);
break;
};
obj = obj.parent;
};
};
nestLevel = newNestLevel;
if ((child is IUIComponent)){
IUIComponent(child).systemManager = this;
};
var uiComponentClassName:Class = Class(getDefinitionByName("mx.core.UIComponent"));
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = document;
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).initThemeColor();
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).stylesInitialized();
};
}
private function dispatchEventToOtherSystemManagers(event:Event):void{
dispatchingToSystemManagers = true;
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].dispatchEvent(event);
};
i++;
};
dispatchingToSystemManagers = false;
}
private function idleTimer_timerHandler(event:TimerEvent):void{
idleCounter++;
if ((idleCounter * IDLE_INTERVAL) > IDLE_THRESHOLD){
dispatchEvent(new FlexEvent(FlexEvent.IDLE));
};
}
private function initManagerHandler(event:Event):void{
var event = event;
if (!dispatchingToSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
Singleton.getInstance(name);
//unresolved jump
var _slot1 = e;
}
private function getSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
eObj.data = {width:measuredWidth, height:measuredHeight};
}
private function beforeUnloadHandler(event:Event):void{
var sandboxRoot:DisplayObject;
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.removeEventListener(Event.RESIZE, Stage_resizeHandler);
};
};
removeParentBridgeListeners();
dispatchEvent(event);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function getVisibleRectRequestHandler(event:Event):void{
var localRect:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var rect:Rectangle = Rectangle(request.data);
var owner:DisplayObject = DisplayObject(swfBridgeGroup.getChildBridgeProvider(request.requestor));
var forwardRequest:Boolean;
if (!DisplayObjectContainer(document).contains(owner)){
forwardRequest = false;
};
if ((owner is ISWFLoader)){
localRect = ISWFLoader(owner).getVisibleApplicationRect();
} else {
localRect = owner.getBounds(this);
pt = localToGlobal(localRect.topLeft);
localRect.x = pt.x;
localRect.y = pt.y;
};
rect = rect.intersection(localRect);
request.data = rect;
if (((forwardRequest) && (useSWFBridge()))){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
Object(event).data = request.data;
}
mx_internal function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.styleChanged(styleProp);
child.notifyStyleChangeInChildren(styleProp, recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).styleChanged(styleProp);
IStyleClient(topLevelWindow).notifyStyleChangeInChildren(styleProp, recursive);
};
}
mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array{
return (super.getObjectsUnderPoint(pt));
}
private function initHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent;
var event = event;
if (!isStageRoot){
if (root.loaderInfo.parentAllowsChild){
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true))){
isBootstrapRoot = true;
};
//unresolved jump
var _slot1 = e;
};
};
allSystemManagers[this] = this.loaderInfo.url;
root.loaderInfo.removeEventListener(Event.INIT, initHandler);
if (useSWFBridge()){
swfBridgeGroup = new SWFBridgeGroup(this);
swfBridgeGroup.parentBridge = loaderInfo.sharedEvents;
addParentBridgeListeners();
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_NEW_APPLICATION);
bridgeEvent.data = swfBridgeGroup.parentBridge;
swfBridgeGroup.parentBridge.dispatchEvent(bridgeEvent);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
root.loaderInfo.addEventListener(Event.UNLOAD, unloadHandler, false, 0, true);
};
getSandboxRoot().addEventListener(InterManagerRequest.INIT_MANAGER_REQUEST, initManagerHandler, false, 0, true);
if (getSandboxRoot() == this){
addEventListener(InterManagerRequest.SYSTEM_MANAGER_REQUEST, systemManagerHandler);
addEventListener(InterManagerRequest.DRAG_MANAGER_REQUEST, multiWindowRedispatcher);
addEventListener("dispatchDragEvent", multiWindowRedispatcher);
addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
};
var docFrame:int = ((totalFrames)==1) ? 0 : 1;
addEventListener(Event.ENTER_FRAME, docFrameListener);
initialize();
}
mx_internal function findFocusManagerContainer(smp:SystemManagerProxy):IFocusManagerContainer{
var child:DisplayObject;
var children:IChildList = smp.rawChildren;
var numChildren:int = children.numChildren;
var i:int;
while (i < numChildren) {
child = children.getChildAt(i);
if ((child is IFocusManagerContainer)){
return (IFocusManagerContainer(child));
};
i++;
};
return (null);
}
private function addPlaceholderPopupRequestHandler(event:Event):void{
var remoteForm:RemotePopUp;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
if (!forwardPlaceholderRequest(popUpRequest, true)){
remoteForm = new RemotePopUp(popUpRequest.data.placeHolderId, popUpRequest.requestor);
forms.push(remoteForm);
};
}
override public function contains(child:DisplayObject):Boolean{
var childIndex:int;
var i:int;
var myChild:DisplayObject;
if (super.contains(child)){
if (child.parent == this){
childIndex = super.getChildIndex(child);
if (childIndex < noTopMostIndex){
return (true);
};
} else {
i = 0;
while (i < noTopMostIndex) {
myChild = super.getChildAt(i);
if ((myChild is IRawChildrenContainer)){
if (IRawChildrenContainer(myChild).rawChildren.contains(child)){
return (true);
};
};
if ((myChild is DisplayObjectContainer)){
if (DisplayObjectContainer(myChild).contains(child)){
return (true);
};
};
i++;
};
};
};
return (false);
}
private function modalWindowRequestHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!preProcessModalWindowRequest(request, getSandboxRoot())){
return;
};
Singleton.getInstance("mx.managers::IPopUpManager");
dispatchEvent(request);
}
private function activateApplicationSandboxEventHandler(event:Event):void{
if (!isTopLevelRoot()){
swfBridgeGroup.parentBridge.dispatchEvent(event);
return;
};
activateForm(document);
}
public function getDefinitionByName(name:String):Object{
var definition:Object;
var domain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : (info()["currentDomain"] as ApplicationDomain);
if (domain.hasDefinition(name)){
definition = domain.getDefinition(name);
};
return (definition);
}
public function removeChildFromSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].removeChild(child);
} else {
removingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".removeChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childRemoved(child);
};
}
private function removeEventListenerFromOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].removeEventListener(type, listener, useCapture);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
private function addEventListenerToOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].addEventListener(type, listener, useCapture, priority, useWeakReference);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
public function get embeddedFontList():Object{
var o:Object;
var p:String;
var fl:Object;
if (_fontList == null){
_fontList = {};
o = info()["fonts"];
for (p in o) {
_fontList[p] = o[p];
};
if (((!(topLevel)) && (_topLevelSystemManager))){
fl = _topLevelSystemManager.embeddedFontList;
for (p in fl) {
_fontList[p] = fl[p];
};
};
};
return (_fontList);
}
mx_internal function set cursorIndex(value:int):void{
var delta:int = (value - _cursorIndex);
_cursorIndex = value;
}
mx_internal function addChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addChildBridgeListeners(bridge);
return;
};
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
public function set document(value:Object):void{
_document = value;
}
override public function getChildAt(index:int):DisplayObject{
return (super.getChildAt((applicationIndex + index)));
}
public function get rawChildren():IChildList{
if (!_rawChildren){
_rawChildren = new SystemRawChildrenList(this);
};
return (_rawChildren);
}
private function findLastActiveForm(f:Object):Object{
var n:int = forms.length;
var i:int = (forms.length - 1);
while (i >= 0) {
if (((!((forms[i] == f))) && (canActivatePopUp(forms[i])))){
return (forms[i]);
};
i--;
};
return (null);
}
private function multiWindowRedispatcher(event:Event):void{
if (!dispatchingToSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
}
public function deployMouseShields(deploy:Boolean):void{
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.DRAG_MANAGER_REQUEST, false, false, "mouseShield", deploy);
getSandboxRoot().dispatchEvent(me);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var newListener:StageEventProxy;
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
var priority = priority;
var useWeakReference = useWeakReference;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.addEventListener(type, listener, useCapture, priority, useWeakReference);
} else {
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
};
//unresolved jump
var _slot1 = error;
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
if (((stage) && ((type == Event.RENDER)))){
stage.invalidate();
};
return;
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (stage){
newListener = new StageEventProxy(listener);
stage.addEventListener(type, newListener.stageListener, false, priority, useWeakReference);
if (useWeakReference){
weakReferenceProxies[listener] = newListener;
} else {
strongReferenceProxies[listener] = newListener;
};
};
//unresolved jump
var _slot1 = error;
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
addEventListenerToSandboxes(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(type, sandboxMouseListener, useCapture, priority, useWeakReference);
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
addEventListenerToOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture, priority, useWeakReference);
};
if (getSandboxRoot() == this){
super.addEventListener(actualType, eventProxy.marshalListener, useCapture, priority, useWeakReference);
};
super.addEventListener(type, listener, false, priority, useWeakReference);
return;
};
};
if ((((type == FlexEvent.IDLE)) && (!(idleTimer)))){
idleTimer = new Timer(IDLE_INTERVAL);
idleTimer.addEventListener(TimerEvent.TIMER, idleTimer_timerHandler);
idleTimer.start();
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
};
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
private function activateForm(f:Object):void{
var z:IFocusManagerContainer;
if (form){
if (((!((form == f))) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
if (!areRemotePopUpsEqual(form, f)){
deactivateRemotePopUp(form);
};
} else {
z = IFocusManagerContainer(form);
z.focusManager.deactivate();
};
};
};
form = f;
if (isRemotePopUp(f)){
activateRemotePopUp(f);
} else {
if (f.focusManager){
f.focusManager.activate();
};
};
updateLastActiveForm();
}
public function removeFocusManager(f:IFocusManagerContainer):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (forms[i] == f){
if (form == f){
deactivate(f);
};
dispatchDeactivatedWindowEvent(DisplayObject(f));
forms.splice(i, 1);
return;
};
i++;
};
}
private function mouseMoveHandler(event:MouseEvent):void{
idleCounter = 0;
}
private function getSandboxScreen():Rectangle{
var sandboxScreen:Rectangle;
var sm:DisplayObject;
var me:InterManagerRequest;
var sandboxRoot:DisplayObject = getSandboxRoot();
if (sandboxRoot == this){
sandboxScreen = new Rectangle(0, 0, width, height);
} else {
if (sandboxRoot == topLevelSystemManager){
sm = DisplayObject(topLevelSystemManager);
sandboxScreen = new Rectangle(0, 0, sm.width, sm.height);
} else {
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "screen");
sandboxRoot.dispatchEvent(me);
sandboxScreen = Rectangle(me.value);
};
};
return (sandboxScreen);
}
public function get focusPane():Sprite{
return (_focusPane);
}
override public function get mouseX():Number{
if (_mouseX === undefined){
return (super.mouseX);
};
return (_mouseX);
}
private function mouseDownHandler(event:MouseEvent):void{
var n:int;
var p:DisplayObject;
var isApplication:Boolean;
var i:int;
var form_i:Object;
var j:int;
var index:int;
var newIndex:int;
var childList:IChildList;
var f:DisplayObject;
var isRemotePopUp:Boolean;
var fChildIndex:int;
idleCounter = 0;
var bridge:IEventDispatcher = getSWFBridgeOfDisplayObject((event.target as DisplayObject));
if (((bridge) && ((bridgeToFocusManager[bridge] == document.focusManager)))){
if (isTopLevelRoot()){
activateForm(document);
} else {
dispatchActivatedApplicationEvent();
};
return;
};
if (numModalWindows == 0){
if (((!(isTopLevelRoot())) || ((forms.length > 1)))){
n = forms.length;
p = DisplayObject(event.target);
isApplication = document.rawChildren.contains(p);
while (p) {
i = 0;
while (i < n) {
form_i = (isRemotePopUp(forms[i])) ? forms[i].window : forms[i];
if (form_i == p){
j = 0;
if (((((!((p == form))) && ((p is IFocusManagerContainer)))) || (((!(isTopLevelRoot())) && ((p == form)))))){
if (isTopLevelRoot()){
activate(IFocusManagerContainer(p));
};
if (p == document){
dispatchActivatedApplicationEvent();
} else {
if ((p is DisplayObject)){
dispatchActivatedWindowEvent(DisplayObject(p));
};
};
};
if (popUpChildren.contains(p)){
childList = popUpChildren;
} else {
childList = this;
};
index = childList.getChildIndex(p);
newIndex = index;
n = forms.length;
j = 0;
for (;j < n;j++) {
isRemotePopUp = isRemotePopUp(forms[j]);
if (isRemotePopUp){
if ((forms[j].window is String)){
continue;
};
f = forms[j].window;
} else {
f = forms[j];
};
if (isRemotePopUp){
fChildIndex = getChildListIndex(childList, f);
if (fChildIndex > index){
newIndex = Math.max(fChildIndex, newIndex);
};
} else {
if (childList.contains(f)){
if (childList.getChildIndex(f) > index){
newIndex = Math.max(childList.getChildIndex(f), newIndex);
};
};
};
};
if ((((newIndex > index)) && (!(isApplication)))){
childList.setChildIndex(p, newIndex);
};
return;
};
i++;
};
p = p.parent;
};
} else {
dispatchActivatedApplicationEvent();
};
};
}
private function removePopupRequestHandler(event:Event):void{
var request:SWFBridgeRequest;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (popUpChildren.contains(popUpRequest.data.window)){
popUpChildren.removeChild(popUpRequest.data.window);
} else {
removeChild(DisplayObject(popUpRequest.data.window));
};
if (popUpRequest.data.modal){
numModalWindows--;
};
removeRemotePopUp(new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor));
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {placeHolderId:NameUtil.displayObjectToString(popUpRequest.data.window)});
dispatchEvent(request);
};
}
public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
var fm:IFocusManager;
var o:DisplayObject = owner;
while (o) {
if ((o is IFocusManagerContainer)){
fm = IFocusManagerContainer(o).focusManager;
break;
};
o = o.parent;
};
if (!fm){
return;
};
if (!swfBridgeGroup){
swfBridgeGroup = new SWFBridgeGroup(this);
};
swfBridgeGroup.addChildBridge(bridge, ISWFBridgeProvider(owner));
fm.addSWFBridge(bridge, owner);
if (!bridgeToFocusManager){
bridgeToFocusManager = new Dictionary();
};
bridgeToFocusManager[bridge] = fm;
addChildBridgeListeners(bridge);
}
public function get screen():Rectangle{
if (!_screen){
Stage_resizeHandler();
};
if (!isStageRoot){
Stage_resizeHandler();
};
return (_screen);
}
private function resetMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = true;
};
};
}
mx_internal function set topMostIndex(value:int):void{
var delta:int = (value - _topMostIndex);
_topMostIndex = value;
toolTipIndex = (toolTipIndex + delta);
}
mx_internal function docFrameHandler(event:Event=null):void{
var textFieldFactory:TextFieldFactory;
var n:int;
var i:int;
var c:Class;
Singleton.registerClass("mx.managers::IBrowserManager", Class(getDefinitionByName("mx.managers::BrowserManagerImpl")));
Singleton.registerClass("mx.managers::ICursorManager", Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
Singleton.registerClass("mx.managers::IHistoryManager", Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
Singleton.registerClass("mx.managers::ILayoutManager", Class(getDefinitionByName("mx.managers::LayoutManager")));
Singleton.registerClass("mx.managers::IPopUpManager", Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
Singleton.registerClass("mx.managers::IToolTipManager2", Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
if (Capabilities.playerType == "Desktop"){
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::NativeDragManagerImpl")));
if (Singleton.getClass("mx.managers::IDragManager") == null){
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::DragManagerImpl")));
};
} else {
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::DragManagerImpl")));
};
Singleton.registerClass("mx.core::ITextFieldFactory", Class(getDefinitionByName("mx.core::TextFieldFactory")));
executeCallbacks();
doneExecutingInitCallbacks = true;
var mixinList:Array = info()["mixins"];
if (((mixinList) && ((mixinList.length > 0)))){
n = mixinList.length;
i = 0;
while (i < n) {
c = Class(getDefinitionByName(mixinList[i]));
var _local7 = c;
_local7["init"](this);
i++;
};
};
installCompiledResourceBundles();
initializeTopLevelWindow(null);
deferredNextFrame();
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get preloaderBackgroundSize():String{
return (info()["backgroundSize"]);
}
public function isTopLevel():Boolean{
return (topLevel);
}
override public function get mouseY():Number{
if (_mouseY === undefined){
return (super.mouseY);
};
return (_mouseY);
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function deactivate(f:IFocusManagerContainer):void{
deactivateForm(Object(f));
}
private function preProcessModalWindowRequest(request:SWFBridgeRequest, sbRoot:DisplayObject):Boolean{
var bridge:IEventDispatcher;
var exclude:ISWFLoader;
var excludeRect:Rectangle;
if (request.data.skip){
request.data.skip = false;
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
return (false);
};
if (this != sbRoot){
if ((((request.type == SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST)) || ((request.type == SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST)))){
exclude = (swfBridgeGroup.getChildBridgeProvider(request.requestor) as ISWFLoader);
if (exclude){
excludeRect = ISWFLoader(exclude).getVisibleApplicationRect();
request.data.excludeRect = excludeRect;
if (!DisplayObjectContainer(document).contains(DisplayObject(exclude))){
request.data.useExclude = false;
};
};
};
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (request.type == SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST){
sbRoot.dispatchEvent(request);
} else {
bridge.dispatchEvent(request);
};
return (false);
};
request.data.skip = false;
return (true);
}
private function resetMouseCursorTracking(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (isTopLevelRoot()){
SystemManagerGlobals.showMouseCursor = true;
} else {
if (swfBridgeGroup.parentBridge){
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST);
bridge = swfBridgeGroup.parentBridge;
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
};
}
mx_internal function addParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.addEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
public function get swfBridgeGroup():ISWFBridgeGroup{
if (topLevel){
return (_swfBridgeGroup);
};
if (topLevelSystemManager){
return (topLevelSystemManager.swfBridgeGroup);
};
return (null);
}
override public function getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
public function get measuredWidth():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width);
}
public function removeChildBridge(bridge:IEventDispatcher):void{
var fm:IFocusManager = IFocusManager(bridgeToFocusManager[bridge]);
fm.removeSWFBridge(bridge);
swfBridgeGroup.removeChildBridge(bridge);
delete bridgeToFocusManager[bridge];
removeChildBridgeListeners(bridge);
}
mx_internal function removeChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeChildBridgeListeners(bridge);
return;
};
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
noTopMostIndex++;
return (rawChildren_addChildAt(child, (applicationIndex + index)));
}
private function Stage_resizeHandler(event:Event=null):void{
var m:Number;
var n:Number;
var sandboxScreen:Rectangle;
var event = event;
if (isDispatchingResizeEvent){
return;
};
var w:Number = 0;
var h:Number = 0;
m = loaderInfo.width;
n = loaderInfo.height;
//unresolved jump
var _slot1 = error;
return;
var align:String = StageAlign.TOP_LEFT;
if (stage){
w = stage.stageWidth;
h = stage.stageHeight;
align = stage.align;
};
//unresolved jump
var _slot1 = error;
sandboxScreen = getSandboxScreen();
w = sandboxScreen.width;
h = sandboxScreen.height;
var x:Number = ((m - w) / 2);
var y:Number = ((n - h) / 2);
if (align == StageAlign.TOP){
y = 0;
} else {
if (align == StageAlign.BOTTOM){
y = (n - h);
} else {
if (align == StageAlign.LEFT){
x = 0;
} else {
if (align == StageAlign.RIGHT){
x = (m - w);
} else {
if ((((align == StageAlign.TOP_LEFT)) || ((align == "LT")))){
y = 0;
x = 0;
} else {
if (align == StageAlign.TOP_RIGHT){
y = 0;
x = (m - w);
} else {
if (align == StageAlign.BOTTOM_LEFT){
y = (n - h);
x = 0;
} else {
if (align == StageAlign.BOTTOM_RIGHT){
y = (n - h);
x = (m - w);
};
};
};
};
};
};
};
};
if (!_screen){
_screen = new Rectangle();
};
_screen.x = x;
_screen.y = y;
_screen.width = w;
_screen.height = h;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
};
if (event){
resizeMouseCatcher();
isDispatchingResizeEvent = true;
dispatchEvent(event);
isDispatchingResizeEvent = false;
};
}
public function get swfBridge():IEventDispatcher{
if (swfBridgeGroup){
return (swfBridgeGroup.parentBridge);
};
return (null);
}
private function findRemotePopUp(window:Object, bridge:IEventDispatcher):RemotePopUp{
var popUp:RemotePopUp;
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
popUp = RemotePopUp(forms[i]);
if ((((popUp.window == window)) && ((popUp.bridge == bridge)))){
return (popUp);
};
};
i++;
};
return (null);
}
public function info():Object{
return ({});
}
mx_internal function get toolTipIndex():int{
return (_toolTipIndex);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
if (isStageRoot){
return;
};
_width = newWidth;
_height = newHeight;
if (mouseCatcher){
mouseCatcher.width = newWidth;
mouseCatcher.height = newHeight;
};
dispatchEvent(new Event(Event.RESIZE));
}
private function removePlaceholderPopupRequestHandler(event:Event):void{
var n:int;
var i:int;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!forwardPlaceholderRequest(popUpRequest, false)){
n = forms.length;
i = 0;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == popUpRequest.data.placeHolderId)) && ((forms[i].bridge == popUpRequest.requestor)))){
forms.splice(i, 1);
break;
};
};
i++;
};
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane = null;
};
}
mx_internal function removeParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.removeEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
override public function get parent():DisplayObjectContainer{
return (super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
private function eventListenerRequestHandler(event:Event):void{
var actualType:String;
if ((event is EventListenerRequest)){
return;
};
var request:EventListenerRequest = EventListenerRequest.marshal(event);
if (event.type == EventListenerRequest.ADD_EVENT_LISTENER_REQUEST){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(request.eventType, sandboxMouseListener, true, request.priority, request.useWeakReference, (event.target as IEventDispatcher));
addEventListenerToOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true, request.priority, request.useWeakReference);
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.addEventListener(actualType, eventProxy.marshalListener, false, request.priority, request.useWeakReference);
};
super.addEventListener(actualType, eventProxy.marshalListener, true, request.priority, request.useWeakReference);
};
};
} else {
if (event.type == EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST){
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
removeEventListenerFromOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true);
removeEventListenerFromSandboxes(request.eventType, sandboxMouseListener, true, (event.target as IEventDispatcher));
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.removeEventListener(actualType, eventProxy.marshalListener);
};
super.removeEventListener(actualType, eventProxy.marshalListener, true);
};
};
};
};
}
mx_internal function set applicationIndex(value:int):void{
_applicationIndex = value;
}
private function showMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
Object(event).data = request.data;
} else {
if (eventProxy){
Object(event).data = SystemManagerGlobals.showMouseCursor;
};
};
}
public function get childAllowsParent():Boolean{
return (loaderInfo.childAllowsParent);
//unresolved jump
var _slot1 = error;
return (false);
}
public function dispatchEventFromSWFBridges(event:Event, skip:IEventDispatcher=null, trackClones:Boolean=false, toOtherSystemManagers:Boolean=false):void{
var clone:Event;
if (toOtherSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if (!swfBridgeGroup){
return;
};
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = parentBridge;
};
parentBridge.dispatchEvent(clone);
};
var children:Array = swfBridgeGroup.getChildBridges();
var i:int;
while (i < children.length) {
if (children[i] != skip){
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = IEventDispatcher(children[i]);
};
IEventDispatcher(children[i]).dispatchEvent(clone);
};
i++;
};
currentSandboxEvent = null;
}
private function setActualSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
setActualSize(eObj.data.width, eObj.data.height);
}
private function executeCallbacks():void{
var initFunction:Function;
if (((!(parent)) && (parentAllowsChild))){
return;
};
while (initCallbackFunctions.length > 0) {
initFunction = initCallbackFunctions.shift();
initFunction(this);
};
}
private function addPlaceholderId(id:String, previousId:String, bridge:IEventDispatcher, placeholder:Object):void{
if (!bridge){
throw (new Error());
};
if (!idToPlaceholder){
idToPlaceholder = [];
};
idToPlaceholder[id] = new PlaceholderData(previousId, bridge, placeholder);
}
private function canActivateHandler(event:Event):void{
var request:SWFBridgeRequest;
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var bridge:IEventDispatcher;
var eObj:Object = Object(event);
var child:Object = eObj.data;
var nextId:String;
if ((eObj.data is String)){
placeholder = idToPlaceholder[eObj.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, IEventDispatcher(popUp.bridge), popUp.window);
if (popUp.bridge){
popUp.bridge.dispatchEvent(request);
eObj.data = request.data;
};
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
eObj.data = ((((smp) && (f))) && (canActivateLocalComponent(f)));
} else {
if ((child is IFocusManagerContainer)){
eObj.data = canActivateLocalComponent(child);
} else {
if ((child is IEventDispatcher)){
bridge = IEventDispatcher(child);
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, bridge, nextId);
if (bridge){
bridge.dispatchEvent(request);
eObj.data = request.data;
};
} else {
throw (new Error());
};
};
};
}
private function docFrameListener(event:Event):void{
if (currentFrame == 2){
removeEventListener(Event.ENTER_FRAME, docFrameListener);
if (totalFrames > 2){
addEventListener(Event.ENTER_FRAME, extraFrameListener);
};
docFrameHandler();
};
}
public function get popUpChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.popUpChildren);
};
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
return (_popUpChildren);
}
private function addEventListenerToSandboxes(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
var childBridge:IEventDispatcher;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, false, false, type, useCapture, priority, useWeakReference);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
childBridge = IEventDispatcher(children[i]);
if (childBridge != skip){
childBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
private function forwardFormEvent(event:SWFBridgeEvent):Boolean{
var sbRoot:DisplayObject;
if (isTopLevelRoot()){
return (false);
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (bridge){
sbRoot = getSandboxRoot();
event.data.notifier = bridge;
if (sbRoot == this){
if (!(event.data.window is String)){
event.data.window = NameUtil.displayObjectToString(DisplayObject(event.data.window));
} else {
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
bridge.dispatchEvent(event);
} else {
if ((event.data.window is String)){
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
sbRoot.dispatchEvent(event);
};
};
return (true);
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
override public function removeChild(child:DisplayObject):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChild(child));
}
mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
super.removeChild(child);
childRemoved(child);
return (child);
}
final mx_internal function get $numChildren():int{
return (super.numChildren);
}
public function get toolTipChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.toolTipChildren);
};
if (!_toolTipChildren){
_toolTipChildren = new SystemChildrenList(this, new QName(mx_internal, "topMostIndex"), new QName(mx_internal, "toolTipIndex"));
};
return (_toolTipChildren);
}
public function create(... _args):Object{
var url:String;
var dot:int;
var slash:int;
var mainClassName:String = info()["mainClassName"];
if (mainClassName == null){
url = loaderInfo.loaderURL;
dot = url.lastIndexOf(".");
slash = url.lastIndexOf("/");
mainClassName = url.substring((slash + 1), dot);
};
var mainClass:Class = Class(getDefinitionByName(mainClassName));
return ((mainClass) ? new (mainClass) : null);
}
override public function get stage():Stage{
var root:DisplayObject;
if (_stage){
return (_stage);
};
var s:Stage = super.stage;
if (s){
_stage = s;
return (s);
};
if (((!(topLevel)) && (_topLevelSystemManager))){
_stage = _topLevelSystemManager.stage;
return (_stage);
};
if (((!(isStageRoot)) && (topLevel))){
root = getTopLevelRoot();
if (root){
_stage = root.stage;
return (_stage);
};
};
return (null);
}
override public function addChild(child:DisplayObject):DisplayObject{
noTopMostIndex++;
return (rawChildren_addChildAt(child, (noTopMostIndex - 1)));
}
private function removeRemotePopUp(form:RemotePopUp):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == form.window)) && ((forms[i].bridge == form.bridge)))){
if (forms[i] == form){
deactivateForm(form);
};
forms.splice(i, 1);
break;
};
};
i++;
};
}
private function deactivateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
override public function getChildIndex(child:DisplayObject):int{
return ((super.getChildIndex(child) - applicationIndex));
}
mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{
return (super.getChildIndex(child));
}
public function activate(f:IFocusManagerContainer):void{
activateForm(f);
}
public function getSandboxRoot():DisplayObject{
var parent:DisplayObject;
var lastParent:DisplayObject;
var loader:Loader;
var loaderInfo:LoaderInfo;
var sm:ISystemManager = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
if ((parent is Stage)){
return (DisplayObject(sm));
};
if (((parent) && (!(parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))))){
return (this);
};
lastParent = parent;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true))){
return (lastParent);
};
if ((parent is Loader)){
loader = Loader(parent);
loaderInfo = loader.contentLoaderInfo;
if (!loaderInfo.childAllowsParent){
return (loaderInfo.content);
};
};
lastParent = parent;
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (((lastParent)!=null) ? lastParent : DisplayObject(sm));
}
private function deferredNextFrame():void{
if ((currentFrame + 1) > totalFrames){
return;
};
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
} else {
nextFrameTimer = new Timer(100);
nextFrameTimer.addEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.start();
};
}
mx_internal function get cursorIndex():int{
return (_cursorIndex);
}
mx_internal function rawChildren_contains(child:DisplayObject):Boolean{
return (super.contains(child));
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, (applicationIndex + newIndex));
}
public function get document():Object{
return (_document);
}
private function resizeMouseCatcher():void{
var g:Graphics;
var s:Rectangle;
if (mouseCatcher){
g = mouseCatcher.graphics;
s = screen;
g.clear();
g.beginFill(0, 0);
g.drawRect(0, 0, s.width, s.height);
g.endFill();
//unresolved jump
var _slot1 = e;
};
}
private function extraFrameListener(event:Event):void{
if (lastFrame == currentFrame){
return;
};
lastFrame = currentFrame;
if ((currentFrame + 1) > totalFrames){
removeEventListener(Event.ENTER_FRAME, extraFrameListener);
};
extraFrameHandler();
}
private function addPopupRequestHandler(event:Event):void{
var topMost:Boolean;
var children:IChildList;
var bridgeProvider:ISWFBridgeProvider;
var request:SWFBridgeRequest;
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (event.target != this){
bridgeProvider = swfBridgeGroup.getChildBridgeProvider(IEventDispatcher(event.target));
if (!SecurityUtil.hasMutualTrustBetweenParentAndChild(bridgeProvider)){
return;
};
};
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (((!(popUpRequest.data.childList)) || ((popUpRequest.data.childList == PopUpManagerChildList.PARENT)))){
topMost = ((popUpRequest.data.parent) && (popUpChildren.contains(popUpRequest.data.parent)));
} else {
topMost = (popUpRequest.data.childList == PopUpManagerChildList.POPUP);
};
children = (topMost) ? popUpChildren : this;
children.addChild(DisplayObject(popUpRequest.data.window));
if (popUpRequest.data.modal){
numModalWindows++;
};
var remoteForm:RemotePopUp = new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor);
forms.push(remoteForm);
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {window:popUpRequest.data.window});
request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(popUpRequest.data.window));
dispatchEvent(request);
};
}
override public function get height():Number{
return (_height);
}
mx_internal function rawChildren_getChildAt(index:int):DisplayObject{
return (super.getChildAt(index));
}
private function systemManagerHandler(event:Event):void{
if (event["name"] == "sameSandbox"){
event["value"] = (currentSandboxEvent == event["value"]);
return;
};
if (event["name"] == "hasSWFBridges"){
event["value"] = hasSWFBridges();
return;
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
switch (name){
case "popUpChildren.addChild":
popUpChildren.addChild(event["value"]);
break;
case "popUpChildren.removeChild":
popUpChildren.removeChild(event["value"]);
break;
case "cursorChildren.addChild":
cursorChildren.addChild(event["value"]);
break;
case "cursorChildren.removeChild":
cursorChildren.removeChild(event["value"]);
break;
case "toolTipChildren.addChild":
toolTipChildren.addChild(event["value"]);
break;
case "toolTipChildren.removeChild":
toolTipChildren.removeChild(event["value"]);
break;
case "screen":
event["value"] = screen;
break;
case "application":
event["value"] = application;
break;
case "isTopLevelRoot":
event["value"] = isTopLevelRoot();
break;
case "getVisibleApplicationRect":
event["value"] = getVisibleApplicationRect();
break;
case "bringToFront":
if (event["value"].topMost){
popUpChildren.setChildIndex(DisplayObject(event["value"].popUp), (popUpChildren.numChildren - 1));
} else {
setChildIndex(DisplayObject(event["value"].popUp), (numChildren - 1));
};
break;
};
}
private function activateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
mx_internal function set noTopMostIndex(value:int):void{
var delta:int = (value - _noTopMostIndex);
_noTopMostIndex = value;
topMostIndex = (topMostIndex + delta);
}
override public function getObjectsUnderPoint(point:Point):Array{
var child:DisplayObject;
var temp:Array;
var children:Array = [];
var n:int = topMostIndex;
var i:int;
while (i < n) {
child = super.getChildAt(i);
if ((child is DisplayObjectContainer)){
temp = DisplayObjectContainer(child).getObjectsUnderPoint(point);
if (temp){
children = children.concat(temp);
};
};
i++;
};
return (children);
}
mx_internal function get topMostIndex():int{
return (_topMostIndex);
}
mx_internal function regenerateStyleCache(recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.regenerateStyleCache(recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).regenerateStyleCache(recursive);
};
}
public function addFocusManager(f:IFocusManagerContainer):void{
forms.push(f);
}
private function deactivateFormSandboxEventHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
if (((((isRemotePopUp(form)) && ((RemotePopUp(form).window == bridgeEvent.data.window)))) && ((RemotePopUp(form).bridge == bridgeEvent.data.notifier)))){
deactivateForm(form);
};
};
}
public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
if (topLevel){
_swfBridgeGroup = bridgeGroup;
} else {
if (topLevelSystemManager){
SystemManager(topLevelSystemManager).swfBridgeGroup = bridgeGroup;
};
};
}
mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, newIndex);
}
private function mouseUpHandler(event:MouseEvent):void{
idleCounter = 0;
}
mx_internal function childAdded(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
}
public function isFontFaceEmbedded(textFormat:TextFormat):Boolean{
var font:Font;
var style:String;
var fontName:String = textFormat.font;
var fl:Array = Font.enumerateFonts();
var f:int;
while (f < fl.length) {
font = Font(fl[f]);
if (font.fontName == fontName){
style = "regular";
if (((textFormat.bold) && (textFormat.italic))){
style = "boldItalic";
} else {
if (textFormat.bold){
style = "bold";
} else {
if (textFormat.italic){
style = "italic";
};
};
};
if (font.fontStyle == style){
return (true);
};
};
f++;
};
if (((((!(fontName)) || (!(embeddedFontList)))) || (!(embeddedFontList[fontName])))){
return (false);
};
var info:Object = embeddedFontList[fontName];
return (!(((((((textFormat.bold) && (!(info.bold)))) || (((textFormat.italic) && (!(info.italic)))))) || (((((!(textFormat.bold)) && (!(textFormat.italic)))) && (!(info.regular)))))));
}
private function forwardPlaceholderRequest(request:SWFBridgeRequest, addPlaceholder:Boolean):Boolean{
if (isTopLevelRoot()){
return (false);
};
var refObj:Object;
var oldId:String;
if (request.data.window){
refObj = request.data.window;
request.data.window = null;
} else {
refObj = request.requestor;
oldId = request.data.placeHolderId;
request.data.placeHolderId = ((NameUtil.displayObjectToString(this) + ".") + request.data.placeHolderId);
};
if (addPlaceholder){
addPlaceholderId(request.data.placeHolderId, oldId, request.requestor, refObj);
} else {
removePlaceholderId(request.data.placeHolderId);
};
var sbRoot:DisplayObject = getSandboxRoot();
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (sbRoot == this){
bridge.dispatchEvent(request);
} else {
sbRoot.dispatchEvent(request);
};
return (true);
}
public function getTopLevelRoot():DisplayObject{
var sm:ISystemManager;
var parent:DisplayObject;
var lastParent:DisplayObject;
sm = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
lastParent = parent;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
lastParent = parent;
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (null);
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
var newListener:StageEventProxy;
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.removeEventListener(type, listener, useCapture);
};
super.removeEventListener(type, listener, useCapture);
//unresolved jump
var _slot1 = error;
super.removeEventListener(type, listener, useCapture);
return;
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (stage){
newListener = weakReferenceProxies[listener];
if (!newListener){
newListener = strongReferenceProxies[listener];
if (newListener){
delete strongReferenceProxies[listener];
};
};
if (newListener){
stage.removeEventListener(type, newListener.stageListener, false);
};
};
//unresolved jump
var _slot1 = error;
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if ((((getSandboxRoot() == this)) && (eventProxy))){
super.removeEventListener(actualType, eventProxy.marshalListener, useCapture);
};
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
removeEventListenerFromOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture);
};
removeEventListenerFromSandboxes(type, sandboxMouseListener, useCapture);
super.removeEventListener(type, listener, false);
return;
};
};
if (type == FlexEvent.IDLE){
super.removeEventListener(type, listener, useCapture);
if (((!(hasEventListener(FlexEvent.IDLE))) && (idleTimer))){
idleTimer.stop();
idleTimer = null;
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
};
} else {
super.removeEventListener(type, listener, useCapture);
};
}
private function extraFrameHandler(event:Event=null):void{
var c:Class;
var frameList:Object = info()["frames"];
if (((frameList) && (frameList[currentLabel]))){
c = Class(getDefinitionByName(frameList[currentLabel]));
var _local4 = c;
_local4["frame"](this);
};
deferredNextFrame();
}
public function isTopLevelRoot():Boolean{
return (((isStageRoot) || (isBootstrapRoot)));
}
public function get application():IUIComponent{
return (IUIComponent(_document));
}
override public function removeChildAt(index:int):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChildAt((applicationIndex + index)));
}
mx_internal function rawChildren_removeChildAt(index:int):DisplayObject{
var child:DisplayObject = super.getChildAt(index);
removingChild(child);
super.removeChildAt(index);
childRemoved(child);
return (child);
}
private function getSWFBridgeOfDisplayObject(displayObject:DisplayObject):IEventDispatcher{
var request:SWFBridgeRequest;
var children:Array;
var n:int;
var i:int;
var childBridge:IEventDispatcher;
var bp:ISWFBridgeProvider;
if (swfBridgeGroup){
request = new SWFBridgeRequest(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, false, false, null, displayObject);
children = swfBridgeGroup.getChildBridges();
n = children.length;
i = 0;
while (i < n) {
childBridge = IEventDispatcher(children[i]);
bp = swfBridgeGroup.getChildBridgeProvider(childBridge);
if (SecurityUtil.hasMutualTrustBetweenParentAndChild(bp)){
childBridge.dispatchEvent(request);
if (request.data == true){
return (childBridge);
};
request.data = displayObject;
};
i++;
};
};
return (null);
}
private function deactivateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
deactivateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.deactivateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.deactivate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
return;
};
throw (new Error());
};
};
}
private function installCompiledResourceBundles():void{
var info:Object = this.info();
var applicationDomain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : info["currentDomain"];
var compiledLocales:Array = info["compiledLocales"];
var compiledResourceBundleNames:Array = info["compiledResourceBundleNames"];
var resourceManager:IResourceManager = ResourceManager.getInstance();
resourceManager.installCompiledResourceBundles(applicationDomain, compiledLocales, compiledResourceBundleNames);
if (!resourceManager.localeChain){
resourceManager.initializeLocaleChain(compiledLocales);
};
}
private function deactivateForm(f:Object):void{
if (form){
if ((((form == f)) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
deactivateRemotePopUp(form);
} else {
form.focusManager.deactivate();
};
form = findLastActiveForm(f);
if (form){
if (isRemotePopUp(form)){
activateRemotePopUp(form);
} else {
form.focusManager.activate();
};
};
};
};
}
private function unloadHandler(event:Event):void{
dispatchEvent(event);
}
mx_internal function removingChild(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
}
mx_internal function get applicationIndex():int{
return (_applicationIndex);
}
mx_internal function set toolTipIndex(value:int):void{
var delta:int = (value - _toolTipIndex);
_toolTipIndex = value;
cursorIndex = (cursorIndex + delta);
}
private function hasSWFBridges():Boolean{
if (swfBridgeGroup){
return (true);
};
return (false);
}
private function updateLastActiveForm():void{
var n:int = forms.length;
if (n < 2){
return;
};
var index = -1;
var i:int;
while (i < n) {
if (areFormsEqual(form, forms[i])){
index = i;
break;
};
i++;
};
if (index >= 0){
forms.splice(index, 1);
forms.push(form);
} else {
throw (new Error());
};
}
public function get cursorChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.cursorChildren);
};
if (!_cursorChildren){
_cursorChildren = new SystemChildrenList(this, new QName(mx_internal, "toolTipIndex"), new QName(mx_internal, "cursorIndex"));
};
return (_cursorChildren);
}
private function sandboxMouseListener(event:Event):void{
if ((event is SandboxMouseEvent)){
return;
};
var marshaledEvent:Event = SandboxMouseEvent.marshal(event);
dispatchEventFromSWFBridges(marshaledEvent, (event.target as IEventDispatcher));
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(marshaledEvent);
};
}
public function get preloaderBackgroundImage():Object{
return (info()["backgroundImage"]);
}
public function set numModalWindows(value:int):void{
_numModalWindows = value;
}
public function get preloaderBackgroundAlpha():Number{
return (info()["backgroundAlpha"]);
}
mx_internal function rawChildren_getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
private function dispatchInvalidateRequest():void{
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.INVALIDATE_REQUEST, false, false, bridge, (InvalidateRequestData.SIZE | InvalidateRequestData.DISPLAY_LIST));
bridge.dispatchEvent(request);
}
public function get preloaderBackgroundColor():uint{
var value:* = info()["backgroundColor"];
if (value == undefined){
return (StyleManager.NOT_A_COLOR);
};
return (StyleManager.getColorName(value));
}
public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
var s:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
var request:SWFBridgeRequest;
if (!bounds){
bounds = getBounds(DisplayObject(this));
s = screen;
pt = new Point(Math.max(0, bounds.x), Math.max(0, bounds.y));
pt = localToGlobal(pt);
bounds.x = pt.x;
bounds.y = pt.y;
bounds.width = s.width;
bounds.height = s.height;
};
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request = new SWFBridgeRequest(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, false, false, bridge, bounds);
bridge.dispatchEvent(request);
bounds = Rectangle(request.data);
};
return (bounds);
}
public function get topLevelSystemManager():ISystemManager{
if (topLevel){
return (this);
};
return (_topLevelSystemManager);
}
private function appCreationCompleteHandler(event:FlexEvent):void{
var obj:DisplayObjectContainer;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is IInvalidating)){
IInvalidating(obj).invalidateSize();
IInvalidating(obj).invalidateDisplayList();
return;
};
obj = obj.parent;
};
};
if (((topLevel) && (useSWFBridge()))){
dispatchInvalidateRequest();
};
}
public function addChildToSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].addChild(child);
} else {
addingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".addChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childAdded(child);
};
}
private function dispatchDeactivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
private function isBridgeChildHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var eObj:Object = Object(event);
eObj.data = ((eObj.data) && (rawChildren.contains((eObj.data as DisplayObject))));
}
public function get measuredHeight():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height);
}
private function activateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
activateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.activateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.activate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
} else {
throw (new Error());
};
};
};
}
mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{
addingChild(child);
super.addChildAt(child, index);
childAdded(child);
return (child);
}
mx_internal function initialize():void{
var n:int;
var i:int;
var fontRegistry:EmbeddedFontRegistry;
var crossDomainRSLItem:Class;
var cdNode:Object;
var node:RSLItem;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
} else {
_width = loaderInfo.width;
_height = loaderInfo.height;
};
preloader = new Preloader();
preloader.addEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
preloader.addEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
_popUpChildren.addChild(preloader);
var rsls:Array = info()["rsls"];
var cdRsls:Array = info()["cdRsls"];
var usePreloader:Boolean;
if (info()["usePreloader"] != undefined){
usePreloader = info()["usePreloader"];
};
var preloaderDisplayClass:Class = (info()["preloader"] as Class);
if (((usePreloader) && (!(preloaderDisplayClass)))){
preloaderDisplayClass = DownloadProgressBar;
};
var rslList:Array = [];
if (((cdRsls) && ((cdRsls.length > 0)))){
crossDomainRSLItem = Class(getDefinitionByName("mx.core::CrossDomainRSLItem"));
n = cdRsls.length;
i = 0;
while (i < n) {
cdNode = new crossDomainRSLItem(cdRsls[i]["rsls"], cdRsls[i]["policyFiles"], cdRsls[i]["digests"], cdRsls[i]["types"], cdRsls[i]["isSigned"], this.loaderInfo.url);
rslList.push(cdNode);
i++;
};
};
if (((!((rsls == null))) && ((rsls.length > 0)))){
n = rsls.length;
i = 0;
while (i < n) {
node = new RSLItem(rsls[i].url, this.loaderInfo.url);
rslList.push(node);
i++;
};
};
Singleton.registerClass("mx.resources::IResourceManager", Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
var resourceManager:IResourceManager = ResourceManager.getInstance();
Singleton.registerClass("mx.core::IEmbeddedFontRegistry", Class(getDefinitionByName("mx.core::EmbeddedFontRegistry")));
Singleton.registerClass("mx.styles::IStyleManager", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
Singleton.registerClass("mx.styles::IStyleManager2", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
var localeChainList:String = loaderInfo.parameters["localeChain"];
if (((!((localeChainList == null))) && (!((localeChainList == ""))))){
resourceManager.localeChain = localeChainList.split(",");
};
var resourceModuleURLList:String = loaderInfo.parameters["resourceModuleURLs"];
var resourceModuleURLs:Array = (resourceModuleURLList) ? resourceModuleURLList.split(",") : null;
preloader.initialize(usePreloader, preloaderDisplayClass, preloaderBackgroundColor, preloaderBackgroundAlpha, preloaderBackgroundImage, preloaderBackgroundSize, (isStageRoot) ? stage.stageWidth : loaderInfo.width, (isStageRoot) ? stage.stageHeight : loaderInfo.height, null, null, rslList, resourceModuleURLs);
}
public function useSWFBridge():Boolean{
if (isStageRoot){
return (false);
};
if (((!(topLevel)) && (topLevelSystemManager))){
return (topLevelSystemManager.useSWFBridge());
};
if (((topLevel) && (!((getSandboxRoot() == this))))){
return (true);
};
if (getSandboxRoot() == this){
root.loaderInfo.parentAllowsChild;
if (((parentAllowsChild) && (childAllowsParent))){
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isStageRoot", false, true))){
return (true);
};
//unresolved jump
var _slot1 = e;
} else {
return (true);
};
//unresolved jump
var _slot1 = e1;
return (false);
};
return (false);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
private function canActivatePopUp(f:Object):Boolean{
var remotePopUp:RemotePopUp;
var event:SWFBridgeRequest;
if (isRemotePopUp(f)){
remotePopUp = RemotePopUp(f);
event = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, null, remotePopUp.window);
IEventDispatcher(remotePopUp.bridge).dispatchEvent(event);
return (event.data);
};
if (canActivateLocalComponent(f)){
return (true);
};
return (false);
}
mx_internal function get noTopMostIndex():int{
return (_noTopMostIndex);
}
override public function get numChildren():int{
return ((noTopMostIndex - applicationIndex));
}
private function canActivateLocalComponent(o:Object):Boolean{
if ((((((((o is Sprite)) && ((o is IUIComponent)))) && (Sprite(o).visible))) && (IUIComponent(o).enabled))){
return (true);
};
return (false);
}
private function preloader_preloaderDoneHandler(event:Event):void{
var app:IUIComponent = topLevelWindow;
preloader.removeEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
_popUpChildren.removeChild(preloader);
preloader = null;
mouseCatcher = new FlexSprite();
mouseCatcher.name = "mouseCatcher";
noTopMostIndex++;
super.addChildAt(mouseCatcher, 0);
resizeMouseCatcher();
if (!topLevel){
mouseCatcher.visible = false;
mask = mouseCatcher;
};
noTopMostIndex++;
super.addChildAt(DisplayObject(app), 1);
app.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
}
private function initializeTopLevelWindow(event:Event):void{
var app:IUIComponent;
var obj:DisplayObjectContainer;
var sm:ISystemManager;
var sandboxRoot:DisplayObject;
initialized = true;
if (((!(parent)) && (parentAllowsChild))){
return;
};
if (!topLevel){
obj = parent.parent;
if (!obj){
return;
};
while (obj) {
if ((obj is IUIComponent)){
sm = IUIComponent(obj).systemManager;
if (((sm) && (!(sm.isTopLevel())))){
sm = sm.topLevelSystemManager;
};
_topLevelSystemManager = sm;
break;
};
obj = obj.parent;
};
};
if (((isTopLevelRoot()) || ((getSandboxRoot() == this)))){
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true);
};
if (((isTopLevelRoot()) && (stage))){
stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
} else {
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
};
};
};
app = (topLevelWindow = IUIComponent(create()));
document = app;
if (document){
IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
if (!LoaderConfig._url){
LoaderConfig._url = loaderInfo.url;
LoaderConfig._parameters = loaderInfo.parameters;
};
if (((isStageRoot) && (stage))){
_width = stage.stageWidth;
_height = stage.stageHeight;
IFlexDisplayObject(app).setActualSize(_width, _height);
} else {
IFlexDisplayObject(app).setActualSize(loaderInfo.width, loaderInfo.height);
};
if (preloader){
preloader.registerApplication(app);
};
addingChild(DisplayObject(app));
childAdded(DisplayObject(app));
} else {
document = this;
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
mx_internal function dispatchActivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
private function nextFrameTimerHandler(event:TimerEvent):void{
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
nextFrameTimer.removeEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.reset();
};
}
public function get numModalWindows():int{
return (_numModalWindows);
}
private function areFormsEqual(form1:Object, form2:Object):Boolean{
if (form1 == form2){
return (true);
};
if ((((form1 is RemotePopUp)) && ((form2 is RemotePopUp)))){
return (areRemotePopUpsEqual(form1, form2));
};
return (false);
}
public function isTopLevelWindow(object:DisplayObject):Boolean{
return ((((object is IUIComponent)) && ((IUIComponent(object) == topLevelWindow))));
}
private function removePlaceholderId(id:String):void{
delete idToPlaceholder[id];
}
override public function get width():Number{
return (_width);
}
private function dispatchActivatedApplicationEvent():void{
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, false, false);
bridge.dispatchEvent(bridgeEvent);
};
}
private function otherSystemManagerMouseListener(event:SandboxMouseEvent):void{
if (dispatchingToSystemManagers){
return;
};
dispatchEventFromSWFBridges(event);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(event);
};
}
private function hideMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = false;
};
};
}
private function getTopLevelSystemManager(parent:DisplayObject):ISystemManager{
var sm:ISystemManager;
var localRoot:DisplayObjectContainer = DisplayObjectContainer(parent.root);
if (((((!(localRoot)) || ((localRoot is Stage)))) && ((parent is IUIComponent)))){
localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager);
};
if ((localRoot is ISystemManager)){
sm = ISystemManager(localRoot);
if (!sm.isTopLevel()){
sm = sm.topLevelSystemManager;
};
};
return (sm);
}
public function isDisplayObjectInABridgedApplication(displayObject:DisplayObject):Boolean{
return (!((getSWFBridgeOfDisplayObject(displayObject) == null)));
}
public function move(x:Number, y:Number):void{
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function get parentAllowsChild():Boolean{
return (loaderInfo.parentAllowsChild);
//unresolved jump
var _slot1 = error;
return (false);
}
private function preloader_initProgressHandler(event:Event):void{
preloader.removeEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
deferredNextFrame();
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
private function activateFormSandboxEventHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
activateForm(new RemotePopUp(bridgeEvent.data.window, bridgeEvent.data.notifier));
};
}
mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject{
addingChild(child);
super.addChild(child);
childAdded(child);
return (child);
}
public static function getSWFRoot(object:Object):DisplayObject{
var p:*;
var sm:ISystemManager;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for (p in allSystemManagers) {
sm = (p as ISystemManager);
domain = sm.loaderInfo.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return ((sm as DisplayObject));
};
//unresolved jump
var _slot1 = e;
};
return (null);
}
private static function areRemotePopUpsEqual(form1:Object, form2:Object):Boolean{
if (!(form1 is RemotePopUp)){
return (false);
};
if (!(form2 is RemotePopUp)){
return (false);
};
var remotePopUp1:RemotePopUp = RemotePopUp(form1);
var remotePopUp2:RemotePopUp = RemotePopUp(form2);
if ((((((remotePopUp1.window == remotePopUp2.window)) && (remotePopUp1.bridge))) && (remotePopUp2.bridge))){
return (true);
};
return (false);
}
private static function getChildListIndex(childList:IChildList, f:Object):int{
var childList = childList;
var f = f;
var index = -1;
index = childList.getChildIndex(DisplayObject(f));
//unresolved jump
var _slot1 = e;
return (index);
}
mx_internal static function registerInitCallback(initFunction:Function):void{
if (((!(allSystemManagers)) || (!(lastSystemManager)))){
return;
};
var sm:SystemManager = lastSystemManager;
if (sm.doneExecutingInitCallbacks){
initFunction(sm);
} else {
sm.initCallbackFunctions.push(initFunction);
};
}
private static function isRemotePopUp(form:Object):Boolean{
return (!((form is IFocusManagerContainer)));
}
}
}//package mx.managers
Section 257
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var changingListenersInOtherSystemManagers:Boolean;
public static var bootstrapLoaderInfoURL:String;
public static var showMouseCursor:Boolean;
public function SystemManagerGlobals(){
super();
}
}
}//package mx.managers
Section 258
//SystemManagerProxy (mx.managers.SystemManagerProxy)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.utils.*;
public class SystemManagerProxy extends SystemManager {
private var _systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemManagerProxy(systemManager:ISystemManager){
super();
_systemManager = systemManager;
topLevel = true;
super.addEventListener(MouseEvent.MOUSE_DOWN, proxyMouseDownHandler, true);
}
override public function create(... _args):Object{
return (IFlexModuleFactory(_systemManager).create.apply(this, _args));
}
public function get systemManager():ISystemManager{
return (_systemManager);
}
override public function activate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (_systemManager.swfBridgeGroup) ? _systemManager.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
_systemManager.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function deactivateByProxy(f:IFocusManagerContainer):void{
if (f){
f.focusManager.deactivate();
};
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
_systemManager.removeEventListener(type, listener, useCapture);
}
override public function get document():Object{
return (findFocusManagerContainer(this));
}
public function activateByProxy(f:IFocusManagerContainer):void{
super.activate(f);
}
override public function removeChildBridge(bridge:IEventDispatcher):void{
_systemManager.removeChildBridge(bridge);
}
override public function get swfBridgeGroup():ISWFBridgeGroup{
return (_systemManager.swfBridgeGroup);
}
override public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
_systemManager.addChildBridge(bridge, owner);
}
override public function useSWFBridge():Boolean{
return (_systemManager.useSWFBridge());
}
override public function get screen():Rectangle{
return (_systemManager.screen);
}
override public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
}
private function proxyMouseDownHandler(event:MouseEvent):void{
if (findFocusManagerContainer(this)){
SystemManager(_systemManager).dispatchActivatedWindowEvent(this);
};
}
override public function deactivate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var sm:ISystemManager = _systemManager;
var bridge:IEventDispatcher = (sm.swfBridgeGroup) ? sm.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function set document(value:Object):void{
}
override public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
return (_systemManager.getVisibleApplicationRect(bounds));
}
override public function getDefinitionByName(name:String):Object{
return (_systemManager.getDefinitionByName(name));
}
}
}//package mx.managers
Section 259
//SystemRawChildrenList (mx.managers.SystemRawChildrenList)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
public class SystemRawChildrenList implements IChildList {
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemRawChildrenList(owner:SystemManager){
super();
this.owner = owner;
}
public function getChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_getChildAt(index));
}
public function addChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_addChild(child));
}
public function getChildIndex(child:DisplayObject):int{
return (owner.mx_internal::rawChildren_getChildIndex(child));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, newIndex);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_removeChildAt(index));
}
public function get numChildren():int{
return (owner.mx_internal::$numChildren);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
return (owner.mx_internal::rawChildren_addChildAt(child, index));
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function contains(child:DisplayObject):Boolean{
return (owner.mx_internal::rawChildren_contains(child));
}
public function removeChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_removeChild(child));
}
}
}//package mx.managers
Section 260
//ToolTipManager (mx.managers.ToolTipManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.effects.*;
public class ToolTipManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var implClassDependency:ToolTipManagerImpl;
private static var _impl:IToolTipManager2;
public function ToolTipManager(){
super();
}
mx_internal static function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
impl.registerToolTip(target, oldToolTip, newToolTip);
}
public static function get enabled():Boolean{
return (impl.enabled);
}
public static function set enabled(value:Boolean):void{
impl.enabled = value;
}
public static function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
return (impl.createToolTip(text, x, y, errorTipBorderStyle, context));
}
public static function set hideDelay(value:Number):void{
impl.hideDelay = value;
}
public static function set showDelay(value:Number):void{
impl.showDelay = value;
}
public static function get showDelay():Number{
return (impl.showDelay);
}
public static function destroyToolTip(toolTip:IToolTip):void{
return (impl.destroyToolTip(toolTip));
}
public static function get scrubDelay():Number{
return (impl.scrubDelay);
}
public static function get toolTipClass():Class{
return (impl.toolTipClass);
}
mx_internal static function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
impl.registerErrorString(target, oldErrorString, newErrorString);
}
mx_internal static function sizeTip(toolTip:IToolTip):void{
impl.sizeTip(toolTip);
}
public static function set currentTarget(value:DisplayObject):void{
impl.currentTarget = value;
}
public static function set showEffect(value:IAbstractEffect):void{
impl.showEffect = value;
}
private static function get impl():IToolTipManager2{
if (!_impl){
_impl = IToolTipManager2(Singleton.getInstance("mx.managers::IToolTipManager2"));
};
return (_impl);
}
public static function get hideDelay():Number{
return (impl.hideDelay);
}
public static function set hideEffect(value:IAbstractEffect):void{
impl.hideEffect = value;
}
public static function set scrubDelay(value:Number):void{
impl.scrubDelay = value;
}
public static function get currentToolTip():IToolTip{
return (impl.currentToolTip);
}
public static function set currentToolTip(value:IToolTip):void{
impl.currentToolTip = value;
}
public static function get showEffect():IAbstractEffect{
return (impl.showEffect);
}
public static function get currentTarget():DisplayObject{
return (impl.currentTarget);
}
public static function get hideEffect():IAbstractEffect{
return (impl.hideEffect);
}
public static function set toolTipClass(value:Class):void{
impl.toolTipClass = value;
}
}
}//package mx.managers
Section 261
//ToolTipManagerImpl (mx.managers.ToolTipManagerImpl)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.*;
import mx.effects.*;
import mx.validators.*;
import flash.utils.*;
public class ToolTipManagerImpl extends EventDispatcher implements IToolTipManager2 {
private var _enabled:Boolean;// = true
private var _showDelay:Number;// = 500
private var _hideEffect:IAbstractEffect;
mx_internal var hideTimer:Timer;
private var _scrubDelay:Number;// = 100
private var _toolTipClass:Class;
mx_internal var showTimer:Timer;
private var sandboxRoot:IEventDispatcher;// = null
mx_internal var currentText:String;
private var _currentToolTip:DisplayObject;
mx_internal var scrubTimer:Timer;
mx_internal var previousTarget:DisplayObject;
private var _currentTarget:DisplayObject;
private var systemManager:ISystemManager;// = null
private var _showEffect:IAbstractEffect;
private var _hideDelay:Number;// = 10000
mx_internal var initialized:Boolean;// = false
mx_internal var isError:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:IToolTipManager2;
public function ToolTipManagerImpl(){
_toolTipClass = ToolTip;
super();
if (instance){
throw (new Error("Instance already exists."));
};
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.TOOLTIP_MANAGER_REQUEST, marshalToolTipManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void{
reset();
}
public function set showDelay(value:Number):void{
_showDelay = value;
}
mx_internal function showTimer_timerHandler(event:TimerEvent):void{
if (currentTarget){
createTip();
initializeTip();
positionTip();
showTip();
};
}
mx_internal function hideEffectEnded():void{
var event:ToolTipEvent;
reset();
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_END);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
}
public function set scrubDelay(value:Number):void{
_scrubDelay = value;
}
public function get currentToolTip():IToolTip{
return ((_currentToolTip as IToolTip));
}
private function mouseIsOver(target:DisplayObject):Boolean{
if (((!(target)) || (!(target.stage)))){
return (false);
};
if ((((target.stage.mouseX == 0)) && ((target.stage.mouseY == 0)))){
return (false);
};
return (target.hitTestPoint(target.stage.mouseX, target.stage.mouseY, true));
}
mx_internal function toolTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
public function get enabled():Boolean{
return (_enabled);
}
public function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
var toolTip:ToolTip = new ToolTip();
var sm:ISystemManager = (context) ? (context.systemManager as ISystemManager) : (ApplicationGlobals.application.systemManager as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (toolTip as DisplayObject));
if (errorTipBorderStyle){
toolTip.setStyle("styleName", "errorTip");
toolTip.setStyle("borderStyle", errorTipBorderStyle);
};
toolTip.text = text;
sizeTip(toolTip);
toolTip.move(x, y);
return ((toolTip as IToolTip));
}
mx_internal function reset():void{
var sm:ISystemManager;
showTimer.reset();
hideTimer.reset();
if (currentToolTip){
if (((showEffect) || (hideEffect))){
currentToolTip.removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
EffectManager.endEffectsForTarget(currentToolTip);
sm = (currentToolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
currentToolTip = null;
scrubTimer.delay = scrubDelay;
scrubTimer.reset();
if (scrubDelay > 0){
scrubTimer.delay = scrubDelay;
scrubTimer.start();
};
};
}
public function set currentToolTip(value:IToolTip):void{
_currentToolTip = (value as DisplayObject);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = value;
sandboxRoot.dispatchEvent(me);
}
public function get toolTipClass():Class{
return (_toolTipClass);
}
private function hideImmediately(target:DisplayObject):void{
checkIfTargetChanged(null);
}
mx_internal function showTip():void{
var sm:ISystemManager;
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOW);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
if (isError){
currentTarget.addEventListener("change", changeHandler);
} else {
sm = getSystemManager(currentTarget);
sm.addEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
currentToolTip.visible = true;
if (!showEffect){
showEffectEnded();
};
}
mx_internal function effectEndHandler(event:EffectEvent):void{
if (event.effectInstance.effect == showEffect){
showEffectEnded();
} else {
if (event.effectInstance.effect == hideEffect){
hideEffectEnded();
};
};
}
public function get hideDelay():Number{
return (_hideDelay);
}
public function get currentTarget():DisplayObject{
return (_currentTarget);
}
mx_internal function showEffectEnded():void{
var event:ToolTipEvent;
if (hideDelay == 0){
hideTip();
} else {
if (hideDelay < Infinity){
hideTimer.delay = hideDelay;
hideTimer.start();
};
};
if (currentTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOWN);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
};
}
public function get hideEffect():IAbstractEffect{
return (_hideEffect);
}
mx_internal function changeHandler(event:Event):void{
reset();
}
public function set enabled(value:Boolean):void{
_enabled = value;
}
mx_internal function errorTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
public function get showDelay():Number{
return (_showDelay);
}
public function get scrubDelay():Number{
return (_scrubDelay);
}
public function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
if (((!(oldErrorString)) && (newErrorString))){
target.addEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldErrorString) && (!(newErrorString)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
mx_internal function initialize():void{
if (!showTimer){
showTimer = new Timer(0, 1);
showTimer.addEventListener(TimerEvent.TIMER, showTimer_timerHandler);
};
if (!hideTimer){
hideTimer = new Timer(0, 1);
hideTimer.addEventListener(TimerEvent.TIMER, hideTimer_timerHandler);
};
if (!scrubTimer){
scrubTimer = new Timer(0, 1);
};
initialized = true;
}
public function destroyToolTip(toolTip:IToolTip):void{
var sm:ISystemManager = (toolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", DisplayObject(toolTip));
}
mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void{
if (!enabled){
return;
};
findTarget(displayObject);
if (currentTarget != previousTarget){
targetChanged();
previousTarget = currentTarget;
};
}
private function marshalToolTipManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "currentToolTip":
_currentToolTip = marshalEvent.value;
break;
case ToolTipEvent.TOOL_TIP_HIDE:
if ((_currentToolTip is IToolTip)){
hideTip();
};
break;
case "update":
event.stopImmediatePropagation();
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = _currentToolTip;
sandboxRoot.dispatchEvent(me);
};
}
public function set toolTipClass(value:Class):void{
_toolTipClass = value;
}
private function getGlobalBounds(obj:DisplayObject, parent:DisplayObject):Rectangle{
var upperLeft:Point = new Point(0, 0);
upperLeft = obj.localToGlobal(upperLeft);
upperLeft = parent.globalToLocal(upperLeft);
return (new Rectangle(upperLeft.x, upperLeft.y, obj.width, obj.height));
}
mx_internal function positionTip():void{
var x:Number;
var y:Number;
var targetGlobalBounds:Rectangle;
var pos:Point;
var ctt:IToolTip;
var newWidth:Number;
var oldWidth:Number;
var sm:ISystemManager;
var toolTipWidth:Number;
var toolTipHeight:Number;
var screenWidth:Number = currentToolTip.screen.width;
var screenHeight:Number = currentToolTip.screen.height;
if (isError){
targetGlobalBounds = getGlobalBounds(currentTarget, currentToolTip.root);
x = (targetGlobalBounds.right + 4);
y = (targetGlobalBounds.top - 1);
if ((x + currentToolTip.width) > screenWidth){
newWidth = NaN;
oldWidth = NaN;
x = (targetGlobalBounds.left - 2);
if (((x + currentToolTip.width) + 4) > screenWidth){
newWidth = ((screenWidth - x) - 4);
oldWidth = Object(toolTipClass).maxWidth;
Object(toolTipClass).maxWidth = newWidth;
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
Object(toolTipClass).maxWidth = oldWidth;
} else {
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
};
if ((currentToolTip.height + 2) < targetGlobalBounds.top){
y = (targetGlobalBounds.top - (currentToolTip.height + 2));
} else {
y = (targetGlobalBounds.bottom + 2);
if (!isNaN(newWidth)){
Object(toolTipClass).maxWidth = newWidth;
};
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipBelow");
};
currentToolTip["text"] = currentToolTip["text"];
if (!isNaN(oldWidth)){
Object(toolTipClass).maxWidth = oldWidth;
};
};
};
sizeTip(currentToolTip);
pos = new Point(x, y);
ctt = currentToolTip;
x = pos.x;
y = pos.y;
} else {
sm = getSystemManager(currentTarget);
x = (DisplayObject(sm).mouseX + 11);
y = (DisplayObject(sm).mouseY + 22);
toolTipWidth = currentToolTip.width;
if ((x + toolTipWidth) > screenWidth){
x = (screenWidth - toolTipWidth);
};
toolTipHeight = currentToolTip.height;
if ((y + toolTipHeight) > screenHeight){
y = (screenHeight - toolTipHeight);
};
pos = new Point(x, y);
pos = DisplayObject(sm).localToGlobal(pos);
pos = DisplayObject(sandboxRoot).globalToLocal(pos);
x = pos.x;
y = pos.y;
};
currentToolTip.move(x, y);
}
mx_internal function errorTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
mx_internal function findTarget(displayObject:DisplayObject):void{
while (displayObject) {
if ((displayObject is IValidatorListener)){
currentText = IValidatorListener(displayObject).errorString;
if (((!((currentText == null))) && (!((currentText == ""))))){
currentTarget = displayObject;
isError = true;
return;
};
};
if ((displayObject is IToolTipManagerClient)){
currentText = IToolTipManagerClient(displayObject).toolTip;
if (currentText != null){
currentTarget = displayObject;
isError = false;
return;
};
};
displayObject = displayObject.parent;
};
currentText = null;
currentTarget = null;
}
public function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
if (((!(oldToolTip)) && (newToolTip))){
target.addEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldToolTip) && (!(newToolTip)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
private function showImmediately(target:DisplayObject):void{
var oldShowDelay:Number = ToolTipManager.showDelay;
ToolTipManager.showDelay = 0;
checkIfTargetChanged(target);
ToolTipManager.showDelay = oldShowDelay;
}
public function set hideDelay(value:Number):void{
_hideDelay = value;
}
private function getSystemManager(target:DisplayObject):ISystemManager{
return (((target is IUIComponent)) ? IUIComponent(target).systemManager : null);
}
public function set currentTarget(value:DisplayObject):void{
_currentTarget = value;
}
public function sizeTip(toolTip:IToolTip):void{
if ((toolTip is IInvalidating)){
IInvalidating(toolTip).validateNow();
};
toolTip.setActualSize(toolTip.getExplicitOrMeasuredWidth(), toolTip.getExplicitOrMeasuredHeight());
}
public function set showEffect(value:IAbstractEffect):void{
_showEffect = (value as IAbstractEffect);
}
mx_internal function targetChanged():void{
var event:ToolTipEvent;
var me:InterManagerRequest;
if (!initialized){
initialize();
};
if (((previousTarget) && (currentToolTip))){
if ((currentToolTip is IToolTip)){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
} else {
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = ToolTipEvent.TOOL_TIP_HIDE;
sandboxRoot.dispatchEvent(me);
};
};
reset();
if (currentTarget){
if (currentText == ""){
return;
};
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_START);
currentTarget.dispatchEvent(event);
if ((((showDelay == 0)) || (scrubTimer.running))){
createTip();
initializeTip();
positionTip();
showTip();
} else {
showTimer.delay = showDelay;
showTimer.start();
};
};
}
public function set hideEffect(value:IAbstractEffect):void{
_hideEffect = (value as IAbstractEffect);
}
mx_internal function hideTimer_timerHandler(event:TimerEvent):void{
hideTip();
}
mx_internal function initializeTip():void{
if ((currentToolTip is IToolTip)){
IToolTip(currentToolTip).text = currentText;
};
if (((isError) && ((currentToolTip is IStyleClient)))){
IStyleClient(currentToolTip).setStyle("styleName", "errorTip");
};
sizeTip(currentToolTip);
if ((currentToolTip is IStyleClient)){
if (showEffect){
IStyleClient(currentToolTip).setStyle("showEffect", showEffect);
};
if (hideEffect){
IStyleClient(currentToolTip).setStyle("hideEffect", hideEffect);
};
};
if (((showEffect) || (hideEffect))){
currentToolTip.addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
}
public function get showEffect():IAbstractEffect{
return (_showEffect);
}
mx_internal function toolTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
mx_internal function hideTip():void{
var event:ToolTipEvent;
var sm:ISystemManager;
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
if (currentToolTip){
currentToolTip.visible = false;
};
if (isError){
if (currentTarget){
currentTarget.removeEventListener("change", changeHandler);
};
} else {
if (previousTarget){
sm = getSystemManager(previousTarget);
sm.removeEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
};
if (!hideEffect){
hideEffectEnded();
};
}
mx_internal function createTip():void{
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_CREATE);
currentTarget.dispatchEvent(event);
if (event.toolTip){
currentToolTip = event.toolTip;
} else {
currentToolTip = new toolTipClass();
};
currentToolTip.visible = false;
var sm:ISystemManager = (getSystemManager(currentTarget) as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
}
public static function getInstance():IToolTipManager2{
if (!instance){
instance = new (ToolTipManagerImpl);
};
return (instance);
}
}
}//package mx.managers
Section 262
//LoaderConfig (mx.messaging.config.LoaderConfig)
package mx.messaging.config {
import mx.core.*;
public class LoaderConfig {
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var _url:String = null;
mx_internal static var _parameters:Object;
public function LoaderConfig(){
super();
}
public static function get url():String{
return (_url);
}
public static function get parameters():Object{
return (_parameters);
}
}
}//package mx.messaging.config
Section 263
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import mx.core.*;
import flash.events.*;
import flash.system.*;
import flash.utils.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 264
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ModuleManager(){
super();
}
public static function getModule(url:String):IModuleInfo{
return (getSingleton().getModule(url));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(object:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(object));
}
}
}//package mx.modules
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import flash.net.*;
import flash.utils.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(info:ModuleInfo){
super();
this.info = info;
info.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(factory:IFlexModuleFactory):void{
info.publish(factory);
}
public function set data(value:Object):void{
_data = value;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
var moduleEvent:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
moduleEvent = new ModuleEvent(ModuleEvent.PROGRESS);
moduleEvent.bytesLoaded = info.size;
moduleEvent.bytesTotal = info.size;
dispatchEvent(moduleEvent);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(applicationDomain, securityDomain, bytes);
};
};
}
private function moduleEventHandler(event:ModuleEvent):void{
dispatchEvent(event);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(url:String):IModuleInfo{
var info:ModuleInfo = (moduleList[url] as ModuleInfo);
if (!info){
info = new ModuleInfo(url);
moduleList[url] = info;
};
return (new ModuleInfoProxy(info));
}
public function getAssociatedFactory(object:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
//unresolved jump
var _slot1 = error;
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(url:String){
super();
_url = url;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
loader.content.removeEventListener("error", moduleErrorHandler);
};
//unresolved jump
var _slot1 = error;
if (_loaded){
loader.close();
//unresolved jump
var _slot1 = error;
};
loader.unload();
//unresolved jump
var _slot1 = error;
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(event:Event):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(moduleEvent);
}
public function publish(factory:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = factory;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(event:Event):void{
var moduleEvent:ModuleEvent;
var event = event;
factoryInfo = new FactoryInfo();
factoryInfo.factory = (loader.content as IFlexModuleFactory);
//unresolved jump
var _slot1 = error;
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
loader.content.addEventListener("error", moduleErrorHandler);
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
//unresolved jump
var _slot1 = error;
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var f:Object;
if (((!(factoryInfo)) && (limbo))){
for (f in limbo) {
factoryInfo = (f as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(event:ErrorEvent):void{
_error = true;
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = event.text;
dispatchEvent(moduleEvent);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
private function loadBytes(applicationDomain:ApplicationDomain, bytes:ByteArray):void{
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in c)){
c["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.loadBytes(bytes, c);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(event:ProgressEvent):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = event.bytesLoaded;
moduleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(moduleEvent);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (bytes){
loadBytes(applicationDomain, bytes);
return;
};
if (_url.indexOf("published://") == 0){
return;
};
var r:URLRequest = new URLRequest(_url);
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
c.securityDomain = securityDomain;
if ((((securityDomain == null)) && ((Security.sandboxType == Security.REMOTE)))){
c.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(r, c);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function moduleErrorHandler(event:Event):void{
var errorEvent:ModuleEvent;
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
if ((event is ModuleEvent)){
errorEvent = ModuleEvent(event);
} else {
errorEvent = new ModuleEvent(ModuleEvent.ERROR);
};
dispatchEvent(errorEvent);
}
public function readyHandler(event:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
super();
}
}
Section 265
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
public function ModuleManagerGlobals(){
super();
}
}
}//package mx.modules
Section 266
//DownloadProgressBar (mx.preloaders.DownloadProgressBar)
package mx.preloaders {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import mx.graphics.*;
import flash.net.*;
import flash.utils.*;
public class DownloadProgressBar extends Sprite implements IPreloaderDisplay {
protected var MINIMUM_DISPLAY_TIME:uint;// = 0
private var _barFrameRect:RoundedRectangle;
private var _stageHeight:Number;// = 375
private var _stageWidth:Number;// = 500
private var _percentRect:Rectangle;
private var _percentObj:TextField;
private var _downloadingLabel:String;// = "Loading"
private var _showProgressBar:Boolean;// = true
private var _yOffset:Number;// = 20
private var _initProgressCount:uint;// = 0
private var _barSprite:Sprite;
private var _visible:Boolean;// = false
private var _barRect:RoundedRectangle;
private var _showingDisplay:Boolean;// = false
private var _backgroundSize:String;// = ""
private var _initProgressTotal:uint;// = 12
private var _startedInit:Boolean;// = false
private var _showLabel:Boolean;// = true
private var _value:Number;// = 0
private var _labelRect:Rectangle;
private var _backgroundImage:Object;
private var _backgroundAlpha:Number;// = 1
private var _backgroundColor:uint;
private var _startedLoading:Boolean;// = false
private var _showPercentage:Boolean;// = false
private var _barFrameSprite:Sprite;
protected var DOWNLOAD_PERCENTAGE:uint;// = 60
private var _displayStartCount:uint;// = 0
private var _labelObj:TextField;
private var _borderRect:RoundedRectangle;
private var _maximum:Number;// = 0
private var _displayTime:int;
private var _label:String;// = ""
private var _preloader:Sprite;
private var _xOffset:Number;// = 20
private var _startTime:int;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _initializingLabel:String = "Initializing";
public function DownloadProgressBar(){
_labelRect = labelRect;
_percentRect = percentRect;
_borderRect = borderRect;
_barFrameRect = barFrameRect;
_barRect = barRect;
super();
}
protected function getPercentLoaded(loaded:Number, total:Number):Number{
var perc:Number;
if ((((((((loaded == 0)) || ((total == 0)))) || (isNaN(total)))) || (isNaN(loaded)))){
return (0);
};
perc = ((100 * loaded) / total);
if (((isNaN(perc)) || ((perc <= 0)))){
return (0);
};
if (perc > 99){
return (99);
};
return (Math.round(perc));
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0x333333;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
private function calcScale():void{
var scale:Number;
if ((((stageWidth < 160)) || ((stageHeight < 120)))){
scaleX = 1;
scaleY = 1;
} else {
if ((((stageWidth < 240)) || ((stageHeight < 150)))){
createChildren();
scale = Math.min((stageWidth / 240), (stageHeight / 150));
scaleX = scale;
scaleY = scale;
} else {
createChildren();
};
};
}
protected function get percentRect():Rectangle{
return (new Rectangle(108, 4, 34, 16));
}
protected function set showLabel(value:Boolean):void{
_showLabel = value;
draw();
}
private function calcBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
if (backgroundSize){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function show():void{
_showingDisplay = true;
calcScale();
draw();
_displayTime = getTimer();
}
private function loadBackgroundImage(classOrString:Object):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var classOrString = classOrString;
if (((classOrString) && ((classOrString as Class)))){
cls = Class(classOrString);
initBackgroundImage(new (cls));
} else {
if (((classOrString) && ((classOrString is String)))){
cls = Class(getDefinitionByName(String(classOrString)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(classOrString)), loaderContext);
};
};
};
}
protected function set showPercentage(value:Boolean):void{
_showPercentage = value;
draw();
}
protected function get barFrameRect():RoundedRectangle{
return (new RoundedRectangle(14, 40, 154, 4));
}
private function loader_ioErrorHandler(event:IOErrorEvent):void{
}
protected function rslErrorHandler(event:RSLEvent):void{
_preloader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
_preloader.removeEventListener(Event.COMPLETE, completeHandler);
_preloader.removeEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
_preloader.removeEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
_preloader.removeEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
_preloader.removeEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
_preloader.removeEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
if (!_showingDisplay){
show();
_showingDisplay = true;
};
label = ((("RSL Error " + (event.rslIndex + 1)) + " of ") + event.rslTotal);
var errorField:ErrorField = new ErrorField(this);
errorField.show(event.errorText);
}
protected function rslCompleteHandler(event:RSLEvent):void{
label = ((("Loaded library " + event.rslIndex) + " of ") + event.rslTotal);
}
protected function get borderRect():RoundedRectangle{
return (new RoundedRectangle(0, 0, 182, 60, 4));
}
protected function showDisplayForDownloading(elapsedTime:int, event:ProgressEvent):Boolean{
return ((((elapsedTime > 700)) && ((event.bytesLoaded < (event.bytesTotal / 2)))));
}
protected function createChildren():void{
var labelObj:TextField;
var percentObj:TextField;
var g:Graphics = graphics;
if (backgroundColor != 4294967295){
g.beginFill(backgroundColor, backgroundAlpha);
g.drawRect(0, 0, stageWidth, stageHeight);
};
if (backgroundImage != null){
loadBackgroundImage(backgroundImage);
};
_barFrameSprite = new Sprite();
_barSprite = new Sprite();
addChild(_barFrameSprite);
addChild(_barSprite);
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height, (_borderRect.cornerRadius * 2), (_borderRect.cornerRadius * 2));
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
var frame_g:Graphics = _barFrameSprite.graphics;
var matrix:Matrix = new Matrix();
matrix.createGradientBox(_barFrameRect.width, _barFrameRect.height, (Math.PI / 2), calcX(_barFrameRect.x), calcY(_barFrameRect.y));
frame_g.beginGradientFill(GradientType.LINEAR, [6054502, 11909306], [1, 1], [0, 0xFF], matrix);
frame_g.drawRoundRect(calcX(_barFrameRect.x), calcY(_barFrameRect.y), _barFrameRect.width, _barFrameRect.height, (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.drawRoundRect(calcX((_barFrameRect.x + 1)), calcY((_barFrameRect.y + 1)), (_barFrameRect.width - 2), (_barFrameRect.height - 2), (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.endFill();
_labelObj = new TextField();
_labelObj.x = calcX(_labelRect.x);
_labelObj.y = calcY(_labelRect.y);
_labelObj.width = _labelRect.width;
_labelObj.height = _labelRect.height;
_labelObj.selectable = false;
_labelObj.defaultTextFormat = labelFormat;
addChild(_labelObj);
_percentObj = new TextField();
_percentObj.x = calcX(_percentRect.x);
_percentObj.y = calcY(_percentRect.y);
_percentObj.width = _percentRect.width;
_percentObj.height = _percentRect.height;
_percentObj.selectable = false;
_percentObj.defaultTextFormat = percentFormat;
addChild(_percentObj);
var ds:RectangularDropShadow = new RectangularDropShadow();
ds.color = 0;
ds.angle = 90;
ds.alpha = 0.6;
ds.distance = 2;
ds.tlRadius = (ds.trRadius = (ds.blRadius = (ds.brRadius = _borderRect.cornerRadius)));
ds.drawShadow(g, calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height);
g.lineStyle(1, 0xFFFFFF, 0.3);
g.moveTo((calcX(_borderRect.x) + _borderRect.cornerRadius), calcY(_borderRect.y));
g.lineTo(((calcX(_borderRect.x) - _borderRect.cornerRadius) + _borderRect.width), calcY(_borderRect.y));
}
private function draw():void{
var percentage:Number;
if (_startedLoading){
if (!_startedInit){
percentage = Math.round(((getPercentLoaded(_value, _maximum) * DOWNLOAD_PERCENTAGE) / 100));
} else {
percentage = Math.round((((getPercentLoaded(_value, _maximum) * (100 - DOWNLOAD_PERCENTAGE)) / 100) + DOWNLOAD_PERCENTAGE));
};
} else {
percentage = getPercentLoaded(_value, _maximum);
};
if (_labelObj){
_labelObj.text = _label;
};
if (_percentObj){
if (!_showPercentage){
_percentObj.visible = false;
_percentObj.text = "";
} else {
_percentObj.text = (String(percentage) + "%");
};
};
if (((_barSprite) && (_barFrameSprite))){
if (!_showProgressBar){
_barSprite.visible = false;
_barFrameSprite.visible = false;
} else {
drawProgressBar(percentage);
};
};
}
private function timerHandler(event:Event=null):void{
dispatchEvent(new Event(Event.COMPLETE));
}
private function hide():void{
}
public function get backgroundSize():String{
return (_backgroundSize);
}
protected function center(width:Number, height:Number):void{
_xOffset = Math.floor(((width - _borderRect.width) / 2));
_yOffset = Math.floor(((height - _borderRect.height) / 2));
}
protected function progressHandler(event:ProgressEvent):void{
var loaded:uint = event.bytesLoaded;
var total:uint = event.bytesTotal;
var elapsedTime:int = (getTimer() - _startTime);
if (((_showingDisplay) || (showDisplayForDownloading(elapsedTime, event)))){
if (!_startedLoading){
show();
label = downloadingLabel;
_startedLoading = true;
};
setProgress(event.bytesLoaded, event.bytesTotal);
};
}
protected function initProgressHandler(event:Event):void{
var loaded:Number;
var elapsedTime:int = (getTimer() - _startTime);
_initProgressCount++;
if (((!(_showingDisplay)) && (showDisplayForInit(elapsedTime, _initProgressCount)))){
_displayStartCount = _initProgressCount;
show();
} else {
if (_showingDisplay){
if (!_startedInit){
_startedInit = true;
label = initializingLabel;
};
loaded = ((100 * _initProgressCount) / (_initProgressTotal - _displayStartCount));
setProgress(loaded, 100);
};
};
}
protected function set downloadingLabel(value:String):void{
_downloadingLabel = value;
}
public function get stageWidth():Number{
return (_stageWidth);
}
protected function get showPercentage():Boolean{
return (_showPercentage);
}
override public function get visible():Boolean{
return (_visible);
}
public function set stageHeight(value:Number):void{
_stageHeight = value;
}
public function initialize():void{
_startTime = getTimer();
center(stageWidth, stageHeight);
}
protected function rslProgressHandler(event:RSLEvent):void{
}
protected function get barRect():RoundedRectangle{
return (new RoundedRectangle(14, 39, 154, 6, 0));
}
protected function get percentFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.align = "right";
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function set backgroundImage(value:Object):void{
_backgroundImage = value;
}
private function calcX(base:Number):Number{
return ((base + _xOffset));
}
private function calcY(base:Number):Number{
return ((base + _yOffset));
}
public function set backgroundAlpha(value:Number):void{
_backgroundAlpha = value;
}
private function initCompleteHandler(event:Event):void{
var timer:Timer;
var elapsedTime:int = (getTimer() - _displayTime);
if (((_showingDisplay) && ((elapsedTime < MINIMUM_DISPLAY_TIME)))){
timer = new Timer((MINIMUM_DISPLAY_TIME - elapsedTime), 1);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timerHandler();
};
}
public function set backgroundColor(value:uint):void{
_backgroundColor = value;
}
private function initBackgroundImage(image:DisplayObject):void{
var sX:Number;
var sY:Number;
var scale:Number;
addChildAt(image, 0);
var backgroundImageWidth:Number = image.width;
var backgroundImageHeight:Number = image.height;
var percentage:Number = calcBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * stageWidth) / backgroundImageWidth);
sY = ((scale * stageHeight) / backgroundImageHeight);
};
image.scaleX = sX;
image.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (stageWidth - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (stageHeight - (backgroundImageHeight * sY))));
image.x = offsetX;
image.y = offsetY;
if (!isNaN(backgroundAlpha)){
image.alpha = backgroundAlpha;
};
}
public function set backgroundSize(value:String):void{
_backgroundSize = value;
}
protected function showDisplayForInit(elapsedTime:int, count:int):Boolean{
return ((((elapsedTime > 300)) && ((count == 2))));
}
protected function get downloadingLabel():String{
return (_downloadingLabel);
}
private function loader_completeHandler(event:Event):void{
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
}
protected function setProgress(completed:Number, total:Number):void{
if (((((((!(isNaN(completed))) && (!(isNaN(total))))) && ((completed >= 0)))) && ((total > 0)))){
_value = Number(completed);
_maximum = Number(total);
draw();
};
}
public function get stageHeight():Number{
return (_stageHeight);
}
public function get backgroundImage():Object{
return (_backgroundImage);
}
public function get backgroundAlpha():Number{
if (!isNaN(_backgroundAlpha)){
return (_backgroundAlpha);
};
return (1);
}
private function drawProgressBar(percentage:Number):void{
var barY2:Number;
var g:Graphics = _barSprite.graphics;
g.clear();
var colors:Array = [0xFFFFFF, 0xFFFFFF];
var ratios:Array = [0, 0xFF];
var matrix:Matrix = new Matrix();
var barWidth:Number = ((_barRect.width * percentage) / 100);
var barWidthSplit:Number = (barWidth / 2);
var barHeight:Number = (_barRect.height - 4);
var barX:Number = calcX(_barRect.x);
var barY:Number = (calcY(_barRect.y) + 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.39, 0.85], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, barHeight);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.85, 1], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, barHeight);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = calcY(_barRect.y);
barY2 = ((barY + barHeight) - 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.05, 0.15], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.25], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.25, 0.1], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = (calcY(_barRect.y) + 1);
barY2 = ((calcY(_barRect.y) + barHeight) - 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.3], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.3, 0.4], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.4, 0.25], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
}
public function get backgroundColor():uint{
return (_backgroundColor);
}
public function set stageWidth(value:Number):void{
_stageWidth = value;
}
protected function completeHandler(event:Event):void{
}
protected function set label(value:String):void{
if (!(value is Function)){
_label = value;
};
draw();
}
public function set preloader(value:Sprite):void{
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
protected function get label():String{
return (_label);
}
protected function get labelRect():Rectangle{
return (new Rectangle(14, 17, 100, 16));
}
override public function set visible(value:Boolean):void{
if (((!(_visible)) && (value))){
show();
} else {
if (((_visible) && (!(value)))){
hide();
};
};
_visible = value;
}
protected function get showLabel():Boolean{
return (_showLabel);
}
public static function get initializingLabel():String{
return (_initializingLabel);
}
public static function set initializingLabel(value:String):void{
_initializingLabel = value;
}
}
}//package mx.preloaders
import flash.display.*;
import flash.text.*;
import flash.system.*;
class ErrorField extends Sprite {
private const TEXT_MARGIN_PX:int = 10;
private const MAX_WIDTH_INCHES:int = 6;
private const MIN_WIDTH_INCHES:int = 2;
private var downloadProgressBar:DownloadProgressBar;
private function ErrorField(downloadProgressBar:DownloadProgressBar){
super();
this.downloadProgressBar = downloadProgressBar;
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function show(errorText:String):void{
if ((((errorText == null)) || ((errorText.length == 0)))){
return;
};
var screenWidth:Number = downloadProgressBar.stageWidth;
var screenHeight:Number = downloadProgressBar.stageHeight;
var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
textField.multiline = true;
textField.wordWrap = true;
textField.background = true;
textField.defaultTextFormat = labelFormat;
textField.text = errorText;
textField.width = Math.max((MIN_WIDTH_INCHES * Capabilities.screenDPI), (screenWidth - (TEXT_MARGIN_PX * 2)));
textField.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), textField.width);
textField.y = Math.max(0, ((screenHeight - TEXT_MARGIN_PX) - textField.height));
textField.x = ((screenWidth - textField.width) / 2);
downloadProgressBar.parent.addChild(this);
this.addChild(textField);
}
}
Section 267
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay)
package mx.preloaders {
import flash.display.*;
import flash.events.*;
public interface IPreloaderDisplay extends IEventDispatcher {
function set backgroundAlpha(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get stageHeight():Number;
function get stageWidth():Number;
function set backgroundColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:uint):void;
function set preloader(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Sprite):void;
function get backgroundImage():Object;
function get backgroundSize():String;
function get backgroundAlpha():Number;
function set stageHeight(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get backgroundColor():uint;
function set stageWidth(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function set backgroundImage(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Object):void;
function set backgroundSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:String):void;
function initialize():void;
}
}//package mx.preloaders
Section 268
//Preloader (mx.preloaders.Preloader)
package mx.preloaders {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
public class Preloader extends Sprite {
private var app:IEventDispatcher;// = null
private var showDisplay:Boolean;
private var timer:Timer;
private var rslDone:Boolean;// = false
private var displayClass:IPreloaderDisplay;// = null
private var rslListLoader:RSLListLoader;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Preloader(){
super();
}
private function getByteValues():Object{
var li:LoaderInfo = root.loaderInfo;
var loaded:int = li.bytesLoaded;
var total:int = li.bytesTotal;
var n:int = (rslListLoader) ? rslListLoader.getItemCount() : 0;
var i:int;
while (i < n) {
loaded = (loaded + rslListLoader.getItem(i).loaded);
total = (total + rslListLoader.getItem(i).total);
i++;
};
return ({loaded:loaded, total:total});
}
private function appProgressHandler(event:Event):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
}
private function dispatchAppEndEvent(event:Object=null):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_COMPLETE));
if (!showDisplay){
displayClassCompleteHandler(null);
};
}
private function ioErrorHandler(event:IOErrorEvent):void{
}
private function appCreationCompleteHandler(event:FlexEvent):void{
dispatchAppEndEvent();
}
mx_internal function rslErrorHandler(event:ErrorEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_ERROR);
rslEvent.bytesLoaded = 0;
rslEvent.bytesTotal = 0;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
rslEvent.errorText = decodeURI(event.text);
dispatchEvent(rslEvent);
}
public function initialize(showDisplay:Boolean, displayClassName:Class, backgroundColor:uint, backgroundAlpha:Number, backgroundImage:Object, backgroundSize:String, displayWidth:Number, displayHeight:Number, libs:Array=null, sizes:Array=null, rslList:Array=null, resourceModuleURLs:Array=null):void{
var n:int;
var i:int;
var node:RSLItem;
var resourceModuleNode:ResourceModuleRSLItem;
if (((((!((libs == null))) || (!((sizes == null))))) && (!((rslList == null))))){
throw (new Error("RSLs may only be specified by using libs and sizes or rslList, not both."));
};
root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
if (((libs) && ((libs.length > 0)))){
if (rslList == null){
rslList = [];
};
n = libs.length;
i = 0;
while (i < n) {
node = new RSLItem(libs[i]);
rslList.push(node);
i++;
};
};
if (((resourceModuleURLs) && ((resourceModuleURLs.length > 0)))){
n = resourceModuleURLs.length;
i = 0;
while (i < n) {
resourceModuleNode = new ResourceModuleRSLItem(resourceModuleURLs[i]);
rslList.push(resourceModuleNode);
i++;
};
};
rslListLoader = new RSLListLoader(rslList);
this.showDisplay = showDisplay;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
if (showDisplay){
displayClass = new (displayClassName);
displayClass.addEventListener(Event.COMPLETE, displayClassCompleteHandler);
addChild(DisplayObject(displayClass));
displayClass.backgroundColor = backgroundColor;
displayClass.backgroundAlpha = backgroundAlpha;
displayClass.backgroundImage = backgroundImage;
displayClass.backgroundSize = backgroundSize;
displayClass.stageWidth = displayWidth;
displayClass.stageHeight = displayHeight;
displayClass.initialize();
displayClass.preloader = this;
};
if (rslListLoader.getItemCount() > 0){
rslListLoader.load(mx_internal::rslProgressHandler, mx_internal::rslCompleteHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler);
} else {
rslDone = true;
};
}
mx_internal function rslProgressHandler(event:ProgressEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_PROGRESS);
rslEvent.bytesLoaded = event.bytesLoaded;
rslEvent.bytesTotal = event.bytesTotal;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
}
public function registerApplication(app:IEventDispatcher):void{
app.addEventListener("validatePropertiesComplete", appProgressHandler);
app.addEventListener("validateSizeComplete", appProgressHandler);
app.addEventListener("validateDisplayListComplete", appProgressHandler);
app.addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
this.app = app;
}
mx_internal function rslCompleteHandler(event:Event):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_COMPLETE);
rslEvent.bytesLoaded = item.total;
rslEvent.bytesTotal = item.total;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
rslDone = ((index + 1) == rslEvent.rslTotal);
}
private function timerHandler(event:TimerEvent):void{
if (!root){
return;
};
var bytes:Object = getByteValues();
var loaded:int = bytes.loaded;
var total:int = bytes.total;
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, loaded, total));
if (((rslDone) && ((((((((loaded >= total)) && ((total > 0)))) || ((((total == 0)) && ((loaded > 0)))))) || ((((((root is MovieClip)) && ((MovieClip(root).totalFrames > 2)))) && ((MovieClip(root).framesLoaded >= 2)))))))){
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.reset();
dispatchEvent(new Event(Event.COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
};
}
private function displayClassCompleteHandler(event:Event):void{
if (displayClass){
displayClass.removeEventListener(Event.COMPLETE, displayClassCompleteHandler);
};
if (root){
root.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
};
if (app){
app.removeEventListener("validatePropertiesComplete", appProgressHandler);
app.removeEventListener("validateSizeComplete", appProgressHandler);
app.removeEventListener("validateDisplayListComplete", appProgressHandler);
app.removeEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
app = null;
};
dispatchEvent(new FlexEvent(FlexEvent.PRELOADER_DONE));
}
}
}//package mx.preloaders
Section 269
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 270
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function getPreferredLocaleChain():Array;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function initializeLocaleChain(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 271
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 272
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
import mx.core.*;
public class LocaleSorter {
mx_internal static const VERSION:String = "3.2.0.3958";
public function LocaleSorter(){
super();
}
private static function normalizeLocale(locale:String):String{
return (locale.toLowerCase().replace(/-/g, "_"));
}
public static function sortLocalesByPreference(appLocales:Array, systemPreferences:Array, ultimateFallbackLocale:String=null, addAll:Boolean=false):Array{
var result:Array;
var hasLocale:Object;
var i:int;
var j:int;
var k:int;
var l:int;
var locale:String;
var plocale:LocaleID;
var appLocales = appLocales;
var systemPreferences = systemPreferences;
var ultimateFallbackLocale = ultimateFallbackLocale;
var addAll = addAll;
var promote:Function = function (locale:String):void{
if (typeof(hasLocale[locale]) != "undefined"){
result.push(appLocales[hasLocale[locale]]);
delete hasLocale[locale];
};
};
result = [];
hasLocale = {};
var locales:Array = trimAndNormalize(appLocales);
var preferenceLocales:Array = trimAndNormalize(systemPreferences);
addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
j = 0;
while (j < locales.length) {
hasLocale[locales[j]] = j;
j = (j + 1);
};
i = 0;
l = preferenceLocales.length;
while (i < l) {
plocale = LocaleID.fromString(preferenceLocales[i]);
promote(preferenceLocales[i]);
promote(plocale.toString());
while (plocale.transformToParent()) {
promote(plocale.toString());
};
plocale = LocaleID.fromString(preferenceLocales[i]);
j = 0;
while (j < l) {
locale = preferenceLocales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
j = 0;
k = locales.length;
while (j < k) {
locale = locales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
i = (i + 1);
};
if (addAll){
j = 0;
k = locales.length;
while (j < k) {
promote(locales[j]);
j = (j + 1);
};
};
return (result);
}
private static function addUltimateFallbackLocale(preferenceLocales:Array, ultimateFallbackLocale:String):void{
var locale:String;
if (((!((ultimateFallbackLocale == null))) && (!((ultimateFallbackLocale == ""))))){
locale = normalizeLocale(ultimateFallbackLocale);
if (preferenceLocales.indexOf(locale) == -1){
preferenceLocales.push(locale);
};
};
}
private static function trimAndNormalize(list:Array):Array{
var resultList:Array = [];
var i:int;
while (i < list.length) {
resultList.push(normalizeLocale(list[i]));
i++;
};
return (resultList);
}
}
}//package mx.resources
class LocaleID {
private var privateLangs:Boolean;// = false
private var script:String;// = ""
private var variants:Array;
private var privates:Array;
private var extensions:Object;
private var lang:String;// = ""
private var region:String;// = ""
private var extended_langs:Array;
public static const STATE_PRIMARY_LANGUAGE:int = 0;
public static const STATE_REGION:int = 3;
public static const STATE_EXTENDED_LANGUAGES:int = 1;
public static const STATE_EXTENSIONS:int = 5;
public static const STATE_SCRIPT:int = 2;
public static const STATE_VARIANTS:int = 4;
public static const STATE_PRIVATES:int = 6;
private function LocaleID(){
extended_langs = [];
variants = [];
extensions = {};
privates = [];
super();
}
public function equals(locale:LocaleID):Boolean{
return ((toString() == locale.toString()));
}
public function canonicalize():void{
var i:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
if (extensions[i].length == 0){
delete extensions[i];
} else {
extensions[i] = extensions[i].sort();
};
};
};
extended_langs = extended_langs.sort();
variants = variants.sort();
privates = privates.sort();
if (script == ""){
script = LocaleRegistry.getScriptByLang(lang);
};
if ((((script == "")) && (!((region == ""))))){
script = LocaleRegistry.getScriptByLangAndRegion(lang, region);
};
if ((((region == "")) && (!((script == ""))))){
region = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
};
}
public function toString():String{
var i:String;
var stack:Array = [lang];
Array.prototype.push.apply(stack, extended_langs);
if (script != ""){
stack.push(script);
};
if (region != ""){
stack.push(region);
};
Array.prototype.push.apply(stack, variants);
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
stack.push(i);
Array.prototype.push.apply(stack, extensions[i]);
};
};
if (privates.length > 0){
stack.push("x");
Array.prototype.push.apply(stack, privates);
};
return (stack.join("_"));
}
public function isSiblingOf(other:LocaleID):Boolean{
return ((((lang == other.lang)) && ((script == other.script))));
}
public function transformToParent():Boolean{
var i:String;
var lastExtension:Array;
var defaultRegion:String;
if (privates.length > 0){
privates.splice((privates.length - 1), 1);
return (true);
};
var lastExtensionName:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
lastExtensionName = i;
};
};
if (lastExtensionName){
lastExtension = extensions[lastExtensionName];
if (lastExtension.length == 1){
delete extensions[lastExtensionName];
return (true);
};
lastExtension.splice((lastExtension.length - 1), 1);
return (true);
};
if (variants.length > 0){
variants.splice((variants.length - 1), 1);
return (true);
};
if (script != ""){
if (LocaleRegistry.getScriptByLang(lang) != ""){
script = "";
return (true);
};
if (region == ""){
defaultRegion = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
if (defaultRegion != ""){
region = defaultRegion;
script = "";
return (true);
};
};
};
if (region != ""){
if (!(((script == "")) && ((LocaleRegistry.getScriptByLang(lang) == "")))){
region = "";
return (true);
};
};
if (extended_langs.length > 0){
extended_langs.splice((extended_langs.length - 1), 1);
return (true);
};
return (false);
}
public static function fromString(str:String):LocaleID{
var last_extension:Array;
var subtag:String;
var subtag_length:int;
var firstChar:String;
var localeID:LocaleID = new (LocaleID);
var state:int = STATE_PRIMARY_LANGUAGE;
var subtags:Array = str.replace(/-/g, "_").split("_");
var i:int;
var l:int = subtags.length;
while (i < l) {
subtag = subtags[i].toLowerCase();
if (state == STATE_PRIMARY_LANGUAGE){
if (subtag == "x"){
localeID.privateLangs = true;
} else {
if (subtag == "i"){
localeID.lang = (localeID.lang + "i-");
} else {
localeID.lang = (localeID.lang + subtag);
state = STATE_EXTENDED_LANGUAGES;
};
};
} else {
subtag_length = subtag.length;
if (subtag_length == 0){
} else {
firstChar = subtag.charAt(0).toLowerCase();
if ((((state <= STATE_EXTENDED_LANGUAGES)) && ((subtag_length == 3)))){
localeID.extended_langs.push(subtag);
if (localeID.extended_langs.length == 3){
state = STATE_SCRIPT;
};
} else {
if ((((state <= STATE_SCRIPT)) && ((subtag_length == 4)))){
localeID.script = subtag;
state = STATE_REGION;
} else {
if ((((state <= STATE_REGION)) && ((((subtag_length == 2)) || ((subtag_length == 3)))))){
localeID.region = subtag;
state = STATE_VARIANTS;
} else {
if ((((state <= STATE_VARIANTS)) && ((((((((firstChar >= "a")) && ((firstChar <= "z")))) && ((subtag_length >= 5)))) || ((((((firstChar >= "0")) && ((firstChar <= "9")))) && ((subtag_length >= 4)))))))){
localeID.variants.push(subtag);
state = STATE_VARIANTS;
} else {
if ((((state < STATE_PRIVATES)) && ((subtag_length == 1)))){
if (subtag == "x"){
state = STATE_PRIVATES;
last_extension = localeID.privates;
} else {
state = STATE_EXTENSIONS;
last_extension = ((localeID.extensions[subtag]) || ([]));
localeID.extensions[subtag] = last_extension;
};
} else {
if (state >= STATE_EXTENSIONS){
last_extension.push(subtag);
};
};
};
};
};
};
};
};
i++;
};
localeID.canonicalize();
return (localeID);
}
}
class LocaleRegistry {
private static const SCRIPT_ID_BY_LANG:Object = {ab:5, af:1, am:2, ar:3, as:4, ay:1, be:5, bg:5, bn:4, bs:1, ca:1, ch:1, cs:1, cy:1, da:1, de:1, dv:6, dz:7, el:8, en:1, eo:1, es:1, et:1, eu:1, fa:3, fi:1, fj:1, fo:1, fr:1, frr:1, fy:1, ga:1, gl:1, gn:1, gu:9, gv:1, he:10, hi:11, hr:1, ht:1, hu:1, hy:12, id:1, in:1, is:1, it:1, iw:10, ja:13, ka:14, kk:5, kl:1, km:15, kn:16, ko:17, la:1, lb:1, ln:1, lo:18, lt:1, lv:1, mg:1, mh:1, mk:5, ml:19, mo:1, mr:11, ms:1, mt:1, my:20, na:1, nb:1, nd:1, ne:11, nl:1, nn:1, no:1, nr:1, ny:1, om:1, or:21, pa:22, pl:1, ps:3, pt:1, qu:1, rn:1, ro:1, ru:5, rw:1, sg:1, si:23, sk:1, sl:1, sm:1, so:1, sq:1, ss:1, st:1, sv:1, sw:1, ta:24, te:25, th:26, ti:2, tl:1, tn:1, to:1, tr:1, ts:1, uk:5, ur:3, ve:1, vi:1, wo:1, xh:1, yi:10, zu:1, cpe:1, dsb:1, frs:1, gsw:1, hsb:1, kok:11, mai:11, men:1, nds:1, niu:1, nqo:27, nso:1, son:1, tem:1, tkl:1, tmh:1, tpi:1, tvl:1, zbl:28};
private static const SCRIPTS:Array = ["", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"];
private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object = {bg:{5:"bg"}, ca:{1:"es"}, zh:{30:"tw", 29:"cn"}, cs:{1:"cz"}, da:{1:"dk"}, de:{1:"de"}, el:{8:"gr"}, en:{1:"us"}, es:{1:"es"}, fi:{1:"fi"}, fr:{1:"fr"}, he:{10:"il"}, hu:{1:"hu"}, is:{1:"is"}, it:{1:"it"}, ja:{13:"jp"}, ko:{17:"kr"}, nl:{1:"nl"}, nb:{1:"no"}, pl:{1:"pl"}, pt:{1:"br"}, ro:{1:"ro"}, ru:{5:"ru"}, hr:{1:"hr"}, sk:{1:"sk"}, sq:{1:"al"}, sv:{1:"se"}, th:{26:"th"}, tr:{1:"tr"}, ur:{3:"pk"}, id:{1:"id"}, uk:{5:"ua"}, be:{5:"by"}, sl:{1:"si"}, et:{1:"ee"}, lv:{1:"lv"}, lt:{1:"lt"}, fa:{3:"ir"}, vi:{1:"vn"}, hy:{12:"am"}, az:{1:"az", 5:"az"}, eu:{1:"es"}, mk:{5:"mk"}, af:{1:"za"}, ka:{14:"ge"}, fo:{1:"fo"}, hi:{11:"in"}, ms:{1:"my"}, kk:{5:"kz"}, ky:{5:"kg"}, sw:{1:"ke"}, uz:{1:"uz", 5:"uz"}, tt:{5:"ru"}, pa:{22:"in"}, gu:{9:"in"}, ta:{24:"in"}, te:{25:"in"}, kn:{16:"in"}, mr:{11:"in"}, sa:{11:"in"}, mn:{5:"mn"}, gl:{1:"es"}, kok:{11:"in"}, syr:{32:"sy"}, dv:{6:"mv"}, nn:{1:"no"}, sr:{1:"cs", 5:"cs"}, cy:{1:"gb"}, mi:{1:"nz"}, mt:{1:"mt"}, quz:{1:"bo"}, tn:{1:"za"}, xh:{1:"za"}, zu:{1:"za"}, nso:{1:"za"}, se:{1:"no"}, smj:{1:"no"}, sma:{1:"no"}, sms:{1:"fi"}, smn:{1:"fi"}, bs:{1:"ba"}};
private static const SCRIPT_BY_ID:Object = {latn:1, ethi:2, arab:3, beng:4, cyrl:5, thaa:6, tibt:7, grek:8, gujr:9, hebr:10, deva:11, armn:12, jpan:13, geor:14, khmr:15, knda:16, kore:17, laoo:18, mlym:19, mymr:20, orya:21, guru:22, sinh:23, taml:24, telu:25, thai:26, nkoo:27, blis:28, hans:29, hant:30, mong:31, syrc:32};
private static const SCRIPT_ID_BY_LANG_AND_REGION:Object = {zh:{cn:29, sg:29, tw:30, hk:30, mo:30}, mn:{cn:31, sg:5}, pa:{pk:3, in:22}, ha:{gh:1, ne:1}};
private function LocaleRegistry(){
super();
}
public static function getScriptByLangAndRegion(lang:String, region:String):String{
var langRegions:Object = SCRIPT_ID_BY_LANG_AND_REGION[lang];
if (langRegions == null){
return ("");
};
var scriptID:Object = langRegions[region];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getScriptByLang(lang:String):String{
var scriptID:Object = SCRIPT_ID_BY_LANG[lang];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getDefaultRegionForLangAndScript(lang:String, script:String):String{
var langObj:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[lang];
var scriptID:Object = SCRIPT_BY_ID[script];
if ((((langObj == null)) || ((scriptID == null)))){
return ("");
};
return (((langObj[int(scriptID)]) || ("")));
}
}
Section 273
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var backupApplicationDomain:ApplicationDomain;
mx_internal static var locale:String;
public function ResourceBundle(locale:String=null, bundleName:String=null){
_content = {};
super();
mx_internal::_locale = locale;
mx_internal::_bundleName = bundleName;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(key:String):String{
return (String(_getObject(key)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(key:String, defaultValue:Boolean=true):Boolean{
var temp:String = _getObject(key).toLowerCase();
if (temp == "false"){
return (false);
};
if (temp == "true"){
return (true);
};
return (defaultValue);
}
public function getStringArray(key:String):Array{
var array:Array = _getObject(key).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
public function getObject(key:String):Object{
return (_getObject(key));
}
private function _getObject(key:String):Object{
var value:Object = content[key];
if (!value){
throw (new Error(((("Key " + key) + " was not found in resource bundle ") + bundleName)));
};
return (value);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(key:String):Number{
return (Number(_getObject(key)));
}
private static function getClassByName(name:String, domain:ApplicationDomain):Class{
var c:Class;
if (domain.hasDefinition(name)){
c = (domain.getDefinition(name) as Class);
};
return (c);
}
public static function getResourceBundle(baseName:String, currentDomain:ApplicationDomain=null):ResourceBundle{
var className:String;
var bundleClass:Class;
var bundleObj:Object;
var bundle:ResourceBundle;
if (!currentDomain){
currentDomain = ApplicationDomain.currentDomain;
};
className = (((mx_internal::locale + "$") + baseName) + "_properties");
bundleClass = getClassByName(className, currentDomain);
if (!bundleClass){
className = (baseName + "_properties");
bundleClass = getClassByName(className, currentDomain);
};
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, currentDomain);
};
if (((!(bundleClass)) && (mx_internal::backupApplicationDomain))){
className = (baseName + "_properties");
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
};
};
if (bundleClass){
bundleObj = new (bundleClass);
if ((bundleObj is ResourceBundle)){
bundle = ResourceBundle(bundleObj);
return (bundle);
};
};
throw (new Error(("Could not find resource bundle " + baseName)));
}
}
}//package mx.resources
Section 274
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var implClassDependency:ResourceManagerImpl;
private static var instance:IResourceManager;
public function ResourceManager(){
super();
}
public static function getInstance():IResourceManager{
if (!instance){
instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
//unresolved jump
var _slot1 = e;
instance = new ResourceManagerImpl();
};
return (instance);
}
}
}//package mx.resources
Section 275
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import mx.modules.*;
import flash.utils.*;
import mx.utils.*;
public class ResourceManagerImpl extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:IResourceManager;
public function ResourceManagerImpl(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(value:Array):void{
_localeChain = value;
update();
}
public function getStringArray(bundleName:String, resourceName:String, locale:String=null):Array{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
var array:Array = String(value).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
mx_internal function installCompiledResourceBundle(applicationDomain:ApplicationDomain, locale:String, bundleName:String):void{
var packageName:String;
var localName:String = bundleName;
var colonIndex:int = bundleName.indexOf(":");
if (colonIndex != -1){
packageName = bundleName.substring(0, colonIndex);
localName = bundleName.substring((colonIndex + 1));
};
if (getResourceBundle(locale, bundleName)){
return;
};
var resourceBundleClassName = (((locale + "$") + localName) + "_properties");
if (packageName != null){
resourceBundleClassName = ((packageName + ".") + resourceBundleClassName);
};
var bundleClass:Class;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
if (!bundleClass){
resourceBundleClassName = bundleName;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
resourceBundleClassName = (bundleName + "_properties");
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
throw (new Error((((("Could not find compiled resource bundle '" + bundleName) + "' for locale '") + locale) + "'.")));
};
var resourceBundle:ResourceBundle = ResourceBundle(new (bundleClass));
resourceBundle.mx_internal::_locale = locale;
resourceBundle.mx_internal::_bundleName = bundleName;
addResourceBundle(resourceBundle);
}
public function getString(bundleName:String, resourceName:String, parameters:Array=null, locale:String=null):String{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:String = String(resourceBundle.content[resourceName]);
if (parameters){
value = StringUtil.substitute(value, parameters);
};
return (value);
}
public function loadResourceModule(url:String, updateFlag:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var updateFlag = updateFlag;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (event:ModuleEvent):void{
var resourceModule:* = event.module.factory.create();
resourceModules[event.module.url].resourceModule = resourceModule;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (event:ModuleEvent):void{
var resourceEvent:ResourceEvent;
var message:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
resourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = 0;
resourceEvent.bytesTotal = 0;
resourceEvent.errorText = message;
resourceEventDispatcher.dispatchEvent(resourceEvent);
} else {
throw (new Error(message));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var p:String;
var locales:Array = [];
for (p in localeMap) {
locales.push(p);
};
return (locales);
}
public function removeResourceBundlesForLocale(locale:String):void{
delete localeMap[locale];
}
public function getResourceBundle(locale:String, bundleName:String):IResourceBundle{
var bundleMap:Object = localeMap[locale];
if (!bundleMap){
return (null);
};
return (bundleMap[bundleName]);
}
private function dumpResourceModule(resourceModule):void{
var bundle:ResourceBundle;
var p:String;
for each (bundle in resourceModule.resourceBundles) {
trace(bundle.locale, bundle.bundleName);
for (p in bundle.content) {
};
};
}
public function addResourceBundle(resourceBundle:IResourceBundle):void{
var locale:String = resourceBundle.locale;
var bundleName:String = resourceBundle.bundleName;
if (!localeMap[locale]){
localeMap[locale] = {};
};
localeMap[locale][bundleName] = resourceBundle;
}
public function getObject(bundleName:String, resourceName:String, locale:String=null){
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (undefined);
};
return (resourceBundle.content[resourceName]);
}
public function getInt(bundleName:String, resourceName:String, locale:String=null):int{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (int(value));
}
private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{
supportNonFrameworkApps();
return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, resourceName));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain;
if (!applicationDomain.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var c:Class = Class(applicationDomain.getDefinition("_CompiledResourceBundleInfo"));
var locales:Array = c.compiledLocales;
var bundleNames:Array = c.compiledResourceBundleNames;
installCompiledResourceBundles(applicationDomain, locales, bundleNames);
localeChain = locales;
}
public function getBundleNamesForLocale(locale:String):Array{
var p:String;
var bundleNames:Array = [];
for (p in localeMap[locale]) {
bundleNames.push(p);
};
return (bundleNames);
}
public function getPreferredLocaleChain():Array{
return (LocaleSorter.sortLocalesByPreference(getLocales(), getSystemPreferredLocales(), null, true));
}
public function getNumber(bundleName:String, resourceName:String, locale:String=null):Number{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (NaN);
};
var value:* = resourceBundle.content[resourceName];
return (Number(value));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getClass(bundleName:String, resourceName:String, locale:String=null):Class{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
return ((value as Class));
}
public function removeResourceBundle(locale:String, bundleName:String):void{
delete localeMap[locale][bundleName];
if (getBundleNamesForLocale(locale).length == 0){
delete localeMap[locale];
};
}
public function initializeLocaleChain(compiledLocales:Array):void{
localeChain = LocaleSorter.sortLocalesByPreference(compiledLocales, getSystemPreferredLocales(), null, true);
}
public function findResourceBundleWithResource(bundleName:String, resourceName:String):IResourceBundle{
var locale:String;
var bundleMap:Object;
var bundle:ResourceBundle;
if (!_localeChain){
return (null);
};
var n:int = _localeChain.length;
var i:int;
while (i < n) {
locale = localeChain[i];
bundleMap = localeMap[locale];
if (!bundleMap){
} else {
bundle = bundleMap[bundleName];
if (!bundle){
} else {
if ((resourceName in bundle.content)){
return (bundle);
};
};
};
i++;
};
return (null);
}
public function getUint(bundleName:String, resourceName:String, locale:String=null):uint{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (uint(value));
}
private function getSystemPreferredLocales():Array{
var systemPreferences:Array;
if (Capabilities["languages"]){
systemPreferences = Capabilities["languages"];
} else {
systemPreferences = [Capabilities.language];
};
return (systemPreferences);
}
public function installCompiledResourceBundles(applicationDomain:ApplicationDomain, locales:Array, bundleNames:Array):void{
var locale:String;
var j:int;
var bundleName:String;
var n:int = (locales) ? locales.length : 0;
var m:int = (bundleNames) ? bundleNames.length : 0;
var i:int;
while (i < n) {
locale = locales[i];
j = 0;
while (j < m) {
bundleName = bundleNames[j];
mx_internal::installCompiledResourceBundle(applicationDomain, locale, bundleName);
j++;
};
i++;
};
}
public function getBoolean(bundleName:String, resourceName:String, locale:String=null):Boolean{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (false);
};
var value:* = resourceBundle.content[resourceName];
return ((String(value).toLowerCase() == "true"));
}
public function unloadResourceModule(url:String, update:Boolean=true):void{
throw (new Error("unloadResourceModule() is not yet implemented."));
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.events.*;
import mx.modules.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(moduleInfo:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.moduleInfo = moduleInfo;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
dispatchEvent(resourceEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(resourceEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
resourceEvent.errorText = event.errorText;
dispatchEvent(resourceEvent);
}
}
Section 276
//IResponder (mx.rpc.IResponder)
package mx.rpc {
public interface IResponder {
function fault(:Object):void;
function result(:Object):void;
}
}//package mx.rpc
Section 277
//ApplicationBackground (mx.skins.halo.ApplicationBackground)
package mx.skins.halo {
import flash.display.*;
import mx.utils.*;
import mx.skins.*;
public class ApplicationBackground extends ProgrammaticSkin {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ApplicationBackground(){
super();
}
override public function get measuredWidth():Number{
return (8);
}
override public function get measuredHeight():Number{
return (8);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var bgColor:uint;
super.updateDisplayList(w, h);
var g:Graphics = graphics;
var fillColors:Array = getStyle("backgroundGradientColors");
var fillAlphas:Array = getStyle("backgroundGradientAlphas");
if (!fillColors){
bgColor = getStyle("backgroundColor");
if (isNaN(bgColor)){
bgColor = 0xFFFFFF;
};
fillColors = [];
fillColors[0] = ColorUtil.adjustBrightness(bgColor, 15);
fillColors[1] = ColorUtil.adjustBrightness(bgColor, -25);
};
if (!fillAlphas){
fillAlphas = [1, 1];
};
g.clear();
drawRoundRect(0, 0, w, h, 0, fillColors, fillAlphas, verticalGradientMatrix(0, 0, w, h));
}
}
}//package mx.skins.halo
Section 278
//BusyCursor (mx.skins.halo.BusyCursor)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.styles.*;
public class BusyCursor extends FlexSprite {
private var hourHand:Shape;
private var minuteHand:Shape;
mx_internal static const VERSION:String = "3.2.0.3958";
public function BusyCursor(){
var g:Graphics;
super();
var cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
var cursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursorBackground");
var cursorHolder:DisplayObject = new (cursorClass);
if ((cursorHolder is InteractiveObject)){
InteractiveObject(cursorHolder).mouseEnabled = false;
};
addChild(cursorHolder);
var xOff:Number = -0.5;
var yOff:Number = -0.5;
minuteHand = new FlexShape();
minuteHand.name = "minuteHand";
g = minuteHand.graphics;
g.beginFill(0);
g.moveTo(xOff, yOff);
g.lineTo((1 + xOff), (0 + yOff));
g.lineTo((1 + xOff), (5 + yOff));
g.lineTo((0 + xOff), (5 + yOff));
g.lineTo((0 + xOff), (0 + yOff));
g.endFill();
addChild(minuteHand);
hourHand = new FlexShape();
hourHand.name = "hourHand";
g = hourHand.graphics;
g.beginFill(0);
g.moveTo(xOff, yOff);
g.lineTo((4 + xOff), (0 + yOff));
g.lineTo((4 + xOff), (1 + yOff));
g.lineTo((0 + xOff), (1 + yOff));
g.lineTo((0 + xOff), (0 + yOff));
g.endFill();
addChild(hourHand);
addEventListener(Event.ADDED, handleAdded);
addEventListener(Event.REMOVED, handleRemoved);
}
private function enterFrameHandler(event:Event):void{
minuteHand.rotation = (minuteHand.rotation + 12);
hourHand.rotation = (hourHand.rotation + 1);
}
private function handleAdded(event:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function handleRemoved(event:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package mx.skins.halo
Section 279
//ButtonSkin (mx.skins.halo.ButtonSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.utils.*;
import mx.skins.*;
public class ButtonSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ButtonSkin(){
super();
}
override public function get measuredWidth():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_WIDTH);
}
override public function get measuredHeight():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_HEIGHT);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tmp:Number;
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
var disFillColors:Array;
var disFillAlphas:Array;
super.updateDisplayList(w, h);
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var derStyles:Object = calcDerivedStyles(themeColor, fillColors[0], fillColors[1]);
var borderColorDrk1:Number = ColorUtil.adjustBrightness2(borderColor, -50);
var themeColorDrk1:Number = ColorUtil.adjustBrightness2(themeColor, -25);
var emph:Boolean;
if ((parent is IButton)){
emph = IButton(parent).emphasized;
};
var cr:Number = Math.max(0, cornerRadius);
var cr1:Number = Math.max(0, (cornerRadius - 1));
var cr2:Number = Math.max(0, (cornerRadius - 2));
graphics.clear();
switch (name){
case "selectedUpSkin":
case "selectedOverSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [fillColors[1], fillColors[1]], 1, verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
break;
case "upSkin":
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
if (emph){
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:2, y:2, w:(w - 4), h:(h - 4), r:(cornerRadius - 2)});
drawRoundRect(2, 2, (w - 4), (h - 4), cr2, upFillColors, upFillAlphas, verticalGradientMatrix(2, 2, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
} else {
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, upFillColors, upFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
};
break;
case "overSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, overFillColors, overFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "downSkin":
case "selectedDownSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "disabledSkin":
case "selectedDisabledSkin":
disFillColors = [fillColors[0], fillColors[1]];
disFillAlphas = [Math.max(0, (fillAlphas[0] - 0.15)), Math.max(0, (fillAlphas[1] - 0.15))];
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 0.5, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, disFillColors, disFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
break;
};
}
private static function calcDerivedStyles(themeColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 280
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.graphics.*;
import mx.utils.*;
import mx.skins.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
super();
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(styleProp:String):void{
if ((((((((((styleProp == null)) || ((styleProp == "styleName")))) || ((styleProp == "borderStyle")))) || ((styleProp == "borderThickness")))) || ((styleProp == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(w:Number, h:Number):void{
if (((isNaN(w)) || (isNaN(h)))){
return;
};
super.updateDisplayList(w, h);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(w, h);
drawBackground(w, h);
}
mx_internal function drawBorder(w:Number, h:Number):void{
var backgroundAlpha:Number;
var borderCapColor:uint;
var borderColor:uint;
var borderSides:String;
var borderThickness:Number;
var buttonColor:uint;
var docked:Boolean;
var dropdownBorderColor:uint;
var fillColors:Array;
var footerColors:Array;
var highlightColor:uint;
var shadowCapColor:uint;
var shadowColor:uint;
var themeColor:uint;
var translucent:Boolean;
var hole:Object;
var borderColorDrk1:Number;
var borderColorDrk2:Number;
var borderColorLt1:Number;
var borderInnerColor:Object;
var contentAlpha:Number;
var br:Number;
var parentContainer:IContainer;
var vm:EdgeMetrics;
var showChrome:Boolean;
var borderAlpha:Number;
var fillAlphas:Array;
var backgroundColorNum:uint;
var bHasAllSides:Boolean;
var holeRadius:Number;
var borderStyle:String = getStyle("borderStyle");
var highlightAlphas:Array = getStyle("highlightAlphas");
var drawTopHighlight:Boolean;
var g:Graphics = graphics;
g.clear();
if (borderStyle){
switch (borderStyle){
case "none":
break;
case "inset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, 25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorDrk1, borderColorLt1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "outset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorLt1, borderColorDrk1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
contentAlpha = getStyle("backgroundAlpha");
backgroundAlpha = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
br = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, w, h, radius, radius, br, br);
if (!bRoundedCorners){
radiusObj = {};
};
parentContainer = (parent as IContainer);
if (parentContainer){
vm = parentContainer.viewMetrics;
backgroundHole = {x:vm.left, y:vm.top, w:Math.max(0, ((w - vm.left) - vm.right)), h:Math.max(0, ((h - vm.top) - vm.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (contentAlpha != backgroundAlpha){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
g.beginFill(Number(backgroundColor), contentAlpha);
g.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
g.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
dropdownBorderColor = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, w, h, 4, 0, 0, 4);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
if (!isNaN(dropdownBorderColor)){
drawRoundRect(0, 0, (w + 1), h, {tl:4, tr:0, br:0, bl:4}, dropdownBorderColor, 0.5);
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
borderColor = getStyle("borderColor");
drawRoundRect(0, 0, w, h, 0, borderColor, 1);
drawDropShadow(1, 1, (w - 2), (h - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((w == 0)) || ((h == 0)))){
backgroundColor = null;
break;
};
footerColors = getStyle("footerColors");
showChrome = !((footerColors == null));
borderAlpha = getStyle("borderAlpha");
if (showChrome){
g.lineStyle(0, ((footerColors.length > 0)) ? footerColors[1] : footerColors[0], borderAlpha);
g.moveTo(0, 0);
g.lineTo(w, 0);
g.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
borderAlpha = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
if ((((footerColors.length > 1)) && (!((footerColors[0] == footerColors[1]))))){
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 2, (w - 2), (h - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
fillColors = getStyle("fillColors");
backgroundAlpha = getStyle("backgroundAlpha");
highlightAlphas = getStyle("highlightAlphas");
fillAlphas = getStyle("fillAlphas");
docked = getStyle("docked");
backgroundColorNum = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, w, (h - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, w, (h - 1), radius, backgroundColorNum, backgroundAlpha, verticalGradientMatrix(0, 0, w, h));
};
drawRoundRect(0, 1, w, (h - 1), radius, fillColors, fillAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(0, 1, w, ((h / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, ((h / 2) - 1)));
drawRoundRect(0, 1, w, (h - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:w, h:(h - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
borderColor = getStyle("borderColor");
borderThickness = getStyle("borderThickness");
borderSides = getStyle("borderSides");
bHasAllSides = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
holeRadius = Math.max((radius - borderThickness), 0);
hole = {x:borderThickness, y:borderThickness, w:(w - (borderThickness * 2)), h:(h - (borderThickness * 2)), r:holeRadius};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
hole.r = {tl:holeRadius, tr:holeRadius, bl:0, br:0};
};
if (borderSides != "left top right bottom"){
hole.r = {tl:holeRadius, tr:holeRadius, bl:(bRoundedCorners) ? holeRadius : 0, br:(bRoundedCorners) ? holeRadius : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
borderSides = borderSides.toLowerCase();
if (borderSides.indexOf("left") == -1){
hole.x = 0;
hole.w = (hole.w + borderThickness);
hole.r.tl = 0;
hole.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("top") == -1){
hole.y = 0;
hole.h = (hole.h + borderThickness);
hole.r.tl = 0;
hole.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("right") == -1){
hole.w = (hole.w + borderThickness);
hole.r.tr = 0;
hole.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("bottom") == -1){
hole.h = (hole.h + borderThickness);
hole.r.bl = 0;
hole.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
};
if ((((radius == 0)) && (bHasAllSides))){
drawDropShadow(0, 0, w, h, 0, 0, 0, 0);
g.beginFill(borderColor);
g.drawRect(0, 0, w, h);
g.drawRect(borderThickness, borderThickness, (w - (2 * borderThickness)), (h - (2 * borderThickness)));
g.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, w, h, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, w, h, radiusObj, borderColor, 1, null, null, null, hole);
radiusObj.tl = Math.max((radius - borderThickness), 0);
radiusObj.tr = Math.max((radius - borderThickness), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
} else {
drawDropShadow(0, 0, w, h, radius, radius, radius, radius);
drawRoundRect(0, 0, w, h, radius, borderColor, 1, null, null, null, hole);
radius = Math.max((getStyle("cornerRadius") - borderThickness), 0);
};
};
};
};
}
mx_internal function drawBackground(w:Number, h:Number):void{
var nd:Number;
var alpha:Number;
var bm:EdgeMetrics;
var g:Graphics;
var bottom:Number;
var bottomRadius:Number;
var highlightAlphas:Array;
var highlightAlpha:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
nd = Number(backgroundColor);
alpha = 1;
bm = getBackgroundColorMetrics();
g = graphics;
if (((((isNaN(nd)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
alpha = 0;
nd = 0xFFFFFF;
} else {
alpha = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
bottom = bm.bottom;
if (radiusObj){
bottomRadius = (bRoundedCorners) ? radius : 0;
radiusObj = {tl:radius, tr:radius, bl:bottomRadius, br:bottomRadius};
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radiusObj, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radius, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
g.beginFill(nd, alpha);
g.drawRect(bm.left, bm.top, ((w - bm.right) - bm.left), ((h - bm.bottom) - bm.top));
g.endFill();
};
};
var borderStyle:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((borderStyle == "alert")) || ((borderStyle == "default")))))) && ((getStyle("headerColors") == null)))){
highlightAlphas = getStyle("highlightAlphas");
highlightAlpha = (highlightAlphas) ? highlightAlphas[0] : 0.3;
drawRoundRect(0, 0, w, h, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, highlightAlpha, null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(x:Number, y:Number, width:Number, height:Number, tlRadius:Number, trRadius:Number, brRadius:Number, blRadius:Number):void{
var angle:Number;
var docked:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((width == 0)))) || ((height == 0)))){
return;
};
var distance:Number = getStyle("shadowDistance");
var direction:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
docked = getStyle("docked");
angle = (docked) ? 90 : getDropShadowAngle(distance, direction);
distance = Math.abs(distance);
} else {
angle = getDropShadowAngle(distance, direction);
distance = (Math.abs(distance) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = distance;
dropShadow.angle = angle;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = tlRadius;
dropShadow.trRadius = trRadius;
dropShadow.blRadius = blRadius;
dropShadow.brRadius = brRadius;
dropShadow.drawShadow(graphics, x, y, width, height);
}
mx_internal function getBackgroundColor():Object{
var color:Object;
var p:IUIComponent = (parent as IUIComponent);
if (((p) && (!(p.enabled)))){
color = getStyle("backgroundDisabledColor");
if (((!((color === null))) && (StyleManager.isValidStyleValue(color)))){
return (color);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(c1:Number, c2:Number, c3:Number, c4:Number, c5:Number, c6:Number):void{
var w:Number = width;
var h:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var g:Graphics = graphics;
g.beginFill(c1);
g.drawRect(0, 0, w, h);
g.drawRect(1, 0, (w - 2), h);
g.endFill();
g.beginFill(c2);
g.drawRect(1, 0, (w - 2), 1);
g.endFill();
g.beginFill(c3);
g.drawRect(1, (h - 1), (w - 2), 1);
g.endFill();
g.beginFill(c4);
g.drawRect(1, 1, (w - 2), 1);
g.endFill();
g.beginFill(c5);
g.drawRect(1, (h - 2), (w - 2), 1);
g.endFill();
g.beginFill(c6);
g.drawRect(1, 2, (w - 2), (h - 4));
g.drawRect(2, 2, (w - 4), (h - 4));
g.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(distance:Number, direction:String):Number{
if (direction == "left"){
return (((distance >= 0)) ? 135 : 225);
} else {
if (direction == "right"){
return (((distance >= 0)) ? 45 : 315);
//unresolved jump
};
};
return (!NULL!);
}
override public function get borderMetrics():EdgeMetrics{
var borderThickness:Number;
var borderSides:String;
if (_borderMetrics){
return (_borderMetrics);
};
var borderStyle:String = getStyle("borderStyle");
if ((((borderStyle == "default")) || ((borderStyle == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((borderStyle == "controlBar")) || ((borderStyle == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (borderStyle == "solid"){
borderThickness = getStyle("borderThickness");
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
borderSides = getStyle("borderSides");
if (borderSides != "left top right bottom"){
if (borderSides.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (borderSides.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (borderSides.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (borderSides.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
borderThickness = BORDER_WIDTHS[borderStyle];
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 281
//HaloColors (mx.skins.halo.HaloColors)
package mx.skins.halo {
import mx.utils.*;
public class HaloColors {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function HaloColors(){
super();
}
public static function getCacheKey(... _args):String{
return (_args.join(","));
}
public static function addHaloColors(colors:Object, themeColor:uint, fillColor0:uint, fillColor1:uint):void{
var key:String = getCacheKey(themeColor, fillColor0, fillColor1);
var o:Object = cache[key];
if (!o){
o = (cache[key] = {});
o.themeColLgt = ColorUtil.adjustBrightness(themeColor, 100);
o.themeColDrk1 = ColorUtil.adjustBrightness(themeColor, -75);
o.themeColDrk2 = ColorUtil.adjustBrightness(themeColor, -25);
o.fillColorBright1 = ColorUtil.adjustBrightness2(fillColor0, 15);
o.fillColorBright2 = ColorUtil.adjustBrightness2(fillColor1, 15);
o.fillColorPress1 = ColorUtil.adjustBrightness2(themeColor, 85);
o.fillColorPress2 = ColorUtil.adjustBrightness2(themeColor, 60);
o.bevelHighlight1 = ColorUtil.adjustBrightness2(fillColor0, 40);
o.bevelHighlight2 = ColorUtil.adjustBrightness2(fillColor1, 40);
};
colors.themeColLgt = o.themeColLgt;
colors.themeColDrk1 = o.themeColDrk1;
colors.themeColDrk2 = o.themeColDrk2;
colors.fillColorBright1 = o.fillColorBright1;
colors.fillColorBright2 = o.fillColorBright2;
colors.fillColorPress1 = o.fillColorPress1;
colors.fillColorPress2 = o.fillColorPress2;
colors.bevelHighlight1 = o.bevelHighlight1;
colors.bevelHighlight2 = o.bevelHighlight2;
}
}
}//package mx.skins.halo
Section 282
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.utils.*;
import mx.skins.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function HaloFocusRect(){
super();
}
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(value:Object):void{
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
}
public function registerEffects(effects:Array):void{
}
public function regenerateStyleCache(recursive:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(styleProp:String):void{
if (styleProp == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "focusColor"){
_focusColor = newValue;
};
}
public function set nonInheritingStyles(value:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tl:Number;
var bl:Number;
var tr:Number;
var br:Number;
var nr:Number;
var ellipseSize:Number;
super.updateDisplayList(w, h);
var focusBlendMode:String = getStyle("focusBlendMode");
var focusAlpha:Number = getStyle("focusAlpha");
var focusColor:Number = getStyle("focusColor");
var cornerRadius:Number = getStyle("cornerRadius");
var focusThickness:Number = getStyle("focusThickness");
var focusRoundedCorners:String = getStyle("focusRoundedCorners");
var themeColor:Number = getStyle("themeColor");
var rectColor:Number = focusColor;
if (isNaN(rectColor)){
rectColor = themeColor;
};
var g:Graphics = graphics;
g.clear();
blendMode = focusBlendMode;
if (((!((focusRoundedCorners == "tl tr bl br"))) && ((cornerRadius > 0)))){
tl = 0;
bl = 0;
tr = 0;
br = 0;
nr = (cornerRadius + focusThickness);
if (focusRoundedCorners.indexOf("tl") >= 0){
tl = nr;
};
if (focusRoundedCorners.indexOf("tr") >= 0){
tr = nr;
};
if (focusRoundedCorners.indexOf("bl") >= 0){
bl = nr;
};
if (focusRoundedCorners.indexOf("br") >= 0){
br = nr;
};
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, w, h, tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
nr = (cornerRadius + (focusThickness / 2));
tl = (tl) ? nr : 0;
tr = (tr) ? nr : 0;
bl = (bl) ? nr : 0;
br = (br) ? nr : 0;
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, (focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
} else {
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + focusThickness) : 0 * 2);
g.drawRoundRect(0, 0, w, h, ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + (focusThickness / 2)) : 0 * 2);
g.drawRoundRect((focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
};
}
override public function getStyle(styleProp:String){
return (((styleProp == "focusColor")) ? _focusColor : super.getStyle(styleProp));
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 283
//PanelSkin (mx.skins.halo.PanelSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class PanelSkin extends HaloBorder {
private var oldControlBarHeight:Number;
protected var _panelBorderMetrics:EdgeMetrics;
private var oldHeaderHeight:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var panels:Object = {};
public function PanelSkin(){
super();
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((((((((((((((((styleProp == null)) || ((styleProp == "styleName")))) || ((styleProp == "borderStyle")))) || ((styleProp == "borderThickness")))) || ((styleProp == "borderThicknessTop")))) || ((styleProp == "borderThicknessBottom")))) || ((styleProp == "borderThicknessLeft")))) || ((styleProp == "borderThicknessRight")))) || ((styleProp == "borderSides")))){
_panelBorderMetrics = null;
};
invalidateDisplayList();
}
override mx_internal function drawBorder(w:Number, h:Number):void{
var contentAlpha:Number;
var backgroundAlpha:Number;
var br:Number;
var g:Graphics;
var parentContainer:IContainer;
var vm:EdgeMetrics;
super.drawBorder(w, h);
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return;
};
var borderStyle:String = getStyle("borderStyle");
if (borderStyle == "default"){
contentAlpha = getStyle("backgroundAlpha");
backgroundAlpha = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radiusObj = null;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
br = (bRoundedCorners) ? radius : 0;
g = graphics;
drawDropShadow(0, 0, w, h, radius, radius, br, br);
if (!bRoundedCorners){
radiusObj = {};
};
parentContainer = (parent as IContainer);
if (parentContainer){
vm = parentContainer.viewMetrics;
backgroundHole = {x:vm.left, y:vm.top, w:Math.max(0, ((w - vm.left) - vm.right)), h:Math.max(0, ((h - vm.top) - vm.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (contentAlpha != backgroundAlpha){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
g.beginFill(Number(backgroundColor), contentAlpha);
g.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
g.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
}
override public function get borderMetrics():EdgeMetrics{
var newControlBarHeight:Number;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (super.borderMetrics);
};
var hasPanelParent:Boolean = isPanel(parent);
var controlBar:IUIComponent = (hasPanelParent) ? Object(parent)._controlBar : null;
var hHeight:Number = (hasPanelParent) ? Object(parent).getHeaderHeightProxy() : NaN;
if (((controlBar) && (controlBar.includeInLayout))){
newControlBarHeight = controlBar.getExplicitOrMeasuredHeight();
};
if (((!((newControlBarHeight == oldControlBarHeight))) && (!(((isNaN(oldControlBarHeight)) && (isNaN(newControlBarHeight))))))){
_panelBorderMetrics = null;
};
if (((!((hHeight == oldHeaderHeight))) && (!(((isNaN(hHeight)) && (isNaN(oldHeaderHeight))))))){
_panelBorderMetrics = null;
};
if (_panelBorderMetrics){
return (_panelBorderMetrics);
};
var o:EdgeMetrics = super.borderMetrics;
var vm:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
var bt:Number = getStyle("borderThickness");
var btl:Number = getStyle("borderThicknessLeft");
var btt:Number = getStyle("borderThicknessTop");
var btr:Number = getStyle("borderThicknessRight");
var btb:Number = getStyle("borderThicknessBottom");
vm.left = (o.left + (isNaN(btl)) ? bt : btl);
vm.top = (o.top + (isNaN(btt)) ? bt : btt);
vm.right = (o.bottom + (isNaN(btr)) ? bt : btr);
vm.bottom = (o.bottom + (isNaN(btb)) ? (((controlBar) && (!(isNaN(btt))))) ? btt : (isNaN(btl)) ? bt : btl : btb);
oldHeaderHeight = hHeight;
if (!isNaN(hHeight)){
vm.top = (vm.top + hHeight);
};
oldControlBarHeight = newControlBarHeight;
if (!isNaN(newControlBarHeight)){
vm.bottom = (vm.bottom + newControlBarHeight);
};
_panelBorderMetrics = vm;
return (_panelBorderMetrics);
}
override mx_internal function drawBackground(w:Number, h:Number):void{
var highlightAlphas:Array;
var highlightAlpha:Number;
super.drawBackground(w, h);
if ((((getStyle("headerColors") == null)) && ((getStyle("borderStyle") == "default")))){
highlightAlphas = getStyle("highlightAlphas");
highlightAlpha = (highlightAlphas) ? highlightAlphas[0] : 0.3;
drawRoundRect(0, 0, w, h, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, highlightAlpha, null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
override mx_internal function getBackgroundColorMetrics():EdgeMetrics{
if (getStyle("borderStyle") == "default"){
return (EdgeMetrics.EMPTY);
};
return (super.borderMetrics);
}
private static function isPanel(parent:Object):Boolean{
var s:String;
var x:XML;
var parent = parent;
s = getQualifiedClassName(parent);
if (panels[s] == 1){
return (true);
};
if (panels[s] == 0){
return (false);
};
if (s == "mx.containers::Panel"){
(panels[s] == 1);
return (true);
};
x = describeType(parent);
var xmllist:XMLList = x.extendsClass.(@type == "mx.containers::Panel");
if (xmllist.length() == 0){
panels[s] = 0;
return (false);
};
panels[s] = 1;
return (true);
}
}
}//package mx.skins.halo
Section 284
//ScrollArrowSkin (mx.skins.halo.ScrollArrowSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.controls.scrollClasses.*;
import mx.utils.*;
import mx.skins.*;
public class ScrollArrowSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ScrollArrowSkin(){
super();
}
override public function get measuredWidth():Number{
return (ScrollBar.THICKNESS);
}
override public function get measuredHeight():Number{
return (ScrollBar.THICKNESS);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var borderColors:Array;
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
var disFillColors:Array;
var disFillAlphas:Array;
super.updateDisplayList(w, h);
var backgroundColor:Number = getStyle("backgroundColor");
var borderColor:uint = getStyle("borderColor");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var upArrow = (name.charAt(0) == "u");
var arrowColor:uint = getStyle("iconColor");
var derStyles:Object = calcDerivedStyles(themeColor, borderColor, fillColors[0], fillColors[1]);
var horizontal:Boolean = ((((parent) && (parent.parent))) && (!((parent.parent.rotation == 0))));
if (((upArrow) && (!(horizontal)))){
borderColors = [borderColor, derStyles.borderColorDrk1];
} else {
borderColors = [derStyles.borderColorDrk1, derStyles.borderColorDrk2];
};
var g:Graphics = graphics;
g.clear();
if (isNaN(backgroundColor)){
backgroundColor = 0xFFFFFF;
};
if ((((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)) || ((name.indexOf("Disabled") == -1)))){
drawRoundRect(0, 0, w, h, 0, backgroundColor, 1);
};
switch (name){
case "upArrowUpSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowUpSkin":
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
drawRoundRect(0, 0, w, h, 0, borderColors, 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, upFillColors, upFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowOverSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowOverSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 1);
drawRoundRect(0, 0, w, h, 0, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, overFillColors, overFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowDownSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(1, (h - 4), (w - 2), 8) : verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowDownSkin":
drawRoundRect(0, 0, w, h, 0, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowDisabledSkin":
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [0.5, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
};
case "downArrowDisabledSkin":
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
disFillColors = [fillColors[0], fillColors[1]];
disFillAlphas = [(fillAlphas[0] - 0.15), (fillAlphas[1] - 0.15)];
drawRoundRect(0, 0, w, h, 0, borderColors, 0.5, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, disFillColors, disFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
arrowColor = getStyle("disabledIconColor");
} else {
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
return;
};
break;
default:
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
return;
};
g.beginFill(arrowColor);
if (upArrow){
g.moveTo((w / 2), 6);
g.lineTo((w - 5), (h - 6));
g.lineTo(5, (h - 6));
g.lineTo((w / 2), 6);
} else {
g.moveTo((w / 2), (h - 6));
g.lineTo((w - 5), 6);
g.lineTo(5, 6);
g.lineTo((w / 2), (h - 6));
};
g.endFill();
}
private static function calcDerivedStyles(themeColor:uint, borderColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, borderColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
o.borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -25);
o.borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -50);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 285
//ScrollThumbSkin (mx.skins.halo.ScrollThumbSkin)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.utils.*;
import mx.skins.*;
public class ScrollThumbSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ScrollThumbSkin(){
super();
}
override public function get measuredWidth():Number{
return (16);
}
override public function get measuredHeight():Number{
return (10);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
super.updateDisplayList(w, h);
var backgroundColor:Number = getStyle("backgroundColor");
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var gripColor:uint = 7305079;
var derStyles:Object = calcDerivedStyles(themeColor, borderColor, fillColors[0], fillColors[1]);
var radius:Number = Math.max((cornerRadius - 1), 0);
var cr:Object = {tl:0, tr:radius, bl:0, br:radius};
radius = Math.max((radius - 1), 0);
var cr1:Object = {tl:0, tr:radius, bl:0, br:radius};
var horizontal:Boolean = ((((parent) && (parent.parent))) && (!((parent.parent.rotation == 0))));
if (isNaN(backgroundColor)){
backgroundColor = 0xFFFFFF;
};
graphics.clear();
drawRoundRect(1, 0, (w - 3), h, cr, backgroundColor, 1);
switch (name){
case "thumbUpSkin":
default:
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cornerRadius, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [borderColor, derStyles.borderColorDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, upFillColors, upFillAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, (w - 2), (h - 2)) : verticalGradientMatrix(1, 0, (w - 2), (h - 2)));
if (horizontal){
drawRoundRect(1, 0, ((w - 4) / 2), (h - 2), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, horizontalGradientMatrix(1, 1, (w - 4), ((h - 2) / 2)));
} else {
drawRoundRect(1, 1, (w - 4), ((h - 2) / 2), cr1, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, ((w - 4) / 2), (h - 2)) : verticalGradientMatrix(1, 1, (w - 4), ((h - 2) / 2)));
};
break;
case "thumbOverSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cornerRadius, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, overFillColors, overFillAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(1, 0, w, h));
break;
case "thumbDownSkin":
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cr, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [themeColor, derStyles.themeColDrk2], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(1, 0, w, h));
break;
case "thumbDisabledSkin":
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
drawRoundRect(1, 0, (w - 3), h, cr, 0x999999, 0.5);
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, 0xFFFFFF, 0.5);
break;
};
var gripW:Number = Math.floor(((w / 2) - 4));
drawRoundRect(gripW, Math.floor(((h / 2) - 4)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) - 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor((h / 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) + 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) + 4)), 5, 1, 0, 0, 0.4);
}
private static function calcDerivedStyles(themeColor:uint, borderColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, borderColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
o.borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -50);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 286
//ScrollTrackSkin (mx.skins.halo.ScrollTrackSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.utils.*;
import mx.skins.*;
public class ScrollTrackSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollTrackSkin(){
super();
}
override public function get measuredWidth():Number{
return (16);
}
override public function get measuredHeight():Number{
return (1);
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var fillColors:Array = getStyle("trackColors");
StyleManager.getColorNames(fillColors);
var borderColor:uint = ColorUtil.adjustBrightness2(getStyle("borderColor"), -20);
var borderColorDrk1:uint = ColorUtil.adjustBrightness2(borderColor, -30);
graphics.clear();
var fillAlpha:Number = 1;
if ((((name == "trackDisabledSkin")) && ((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)))){
fillAlpha = 0.2;
};
drawRoundRect(0, 0, w, h, 0, [borderColor, borderColorDrk1], fillAlpha, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, fillColors, fillAlpha, horizontalGradientMatrix(1, 1, ((w / 3) * 2), (h - 2)));
}
}
}//package mx.skins.halo
Section 287
//TitleBackground (mx.skins.halo.TitleBackground)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.utils.*;
import mx.skins.*;
public class TitleBackground extends ProgrammaticSkin {
mx_internal static const VERSION:String = "3.2.0.3958";
public function TitleBackground(){
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var borderAlpha:Number = getStyle("borderAlpha");
var cornerRadius:Number = getStyle("cornerRadius");
var highlightAlphas:Array = getStyle("highlightAlphas");
var headerColors:Array = getStyle("headerColors");
var showChrome = !((headerColors == null));
StyleManager.getColorNames(headerColors);
var colorDark:Number = ColorUtil.adjustBrightness2((headerColors) ? headerColors[1] : 0xFFFFFF, -20);
var g:Graphics = graphics;
g.clear();
if (h < 3){
return;
};
if (showChrome){
g.lineStyle(0, colorDark, borderAlpha);
g.moveTo(0, h);
g.lineTo(w, h);
g.lineStyle(0, 0, 0);
drawRoundRect(0, 0, w, h, {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, headerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(0, 0, w, (h / 2), {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, (h / 2)));
drawRoundRect(0, 0, w, h, {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, 0xFFFFFF, highlightAlphas[0], null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:cornerRadius, tr:cornerRadius, bl:0, br:0}});
};
}
}
}//package mx.skins.halo
Section 288
//ToolTipBorder (mx.skins.halo.ToolTipBorder)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.graphics.*;
import mx.skins.*;
import flash.filters.*;
public class ToolTipBorder extends RectangularBorder {
private var _borderMetrics:EdgeMetrics;
private var dropShadow:RectangularDropShadow;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ToolTipBorder(){
super();
}
override public function get borderMetrics():EdgeMetrics{
if (_borderMetrics){
return (_borderMetrics);
};
var borderStyle:String = getStyle("borderStyle");
switch (borderStyle){
case "errorTipRight":
_borderMetrics = new EdgeMetrics(15, 1, 3, 3);
break;
case "errorTipAbove":
_borderMetrics = new EdgeMetrics(3, 1, 3, 15);
break;
case "errorTipBelow":
_borderMetrics = new EdgeMetrics(3, 13, 3, 3);
break;
default:
_borderMetrics = new EdgeMetrics(3, 1, 3, 3);
break;
};
return (_borderMetrics);
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var borderStyle:String = getStyle("borderStyle");
var backgroundColor:uint = getStyle("backgroundColor");
var backgroundAlpha:Number = getStyle("backgroundAlpha");
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var shadowColor:uint = getStyle("shadowColor");
var shadowAlpha:Number = 0.1;
var g:Graphics = graphics;
g.clear();
filters = [];
switch (borderStyle){
case "toolTip":
drawRoundRect(3, 1, (w - 6), (h - 4), cornerRadius, backgroundColor, backgroundAlpha);
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = 3;
dropShadow.angle = 90;
dropShadow.color = 0;
dropShadow.alpha = 0.4;
dropShadow.tlRadius = (cornerRadius + 2);
dropShadow.trRadius = (cornerRadius + 2);
dropShadow.blRadius = (cornerRadius + 2);
dropShadow.brRadius = (cornerRadius + 2);
dropShadow.drawShadow(graphics, 3, 0, (w - 6), (h - 4));
break;
case "errorTipRight":
drawRoundRect(11, 0, (w - 11), (h - 2), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(11, 7);
g.lineTo(0, 13);
g.lineTo(11, 19);
g.moveTo(11, 7);
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
case "errorTipAbove":
drawRoundRect(0, 0, w, (h - 13), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(9, (h - 13));
g.lineTo(15, (h - 2));
g.lineTo(21, (h - 13));
g.moveTo(9, (h - 13));
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
case "errorTipBelow":
drawRoundRect(0, 11, w, (h - 13), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(9, 11);
g.lineTo(15, 0);
g.lineTo(21, 11);
g.moveTo(10, 11);
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
};
}
override public function styleChanged(styleProp:String):void{
if ((((((styleProp == "borderStyle")) || ((styleProp == "styleName")))) || ((styleProp == null)))){
_borderMetrics = null;
};
invalidateDisplayList();
}
}
}//package mx.skins.halo
Section 289
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.2.0.3958";
public function Border(){
super();
}
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 290
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import mx.managers.*;
import mx.styles.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
super();
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(styleProp:String){
return ((_styleName) ? _styleName.getStyle(styleProp) : null);
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(value:int):void{
_nestLevel = value;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 90));
}
public function validateSize(recursive:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 0));
}
override public function set height(value:Number):void{
_height = value;
invalidateDisplayList();
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(value:Number):void{
_width = value;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object=null, color:Object=null, alpha:Object=null, gradientMatrix:Matrix=null, gradientType:String="linear", gradientRatios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var holeR:Object;
var g:Graphics = graphics;
if ((((width == 0)) || ((height == 0)))){
return;
};
if (color !== null){
if ((color is uint)){
g.beginFill(uint(color), Number(alpha));
} else {
if ((color is Array)){
alphas = ((alpha is Array)) ? (alpha as Array) : [alpha, alpha];
if (!gradientRatios){
gradientRatios = [0, 0xFF];
};
g.beginGradientFill(gradientType, (color as Array), alphas, gradientRatios, gradientMatrix);
};
};
};
if (!cornerRadius){
g.drawRect(x, y, width, height);
} else {
if ((cornerRadius is Number)){
ellipseSize = (Number(cornerRadius) * 2);
g.drawRoundRect(x, y, width, height, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, width, height, cornerRadius.tl, cornerRadius.tr, cornerRadius.bl, cornerRadius.br);
};
};
if (hole){
holeR = hole.r;
if ((holeR is Number)){
ellipseSize = (Number(holeR) * 2);
g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br);
};
};
if (color !== null){
g.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(value:Object):void{
if (_styleName != value){
_styleName = (value as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
var changed:Boolean;
if (_width != newWidth){
_width = newWidth;
changed = true;
};
if (_height != newHeight){
_height = newHeight;
changed = true;
};
if (changed){
invalidateDisplayList();
};
}
public function styleChanged(styleProp:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix{
tempMatrix.createGradientBox(width, height, ((rotation * Math.PI) / 180), x, y);
return (tempMatrix);
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 291
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.resources.*;
import mx.styles.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var sW:Number;
var sH:Number;
var sX:Number;
var sY:Number;
var scale:Number;
var g:Graphics;
var p:DisplayObject = parent;
var bm:EdgeMetrics = ((p is IContainer)) ? IContainer(p).viewMetrics : borderMetrics;
var scrollableBk = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
sW = _backgroundImageBounds.width;
sH = _backgroundImageBounds.height;
} else {
sW = ((width - bm.left) - bm.right);
sH = ((height - bm.top) - bm.bottom);
};
var percentage:Number = getBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * sW) / backgroundImageWidth);
sY = ((scale * sH) / backgroundImageHeight);
};
backgroundImage.scaleX = sX;
backgroundImage.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (sW - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (sH - (backgroundImageHeight * sY))));
backgroundImage.x = bm.left;
backgroundImage.y = bm.top;
var backgroundMask:Shape = Shape(backgroundImage.mask);
backgroundMask.x = bm.left;
backgroundMask.y = bm.top;
if (((scrollableBk) && ((p is IContainer)))){
offsetX = (offsetX - IContainer(p).horizontalScrollPosition);
offsetY = (offsetY - IContainer(p).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + offsetX);
backgroundImage.y = (backgroundImage.y + offsetY);
var maskWidth:Number = ((width - bm.left) - bm.right);
var maskHeight:Number = ((height - bm.top) - bm.bottom);
if (((!((backgroundMask.width == maskWidth))) || (!((backgroundMask.height == maskHeight))))){
g = backgroundMask.graphics;
g.clear();
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, maskWidth, maskHeight);
g.endFill();
};
}
public function set backgroundImageBounds(value:Rectangle):void{
_backgroundImageBounds = value;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
var backgroundSize:Object = getStyle("backgroundSize");
if (((backgroundSize) && ((backgroundSize is String)))){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function removedHandler(event:Event):void{
var childrenList:IChildList;
if (backgroundImage){
childrenList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
childrenList.removeChild(backgroundImage.mask);
childrenList.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(image:DisplayObject):void{
backgroundImage = image;
if ((image is Loader)){
backgroundImageWidth = Loader(image).contentLoaderInfo.width;
backgroundImageHeight = Loader(image).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((image is ISimpleStyleClient)){
ISimpleStyleClient(image).styleName = styleName;
};
};
var childrenList:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var backgroundMask:Shape = new FlexShape();
backgroundMask.name = "backgroundMask";
backgroundMask.x = 0;
backgroundMask.y = 0;
childrenList.addChild(backgroundMask);
var myIndex:int = childrenList.getChildIndex(this);
childrenList.addChildAt(backgroundImage, (myIndex + 1));
backgroundImage.mask = backgroundMask;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(event:Event):void{
if (!parent){
return;
};
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
layoutBackgroundImage();
dispatchEvent(event.clone());
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = unscaledWidth;
var unscaledHeight = unscaledHeight;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
cls = Class(getDefinitionByName(String(newStyle)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(event:Event):void{
}
}
}//package mx.skins
Section 292
//IOverride (mx.states.IOverride)
package mx.states {
import mx.core.*;
public interface IOverride {
function initialize():void;
function remove(:UIComponent):void;
function apply(:UIComponent):void;
}
}//package mx.states
Section 293
//State (mx.states.State)
package mx.states {
import flash.events.*;
import mx.events.*;
public class State extends EventDispatcher {
public var basedOn:String;
private var initialized:Boolean;// = false
public var overrides:Array;
public var name:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function State(){
overrides = [];
super();
}
mx_internal function initialize():void{
var i:int;
if (!initialized){
initialized = true;
i = 0;
while (i < overrides.length) {
IOverride(overrides[i]).initialize();
i++;
};
};
}
mx_internal function dispatchExitState():void{
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
}
mx_internal function dispatchEnterState():void{
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
}
}
}//package mx.states
Section 294
//Transition (mx.states.Transition)
package mx.states {
import mx.effects.*;
public class Transition {
public var effect:IEffect;
public var toState:String;// = "*"
public var fromState:String;// = "*"
mx_internal static const VERSION:String = "3.2.0.3958";
public function Transition(){
super();
}
}
}//package mx.states
Section 295
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.display.*;
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import flash.utils.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(selector:String=null){
clones = new Dictionary(true);
super();
if (selector){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(selector, this, false);
};
}
mx_internal function addStyleToProtoChain(chain:Object, target:DisplayObject, filterMap:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = chain;
var target = target;
var filterMap = filterMap;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(styleProp:String){
var o:*;
var v:*;
if (overrides){
if ((((styleProp in overrides)) && ((overrides[styleProp] === undefined)))){
return (undefined);
};
v = overrides[styleProp];
if (v !== undefined){
return (v);
};
};
if (factory != null){
factory.prototype = {};
o = new factory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
o = new defaultFactory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
return (undefined);
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function setStyle(styleProp:String, newValue):void{
var i:int;
var sm:Object;
var oldValue:Object = getStyle(styleProp);
var regenerate:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((oldValue === newValue))))){
regenerate = true;
};
if (newValue !== undefined){
setStyle(styleProp, newValue);
} else {
if (newValue == oldValue){
return;
};
setStyle(styleProp, newValue);
};
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
if (regenerate){
i = 0;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
i++;
};
};
i = 0;
while (i < n) {
sm = sms[i];
sm.notifyStyleChangeInChildren(styleProp, true);
i++;
};
}
private function clearStyleAttr(styleProp:String):void{
var clone:*;
if (!overrides){
overrides = {};
};
overrides[styleProp] = undefined;
for (clone in clones) {
delete clone[styleProp];
};
}
mx_internal function createProtoChainRoot():Object{
var root:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = root;
root = new defaultFactory();
};
if (factory != null){
factory.prototype = root;
root = new factory();
};
clones[root] = 1;
return (root);
}
mx_internal function clearOverride(styleProp:String):void{
if (((overrides) && (overrides[styleProp]))){
delete overrides[styleProp];
};
}
mx_internal function setStyle(styleProp:String, value):void{
var o:Object;
var clone:*;
var colorNumber:Number;
var cloneFilter:Object;
if (value === undefined){
clearStyleAttr(styleProp);
return;
};
if ((value is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
colorNumber = styleManager.getColorName(value);
if (colorNumber != NOT_A_COLOR){
value = colorNumber;
};
};
if (defaultFactory != null){
o = new defaultFactory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if (factory != null){
o = new factory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
};
for (clone in clones) {
cloneFilter = clone[FILTERMAP_PROP];
if (cloneFilter){
if (cloneFilter[styleProp] != null){
clone[cloneFilter[styleProp]] = value;
};
} else {
clone[styleProp] = value;
};
};
}
}
}//package mx.styles
Section 296
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void;
function styleChanged(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 297
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Boolean):void;
function get className():String;
function clearStyle(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function getStyle(*:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Array):void;
}
}//package mx.styles
Section 298
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(value:String):Boolean;
function registerParentDisplayListInvalidatingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerInheritingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function set stylesRoot(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(value:String):Boolean;
function isSizeInvalidatingStyle(value:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(value):Boolean;
function isParentSizeInvalidatingStyle(value:String):Boolean;
function getColorName(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/set:Object):uint;
function set typeSelectorCache(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(value:String):Boolean;
function set inheritingStyles(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerSizeInvalidatingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(value:String):Boolean;
function getStyleDeclaration(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/get:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 299
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 300
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 301
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import mx.core.*;
import flash.events.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public function StyleManager(){
super();
}
public static function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(styleName));
}
public static function registerInheritingStyle(styleName:String):void{
impl.registerInheritingStyle(styleName);
}
mx_internal static function set stylesRoot(value:Object):void{
impl.stylesRoot = value;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
impl.setStyleDeclaration(selector, styleDeclaration, update);
}
public static function registerParentDisplayListInvalidatingStyle(styleName:String):void{
impl.registerParentDisplayListInvalidatingStyle(styleName);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(value:Object):void{
impl.inheritingStyles = value;
}
public static function isColorName(colorName:String):Boolean{
return (impl.isColorName(colorName));
}
public static function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(styleName));
}
public static function isSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isSizeInvalidatingStyle(styleName));
}
public static function getColorName(colorName:Object):uint{
return (impl.getColorName(colorName));
}
mx_internal static function set typeSelectorCache(value:Object):void{
impl.typeSelectorCache = value;
}
public static function unloadStyleDeclarations(url:String, update:Boolean=true):void{
impl.unloadStyleDeclarations(url, update);
}
public static function getColorNames(colors:Array):void{
impl.getColorNames(colors);
}
public static function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(url, update, applicationDomain, securityDomain));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(value):Boolean{
return (impl.isValidStyleValue(value));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(styleName:String):Boolean{
return (impl.isInheritingStyle(styleName));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(styleName:String):void{
impl.registerParentSizeInvalidatingStyle(styleName);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(styleName:String):void{
impl.registerSizeInvalidatingStyle(styleName);
}
public static function clearStyleDeclaration(selector:String, update:Boolean):void{
impl.clearStyleDeclaration(selector, update);
}
public static function registerColorName(colorName:String, colorValue:uint):void{
impl.registerColorName(colorName, colorValue);
}
public static function isInheritingTextFormatStyle(styleName:String):Boolean{
return (impl.isInheritingTextFormatStyle(styleName));
}
public static function getStyleDeclaration(selector:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(selector));
}
}
}//package mx.styles
Section 302
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.resources.*;
import flash.system.*;
import mx.modules.*;
import flash.utils.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
styleDeclaration.selectorRefCount++;
_selectors[selector] = styleDeclaration;
typeSelectorCache = {};
if (update){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(styleName:String):void{
parentDisplayListInvalidatingStyles[styleName] = true;
}
public function getStyleDeclaration(selector:String):CSSStyleDeclaration{
var index:int;
if (selector.charAt(0) != "."){
index = selector.lastIndexOf(".");
if (index != -1){
selector = selector.substr((index + 1));
};
};
return (_selectors[selector]);
}
public function set typeSelectorCache(value:Object):void{
_typeSelectorCache = value;
}
public function isColorName(colorName:String):Boolean{
return (!((colorNames[colorName.toLowerCase()] === undefined)));
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getColorNames(colors:Array):void{
var colorNumber:uint;
if (!colors){
return;
};
var n:int = colors.length;
var i:int;
while (i < n) {
if (((!((colors[i] == null))) && (isNaN(colors[i])))){
colorNumber = getColorName(colors[i]);
if (colorNumber != StyleManager.NOT_A_COLOR){
colors[i] = colorNumber;
};
};
i++;
};
}
public function isInheritingTextFormatStyle(styleName:String):Boolean{
return ((inheritingTextFormatStyles[styleName] == true));
}
public function registerParentSizeInvalidatingStyle(styleName:String):void{
parentSizeInvalidatingStyles[styleName] = true;
}
public function registerColorName(colorName:String, colorValue:uint):void{
colorNames[colorName.toLowerCase()] = colorValue;
}
public function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return ((parentSizeInvalidatingStyles[styleName] == true));
}
public function registerInheritingStyle(styleName:String):void{
inheritingStyles[styleName] = true;
}
public function set stylesRoot(value:Object):void{
_stylesRoot = value;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return ((parentDisplayListInvalidatingStyles[styleName] == true));
}
public function isSizeInvalidatingStyle(styleName:String):Boolean{
return ((sizeInvalidatingStyles[styleName] == true));
}
public function styleDeclarationsChanged():void{
var sm:Object;
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
var i:int;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
sm.notifyStyleChangeInChildren(null, true);
i++;
};
}
public function isValidStyleValue(value):Boolean{
return (!((value === undefined)));
}
public function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(url, update));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(url:String, update:Boolean=true):void{
var module:IModuleInfo;
var styleModuleInfo:StyleModuleInfo = styleModules[url];
if (styleModuleInfo){
styleModuleInfo.styleModule.unload();
module = styleModuleInfo.module;
module.unload();
module.removeEventListener(ModuleEvent.READY, styleModuleInfo.readyHandler);
module.removeEventListener(ModuleEvent.ERROR, styleModuleInfo.errorHandler);
styleModules[url] = null;
};
if (update){
styleDeclarationsChanged();
};
}
public function getColorName(colorName:Object):uint{
var n:Number;
var c:*;
if ((colorName is String)){
if (colorName.charAt(0) == "#"){
n = Number(("0x" + colorName.slice(1)));
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
if ((((colorName.charAt(1) == "x")) && ((colorName.charAt(0) == "0")))){
n = Number(colorName);
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
c = colorNames[colorName.toLowerCase()];
if (c === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(c));
};
return (uint(colorName));
}
public function isInheritingStyle(styleName:String):Boolean{
return ((inheritingStyles[styleName] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(url:String, update:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var update = update;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleModule:IStyleModule = IStyleModule(moduleEvent.module.factory.create());
styleModules[moduleEvent.module.url].styleModule = styleModule;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleEvent:StyleEvent;
var errorText:String = resourceManager.getString("styles", "unableToLoad", [moduleEvent.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
styleEvent = new StyleEvent(StyleEvent.ERROR, moduleEvent.bubbles, moduleEvent.cancelable);
styleEvent.bytesLoaded = 0;
styleEvent.bytesTotal = 0;
styleEvent.errorText = errorText;
styleEventDispatcher.dispatchEvent(styleEvent);
} else {
throw (new Error(errorText));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(styleName:String):void{
sizeInvalidatingStyles[styleName] = true;
}
public function clearStyleDeclaration(selector:String, update:Boolean):void{
var styleDeclaration:CSSStyleDeclaration = getStyleDeclaration(selector);
if (((styleDeclaration) && ((styleDeclaration.selectorRefCount > 0)))){
styleDeclaration.selectorRefCount--;
};
delete _selectors[selector];
if (update){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var i:String;
var theSelectors:Array = [];
for (i in _selectors) {
theSelectors.push(i);
};
return (theSelectors);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.events.*;
import mx.modules.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(styleEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
dispatchEvent(styleEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.ERROR, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
styleEvent.errorText = event.errorText;
dispatchEvent(styleEvent);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(module:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.module = module;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
Section 303
//StyleProtoChain (mx.styles.StyleProtoChain)
package mx.styles {
import flash.display.*;
import mx.core.*;
public class StyleProtoChain {
mx_internal static const VERSION:String = "3.2.0.3958";
public function StyleProtoChain(){
super();
}
public static function initProtoChainForUIComponentStyleName(obj:IStyleClient):void{
var typeSelector:CSSStyleDeclaration;
var styleName:IStyleClient = IStyleClient(obj.styleName);
var target:DisplayObject = (obj as DisplayObject);
var nonInheritChain:Object = styleName.nonInheritingStyles;
if (((!(nonInheritChain)) || ((nonInheritChain == UIComponent.STYLE_UNINITIALIZED)))){
nonInheritChain = StyleManager.stylesRoot;
if (nonInheritChain.effects){
obj.registerEffects(nonInheritChain.effects);
};
};
var inheritChain:Object = styleName.inheritingStyles;
if (((!(inheritChain)) || ((inheritChain == UIComponent.STYLE_UNINITIALIZED)))){
inheritChain = StyleManager.stylesRoot;
};
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
if ((styleName is StyleProxy)){
if (n == 0){
nonInheritChain = addProperties(nonInheritChain, styleName, false);
};
target = (StyleProxy(styleName).source as DisplayObject);
};
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, target);
inheritChain = addProperties(inheritChain, styleName, true);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, target);
nonInheritChain = addProperties(nonInheritChain, styleName, false);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
obj.inheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(inheritChain, target) : inheritChain;
obj.nonInheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(nonInheritChain, target) : nonInheritChain;
}
private static function addProperties(chain:Object, obj:IStyleClient, bInheriting:Boolean):Object{
var typeSelector:CSSStyleDeclaration;
var classSelector:CSSStyleDeclaration;
var filterMap:Object = ((((obj is StyleProxy)) && (!(bInheriting)))) ? StyleProxy(obj).filterMap : null;
var curObj:IStyleClient = obj;
while ((curObj is StyleProxy)) {
curObj = StyleProxy(curObj).source;
};
var target:DisplayObject = (curObj as DisplayObject);
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
chain = typeSelector.addStyleToProtoChain(chain, target, filterMap);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
chain = addProperties(chain, IStyleClient(styleName), bInheriting);
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
if (classSelector){
chain = classSelector.addStyleToProtoChain(chain, target, filterMap);
if (classSelector.effects){
obj.registerEffects(classSelector.effects);
};
};
};
if (obj.styleDeclaration){
chain = obj.styleDeclaration.addStyleToProtoChain(chain, target, filterMap);
};
return (chain);
}
public static function initTextField(obj:IUITextField):void{
var classSelector:CSSStyleDeclaration;
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((styleName is StyleProxy)){
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = addProperties(StyleManager.stylesRoot, IStyleClient(styleName), false);
return;
};
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = IStyleClient(styleName).nonInheritingStyles;
return;
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
var inheritChain:Object = IStyleClient(obj.parent).inheritingStyles;
var nonInheritChain:Object = StyleManager.stylesRoot;
if (!inheritChain){
inheritChain = StyleManager.stylesRoot;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, DisplayObject(obj));
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, DisplayObject(obj));
};
obj.inheritingStyles = inheritChain;
obj.nonInheritingStyles = nonInheritChain;
}
}
}//package mx.styles
Section 304
//StyleProxy (mx.styles.StyleProxy)
package mx.styles {
import mx.core.*;
public class StyleProxy implements IStyleClient {
private var _source:IStyleClient;
private var _filterMap:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function StyleProxy(source:IStyleClient, filterMap:Object){
super();
this.filterMap = filterMap;
this.source = source;
}
public function styleChanged(styleProp:String):void{
return (_source.styleChanged(styleProp));
}
public function get filterMap():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? null : _filterMap);
}
public function set filterMap(value:Object):void{
_filterMap = value;
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_source.styleDeclaration);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
return (_source.notifyStyleChangeInChildren(styleProp, recursive));
}
public function set inheritingStyles(value:Object):void{
}
public function get source():IStyleClient{
return (_source);
}
public function get styleName():Object{
if ((_source.styleName is IStyleClient)){
return (new StyleProxy(IStyleClient(_source.styleName), filterMap));
};
return (_source.styleName);
}
public function registerEffects(effects:Array):void{
return (_source.registerEffects(effects));
}
public function regenerateStyleCache(recursive:Boolean):void{
_source.regenerateStyleCache(recursive);
}
public function get inheritingStyles():Object{
return (_source.inheritingStyles);
}
public function get className():String{
return (_source.className);
}
public function clearStyle(styleProp:String):void{
_source.clearStyle(styleProp);
}
public function getClassStyleDeclarations():Array{
return (_source.getClassStyleDeclarations());
}
public function set nonInheritingStyles(value:Object):void{
}
public function setStyle(styleProp:String, newValue):void{
_source.setStyle(styleProp, newValue);
}
public function get nonInheritingStyles():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? _source.nonInheritingStyles : null);
}
public function set styleName(value:Object):void{
_source.styleName = value;
}
public function getStyle(styleProp:String){
return (_source.getStyle(styleProp));
}
public function set source(value:IStyleClient):void{
_source = value;
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_source.styleDeclaration = styleDeclaration;
}
}
}//package mx.styles
Section 305
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
public class ColorUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ColorUtil(){
super();
}
public static function adjustBrightness2(rgb:uint, brite:Number):uint{
var r:Number;
var g:Number;
var b:Number;
if (brite == 0){
return (rgb);
};
if (brite < 0){
brite = ((100 + brite) / 100);
r = (((rgb >> 16) & 0xFF) * brite);
g = (((rgb >> 8) & 0xFF) * brite);
b = ((rgb & 0xFF) * brite);
} else {
brite = (brite / 100);
r = ((rgb >> 16) & 0xFF);
g = ((rgb >> 8) & 0xFF);
b = (rgb & 0xFF);
r = (r + ((0xFF - r) * brite));
g = (g + ((0xFF - g) * brite));
b = (b + ((0xFF - b) * brite));
r = Math.min(r, 0xFF);
g = Math.min(g, 0xFF);
b = Math.min(b, 0xFF);
};
return ((((r << 16) | (g << 8)) | b));
}
public static function rgbMultiply(rgb1:uint, rgb2:uint):uint{
var r1:Number = ((rgb1 >> 16) & 0xFF);
var g1:Number = ((rgb1 >> 8) & 0xFF);
var b1:Number = (rgb1 & 0xFF);
var r2:Number = ((rgb2 >> 16) & 0xFF);
var g2:Number = ((rgb2 >> 8) & 0xFF);
var b2:Number = (rgb2 & 0xFF);
return ((((((r1 * r2) / 0xFF) << 16) | (((g1 * g2) / 0xFF) << 8)) | ((b1 * b2) / 0xFF)));
}
public static function adjustBrightness(rgb:uint, brite:Number):uint{
var r:Number = Math.max(Math.min((((rgb >> 16) & 0xFF) + brite), 0xFF), 0);
var g:Number = Math.max(Math.min((((rgb >> 8) & 0xFF) + brite), 0xFF), 0);
var b:Number = Math.max(Math.min(((rgb & 0xFF) + brite), 0xFF), 0);
return ((((r << 16) | (g << 8)) | b));
}
}
}//package mx.utils
Section 306
//EventUtil (mx.utils.EventUtil)
package mx.utils {
import mx.core.*;
import flash.events.*;
import mx.events.*;
public class EventUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _sandboxEventMap:Object;
private static var _mouseEventMap:Object;
public function EventUtil(){
super();
}
public static function get sandboxMouseEventMap():Object{
if (!_sandboxEventMap){
_sandboxEventMap = {};
_sandboxEventMap[SandboxMouseEvent.CLICK_SOMEWHERE] = MouseEvent.CLICK;
_sandboxEventMap[SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE] = MouseEvent.DOUBLE_CLICK;
_sandboxEventMap[SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE] = MouseEvent.MOUSE_DOWN;
_sandboxEventMap[SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE] = MouseEvent.MOUSE_MOVE;
_sandboxEventMap[SandboxMouseEvent.MOUSE_UP_SOMEWHERE] = MouseEvent.MOUSE_UP;
_sandboxEventMap[SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE] = MouseEvent.MOUSE_WHEEL;
};
return (_sandboxEventMap);
}
public static function get mouseEventMap():Object{
if (!_mouseEventMap){
_mouseEventMap = {};
_mouseEventMap[MouseEvent.CLICK] = SandboxMouseEvent.CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.DOUBLE_CLICK] = SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_DOWN] = SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_MOVE] = SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_UP] = SandboxMouseEvent.MOUSE_UP_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_WHEEL] = SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE;
};
return (_mouseEventMap);
}
}
}//package mx.utils
Section 307
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public function GraphicsUtil(){
super();
}
public static function drawRoundRectComplex(graphics:Graphics, x:Number, y:Number, width:Number, height:Number, topLeftRadius:Number, topRightRadius:Number, bottomLeftRadius:Number, bottomRightRadius:Number):void{
var xw:Number = (x + width);
var yh:Number = (y + height);
var minSize:Number = ((width < height)) ? (width * 2) : (height * 2);
topLeftRadius = ((topLeftRadius < minSize)) ? topLeftRadius : minSize;
topRightRadius = ((topRightRadius < minSize)) ? topRightRadius : minSize;
bottomLeftRadius = ((bottomLeftRadius < minSize)) ? bottomLeftRadius : minSize;
bottomRightRadius = ((bottomRightRadius < minSize)) ? bottomRightRadius : minSize;
var a:Number = (bottomRightRadius * 0.292893218813453);
var s:Number = (bottomRightRadius * 0.585786437626905);
graphics.moveTo(xw, (yh - bottomRightRadius));
graphics.curveTo(xw, (yh - s), (xw - a), (yh - a));
graphics.curveTo((xw - s), yh, (xw - bottomRightRadius), yh);
a = (bottomLeftRadius * 0.292893218813453);
s = (bottomLeftRadius * 0.585786437626905);
graphics.lineTo((x + bottomLeftRadius), yh);
graphics.curveTo((x + s), yh, (x + a), (yh - a));
graphics.curveTo(x, (yh - s), x, (yh - bottomLeftRadius));
a = (topLeftRadius * 0.292893218813453);
s = (topLeftRadius * 0.585786437626905);
graphics.lineTo(x, (y + topLeftRadius));
graphics.curveTo(x, (y + s), (x + a), (y + a));
graphics.curveTo((x + s), y, (x + topLeftRadius), y);
a = (topRightRadius * 0.292893218813453);
s = (topRightRadius * 0.585786437626905);
graphics.lineTo((xw - topRightRadius), y);
graphics.curveTo((xw - s), y, (xw - a), (y + a));
graphics.curveTo(xw, (y + s), xw, (y + topRightRadius));
graphics.lineTo(xw, (yh - bottomRightRadius));
}
}
}//package mx.utils
Section 308
//LoaderUtil (mx.utils.LoaderUtil)
package mx.utils {
import flash.display.*;
public class LoaderUtil {
public function LoaderUtil(){
super();
}
public static function normalizeURL(loaderInfo:LoaderInfo):String{
var url:String = loaderInfo.url;
var results:Array = url.split("/[[DYNAMIC]]/");
return (results[0]);
}
public static function createAbsoluteURL(rootURL:String, url:String):String{
var lastIndex:int;
var parentIndex:int;
var absoluteURL:String = url;
if (!(((((url.indexOf(":") > -1)) || ((url.indexOf("/") == 0)))) || ((url.indexOf("\\") == 0)))){
if (rootURL){
lastIndex = Math.max(rootURL.lastIndexOf("\\"), rootURL.lastIndexOf("/"));
if (lastIndex <= 8){
rootURL = (rootURL + "/");
lastIndex = (rootURL.length - 1);
};
if (url.indexOf("./") == 0){
url = url.substring(2);
} else {
while (url.indexOf("../") == 0) {
url = url.substring(3);
parentIndex = Math.max(rootURL.lastIndexOf("\\", (lastIndex - 1)), rootURL.lastIndexOf("/", (lastIndex - 1)));
if (parentIndex <= 8){
parentIndex = lastIndex;
};
lastIndex = parentIndex;
};
};
if (lastIndex != -1){
absoluteURL = (rootURL.substr(0, (lastIndex + 1)) + url);
};
};
};
return (absoluteURL);
}
}
}//package mx.utils
Section 309
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = displayObject;
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
//unresolved jump
var _slot1 = e;
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 310
//SecurityUtil (mx.utils.SecurityUtil)
package mx.utils {
import mx.core.*;
public class SecurityUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public function SecurityUtil(){
super();
}
public static function hasMutualTrustBetweenParentAndChild(bp:ISWFBridgeProvider):Boolean{
if (((((bp) && (bp.childAllowsParent))) && (bp.parentAllowsChild))){
return (true);
};
return (false);
}
}
}//package mx.utils
Section 311
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public function StringUtil(){
super();
}
public static function trim(str:String):String{
if (str == null){
return ("");
};
var startIndex:int;
while (isWhitespace(str.charAt(startIndex))) {
startIndex++;
};
var endIndex:int = (str.length - 1);
while (isWhitespace(str.charAt(endIndex))) {
endIndex--;
};
if (endIndex >= startIndex){
return (str.slice(startIndex, (endIndex + 1)));
};
return ("");
}
public static function isWhitespace(character:String):Boolean{
switch (character){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(str:String, ... _args):String{
var args:Array;
if (str == null){
return ("");
};
var len:uint = _args.length;
if ((((len == 1)) && ((_args[0] is Array)))){
args = (_args[0] as Array);
len = args.length;
} else {
args = _args;
};
var i:int;
while (i < len) {
str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]);
i++;
};
return (str);
}
public static function trimArrayElements(value:String, delimiter:String):String{
var items:Array;
var len:int;
var i:int;
if (((!((value == ""))) && (!((value == null))))){
items = value.split(delimiter);
len = items.length;
i = 0;
while (i < len) {
items[i] = StringUtil.trim(items[i]);
i++;
};
if (len > 0){
value = items.join(delimiter);
};
};
return (value);
}
}
}//package mx.utils
Section 312
//IValidatorListener (mx.validators.IValidatorListener)
package mx.validators {
import mx.events.*;
public interface IValidatorListener {
function set errorString(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get validationSubField():String;
function validationResultHandler(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:ValidationResultEvent):void;
function set validationSubField(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get errorString():String;
}
}//package mx.validators
Section 313
//ValidationResult (mx.validators.ValidationResult)
package mx.validators {
public class ValidationResult {
public var subField:String;
public var errorCode:String;
public var isError:Boolean;
public var errorMessage:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ValidationResult(isError:Boolean, subField:String="", errorCode:String="", errorMessage:String=""){
super();
this.isError = isError;
this.subField = subField;
this.errorMessage = errorMessage;
this.errorCode = errorCode;
}
}
}//package mx.validators
Section 314
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_activeButtonStyleStyle:IFlexModuleFactory):void{
var fbs = _activeButtonStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 315
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 316
//_advancedDataGridStylesStyle (_advancedDataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _advancedDataGridStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".advancedDataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".advancedDataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 317
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 318
//_AlertStyle (_AlertStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _AlertStyle {
public static function init(backgroundAlpha:IFlexModuleFactory):void{
var fbs = backgroundAlpha;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Alert");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Alert", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.borderColor = 8821927;
this.paddingLeft = 10;
this.color = 0xFFFFFF;
this.roundedBottomCorners = true;
this.paddingRight = 10;
this.backgroundAlpha = 0.9;
this.paddingBottom = 2;
this.borderAlpha = 0.9;
this.buttonStyleName = "alertButtonStyle";
this.backgroundColor = 8821927;
};
};
}
}
}//package
Section 319
//_ApplicationStyle (_ApplicationStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ApplicationStyle {
public static function init(paddingRight:IFlexModuleFactory):void{
var fbs = paddingRight;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Application");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Application", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 24;
this.paddingLeft = 24;
this.backgroundGradientAlphas = [1, 1];
this.horizontalAlign = "center";
this.paddingRight = 24;
this.backgroundImage = ApplicationBackground;
this.paddingBottom = 24;
this.backgroundSize = "100%";
this.backgroundColor = 8821927;
};
};
}
}
}//package
Section 320
//_ButtonStyle (_ButtonStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ButtonStyle {
public static function init(paddingLeft:IFlexModuleFactory):void{
var fbs = paddingLeft;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Button");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Button", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.textAlign = "center";
this.skin = ButtonSkin;
this.paddingLeft = 10;
this.fontWeight = "bold";
this.cornerRadius = 4;
this.paddingRight = 10;
this.verticalGap = 2;
this.horizontalGap = 2;
this.paddingBottom = 2;
};
};
}
}
}//package
Section 321
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(dropShadowEnabled:IFlexModuleFactory):void{
var fbs = dropShadowEnabled;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingLeft = 5;
this.fontWeight = "normal";
this.cornerRadius = 0;
this.paddingRight = 5;
this.dropShadowEnabled = true;
this.shadowDirection = "center";
this.leading = 0;
this.borderThickness = 0;
this.shadowDistance = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 322
//_ContainerStyle (_ContainerStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _ContainerStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Container");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Container", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "none";
};
};
}
}
}//package
Section 323
//_CursorManagerStyle (_CursorManagerStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _CursorManagerStyle {
private static var _embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188:Class = _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188;
public static function init(mx.skins.halo:IFlexModuleFactory):void{
var fbs = mx.skins.halo;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("CursorManager", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.busyCursor = BusyCursor;
this.busyCursorBackground = _embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188;
};
};
}
}
}//package
Section 324
//_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188 (_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188)
package {
import mx.core.*;
public class _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188 extends SpriteAsset {
}
}//package
Section 325
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 326
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_dateFieldPopupStyle.as$21:IFlexModuleFactory):void{
var fbs = _dateFieldPopupStyle.as$21;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.borderThickness = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 327
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(fontWeight:IFlexModuleFactory):void{
var fbs = fontWeight;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 4;
this.borderColor = 13510953;
this.paddingLeft = 4;
this.color = 0xFFFFFF;
this.fontWeight = "bold";
this.paddingRight = 4;
this.shadowColor = 0;
this.fontSize = 9;
this.paddingBottom = 4;
this.borderStyle = "errorTipRight";
};
};
}
}
}//package
Section 328
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(borderAlpha:IFlexModuleFactory):void{
var fbs = borderAlpha;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.modalTransparencyBlur = 3;
this.verticalGridLineColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.textAlign = "left";
this.disabledIconColor = 0x999999;
this.stroked = false;
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.fontStyle = "normal";
this.borderSides = "left top right bottom";
this.borderThickness = 1;
this.modalTransparencyDuration = 100;
this.useRollOver = true;
this.strokeWidth = 1;
this.filled = true;
this.borderColor = 12040892;
this.horizontalGridLines = false;
this.horizontalGridLineColor = 0xF7F7F7;
this.shadowCapColor = 14015965;
this.fontGridFitType = "pixel";
this.horizontalAlign = "left";
this.modalTransparencyColor = 0xDDDDDD;
this.disabledColor = 11187123;
this.borderSkin = HaloBorder;
this.dropShadowColor = 0;
this.paddingBottom = 0;
this.indentation = 17;
this.version = "3.0.0";
this.fontThickness = 0;
this.verticalGridLines = true;
this.embedFonts = false;
this.fontSharpness = 0;
this.shadowDirection = "center";
this.textDecoration = "none";
this.selectionDuration = 250;
this.bevel = true;
this.fillColor = 0xFFFFFF;
this.focusBlendMode = "normal";
this.dropShadowEnabled = false;
this.textRollOverColor = 2831164;
this.textIndent = 0;
this.fontSize = 10;
this.openDuration = 250;
this.closeDuration = 250;
this.kerning = false;
this.paddingTop = 0;
this.highlightAlphas = [0.3, 0];
this.cornerRadius = 0;
this.horizontalGap = 8;
this.textSelectedColor = 2831164;
this.paddingLeft = 0;
this.modalTransparency = 0.5;
this.roundedBottomCorners = true;
this.repeatDelay = 500;
this.selectionDisabledColor = 0xDDDDDD;
this.fontAntiAliasType = "advanced";
this.focusSkin = HaloFocusRect;
this.verticalGap = 6;
this.leading = 2;
this.shadowColor = 0xEEEEEE;
this.backgroundAlpha = 1;
this.iconColor = 0x111111;
this.focusAlpha = 0.4;
this.borderAlpha = 1;
this.focusThickness = 2;
this.themeColor = 40447;
this.backgroundSize = "auto";
this.indicatorGap = 14;
this.letterSpacing = 0;
this.fontFamily = "Verdana";
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.color = 734012;
this.paddingRight = 0;
this.errorColor = 0xFF0000;
this.verticalAlign = "top";
this.focusRoundedCorners = "tl tr bl br";
this.shadowDistance = 2;
this.repeatInterval = 35;
};
};
}
}
}//package
Section 329
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 330
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 331
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(http://adobe.com/AS3/2006/builtin:IFlexModuleFactory):void{
var fbs = http://adobe.com/AS3/2006/builtin;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingRight = 2;
this.paddingBottom = 2;
};
};
}
}
}//package
Section 332
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(Object:IFlexModuleFactory):void{
var fbs = Object;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.borderAlpha = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 333
//_PanelStyle (_PanelStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _PanelStyle {
public static function init(windowStyles:IFlexModuleFactory):void{
var effects:Array;
var fbs = windowStyles;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Panel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Panel", style, false);
effects = style.mx_internal::effects;
if (!effects){
effects = (style.mx_internal::effects = new Array());
};
effects.push("resizeEndEffect");
effects.push("resizeStartEffect");
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xE2E2E2;
this.paddingLeft = 0;
this.roundedBottomCorners = false;
this.dropShadowEnabled = true;
this.resizeStartEffect = "Dissolve";
this.borderSkin = PanelSkin;
this.statusStyleName = "windowStatus";
this.borderAlpha = 0.4;
this.borderStyle = "default";
this.paddingBottom = 0;
this.resizeEndEffect = "Dissolve";
this.paddingTop = 0;
this.borderThicknessRight = 10;
this.titleStyleName = "windowStyles";
this.cornerRadius = 4;
this.paddingRight = 0;
this.borderThicknessLeft = 10;
this.titleBackgroundSkin = TitleBackground;
this.borderThickness = 0;
this.borderThicknessTop = 2;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 334
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(left:IFlexModuleFactory):void{
var fbs = left;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.paddingLeft = 0;
this.horizontalAlign = "left";
this.paddingRight = 0;
this.backgroundImage = "";
this.paddingBottom = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 335
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(left:IFlexModuleFactory):void{
var fbs = left;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "left";
this.fontWeight = "normal";
};
};
}
}
}//package
Section 336
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_richTextEditorTextAreaStyleStyle:IFlexModuleFactory):void{
var fbs = _richTextEditorTextAreaStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 337
//_ScrollBarStyle (_ScrollBarStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ScrollBarStyle {
public static function init(ScrollTrackSkin:IFlexModuleFactory):void{
var fbs = ScrollTrackSkin;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ScrollBar");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("ScrollBar", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.trackColors = [9738651, 0xE7E7E7];
this.thumbOffset = 0;
this.paddingTop = 0;
this.downArrowSkin = ScrollArrowSkin;
this.borderColor = 12040892;
this.paddingLeft = 0;
this.cornerRadius = 4;
this.paddingRight = 0;
this.trackSkin = ScrollTrackSkin;
this.thumbSkin = ScrollThumbSkin;
this.paddingBottom = 0;
this.upArrowSkin = ScrollArrowSkin;
};
};
}
}
}//package
Section 338
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(shadowColor:IFlexModuleFactory):void{
var fbs = shadowColor;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.highlightColor = 12897484;
this.borderColor = 14015965;
this.paddingLeft = 5;
this.shadowCapColor = 14015965;
this.paddingRight = 5;
this.shadowColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.backgroundColor = 0xFFFFFF;
this.borderCapColor = 9542041;
};
};
}
}
}//package
Section 339
//_SVI_FlexInit (_SVI_FlexInit)
package {
import mx.core.*;
import mx.styles.*;
import mx.effects.*;
import flash.utils.*;
import flash.system.*;
public class _SVI_FlexInit {
public static function init(added:IFlexModuleFactory):void{
var _local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("addedEffect", "added");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("creationCompleteEffect", "creationComplete");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("focusInEffect", "focusIn");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("focusOutEffect", "focusOut");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("hideEffect", "hide");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("mouseDownEffect", "mouseDown");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("mouseUpEffect", "mouseUp");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("moveEffect", "move");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("removedEffect", "removed");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("resizeEffect", "resize");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("rollOutEffect", "rollOut");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("rollOverEffect", "rollOver");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("showEffect", "show");
var _local2:Array = ["fontWeight", "modalTransparencyBlur", "textRollOverColor", "backgroundDisabledColor", "textIndent", "barColor", "fontSize", "kerning", "textAlign", "fontStyle", "modalTransparencyDuration", "textSelectedColor", "modalTransparency", "fontGridFitType", "disabledColor", "fontAntiAliasType", "modalTransparencyColor", "leading", "dropShadowColor", "themeColor", "letterSpacing", "fontFamily", "color", "fontThickness", "errorColor", "fontSharpness", "textDecoration"];
var _local3:int;
while (_local3 < _local2.length) {
StyleManager.registerInheritingStyle(_local2[_local3]);
_local3++;
};
}
}
}//package
Section 340
//_SVI_mx_managers_SystemManager (_SVI_mx_managers_SystemManager)
package {
import mx.core.*;
import mx.managers.*;
import flash.system.*;
public class _SVI_mx_managers_SystemManager extends SystemManager implements IFlexModuleFactory {
override public function create(... _args):Object{
if ((((_args.length > 0)) && (!((_args[0] is String))))){
return (super.create.apply(this, _args));
};
var _local2:String = ((_args.length == 0)) ? "SVI" : String(_args[0]);
var _local3:Class = Class(getDefinitionByName(_local2));
if (!_local3){
return (null);
};
var _local4:Object = new (_local3);
if ((_local4 is IFlexModule)){
IFlexModule(_local4).moduleFactory = this;
};
if (_args.length == 0){
EmbeddedFontRegistry.registerFonts(info()["fonts"], this);
};
return (_local4);
}
override public function info():Object{
return ({applicationComplete:"complete()", backgroundGradientAlphas:"[1.0, 1.0]", backgroundGradientColors:"[#000000, #000000]", borderColor:"#000000", color:"#000000", compiledLocales:["en_US"], compiledResourceBundleNames:["containers", "core", "effects", "skins", "styles"], currentDomain:ApplicationDomain.currentDomain, fonts:{Bimini:{regular:true, bold:false, italic:false, boldItalic:false}, DS Note:{regular:true, bold:false, italic:false, boldItalic:false}}, height:"480", initialize:"Init()", layout:"absolute", mainClassName:"SVI", mixins:["_SVI_FlexInit", "_alertButtonStyleStyle", "_ScrollBarStyle", "_activeTabStyleStyle", "_textAreaHScrollBarStyleStyle", "_ToolTipStyle", "_advancedDataGridStylesStyle", "_comboDropdownStyle", "_ContainerStyle", "_textAreaVScrollBarStyleStyle", "_linkButtonStyleStyle", "_globalStyle", "_windowStatusStyle", "_windowStylesStyle", "_PanelStyle", "_activeButtonStyleStyle", "_errorTipStyle", "_richTextEditorTextAreaStyleStyle", "_CursorManagerStyle", "_todayStyleStyle", "_dateFieldPopupStyle", "_plainStyle", "_dataGridStylesStyle", "_ApplicationStyle", "_headerDateTextStyle", "_ButtonStyle", "_popUpMenuStyle", "_AlertStyle", "_swatchPanelTextFieldStyle", "_opaquePanelStyle", "_weekDayStyleStyle", "_headerDragProxyStyleStyle"], preloader:Preloader, width:"640"});
}
}
}//package
Section 341
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_textAreaHScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaHScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 342
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_textAreaVScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaVScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 343
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.color = 0xFFFFFF;
};
};
}
}
}//package
Section 344
//_ToolTipStyle (_ToolTipStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ToolTipStyle {
public static function init(mx.skins.halo:IFlexModuleFactory):void{
var fbs = mx.skins.halo;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ToolTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("ToolTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.borderColor = 9542041;
this.paddingLeft = 4;
this.cornerRadius = 2;
this.paddingRight = 4;
this.shadowColor = 0;
this.fontSize = 9;
this.borderSkin = ToolTipBorder;
this.backgroundAlpha = 0.95;
this.paddingBottom = 2;
this.borderStyle = "toolTip";
this.backgroundColor = 16777164;
};
};
}
}
}//package
Section 345
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 346
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 347
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 348
//Bimini (Bimini)
package {
import flash.text.*;
public dynamic class Bimini extends Font {
}
}//package
Section 349
//Constants (Constants)
package {
public class Constants {
public static const UPGRADE_MAINGUN_BULLETDAMAGE:Array = [20, 25, 30, 35, 45, 50, 60, 75, 85, 100];
public static const GST_UFO:uint = 1;
public static const CMD_DELETEWEAPONBUYINFO:uint = 106;
public static const GST_SLBULLET:uint = 6;
public static const SCREEN_WIDTH:int = 640;
public static const BOSS_LevelNum:int = 25;
public static const WT_ROCKETLAUNCHER:uint = 4;
public static const GST_LEVELMESSAGE_LEVELXXX:uint = 11;
public static const GST_EARTH:uint = 5;
public static const ZB_BOSSBOOMFLASH:uint = 122;
public static const CMD_PLAYSAMPLE:uint = 2;
public static const ZB_BOSS:uint = 17;
public static const GST_HITTEST:uint = 1002;
public static const YOULOSE_UFOSPEEDBURST:Number = 1.4;
public static const ID_LevelNum:int = 1005;
public static const UPGRADE_LASERTURRET_BULLETDAMAGE:Array = [10, 20, 30, 40, 50, 65, 80, 100, 115, 125];
public static const STR_STATLINE3:String = "UFOs left bonus ";
public static const PS_LevelNum:int = 1001;
public static const DEFAULT_ISMUTED:Boolean = false;
public static const SELL_PROC:Number = 0.5;
public static const GST_BOSS_BOOM_FLASH:uint = 41;
public static const ZB_UFO:uint = 20;
public static const ZB_Cross:uint = 1000;
public static const STR_STATLINE1:String = "ACCURACY ";
public static const STR_STATLINE2:String = "UFOs shooted bonus ";
public static const GST_LEVELMESSAGE_YOULOSE:uint = 15;
public static const WEAPONPOSNUMX:Array = [50, 590, 50, 590, 50, 590];
public static const WEAPONPOSNUMY:Array = [100, 100, 220, 220, 340, 340];
public static const ZB_Earth:uint = 10;
public static const GST_ROCKETEXPLODE:uint = 34;
public static const SCREEN_HEIGHT:int = 480;
public static const SS_BGNum:int = 1006;
public static const GST_BOSS:uint = 38;
public static const ZB_ScoreText:uint = 200;
public static const MinPlayableLevelNum:int = 1;
public static const UPGRADE_ROCKETLAUNCHER_FIRERATE:Array = [80, 75, 70, 65, 60, 55, 50, 45, 40, 40];
public static const YOULOSE_UFONEXTBORN:int = 20;
public static const GST_POSTSCORESPANEL:uint = 36;
public static const MaxPlayable_BGNum:int = 24;
public static const GST_POSTSCORESLINE:uint = 37;
public static const SS_LevelNum:int = 1006;
public static const HELP_BGNum:int = 1004;
public static const USE_DEBUG_SHOWSTARSHINEAREA:Boolean = false;
public static const WT_ALIENLAB:uint = 6;
public static const DEFAULT_SPEED:Number = 1;
public static const COST_UPGRADE_ALIENLAB:Array = [0, 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500];
public static const SCREEN_WIDTH_DIV2:int = Math.round((SCREEN_WIDTH / 2));
public static const GST_ALIEN:uint = 23;
public static const STR_PLAYERCASH:String = "$ ";
public static const GST_LASERTURRETBULLET:uint = 8;
public static const LEVELMESSAGES_X:Array = [185, 185, 270, 185, 170];
public static const UPGRADE_MAX:int = 10;
public static const WT_STATICLASER:uint = 1;
public static const ZB_ALIENLAB:uint = 5;
public static const LS_LOAD:uint = 1;
public static const SCREEN_HEIGHT_DIV2:int = Math.round((SCREEN_HEIGHT / 2));
public static const GST_WEAPONUPGRADESELLPANEL:uint = 28;
public static const COST_UPGRADE_LASERTURRET:Array = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000];
public static const LEVELMESSAGES:Array = ["LEVEL XX", "READY?", "GO!", "CLEAR!", "YOU LOSE"];
public static const UPGRADE_ALIENLAB_SPEED:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
public static const UPGRADE_ROCKETHEATLAUNCHER_BULLETDAMAGE:Array = [100, 125, 150, 175, 200, 225, 250, 275, 300, 350];
public static const GST_WEAPONUPGRADESELLINFOLINE:uint = 29;
public static const HELP_LevelNum:int = 1004;
public static const DEFAULT_QUALITY:String = "best";
public static const GST_BOSS_HP:uint = 40;
public static const UFO_PE_OffsetY:int = 5;
public static const UFONEXTBORNPERIODRND:Array = [3.75, 3.75, 3.75, 2.5, 2.5, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25];
public static const STARTUP_PLAYERCASH:uint = 5000;
public static const UFO_HP_OffsetX:int = 0;
public static const ZB_ALIEN:uint = 15;
public static const UFO_PE_OffsetX:int = 0;
public static const GST_ALIENTEXTSCORE:uint = 25;
public static const LS_YOULOSE:uint = 6;
public static const ID_BGNum:int = 1005;
public static const WT_PLASMACANNON:uint = 3;
public static const MinPlayable_BGNum:int = 1;
public static const LS_GAMECOMPLETE:uint = 7;
public static const GST_ALIENLAB:uint = 24;
public static const CMD_BOSSDEAD:uint = 113;
public static const GST_UFOEXPLODE:uint = 32;
public static const UFONEXTBORNPERIOD:Array = [18.75, 17.5, 16.25, 15, 15, 13.75, 13.75, 12.5, 12.5, 11.25, 10, 8.75, 7.5, 7.5, 6.25, 6.25, 6.25, 5, 5, 5, 5, 5, 5, 5, 5, 5];
public static const LS_PLAY:uint = 3;
public static const GST_WEAPONBUYINFOLINE:uint = 27;
public static const CMD_DELETEWEAPONUPGRADESELLINFO:uint = 108;
public static const GST_UFOPLASMAEFFECT:uint = 33;
public static const UPGRADE_LASERTURRET_FIRERATE:Array = [25, 24, 23, 22, 21, 20, 19, 18, 17, 15];
public static const UFOALIENPROBABILITY:Array = [0, 0.1, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.3, 0.4, 0.5, 0.6, 0.6, 0.6, 0.5, 0.4, 0.3, 0.3, 0.3, 0.2, 0.2, 0.4, 0.4, 0, 0.3];
public static const UFOLEFT2BORN:Array = [30, 45, 60, 70, 80, 100, 120, 135, 140, 150, 160, 170, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240];
public static const UFO_HP_OffsetY:int = -40;
public static const GST_LEVELMESSAGE_READY:uint = 12;
public static const WT_LASERTURRET:uint = 2;
public static const ZB_BOSS_HP:uint = 105;
public static const COST_WEAPON:Array = [4000, 2500, 10000, 5000, 7500, 5000, 0];
public static const WT_ROCKETHEATLAUNCHER:uint = 5;
public static const CMD_MAKEBOSSEXPLOSION:uint = 111;
public static const GST_LEVELMESSAGE_LEVELCOMPLETE:uint = 14;
public static const ZB_PLAYERPANEL:uint = 120;
public static const LEVELMESSAGE_Y:int = 180;
public static const ZB_WEAPONBULLETS:uint = 100;
public static const GST_BOSSChild:uint = 39;
public static const GST_PLAYERBULLET:uint = 3;
public static const USE_DEBUG_SHOWDEBUGBUTTON:Boolean = true;
public static const STR_PLAYERSCORE:String = "";
public static const UPGRADE_ROCKETLAUNCHER_BULLETDAMAGE:Array = [100, 125, 150, 175, 200, 225, 250, 275, 300, 350];
public static const ZB_WEAPON:uint = 101;
public static const CMD_CHECK4LEVELCOMPLETE:uint = 101;
public static const GP_BossScore:Number = 500000;
public static const CMD_EXPLODEALLUFOS:uint = 110;
public static const STARTUP_LEVELNUM:uint = 1;
public static const COST_UPGRADE_MAINGUN:Array = [0, 500, 1000, 1500, 3000, 5000, 10000, 15000, 20000, 25000];
public static const RELEASE_CORRECTDOMAIN:String = "www.flashgamelicense.com";
public static const GST_PLASMACANNONBULLET:uint = 20;
public static const GST_UFOTEXTSCORE:uint = 4;
public static const COST_UPGRADE_ROCKETHEATLAUNCHER:Array = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 5000, 10000];
public static const MM_LevelNum:int = 1000;
public static const GP_AlienScore:int = 1000;
public static const CMD_SHOWLINESTAT:uint = 102;
public static const GST_PLAYERCASH:uint = 18;
public static const GST_LEVELMESSAGE_GO:uint = 13;
public static const UFOSPEED:Array = [0.9, 0.915, 0.9375, 0.975, 1.0125, 1.05, 1.0875, 1.125, 1.1625, 1.2, 1.2375, 1.275, 1.3125, 1.35, 1.3875, 1.425, 1.4325, 1.44, 1.4475, 1.455, 1.4625, 1.47, 1.4775, 1.485, 1.5, 1.5];
public static const UFO_HP_dAlpha:Number = 0.075;
public static const GST_WEAPON:uint = 19;
public static const RELEASE_CHECKDOMAIN:Boolean = false;
public static const GST_PLAYERSCORE:uint = 9;
public static const USE_DEBUG:Boolean = false;
public static const CMD_DELETEPOSTSCORESINFO:uint = 114;
public static const CMD_CLEARGUI:uint = 1;
public static const COST_UPGRADE_PLASMACANNON:Array = [0, 1000, 2000, 3000, 4000, 5000, 7500, 10000, 12500, 15000];
public static const WT_MAINGUN:uint = 7;
public static const UFOHP:Array = [52.5, 75, 90, 109, 112, 120, 131, 139, 150, 158, 161, 161, 165, 169, 173, 176, 180, 180, 184, 191, 199, 206, 214, 221, 225, 225];
public static const CMD_DELETEWEAPONSELLQINFO:uint = 109;
public static const RELEASE_ALLOWLOCALHOSTRUN:Boolean = true;
public static const GST_CROSSHAIR:uint = 2;
public static const GST_ROCKETLAUNCHERBULLET:uint = 21;
public static const GST_WEAPONSELLQINFOLINE:uint = 31;
public static const BGShineStarPeriodRND:int = 50;
public static const GP_UFOSmallScore:int = 500;
public static const MaxPlayableLevelNum:int = 24;
public static const UFO_HP_VisibleCount:int = 20;
public static const CMD_MAKELEVELMESSAGE:uint = 100;
public static const USE_DEBUG_TESTSPRITESCOUNT:Boolean = false;
public static const GST_STATPANEL:uint = 16;
public static const LS_LEVELXXREADYGO:uint = 4;
public static const WS_LevelNum:int = 1002;
public static const GST_SHINESTAR:uint = 1001;
public static const BGShineStarPeriod:int = 150;
public static const LS_START:uint = 2;
public static const CMD_ENABLEALLWEAPONS:uint = 105;
public static const GC_LevelNum:int = 1003;
public static const GP_UFOTextColor:uint = 4294967210;
public static const GST_WEAPONBUYPANEL:uint = 26;
public static const UFO_EXPLODE_SCALE:Number = 1.25;
public static const UPGRADE_STATICLASER_FIRERATE:Array = [100, 95, 80, 85, 80, 75, 70, 65, 60, 55];
public static const CMD_DELETEALLWEAPONS:uint = 107;
public static const GST_WEAPONSELLQPANEL:uint = 30;
public static const WEAPONNAMEBYTYPE:Array = ["PULSE LASER", "LASER GUN", "PLASMA CANNON", "ROCKET LAUNCHER", "HEAT SEEKING ROCKET LAUNCHER", "ALIEN LABORATORY", "MAIN GUN"];
public static const UFO_PE_SCALE:Number = 0.75;
public static const MM_BGNum:int = 1000;
public static const UPGRADE_PLASMACANNON_FIRERATE:Array = [90, 87.5, 85, 82.5, 80, 77.5, 75, 72.5, 70, 65];
public static const GST_LASEREXPLODE:uint = 35;
public static const BOSS_BGNum:int = 25;
public static const CMD_SHOWOKSTAT:uint = 103;
public static const USE_DEBUG_DEBUGMOVIEALPHA:Number = 0.25;
public static const GST_STATLINE:uint = 17;
public static const PS_BGNum:int = 1001;
public static const CMD_EMPTY:uint = 0;
public static const UFOSLEFT:uint = 100;
public static const UPGRADE_ROCKETHEATLAUNCHER_FIRERATE:Array = [80, 75, 70, 65, 60, 55, 50, 45, 40, 40];
public static const UFOTRAJ2PROB:Array = [0, 0.02, 0.1, 0.2, 0.4, 0.5, 0.7, 0.7, 0.8, 0.8, 0.8, 0.6, 0.7, 0.5, 0.6, 0.7, 0.7, 0.7, 0.7, 0.7, 0.8, 0.8, 0.8, 0.9, 0.9];
public static const COST_UPGRADE_ROCKETLAUNCHER:Array = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000];
public static const GST_WEAPONINFO_MOVIE:uint = 42;
public static const GST_UNKNOWN:uint = 0;
public static const GST_PLAYERUFOSLEFT:uint = 10;
public static const UPGRADE_STATICLASER_BULLETDAMAGE:Array = [5, 6, 7, 8, 10, 12, 14, 16, 18, 20];
public static const COST_UPGRADE_STATICLASER:Array = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000];
public static const ZB_LEVELMESSAGE:uint = 110;
public static const GST_ROCKETHEATLAUNCHERBULLET:uint = 22;
public static const WS_BGNum:int = 1002;
public static const WEAPONBUYPOSNUMX:Array = [5, 543, 5, 543, 5, 543];
public static const WEAPONBUYPOSNUMY:Array = [75, 75, 195, 195, 315, 315];
public static const LS_LEVELCOMPLETE:uint = 5;
public static const ZB_ShineStar:uint = 10;
public static const ZB_PLAYERPANELINFO:uint = 121;
public static const GP_UFOScore:int = 100;
public static const GST_VICTORYMESSAGE:uint = 43;
public static const GC_BGNum:int = 1003;
public static const UPGRADE_PLASMACANNON_BULLETDAMAGE:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
public static const GST_UFOHEALTHBAR:uint = 7;
public static const WEAPONUPGRADESELLPOSNUMX:Array = [5, 504, 5, 504, 5, 504];
public static const WEAPONUPGRADESELLPOSNUMY:Array = [130, 130, 0xFF, 0xFF, 370, 370];
public static const CMD_MAKEBOSSFLASH:uint = 112;
public static const CMD_DISABLEALLWEAPONS:uint = 104;
public static const USE_DEBUG_SHOWHITAREA:Boolean = false;
public function Constants(){
super();
}
}
}//package
Section 350
//DebugButton (DebugButton)
package {
import flash.display.*;
public dynamic class DebugButton extends SimpleButton {
}
}//package
Section 351
//DS_Note (DS_Note)
package {
import flash.text.*;
public dynamic class DS_Note extends Font {
}
}//package
Section 352
//en_US$containers_properties (en_US$containers_properties)
package {
import mx.resources.*;
public class en_US$containers_properties extends ResourceBundle {
public function en_US$containers_properties(){
super("en_US", "containers");
}
override protected function getContent():Object{
var _local1:Object = {noColumnsFound:"No ConstraintColumns found.", noRowsFound:"No ConstraintRows found.", rowNotFound:"ConstraintRow '{0}' not found.", columnNotFound:"ConstraintColumn '{0}' not found."};
return (_local1);
}
}
}//package
Section 353
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 354
//en_US$effects_properties (en_US$effects_properties)
package {
import mx.resources.*;
public class en_US$effects_properties extends ResourceBundle {
public function en_US$effects_properties(){
super("en_US", "effects");
}
override protected function getContent():Object{
var _local1:Object = {incorrectTrigger:"The Zoom effect can not be triggered by a moveEffect trigger.", incorrectSource:"Source property must be a Class or String."};
return (_local1);
}
}
}//package
Section 355
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 356
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 357
//Preloader (Preloader)
package {
import flash.display.*;
import flash.events.*;
import mx.preloaders.*;
import com.gamezhero.api.as3.*;
public class Preloader extends DownloadProgressBar {
public function Preloader(){
super();
}
override public function set preloader(preloader:Sprite):void{
GamezheroApi.ini("spacevoyageinvasion");
GamezheroApi.preloader((preloader.parent as MovieClip), nextStep);
}
private function nextStep():void{
dispatchEvent(new Event(Event.COMPLETE));
}
}
}//package
Section 358
//SpriteEngine (SpriteEngine)
package {
import flash.display.*;
import flash.events.*;
public class SpriteEngine extends Sprite {
public var Items:Array;
public var DeadList:Array;
public var isGameSpriteEngine:Boolean;// = true
private var BGChildrenNumOrigin:int;// = 0
public var UFOShooter1:UFOShooter;
public function SpriteEngine(){
super();
Items = new Array();
DeadList = new Array();
}
public function Add(sprite:TGameSprite):int{
var gs:TGameSprite;
var i:int;
var len:int = this.Items.length;
var indx = -1;
if (len == 0){
if (!isGameSpriteEngine){
BGChildrenNumOrigin = (this.UFOShooter1.BGMovie.numChildren - 1);
};
Items.push(sprite);
indx = 0;
} else {
i = 0;
while (i < len) {
gs = Items[i];
if (gs.z_ > sprite.z_){
indx = i;
Items.splice(i, 0, sprite);
break;
};
i++;
};
if (indx == -1){
Items.push(sprite);
indx = 0;
};
};
this.RebuildChildIndexes();
return (indx);
}
public function Update(Speed:Number):void{
var gs:TGameSprite;
var len:int = Items.length;
if (len == 0){
return;
};
var i:int;
while (i < len) {
gs = Items[i];
gs.Update(Speed);
i++;
};
}
public function Remove(sprite:TGameSprite):void{
var i = -1;
i = this.Items.indexOf(sprite);
if (i >= 0){
if (sprite.FlashSprite != null){
if (this.isGameSpriteEngine){
this.UFOShooter1.GameSpritesMovie.removeChild(sprite.FlashSprite);
} else {
this.UFOShooter1.BGMovie.removeChild(sprite.FlashSprite);
};
sprite.FlashSprite = null;
};
if (((((Constants.USE_DEBUG) && (Constants.USE_DEBUG_SHOWHITAREA))) && (!((sprite.hitArea == null))))){
this.UFOShooter1.DebugMovie.removeChild(sprite.hitArea);
};
this.Items.splice(i, 1);
this.RebuildChildIndexes();
};
}
public function Collision():void{
var gs:TGameSprite;
var gs2:TGameSprite;
var j:int;
var len:int = Items.length;
if (len <= 1){
return;
};
var i:int;
while (i < (len - 1)) {
gs = Items[i];
if (gs.doCollision){
j = (i + 1);
while (j < len) {
gs2 = Items[j];
if (gs2.doCollision){
gs.isCollide(gs2);
};
j++;
};
};
i++;
};
}
public function Dead():void{
var gs:TGameSprite;
var indx = -1;
while (DeadList.length > 0) {
gs = DeadList.pop();
Remove(gs);
};
}
public function RebuildChildIndexes():void{
var gs:TGameSprite;
var len:int = this.Items.length;
if (len <= 0){
return;
};
var indx:int;
var i:int;
while (i < len) {
gs = Items[i];
if (gs != null){
if (gs.FlashSprite != null){
if (this.isGameSpriteEngine){
if (this.UFOShooter1.GameSpritesMovie.getChildIndex(gs.FlashSprite) != indx){
this.UFOShooter1.GameSpritesMovie.setChildIndex(gs.FlashSprite, indx);
};
} else {
if (this.UFOShooter1.BGMovie.getChildIndex(gs.FlashSprite) != (indx + BGChildrenNumOrigin)){
this.UFOShooter1.BGMovie.setChildIndex(gs.FlashSprite, (indx + BGChildrenNumOrigin));
};
};
indx++;
};
};
i++;
};
}
}
}//package
Section 359
//SVI (SVI)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.*;
import mx.binding.*;
import flash.ui.*;
import flash.utils.*;
import mochi.as3.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
import flash.accessibility.*;
import flash.debugger.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.xml.*;
import com.gamezhero.api.as3.*;
public class SVI extends Application {
private var _1389787824ID_Label:Label;
private var Game:Object;
private var CLICKAWAY_OPTIONS:Object;
private var _clip:MovieClip;
private var clickAwayMC:MovieClip;
private var _1818095848MochiAdComponent:UIComponent;
private var INTER_OPTIONS:Object;
private var _documentDescriptor_:UIComponentDescriptor;
private var _storeItems:Object;
mx_internal static var _SVI_StylesInit_done:Boolean = false;
public function SVI(){
_documentDescriptor_ = new UIComponentDescriptor({type:Application, propertiesFactory:function ():Object{
return ({width:640, height:480, childDescriptors:[new UIComponentDescriptor({type:UIComponent, id:"MochiAdComponent", propertiesFactory:function ():Object{
return ({x:0, y:0});
}}), new UIComponentDescriptor({type:Label, id:"ID_Label", stylesFactory:function ():void{
this.color = 0xFFFFFF;
this.textAlign = "center";
}, propertiesFactory:function ():Object{
return ({text:"Incorrect domain:", width:620, x:10, y:452});
}})]});
}});
super();
mx_internal::_document = this;
if (!this.styleDeclaration){
this.styleDeclaration = new CSSStyleDeclaration();
};
this.styleDeclaration.defaultFactory = function ():void{
this.color = 0;
this.borderColor = 0;
this.backgroundGradientAlphas = [1, 1];
this.backgroundGradientColors = [0, 0];
};
mx_internal::_SVI_StylesInit();
this.layout = "absolute";
this.width = 640;
this.height = 480;
this.addEventListener("initialize", ___SVI_Application1_initialize);
this.addEventListener("applicationComplete", ___SVI_Application1_applicationComplete);
}
mx_internal function _SVI_StylesInit():void{
var _local1:CSSStyleDeclaration;
var _local2:Array;
if (mx_internal::_SVI_StylesInit_done){
return;
};
mx_internal::_SVI_StylesInit_done = true;
var _local3 = StyleManager;
_local3.mx_internal::initProtoChainRoots();
}
public function isDomainCorrect():Boolean{
trace("Checking domain...");
var loaderInfoURL:String = this.root.loaderInfo.url;
var domain:String = loaderInfoURL.split("/")[2];
ID_Label.text = ("Incorrect domain " + domain);
var r:Boolean = (((domain == Constants.RELEASE_CORRECTDOMAIN)) || ((Constants.RELEASE_CORRECTDOMAIN == "")));
r = ((r) || (((Constants.RELEASE_ALLOWLOCALHOSTRUN) && ((domain == "")))));
r = ((r) || (((Constants.RELEASE_ALLOWLOCALHOSTRUN) && ((domain == "localhost")))));
r = ((r) || (((Constants.RELEASE_ALLOWLOCALHOSTRUN) && ((domain.substr(1, 2) == ":\\")))));
trace(("Checking domain... " + r));
return (r);
}
private function hideLogin(ev:Object=null):void{
MochiCoins.hideLoginWidget();
}
private function showInterlevelAd(event:Event):void{
MochiAd.showInterLevelAd(INTER_OPTIONS);
}
public function ___SVI_Application1_applicationComplete(event:FlexEvent):void{
complete();
}
private function showLogin(ev:Object=null):void{
MochiCoins.showLoginWidget({x:420, y:430});
}
override public function initialize():void{
mx_internal::setDocumentDescriptor(_documentDescriptor_);
super.initialize();
}
private function unloadClickAwayAd(event:Event):void{
MochiAd.unload(clickAwayMC);
}
private function showClickAwayAd(event:Event):void{
clickAwayMC = new MovieClip();
MochiAd.showClickAwayAd(CLICKAWAY_OPTIONS);
}
public function set MochiAdComponent(x:UIComponent):void{
var _local2:Object = this._1818095848MochiAdComponent;
if (_local2 !== x){
this._1818095848MochiAdComponent = x;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "MochiAdComponent", _local2, x));
};
}
private function storeItems(arg:Object):void{
var key:String;
_storeItems = arg;
for (key in _storeItems) {
trace(("[GAME] [StoreItems] " + key));
};
}
public function set ID_Label(x:Label):void{
var _local2:Object = this._1389787824ID_Label;
if (_local2 !== x){
this._1389787824ID_Label = x;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "ID_Label", _local2, x));
};
}
public function ___SVI_Application1_initialize(event:FlexEvent):void{
Init();
}
private function coinsError(error:Object):void{
trace(("[GAME] [coinsError] " + error.type));
}
public function get MochiAdComponent():UIComponent{
return (this._1818095848MochiAdComponent);
}
private function onError(status:String):void{
trace(("[GAME] Connect onError called " + status));
}
private function showStore(ev:Object=null):void{
}
public function Init():void{
trace("Init Space Voyage - Invasion");
trace(("Flash version=" + Capabilities.version));
trace(("Flash isDebugger=" + Capabilities.isDebugger));
}
private function showItem(ev:Object=null):void{
}
private function coinsEvent(event:Object):void{
trace(("[GAME] [coinsEvent] " + event));
}
private function complete():void{
ID_Label.text = "";
trace("Starting game...");
this.stage.quality = Constants.DEFAULT_QUALITY;
this.stage.scaleMode = StageScaleMode.EXACT_FIT;
Game = (UFOShooter as Class);
this.stage.addChild((new Game() as DisplayObject));
}
public function get ID_Label():Label{
return (this._1389787824ID_Label);
}
}
}//package
Section 360
//TAlien_hitArea (TAlien_hitArea)
package {
import flash.display.*;
public dynamic class TAlien_hitArea extends MovieClip {
}
}//package
Section 361
//TAlien1 (TAlien1)
package {
import flash.display.*;
public dynamic class TAlien1 extends MovieClip {
}
}//package
Section 362
//TAlien2 (TAlien2)
package {
import flash.display.*;
public dynamic class TAlien2 extends MovieClip {
}
}//package
Section 363
//TAlien3 (TAlien3)
package {
import flash.display.*;
public dynamic class TAlien3 extends MovieClip {
}
}//package
Section 364
//TAlien4 (TAlien4)
package {
import flash.display.*;
public dynamic class TAlien4 extends MovieClip {
}
}//package
Section 365
//TAlienLab (TAlienLab)
package {
import flash.display.*;
public dynamic class TAlienLab extends MovieClip {
}
}//package
Section 366
//TAlienLab_hitArea (TAlienLab_hitArea)
package {
import flash.display.*;
public dynamic class TAlienLab_hitArea extends MovieClip {
}
}//package
Section 367
//TBG_OBJ_SHINESTAR1 (TBG_OBJ_SHINESTAR1)
package {
import flash.display.*;
public dynamic class TBG_OBJ_SHINESTAR1 extends MovieClip {
}
}//package
Section 368
//TBG_OBJ_SHINESTAR2 (TBG_OBJ_SHINESTAR2)
package {
import flash.display.*;
public dynamic class TBG_OBJ_SHINESTAR2 extends MovieClip {
}
}//package
Section 369
//TBGMovie (TBGMovie)
package {
import flash.display.*;
public dynamic class TBGMovie extends MovieClip {
}
}//package
Section 370
//TBGStarShineAreaMM (TBGStarShineAreaMM)
package {
import flash.display.*;
public dynamic class TBGStarShineAreaMM extends MovieClip {
}
}//package
Section 371
//TBGStarShineAreaPlayable (TBGStarShineAreaPlayable)
package {
import flash.display.*;
public dynamic class TBGStarShineAreaPlayable extends MovieClip {
}
}//package
Section 372
//TBOSS (TBOSS)
package {
import flash.display.*;
public dynamic class TBOSS extends MovieClip {
}
}//package
Section 373
//TBOSS_hitArea (TBOSS_hitArea)
package {
import flash.display.*;
public dynamic class TBOSS_hitArea extends MovieClip {
}
}//package
Section 374
//TCommandProcessor (TCommandProcessor)
package {
public class TCommandProcessor {
private var Items:Array;
public var UFOShooter1:UFOShooter;
public function TCommandProcessor(){
super();
trace("TCommandProcessor created.");
Items = new Array();
}
public function DestroyByGameLevel(Obj:Object):void{
var cmd:TGameCommand;
if ((((Items.length <= 0)) || ((Obj == null)))){
return;
};
var i:int;
while (i < Items.length) {
cmd = Items[i];
if (((!((cmd.BornByLevel == null))) && ((cmd.BornByLevel == Obj)))){
Items.splice(i, 1);
i--;
};
i++;
};
}
public function DestroyByBG(Obj:Object):void{
var cmd:TGameCommand;
if ((((Items.length <= 0)) || ((Obj == null)))){
return;
};
var i:int;
while (i < Items.length) {
cmd = Items[i];
if (((!((cmd.BornByBG == null))) && ((cmd.BornByBG == Obj)))){
Items.splice(i, 1);
i--;
};
i++;
};
}
public function Update(Speed:Number=1):void{
var cmd:TGameCommand;
var len:int = Items.length;
if (len <= 0){
return;
};
var i:int;
while (i < len) {
cmd = Items[i];
if (cmd.Type == Constants.CMD_EMPTY){
} else {
cmd.Ticks = (cmd.Ticks - Speed);
if (cmd.Ticks <= 0){
fCommandExec(cmd);
cmd.Clear();
};
};
i++;
};
i = 0;
while (i < Items.length) {
cmd = Items[i];
if (cmd.Type == Constants.CMD_EMPTY){
Items.splice(i, 1);
i--;
};
i++;
};
}
public function DeleteAllCommandType(CommandType:uint):int{
var cmd:TGameCommand;
var len:int = Items.length;
var res:int;
if (Items.length <= 0){
return (-1);
};
if (CommandType == 0){
while (Items.length > 0) {
Items.pop();
};
return (len);
};
var i:int;
while (i < Items.length) {
cmd = Items[i];
if (cmd.Type == CommandType){
Items.splice(i, 1);
i--;
res++;
};
i++;
};
return (res);
}
public function GetCommandNum(CommandType:uint):int{
var cmd:TGameCommand;
var len:int = Items.length;
if (len <= 0){
return (-1);
};
var i:int;
while (i < len) {
cmd = Items[i];
if (cmd.Type == CommandType){
return (i);
};
i++;
};
return (-1);
}
public function CommandAdd(CommandType:uint, BornByLevel_:Object=null, BornByBG_:Object=null):TGameCommand{
var cmd:TGameCommand = new TGameCommand(CommandType);
cmd.BornByLevel = BornByLevel_;
cmd.BornByBG = BornByBG_;
Items.push(cmd);
return (cmd);
}
public function CommandExec(CommandType:uint):void{
var cmd:TGameCommand = new TGameCommand(CommandType);
fCommandExec(cmd);
}
private function fCommandExec(cmd:TGameCommand):void{
var NoUFOs:Boolean;
var gs:TGameSprite;
var len:int;
var i:int;
var ok:TGUI_FORM3_OK;
if ((((cmd == null)) || ((cmd.Type == Constants.CMD_EMPTY)))){
return;
};
if (cmd.Type == Constants.CMD_CLEARGUI){
if (((!((UFOShooter1 == null))) && (!((UFOShooter1.GUIMovie == null))))){
while (UFOShooter1.GUIMovie.numChildren != 0) {
UFOShooter1.GUIMovie.removeChildAt(0);
};
};
} else {
if (cmd.Type == Constants.CMD_PLAYSAMPLE){
UFOShooter1.SoundEngine.PlaySample(cmd.String_Param1, cmd.Bool_Param1);
} else {
if (cmd.Type == Constants.CMD_MAKELEVELMESSAGE){
if (UFOShooter1.CurrentLevel != null){
UFOShooter1.CurrentLevel.MakeLevelMessage(cmd.UInt_Param1);
};
} else {
if (cmd.Type == Constants.CMD_CHECK4LEVELCOMPLETE){
if (((((((((!((UFOShooter1.CurrentLevel == null))) && (UFOShooter1.CurrentLevel.isPlayable()))) && (!((UFOShooter1.CurrentLevel.LevelNum == Constants.BOSS_LevelNum))))) && ((UFOShooter1.CurrentLevel.GetLevelState() == Constants.LS_PLAY)))) && ((UFOShooter1.CurrentLevel.UFOLEFT2BORN == 0)))){
NoUFOs = true;
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if (gs.Type == Constants.GST_UFO){
NoUFOs = false;
break;
};
i++;
};
if (NoUFOs){
UFOShooter1.CurrentLevel.ChangeLevelState(Constants.LS_LEVELCOMPLETE);
cmd = UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(UFOShooter1.CurrentLevel));
cmd.UInt_Param1 = Constants.GST_LEVELMESSAGE_LEVELCOMPLETE;
cmd.Ticks = Constants.DEFAULT_SPEED;
UFOShooter1.SoundEngine.PlaySample("LevelClear");
UFOShooter1.SoundEngine.StopCurrentStream();
cmd = UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_DISABLEALLWEAPONS, Object(UFOShooter1.CurrentLevel));
cmd.Ticks = 80;
};
};
} else {
if (cmd.Type == Constants.CMD_SHOWLINESTAT){
if (UFOShooter1.CurrentLevel != null){
UFOShooter1.CurrentLevel.MakeStatLine(cmd.Int_Param1);
};
} else {
if (cmd.Type == Constants.CMD_SHOWOKSTAT){
ok = new TGUI_FORM3_OK();
ok.x = 270;
ok.y = 315;
UFOShooter1.GUIMovie.addChild(ok);
} else {
if (cmd.Type == Constants.CMD_DISABLEALLWEAPONS){
UFOShooter1.Cross.WeaponEnabled = false;
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if (((((((gs.WeaponEnabled) && ((gs.Type == Constants.GST_WEAPON)))) || ((gs.Type == Constants.GST_ALIENLAB)))) || ((gs.Type == Constants.GST_BOSS)))){
gs.WeaponEnabled = false;
gs.WeaponFireRateCount = 0;
if (gs.Type == Constants.GST_BOSS){
gs.StageCount_ = 0;
};
};
i++;
};
} else {
if (cmd.Type == Constants.CMD_ENABLEALLWEAPONS){
UFOShooter1.Cross.WeaponEnabled = true;
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if (((((((!(gs.WeaponEnabled)) && ((gs.Type == Constants.GST_WEAPON)))) || ((gs.Type == Constants.GST_ALIENLAB)))) || ((gs.Type == Constants.GST_BOSS)))){
gs.WeaponEnabled = true;
gs.WeaponFireRateCount = 0;
};
i++;
};
} else {
if (cmd.Type == Constants.CMD_DELETEWEAPONBUYINFO){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if ((((gs.Type == Constants.GST_WEAPONBUYINFOLINE)) || ((gs.Type == Constants.GST_WEAPONINFO_MOVIE)))){
gs.Dead();
};
i++;
};
UFOShooter1.SpriteEngine_.Dead();
} else {
if (cmd.Type == Constants.CMD_DELETEALLWEAPONS){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if ((((gs.Type == Constants.GST_WEAPON)) || ((gs.Type == Constants.GST_ALIENLAB)))){
gs.Dead();
};
i++;
};
UFOShooter1.SpriteEngine_.Dead();
} else {
if (cmd.Type == Constants.CMD_DELETEWEAPONUPGRADESELLINFO){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if ((((gs.Type == Constants.GST_WEAPONUPGRADESELLINFOLINE)) || ((gs.Type == Constants.GST_WEAPONINFO_MOVIE)))){
gs.Dead();
};
i++;
};
UFOShooter1.SpriteEngine_.Dead();
} else {
if (cmd.Type == Constants.CMD_DELETEWEAPONSELLQINFO){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if (gs.Type == Constants.GST_WEAPONSELLQINFOLINE){
gs.Dead();
};
i++;
};
} else {
if (cmd.Type == Constants.CMD_EXPLODEALLUFOS){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if ((((gs.Type == Constants.GST_UFO)) && (!(gs.isDead)))){
gs.ProcDamage(99999);
};
i++;
};
} else {
if (cmd.Type == Constants.CMD_MAKEBOSSEXPLOSION){
UFOShooter1.CurrentLevel.MakeBossExplosion(cmd.Point_Param1);
} else {
if (cmd.Type == Constants.CMD_MAKEBOSSFLASH){
UFOShooter1.CurrentLevel.MakeBossBoomFlash();
} else {
if (cmd.Type == Constants.CMD_BOSSDEAD){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if (gs.Type == Constants.GST_BOSS){
gs.SetVisible(false);
gs.Dead();
};
i++;
};
} else {
if (cmd.Type == Constants.CMD_DELETEPOSTSCORESINFO){
len = UFOShooter1.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gs = UFOShooter1.SpriteEngine_.Items[i];
if ((((gs.Type == Constants.GST_POSTSCORESPANEL)) || ((gs.Type == Constants.GST_POSTSCORESLINE)))){
gs.Dead();
};
i++;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
}
}//package
Section 375
//TCrosshair (TCrosshair)
package {
import flash.display.*;
public dynamic class TCrosshair extends MovieClip {
}
}//package
Section 376
//TEARTH (TEARTH)
package {
import flash.display.*;
public dynamic class TEARTH extends MovieClip {
}
}//package
Section 377
//TEARTH_hitArea (TEARTH_hitArea)
package {
import flash.display.*;
public dynamic class TEARTH_hitArea extends MovieClip {
}
}//package
Section 378
//TFIRE_hitArea (TFIRE_hitArea)
package {
import flash.display.*;
public dynamic class TFIRE_hitArea extends MovieClip {
}
}//package
Section 379
//TGameBG (TGameBG)
package {
import flash.display.*;
import flash.geom.*;
public class TGameBG {
public var BGNum:uint;// = 0
public var UFOShooter1:UFOShooter;// = null
private var StarShine_BornCount:Number;// = 0
private var BGFrame:uint;// = 7
private var StarShine_NextBornBorn:Number;// = 0
private var StarShineArea:MovieClip;// = null
public var SpriteEngine_:SpriteEngine;// = null
public function TGameBG(BGNum_:int){
super();
BGNum = BGNum_;
if (BGNum_ == Constants.MM_BGNum){
BGFrame = 6;
StarShineArea = new TBGStarShineAreaMM();
} else {
if ((((BGNum_ >= Constants.MinPlayable_BGNum)) && ((BGNum_ <= Constants.MaxPlayable_BGNum)))){
BGFrame = (1 + Math.round((Math.random() * 4)));
if (BGFrame < 1){
BGFrame = 1;
};
if (BGFrame > 5){
BGFrame = 5;
};
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.PS_BGNum){
BGFrame = 7;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.WS_BGNum){
BGFrame = 8;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.GC_BGNum){
BGFrame = 9;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.HELP_BGNum){
BGFrame = 10;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.BOSS_BGNum){
BGFrame = 11;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.ID_BGNum){
BGFrame = 12;
StarShineArea = new TBGStarShineAreaPlayable();
} else {
if (BGNum_ == Constants.SS_BGNum){
BGFrame = 13;
StarShineArea = new TBGStarShineAreaPlayable();
};
};
};
};
};
};
};
};
};
}
public function Start():void{
UFOShooter1.BGMovie.gotoAndStop(BGFrame);
if (StarShineArea != null){
UFOShooter1.BGMovie.addChild(StarShineArea);
StarShineArea.visible = ((Constants.USE_DEBUG) && (Constants.USE_DEBUG_SHOWSTARSHINEAREA));
};
UFOShooter1.BGMovie.visible = true;
}
public function Update(Speed:Number=1):void{
StarShine_BornCount = (StarShine_BornCount + Speed);
if (StarShine_NextBornBorn == 0){
StarShine_NextBornBorn = (Constants.BGShineStarPeriod + (Math.random() * Constants.BGShineStarPeriodRND));
};
if (StarShine_BornCount >= StarShine_NextBornBorn){
MakeShineStar(Math.round((1 + Math.random())));
StarShine_BornCount = 0;
StarShine_NextBornBorn = (Constants.BGShineStarPeriod + (Math.random() * Constants.BGShineStarPeriodRND));
};
}
public function MakeShineStar(StarType_:int):TGameSprite{
var gs:TGameSprite;
var SS1:TBG_OBJ_SHINESTAR1;
var SS2:TBG_OBJ_SHINESTAR2;
var trys:int;
if (StarType_ == 1){
SS1 = new TBG_OBJ_SHINESTAR1();
UFOShooter1.BGMovie.addChild(SS1);
gs = new TGameSprite(SpriteEngine_, SS1, null, Constants.GST_SHINESTAR, Constants.ZB_ShineStar);
} else {
if (StarType_ == 2){
SS2 = new TBG_OBJ_SHINESTAR2();
UFOShooter1.BGMovie.addChild(SS2);
gs = new TGameSprite(SpriteEngine_, SS2, null, Constants.GST_SHINESTAR, Constants.ZB_ShineStar);
};
};
gs.ShineStarType = StarType_;
gs.Alpha_ = 0;
gs.Rotation_ = (Math.random() * 360);
gs.Scale_ = (0.5 + (Math.random() / 10));
gs.Stage_ = 0;
gs.BlendMode_ = BlendMode.ADD;
gs.doCollision = false;
gs.BornByBG = Object(this);
var Pos:Point = new Point((20 + (Math.random() * (Constants.SCREEN_WIDTH - 40))), (20 + (Math.random() * (Constants.SCREEN_HEIGHT - 60))));
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
if (StarShineArea != null){
trys = 0;
while (true) {
Pos = new Point((20 + (Math.random() * (Constants.SCREEN_WIDTH - 40))), (20 + (Math.random() * (Constants.SCREEN_HEIGHT - 60))));
gs.SetPos(Pos);
gs.SetVisible(false);
gs.ForceSetFlashSprite();
if (StarShineArea.hitTestPoint(Pos.x, Pos.y, true)){
gs.SetVisible(true);
break;
};
var _temp1 = trys;
trys = (trys + 1);
if (_temp1 > 12){
gs.Dead();
break;
};
};
} else {
gs.Dead();
};
gs.ForceSetFlashSprite();
return (gs);
}
public function Destroy():void{
var len:int;
var gc:TGameSprite;
var i:int;
if (this.UFOShooter1 != null){
if (((!((UFOShooter1.BGMovie == null))) && (!((StarShineArea == null))))){
UFOShooter1.BGMovie.removeChild(StarShineArea);
};
len = this.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gc = this.SpriteEngine_.Items[i];
if (TGameBG(gc.BornByBG) == this){
gc.Dead();
};
i++;
};
this.UFOShooter1.CommandProcessor.DestroyByBG(Object(this));
};
}
public function MakeHitTest(Pos:Point, Color:uint):TGameSprite{
var s:Sprite = new Sprite();
s.graphics.clear();
s.graphics.beginFill(Color);
s.graphics.drawCircle(0, 0, 5);
s.graphics.endFill();
this.UFOShooter1.BGMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_HITTEST, Constants.ZB_ShineStar);
gs.SetPos(Pos);
gs.doCollision = false;
gs.BornByBG = Object(this);
return (gs);
}
}
}//package
Section 380
//TGameCommand (TGameCommand)
package {
import flash.geom.*;
public class TGameCommand {
public var Number_Param2:Number;
public var OtherLink:Object;
public var Point_Param1:Point;
public var Point_Param2:Point;
public var Point_Param3:Point;
public var String_Param1:String;
public var String_Param2:String;
public var String_Param3:String;
public var Bool_Param1:Boolean;
public var Bool_Param2:Boolean;
public var Bool_Param3:Boolean;
public var Object_Param1:Object;
public var Object_Param2:Object;
public var Object_Param3:Object;
public var BornByLevel:Object;
public var Int_Param2:int;
public var Type:uint;// = 0
public var Int_Param1:int;
public var Ticks:Number;// = 0
public var BornByBG:Object;
public var UInt_Param1:uint;
public var UInt_Param2:uint;
public var UInt_Param3:uint;
public var Int_Param3:int;
public var Number_Param1:Number;
public var Number_Param3:Number;
public function TGameCommand(CommandType:uint=0){
super();
Point_Param1 = new Point(0, 0);
Point_Param2 = new Point(0, 0);
Point_Param3 = new Point(0, 0);
Clear();
Type = CommandType;
}
public function Clear():void{
Type = Constants.CMD_EMPTY;
Ticks = 0;
Bool_Param1 = false;
Bool_Param2 = false;
Bool_Param3 = false;
Int_Param1 = 0;
Int_Param2 = 0;
Int_Param3 = 0;
Number_Param1 = 0;
Number_Param2 = 0;
Number_Param3 = 0;
UInt_Param1 = 0;
UInt_Param2 = 0;
UInt_Param3 = 0;
String_Param1 = "";
String_Param2 = "";
String_Param3 = "";
Point_Param1.x = 0;
Point_Param1.y = 0;
Point_Param2.x = 0;
Point_Param2.y = 0;
Point_Param3.x = 0;
Point_Param3.y = 0;
BornByBG = null;
BornByLevel = null;
OtherLink = null;
}
}
}//package
Section 381
//TGameLevel (TGameLevel)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mochi.as3.*;
import com.gamezhero.api.as3.*;
public class TGameLevel {
public var LevelNum:int;// = 0
public var UFO_BornCount:Number;// = 0
public var UFOShooter1:UFOShooter;// = null
public var LevelSubNum:int;// = 0
public var UFOLEFT2BORN:uint;// = 0
public var SpriteEngine_:SpriteEngine;// = null
public var UFO_NextBorn:Number;// = 0
private var fisPause:Boolean;// = false
public var GameBG:TGameBG;// = null
private var fLevelState:uint;// = 2
public function TGameLevel(LevelNum_:int, LevelSubNum_:int){
super();
LevelNum = LevelNum_;
LevelSubNum = LevelSubNum_;
}
public function MakeWeaponUpgradeSellPanel():TGameSprite{
var s:TGUI_FORM8_PANEL = new TGUI_FORM8_PANEL();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONUPGRADESELLPANEL, Constants.ZB_PLAYERPANEL);
gs.SetPos(new Point(80, 125));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeAlienLab(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TAlienLab = new TAlienLab();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, new TAlienLab_hitArea(), Constants.GST_ALIENLAB, Constants.ZB_ALIENLAB);
if (PosNum == 7){
gs.SetPos(new Point(110, 162));
gs.Stage_ = 0;
} else {
gs.SetPos(new Point(530, 278));
gs.Stage_ = 1;
};
gs.ALIENLAB_SPEED = Constants.UPGRADE_ALIENLAB_SPEED[(UpgradeNum - 1)];
gs.dx = gs.ALIENLAB_SPEED;
gs.doCollision = true;
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeRocketExplode(Pos:Point, Scale:Number):TGameSprite{
var s:TROCKETEXPLODE = new TROCKETEXPLODE();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_ROCKETEXPLODE, (Constants.ZB_UFO + 1));
gs.BlendMode_ = BlendMode.ADD;
gs.Scale_ = Scale;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeRocketLauncher(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TRocketLauncherL;
var gs:TGameSprite;
var s1:TRocketLauncherR;
var Pos:Point = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
if ((PosNum % 2) == 1){
s = new TRocketLauncherL();
this.UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
gs.WeaponBulletPos = new Point((Pos.x - 25), (Pos.y + 5));
} else {
s1 = new TRocketLauncherR();
this.UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
gs.WeaponBulletPos = new Point((Pos.x + 10), (Pos.y + 5));
};
gs.WeaponType = Constants.WT_ROCKETLAUNCHER;
gs.WeaponPosNum = PosNum;
gs.WeaponUpgradeNum = UpgradeNum;
gs.WeaponIsLR = ((PosNum % 2) == 1);
gs.SetPos(Pos);
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function isPausable():Boolean{
return (((((isPlayable()) || ((LevelNum == Constants.BOSS_LevelNum)))) && ((((fLevelState == Constants.LS_LEVELXXREADYGO)) || ((fLevelState == Constants.LS_PLAY))))));
}
public function MakePlasmaCannon(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TPlasmaCannonL;
var gs:TGameSprite;
var s1:TPlasmaCannonR;
if ((PosNum % 2) == 1){
s = new TPlasmaCannonL();
this.UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
} else {
s1 = new TPlasmaCannonR();
this.UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
};
gs.WeaponType = Constants.WT_PLASMACANNON;
gs.WeaponPosNum = PosNum;
gs.WeaponUpgradeNum = UpgradeNum;
gs.WeaponIsLR = ((PosNum % 2) == 1);
var Pos:Point = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
gs.SetPos(Pos);
if (gs.WeaponIsLR){
gs.WeaponBulletPos = new Point((Pos.x + 65), Pos.y);
} else {
gs.WeaponBulletPos = new Point((Pos.x - 65), Pos.y);
};
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeLaserTurretBullet(isLR:Boolean, Pos:Point, BulletDamage:int):TGameSprite{
var gs:TGameSprite;
var s:TLaserTurretBulletLR;
var s1:TLaserTurretBulletRL;
if (isLR){
s = new TLaserTurretBulletLR();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, new TLaserTurretBulletLR_hitArea(), Constants.GST_LASERTURRETBULLET, Constants.ZB_WEAPONBULLETS);
gs.dx = 20;
} else {
s1 = new TLaserTurretBulletRL();
UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, new TLaserTurretBulletRL_hitArea(), Constants.GST_LASERTURRETBULLET, Constants.ZB_WEAPONBULLETS);
gs.dx = -20;
};
gs.BlendMode_ = BlendMode.ADD;
gs.BulletDamage = BulletDamage;
gs.WeaponIsLR = isLR;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFO(Color_:int, Speed_:Number=1):TGameSprite{
var UFOC1:TUFOC1Movie;
var UFOC2:TUFOC2Movie;
var UFOC3:TUFOC3Movie;
var gs:TGameSprite;
if (Color_ == 1){
UFOC1 = new TUFOC1Movie();
UFOShooter1.GameSpritesMovie.addChild(UFOC1);
gs = new TGameSprite(SpriteEngine_, UFOC1, new TUFO_hitArea(), Constants.GST_UFO, Constants.ZB_UFO);
} else {
if (Color_ == 2){
UFOC2 = new TUFOC2Movie();
UFOShooter1.GameSpritesMovie.addChild(UFOC2);
gs = new TGameSprite(SpriteEngine_, UFOC2, new TUFO_hitArea(), Constants.GST_UFO, Constants.ZB_UFO);
} else {
if (Color_ == 3){
UFOC3 = new TUFOC3Movie();
UFOShooter1.GameSpritesMovie.addChild(UFOC3);
gs = new TGameSprite(SpriteEngine_, UFOC3, new TUFO_hitArea(), Constants.GST_UFO, Constants.ZB_UFO);
};
};
};
gs.ColorTransform_ = new ColorTransform();
gs.BornByLevel = Object(this);
gs.UFOColor = Color_;
gs.UFOSpeed = (Speed_ * ((9 + Math.random()) / 10));
var cLevel:int = (UFOShooter1.Player.LevelNum - Constants.MinPlayableLevelNum);
if (isPlayable()){
cLevel = (LevelNum - Constants.MinPlayableLevelNum);
};
gs.UFOSpeed = (gs.UFOSpeed * Constants.UFOSPEED[cLevel]);
gs.UFO_HP = Constants.UFOHP[cLevel];
gs.UFO_HP_MAX = gs.UFO_HP;
var t2p:Number = Constants.UFOTRAJ2PROB[cLevel];
if (t2p <= 0){
gs.UFOTraj = 1;
} else {
if (t2p >= 1){
gs.UFOTraj = 2;
} else {
gs.UFOTraj = 1;
if (Math.random() < t2p){
gs.UFOTraj = 2;
};
};
};
gs.SetPos(new Point((200 + (Math.random() * (Constants.SCREEN_WIDTH - 400))), -50));
gs.dy = (4 * gs.UFOSpeed);
if (gs.x_ < (Constants.SCREEN_WIDTH_DIV2 - 150)){
gs.dx = -((Math.random() * 2));
} else {
if (gs.x_ > (Constants.SCREEN_WIDTH_DIV2 + 150)){
gs.dx = (Math.random() * 2);
} else {
gs.dx = ((Math.random() - 0.5) * 2);
};
};
if (gs.UFOTraj == 2){
gs.UFO_TrajSpiral_Center.x = gs.x_;
gs.UFO_TrajSpiral_Center.y = gs.y_;
gs.UFO_TrajSpiral_Center_dx = gs.dx;
gs.UFO_TrajSpiral_Center_dy = gs.dy;
gs.UFO_TrajSpiral_Fi = Math.round((Math.random() * 360));
gs.UFO_TrajSpiral_dFi = (0.15 * (1 + (gs.UFOSpeed / 10)));
gs.UFO_TrajSpiral_Radius = (18 + gs.UFOSpeed);
gs.UFO_TrajSpiral_dRadius = 0;
};
gs.doCollision = true;
gs.ForceSetFlashSprite();
gs.UFO_HEALTHBAR = MakeUFOHealthBar(new Point((gs.x_ + Constants.UFO_HP_OffsetX), (gs.y_ + Constants.UFO_HP_OffsetY)), gs.z_);
gs.RedrawUFOHealthBar();
gs.UFO_HEALTHBAR.SetVisible(false);
gs.UFO_HEALTHBAR.ForceSetFlashSprite();
gs.UFO_HEALTHBAR.UFO_HEALTHBARCount = 0;
gs.UFO_PLASMAEFFECT = MakeUFOPlasmaEffect(new Point((gs.x + ((Constants.UFO_PE_OffsetX * gs.Scale_) * Constants.UFO_PE_SCALE)), (gs.y + ((Constants.UFO_PE_OffsetY * gs.Scale_) * Constants.UFO_PE_SCALE))), (gs.Scale_ * Constants.UFO_PE_SCALE));
gs.UFO_PLASMAEFFECT.SetVisible(false);
gs.UFO_PLASMAEFFECT.ForceSetFlashSprite();
return (gs);
}
public function MakeLevelMessage(MessageType:uint):TGameSprite{
var str:String;
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, MessageType, Constants.ZB_LEVELMESSAGE);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 64;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "left";
tf.width = Constants.SCREEN_WIDTH;
tf.selectable = false;
if (MessageType == Constants.GST_LEVELMESSAGE_LEVELXXX){
str = "";
if (LevelNum < 10){
str = "0";
};
tf.text = (("LEVEL " + str) + LevelNum.toString());
} else {
tf.text = Constants.LEVELMESSAGES[(MessageType - Constants.GST_LEVELMESSAGE_LEVELXXX)];
};
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(Constants.LEVELMESSAGES_X[(MessageType - Constants.GST_LEVELMESSAGE_LEVELXXX)], Constants.LEVELMESSAGE_Y));
gs.LM_GO_STARTPOS = gs.GetPos();
gs.Alpha_ = 0;
if (MessageType == Constants.GST_LEVELMESSAGE_READY){
gs.x_ = -350;
gs.dx = 95;
gs.Alpha_ = 1;
};
gs.Stage_ = 0;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePlayerUFOsLeft():TGameSprite{
var tf:TextField = new TextField();
var s:TUFOICON = new TUFOICON();
tf.x = 15;
tf.y = -20;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_PLAYERUFOSLEFT, Constants.ZB_PLAYERPANEL);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 32;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "left";
tf.width = 200;
tf.selectable = false;
tf.text = "";
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(30, 25));
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeAlienTextScore(Text_:String, Pos_:Point):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_ALIENTEXTSCORE, Constants.ZB_ScoreText);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 22;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = Constants.GP_UFOTextColor;
tf.selectable = false;
tf.text = Text_;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.ColorTransform_ = new ColorTransform();
gs.BornByLevel = Object(this);
gs.SetPos(Pos_);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeStatLine(LineNum:int):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_STATLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 25;
gs.TextFormat_.font = "Bimini";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "center";
gs.TextFormat_.kerning = 2;
tf.width = 462;
tf.selectable = false;
if (LineNum == 1){
tf.text = ((Constants.STR_STATLINE1 + UFOShooter1.Player.StatLine1.toString()) + "%");
SpriteEngine_.UFOShooter1.Player.AddScore((UFOShooter1.Player.StatLine1 * 100));
} else {
if (LineNum == 2){
tf.text = (Constants.STR_STATLINE2 + UFOShooter1.Player.StatLine2.toString());
SpriteEngine_.UFOShooter1.Player.AddScore(UFOShooter1.Player.StatLine2);
} else {
if (LineNum == 3){
tf.text = (Constants.STR_STATLINE3 + UFOShooter1.Player.StatLine3.toString());
SpriteEngine_.UFOShooter1.Player.AddScore(UFOShooter1.Player.StatLine3);
};
};
};
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(90, (160 + (32 * LineNum))));
gs.Alpha_ = 1;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponBuyPanel():TGameSprite{
var s:TGUI_FORM7_PANEL = new TGUI_FORM7_PANEL();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONBUYPANEL, Constants.ZB_PLAYERPANEL);
gs.SetPos(new Point(85, 125));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeBoss():TGameSprite{
var gs:TGameSprite;
var BOSS:TBOSS = new TBOSS();
UFOShooter1.GameSpritesMovie.addChild(BOSS);
gs = new TGameSprite(SpriteEngine_, BOSS, new TBOSS_hitArea(), Constants.GST_BOSS, Constants.ZB_BOSS);
gs.ColorTransform_ = new ColorTransform();
gs.BornByLevel = Object(this);
gs.BOSS_HP = (125000 * 0.75);
gs.BOSS_HP_MAX = gs.BOSS_HP;
gs.BOSS_CENTER = new Point(Constants.SCREEN_WIDTH_DIV2, (Constants.SCREEN_HEIGHT_DIV2 - 150));
gs.BOSS_Fi = 0;
gs.BOSS_dFi = 0.05;
gs.BOSS_CriticalStageCount = 210;
gs.BOSS_Radius = 50;
gs.doCollision = true;
(gs.FlashSprite as MovieClip).gotoAndStop(1);
(gs.hitArea as MovieClip).gotoAndStop(1);
gs.ForceSetFlashSprite();
gs.Update(0);
gs.BOSS_HEALTHBAR = MakeBOSS_HealthBar();
return (gs);
}
public function Weapons_Make():void{
var pwi:TPlayerWeaponInfo;
if (UFOShooter1.Player.Weapons.length == 0){
return;
};
var s:int;
var i:int;
while (i < UFOShooter1.Player.Weapons.length) {
s++;
pwi = UFOShooter1.Player.Weapons[i];
if (pwi.WeaponType == Constants.WT_STATICLASER){
MakeStaticLaser(pwi.PosNum, pwi.UpgradeNum);
} else {
if (pwi.WeaponType == Constants.WT_LASERTURRET){
MakeLaserTurret(pwi.PosNum, pwi.UpgradeNum);
} else {
if (pwi.WeaponType == Constants.WT_PLASMACANNON){
MakePlasmaCannon(pwi.PosNum, pwi.UpgradeNum);
} else {
if (pwi.WeaponType == Constants.WT_ROCKETLAUNCHER){
MakeRocketLauncher(pwi.PosNum, pwi.UpgradeNum);
} else {
if (pwi.WeaponType == Constants.WT_ROCKETHEATLAUNCHER){
MakeRocketHeatLauncher(pwi.PosNum, pwi.UpgradeNum);
} else {
if (pwi.WeaponType == Constants.WT_ALIENLAB){
MakeAlienLab(pwi.PosNum, pwi.UpgradeNum);
};
};
};
};
};
};
i++;
};
}
public function MakeStaticLaser(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TStaticLaserL;
var gs:TGameSprite;
var s1:TStaticLaserR;
if ((PosNum % 2) == 1){
s = new TStaticLaserL();
this.UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
} else {
s1 = new TStaticLaserR();
this.UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
};
gs.WeaponType = Constants.WT_STATICLASER;
gs.WeaponPosNum = PosNum;
gs.WeaponUpgradeNum = UpgradeNum;
gs.WeaponIsLR = ((PosNum % 2) == 1);
var Pos:Point = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
gs.SetPos(Pos);
gs.WeaponBulletPos = new Point((Pos.x + 58), (Pos.y + 3));
if (!gs.WeaponIsLR){
gs.WeaponBulletPos = new Point(Pos.x, (Pos.y + 3));
};
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeStatPanel():TGameSprite{
var tf:TextField = new TextField();
var s:TGUI_FORM3_PANEL = new TGUI_FORM3_PANEL();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_STATPANEL, Constants.ZB_PLAYERPANEL);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 48;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "center";
tf.width = 462;
tf.selectable = false;
tf.text = "STATISTICS";
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(100, 125));
gs.Alpha_ = 0;
gs.ForceSetFlashSprite();
return (gs);
}
public function CheckinGameButtons():void{
var MenuButton:TGUI_FORM2_MENU;
var SoundButtonOn:TGUI_FORM2_SOUNDON;
var SoundButtonOff:TGUI_FORM2_SOUNDOFF;
var QualityHI:TGUI_FORM2_QHI;
var QualityMED:TGUI_FORM2_QMED;
var QualityLOW:TGUI_FORM2_QLOW;
var tb:DebugButton;
if (LevelNum <= 0){
return;
};
if (UFOShooter1.Player.MenuButton == null){
MenuButton = new TGUI_FORM2_MENU();
UFOShooter1.Player.MenuButton = MenuButton;
MenuButton.x = -2;
MenuButton.y = 458;
SoundButtonOn = new TGUI_FORM2_SOUNDON();
UFOShooter1.Player.SoundButtonOn = SoundButtonOn;
SoundButtonOn.x = 586;
SoundButtonOn.y = 458;
SoundButtonOff = new TGUI_FORM2_SOUNDOFF();
UFOShooter1.Player.SoundButtonOff = SoundButtonOff;
SoundButtonOff.x = 586;
SoundButtonOff.y = 458;
QualityHI = new TGUI_FORM2_QHI();
UFOShooter1.Player.QualityButtonHI = QualityHI;
QualityHI.x = 582;
QualityHI.y = 432;
QualityMED = new TGUI_FORM2_QMED();
UFOShooter1.Player.QualityButtonMED = QualityMED;
QualityMED.x = 582;
QualityMED.y = 432;
QualityLOW = new TGUI_FORM2_QLOW();
UFOShooter1.Player.QualityButtonLOW = QualityLOW;
QualityLOW.x = 582;
QualityLOW.y = 432;
};
if (((isPlayable()) || ((LevelNum == Constants.BOSS_LevelNum)))){
UFOShooter1.Player.MenuButton.x = -2;
} else {
UFOShooter1.Player.MenuButton.x = (-2 - 1000);
};
if (UFOShooter1.SoundEngine.isMuted){
UFOShooter1.Player.SoundButtonOff.x = 586;
UFOShooter1.Player.SoundButtonOn.x = (UFOShooter1.Player.SoundButtonOff.x + 1000);
} else {
UFOShooter1.Player.SoundButtonOn.x = 586;
UFOShooter1.Player.SoundButtonOff.x = (UFOShooter1.Player.SoundButtonOn.x + 1000);
};
if (UFOShooter.main.Player.Quality == StageQuality.LOW){
UFOShooter1.Player.QualityButtonLOW.x = 582;
UFOShooter1.Player.QualityButtonMED.x = (UFOShooter1.Player.QualityButtonLOW.x + 1000);
UFOShooter1.Player.QualityButtonHI.x = (UFOShooter1.Player.QualityButtonLOW.x + 1000);
} else {
if (UFOShooter.main.Player.Quality == StageQuality.MEDIUM){
UFOShooter1.Player.QualityButtonMED.x = 582;
UFOShooter1.Player.QualityButtonLOW.x = (UFOShooter1.Player.QualityButtonMED.x + 1000);
UFOShooter1.Player.QualityButtonHI.x = (UFOShooter1.Player.QualityButtonMED.x + 1000);
} else {
UFOShooter1.Player.QualityButtonHI.x = 582;
UFOShooter1.Player.QualityButtonLOW.x = (UFOShooter1.Player.QualityButtonHI.x + 1000);
UFOShooter1.Player.QualityButtonMED.x = (UFOShooter1.Player.QualityButtonHI.x + 1000);
};
};
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.MenuButton);
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.SoundButtonOn);
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.SoundButtonOff);
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.QualityButtonHI);
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.QualityButtonMED);
UFOShooter1.GUIMovie.addChild(UFOShooter1.Player.QualityButtonLOW);
if (((Constants.USE_DEBUG) && (Constants.USE_DEBUG_SHOWDEBUGBUTTON))){
tb = new DebugButton();
tb.x = 582;
tb.y = 370;
UFOShooter1.GUIMovie.addChild(tb);
};
}
public function MakeLaserTurret(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TLaserTurretL;
var gs:TGameSprite;
var s1:TLaserTurretR;
if ((PosNum % 2) == 1){
s = new TLaserTurretL();
this.UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
} else {
s1 = new TLaserTurretR();
this.UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
};
gs.WeaponType = Constants.WT_LASERTURRET;
gs.WeaponPosNum = PosNum;
gs.WeaponUpgradeNum = UpgradeNum;
gs.WeaponIsLR = ((PosNum % 2) == 1);
var Pos:Point = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
gs.SetPos(Pos);
gs.WeaponBulletPos = new Point(Pos.x, (Pos.y - 1));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFOExplode(Pos:Point, Scale:Number):TGameSprite{
var s:TUFOEXPLODE = new TUFOEXPLODE();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_UFOEXPLODE, (Constants.ZB_UFO - 1));
gs.BlendMode_ = BlendMode.ADD;
gs.Scale_ = Scale;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFOPlasmaEffect(Pos:Point, Scale:Number):TGameSprite{
var s:TUFOPLASMAEFFECT = new TUFOPLASMAEFFECT();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_UFOPLASMAEFFECT, (Constants.ZB_UFO + 1));
(gs.FlashSprite as MovieClip).gotoAndStop((1 + Math.round((Math.random() * 19))));
gs.BlendMode_ = BlendMode.ADD;
gs.Scale_ = Scale;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeBOSS_HealthBar():TGameSprite{
var gs:TGameSprite;
var s:Sprite = new Sprite();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_BOSS_HP, Constants.ZB_BOSS_HP);
gs.ColorTransform_ = new ColorTransform();
gs.BornByLevel = Object(this);
gs.SetPos(new Point(175, 18));
gs.ForceSetFlashSprite();
gs.RedrawBOSSHealthBar(100);
return (gs);
}
public function MakeUFOTextScore(Text_:String, Pos_:Point):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_UFOTEXTSCORE, Constants.ZB_ScoreText);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 22;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = Constants.GP_UFOTextColor;
tf.selectable = false;
tf.text = Text_;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.doCollision = false;
gs.BornByLevel = Object(this);
gs.SetPos(Pos_);
gs.ForceSetFlashSprite();
return (gs);
}
public function ResumeLevel():void{
fisPause = false;
}
public function MakeWeaponBuyInfo(WeaponType:uint):void{
var gs1:TGameSprite;
var gs2:TGameSprite;
var gs3:TGameSprite;
var gs4:TGameSprite;
var CostColor:uint = 4294967210;
var StartYPos:Number = 130;
if (UFOShooter1.Player.Cash < Constants.COST_WEAPON[(WeaponType - 1)]){
CostColor = 4294919236;
};
var gs:TGameSprite = MakeWeaponBuyInfoLine("BIMINI", new Point(90, StartYPos), Constants.WEAPONNAMEBYTYPE[(WeaponType - 1)], 462, 30, 4294967210, "center");
gs1 = MakeWeaponBuyInfoLine("BIMINI", new Point(313, (StartYPos + 60)), ("COST:" + Constants.COST_WEAPON[(WeaponType - 1)]), 250, 16, CostColor, "left");
var Damage:uint;
var FireRate:uint;
var Speed:uint;
if (WeaponType == Constants.WT_ALIENLAB){
Speed = Constants.UPGRADE_ALIENLAB_SPEED[0];
gs1 = MakeWeaponBuyInfoLine("BIMINI", new Point(313, (StartYPos + 100)), ("SPEED:" + Speed.toString()), 250, 16, 4294967210, "left");
} else {
if (WeaponType == Constants.WT_MAINGUN){
Damage = UFOShooter1.Player.GetDamageByWTUN(WeaponType, 1);
gs2 = MakeWeaponBuyInfoLine("BIMINI", new Point(313, (StartYPos + 100)), ("DAMAGE:" + Damage.toString()), 250, 16, 4294967210, "left");
} else {
Damage = UFOShooter1.Player.GetDamageByWTUN(WeaponType, 1);
FireRate = UFOShooter1.Player.GetFireRateByWTUN(WeaponType, 1);
gs3 = MakeWeaponBuyInfoLine("BIMINI", new Point(313, (StartYPos + 100)), ("DAMAGE:" + Damage.toString()), 250, 16, 4294967210, "left");
gs4 = MakeWeaponBuyInfoLine("BIMINI", new Point(313, (StartYPos + 140)), ("FIRE RATE:" + FireRate.toString()), 250, 16, 4294967210, "left");
};
};
var wi:TGameSprite = MakeWeaponInfoMovie(new Point(100, (StartYPos + 50)), WeaponType, SpriteEngine_.UFOShooter1.Player.WeaponInfoMovieFrame);
}
public function MakeBossExplosion(BossCenter:Point):TGameSprite{
var s:TUFOEXPLODE = new TUFOEXPLODE();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_UFOEXPLODE, (Constants.ZB_BOSS + 1));
gs.BlendMode_ = BlendMode.ADD;
gs.BornByLevel = Object(this);
gs.Scale_ = (2 + Math.random());
var NewPos:Point = new Point(((BossCenter.x - 115) + (Math.random() * 230)), ((BossCenter.y - 130) + (Math.random() * 260)));
gs.SetPos(NewPos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePostScoresLine(Text:String, Pos:Point, FontName:String, FontColor:uint, FontSize:int, FontAlign:String, FieldWidth:int, FontKerning:int):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_POSTSCORESLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = FontSize;
gs.TextFormat_.font = FontName;
gs.TextFormat_.color = FontColor;
gs.TextFormat_.align = FontAlign;
gs.TextFormat_.kerning = FontKerning;
tf.width = FieldWidth;
tf.multiline = false;
tf.selectable = false;
tf.text = Text;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.Alpha_ = 1;
gs.SetPos(Pos);
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFO_HelpScreen():TGameSprite{
var gs:TGameSprite = MakeUFO(Math.round((1 + (Math.random() * 2))));
gs.SetPos(new Point(0, (50 + Math.round((Math.random() * 350)))));
gs.dy = 0;
gs.dx = (15 + (Math.random() * 2));
gs.UFOTraj = 1;
gs.ForceSetFlashSprite();
return (gs);
}
public function UpdateUFOBorn(Speed:Number=1):void{
var gs:TGameSprite;
var cLevel:int = (UFOShooter1.Player.LevelNum - Constants.MinPlayableLevelNum);
if (isPlayable()){
cLevel = (LevelNum - Constants.MinPlayableLevelNum);
};
UFO_BornCount = (UFO_BornCount + Speed);
if (UFO_NextBorn == 0){
UFO_NextBorn = (Constants.UFONEXTBORNPERIOD[cLevel] + (Math.random() * Constants.UFONEXTBORNPERIODRND[cLevel]));
};
if (UFO_BornCount >= UFO_NextBorn){
gs = MakeUFO(Math.round((1 + (Math.random() * 2))), Speed);
gs.ForceSetFlashSprite();
UFO_BornCount = 0;
UFO_NextBorn = (Constants.UFONEXTBORNPERIOD[cLevel] + (Math.random() * Constants.UFONEXTBORNPERIODRND[cLevel]));
UFOLEFT2BORN = (UFOLEFT2BORN - 1);
};
}
public function MakePostScoresInputField():TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_POSTSCORESLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 32;
gs.TextFormat_.font = "Bimini";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "center";
gs.TextFormat_.kerning = 2;
tf.type = TextFieldType.INPUT;
tf.width = 440;
tf.height = 40;
tf.multiline = false;
tf.text = ("HERO #" + Math.round((1 + (Math.random() * 999))).toString());
tf.border = true;
tf.borderColor = 4279650432;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.Alpha_ = 1;
gs.SetPos(new Point(95, 200));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFO_GameComplete():TGameSprite{
var gs:TGameSprite = MakeUFO(Math.round((1 + (Math.random() * 2))));
gs.SetPos(new Point(0, (200 + Math.round((Math.random() * 200)))));
gs.Scale_ = 0.1;
gs.dScale = 0.01;
gs.isGCUFO = true;
gs.dy = -((2 + (Math.random() * 2)));
gs.dx = (12 + (Math.random() * 2));
gs.UFOTraj = 1;
gs.ForceSetFlashSprite();
if (UFOShooter.main.Player.VictorySprite != null){
UFOShooter.main.Player.VictorySprite.Scale_ = 1.5;
};
return (gs);
}
public function Start():void{
var cmd:TGameCommand;
var f1:TGUI_FORM1;
var gcOK:TGUI_FORM6_OK;
var gsUFOBOSS:TGameSprite;
trace(((("TGameLevel.Start: LevelNum=" + LevelNum.toString()) + " LevelSubNum=") + LevelSubNum.toString()));
if (isPlayable()){
UFOShooter1.Player.PlayerUFOsLeft = MakePlayerUFOsLeft();
UFOShooter1.Player.PlayerCash = MakePlayerCash();
UFOShooter1.Player.PlayerScore = MakePlayerScore();
UFOLEFT2BORN = Constants.UFOLEFT2BORN[(LevelNum - Constants.MinPlayableLevelNum)];
UFOShooter1.Earth = MakeEarth();
UFOShooter1.Player.NewLevel();
ChangeLevelState(Constants.LS_LEVELXXREADYGO);
cmd = UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(this));
cmd.UInt_Param1 = Constants.GST_LEVELMESSAGE_LEVELXXX;
cmd.Ticks = 30;
Weapons_Make();
UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
} else {
if (LevelNum == Constants.MM_LevelNum){
ChangeLevelState(Constants.LS_PLAY);
f1 = new TGUI_FORM1();
f1.x = 400;
f1.y = 200;
UFOShooter1.GUIMovie.addChild(f1);
UFOShooter1.SoundEngine.PlayStream("MenuMusic");
} else {
if (LevelNum == Constants.PS_LevelNum){
UFOShooter1.SoundEngine.PlayStream("MenuMusic");
ChangeLevelState(Constants.LS_PLAY);
GamezheroApi.score((UFOShooter1 as MovieClip), "154198208149173156203162164085153154160219163212169148200158171166175195205158204158216147163154149160152153165", UFOShooter1.Player.Score, 170, 100, SubmitProc, SubmitProc, SubmitProc);
} else {
if (LevelNum == Constants.WS_LevelNum){
ChangeLevelState(Constants.LS_PLAY);
UFOShooter1.Player.PlayerCash = MakePlayerCash();
UFOShooter1.Player.PlayerScore = MakePlayerScore();
WorkShop_Start();
Weapons_Make();
UFOShooter1.SoundEngine.PlayStream("MenuMusic");
} else {
if (LevelNum == Constants.GC_LevelNum){
ChangeLevelState(Constants.LS_PLAY);
gcOK = new TGUI_FORM6_OK();
gcOK.x = 265;
gcOK.y = 440;
UFOShooter1.GUIMovie.addChild(gcOK);
UFOShooter.main.Player.VictorySprite = MakeWinnerMessage();
} else {
if (LevelNum == Constants.HELP_LevelNum){
UFO_NextBorn = 50;
UFOShooter1.Player.PlayerScore = MakePlayerScore();
UFOShooter1.Player.PlayerUFOsLeft = MakePlayerUFOsLeft();
UFOShooter1.Player.PlayerCash = MakePlayerCash();
UFOShooter1.Player.AddUFOsLeft(0);
} else {
if (LevelNum == Constants.BOSS_LevelNum){
UFOShooter1.Player.PlayerScore = MakePlayerScore();
UFOShooter1.Player.PlayerUFOsLeft = MakePlayerUFOsLeft();
gsUFOBOSS = MakeBoss();
UFOShooter1.Player.NewLevel();
ChangeLevelState(Constants.LS_LEVELXXREADYGO);
cmd = UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(this));
cmd.UInt_Param1 = Constants.GST_LEVELMESSAGE_LEVELXXX;
cmd.Ticks = 30;
Weapons_Make();
UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
} else {
if (LevelNum == Constants.ID_LevelNum){
UFO_NextBorn = 50;
UFOShooter1.Player.AddUFOsLeft(0);
UFOShooter1.SoundEngine.PlayStream("MenuMusic");
} else {
if (LevelNum == Constants.SS_LevelNum){
trace("Try show leaderboard...");
if (((MochiServices.connected) && (!((MochiServices.clip == null))))){
trace("ShowLeaderboard started...");
UFOShooter.main.GUIMovie.addChild(MochiServices.clip);
MochiScores.showLeaderboard({boardID:"10ccd2ee50961f56"});
};
};
};
};
};
};
};
};
};
};
CheckinGameButtons();
}
public function GetLevelState():uint{
return (fLevelState);
}
public function MakeLaserExplode(isLR:Boolean, Pos:Point, Scale:Number):TGameSprite{
var s:TLaserExplode = new TLaserExplode();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_LASEREXPLODE, (Constants.ZB_UFO - 1));
gs.BlendMode_ = BlendMode.ADD;
gs.Scale_ = Scale;
gs.BornByLevel = Object(this);
var NewPos:Point = new Point(Pos.x, Pos.y);
if (isLR){
NewPos.x = (NewPos.x + (15 * Scale));
} else {
gs.Rotation_ = 180;
};
gs.SetPos(NewPos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponBuyInfoLine(FontName:String, Pos:Point, Text:String, width:int, size:int, color:uint, align:String):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONBUYINFOLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = size;
gs.TextFormat_.font = FontName;
gs.TextFormat_.color = color;
gs.TextFormat_.align = align;
tf.width = width;
tf.selectable = false;
tf.text = Text;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFOJustBornByBoss(NewPos:Point):TGameSprite{
var gs:TGameSprite = MakeUFO(Math.round((1 + (Math.random() * 2))));
gs.UFO_HP = (((350 * 4) + 110) * 0.75);
gs.UFO_HP_MAX = gs.UFO_HP;
gs.RedrawUFOHealthBar();
gs.isBossChild = true;
gs.SetPos(NewPos);
gs.isUFOJustBornByBoss = true;
gs.Scale_ = 0.25;
gs.dScale = 0.025;
gs.dx = 0;
gs.dy = 2;
gs.dx = (-0.5 + Math.random());
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePlayerScore():TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_PLAYERSCORE, Constants.ZB_PLAYERPANEL);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 32;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "right";
tf.width = 200;
tf.selectable = false;
tf.text = (Constants.STR_PLAYERSCORE + UFOShooter1.Player.Score.toString());
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(435, 5));
gs.ForceSetFlashSprite();
return (gs);
}
public function PauseLevel():void{
fisPause = true;
}
public function SubmitProc():void{
UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
UFOShooter1.ChangeGameLevel(Constants.MM_LevelNum);
}
public function WorkShop_Start(PageNum:int=1):void{
var ab:TGUI_FORM5_ACTIVATE;
var pb:TGUI_FORM5_PLAY;
var i:int;
var PosNum:int;
var pwi:TPlayerWeaponInfo;
var wb1b:TGUI_FORM5_WEAPONBUY;
var wusb1:TGUI_FORM5_WEAPONUPGRADE;
var alb1b:TGUI_FORM5_ALIENLABBUY;
var alu1b:TGUI_FORM5_WEAPONUPGRADE;
var mgu1b:TGUI_FORM5_MAINGUNUPGRADE;
var dab:TGUI_FORM5_DEACTIVATE;
var tub:TGUI_FORM5_UFOTEST;
if (PageNum == 1){
ab = new TGUI_FORM5_ACTIVATE();
ab.x = 120;
ab.y = 435;
UFOShooter1.GUIMovie.addChild(ab);
ab.name = "TGUI_FORM5_ACTIVATE";
pb = new TGUI_FORM5_PLAY();
pb.x = 350;
pb.y = 435;
UFOShooter1.GUIMovie.addChild(pb);
pb.name = "TGUI_FORM5_PLAY";
i = -1;
PosNum = 0;
while (PosNum <= 8) {
i = UFOShooter1.Player.GetWeaponIndexByPosNum(PosNum);
pwi = null;
if ((((((PosNum > 0)) && ((PosNum <= 6)))) && ((i == -1)))){
pwi = UFOShooter1.Player.Weapons[i];
wb1b = new TGUI_FORM5_WEAPONBUY();
wb1b.x = Constants.WEAPONBUYPOSNUMX[(PosNum - 1)];
wb1b.y = Constants.WEAPONBUYPOSNUMY[(PosNum - 1)];
UFOShooter1.GUIMovie.addChild(wb1b);
wb1b.name = ("TGUI_FORM5_WEAPONBUY" + PosNum);
} else {
if ((((((PosNum > 0)) && ((PosNum <= 6)))) && (!((i == -1))))){
pwi = UFOShooter1.Player.Weapons[i];
wusb1 = new TGUI_FORM5_WEAPONUPGRADE();
wusb1.x = Constants.WEAPONUPGRADESELLPOSNUMX[(PosNum - 1)];
wusb1.y = Constants.WEAPONUPGRADESELLPOSNUMY[(PosNum - 1)];
UFOShooter1.GUIMovie.addChild(wusb1);
wusb1.name = ("TGUI_FORM5_WEAPONUPGRADE" + PosNum);
} else {
if ((((PosNum == 7)) && ((i == -1)))){
alb1b = new TGUI_FORM5_ALIENLABBUY();
alb1b.x = 225;
alb1b.y = 148;
UFOShooter1.GUIMovie.addChild(alb1b);
alb1b.name = ("TGUI_FORM5_WEAPONBUY" + PosNum);
} else {
if ((((PosNum == 7)) && (!((i == -1))))){
alu1b = new TGUI_FORM5_WEAPONUPGRADE();
alu1b.x = 225;
alu1b.y = 149;
UFOShooter1.GUIMovie.addChild(alu1b);
alu1b.name = ("TGUI_FORM5_WEAPONUPGRADE" + PosNum);
} else {
if ((((PosNum == 8)) && ((i == -1)))){
alb1b = new TGUI_FORM5_ALIENLABBUY();
alb1b.x = 295;
alb1b.y = 270;
UFOShooter1.GUIMovie.addChild(alb1b);
alb1b.name = ("TGUI_FORM5_WEAPONBUY" + PosNum);
} else {
if ((((PosNum == 8)) && (!((i == -1))))){
alu1b = new TGUI_FORM5_WEAPONUPGRADE();
alu1b.x = 295;
alu1b.y = 265;
UFOShooter1.GUIMovie.addChild(alu1b);
alu1b.name = ("TGUI_FORM5_WEAPONUPGRADE" + PosNum);
} else {
if (PosNum == 0){
mgu1b = new TGUI_FORM5_MAINGUNUPGRADE();
mgu1b.x = 225;
mgu1b.y = 210;
UFOShooter1.GUIMovie.addChild(mgu1b);
mgu1b.name = ("TGUI_FORM5_WEAPONUPGRADE" + PosNum);
};
};
};
};
};
};
};
PosNum++;
};
} else {
dab = new TGUI_FORM5_DEACTIVATE();
dab.x = 120;
dab.y = 435;
UFOShooter1.GUIMovie.addChild(dab);
dab.name = "TGUI_FORM5_DEACTIVATE";
tub = new TGUI_FORM5_UFOTEST();
tub.x = 350;
tub.y = 435;
UFOShooter1.GUIMovie.addChild(tub);
tub.name = "TGUI_FORM5_UFOTEST";
};
}
public function MakeRocketHeatLauncher(PosNum:uint, UpgradeNum:uint=1):TGameSprite{
var s:TRocketHeatLauncherL;
var gs:TGameSprite;
var Pos:Point;
var s1:TRocketHeatLauncherR;
if ((PosNum % 2) == 1){
s = new TRocketHeatLauncherL();
this.UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
Pos = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
gs.SetPos(Pos);
gs.WeaponBulletPos = new Point((Pos.x - 20), (Pos.y + 5));
} else {
s1 = new TRocketHeatLauncherR();
this.UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPON, Constants.ZB_WEAPON);
Pos = new Point(Constants.WEAPONPOSNUMX[(PosNum - 1)], Constants.WEAPONPOSNUMY[(PosNum - 1)]);
gs.SetPos(Pos);
gs.WeaponBulletPos = new Point((Pos.x + 20), (Pos.y - 5));
};
gs.WeaponType = Constants.WT_ROCKETHEATLAUNCHER;
gs.WeaponPosNum = PosNum;
gs.WeaponUpgradeNum = UpgradeNum;
gs.WeaponIsLR = ((PosNum % 2) == 1);
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponUpgradeSellInfoLine(FontName:String, Pos:Point, Text:String, width:int, size:int, color:uint, align:String):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONUPGRADESELLINFOLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = size;
gs.TextFormat_.font = FontName;
gs.TextFormat_.color = color;
gs.TextFormat_.align = align;
tf.width = width;
tf.selectable = false;
tf.text = Text;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.SetPos(Pos);
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function isPlayable():Boolean{
return ((((LevelNum >= Constants.MinPlayableLevelNum)) && ((LevelNum <= Constants.MaxPlayableLevelNum))));
}
public function MakeAlien(Pos:Point, Color_:int, Speed_:Number=1):TGameSprite{
var ALIEN1:TAlien1;
var ALIEN2:TAlien2;
var ALIEN3:TAlien3;
var ALIEN4:TAlien4;
var gs:TGameSprite;
if (Color_ == 1){
ALIEN1 = new TAlien1();
UFOShooter1.GameSpritesMovie.addChild(ALIEN1);
gs = new TGameSprite(SpriteEngine_, ALIEN1, new TAlien_hitArea(), Constants.GST_ALIEN, Constants.ZB_ALIEN);
} else {
if (Color_ == 2){
ALIEN2 = new TAlien2();
UFOShooter1.GameSpritesMovie.addChild(ALIEN2);
gs = new TGameSprite(SpriteEngine_, ALIEN2, new TAlien_hitArea(), Constants.GST_ALIEN, Constants.ZB_ALIEN);
} else {
if (Color_ == 3){
ALIEN3 = new TAlien3();
UFOShooter1.GameSpritesMovie.addChild(ALIEN3);
gs = new TGameSprite(SpriteEngine_, ALIEN3, new TAlien_hitArea(), Constants.GST_ALIEN, Constants.ZB_ALIEN);
} else {
ALIEN4 = new TAlien4();
UFOShooter1.GameSpritesMovie.addChild(ALIEN4);
gs = new TGameSprite(SpriteEngine_, ALIEN4, new TAlien_hitArea(), Constants.GST_ALIEN, Constants.ZB_ALIEN);
};
};
};
if (Math.random() > 0.5){
gs.dRotation = 5;
} else {
gs.dRotation = -5;
};
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function Destroy():void{
var len:int;
var gc:TGameSprite;
var i:int;
if (UFOShooter1 != null){
len = this.SpriteEngine_.Items.length;
i = 0;
while (i < len) {
gc = SpriteEngine_.Items[i];
if (TGameLevel(gc.BornByLevel) == this){
gc.Dead();
};
i++;
};
UFOShooter1.CommandProcessor.DestroyByGameLevel(Object(this));
};
}
public function MakeCrossHair():TGameSprite{
var CrossHair:TCrosshair = new TCrosshair();
UFOShooter1.GameSpritesMovie.addChild(CrossHair);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, CrossHair, null, Constants.GST_CROSSHAIR, Constants.ZB_Cross);
gs.BornByLevel = null;
gs.SetVisible(false);
gs.SetPos(new Point((UFOShooter1.mouseX - 14), (UFOShooter1.mouseX - 12)));
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeEarth():TGameSprite{
var E:TEARTH = new TEARTH();
UFOShooter1.GameSpritesMovie.addChild(E);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, E, new TEARTH_hitArea(), Constants.GST_EARTH, Constants.ZB_Earth);
gs.BornByLevel = Object(this);
gs.EARTH_CENTER = new Point(Constants.SCREEN_WIDTH_DIV2, (Constants.SCREEN_HEIGHT - 10));
gs.EARTH_Fi = (Math.random() * 360);
gs.EARTH_dFi = (0.01 + (Math.random() / 100));
if (Math.random() > 0.5){
gs.EARTH_dFi = -(gs.EARTH_dFi);
};
gs.EARTH_Radius = 20;
gs.Update(1);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function ChangeLevelState(NewLevelState:uint):void{
trace(((("TGameLevel.ChangeLevelState: fLevelState=" + fLevelState.toString()) + " NewLevelState=") + NewLevelState.toString()));
fLevelState = NewLevelState;
}
public function MakeWeaponUpgradeSellInfo():void{
var colorNormal:uint;
var colorGreen:uint;
var colorRed:uint;
var StartXPos:Number;
var StartYPos:Number;
var pwi:TPlayerWeaponInfo;
var wtStr:String;
var gs:TGameSprite;
var upgStr:String;
var upgColor:uint;
var upgCost:uint;
var upgCostStr:String;
var upgCostColor:uint;
var Damage:int;
var DamageNext:int;
var DamageStr:String;
var FireRate:int;
var FireRateNext:int;
var FireRateStr:String;
var wi:TGameSprite;
var Speed:int;
var SpeedNext:int;
var SpeedStr:String;
var i:int = UFOShooter1.Player.GetWeaponIndexByPosNum(UFOShooter1.Player.WeaponUpgradeSellPosNum);
if (i != -1){
colorNormal = 4294967210;
colorGreen = 4281597747;
colorRed = 4294919236;
StartXPos = 325;
StartYPos = 130;
pwi = UFOShooter1.Player.Weapons[i];
wtStr = Constants.WEAPONNAMEBYTYPE[(pwi.WeaponType - 1)];
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(175, StartYPos), wtStr, 300, 30, colorNormal, "center");
upgStr = ((("UPGRADE " + pwi.UpgradeNum) + "/") + Constants.UPGRADE_MAX);
upgColor = colorNormal;
if (pwi.UpgradeNum >= Constants.UPGRADE_MAX){
upgColor = colorGreen;
};
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(175, (StartYPos + 30)), upgStr, 300, 20, upgColor, "center");
upgCost = 0;
upgCostStr = "";
upgCostColor = colorNormal;
if (pwi.UpgradeNum < Constants.UPGRADE_MAX){
upgCost = UFOShooter1.Player.GetCostUpgradeByWTUN(pwi.WeaponType, (pwi.UpgradeNum + 1));
if (upgCost > UFOShooter1.Player.Cash){
upgCostColor = colorRed;
};
upgCostStr = ("UPGRADE COST: " + upgCost.toString());
} else {
upgCostStr = "UPGRADE COST: N/A";
};
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(StartXPos, (StartYPos + 75)), upgCostStr, 300, 16, upgCostColor, "left");
Damage = 0;
DamageNext = 0;
DamageStr = "";
if (pwi.UpgradeNum < Constants.UPGRADE_MAX){
Damage = UFOShooter1.Player.GetDamageByWTUN(pwi.WeaponType, pwi.UpgradeNum);
DamageNext = UFOShooter1.Player.GetDamageByWTUN(pwi.WeaponType, (pwi.UpgradeNum + 1));
DamageStr = (((("DAMAGE: " + Damage.toString()) + " (") + DamageNext.toString()) + ")");
} else {
Damage = UFOShooter1.Player.GetDamageByWTUN(pwi.WeaponType, pwi.UpgradeNum);
DamageStr = ("DAMAGE: " + Damage.toString());
};
if (pwi.WeaponType == Constants.WT_ALIENLAB){
Speed = Constants.UPGRADE_ALIENLAB_SPEED[(pwi.UpgradeNum - 1)];
SpeedNext = Speed;
SpeedStr = "";
if (pwi.UpgradeNum < Constants.UPGRADE_MAX){
SpeedNext = Constants.UPGRADE_ALIENLAB_SPEED[pwi.UpgradeNum];
SpeedStr = (((("SPEED:" + Speed.toString()) + " (") + SpeedNext.toString()) + ")");
} else {
SpeedStr = ("SPEED:" + Speed.toString());
};
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(StartXPos, (StartYPos + 115)), SpeedStr, 320, 16, colorNormal, "left");
} else {
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(StartXPos, (StartYPos + 115)), DamageStr, 320, 16, colorNormal, "left");
};
FireRate = 0;
FireRateNext = 0;
FireRateStr = "";
if (pwi.UpgradeNum < Constants.UPGRADE_MAX){
FireRate = UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, pwi.UpgradeNum);
FireRate = UFOShooter1.Player.ConvertFireRate(UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, 1), FireRate);
FireRateNext = UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, (pwi.UpgradeNum + 1));
FireRateNext = UFOShooter1.Player.ConvertFireRate(UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, 1), FireRateNext);
FireRateStr = (((("FIRERATE: " + FireRate.toString()) + " (") + FireRateNext.toString()) + ")");
} else {
FireRate = UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, pwi.UpgradeNum);
FireRate = UFOShooter1.Player.ConvertFireRate(UFOShooter1.Player.GetFireRateByWTUN(pwi.WeaponType, 1), FireRate);
FireRateStr = ("FIRERATE: " + FireRate.toString());
};
if (((!((pwi.WeaponType == Constants.WT_ALIENLAB))) && (!((pwi.WeaponType == Constants.WT_MAINGUN))))){
gs = MakeWeaponUpgradeSellInfoLine("Bimini", new Point(StartXPos, (StartYPos + 155)), FireRateStr, 320, 16, colorNormal, "left");
};
wi = MakeWeaponInfoMovie(new Point(105, (StartYPos + 60)), pwi.WeaponType, this.SpriteEngine_.UFOShooter1.Player.WeaponInfoMovieFrame);
};
}
public function MakeWinnerMessage():TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_VICTORYMESSAGE, Constants.ZB_LEVELMESSAGE);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 64;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "center";
tf.width = Constants.SCREEN_WIDTH;
tf.selectable = false;
tf.text = "VICTORY!";
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.ColorTransform_ = new ColorTransform();
gs.SetPos(new Point(-210, 0));
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePlayerCash():TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
s.x = 0;
s.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_PLAYERCASH, Constants.ZB_PLAYERPANEL);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = 32;
gs.TextFormat_.font = "DS NOTE";
gs.TextFormat_.color = 4294967210;
gs.TextFormat_.align = "center";
tf.width = 185;
tf.selectable = false;
tf.text = (Constants.STR_PLAYERCASH + UFOShooter1.Player.Cash.toString());
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.BornByLevel = Object(this);
gs.SetPos(new Point(225, 5));
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponSellQInfo():void{
var colorNormal:uint;
var colorGreen:uint;
var colorRed:uint;
var StartYPos:Number;
var pwi:TPlayerWeaponInfo;
var wtStr:String;
var upgStr:String;
var sellforStr:String;
var upgColor:uint;
var gs:TGameSprite;
var gs1:TGameSprite;
var i:int = UFOShooter1.Player.GetWeaponIndexByPosNum(UFOShooter1.Player.WeaponUpgradeSellPosNum);
if (i != -1){
colorNormal = 4294967210;
colorGreen = 4281597747;
colorRed = 4294919236;
StartYPos = 130;
pwi = UFOShooter1.Player.Weapons[i];
wtStr = Constants.WEAPONNAMEBYTYPE[(pwi.WeaponType - 1)];
upgStr = ((("UPGRADE " + pwi.UpgradeNum) + "/") + Constants.UPGRADE_MAX);
sellforStr = (("SELL FOR " + Math.round((pwi.TotalCost * Constants.SELL_PROC))) + "?");
upgColor = colorNormal;
if (pwi.UpgradeNum >= Constants.UPGRADE_MAX){
upgColor = colorGreen;
};
gs = MakeWeaponSellQInfoLine("Bimini", new Point(175, StartYPos), wtStr, 300, 30, 4294967210, "center");
gs = MakeWeaponSellQInfoLine("Bimini", new Point(175, (StartYPos + 30)), upgStr, 300, 20, upgColor, "center");
gs1 = MakeWeaponSellQInfoLine("Bimini", new Point(175, (StartYPos + 85)), sellforStr, 300, 24, 4294967210, "center");
};
}
public function MakeRocketLauncherBullet(isLR:Boolean, Pos:Point, BulletDamage:int):TGameSprite{
var gs:TGameSprite;
var s:TRocketLauncherBulletLR;
var s1:TRocketLauncherBulletRL;
if (isLR){
s = new TRocketLauncherBulletLR();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, new TRocketLauncherBullet_hitArea(), Constants.GST_ROCKETLAUNCHERBULLET, Constants.ZB_WEAPONBULLETS);
gs.dx = 3;
} else {
s1 = new TRocketLauncherBulletRL();
UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, new TRocketLauncherBullet_hitArea(), Constants.GST_ROCKETLAUNCHERBULLET, Constants.ZB_WEAPONBULLETS);
gs.dx = -3;
};
gs.Scale_ = 1.5;
gs.BulletDamage = BulletDamage;
gs.WeaponIsLR = isLR;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeUFOHealthBar(Pos:Point, Z:uint):TGameSprite{
var s:TUFOHBMovie = new TUFOHBMovie();
this.UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_UFOHEALTHBAR, Z);
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.ForceSetFlashSprite();
return (gs);
}
public function Update(Speed:Number=1):void{
var gs:TGameSprite;
if (((isPlayable()) && ((fLevelState == Constants.LS_PLAY)))){
if (UFOLEFT2BORN > 0){
UpdateUFOBorn(Speed);
};
} else {
if (((isPlayable()) && ((fLevelState == Constants.LS_YOULOSE)))){
UFO_BornCount = (UFO_BornCount + Speed);
if (UFO_BornCount >= UFO_NextBorn){
gs = MakeUFO(Math.round((1 + (Math.random() * 2))), (Speed * Constants.YOULOSE_UFOSPEEDBURST));
gs.ForceSetFlashSprite();
UFO_BornCount = 0;
UFO_NextBorn = Constants.YOULOSE_UFONEXTBORN;
};
} else {
if ((((LevelNum == Constants.HELP_LevelNum)) || ((LevelNum == Constants.ID_LevelNum)))){
UFO_BornCount = (UFO_BornCount + Speed);
if (UFO_BornCount >= UFO_NextBorn){
gs = MakeUFO_HelpScreen();
gs.ForceSetFlashSprite();
UFO_BornCount = 0;
UFO_NextBorn = (350 + Math.round((Math.random() * 100)));
};
} else {
if (LevelNum == Constants.GC_LevelNum){
UFO_BornCount = (UFO_BornCount + Speed);
if (UFO_BornCount >= UFO_NextBorn){
gs = MakeUFO_GameComplete();
gs.ForceSetFlashSprite();
UFO_BornCount = 0;
UFO_NextBorn = (25 + Math.round((Math.random() * 15)));
};
};
};
};
};
}
public function MakeBossBoomFlash():TGameSprite{
var gs:TGameSprite;
var s:Sprite = new Sprite();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, null, Constants.GST_BOSS_BOOM_FLASH, Constants.ZB_BOSS_HP);
gs.ColorTransform_ = new ColorTransform();
gs.BornByLevel = Object(this);
gs.SetPos(new Point(0, 0));
gs.ForceSetFlashSprite();
s.graphics.clear();
s.graphics.beginFill(4294901502);
s.graphics.drawRect(0, 0, Constants.SCREEN_WIDTH, Constants.SCREEN_HEIGHT);
s.graphics.endFill();
return (gs);
}
public function MakePostScoresPanel():TGameSprite{
var s:TGUI_FORM4_PANEL = new TGUI_FORM4_PANEL();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_POSTSCORESPANEL, Constants.ZB_PLAYERPANEL);
gs.SetPos(new Point(85, 110));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePlasmaCannonBullet(isLR:Boolean, Pos:Point, BulletDamage:int):TGameSprite{
var gs:TGameSprite;
var s:TPlasmaCannonBullet = new TPlasmaCannonBullet();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, new TPlasmaCannonBullet_hitArea(), Constants.GST_PLASMACANNONBULLET, Constants.ZB_WEAPONBULLETS);
gs.ColorTransform_ = new ColorTransform();
if (isLR){
gs.dx = 5;
gs.dRotation = 0.5;
} else {
gs.dx = -5;
gs.dRotation = -0.5;
};
gs.BlendMode_ = BlendMode.ADD;
gs.Rotation_ = 80;
gs.Scale_ = 1;
gs.Alpha_ = 0.05;
gs.BulletDamage = BulletDamage;
gs.WeaponIsLR = isLR;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakePlayerBullet(Pos_:Point, BulletDamage:int):TGameSprite{
var gs:TGameSprite = new TGameSprite(SpriteEngine_, null, new TFIRE_hitArea(), Constants.GST_PLAYERBULLET, 0);
gs.BulletDamage = BulletDamage;
gs.BornByLevel = Object(this);
gs.SetPos(Pos_);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeRocketHeatLauncherBullet(isLR:Boolean, Pos:Point, BulletDamage:int):TGameSprite{
var gs:TGameSprite;
var s:TRocketHeatLauncherBullet = new TRocketHeatLauncherBullet();
UFOShooter1.GameSpritesMovie.addChild(s);
gs = new TGameSprite(SpriteEngine_, s, new TRocketLauncherBullet_hitArea(), Constants.GST_ROCKETHEATLAUNCHERBULLET, Constants.ZB_WEAPONBULLETS);
if (isLR){
gs.dx = 5;
} else {
gs.dx = -5;
gs.Rotation_ = 180;
};
gs.Scale_ = 1.5;
gs.BulletDamage = BulletDamage;
gs.WeaponIsLR = isLR;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponSellQPanel():TGameSprite{
var s:TGUI_FORM9_PANEL = new TGUI_FORM9_PANEL();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONSELLQPANEL, Constants.ZB_PLAYERPANEL);
gs.SetPos(new Point(122, 125));
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeWeaponSellQInfoLine(FontName:String, Pos:Point, Text:String, width:int, size:int, color:uint, align:String):TGameSprite{
var tf:TextField = new TextField();
var s:Sprite = new Sprite();
tf.x = 0;
tf.y = 0;
s.addChild(tf);
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, null, Constants.GST_WEAPONSELLQINFOLINE, Constants.ZB_PLAYERPANELINFO);
gs.TextField_ = tf;
gs.TextFormat_ = new TextFormat();
gs.TextFormat_.size = size;
gs.TextFormat_.font = FontName;
gs.TextFormat_.color = color;
gs.TextFormat_.align = align;
tf.width = width;
tf.selectable = false;
tf.text = Text;
tf.embedFonts = true;
tf.setTextFormat(gs.TextFormat_);
gs.SetPos(Pos);
gs.BornByLevel = Object(this);
gs.ForceSetFlashSprite();
return (gs);
}
public function MakeStaticLaserBullet(isLR:Boolean, Pos:Point, BulletDamage:int):TGameSprite{
var s:TStaticLaserBullet = new TStaticLaserBullet();
UFOShooter1.GameSpritesMovie.addChild(s);
var gs:TGameSprite = new TGameSprite(SpriteEngine_, s, new TSTATICLASERBULLET_hitArea(), Constants.GST_SLBULLET, Constants.ZB_WEAPONBULLETS);
gs.ColorTransform_ = new ColorTransform();
gs.BulletDamage = BulletDamage;
gs.WeaponIsLR = isLR;
gs.BornByLevel = Object(this);
gs.SetPos(Pos);
gs.doCollision = true;
gs.ForceSetFlashSprite();
return (gs);
}
public function isPause():Boolean{
return (fisPause);
}
public function MakeWeaponInfoMovie(NewPos:Point, WeaponType:uint, StartFrame:int=1):TGameSprite{
var s7:TGUI_WEAPONMOVIE7;
var s6:TGUI_WEAPONMOVIE6;
var s4:TGUI_WEAPONMOVIE4;
var s5:TGUI_WEAPONMOVIE5;
var s2:TGUI_WEAPONMOVIE2;
var s1:TGUI_WEAPONMOVIE1;
var s3:TGUI_WEAPONMOVIE3;
var gs:TGameSprite;
if (WeaponType == Constants.WT_MAINGUN){
s7 = new TGUI_WEAPONMOVIE7();
UFOShooter1.GameSpritesMovie.addChild(s7);
gs = new TGameSprite(SpriteEngine_, s7, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s7 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_ALIENLAB){
s6 = new TGUI_WEAPONMOVIE6();
UFOShooter1.GameSpritesMovie.addChild(s6);
gs = new TGameSprite(SpriteEngine_, s6, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s6 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_ROCKETLAUNCHER){
s4 = new TGUI_WEAPONMOVIE4();
UFOShooter1.GameSpritesMovie.addChild(s4);
gs = new TGameSprite(SpriteEngine_, s4, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s4 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_ROCKETHEATLAUNCHER){
s5 = new TGUI_WEAPONMOVIE5();
UFOShooter1.GameSpritesMovie.addChild(s5);
gs = new TGameSprite(SpriteEngine_, s5, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s5 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_LASERTURRET){
s2 = new TGUI_WEAPONMOVIE2();
UFOShooter1.GameSpritesMovie.addChild(s2);
gs = new TGameSprite(SpriteEngine_, s2, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s2 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_STATICLASER){
s1 = new TGUI_WEAPONMOVIE1();
UFOShooter1.GameSpritesMovie.addChild(s1);
gs = new TGameSprite(SpriteEngine_, s1, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s1 as MovieClip).gotoAndPlay(StartFrame);
} else {
if (WeaponType == Constants.WT_PLASMACANNON){
s3 = new TGUI_WEAPONMOVIE3();
UFOShooter1.GameSpritesMovie.addChild(s3);
gs = new TGameSprite(SpriteEngine_, s3, null, Constants.GST_WEAPONINFO_MOVIE, Constants.ZB_PLAYERPANELINFO);
(s3 as MovieClip).gotoAndPlay(StartFrame);
};
};
};
};
};
};
};
gs.WeaponType = WeaponType;
if (gs != null){
gs.BornByLevel = Object(this);
gs.SetPos(NewPos);
gs.ForceSetFlashSprite();
};
SpriteEngine_.UFOShooter1.Player.WeaponInfoMovieFrame = StartFrame;
return (gs);
}
}
}//package
Section 382
//TGamePlay1Music (TGamePlay1Music)
package {
import flash.media.*;
public dynamic class TGamePlay1Music extends Sound {
}
}//package
Section 383
//TGamePlay2Music (TGamePlay2Music)
package {
import flash.media.*;
public dynamic class TGamePlay2Music extends Sound {
}
}//package
Section 384
//TGamePlay3Music (TGamePlay3Music)
package {
import flash.media.*;
public dynamic class TGamePlay3Music extends Sound {
}
}//package
Section 385
//TGamePlay4Music (TGamePlay4Music)
package {
import flash.media.*;
public dynamic class TGamePlay4Music extends Sound {
}
}//package
Section 386
//TGameSprite (TGameSprite)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.ui.*;
public class TGameSprite extends Sprite {
public var y_:Number;// = 0
public var UFOSpeed:Number;// = 1
public var EARTH_CENTER:Point;
public var UFO_HP_MAX:Number;// = 100
public var UFO_HP:Number;
public var dRotation:Number;// = 0
public var Name_:String;// = ""
public var ALIENLAB_SPEED:int;// = 0
public var ColorTransform_:ColorTransform;// = null
public var ShineStarType:int;// = 0
public var EARTH_Fi:Number;// = 0
public var BOSS_HP:Number;// = 0
public var UFO_PLASMAEFFECT:TGameSprite;// = null
public var WeaponBulletPos:Point;
public var UFO_TrajSpiral_dFi:Number;// = 0
public var z_:int;// = 0
public var WeaponUpgradeNum:uint;// = 1
public var BulletDamage:Number;// = 0
public var UFOColor:int;// = 0
public var RocketDistance:Number;// = 0
public var HEATROCKET_NewTargetCount:Number;// = 0
public var TextFormat_:TextFormat;// = null
public var UFOTraj:int;// = 1
public var Stage_:Number;// = 0
public var dScale:Number;// = 0
public var TextField_:TextField;// = null
public var isCashable:Boolean;// = true
public var UFO_TrajSpiral_Center:Point;
public var Type:uint;// = 0
public var WeaponEnabled:Boolean;// = false
public var EARTH_Radius:Number;// = 0
public var HEATROCKET_NewAngleCount:Number;// = 0
public var UFOStopedByPlasmaBullet:Boolean;// = false
public var BlendMode_:String;// = "normal"
public var Scale_:Number;// = 1
public var LM_GO_STARTPOS:Point;// = null
public var BOSS_dFi:Number;// = 0
public var BOSS_CENTER:Point;
public var Rotation_:Number;// = 0
public var isUFOAimed:Boolean;// = false
public var WeaponIsLR:Boolean;// = true
public var dx:Number;// = 0
public var dy:Number;// = 0
public var WeaponType:uint;// = 0
public var isGCUFO:Boolean;// = false
public var HEATROCKET_Target:TGameSprite;// = null
public var WeaponFireRateCount:Number;// = 0
public var UFO_TrajSpiral_Radius:Number;// = 0
public var isBossChild:Boolean;// = false
public var BOSS_HP_MAX:Number;// = 0
public var isUFOJustBornByBoss:Boolean;// = false
public var isDead:Boolean;// = false
public var EARTH_dFi:Number;// = 0
public var UFOUFOStopedByPlasmaBulletCount:Number;// = 0
public var FlashSprite:Sprite;// = null
public var isEnabled:Boolean;// = true
public var SpriteEngine_:SpriteEngine;
public var UFO_HEALTHBARCount:int;// = 0
public var StageCount_:Number;// = 0
public var BornByLevel:Object;// = null
public var BOSS_HEALTHBAR:TGameSprite;// = null
public var UFO_TrajSpiral_Fi:Number;// = 0
public var BOSS_Radius:Number;// = 0
public var Alpha_:Number;// = 1
public var BOSS_CriticalStageCount:Number;// = 0
public var BornByBG:Object;// = null
public var x_:Number;// = 0
public var isVisible:Boolean;// = true
public var doCollision:Boolean;// = false
public var isUFOSmall:Boolean;// = false
public var WeaponPosNum:uint;// = 0
public var UFO_HEALTHBAR:TGameSprite;// = null
public var UFO_TrajSpiral_dRadius:Number;// = 0
public var UFO_TrajSpiral_Center_dx:Number;// = 0
public var UFO_TrajSpiral_Center_dy:Number;// = 0
public var BOSS_Fi:Number;// = 0
public function TGameSprite(spriteEngine:SpriteEngine, flashSprite:Sprite, hitArea_:Sprite, spriteType:uint, sprite_Z:uint){
UFO_HP = UFO_HP_MAX;
UFO_TrajSpiral_Center = new Point(0, 0);
EARTH_CENTER = new Point(0, 0);
WeaponBulletPos = new Point(0, 0);
BOSS_CENTER = new Point(0, 0);
super();
this.SpriteEngine_ = spriteEngine;
this.FlashSprite = flashSprite;
this.hitArea = hitArea_;
if (((((Constants.USE_DEBUG) && (Constants.USE_DEBUG_SHOWHITAREA))) && (!((hitArea_ == null))))){
SpriteEngine_.UFOShooter1.DebugMovie.addChild(hitArea_);
};
if (FlashSprite != null){
Name_ = (FlashSprite.name + FlashSprite.toString());
x_ = FlashSprite.x;
y_ = FlashSprite.y;
Alpha_ = FlashSprite.alpha;
} else {
Name_ = ((spriteType + "_") + sprite_Z);
};
Type = spriteType;
z_ = sprite_Z;
isVisible = true;
isEnabled = true;
Scale_ = 1;
Rotation_ = 0;
Stage_ = 0;
StageCount_ = 0;
BlendMode_ = BlendMode.NORMAL;
SetVisible(isVisible);
SetEnabled(isEnabled);
spriteEngine.Add(this);
}
public function HeatRocketFindTarget():TGameSprite{
var gs:TGameSprite;
var Finded_GS:TGameSprite;
var Dist:Number = 0;
var Finded_GS_Distance:Number = (Constants.SCREEN_WIDTH * Constants.SCREEN_WIDTH);
var len:int = SpriteEngine_.Items.length;
var i:int;
while (i < len) {
gs = SpriteEngine_.Items[i];
if (((((((gs.doCollision) && ((gs.Type == Constants.GST_UFO)))) || ((gs.Type == Constants.GST_BOSS)))) || ((gs.Type == Constants.GST_BOSSChild)))){
Dist = GetDistance(GetPos(), gs.GetPos());
if (Dist <= Finded_GS_Distance){
Finded_GS_Distance = Dist;
Finded_GS = gs;
};
};
i++;
};
return (Finded_GS);
}
public function onCollision(Other:TGameSprite):Boolean{
var gs:TGameSprite;
var s:TGameSprite;
if ((((Type == Constants.GST_UFO)) && (isDead))){
return (true);
};
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_EARTH)))){
dScale = (-0.025 * UFOSpeed);
return (true);
};
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_PLAYERBULLET)))){
ProcDamage(Other.BulletDamage);
Other.Dead();
if (!isDead){
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("UFOHit");
};
return (true);
} else {
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_SLBULLET)))){
ProcDamage(Other.BulletDamage);
return (true);
};
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_LASERTURRETBULLET)))){
ProcDamage(Other.BulletDamage);
Other.Dead();
if (!isDead){
gs = SpriteEngine_.UFOShooter1.CurrentLevel.MakeLaserExplode(Other.WeaponIsLR, Other.GetPos(), Other.Scale_);
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("UFOHit");
};
return (true);
} else {
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_PLASMACANNONBULLET)))){
if (Type == Constants.GST_UFO){
UFO_PLASMAEFFECT.SetVisible(true);
UFOStopedByPlasmaBullet = true;
UFOUFOStopedByPlasmaBulletCount = 0;
};
ProcDamage(Other.BulletDamage);
return (true);
} else {
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_ROCKETLAUNCHERBULLET)))){
ProcDamage(Other.BulletDamage);
Other.Dead();
if (!isDead){
gs = SpriteEngine_.UFOShooter1.CurrentLevel.MakeRocketExplode(Other.GetPos(), Other.Scale_);
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("UFOHit");
};
return (true);
} else {
if ((((((Type == Constants.GST_UFO)) || ((Type == Constants.GST_BOSS)))) && ((Other.Type == Constants.GST_ROCKETHEATLAUNCHERBULLET)))){
ProcDamage(Other.BulletDamage);
Other.Dead();
if (Other.HEATROCKET_Target != null){
Other.HEATROCKET_Target.isUFOAimed = false;
Other.HEATROCKET_Target.ColorTransform_ = null;
};
if (!isDead){
gs = SpriteEngine_.UFOShooter1.CurrentLevel.MakeRocketExplode(Other.GetPos(), Other.Scale_);
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("UFOHit");
};
return (true);
} else {
if ((((Type == Constants.GST_ALIEN)) && ((Other.Type == Constants.GST_ALIENLAB)))){
Dead();
s = SpriteEngine_.UFOShooter1.CurrentLevel.MakeAlienTextScore(Constants.GP_AlienScore.toString(), new Point((x_ - 20), (y_ - 55)));
if (isCashable){
SpriteEngine_.UFOShooter1.Player.AddScore(Constants.GP_AlienScore);
SpriteEngine_.UFOShooter1.Player.AddCash(Constants.GP_AlienScore);
};
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("AlienCatch");
return (true);
};
};
};
};
};
};
return (false);
}
public function GetPos():Point{
return (new Point(this.x_, this.y_));
}
public function GetDistance(Pos1:Point, Pos2:Point):Number{
var res:Number = 0;
res = Math.sqrt((Math.pow((Pos1.x - Pos2.x), 2) + Math.pow((Pos1.y - Pos2.y), 2)));
return (res);
}
public function RedrawBOSSHealthBar(Proc:Number):void{
FlashSprite.graphics.clear();
FlashSprite.graphics.beginFill(4294901760);
FlashSprite.graphics.drawRect(0, 0, 300, 16);
FlashSprite.graphics.beginFill(4278255360);
FlashSprite.graphics.drawRect(0, 0, Math.round((300 * (Proc / 100))), 16);
FlashSprite.graphics.endFill();
}
public function RedrawUFOHealthBar():void{
var f:int;
if (UFO_HEALTHBAR != null){
f = Math.round((11 * (UFO_HP / UFO_HP_MAX)));
if (f < 1){
f = 1;
} else {
if (f > 11){
f = 11;
};
};
(this.UFO_HEALTHBAR.FlashSprite as MovieClip).gotoAndStop(f);
};
}
public function Dead():void{
if (isDead){
return;
};
isDead = true;
PreDead();
doCollision = false;
SpriteEngine_.DeadList.push(this);
}
public function ProcDamage(How:int):void{
var cLevel:int;
var p:Number;
var Score:int;
var s:TGameSprite;
var gsAlien:TGameSprite;
var k:int;
var i:int;
var cmd1:TGameCommand;
var cmd2:TGameCommand;
var cmd3:TGameCommand;
var cmd4:TGameCommand;
var cmd:TGameCommand;
var cmdExplSnd:TGameCommand;
if (Type == Constants.GST_UFO){
UFO_HP = (UFO_HP - How);
if ((((UFO_HP > 0)) && (!((UFO_HEALTHBAR == null))))){
UFO_HEALTHBAR.SetVisible(true);
UFO_HEALTHBAR.UFO_HEALTHBARCount = 0;
UFO_HEALTHBAR.Alpha_ = 1;
UFO_HEALTHBAR.ForceSetFlashSprite();
RedrawUFOHealthBar();
};
if (UFO_HP <= 0){
Dead();
SpriteEngine_.UFOShooter1.CurrentLevel.MakeUFOExplode(GetPos(), (Scale_ * Constants.UFO_EXPLODE_SCALE));
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("UFOExplosion");
if (isBossChild){
return;
};
cLevel = (SpriteEngine_.UFOShooter1.Player.LevelNum - Constants.MinPlayableLevelNum);
if (SpriteEngine_.UFOShooter1.CurrentLevel.isPlayable()){
cLevel = (SpriteEngine_.UFOShooter1.CurrentLevel.LevelNum - Constants.MinPlayableLevelNum);
};
p = Constants.UFOALIENPROBABILITY[cLevel];
if ((((p > 0)) && ((((p >= 1)) || ((Math.random() < p)))))){
gsAlien = SpriteEngine_.UFOShooter1.CurrentLevel.MakeAlien(GetPos(), Math.round((1 + (Math.random() * 2))), UFOSpeed);
gsAlien.Scale_ = Scale_;
gsAlien.isCashable = isCashable;
gsAlien.ForceSetFlashSprite();
};
Score = Constants.GP_UFOScore;
if (isUFOSmall){
Score = Constants.GP_UFOSmallScore;
};
s = SpriteEngine_.UFOShooter1.CurrentLevel.MakeUFOTextScore(Score.toString(), new Point((x_ - 15), (y_ - 55)));
if (isCashable){
SpriteEngine_.UFOShooter1.Player.UFOsShooted = (SpriteEngine_.UFOShooter1.Player.UFOsShooted + 1);
SpriteEngine_.UFOShooter1.Player.AddScore(Score);
SpriteEngine_.UFOShooter1.Player.AddCash(Score);
};
};
} else {
if (Type == Constants.GST_BOSS){
BOSS_HP = (BOSS_HP - How);
if ((((BOSS_HP > 0)) && (!((BOSS_HEALTHBAR == null))))){
BOSS_HEALTHBAR.RedrawBOSSHealthBar(((100 * BOSS_HP) / BOSS_HP_MAX));
BOSS_HEALTHBAR.ForceSetFlashSprite();
};
if (BOSS_HP <= 0){
doCollision = false;
isEnabled = false;
BOSS_HP = 0;
BOSS_HEALTHBAR.RedrawBOSSHealthBar(0);
SpriteEngine_.UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
SpriteEngine_.UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_EXPLODEALLUFOS);
SpriteEngine_.UFOShooter1.CurrentLevel.ChangeLevelState(Constants.LS_LEVELCOMPLETE);
k = 0;
i = 0;
while (i < 15) {
if (i != 0){
(k == 1);
};
cmd = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKEBOSSEXPLOSION, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd.Point_Param1 = GetPos();
cmd.Ticks = ((k * 15) + (i * (2 + Math.random())));
cmdExplSnd = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_PLAYSAMPLE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
if ((((Math.random() < 0.6)) || ((i > 13)))){
cmdExplSnd.String_Param1 = "UFOExplosion";
cmdExplSnd.Bool_Param1 = true;
cmdExplSnd.Ticks = ((k * 15) + (i * (2 + Math.random())));
};
i++;
};
cmd1 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKEBOSSFLASH, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd1.Ticks = (cmd.Ticks + -1);
cmd2 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_BOSSDEAD, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd2.Ticks = (cmd.Ticks + 0);
cmd3 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd3.UInt_Param1 = Constants.GST_LEVELMESSAGE_LEVELCOMPLETE;
cmd3.Ticks = (cmd.Ticks + 35);
cmd4 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_PLAYSAMPLE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd4.String_Param1 = "LevelClear";
cmd4.Bool_Param1 = true;
cmd4.Ticks = (cmd.Ticks + 35);
SpriteEngine_.UFOShooter1.SoundEngine.StopCurrentStream();
UFOShooter.main.Player.AddScore(Math.round(Constants.GP_BossScore));
};
};
};
}
public function PreDead():void{
var cmd:TGameCommand;
if (Type == Constants.GST_UFO){
if (UFO_HEALTHBAR != null){
UFO_HEALTHBAR.Dead();
};
if (UFO_PLASMAEFFECT != null){
UFO_PLASMAEFFECT.Dead();
};
cmd = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_CHECK4LEVELCOMPLETE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd.Ticks = 10;
} else {
if (Type == Constants.GST_BOSS){
if (BOSS_HEALTHBAR != null){
BOSS_HEALTHBAR.Dead();
};
};
};
}
public function ForceSetFlashSprite():void{
if (FlashSprite != null){
SetVisible(isVisible);
SetEnabled(isEnabled);
FlashSprite.x = Math.round(x_);
FlashSprite.y = Math.round(y_);
FlashSprite.alpha = Alpha_;
FlashSprite.scaleX = Scale_;
FlashSprite.scaleY = Scale_;
FlashSprite.rotation = Rotation_;
FlashSprite.blendMode = this.BlendMode_;
if (ColorTransform_ != null){
FlashSprite.transform.colorTransform = ColorTransform_;
};
};
if (hitArea != null){
hitArea.x = this.x_;
hitArea.y = this.y_;
hitArea.scaleX = this.Scale_;
hitArea.scaleY = this.Scale_;
hitArea.rotation = this.Rotation_;
};
}
public function SetEnabled(Value:Boolean):void{
if (isEnabled == Value){
return;
};
isEnabled = Value;
}
public function isCollide(Other:TGameSprite):void{
if ((((hitArea == null)) || ((Other.hitArea == null)))){
return;
};
if (hitArea.hitTestObject(Other.hitArea)){
if (!onCollision(Other)){
Other.onCollision(this);
};
};
}
public function SetPos(Pos_:Point):void{
this.x_ = Pos_.x;
this.y_ = Pos_.y;
}
public function SetVisible(Value:Boolean):void{
if (isVisible == Value){
return;
};
isVisible = Value;
if (FlashSprite != null){
FlashSprite.visible = Value;
};
}
public function Update(Speed:Number):void{
var dRocketDistance:Number;
var MaxDistance:Number;
var NewRotation_:Number;
var dRotation:Number;
var RocketExplode:TGameSprite;
var cmd:TGameCommand;
var gs1:TGameSprite;
var c1:TGameCommand;
var c2:TGameCommand;
var c3:TGameCommand;
var c4:TGameCommand;
var gsUFO1:TGameSprite;
if (!isEnabled){
return;
};
if (Type == Constants.GST_CROSSHAIR){
if (((!((SpriteEngine_.UFOShooter1 == null))) && (SpriteEngine_.UFOShooter1.Cross.isVisible))){
x_ = SpriteEngine_.UFOShooter1.mouseX;
y_ = SpriteEngine_.UFOShooter1.mouseY;
Mouse.hide();
Scale_ = (Scale_ + (dScale * Speed));
if (Scale_ < 1){
Scale_ = 1;
dScale = 0;
};
} else {
Mouse.show();
};
} else {
if (Type == Constants.GST_UFO){
if (((isGCUFO) && ((Scale_ < 1)))){
Scale_ = (Scale_ + (dScale * Speed));
if (Scale_ > 1){
Scale_ = 1;
};
};
if (SpriteEngine_.UFOShooter1.Cross.isVisible){
SpriteEngine_.UFOShooter1.Cross.x_ = SpriteEngine_.UFOShooter1.mouseX;
SpriteEngine_.UFOShooter1.Cross.y_ = SpriteEngine_.UFOShooter1.mouseY;
SpriteEngine_.UFOShooter1.Cross.ForceSetFlashSprite();
};
if (isUFOJustBornByBoss){
x_ = (x_ + (dx * Speed));
y_ = (y_ + (dy * Speed));
Scale_ = (Scale_ + (dScale * Speed));
if (Scale_ > 1){
Scale_ = 1;
isUFOJustBornByBoss = false;
dScale = 0;
dy = (5 + (Math.random() * 2));
doCollision = true;
UFOTraj = 1;
};
if (((!(isDead)) && (!((UFO_PLASMAEFFECT == null))))){
UFO_PLASMAEFFECT.x_ = (x_ + ((Constants.UFO_PE_OffsetX * Scale_) * Constants.UFO_PE_SCALE));
UFO_PLASMAEFFECT.y_ = (y_ + ((Constants.UFO_PE_OffsetY * Scale_) * Constants.UFO_PE_SCALE));
UFO_PLASMAEFFECT.Scale_ = (Scale_ * Constants.UFO_PE_SCALE);
};
ForceSetFlashSprite();
return;
};
if (!UFOStopedByPlasmaBullet){
if (UFOTraj == 1){
x_ = (x_ + (dx * Speed));
y_ = (y_ + (dy * Speed));
} else {
UFO_TrajSpiral_Center.x = (UFO_TrajSpiral_Center.x + (UFO_TrajSpiral_Center_dx * Speed));
UFO_TrajSpiral_Center.y = (UFO_TrajSpiral_Center.y + (UFO_TrajSpiral_Center_dy * Speed));
UFO_TrajSpiral_Fi = (UFO_TrajSpiral_Fi + (UFO_TrajSpiral_dFi * Speed));
UFO_TrajSpiral_Radius = (UFO_TrajSpiral_Radius + (UFO_TrajSpiral_dRadius * Speed));
x_ = (UFO_TrajSpiral_Center.x + (UFO_TrajSpiral_Radius * Math.cos(UFO_TrajSpiral_Fi)));
y_ = (UFO_TrajSpiral_Center.y + (UFO_TrajSpiral_Radius * Math.sin(UFO_TrajSpiral_Fi)));
};
Scale_ = (Scale_ + (dScale * Speed));
if (((!(isUFOSmall)) && ((Scale_ <= 0.67)))){
isUFOSmall = true;
};
} else {
UFOUFOStopedByPlasmaBulletCount = (UFOUFOStopedByPlasmaBulletCount + Speed);
if (UFOUFOStopedByPlasmaBulletCount > 5){
UFOStopedByPlasmaBullet = false;
UFOUFOStopedByPlasmaBulletCount = 0;
UFO_PLASMAEFFECT.SetVisible(false);
};
};
if (((((((!(isBossChild)) && ((y_ > (Constants.SCREEN_HEIGHT + 100))))) || ((Scale_ <= 0)))) || ((x_ > (Constants.SCREEN_WIDTH + 100))))){
SetVisible(false);
Dead();
SpriteEngine_.UFOShooter1.Player.AddUFOsLeft(-1);
};
if (((!(isDead)) && (!((UFO_HEALTHBAR == null))))){
UFO_HEALTHBAR.x_ = (x_ + (Constants.UFO_HP_OffsetX * Scale_));
UFO_HEALTHBAR.y_ = (y_ + (Constants.UFO_HP_OffsetY * Scale_));
UFO_HEALTHBAR.Scale_ = Scale_;
};
if (((!(isDead)) && (!((UFO_PLASMAEFFECT == null))))){
UFO_PLASMAEFFECT.x_ = (x_ + ((Constants.UFO_PE_OffsetX * Scale_) * Constants.UFO_PE_SCALE));
UFO_PLASMAEFFECT.y_ = (y_ + ((Constants.UFO_PE_OffsetY * Scale_) * Constants.UFO_PE_SCALE));
UFO_PLASMAEFFECT.Scale_ = (Scale_ * Constants.UFO_PE_SCALE);
};
if (((isBossChild) && ((y_ > (Constants.SCREEN_HEIGHT - 80))))){
Scale_ = (Scale_ - (0.04 * Speed));
if (Scale_ < 0){
SetVisible(false);
Dead();
SpriteEngine_.UFOShooter1.Player.AddUFOsLeft(-1);
ForceSetFlashSprite();
} else {
if (Scale_ < 0.2){
doCollision = false;
};
};
};
} else {
if (Type == Constants.GST_UFOHEALTHBAR){
if (visible){
UFO_HEALTHBARCount = (UFO_HEALTHBARCount + Speed);
};
if (((visible) && ((UFO_HEALTHBARCount > Constants.UFO_HP_VisibleCount)))){
Alpha_ = (Alpha_ - Constants.UFO_HP_dAlpha);
if (Alpha_ <= 0){
SetVisible(false);
ForceSetFlashSprite();
UFO_HEALTHBARCount = 0;
};
};
} else {
if (Type == Constants.GST_PLAYERBULLET){
StageCount_ = (StageCount_ + Speed);
if (StageCount_ > Speed){
Dead();
SpriteEngine_.UFOShooter1.Player.PlayerMiss = (SpriteEngine_.UFOShooter1.Player.PlayerMiss + 1);
SpriteEngine_.UFOShooter1.SoundEngine.PlaySample("PlayerMiss");
};
} else {
if (Type == Constants.GST_UFOEXPLODE){
StageCount_ = (StageCount_ + Speed);
if ((FlashSprite as MovieClip).currentFrame >= 21){
Dead();
};
} else {
if (Type == Constants.GST_UFOPLASMAEFFECT){
StageCount_ = (StageCount_ + Speed);
if (StageCount_ >= 5){
(FlashSprite as MovieClip).gotoAndStop((1 + Math.round((Math.random() * 19))));
StageCount_ = 0;
};
} else {
if (Type == Constants.GST_ROCKETEXPLODE){
StageCount_ = (StageCount_ + Speed);
if ((FlashSprite as MovieClip).currentFrame >= 9){
Dead();
};
} else {
if (Type == Constants.GST_LASEREXPLODE){
StageCount_ = (StageCount_ + Speed);
if ((FlashSprite as MovieClip).currentFrame >= 6){
Dead();
};
} else {
if (Type == Constants.GST_UFOTEXTSCORE){
StageCount_ = (StageCount_ + Speed);
y_ = (y_ - (2 * Speed));
if (StageCount_ >= 15){
Alpha_ = (Alpha_ - (0.15 * Speed));
if (Alpha_ <= 0){
Alpha_ = 0;
Dead();
};
};
} else {
if (Type == Constants.GST_ALIENTEXTSCORE){
StageCount_ = (StageCount_ + Speed);
y_ = (y_ - (2 * Speed));
ColorTransform_.redMultiplier = (0.4 + Math.random());
ColorTransform_.blueMultiplier = (0.4 + Math.random());
ColorTransform_.greenMultiplier = (0.4 + Math.random());
if (StageCount_ >= 25){
Alpha_ = (Alpha_ - (0.15 * Speed));
if (Alpha_ <= 0){
Alpha_ = 0;
Dead();
};
};
} else {
if (Type == Constants.GST_EARTH){
EARTH_Fi = (EARTH_Fi + (EARTH_dFi * Speed));
x_ = (EARTH_CENTER.x + (EARTH_Radius * Math.cos(EARTH_Fi)));
y_ = (EARTH_CENTER.y + (EARTH_Radius * Math.sin(EARTH_Fi)));
} else {
if (Type == Constants.GST_SLBULLET){
ColorTransform_.redMultiplier = (0.4 + Math.random());
ColorTransform_.blueMultiplier = (0.4 + Math.random());
ColorTransform_.greenMultiplier = (0.4 + Math.random());
StageCount_ = (StageCount_ + Speed);
if (this.StageCount_ > 20){
Dead();
};
} else {
if (Type == Constants.GST_LASERTURRETBULLET){
x_ = (x_ + (dx * Speed));
if ((((((dx > 0)) && ((x_ > (Constants.SCREEN_WIDTH + 50))))) || ((((dx < 0)) && ((x_ < -50)))))){
Dead();
};
} else {
if (Type == Constants.GST_PLASMACANNONBULLET){
x_ = (x_ + (dx * Speed));
Rotation_ = (Rotation_ + (dRotation * Speed));
ColorTransform_.redMultiplier = (0.4 + Math.random());
ColorTransform_.blueMultiplier = (0.4 + Math.random());
ColorTransform_.greenMultiplier = (0.4 + Math.random());
if ((((((dx > 0)) && ((x_ > (Constants.SCREEN_WIDTH + 50))))) || ((((dx < 0)) && ((x_ < -50)))))){
Dead();
};
} else {
if (Type == Constants.GST_ROCKETLAUNCHERBULLET){
x_ = (x_ + (dx * Speed));
RocketDistance = (RocketDistance + Math.abs((dx * Speed)));
if ((((dx > 0)) && ((dx < 25)))){
dx = (dx + ((Speed / (100 / (RocketDistance + 5))) * 0.85));
} else {
if ((((dx < 0)) && ((dx > -25)))){
dx = (dx - ((Speed / (100 / (RocketDistance + 5))) * 0.85));
};
};
if ((((((dx > 0)) && ((x_ > (Constants.SCREEN_WIDTH + 50))))) || ((((dx < 0)) && ((x_ < -50)))))){
Dead();
};
} else {
if (Type == Constants.GST_ROCKETHEATLAUNCHERBULLET){
x_ = (x_ + (dx * Speed));
y_ = (y_ + (dy * Speed));
dRocketDistance = Math.abs((GetDistance(GetPos(), new Point((x_ + dx), (y_ + dy))) * Speed));
RocketDistance = (RocketDistance + dRocketDistance);
if ((((((HEATROCKET_Target == null)) && ((dx > 0)))) && ((dx < 45)))){
dx = (dx + ((Speed / (100 / (RocketDistance + 5))) * 0.85));
} else {
if ((((((HEATROCKET_Target == null)) && ((dx < 0)))) && ((dx > -45)))){
dx = (dx - ((Speed / (100 / (RocketDistance + 5))) * 0.85));
};
};
HEATROCKET_NewTargetCount = (HEATROCKET_NewTargetCount + Speed);
if ((((((HEATROCKET_Target == null)) && ((RocketDistance < 650)))) && ((((HEATROCKET_NewTargetCount > 15)) || ((RocketDistance > 200)))))){
HEATROCKET_Target = HeatRocketFindTarget();
if (HEATROCKET_Target != null){
HEATROCKET_Target.isUFOAimed = true;
};
} else {
if (HEATROCKET_Target != null){
HEATROCKET_NewTargetCount = 0;
NewRotation_ = ((Math.atan2((HEATROCKET_Target.y_ - y_), (HEATROCKET_Target.x_ - x_)) * 180) / Math.PI);
if (!WeaponIsLR){
if (NewRotation_ > 360){
NewRotation_ = (NewRotation_ - 360);
} else {
if (NewRotation_ < 0){
NewRotation_ = (NewRotation_ + 360);
};
};
};
dRotation = Math.abs(Math.round((RocketDistance / 65)));
if (dRotation < 0.5){
dRotation = 0.5;
} else {
if (dRotation > 12){
dRotation = 12;
};
};
if (NewRotation_ > Rotation_){
Rotation_ = (Rotation_ + dRotation);
} else {
if (NewRotation_ < Rotation_){
Rotation_ = (Rotation_ - dRotation);
};
};
};
};
MaxDistance = Math.min(200, RocketDistance);
dx = ((Math.cos(((Math.PI * Rotation_) / 180)) * MaxDistance) / 7);
dy = ((Math.sin(((Math.PI * Rotation_) / 180)) * MaxDistance) / 7);
if ((((RocketDistance > 1500)) && (!(isDead)))){
if (HEATROCKET_Target != null){
HEATROCKET_Target.isUFOAimed = false;
};
Dead();
doCollision = false;
SetVisible(false);
ForceSetFlashSprite();
if ((((((((x_ > 0)) && ((x_ < Constants.SCREEN_WIDTH)))) && ((y_ > 0)))) && ((y_ < Constants.SCREEN_HEIGHT)))){
RocketExplode = SpriteEngine_.UFOShooter1.CurrentLevel.MakeRocketExplode(GetPos(), Scale_);
};
};
} else {
if (Type == Constants.GST_ALIEN){
Scale_ = (Scale_ - (0.03 * Speed));
Rotation_ = (Rotation_ + (dRotation * Speed));
if (Stage_ == 0){
if (Scale_ < 0.7){
Stage_ = 1;
doCollision = true;
};
};
if (Scale_ < 0.1){
Dead();
};
} else {
if (Type == Constants.GST_ALIENLAB){
if (WeaponEnabled){
if (Stage_ == 0){
x_ = (x_ + (dx * Speed));
if (x_ > 530){
Stage_ = 1;
};
} else {
if (Stage_ == 1){
x_ = (x_ - (dx * Speed));
if (x_ < 110){
Stage_ = 0;
};
};
};
};
} else {
if (Type == Constants.GST_LEVELMESSAGE_LEVELXXX){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
Alpha_ = (Alpha_ + (0.05 * Speed));
if (Alpha_ >= 1){
Alpha_ = 1;
Stage_ = 1;
StageCount_ = 0;
};
} else {
if (Stage_ == 1){
if (StageCount_ > 50){
StageCount_ = 0;
Stage_ = 2;
};
} else {
if (Stage_ == 2){
Alpha_ = (Alpha_ - (0.05 * Speed));
if (Alpha_ <= 0){
Alpha_ = 0;
Dead();
cmd = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd.UInt_Param1 = Constants.GST_LEVELMESSAGE_READY;
cmd.Ticks = 20;
};
};
};
};
} else {
if (Type == Constants.GST_LEVELMESSAGE_READY){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
x_ = (x_ + (dx * Speed));
if (x_ >= 185){
x_ = 185;
Stage_ = 1;
StageCount_ = 0;
};
} else {
if ((((Stage_ == 1)) && ((StageCount_ > 50)))){
x_ = (x_ + ((dx * 1.1) * Speed));
Alpha_ = (Alpha_ - (0.22 * Speed));
if (Alpha_ < 0){
Alpha_ = 0;
};
if (x_ > (Constants.SCREEN_WIDTH * 0.9)){
Alpha_ = 0;
Dead();
cmd = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_MAKELEVELMESSAGE, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
cmd.UInt_Param1 = Constants.GST_LEVELMESSAGE_GO;
};
};
};
} else {
if (Type == Constants.GST_LEVELMESSAGE_GO){
StageCount_ = (StageCount_ + Speed);
SetPos(new Point((LM_GO_STARTPOS.x + ((Math.random() - 0.5) * 7)), (LM_GO_STARTPOS.y + ((Math.random() - 0.5) * 7))));
if (Stage_ != 2){
Alpha_ = 1;
};
if ((((Stage_ == 0)) && ((StageCount_ > 5)))){
SpriteEngine_.UFOShooter1.CurrentLevel.ChangeLevelState(Constants.LS_PLAY);
StageCount_ = 0;
Stage_ = 1;
SpriteEngine_.UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_ENABLEALLWEAPONS);
SpriteEngine_.UFOShooter1.SoundEngine.StopCurrentStream();
SpriteEngine_.UFOShooter1.SoundEngine.PlayStream("GamePlay");
} else {
if ((((Stage_ == 1)) && ((StageCount_ > 20)))){
Stage_ = 2;
StageCount_ = 0;
} else {
if (Stage_ == 2){
Alpha_ = (Alpha_ - (0.2 * Speed));
if (Alpha_ <= 0){
Alpha_ = 0;
Dead();
};
};
};
};
} else {
if (Type == Constants.GST_LEVELMESSAGE_LEVELCOMPLETE){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
Alpha_ = (Alpha_ + (0.07 * Speed));
if (Alpha_ >= 1){
Alpha_ = 1;
Stage_ = 1;
StageCount_ = 0;
};
} else {
if (Stage_ == 1){
if (StageCount_ > 50){
StageCount_ = 0;
Stage_ = 2;
};
} else {
if (Stage_ == 2){
Alpha_ = (Alpha_ - (0.07 * Speed));
if (Alpha_ <= 0){
Stage_ = 3;
Alpha_ = 0;
Dead();
SpriteEngine_.UFOShooter1.Cross.SetVisible(false);
SpriteEngine_.UFOShooter1.Cross.ForceSetFlashSprite();
Mouse.show();
if (SpriteEngine_.UFOShooter1.CurrentLevel.isPlayable()){
SpriteEngine_.UFOShooter1.Player.CalcStatistic();
gs1 = SpriteEngine_.UFOShooter1.CurrentLevel.MakeStatPanel();
} else {
SpriteEngine_.UFOShooter1.ChangeGameLevel(Constants.GC_LevelNum, 1);
};
};
};
};
};
} else {
if (Type == Constants.GST_LEVELMESSAGE_YOULOSE){
StageCount_ = (StageCount_ + Speed);
if ((((Stage_ == 0)) && ((Alpha_ < 1)))){
Alpha_ = (Alpha_ + (0.05 * Speed));
if (Alpha_ > 1){
Alpha_ = 1;
StageCount_ = 0;
};
} else {
if (StageCount_ > 125){
Stage_ = 1;
};
};
if (Stage_ == 1){
Alpha_ = (Alpha_ - (0.05 * Speed));
if (Alpha_ <= 0){
Alpha_ = 0;
Dead();
SpriteEngine_.UFOShooter1.SoundEngine.StopCurrentStream();
SpriteEngine_.UFOShooter1.CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
SpriteEngine_.UFOShooter1.ChangeGameLevel(Constants.PS_LevelNum, 1);
SpriteEngine_.UFOShooter1.Cross.SetVisible(false);
SpriteEngine_.UFOShooter1.Cross.ForceSetFlashSprite();
Mouse.show();
};
};
} else {
if (Type == Constants.GST_PLAYERUFOSLEFT){
if (Scale_ > 1){
Scale_ = (Scale_ - (0.035 * Speed));
if (Scale_ < 1){
Scale_ = 1;
};
};
} else {
if (Type == Constants.GST_STATPANEL){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
Alpha_ = (Alpha_ + (0.07 * Speed));
if (Alpha_ >= 1){
Alpha_ = 1;
Stage_ = 2;
StageCount_ = 0;
c1 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_SHOWLINESTAT, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
c1.Int_Param1 = 1;
c1.Ticks = 11;
c2 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_SHOWLINESTAT, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
c2.Int_Param1 = 2;
c2.Ticks = 22;
c3 = SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_SHOWLINESTAT, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
c3.Int_Param1 = 3;
c3.Ticks = 33;
c4 = this.SpriteEngine_.UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_SHOWOKSTAT, Object(SpriteEngine_.UFOShooter1.CurrentLevel));
c4.Ticks = 44;
};
};
} else {
if (Type == Constants.GST_BOSS_BOOM_FLASH){
StageCount_ = (StageCount_ + Speed);
if (StageCount_ > 2){
Dead();
};
} else {
if (Type == Constants.GST_VICTORYMESSAGE){
StageCount_ = (StageCount_ + Speed);
ColorTransform_.redMultiplier = (0.4 + Math.random());
ColorTransform_.blueMultiplier = (0.4 + Math.random());
ColorTransform_.greenMultiplier = (0.4 + Math.random());
this.x_ = -170;
} else {
if ((((((Type == Constants.GST_WEAPON)) && (WeaponEnabled))) && ((WeaponType == Constants.WT_STATICLASER)))){
WeaponFireRateCount = (WeaponFireRateCount + Speed);
if (WeaponFireRateCount >= Constants.UPGRADE_STATICLASER_FIRERATE[(WeaponUpgradeNum - 1)]){
WeaponFireRateCount = 0;
SpriteEngine_.UFOShooter1.CurrentLevel.MakeStaticLaserBullet(WeaponIsLR, WeaponBulletPos, Constants.UPGRADE_STATICLASER_BULLETDAMAGE[(WeaponUpgradeNum - 1)]);
};
} else {
if ((((((Type == Constants.GST_WEAPON)) && (WeaponEnabled))) && ((WeaponType == Constants.WT_LASERTURRET)))){
WeaponFireRateCount = (WeaponFireRateCount + Speed);
if (WeaponFireRateCount >= Constants.UPGRADE_LASERTURRET_FIRERATE[(WeaponUpgradeNum - 1)]){
WeaponFireRateCount = 0;
SpriteEngine_.UFOShooter1.CurrentLevel.MakeLaserTurretBullet(WeaponIsLR, WeaponBulletPos, Constants.UPGRADE_LASERTURRET_BULLETDAMAGE[(WeaponUpgradeNum - 1)]);
};
} else {
if ((((((Type == Constants.GST_WEAPON)) && (WeaponEnabled))) && ((WeaponType == Constants.WT_PLASMACANNON)))){
WeaponFireRateCount = (WeaponFireRateCount + Speed);
if (WeaponFireRateCount >= Constants.UPGRADE_PLASMACANNON_FIRERATE[(WeaponUpgradeNum - 1)]){
WeaponFireRateCount = 0;
SpriteEngine_.UFOShooter1.CurrentLevel.MakePlasmaCannonBullet(WeaponIsLR, WeaponBulletPos, Constants.UPGRADE_PLASMACANNON_BULLETDAMAGE[(WeaponUpgradeNum - 1)]);
};
} else {
if ((((((Type == Constants.GST_WEAPON)) && (WeaponEnabled))) && ((WeaponType == Constants.WT_ROCKETLAUNCHER)))){
WeaponFireRateCount = (WeaponFireRateCount + Speed);
if (WeaponFireRateCount >= Constants.UPGRADE_ROCKETLAUNCHER_FIRERATE[(WeaponUpgradeNum - 1)]){
WeaponFireRateCount = 0;
SpriteEngine_.UFOShooter1.CurrentLevel.MakeRocketLauncherBullet(WeaponIsLR, WeaponBulletPos, Constants.UPGRADE_ROCKETLAUNCHER_BULLETDAMAGE[(WeaponUpgradeNum - 1)]);
};
} else {
if ((((((Type == Constants.GST_WEAPON)) && (WeaponEnabled))) && ((WeaponType == Constants.WT_ROCKETHEATLAUNCHER)))){
WeaponFireRateCount = (WeaponFireRateCount + Speed);
if (WeaponFireRateCount >= Constants.UPGRADE_ROCKETHEATLAUNCHER_FIRERATE[(WeaponUpgradeNum - 1)]){
WeaponFireRateCount = 0;
SpriteEngine_.UFOShooter1.CurrentLevel.MakeRocketHeatLauncherBullet(WeaponIsLR, WeaponBulletPos, Constants.UPGRADE_ROCKETHEATLAUNCHER_BULLETDAMAGE[(WeaponUpgradeNum - 1)]);
};
} else {
if (Type == Constants.GST_BOSS){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
BOSS_Fi = (BOSS_Fi + (BOSS_dFi * Speed));
x_ = (BOSS_CENTER.x + (BOSS_Radius * Math.cos(BOSS_Fi)));
y_ = (BOSS_CENTER.y + (BOSS_Radius * Math.sin(BOSS_Fi)));
if ((((((StageCount_ > BOSS_CriticalStageCount)) && ((y_ < (BOSS_CENTER.y - ((BOSS_Radius * 299) / 300)))))) && (WeaponEnabled))){
StageCount_ = 0;
Stage_ = 1;
};
} else {
if (Stage_ == 1){
if (StageCount_ > 30){
StageCount_ = 0;
Stage_ = 2;
(FlashSprite as MovieClip).gotoAndStop(2);
(hitArea as MovieClip).gotoAndStop(2);
};
} else {
if (Stage_ == 2){
if ((((((Math.round(StageCount_) == 20)) || ((Math.round(StageCount_) == 50)))) || ((Math.round(StageCount_) == 80)))){
gsUFO1 = SpriteEngine_.UFOShooter1.CurrentLevel.MakeUFOJustBornByBoss(new Point((x_ + 3), (y_ + 125)));
};
if (StageCount_ > 100){
StageCount_ = 0;
Stage_ = 3;
(FlashSprite as MovieClip).gotoAndStop(1);
(hitArea as MovieClip).gotoAndStop(1);
};
} else {
if (Stage_ == 3){
if (StageCount_ > 20){
StageCount_ = 0;
Stage_ = 0;
if (BOSS_dFi < 0.2){
BOSS_dFi = (BOSS_dFi * 1.1);
if (BOSS_dFi > 0.15){
BOSS_dFi = 0.15;
};
};
if (BOSS_CriticalStageCount > 54){
BOSS_CriticalStageCount = (BOSS_CriticalStageCount * (1 / 1.1));
};
};
};
};
};
};
} else {
if (Type == Constants.GST_WEAPONINFO_MOVIE){
if (FlashSprite != null){
SpriteEngine_.UFOShooter1.Player.WeaponInfoMovieFrame = (FlashSprite as MovieClip).currentFrame;
} else {
SpriteEngine_.UFOShooter1.Player.WeaponInfoMovieFrame = 1;
};
} else {
if (Type == Constants.GST_SHINESTAR){
StageCount_ = (StageCount_ + Speed);
if (Stage_ == 0){
Alpha_ = (Alpha_ + (0.045 * Speed));
Rotation_ = (Rotation_ + (1.2 * Speed));
Scale_ = (Scale_ + (0.035 * Speed));
if (Scale_ > 1){
Scale_ = 1;
};
if (Alpha_ >= 1.2){
Stage_ = 1;
StageCount_ = 0;
};
} else {
if (Stage_ == 1){
Rotation_ = (Rotation_ + (1.2 * Speed));
if (StageCount_ >= 10){
Stage_ = 2;
StageCount_ = 0;
};
} else {
if (Stage_ == 2){
Alpha_ = (Alpha_ - (0.03 * Speed));
Rotation_ = (Rotation_ + (1 * Speed));
Scale_ = (Scale_ - (0.02 * Speed));
if ((((Alpha_ <= 0)) || ((Scale_ <= 0)))){
Alpha_ = 0;
Scale_ = 0;
Dead();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
ForceSetFlashSprite();
}
}
}//package
Section 387
//TGUI_FORM1 (TGUI_FORM1)
package {
import flash.display.*;
public dynamic class TGUI_FORM1 extends MovieClip {
}
}//package
Section 388
//TGUI_FORM1_HELP (TGUI_FORM1_HELP)
package {
import flash.display.*;
public dynamic class TGUI_FORM1_HELP extends SimpleButton {
}
}//package
Section 389
//TGUI_FORM1_PLAY (TGUI_FORM1_PLAY)
package {
import flash.display.*;
public dynamic class TGUI_FORM1_PLAY extends SimpleButton {
}
}//package
Section 390
//TGUI_FORM1_SCORES (TGUI_FORM1_SCORES)
package {
import flash.display.*;
public dynamic class TGUI_FORM1_SCORES extends SimpleButton {
}
}//package
Section 391
//TGUI_FORM1_SPONSORLOGO1 (TGUI_FORM1_SPONSORLOGO1)
package {
import flash.display.*;
public dynamic class TGUI_FORM1_SPONSORLOGO1 extends SimpleButton {
}
}//package
Section 392
//TGUI_FORM1_SPONSORMOREGAME (TGUI_FORM1_SPONSORMOREGAME)
package {
import flash.display.*;
public dynamic class TGUI_FORM1_SPONSORMOREGAME extends SimpleButton {
}
}//package
Section 393
//TGUI_FORM10 (TGUI_FORM10)
package {
import flash.display.*;
public dynamic class TGUI_FORM10 extends MovieClip {
}
}//package
Section 394
//TGUI_FORM10_MAINMENU (TGUI_FORM10_MAINMENU)
package {
import flash.display.*;
public dynamic class TGUI_FORM10_MAINMENU extends SimpleButton {
}
}//package
Section 395
//TGUI_FORM10_PANEL (TGUI_FORM10_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM10_PANEL extends MovieClip {
}
}//package
Section 396
//TGUI_FORM10_PLAY (TGUI_FORM10_PLAY)
package {
import flash.display.*;
public dynamic class TGUI_FORM10_PLAY extends SimpleButton {
}
}//package
Section 397
//TGUI_FORM11 (TGUI_FORM11)
package {
import flash.display.*;
public dynamic class TGUI_FORM11 extends MovieClip {
}
}//package
Section 398
//TGUI_FORM11_OK (TGUI_FORM11_OK)
package {
import flash.display.*;
public dynamic class TGUI_FORM11_OK extends SimpleButton {
}
}//package
Section 399
//TGUI_FORM11_PANEL (TGUI_FORM11_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM11_PANEL extends MovieClip {
}
}//package
Section 400
//TGUI_FORM2_MENU (TGUI_FORM2_MENU)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_MENU extends SimpleButton {
}
}//package
Section 401
//TGUI_FORM2_QHI (TGUI_FORM2_QHI)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_QHI extends SimpleButton {
}
}//package
Section 402
//TGUI_FORM2_QLOW (TGUI_FORM2_QLOW)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_QLOW extends SimpleButton {
}
}//package
Section 403
//TGUI_FORM2_QMED (TGUI_FORM2_QMED)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_QMED extends SimpleButton {
}
}//package
Section 404
//TGUI_FORM2_SOUNDOFF (TGUI_FORM2_SOUNDOFF)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_SOUNDOFF extends SimpleButton {
}
}//package
Section 405
//TGUI_FORM2_SOUNDON (TGUI_FORM2_SOUNDON)
package {
import flash.display.*;
public dynamic class TGUI_FORM2_SOUNDON extends SimpleButton {
}
}//package
Section 406
//TGUI_FORM3_OK (TGUI_FORM3_OK)
package {
import flash.display.*;
public dynamic class TGUI_FORM3_OK extends SimpleButton {
}
}//package
Section 407
//TGUI_FORM3_PANEL (TGUI_FORM3_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM3_PANEL extends MovieClip {
}
}//package
Section 408
//TGUI_FORM4_PANEL (TGUI_FORM4_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM4_PANEL extends MovieClip {
}
}//package
Section 409
//TGUI_FORM5_ACTIVATE (TGUI_FORM5_ACTIVATE)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_ACTIVATE extends SimpleButton {
}
}//package
Section 410
//TGUI_FORM5_ALIENLABBUY (TGUI_FORM5_ALIENLABBUY)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_ALIENLABBUY extends SimpleButton {
}
}//package
Section 411
//TGUI_FORM5_DEACTIVATE (TGUI_FORM5_DEACTIVATE)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_DEACTIVATE extends SimpleButton {
}
}//package
Section 412
//TGUI_FORM5_MAINGUNUPGRADE (TGUI_FORM5_MAINGUNUPGRADE)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_MAINGUNUPGRADE extends SimpleButton {
}
}//package
Section 413
//TGUI_FORM5_PLAY (TGUI_FORM5_PLAY)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_PLAY extends SimpleButton {
}
}//package
Section 414
//TGUI_FORM5_UFOTEST (TGUI_FORM5_UFOTEST)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_UFOTEST extends SimpleButton {
}
}//package
Section 415
//TGUI_FORM5_WEAPONBUY (TGUI_FORM5_WEAPONBUY)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_WEAPONBUY extends SimpleButton {
}
}//package
Section 416
//TGUI_FORM5_WEAPONUPGRADE (TGUI_FORM5_WEAPONUPGRADE)
package {
import flash.display.*;
public dynamic class TGUI_FORM5_WEAPONUPGRADE extends SimpleButton {
}
}//package
Section 417
//TGUI_FORM6_OK (TGUI_FORM6_OK)
package {
import flash.display.*;
public dynamic class TGUI_FORM6_OK extends SimpleButton {
}
}//package
Section 418
//TGUI_FORM7 (TGUI_FORM7)
package {
import flash.display.*;
public dynamic class TGUI_FORM7 extends MovieClip {
}
}//package
Section 419
//TGUI_FORM7_BUY (TGUI_FORM7_BUY)
package {
import flash.display.*;
public dynamic class TGUI_FORM7_BUY extends SimpleButton {
}
}//package
Section 420
//TGUI_FORM7_CANCEL (TGUI_FORM7_CANCEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM7_CANCEL extends SimpleButton {
}
}//package
Section 421
//TGUI_FORM7_NEXT (TGUI_FORM7_NEXT)
package {
import flash.display.*;
public dynamic class TGUI_FORM7_NEXT extends SimpleButton {
}
}//package
Section 422
//TGUI_FORM7_PANEL (TGUI_FORM7_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM7_PANEL extends MovieClip {
}
}//package
Section 423
//TGUI_FORM7_PREV (TGUI_FORM7_PREV)
package {
import flash.display.*;
public dynamic class TGUI_FORM7_PREV extends SimpleButton {
}
}//package
Section 424
//TGUI_FORM7a (TGUI_FORM7a)
package {
import flash.display.*;
public dynamic class TGUI_FORM7a extends MovieClip {
}
}//package
Section 425
//TGUI_FORM8 (TGUI_FORM8)
package {
import flash.display.*;
public dynamic class TGUI_FORM8 extends MovieClip {
}
}//package
Section 426
//TGUI_FORM8_CLOSE (TGUI_FORM8_CLOSE)
package {
import flash.display.*;
public dynamic class TGUI_FORM8_CLOSE extends SimpleButton {
}
}//package
Section 427
//TGUI_FORM8_PANEL (TGUI_FORM8_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM8_PANEL extends MovieClip {
}
}//package
Section 428
//TGUI_FORM8_SELL (TGUI_FORM8_SELL)
package {
import flash.display.*;
public dynamic class TGUI_FORM8_SELL extends SimpleButton {
}
}//package
Section 429
//TGUI_FORM8_UPGRADE (TGUI_FORM8_UPGRADE)
package {
import flash.display.*;
public dynamic class TGUI_FORM8_UPGRADE extends SimpleButton {
}
}//package
Section 430
//TGUI_FORM8a (TGUI_FORM8a)
package {
import flash.display.*;
public dynamic class TGUI_FORM8a extends MovieClip {
}
}//package
Section 431
//TGUI_FORM9 (TGUI_FORM9)
package {
import flash.display.*;
public dynamic class TGUI_FORM9 extends MovieClip {
}
}//package
Section 432
//TGUI_FORM9_NO (TGUI_FORM9_NO)
package {
import flash.display.*;
public dynamic class TGUI_FORM9_NO extends SimpleButton {
}
}//package
Section 433
//TGUI_FORM9_PANEL (TGUI_FORM9_PANEL)
package {
import flash.display.*;
public dynamic class TGUI_FORM9_PANEL extends MovieClip {
}
}//package
Section 434
//TGUI_FORM9_YES (TGUI_FORM9_YES)
package {
import flash.display.*;
public dynamic class TGUI_FORM9_YES extends SimpleButton {
}
}//package
Section 435
//TGUI_WEAPONMOVIE1 (TGUI_WEAPONMOVIE1)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE1 extends MovieClip {
}
}//package
Section 436
//TGUI_WEAPONMOVIE2 (TGUI_WEAPONMOVIE2)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE2 extends MovieClip {
}
}//package
Section 437
//TGUI_WEAPONMOVIE3 (TGUI_WEAPONMOVIE3)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE3 extends MovieClip {
}
}//package
Section 438
//TGUI_WEAPONMOVIE4 (TGUI_WEAPONMOVIE4)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE4 extends MovieClip {
}
}//package
Section 439
//TGUI_WEAPONMOVIE5 (TGUI_WEAPONMOVIE5)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE5 extends MovieClip {
}
}//package
Section 440
//TGUI_WEAPONMOVIE6 (TGUI_WEAPONMOVIE6)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE6 extends MovieClip {
}
}//package
Section 441
//TGUI_WEAPONMOVIE7 (TGUI_WEAPONMOVIE7)
package {
import flash.display.*;
public dynamic class TGUI_WEAPONMOVIE7 extends MovieClip {
}
}//package
Section 442
//TLaserExplode (TLaserExplode)
package {
import flash.display.*;
public dynamic class TLaserExplode extends MovieClip {
}
}//package
Section 443
//TLaserTurretBulletLR (TLaserTurretBulletLR)
package {
import flash.display.*;
public dynamic class TLaserTurretBulletLR extends MovieClip {
}
}//package
Section 444
//TLaserTurretBulletLR_hitArea (TLaserTurretBulletLR_hitArea)
package {
import flash.display.*;
public dynamic class TLaserTurretBulletLR_hitArea extends MovieClip {
}
}//package
Section 445
//TLaserTurretBulletRL (TLaserTurretBulletRL)
package {
import flash.display.*;
public dynamic class TLaserTurretBulletRL extends MovieClip {
}
}//package
Section 446
//TLaserTurretBulletRL_hitArea (TLaserTurretBulletRL_hitArea)
package {
import flash.display.*;
public dynamic class TLaserTurretBulletRL_hitArea extends MovieClip {
}
}//package
Section 447
//TLaserTurretL (TLaserTurretL)
package {
import flash.display.*;
public dynamic class TLaserTurretL extends MovieClip {
}
}//package
Section 448
//TLaserTurretR (TLaserTurretR)
package {
import flash.display.*;
public dynamic class TLaserTurretR extends MovieClip {
}
}//package
Section 449
//TMenuMusic (TMenuMusic)
package {
import flash.media.*;
public dynamic class TMenuMusic extends Sound {
}
}//package
Section 450
//TMuteMusic (TMuteMusic)
package {
import flash.media.*;
public dynamic class TMuteMusic extends Sound {
}
}//package
Section 451
//TPlasmaCannonBullet (TPlasmaCannonBullet)
package {
import flash.display.*;
public dynamic class TPlasmaCannonBullet extends MovieClip {
}
}//package
Section 452
//TPlasmaCannonBullet_hitArea (TPlasmaCannonBullet_hitArea)
package {
import flash.display.*;
public dynamic class TPlasmaCannonBullet_hitArea extends MovieClip {
}
}//package
Section 453
//TPlasmaCannonL (TPlasmaCannonL)
package {
import flash.display.*;
public dynamic class TPlasmaCannonL extends MovieClip {
}
}//package
Section 454
//TPlasmaCannonR (TPlasmaCannonR)
package {
import flash.display.*;
public dynamic class TPlasmaCannonR extends MovieClip {
}
}//package
Section 455
//TPlayer (TPlayer)
package {
public class TPlayer {
public var WeaponBuyPanel:TGameSprite;// = null
public var LevelNum:uint;// = 0
public var isFirstRun:Boolean;// = true
public var PlayerScore:TGameSprite;// = null
public var MenuButton:TGUI_FORM2_MENU;// = null
public var QualityButtonMED:TGUI_FORM2_QMED;// = null
public var PlayerMiss:uint;// = 0
public var UFOShooter1:UFOShooter;// = null
public var StatLine2:uint;// = 0
public var StatLine3:uint;// = 0
public var PlayerName:String;// = ""
public var SoundButtonOff:TGUI_FORM2_SOUNDOFF;// = null
public var StatLine1:uint;// = 0
public var PostScoresInputField:TGameSprite;// = null
public var QualityButtonLOW:TGUI_FORM2_QLOW;// = null
public var Weapons:Array;
public var PlayerShots:uint;// = 0
public var QualityButtonHI:TGUI_FORM2_QHI;// = null
public var SoundButtonOn:TGUI_FORM2_SOUNDON;// = null
public var WeaponInfoMovieFrame:int;// = 1
public var WeaponsBuy:Array;
public var Cash:uint;// = 5000
public var PlayerCash:TGameSprite;// = null
public var VictorySprite:TGameSprite;// = null
public var Quality:String;// = "best"
public var WeaponSellQPanel:TGameSprite;// = null
public var WeaponBuyPosNum:int;// = 0
public var UFOsShooted:uint;// = 0
public var Score:uint;// = 0
public var WeaponUpgradeSellPosNum:int;// = 0
public var WeaponUpgradeSellPanel:TGameSprite;// = null
public var UFOsLeft:int;// = 0
public var PlayerUFOsLeft:TGameSprite;// = null
public function TPlayer(){
Weapons = new Array();
WeaponsBuy = new Array();
super();
NewGame();
}
public function ConvertFireRate(FireRateStart:int, FireRateCurrent:int):int{
var r:int = FireRateStart;
r = (FireRateStart + Math.abs((FireRateStart - FireRateCurrent)));
return (r);
}
public function AddUFOsLeft(UFOsLeft_:int):void{
var cmd:TGameCommand;
if ((((((UFOShooter1 == null)) || ((UFOShooter1.CurrentLevel == null)))) || (((((!(UFOShooter1.CurrentLevel.isPlayable())) && (!((UFOShooter1.CurrentLevel.LevelNum == Constants.BOSS_LevelNum))))) && (!((UFOShooter1.CurrentLevel.LevelNum == Constants.HELP_LevelNum))))))){
return;
};
if (((((!((UFOsLeft == 0))) && (!((UFOsLeft_ == 0))))) && ((UFOShooter1.CurrentLevel.GetLevelState() == Constants.LS_PLAY)))){
PlayerUFOsLeft.Scale_ = 1.4;
UFOShooter1.SoundEngine.PlaySample("UFOLeft");
};
if (UFOShooter1.CurrentLevel.LevelNum != Constants.HELP_LevelNum){
UFOsLeft = (UFOsLeft + UFOsLeft_);
};
if (UFOsLeft < 0){
UFOsLeft = 0;
};
if (PlayerUFOsLeft != null){
PlayerUFOsLeft.TextField_.text = (" x " + UFOsLeft.toString());
if (UFOsLeft < 10){
PlayerUFOsLeft.TextFormat_.color = 4294906129;
};
PlayerUFOsLeft.TextField_.setTextFormat(PlayerUFOsLeft.TextFormat_);
};
if ((((UFOsLeft == 0)) && (!((UFOShooter1.CurrentLevel.GetLevelState() == Constants.LS_YOULOSE))))){
UFOShooter1.CurrentLevel.ChangeLevelState(Constants.LS_YOULOSE);
UFOShooter1.CurrentLevel.MakeLevelMessage(Constants.GST_LEVELMESSAGE_YOULOSE);
cmd = UFOShooter1.CommandProcessor.CommandAdd(Constants.CMD_DISABLEALLWEAPONS, Object(UFOShooter1.CurrentLevel));
cmd.Ticks = 5;
UFOShooter1.CurrentLevel.UFO_BornCount = 0;
UFOShooter1.CurrentLevel.UFO_NextBorn = Constants.YOULOSE_UFONEXTBORN;
UFOShooter1.SoundEngine.PlaySample("YouLose");
};
}
public function NewGame():void{
LevelNum = Constants.STARTUP_LEVELNUM;
Score = 0;
Cash = Constants.STARTUP_PLAYERCASH;
UFOsLeft = Constants.UFOSLEFT;
NewLevel();
while (Weapons.length > 0) {
Weapons.pop();
};
Weapons.push(new TPlayerWeaponInfo(0, Constants.WT_MAINGUN, 1));
}
public function GetWeaponIndexByPosNum(PosNum:int):int{
var pwi:TPlayerWeaponInfo;
var i:int;
if (Weapons.length > 0){
i = 0;
while (i < Weapons.length) {
pwi = TPlayerWeaponInfo(Weapons[i]);
if (pwi.PosNum == PosNum){
return (i);
};
i++;
};
};
return (-1);
}
public function Weapons_SellCurrent():Boolean{
var i:int = GetWeaponIndexByPosNum(WeaponUpgradeSellPosNum);
if (i == -1){
return (false);
};
var pwi:TPlayerWeaponInfo = Weapons[i];
AddCash(Math.round((pwi.TotalCost * Constants.SELL_PROC)));
Weapons.splice(i, 1);
return (true);
}
public function AddScore(Score_:int):void{
if ((((((UFOShooter1 == null)) || ((UFOShooter1.CurrentLevel == null)))) || (((!(UFOShooter1.CurrentLevel.isPlayable())) && (!((UFOShooter1.CurrentLevel.LevelNum == Constants.BOSS_LevelNum))))))){
return;
};
Score = (Score + Score_);
if (PlayerScore != null){
PlayerScore.TextField_.text = (Constants.STR_PLAYERSCORE + Score.toString());
PlayerScore.TextField_.setTextFormat(PlayerScore.TextFormat_);
};
}
public function Update(Speed:Number):void{
if (((((Constants.USE_DEBUG) && (Constants.USE_DEBUG_TESTSPRITESCOUNT))) && (!((PlayerScore == null))))){
PlayerScore.TextField_.text = ((UFOShooter1.SpriteEngine_.Items.length.toString() + "/") + UFOShooter1.BGSpriteEngine.Items.length.toString());
PlayerScore.TextField_.setTextFormat(PlayerScore.TextFormat_);
};
}
public function WeaponsBuy_BuyCurrent():Boolean{
if ((((((WeaponsBuy.length == 0)) || ((WeaponBuyPosNum < 1)))) || ((WeaponBuyPosNum > 8)))){
return (false);
};
var pwi:TPlayerWeaponInfo = new TPlayerWeaponInfo(WeaponBuyPosNum, int(WeaponsBuy[0]), 1);
if (Cash < Constants.COST_WEAPON[(pwi.WeaponType - 1)]){
return (false);
};
AddCash(-(Constants.COST_WEAPON[(pwi.WeaponType - 1)]));
pwi.TotalCost = Constants.COST_WEAPON[(pwi.WeaponType - 1)];
Weapons.push(pwi);
return (true);
}
public function GetDamageByWTUN(WeaponType:uint, UpgradeNum:uint):uint{
if ((((UpgradeNum < 1)) || ((UpgradeNum > Constants.UPGRADE_MAX)))){
return (0);
};
if (WeaponType == Constants.WT_STATICLASER){
return (Constants.UPGRADE_STATICLASER_BULLETDAMAGE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_LASERTURRET){
return (Constants.UPGRADE_LASERTURRET_BULLETDAMAGE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_PLASMACANNON){
return (Constants.UPGRADE_PLASMACANNON_BULLETDAMAGE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETLAUNCHER){
return (Constants.UPGRADE_ROCKETLAUNCHER_BULLETDAMAGE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETHEATLAUNCHER){
return (Constants.UPGRADE_ROCKETHEATLAUNCHER_BULLETDAMAGE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_MAINGUN){
return (Constants.UPGRADE_MAINGUN_BULLETDAMAGE[(UpgradeNum - 1)]);
};
return (0);
}
public function WeaponsBuyPrev():void{
if (WeaponsBuy.length <= 0){
return;
};
var i:uint = WeaponsBuy.pop();
WeaponsBuy.unshift(i);
}
public function GetFireRateByWTUN(WeaponType:uint, UpgradeNum:uint):uint{
if ((((UpgradeNum < 1)) || ((UpgradeNum > Constants.UPGRADE_MAX)))){
return (0);
};
if (WeaponType == Constants.WT_STATICLASER){
return (Constants.UPGRADE_STATICLASER_FIRERATE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_LASERTURRET){
return (Constants.UPGRADE_LASERTURRET_FIRERATE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_PLASMACANNON){
return (Constants.UPGRADE_PLASMACANNON_FIRERATE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETLAUNCHER){
return (Constants.UPGRADE_ROCKETLAUNCHER_FIRERATE[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETHEATLAUNCHER){
return (Constants.UPGRADE_ROCKETHEATLAUNCHER_FIRERATE[(UpgradeNum - 1)]);
};
return (0);
}
public function WeaponsBuyStart(PosNum:int):void{
while (WeaponsBuy.length > 0) {
WeaponsBuy.pop();
};
if (PosNum == 0){
} else {
if (PosNum > 6){
WeaponsBuy.push(Constants.WT_ALIENLAB);
} else {
WeaponsBuy.push(Constants.WT_LASERTURRET, Constants.WT_STATICLASER, Constants.WT_ROCKETLAUNCHER, Constants.WT_ROCKETHEATLAUNCHER, Constants.WT_PLASMACANNON);
};
};
}
public function Weapons_UpgradeCurrent():Boolean{
var i:int = GetWeaponIndexByPosNum(WeaponUpgradeSellPosNum);
if (i == -1){
return (false);
};
var pwi:TPlayerWeaponInfo = Weapons[i];
if (pwi.UpgradeNum >= Constants.UPGRADE_MAX){
return (false);
};
var UpgradeCost:uint = GetCostUpgradeByWTUN(pwi.WeaponType, (pwi.UpgradeNum + 1));
if (UpgradeCost > Cash){
return (false);
};
AddCash(-(UpgradeCost));
pwi.UpgradeNum++;
pwi.TotalCost = (pwi.TotalCost + UpgradeCost);
return (true);
}
public function GetCostUpgradeByWTUN(WeaponType:uint, UpgradeNum:uint):uint{
if ((((UpgradeNum < 1)) || ((UpgradeNum > Constants.UPGRADE_MAX)))){
return (0);
};
if (WeaponType == Constants.WT_STATICLASER){
return (Constants.COST_UPGRADE_STATICLASER[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_LASERTURRET){
return (Constants.COST_UPGRADE_LASERTURRET[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_PLASMACANNON){
return (Constants.COST_UPGRADE_PLASMACANNON[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETLAUNCHER){
return (Constants.COST_UPGRADE_ROCKETLAUNCHER[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ROCKETHEATLAUNCHER){
return (Constants.COST_UPGRADE_ROCKETHEATLAUNCHER[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_ALIENLAB){
return (Constants.COST_UPGRADE_ALIENLAB[(UpgradeNum - 1)]);
};
if (WeaponType == Constants.WT_MAINGUN){
return (Constants.COST_UPGRADE_MAINGUN[(UpgradeNum - 1)]);
};
return (0);
}
public function NewLevel():void{
StatLine1 = 0;
StatLine2 = 0;
StatLine3 = 0;
PlayerMiss = 0;
PlayerShots = 0;
UFOsShooted = 0;
AddScore(0);
AddCash(0);
AddUFOsLeft(0);
}
public function CalcStatistic():void{
if ((((PlayerMiss == 0)) || ((PlayerShots == 0)))){
StatLine1 = 100;
} else {
StatLine1 = Math.round(((100 * (PlayerShots - PlayerMiss)) / PlayerShots));
};
if (StatLine1 < 0){
StatLine1 = 0;
};
if (StatLine1 > 100){
StatLine1 = 100;
};
StatLine2 = (UFOsShooted * 100);
StatLine3 = (UFOsLeft * 100);
}
public function AddCash(Cash_:int):void{
if ((((UFOShooter1 == null)) || ((UFOShooter1.CurrentLevel == null)))){
return;
};
Cash = (Cash + Cash_);
if (PlayerCash != null){
PlayerCash.TextField_.text = (Constants.STR_PLAYERCASH + Cash.toString());
PlayerCash.TextField_.setTextFormat(PlayerCash.TextFormat_);
};
}
public function WeaponsBuyNext():void{
if (WeaponsBuy.length <= 0){
return;
};
var i:uint = WeaponsBuy.shift();
WeaponsBuy.push(i);
}
}
}//package
Section 456
//TPlayerWeaponInfo (TPlayerWeaponInfo)
package {
public class TPlayerWeaponInfo {
public var TotalCost:int;// = 0
public var PosNum:int;// = 0
public var WeaponType:int;// = 0
public var UpgradeNum:int;// = 0
public function TPlayerWeaponInfo(PosNum_:int, WeaponType_:int, UpgradeNum_:int){
super();
PosNum = PosNum_;
WeaponType = WeaponType_;
UpgradeNum = UpgradeNum_;
TotalCost = 0;
}
}
}//package
Section 457
//TROCKETEXPLODE (TROCKETEXPLODE)
package {
import flash.display.*;
public dynamic class TROCKETEXPLODE extends MovieClip {
}
}//package
Section 458
//TRocketHeatLauncherBullet (TRocketHeatLauncherBullet)
package {
import flash.display.*;
public dynamic class TRocketHeatLauncherBullet extends MovieClip {
}
}//package
Section 459
//TRocketHeatLauncherL (TRocketHeatLauncherL)
package {
import flash.display.*;
public dynamic class TRocketHeatLauncherL extends MovieClip {
}
}//package
Section 460
//TRocketHeatLauncherR (TRocketHeatLauncherR)
package {
import flash.display.*;
public dynamic class TRocketHeatLauncherR extends MovieClip {
}
}//package
Section 461
//TRocketLauncherBullet_hitArea (TRocketLauncherBullet_hitArea)
package {
import flash.display.*;
public dynamic class TRocketLauncherBullet_hitArea extends MovieClip {
}
}//package
Section 462
//TRocketLauncherBulletLR (TRocketLauncherBulletLR)
package {
import flash.display.*;
public dynamic class TRocketLauncherBulletLR extends MovieClip {
}
}//package
Section 463
//TRocketLauncherBulletRL (TRocketLauncherBulletRL)
package {
import flash.display.*;
public dynamic class TRocketLauncherBulletRL extends MovieClip {
}
}//package
Section 464
//TRocketLauncherL (TRocketLauncherL)
package {
import flash.display.*;
public dynamic class TRocketLauncherL extends MovieClip {
}
}//package
Section 465
//TRocketLauncherR (TRocketLauncherR)
package {
import flash.display.*;
public dynamic class TRocketLauncherR extends MovieClip {
}
}//package
Section 466
//TSND_AlienCatch (TSND_AlienCatch)
package {
import flash.media.*;
public dynamic class TSND_AlienCatch extends Sound {
}
}//package
Section 467
//TSND_ButtonPress (TSND_ButtonPress)
package {
import flash.media.*;
public dynamic class TSND_ButtonPress extends Sound {
}
}//package
Section 468
//TSND_Cash (TSND_Cash)
package {
import flash.media.*;
public dynamic class TSND_Cash extends Sound {
}
}//package
Section 469
//TSND_Failed (TSND_Failed)
package {
import flash.media.*;
public dynamic class TSND_Failed extends Sound {
}
}//package
Section 470
//TSND_LevelClear (TSND_LevelClear)
package {
import flash.media.*;
public dynamic class TSND_LevelClear extends Sound {
}
}//package
Section 471
//TSND_PlayerMiss (TSND_PlayerMiss)
package {
import flash.media.*;
public dynamic class TSND_PlayerMiss extends Sound {
}
}//package
Section 472
//TSND_UFOExp1 (TSND_UFOExp1)
package {
import flash.media.*;
public dynamic class TSND_UFOExp1 extends Sound {
}
}//package
Section 473
//TSND_UFOExp2 (TSND_UFOExp2)
package {
import flash.media.*;
public dynamic class TSND_UFOExp2 extends Sound {
}
}//package
Section 474
//TSND_UFOExp3 (TSND_UFOExp3)
package {
import flash.media.*;
public dynamic class TSND_UFOExp3 extends Sound {
}
}//package
Section 475
//TSND_UFOExp4 (TSND_UFOExp4)
package {
import flash.media.*;
public dynamic class TSND_UFOExp4 extends Sound {
}
}//package
Section 476
//TSND_UFOHit1 (TSND_UFOHit1)
package {
import flash.media.*;
public dynamic class TSND_UFOHit1 extends Sound {
}
}//package
Section 477
//TSND_UFOHit2 (TSND_UFOHit2)
package {
import flash.media.*;
public dynamic class TSND_UFOHit2 extends Sound {
}
}//package
Section 478
//TSND_UFOHit3 (TSND_UFOHit3)
package {
import flash.media.*;
public dynamic class TSND_UFOHit3 extends Sound {
}
}//package
Section 479
//TSND_UFOLeft (TSND_UFOLeft)
package {
import flash.media.*;
public dynamic class TSND_UFOLeft extends Sound {
}
}//package
Section 480
//TSND_YouLose (TSND_YouLose)
package {
import flash.media.*;
public dynamic class TSND_YouLose extends Sound {
}
}//package
Section 481
//TSoundEngine (TSoundEngine)
package {
import flash.media.*;
import flash.events.*;
public class TSoundEngine {
private var CurrentStreamPosition:Number;// = 0
private var SND_UFOHit1:TSND_UFOHit1;
private var SND_UFOHit2:TSND_UFOHit2;
private var SND_UFOHit3:TSND_UFOHit3;
private var SND_Cash:TSND_Cash;
private var SND_AlienCatch:TSND_AlienCatch;
private var GamePlay1:TGamePlay1Music;
private var GamePlay2:TGamePlay2Music;
private var GamePlay3:TGamePlay3Music;
private var GamePlay4:TGamePlay4Music;
private var SND_UFOLeft:TSND_UFOLeft;
private var SND_Failed:TSND_Failed;
private var SND_ButtonPress:TSND_ButtonPress;
private var SamplesCount:int;// = 0
private var CurrentStreamChn:SoundChannel;
public var CurrentStream:String;// = ""
private var SND_UFOExp1:TSND_UFOExp1;
private var SND_UFOExp2:TSND_UFOExp2;
private var SND_UFOExp3:TSND_UFOExp3;
private var SND_UFOExp4:TSND_UFOExp4;
private var SND_YouLose:TSND_YouLose;
private var SND_PlayerMiss:TSND_PlayerMiss;
public var isMuted:Boolean;// = false
private var SoundMixerDVolume:Number;// = 0
private var MenuMusic:TMenuMusic;
private var SND_LevelClear:TSND_LevelClear;
private static var CONST_STREAMVOLUME:Number = 0.4;
private static var CONST_DEFAULTMUTESPEED:Number = 0.05;
private static var CONST_MAXSAMPLESCOUNT:int = 5;
public function TSoundEngine(){
super();
var MuteMusic:TMuteMusic = new TMuteMusic();
CurrentStreamChn = MuteMusic.play(0, 1);
}
public function SampleComplete(event:Event):void{
SamplesCount--;
}
public function PlaySample(SampleName:String, IgnoreSamplesCount:Boolean=false):void{
if (((IgnoreSamplesCount) && ((SamplesCount >= CONST_MAXSAMPLESCOUNT)))){
return;
};
fPlaySample(SampleName);
}
public function fPlaySample(SampleName:String):void{
var sc:SoundChannel;
if (SampleName == "UFOExplosion"){
fPlaySample(("UFOExplosion" + Math.round((1 + (Math.random() * 3)))));
} else {
if (SampleName == "UFOExplosion1"){
sc = SND_UFOExp1.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOExplosion2"){
sc = SND_UFOExp2.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOExplosion3"){
sc = SND_UFOExp3.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOExplosion4"){
sc = SND_UFOExp4.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOHit"){
fPlaySample(("UFOHit" + Math.round((1 + (Math.random() * 2)))));
} else {
if (SampleName == "UFOHit1"){
sc = SND_UFOHit1.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOHit2"){
sc = SND_UFOHit2.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOHit3"){
sc = SND_UFOHit3.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if ((((SampleName == "PlayerMiss")) && ((SamplesCount <= 0)))){
sc = SND_PlayerMiss.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "UFOLeft"){
sc = SND_UFOLeft.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "ButtonPress"){
sc = SND_ButtonPress.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
} else {
if (SampleName == "Cash"){
sc = SND_Cash.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "Failed"){
sc = SND_Failed.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "LevelClear"){
sc = SND_LevelClear.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "YouLose"){
sc = SND_YouLose.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
} else {
if (SampleName == "AlienCatch"){
sc = SND_AlienCatch.play();
sc.addEventListener(Event.SOUND_COMPLETE, SampleComplete);
SamplesCount++;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function Test1():void{
}
public function StopCurrentStream():void{
if (CurrentStreamChn){
CurrentStreamChn.stop();
CurrentStream = "";
};
}
private function fPlayStream(StreamName:String, StartTime:Number=0):void{
if (!CurrentStreamChn){
return;
};
if (StreamName == "MenuMusic"){
CurrentStreamChn = MenuMusic.play(StartTime, int.MAX_VALUE);
} else {
if (StreamName == "GamePlay"){
fPlayStream(("GamePlay" + Math.round((1 + (Math.random() * 3)))), StartTime);
} else {
if (StreamName == "GamePlay1"){
CurrentStreamChn = GamePlay1.play(StartTime, int.MAX_VALUE);
} else {
if (StreamName == "GamePlay2"){
CurrentStreamChn = GamePlay2.play(StartTime, int.MAX_VALUE);
} else {
if (StreamName == "GamePlay3"){
CurrentStreamChn = GamePlay3.play(StartTime, int.MAX_VALUE);
} else {
if (StreamName == "GamePlay4"){
CurrentStreamChn = GamePlay4.play(StartTime, int.MAX_VALUE);
};
};
};
};
};
};
var st:SoundTransform = new SoundTransform();
st.volume = 1;
CurrentStreamChn.soundTransform = st;
}
public function CreateAll():void{
MenuMusic = new TMenuMusic();
GamePlay1 = new TGamePlay1Music();
GamePlay2 = new TGamePlay2Music();
GamePlay3 = new TGamePlay3Music();
GamePlay4 = new TGamePlay4Music();
SND_UFOExp1 = new TSND_UFOExp1();
SND_UFOExp2 = new TSND_UFOExp2();
SND_UFOExp3 = new TSND_UFOExp3();
SND_UFOExp4 = new TSND_UFOExp4();
SND_PlayerMiss = new TSND_PlayerMiss();
SND_LevelClear = new TSND_LevelClear();
SND_ButtonPress = new TSND_ButtonPress();
SND_Cash = new TSND_Cash();
SND_Failed = new TSND_Failed();
SND_YouLose = new TSND_YouLose();
SND_AlienCatch = new TSND_AlienCatch();
SND_UFOHit1 = new TSND_UFOHit1();
SND_UFOHit2 = new TSND_UFOHit2();
SND_UFOHit3 = new TSND_UFOHit3();
SND_UFOLeft = new TSND_UFOLeft();
}
public function Update(Speed:Number=1):void{
if ((((SoundMixerDVolume == 0)) || ((SoundMixer.soundTransform == null)))){
return;
};
var newVolume:Number = SoundMixer.soundTransform.volume;
if ((((SoundMixer.soundTransform.volume > 0)) && ((SoundMixerDVolume < 0)))){
newVolume = (newVolume + SoundMixerDVolume);
if (newVolume < 0){
newVolume = 0;
};
} else {
if ((((SoundMixer.soundTransform.volume < 1)) && ((SoundMixerDVolume > 0)))){
newVolume = (newVolume + SoundMixerDVolume);
if (newVolume > 1){
newVolume = 1;
};
};
};
var st:SoundTransform = new SoundTransform();
st.volume = newVolume;
SoundMixer.soundTransform = st;
}
public function PlayStream(StreamName:String, RewindIfPlaying:Boolean=false):void{
if (StreamName != CurrentStream){
fPlayStream(StreamName);
CurrentStream = StreamName;
};
}
public function SetMute(isMute_:Boolean):void{
if (isMute_ == isMuted){
return;
};
isMuted = isMute_;
if (isMuted){
SoundMixerDVolume = -(Math.abs(CONST_DEFAULTMUTESPEED));
} else {
SoundMixerDVolume = Math.abs(CONST_DEFAULTMUTESPEED);
};
}
}
}//package
Section 482
//TStaticLaserBullet (TStaticLaserBullet)
package {
import flash.display.*;
public dynamic class TStaticLaserBullet extends MovieClip {
}
}//package
Section 483
//TSTATICLASERBULLET_hitArea (TSTATICLASERBULLET_hitArea)
package {
import flash.display.*;
public dynamic class TSTATICLASERBULLET_hitArea extends MovieClip {
}
}//package
Section 484
//TStaticLaserL (TStaticLaserL)
package {
import flash.display.*;
public dynamic class TStaticLaserL extends MovieClip {
}
}//package
Section 485
//TStaticLaserR (TStaticLaserR)
package {
import flash.display.*;
public dynamic class TStaticLaserR extends MovieClip {
}
}//package
Section 486
//TUFO_hitArea (TUFO_hitArea)
package {
import flash.display.*;
public dynamic class TUFO_hitArea extends MovieClip {
}
}//package
Section 487
//TUFOC1Movie (TUFOC1Movie)
package {
import flash.display.*;
public dynamic class TUFOC1Movie extends MovieClip {
}
}//package
Section 488
//TUFOC2Movie (TUFOC2Movie)
package {
import flash.display.*;
public dynamic class TUFOC2Movie extends MovieClip {
}
}//package
Section 489
//TUFOC3Movie (TUFOC3Movie)
package {
import flash.display.*;
public dynamic class TUFOC3Movie extends MovieClip {
}
}//package
Section 490
//TUFOEXPLODE (TUFOEXPLODE)
package {
import flash.display.*;
public dynamic class TUFOEXPLODE extends MovieClip {
}
}//package
Section 491
//TUFOHBMovie (TUFOHBMovie)
package {
import flash.display.*;
public dynamic class TUFOHBMovie extends MovieClip {
}
}//package
Section 492
//TUFOICON (TUFOICON)
package {
import flash.display.*;
public dynamic class TUFOICON extends MovieClip {
}
}//package
Section 493
//TUFOPLASMAEFFECT (TUFOPLASMAEFFECT)
package {
import flash.display.*;
public dynamic class TUFOPLASMAEFFECT extends MovieClip {
}
}//package
Section 494
//UFOShooter (UFOShooter)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import com.gamezhero.api.as3.*;
public class UFOShooter extends MovieClip {
public var Player:TPlayer;// = null
public var BGSpriteEngine:SpriteEngine;
public var SoundEngine:TSoundEngine;// = null
public var GUIMovie:MovieClip;
public var Cross:TGameSprite;// = null
public var CommandProcessor:TCommandProcessor;// = null
public var CurrentLevel:TGameLevel;// = null
public var Earth:TGameSprite;// = null
public var BGMovie:TBGMovie;
public var GameSpritesMovie:MovieClip;
public var SpriteEngine_:SpriteEngine;
public var DebugMovie:MovieClip;// = null
public static var main;
public function UFOShooter(){
super();
trace("Game created.");
main = this;
CreateAll();
ChangeGameLevel(0, 0);
Cross = CurrentLevel.MakeCrossHair();
ChangeGameLevel(Constants.MM_LevelNum);
}
public function handleEnterFrame(E:Event):void{
if (E.target == this){
if (((((!((SpriteEngine_ == null))) && (!((CurrentLevel == null))))) && (!(CurrentLevel.isPause())))){
SpriteEngine_.Dead();
SpriteEngine_.Update(Constants.DEFAULT_SPEED);
SpriteEngine_.Collision();
};
if (((((!((BGSpriteEngine == null))) && (!((CurrentLevel == null))))) && (!(CurrentLevel.isPause())))){
BGSpriteEngine.Dead();
BGSpriteEngine.Update(Constants.DEFAULT_SPEED);
BGSpriteEngine.Collision();
};
if (((!((CurrentLevel == null))) && (!(CurrentLevel.isPause())))){
CurrentLevel.Update(Constants.DEFAULT_SPEED);
if (CurrentLevel.GameBG != null){
CurrentLevel.GameBG.Update(Constants.DEFAULT_SPEED);
};
};
if (this.SoundEngine != null){
SoundEngine.Update(Constants.DEFAULT_SPEED);
};
CommandProcessor.Update(Constants.DEFAULT_SPEED);
Player.Update(Constants.DEFAULT_SPEED);
};
}
public function DebugActivate():void{
if (!Constants.USE_DEBUG){
return;
};
if ((CurrentLevel = null)){
return;
};
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.GC_LevelNum);
}
public function ChangeGameLevel(LevelNum:int, LevelSubNum:int=1):void{
var oldLevel:TGameLevel;
oldLevel = this.CurrentLevel;
CurrentLevel = new TGameLevel(LevelNum, LevelSubNum);
var BGNum = 1;
if (LevelNum == Constants.MM_LevelNum){
BGNum = Constants.MM_BGNum;
} else {
if (CurrentLevel.isPlayable()){
BGNum = Constants.MinPlayable_BGNum;
} else {
if (LevelNum == Constants.PS_LevelNum){
BGNum = Constants.PS_BGNum;
} else {
if (LevelNum == Constants.WS_LevelNum){
BGNum = Constants.WS_BGNum;
} else {
if (LevelNum == Constants.GC_LevelNum){
BGNum = Constants.GC_BGNum;
} else {
if (LevelNum == Constants.HELP_LevelNum){
BGNum = Constants.HELP_BGNum;
} else {
if (LevelNum == Constants.BOSS_LevelNum){
BGNum = Constants.BOSS_BGNum;
} else {
if (LevelNum == Constants.ID_LevelNum){
BGNum = Constants.ID_BGNum;
} else {
if (LevelNum == Constants.SS_LevelNum){
BGNum = Constants.SS_BGNum;
};
};
};
};
};
};
};
};
};
CurrentLevel.GameBG = new TGameBG(BGNum);
CurrentLevel.UFOShooter1 = this;
CurrentLevel.GameBG.UFOShooter1 = this;
CurrentLevel.SpriteEngine_ = this.SpriteEngine_;
CurrentLevel.GameBG.SpriteEngine_ = this.BGSpriteEngine;
if (oldLevel != null){
oldLevel.Destroy();
if (oldLevel.GameBG != null){
oldLevel.GameBG.Destroy();
};
};
CurrentLevel.Start();
CurrentLevel.GameBG.Start();
}
public function handleMouseClickGUI(E:Event):void{
var f11:TGUI_FORM11;
var f10:TGUI_FORM10;
var g1:TGameSprite;
var f7:TGUI_FORM7;
var f7a:TGUI_FORM7a;
var f8:TGUI_FORM8;
var f8a:TGUI_FORM8a;
var f9:TGUI_FORM9;
var targetName:String = E.target.toString();
if (targetName.indexOf("FORM1_PLAY") != -1){
if (Player.isFirstRun){
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyboard);
Player.isFirstRun = false;
};
Player.NewGame();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.WS_LevelNum);
Cross.SetVisible(false);
SoundEngine.PlaySample("ButtonPress");
};
if (targetName.indexOf("FORM1_HELP") != -1){
Player.NewGame();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.HELP_LevelNum);
f11 = new TGUI_FORM11();
f11.x = 10;
f11.y = 50;
GUIMovie.addChild(f11);
SoundEngine.PlaySample("ButtonPress");
};
if (targetName.indexOf("FORM1_SCORES") != -1){
GamezheroApi.linkTopScore();
SoundEngine.PlaySample("ButtonPress");
};
if (targetName.indexOf("FORM1_SPONSORLOGO") != -1){
GamezheroApi.linkZorroLogo();
SoundEngine.PlaySample("ButtonPress");
};
if (targetName.indexOf("FORM1_SPONSORMOREGAME") != -1){
GamezheroApi.linkMoreGames();
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM2_MENU") != -1){
if (((((!((CurrentLevel == null))) && (!(CurrentLevel.isPause())))) && (CurrentLevel.isPausable()))){
CurrentLevel.PauseLevel();
Cross.SetVisible(false);
Cross.ForceSetFlashSprite();
Mouse.show();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f10 = new TGUI_FORM10();
f10.x = 170;
f10.y = 140;
GUIMovie.addChild(f10);
SoundEngine.PlaySample("ButtonPress");
};
} else {
if (targetName.indexOf("FORM2_SOUNDON") != -1){
Player.SoundButtonOn.x = (Player.SoundButtonOn.x + 1000);
Player.SoundButtonOff.x = (Player.SoundButtonOff.x - 1000);
SoundEngine.SetMute(true);
} else {
if (targetName.indexOf("FORM2_SOUNDOFF") != -1){
Player.SoundButtonOn.x = (Player.SoundButtonOn.x - 1000);
Player.SoundButtonOff.x = (Player.SoundButtonOff.x + 1000);
SoundEngine.SetMute(false);
} else {
if (targetName.indexOf("FORM2_QHI") != -1){
Player.QualityButtonHI.x = (Player.QualityButtonHI.x + 1000);
Player.QualityButtonMED.x = (Player.QualityButtonMED.x - 1000);
Player.Quality = StageQuality.MEDIUM;
this.stage.quality = Player.Quality;
} else {
if (targetName.indexOf("FORM2_QMED") != -1){
Player.QualityButtonMED.x = (Player.QualityButtonMED.x + 1000);
Player.QualityButtonLOW.x = (Player.QualityButtonLOW.x - 1000);
Player.Quality = StageQuality.LOW;
this.stage.quality = Player.Quality;
} else {
if (targetName.indexOf("FORM2_QLOW") != -1){
Player.QualityButtonLOW.x = (Player.QualityButtonLOW.x + 1000);
Player.QualityButtonHI.x = (Player.QualityButtonHI.x - 1000);
Player.Quality = StageQuality.BEST;
this.stage.quality = Player.Quality;
} else {
if (targetName.indexOf("FORM3_OK") != -1){
Player.LevelNum++;
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
if (Player.LevelNum > Constants.BOSS_LevelNum){
} else {
ChangeGameLevel(Constants.WS_LevelNum);
};
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM4_MENU") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.MM_LevelNum);
Player.NewGame();
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM4_POST") != -1){
Player.PlayerName = SpriteEngine_.UFOShooter1.Player.PostScoresInputField.TextField_.text;
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CommandProcessor.CommandExec(Constants.CMD_DELETEPOSTSCORESINFO);
} else {
if (targetName.indexOf("FORM5_PLAY") != -1){
SoundEngine.PlaySample("ButtonPress");
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Player.LevelNum);
Cross.SetVisible(true);
} else {
if (targetName.indexOf("FORM5_ACTIVATE") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CurrentLevel.WorkShop_Start(2);
CommandProcessor.CommandExec(Constants.CMD_ENABLEALLWEAPONS);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM5_DEACTIVATE") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CurrentLevel.WorkShop_Start(1);
CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM5_UFOTEST") != -1){
g1 = CurrentLevel.MakeUFO(Math.round((1 + (Math.random() * 2))));
g1.isCashable = false;
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY1") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(1);
Player.WeaponBuyPosNum = 1;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY2") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(2);
Player.WeaponBuyPosNum = 2;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY3") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(3);
Player.WeaponBuyPosNum = 3;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY4") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(4);
Player.WeaponBuyPosNum = 4;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY5") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(5);
Player.WeaponBuyPosNum = 5;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY6") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7 = new TGUI_FORM7();
f7.x = 66;
f7.y = 157;
GUIMovie.addChild(f7);
Player.WeaponsBuyStart(6);
Player.WeaponBuyPosNum = 6;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY7") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7a = new TGUI_FORM7a();
f7a.x = 48;
f7a.y = 157;
GUIMovie.addChild(f7a);
Player.WeaponsBuyStart(7);
Player.WeaponBuyPosNum = 7;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONBUY8") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f7a = new TGUI_FORM7a();
f7a.x = 48;
f7a.y = 157;
GUIMovie.addChild(f7a);
Player.WeaponsBuyStart(8);
Player.WeaponBuyPosNum = 8;
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponBuyInfo(Player.WeaponsBuy[0]);
Player.WeaponBuyPanel = CurrentLevel.MakeWeaponBuyPanel();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE1") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 1;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE2") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 2;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE3") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 3;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE4") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 4;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE5") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 5;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE6") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 6;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE7") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 7;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE8") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 88;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPosNum = 8;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (E.target.name.indexOf("FORM5_WEAPONUPGRADE0") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8a = new TGUI_FORM8a();
f8a.x = 148;
f8a.y = 345;
GUIMovie.addChild(f8a);
Player.WeaponUpgradeSellPosNum = 0;
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
Player.WeaponInfoMovieFrame = 1;
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM6_OK") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.PS_LevelNum);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM7_BUY") != -1){
if (Player.WeaponsBuy_BuyCurrent()){
CommandProcessor.CommandExec(Constants.CMD_DELETEALLWEAPONS);
Player.WeaponBuyPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONBUYINFO);
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CurrentLevel.WorkShop_Start(1);
CurrentLevel.Weapons_Make();
CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
SoundEngine.PlaySample("Cash");
} else {
SoundEngine.PlaySample("Failed");
};
} else {
if (targetName.indexOf("FORM7_CANCEL") != -1){
CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
Player.WeaponBuyPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONBUYINFO);
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CurrentLevel.WorkShop_Start(1);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM7_PREV") != -1){
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONBUYINFO);
Player.WeaponInfoMovieFrame = 1;
Player.WeaponsBuyPrev();
CurrentLevel.MakeWeaponBuyInfo(int(Player.WeaponsBuy[0]));
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM7_NEXT") != -1){
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONBUYINFO);
Player.WeaponInfoMovieFrame = 1;
Player.WeaponsBuyNext();
CurrentLevel.MakeWeaponBuyInfo(int(Player.WeaponsBuy[0]));
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM8_SELL") != -1){
Player.WeaponUpgradeSellPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONUPGRADESELLINFO);
CurrentLevel.CheckinGameButtons();
f9 = new TGUI_FORM9();
f9.x = 150;
f9.y = 335;
GUIMovie.addChild(f9);
Player.WeaponSellQPanel = CurrentLevel.MakeWeaponSellQPanel();
CurrentLevel.MakeWeaponSellQInfo();
Player.WeaponInfoMovieFrame = 1;
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM8_UPGRADE") != -1){
if (Player.Weapons_UpgradeCurrent()){
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONUPGRADESELLINFO);
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
SoundEngine.PlaySample("Failed");
};
} else {
if (targetName.indexOf("FORM8_CLOSE") != -1){
Player.WeaponUpgradeSellPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONUPGRADESELLINFO);
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CurrentLevel.WorkShop_Start(1);
CommandProcessor.CommandExec(Constants.CMD_DELETEALLWEAPONS);
CurrentLevel.Weapons_Make();
CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM9_YES") != -1){
Player.WeaponSellQPanel.Dead();
Player.Weapons_SellCurrent();
Player.WeaponUpgradeSellPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONSELLQINFO);
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
CommandProcessor.CommandExec(Constants.CMD_DELETEALLWEAPONS);
CurrentLevel.WorkShop_Start(1);
CurrentLevel.Weapons_Make();
CommandProcessor.CommandExec(Constants.CMD_DISABLEALLWEAPONS);
SoundEngine.PlaySample("Cash");
} else {
if (targetName.indexOf("FORM9_NO") != -1){
Player.WeaponSellQPanel.Dead();
CommandProcessor.CommandExec(Constants.CMD_DELETEWEAPONSELLQINFO);
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f8 = new TGUI_FORM8();
f8.x = 93;
f8.y = 345;
GUIMovie.addChild(f8);
Player.WeaponUpgradeSellPanel = CurrentLevel.MakeWeaponUpgradeSellPanel();
CurrentLevel.MakeWeaponUpgradeSellInfo();
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM10_PLAY") != -1){
if (((!((CurrentLevel == null))) && (CurrentLevel.isPause()))){
CurrentLevel.ResumeLevel();
Cross.SetVisible(true);
Mouse.hide();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
SoundEngine.PlaySample("ButtonPress");
};
} else {
if (targetName.indexOf("FORM10_POSTSCORES") != -1){
if (((!((CurrentLevel == null))) && (CurrentLevel.isPlayable()))){
SoundEngine.StopCurrentStream();
CurrentLevel.ResumeLevel();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.PS_LevelNum);
Cross.SetVisible(false);
Cross.ForceSetFlashSprite();
Mouse.show();
CurrentLevel.CheckinGameButtons();
SoundEngine.PlaySample("ButtonPress");
};
} else {
if (targetName.indexOf("FORM10_MAINMENU") != -1){
if (((((!((CurrentLevel == null))) && (CurrentLevel.isPlayable()))) || ((CurrentLevel.LevelNum == Constants.BOSS_LevelNum)))){
SoundEngine.StopCurrentStream();
CurrentLevel.ResumeLevel();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.MM_LevelNum);
Cross.SetVisible(false);
Cross.ForceSetFlashSprite();
Mouse.show();
CurrentLevel.CheckinGameButtons();
SoundEngine.PlaySample("ButtonPress");
};
} else {
if (targetName.indexOf("FORM11_OK") != -1){
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
ChangeGameLevel(Constants.MM_LevelNum);
SoundEngine.PlaySample("ButtonPress");
} else {
if (targetName.indexOf("FORM12_MENU") != -1){
} else {
if (targetName.indexOf("DebugButton") != -1){
DebugActivate();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function CreateAll():void{
BGMovie = new TBGMovie();
BGMovie.stop();
BGMovie.visible = false;
this.addChild(BGMovie);
GameSpritesMovie = new MovieClip();
this.addChild(GameSpritesMovie);
GUIMovie = new MovieClip();
this.addChild(GUIMovie);
DebugMovie = new MovieClip();
if (((Constants.USE_DEBUG) && (Constants.USE_DEBUG_SHOWHITAREA))){
this.addChild(DebugMovie);
DebugMovie.alpha = Constants.USE_DEBUG_DEBUGMOVIEALPHA;
DebugMovie.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseClickSpriteEngine);
};
CommandProcessor = new TCommandProcessor();
CommandProcessor.UFOShooter1 = this;
Player = new TPlayer();
Player.UFOShooter1 = this;
SpriteEngine_ = new SpriteEngine();
SpriteEngine_.UFOShooter1 = this;
SpriteEngine_.isGameSpriteEngine = true;
BGSpriteEngine = new SpriteEngine();
BGSpriteEngine.UFOShooter1 = this;
BGSpriteEngine.isGameSpriteEngine = false;
SoundEngine = new TSoundEngine();
SoundEngine.CreateAll();
SoundEngine.SetMute(Constants.DEFAULT_ISMUTED);
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
GameSpritesMovie.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseClickSpriteEngine);
GUIMovie.addEventListener(MouseEvent.MOUSE_UP, handleMouseClickGUI);
var f1:DS_Note = new DS_Note();
var f2:Bimini = new Bimini();
}
public function handleKeyboard(E:KeyboardEvent):void{
var f10:TGUI_FORM10;
trace(("handleKeyboard with keyCode=" + E.keyCode.toString()));
if (E.keyCode == 27){
if ((((CurrentLevel == null)) || (!(CurrentLevel.isPausable())))){
return;
};
if (!CurrentLevel.isPause()){
CurrentLevel.PauseLevel();
Cross.SetVisible(false);
Cross.ForceSetFlashSprite();
Mouse.show();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
f10 = new TGUI_FORM10();
f10.x = 170;
f10.y = 140;
GUIMovie.addChild(f10);
} else {
if (CurrentLevel.isPause()){
CurrentLevel.ResumeLevel();
Cross.SetVisible(true);
Mouse.hide();
CommandProcessor.CommandExec(Constants.CMD_CLEARGUI);
CurrentLevel.CheckinGameButtons();
};
};
} else {
if (E.keyCode == 777777777777){
DebugActivate();
};
};
}
public function handleMouseClickSpriteEngine(E:Event):void{
var pwi:TPlayerWeaponInfo;
var BulletDamage:int;
if (((((((!((CurrentLevel == null))) && (!((Cross == null))))) && (((CurrentLevel.isPlayable()) || ((CurrentLevel.LevelNum == Constants.BOSS_LevelNum)))))) && (Cross.WeaponEnabled))){
if (((!((Player == null))) || ((Player.Weapons.length > 0)))){
pwi = Player.Weapons[0];
BulletDamage = Player.GetDamageByWTUN(Constants.WT_MAINGUN, pwi.UpgradeNum);
CurrentLevel.MakePlayerBullet(Cross.GetPos(), BulletDamage);
Cross.Scale_ = 1.2;
Cross.dScale = -0.05;
if (((CurrentLevel.isPlayable()) && ((CurrentLevel.GetLevelState() == Constants.LS_PLAY)))){
Player.PlayerShots = (Player.PlayerShots + 1);
};
};
};
}
public function isDomainCorrect():Boolean{
var loaderInfoURL:String = this.root.loaderInfo.url;
var domain:String = loaderInfoURL.split("/")[2];
return ((((domain == Constants.RELEASE_CORRECTDOMAIN)) || ((((domain == "")) && (Constants.RELEASE_ALLOWLOCALHOSTRUN)))));
}
}
}//package