STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228114
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/31859708?noj=FRM31859708-9DC" width="1" height="1"></div>

Bricks & Breakout & Arkanoid - Block Smasher.swf

This is the info page for
Flash #231531

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS3]
Section 1
//TweenLite (gs.TweenLite) package gs { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class TweenLite { public var delay:Number; protected var _hasUpdate:Boolean; protected var _subTweens:Array; protected var _initted:Boolean; public var startTime:int; public var target:Object; public var duration:Number; protected var _hst:Boolean; protected var _isDisplayObject:Boolean; protected var _active:Boolean; public var tweens:Array; public var vars:Object; public var initTime:int; private static var _timer:Timer = new Timer(2000); private static var _classInitted:Boolean; public static var defaultEase:Function = TweenLite.easeOut; public static var version:Number = 8.02; protected static var _all:Dictionary = new Dictionary(); private static var _sprite:Sprite = new Sprite(); protected static var _curTime:uint; public static var overwriteManager:Object; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; private static var _listening:Boolean; public function TweenLite($target:Object, $duration:Number, $vars:Object){ var v:*; super(); if ($target == null){ return; }; if (!_classInitted){ _curTime = getTimer(); _sprite.addEventListener(Event.ENTER_FRAME, executeAll); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; _classInitted = true; }; var mode:int = (((($vars.overwrite == undefined)) || (((!(overwriteManager.enabled)) && (($vars.overwrite > 1)))))) ? overwriteManager.mode : int($vars.overwrite); if ((((_all[$target] == undefined)) || (((!(($target == null))) && ((mode == 1)))))){ delete _all[$target]; _all[$target] = new Dictionary(true); }; _all[$target][this] = this; this.vars = $vars; this.duration = (($duration) || (0.001)); this.delay = (($vars.delay) || (0)); _active = ((($duration == 0)) && ((this.delay == 0))); this.target = $target; _isDisplayObject = ($target is DisplayObject); if (!(this.vars.ease is Function)){ this.vars.ease = defaultEase; }; if (this.vars.easeParams != null){ this.vars.proxiedEase = this.vars.ease; this.vars.ease = easeProxy; }; if (!isNaN(Number(this.vars.autoAlpha))){ this.vars.alpha = Number(this.vars.autoAlpha); this.vars.visible = (this.vars.alpha > 0); }; this.tweens = []; _subTweens = []; _hst = (_initted = false); this.initTime = _curTime; if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){ initTweenVals(); this.startTime = _curTime; if (_active){ render((this.startTime + 1)); } else { render(this.startTime); }; v = this.vars.visible; if (this.vars.isTV == true){ v = this.vars.exposedProps.visible; }; if (((((!((v == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){ this.target.visible = Boolean(v); }; }; if (((!(_listening)) && (!(_active)))){ _timer.addEventListener("timer", killGarbage); _timer.start(); _listening = true; }; } protected function addSubTween($name:String, $proxy:Function, $target:Object, $props:Object, $info:Object=null):void{ var p:String; var sub:Object = {name:$name, proxy:$proxy, target:$target, info:$info}; _subTweens[_subTweens.length] = sub; for (p in $props) { if (typeof($props[p]) == "number"){ this.tweens[this.tweens.length] = {o:$target, p:p, s:$target[p], c:($props[p] - $target[p]), sub:sub, name:$name}; } else { this.tweens[this.tweens.length] = {o:$target, p:p, s:$target[p], c:Number($props[p]), sub:sub, name:$name}; }; }; _hst = true; } public function initTweenVals($hrp:Boolean=false, $reservedProps:String=""):void{ var p:String; var i:int; var endArray:Array; var clr:ColorTransform; var endClr:ColorTransform; var tp:Object; var v:Object = this.vars; if (v.isTV == true){ v = v.exposedProps; }; if (((!($hrp)) && (overwriteManager.enabled))){ overwriteManager.manageOverwrites(v, _all[this.target]); }; if ((this.target is Array)){ endArray = ((this.vars.endArray) || ([])); i = 0; while (i < endArray.length) { if (((!((this.target[i] == endArray[i]))) && (!((this.target[i] == undefined))))){ this.tweens[this.tweens.length] = {o:this.target, p:i.toString(), s:this.target[i], c:(endArray[i] - this.target[i]), name:i.toString()}; }; i++; }; } else { if (((((!((typeof(v.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){ clr = this.target.transform.colorTransform; endClr = new ColorTransform(); if (v.alpha != undefined){ endClr.alphaMultiplier = v.alpha; delete v.alpha; } else { endClr.alphaMultiplier = this.target.alpha; }; if (((!((this.vars.removeTint == true))) && (((((!((v.tint == null))) && (!((v.tint == ""))))) || ((v.tint == 0)))))){ endClr.color = v.tint; }; addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:clr, endColor:endClr}); }; if (((!((v.frame == null))) && (_isDisplayObject))){ addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:v.frame}, {target:this.target}); }; if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){ addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target}); }; for (p in v) { if ((((((((((((((((((((((((((((((((((((p == "ease")) || ((p == "delay")))) || ((p == "overwrite")))) || ((p == "onComplete")))) || ((p == "onCompleteParams")))) || ((p == "runBackwards")))) || ((p == "visible")))) || ((p == "autoOverwrite")))) || ((p == "persist")))) || ((p == "onUpdate")))) || ((p == "onUpdateParams")))) || ((p == "autoAlpha")))) || ((p == "onStart")))) || ((p == "onStartParams")))) || ((p == "renderOnStart")))) || ((p == "proxiedEase")))) || ((p == "easeParams")))) || ((($hrp) && (!(($reservedProps.indexOf(((" " + p) + " ")) == -1))))))){ } else { if (((!(((_isDisplayObject) && ((((((p == "tint")) || ((p == "removeTint")))) || ((p == "frame"))))))) && (!((((p == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){ if (typeof(v[p]) == "number"){ this.tweens[this.tweens.length] = {o:this.target, p:p, s:this.target[p], c:(v[p] - this.target[p]), name:p}; } else { this.tweens[this.tweens.length] = {o:this.target, p:p, s:this.target[p], c:Number(v[p]), name:p}; }; }; }; }; }; if (this.vars.runBackwards == true){ i = (this.tweens.length - 1); while (i > -1) { tp = this.tweens[i]; tp.s = (tp.s + tp.c); tp.c = (tp.c * -1); i--; }; }; if ((((v.visible == true)) && (_isDisplayObject))){ this.target.visible = true; }; if (this.vars.onUpdate != null){ _hasUpdate = true; }; _initted = true; } public function get active():Boolean{ if (_active){ return (true); }; if (((_curTime - this.initTime) / 1000) > this.delay){ _active = true; this.startTime = (this.initTime + (this.delay * 1000)); if (!_initted){ initTweenVals(); } else { if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){ this.target.visible = true; }; }; if (this.vars.onStart != null){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (this.duration == 0.001){ this.startTime = (this.startTime - 1); }; return (true); //unresolved jump }; return (false); } public function render($t:uint):void{ var factor:Number; var tp:Object; var i:int; var time:Number = (($t - this.startTime) / 1000); if (time >= this.duration){ time = this.duration; factor = 1; } else { factor = this.vars.ease(time, 0, 1, this.duration); }; i = (this.tweens.length - 1); while (i > -1) { tp = this.tweens[i]; tp.o[tp.p] = (tp.s + (factor * tp.c)); i--; }; if (_hst){ i = (_subTweens.length - 1); while (i > -1) { _subTweens[i].proxy(_subTweens[i]); i--; }; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (time == this.duration){ complete(true); }; } protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } public function killVars($vars:Object):void{ if (overwriteManager.enabled){ overwriteManager.killVars($vars, this.vars, this.tweens, _subTweens, []); }; } public function complete($skipRender:Boolean=false):void{ if (!$skipRender){ if (!_initted){ initTweenVals(); }; this.startTime = (_curTime - (this.duration * 1000)); render(_curTime); return; }; if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){ if (((!(isNaN(this.vars.autoAlpha))) && ((this.target.alpha == 0)))){ this.target.visible = false; } else { if (this.vars.runBackwards != true){ this.target.visible = this.vars.visible; }; }; }; if (this.vars.persist != true){ removeTween(this); }; if (this.vars.onComplete != null){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); }; } public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{ $t = ($t / $d); return ((((-($c) * $t) * ($t - 2)) + $b)); } public static function frameProxy($o:Object):void{ $o.info.target.gotoAndStop(Math.round($o.target.frame)); } public static function removeTween($t:TweenLite=null):void{ if (((!(($t == null))) && (!((_all[$t.target] == undefined))))){ _all[$t.target][$t] = null; delete _all[$t.target][$t]; }; } public static function killTweensOf($tg:Object=null, $complete:Boolean=false):void{ var o:Object; var tw:*; if (((!(($tg == null))) && (!((_all[$tg] == undefined))))){ if ($complete){ o = _all[$tg]; for (tw in o) { o[tw].complete(false); }; }; delete _all[$tg]; }; } public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null):TweenLite{ return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, overwrite:0})); } public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{ $vars.runBackwards = true; return (new TweenLite($target, $duration, $vars)); } public static function executeAll($e:Event=null):void{ var a:Dictionary; var p:Object; var tw:Object; var t:uint = (_curTime = getTimer()); if (_listening){ a = _all; for each (p in a) { for (tw in p) { if (((!((p[tw] == undefined))) && (p[tw].active))){ p[tw].render(t); }; }; }; }; } public static function volumeProxy($o:Object):void{ $o.info.target.soundTransform = $o.target; } public static function killGarbage($e:TimerEvent):void{ var found:Boolean; var p:Object; var twp:Object; var tw:Object; var tg_cnt:uint; for (p in _all) { found = false; for (twp in _all[p]) { found = true; break; }; if (!found){ delete _all[p]; } else { tg_cnt++; }; }; if (tg_cnt == 0){ _timer.removeEventListener("timer", killGarbage); _timer.stop(); _listening = false; }; } public static function tintProxy($o:Object):void{ var n:Number = $o.target.progress; var r:Number = (1 - n); var sc:Object = $o.info.color; var ec:Object = $o.info.endColor; $o.info.target.transform.colorTransform = new ColorTransform(((sc.redMultiplier * r) + (ec.redMultiplier * n)), ((sc.greenMultiplier * r) + (ec.greenMultiplier * n)), ((sc.blueMultiplier * r) + (ec.blueMultiplier * n)), ((sc.alphaMultiplier * r) + (ec.alphaMultiplier * n)), ((sc.redOffset * r) + (ec.redOffset * n)), ((sc.greenOffset * r) + (ec.greenOffset * n)), ((sc.blueOffset * r) + (ec.blueOffset * n)), ((sc.alphaOffset * r) + (ec.alphaOffset * n))); } public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{ return (new TweenLite($target, $duration, $vars)); } } }//package gs
Section 2
//HighScoreRceivedEvent (libs.com.gamelion.utils.HighScoreRceivedEvent) package libs.com.gamelion.utils { import flash.events.*; public class HighScoreRceivedEvent extends Event { private var m_highScores:Array; public static const TOP_WEEK_SCORES:String = "topWeekScores"; public static const TOP_TODAY_SCORES:String = "topTodayScores"; public static const TOP_SCORES:String = "topScores"; public function HighScoreRceivedEvent(type:String, highScores:Array, bubbles:Boolean=false, cancelable:Boolean=false){ super(type, bubbles, cancelable); m_highScores = highScores; } public function get highScores():Array{ return (m_highScores); } } }//package libs.com.gamelion.utils
Section 3
//HighScoreReceivedAllEvent (libs.com.gamelion.utils.HighScoreReceivedAllEvent) package libs.com.gamelion.utils { import flash.events.*; public class HighScoreReceivedAllEvent extends Event { private var m_allArrays:Object; public static const TOP_ALL_SCORES:String = "topAllScores"; public function HighScoreReceivedAllEvent(type:String, allArrays:Object, bubbles:Boolean=false, cancelable:Boolean=false){ super(type, bubbles, cancelable); m_allArrays = allArrays; } public function get highScores():Object{ return (m_allArrays); } } }//package libs.com.gamelion.utils
Section 4
//HighScoreSavedEvent (libs.com.gamelion.utils.HighScoreSavedEvent) package libs.com.gamelion.utils { import flash.events.*; public class HighScoreSavedEvent extends Event { private var m_rank:int; public static const COMPLETE:String = "complete"; public function HighScoreSavedEvent(type:String, rank:int, bubbles:Boolean=false, cancelable:Boolean=false){ super(type, bubbles, cancelable); m_rank = rank; } public function get rank():int{ return (m_rank); } } }//package libs.com.gamelion.utils
Section 5
//HighScoresSystem (libs.com.gamelion.utils.HighScoresSystem) package libs.com.gamelion.utils { import flash.events.*; import flash.display.*; import flash.net.*; public class HighScoresSystem extends Sprite { private var connection:NetConnection; public static const GET_SCORES_ERROR:String = "getScoresError"; public static const CONN_ERROR:String = "connError"; public static const DESCENDING_ORDER:String = "DESC"; public static const SAVE_SCORES_ERROR:String = "saveScoresError"; public static const ASCENDING_ORDER:String = "ASC"; public function HighScoresSystem(gateway:String){ super(); connection = new NetConnection(); connection.connect(gateway); connection.addEventListener(NetStatusEvent.NET_STATUS, ff); } public function getTopScores(key:int, limit:int, orderType:String="DESC"):void{ var responder:Responder = new Responder(onGetTopScores, onFault); connection.call("Scores.getTop", responder, key, limit, orderType); } private function onFault(error:Object):void{ dispatchEvent(new Event(HighScoresSystem.GET_SCORES_ERROR)); } public function getTodayScores(key:int, limit:int, orderType:String="DESC"):void{ var responder:Responder = new Responder(onGetTodayScores, onFault); connection.call("Scores.getTodayTop", responder, key, limit, orderType); } private function ff(e:NetStatusEvent):void{ dispatchEvent(new Event(HighScoresSystem.CONN_ERROR)); } private function onGetTodayScores(topTodayScores:Array):void{ dispatchEvent(new HighScoreRceivedEvent(HighScoreRceivedEvent.TOP_TODAY_SCORES, topTodayScores)); } public function getAllScores(key:int, limit:int, orderType:String="DESC"):void{ var responder:Responder = new Responder(onGetAllScores, onFault); connection.call("Scores.getAll", responder, key, limit, orderType); } public function getWeekScores(key:int, limit:int, orderType:String="DESC"):void{ var responder:Responder = new Responder(onGetWeekScores, onFault); connection.call("Scores.getWeekTop", responder, key, limit, orderType); } public function saveScore(key:int, name:String, score:int, orderType:String="DESC", mail:String=null):void{ var responder:Responder = new Responder(onSaveScore, onFault); connection.call("Scores.save", responder, key, name, score, orderType, mail); } private function onSaveScore(rank:int):void{ dispatchEvent(new HighScoreSavedEvent(HighScoreSavedEvent.COMPLETE, rank)); } private function onGetAllScores(topScoresArrays:Object):void{ dispatchEvent(new HighScoreReceivedAllEvent(HighScoreReceivedAllEvent.TOP_ALL_SCORES, topScoresArrays)); } private function onGetWeekScores(topWeekScores:Array):void{ dispatchEvent(new HighScoreRceivedEvent(HighScoreRceivedEvent.TOP_WEEK_SCORES, topWeekScores)); } private function onGetTopScores(topScores:Array):void{ dispatchEvent(new HighScoreRceivedEvent(HighScoreRceivedEvent.TOP_SCORES, topScores)); } } }//package libs.com.gamelion.utils
Section 6
//ObjectPool (libs.de.polygonal.core.ObjectPool) package libs.de.polygonal.core { public class ObjectPool { private var _head:ObjNode; private var _usageCount:int; private var _initSize:int; private var _allocNode:ObjNode; private var _tail:ObjNode; private var _emptyNode:ObjNode; private var _currSize:int; private var _obj:Class; private var _grow:Boolean;// = true public function ObjectPool(grow:Boolean=false){ super(); _grow = grow; } public function get size():int{ return (_currSize); } public function initialze(func:String, args:Array):void{ var n:ObjNode = _head; while (n) { n.data[func].apply(n.data, args); if (n == _tail){ break; }; n = n.next; }; } public function get wasteCount():int{ return ((_currSize - _usageCount)); } public function get usageCount():int{ return (_usageCount); } public function deconstruct():void{ var t:ObjNode; var node:ObjNode = _head; while (node) { t = node.next; node.next = null; node.data = null; node = t; }; _head = (_tail = (_emptyNode = (_allocNode = null))); } public function purge():void{ var i:int; var node:ObjNode; var a:Array; var n:ObjNode; var t:ObjNode; var k:int; if (_usageCount == 0){ if (_currSize == _initSize){ return; }; if (_currSize > _initSize){ i = 0; node = _head; while (++i < _initSize) { node = node.next; }; _tail = node; _allocNode = (_emptyNode = _head); _currSize = _initSize; return; }; } else { a = []; node = _head; while (node) { if (!node.data){ var _temp1 = i; i = (i + 1); a[int(_temp1)] = node; }; if (node == _tail){ break; }; node = node.next; }; _currSize = a.length; _usageCount = _currSize; _head = (_tail = a[0]); i = 1; while (i < _currSize) { node = a[i]; node.next = _head; _head = node; i++; }; _emptyNode = (_allocNode = _head); _tail.next = _head; if (_usageCount < _initSize){ _currSize = _initSize; n = _tail; t = _tail; k = (_initSize - _usageCount); i = 0; while (i < k) { node = new ObjNode(); node.data = new _obj(); t.next = node; t = node; i++; }; _tail = t; _tail.next = (_emptyNode = _head); _allocNode = n.next; }; }; } public function allocate(C:Class, size:uint):void{ var n:ObjNode; deconstruct(); _obj = C; _initSize = (_currSize = size); _head = (_tail = new ObjNode()); _head.data = new _obj(); var i = 1; while (i < _initSize) { n = new ObjNode(); n.data = new _obj(); n.next = _head; _head = n; i++; }; _emptyNode = (_allocNode = _head); _tail.next = _head; } public function set object(o):void{ if (_usageCount > 0){ _usageCount--; _emptyNode.data = o; _emptyNode = _emptyNode.next; }; } public function get object(){ var n:ObjNode; var t:ObjNode; var node:ObjNode; var i:int; var o:*; if (_usageCount == _currSize){ if (_grow){ _currSize = (_currSize + _initSize); n = _tail; t = _tail; i = 0; while (i < _initSize) { node = new ObjNode(); node.data = new _obj(); t.next = node; t = node; i++; }; _tail = t; _tail.next = (_emptyNode = _head); _allocNode = n.next; return (object); } else { throw (new Error("object pool exhausted")); }; } else { o = _allocNode.data; _allocNode.data = null; _allocNode = _allocNode.next; _usageCount++; }; return (o); } } }//package libs.de.polygonal.core class ObjNode { public var data; public var next:ObjNode; private function ObjNode(){ super(); } }
Section 7
//Button (mp3Player.Button) package mp3Player { import flash.events.*; import flash.display.*; public class Button extends Sprite { public var pressed:Boolean;// = false private var buttonOver:Class; private var buttonUp:Class; private var button:Bitmap; public var pressedEvent:String; public static const SONG_BACK_OVER:Class = Button_SONG_BACK_OVER; public static const SONG_MUTE:Class = Button_SONG_MUTE; public static const TURN_OFF:Class = Button_TURN_OFF; public static const SONG_MUTE_OVER:Class = Button_SONG_MUTE_OVER; public static const SONG_BACK:Class = Button_SONG_BACK; public static const VOLUME_UP_OVER:Class = Button_VOLUME_UP_OVER; public static const SONG_PLAY_OVER:Class = Button_SONG_PLAY_OVER; public static const SONG_PLAY:Class = Button_SONG_PLAY; public static const SONG_FORWARD_OVER:Class = Button_SONG_FORWARD_OVER; public static const VOLUME_UP:Class = Button_VOLUME_UP; public static const VOLUME_DOWN:Class = Button_VOLUME_DOWN; public static const TURN_OFF_OVER:Class = Button_TURN_OFF_OVER; public static const VOLUME_DOWN_OVER:Class = Button_VOLUME_DOWN_OVER; public static const SONG_FORWARD:Class = Button_SONG_FORWARD; public function Button(over:Class, pressed:Class, up:Class, constantlyPressed:Boolean, pressedEvent:String){ super(); this.buttonMode = true; this.pressedEvent = pressedEvent; button = new (up); addChild(button); addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); addEventListener(MouseEvent.CLICK, onMouseClick); buttonUp = up; buttonOver = over; } private function onMouseOut(e:MouseEvent):void{ removeChild(button); button = new buttonUp(); addChild(button); } private function onMouseClick(e:MouseEvent):void{ dispatchEvent(new Event(pressedEvent)); } private function onMouseOver(e:MouseEvent):void{ removeChild(button); button = new buttonOver(); addChild(button); } } }//package mp3Player
Section 8
//Button_SONG_BACK (mp3Player.Button_SONG_BACK) package mp3Player { import mx.core.*; public class Button_SONG_BACK extends BitmapAsset { } }//package mp3Player
Section 9
//Button_SONG_BACK_OVER (mp3Player.Button_SONG_BACK_OVER) package mp3Player { import mx.core.*; public class Button_SONG_BACK_OVER extends BitmapAsset { } }//package mp3Player
Section 10
//Button_SONG_FORWARD (mp3Player.Button_SONG_FORWARD) package mp3Player { import mx.core.*; public class Button_SONG_FORWARD extends BitmapAsset { } }//package mp3Player
Section 11
//Button_SONG_FORWARD_OVER (mp3Player.Button_SONG_FORWARD_OVER) package mp3Player { import mx.core.*; public class Button_SONG_FORWARD_OVER extends BitmapAsset { } }//package mp3Player
Section 12
//Button_SONG_MUTE (mp3Player.Button_SONG_MUTE) package mp3Player { import mx.core.*; public class Button_SONG_MUTE extends BitmapAsset { } }//package mp3Player
Section 13
//Button_SONG_MUTE_OVER (mp3Player.Button_SONG_MUTE_OVER) package mp3Player { import mx.core.*; public class Button_SONG_MUTE_OVER extends BitmapAsset { } }//package mp3Player
Section 14
//Button_SONG_PLAY (mp3Player.Button_SONG_PLAY) package mp3Player { import mx.core.*; public class Button_SONG_PLAY extends BitmapAsset { } }//package mp3Player
Section 15
//Button_SONG_PLAY_OVER (mp3Player.Button_SONG_PLAY_OVER) package mp3Player { import mx.core.*; public class Button_SONG_PLAY_OVER extends BitmapAsset { } }//package mp3Player
Section 16
//Button_TURN_OFF (mp3Player.Button_TURN_OFF) package mp3Player { import mx.core.*; public class Button_TURN_OFF extends BitmapAsset { } }//package mp3Player
Section 17
//Button_TURN_OFF_OVER (mp3Player.Button_TURN_OFF_OVER) package mp3Player { import mx.core.*; public class Button_TURN_OFF_OVER extends BitmapAsset { } }//package mp3Player
Section 18
//Button_VOLUME_DOWN (mp3Player.Button_VOLUME_DOWN) package mp3Player { import mx.core.*; public class Button_VOLUME_DOWN extends BitmapAsset { } }//package mp3Player
Section 19
//Button_VOLUME_DOWN_OVER (mp3Player.Button_VOLUME_DOWN_OVER) package mp3Player { import mx.core.*; public class Button_VOLUME_DOWN_OVER extends BitmapAsset { } }//package mp3Player
Section 20
//Button_VOLUME_UP (mp3Player.Button_VOLUME_UP) package mp3Player { import mx.core.*; public class Button_VOLUME_UP extends BitmapAsset { } }//package mp3Player
Section 21
//Button_VOLUME_UP_OVER (mp3Player.Button_VOLUME_UP_OVER) package mp3Player { import mx.core.*; public class Button_VOLUME_UP_OVER extends BitmapAsset { } }//package mp3Player
Section 22
//SoundPlayer (mp3Player.SoundPlayer) package mp3Player { import flash.events.*; import flash.display.*; import flash.media.*; import flash.net.*; import flash.errors.*; public class SoundPlayer extends Sprite { private var _offButton:Button; private var _minusButton:Button; private var _position:Number; private var _plusButton:Button; private var loopedSound:Sound; private var _backwardButton:Button; private var _playButton:Button; private var _soundChanel2:SoundChannel; private var _soundChanel3:SoundChannel; private var soundToLoop:Sound; private var _soundChanel1:SoundChannel; private var _volume:Number; private var _paused:Boolean;// = false private var _playerBackground:Bitmap; private var _playList:XMLList; private var _forwardButton:Button; private var _muteButton:Button; private var _muted:Boolean; private var _currentSong:Number; private var _songs:Array; private static var MUTE_CLICKED:String = "muteButtonClickedEvent"; private static var BACKWARD_CLICKED:String = "backwardButtonClickedEvent"; private static var PLUS_CLICKED:String = "plusButtonClickedEvent"; private static var DISPLAY_CLICKED:String = "displayClickedEvent"; private static var FORWARD_CLICKED:String = "forwardButtonClickedEvent"; private static var _soundPlayer:SoundPlayer; public static var PLAYLIST_PATH:String = ("http://playlion.com/games/arkanoid/" + "playlist.xml"); private static var PLAY_CLICKED:String = "playButtonClickedEvent"; public static var INIT_COMPLETED:String = "initCompleted"; private static var MINUS_CLICKED:String = "minusButtonClickedEvent"; public function SoundPlayer(caller:Function=null){ var xmlLoader:URLLoader; super(); if (caller == getInstance){ _volume = 0.5; _muted = false; _backwardButton = new Button(Button.SONG_BACK_OVER, Button.SONG_BACK, Button.SONG_BACK, false, BACKWARD_CLICKED); _backwardButton.x = 13; _backwardButton.y = 54; addChild(_backwardButton); _playButton = new Button(Button.SONG_PLAY_OVER, Button.SONG_PLAY, Button.SONG_PLAY, false, PLAY_CLICKED); _playButton.x = 35; _playButton.y = 50; addChild(_playButton); _forwardButton = new Button(Button.SONG_FORWARD_OVER, Button.SONG_FORWARD, Button.SONG_FORWARD, false, FORWARD_CLICKED); _forwardButton.x = 57; _forwardButton.y = 43; addChild(_forwardButton); _minusButton = new Button(Button.VOLUME_DOWN_OVER, Button.VOLUME_DOWN, Button.VOLUME_DOWN, false, MINUS_CLICKED); _minusButton.x = 26; _minusButton.y = 100; _minusButton.addEventListener(MINUS_CLICKED, onMinusClicked); addChild(_minusButton); _muteButton = new Button(Button.SONG_MUTE_OVER, Button.SONG_MUTE, Button.SONG_MUTE, true, MUTE_CLICKED); _muteButton.x = 42; _muteButton.y = 73; _muteButton.addEventListener(MUTE_CLICKED, onMuteClicked); addChild(_muteButton); _offButton = new Button(Button.TURN_OFF_OVER, Button.TURN_OFF, Button.TURN_OFF, true, MUTE_CLICKED); _offButton.x = 50; _offButton.y = 12; _offButton.addEventListener(MUTE_CLICKED, onMuteClicked); addChild(_offButton); _plusButton = new Button(Button.VOLUME_UP_OVER, Button.VOLUME_UP, Button.VOLUME_UP, false, PLUS_CLICKED); _plusButton.x = 71; _plusButton.y = 88; _plusButton.addEventListener(PLUS_CLICKED, onPlusClicked); addChild(_plusButton); xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, initPlayer); xmlLoader.load(new URLRequest(PLAYLIST_PATH)); } else { throw (new IllegalOperationError("This is a singleton class!!!")); }; } private function initPlayer(e:Event):void{ var mp3:XML; var song:Sound; var url:URLRequest; var loadContext:SoundLoaderContext; _playList = new XMLList(new XML(e.target.data).mp3); _currentSong = 0; _position = 0; var tmp:Boolean; _songs = new Array(); for each (mp3 in _playList) { song = new Sound(); url = new URLRequest(mp3.url); loadContext = new SoundLoaderContext(25); song.load(url, loadContext); _songs.push(song); }; dispatchEvent(new Event(INIT_COMPLETED)); _backwardButton.addEventListener(BACKWARD_CLICKED, onBackwardClicked); _playButton.addEventListener(PLAY_CLICKED, onPlayClicked); _forwardButton.addEventListener(FORWARD_CLICKED, onForwardClicked); } private function onMinusClicked(e:Event):void{ if (_volume > 0.1){ _volume = (_volume - 0.1); }; if (_muted){ _muted = false; _muteButton.pressed = false; }; if (_soundChanel1){ _soundChanel1.soundTransform = new SoundTransform(_volume); }; if (_soundChanel2){ _soundChanel2.soundTransform = new SoundTransform(_volume); }; if (_soundChanel3){ _soundChanel3.soundTransform = new SoundTransform(_volume); }; } private function startLoop(e:Event):void{ _soundChanel3.removeEventListener(Event.SOUND_COMPLETE, startLoop); playLoopSound(soundToLoop); } public function play():void{ if (_soundChanel1 != null){ _soundChanel1.stop(); }; _soundChanel1 = _songs[_currentSong].play(); _soundChanel1.soundTransform = new SoundTransform(_volume); _soundChanel1.addEventListener(Event.SOUND_COMPLETE, onForwardClicked, false, 0, true); } public function playSound(sound:Sound):void{ _soundChanel2 = sound.play(); _soundChanel2.soundTransform = new SoundTransform(_volume); if (_muted){ _soundChanel2.soundTransform = new SoundTransform(0); }; } private function onPlusClicked(e:Event):void{ if (_volume < 0.9){ _volume = (_volume + 0.1); }; if (_muted){ _muted = false; _muteButton.pressed = false; }; if (_soundChanel1){ _soundChanel1.soundTransform = new SoundTransform(_volume); }; if (_soundChanel2){ _soundChanel2.soundTransform = new SoundTransform(_volume); }; if (_soundChanel3){ _soundChanel3.soundTransform = new SoundTransform(_volume); }; } private function onForwardClicked(e:Event):void{ if (_currentSong < (_playList.length() - 1)){ _currentSong++; } else { _currentSong = 0; }; _soundChanel1.stop(); _soundChanel1 = _songs[_currentSong].play(); if (_paused){ _position = 0; _soundChanel1.stop(); }; if (_muted){ _soundChanel1.soundTransform = new SoundTransform(0); } else { _soundChanel1.soundTransform = new SoundTransform(_volume); }; _soundChanel1.addEventListener(Event.SOUND_COMPLETE, onForwardClicked, false, 0, true); } public function startMusic():void{ onPlayClicked(null); } public function playSoundOnLoopChannel(sound:Sound, loopedSoundOnEnd:Sound=null):void{ _soundChanel3 = sound.play(); _soundChanel3.soundTransform = new SoundTransform(_volume); if (_muted){ _soundChanel3.soundTransform = new SoundTransform(0); }; if (loopedSoundOnEnd != null){ soundToLoop = loopedSoundOnEnd; _soundChanel3.addEventListener(Event.SOUND_COMPLETE, startLoop, false, 0, true); }; } public function stopLoopSound():void{ if (_soundChanel3 == null){ return; }; _soundChanel3.stop(); removeEventListener(Event.SOUND_COMPLETE, playLoopSound); } private function onPlayClicked(e:Event):void{ if (_paused){ _paused = false; _soundChanel1 = _songs[_currentSong].play(_position); _soundChanel1.addEventListener(Event.SOUND_COMPLETE, onForwardClicked, false, 0, true); _soundChanel1.soundTransform = new SoundTransform(_volume); if (_muted){ _soundChanel1.soundTransform = new SoundTransform(0); }; } else { _paused = true; _position = _soundChanel1.position; _soundChanel1.stop(); }; } private function onMuteClicked(e:Event):void{ if (_muted){ _muted = false; if (_soundChanel1){ _soundChanel1.soundTransform = new SoundTransform(_volume); }; if (_soundChanel2){ _soundChanel2.soundTransform = new SoundTransform(_volume); }; if (_soundChanel3){ _soundChanel3.soundTransform = new SoundTransform(_volume); }; } else { _muted = true; if (_soundChanel1){ _soundChanel1.soundTransform = new SoundTransform(0); }; if (_soundChanel2){ _soundChanel2.soundTransform = new SoundTransform(_volume); }; if (_soundChanel3){ _soundChanel3.soundTransform = new SoundTransform(_volume); }; }; } public function playLoopSound(arg):void{ if ((arg is Sound)){ loopedSound = arg; }; _soundChanel3 = loopedSound.play(); _soundChanel3.soundTransform = new SoundTransform(_volume); if (_muted){ _soundChanel3.soundTransform = new SoundTransform(0); }; if (!_soundChanel3.willTrigger(Event.SOUND_COMPLETE)){ _soundChanel3.addEventListener(Event.SOUND_COMPLETE, playLoopSound, false, 0, true); }; } private function traceMsg(e:Event):void{ dispatchEvent(new Event(INIT_COMPLETED)); } private function onBackwardClicked(e:Event):void{ if (_currentSong > 0){ _currentSong--; } else { _currentSong = (_playList.length() - 1); }; _soundChanel1.stop(); _soundChanel1 = _songs[_currentSong].play(); if (_paused){ _position = 0; _soundChanel1.stop(); }; if (_muted){ _soundChanel1.soundTransform = new SoundTransform(0); } else { _soundChanel1.soundTransform = new SoundTransform(_volume); }; _soundChanel1.addEventListener(Event.SOUND_COMPLETE, onForwardClicked, false, 0, true); } public static function getInstance():SoundPlayer{ if (_soundPlayer == null){ _soundPlayer = new SoundPlayer(getInstance); }; return (_soundPlayer); } } }//package mp3Player
Section 23
//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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void; function get automationValue():Array; function get numAutomationChildren():int; function set showInAutomationHierarchy(E:\dev\3.0.x\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void; } }//package mx.automation
Section 24
//Binding (mx.binding.Binding) package mx.binding { import mx.core.*; 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 isExecuting:Boolean; mx_internal var isHandlingEvent:Boolean; public var twoWayCounterpart:Binding; mx_internal var isEnabled:Boolean; public var uiComponentWatcher:int; private var lastValue:Object; private var wrappedFunctionSuccessful:Boolean; mx_internal static const VERSION:String = "3.0.0.0"; 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); } 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); } 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); } 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; }; } public function execute(o:Object=null):void{ var o = o; if (!isEnabled){ return; }; if (((isExecuting) || (((twoWayCounterpart) && (twoWayCounterpart.isExecuting))))){ hasHadValue = true; return; }; try { try { isExecuting = true; wrapFunctionCall(this, innerExecute, o); } finally { }; } finally { isExecuting = false; }; } 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 25
//BindingManager (mx.binding.BindingManager) package mx.binding { import mx.core.*; public class BindingManager { mx_internal static const VERSION:String = "3.0.0.0"; 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 26
//EvalBindingResponder (mx.binding.EvalBindingResponder) package mx.binding { import mx.core.*; import mx.rpc.*; public class EvalBindingResponder implements IResponder { private var binding:Binding; private var object:Object; mx_internal static const VERSION:String = "3.0.0.0"; 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 27
//IBindingClient (mx.binding.IBindingClient) package mx.binding { public interface IBindingClient { } }//package mx.binding
Section 28
//ItemPendingError (mx.collections.errors.ItemPendingError) package mx.collections.errors { import mx.core.*; import mx.rpc.*; public class ItemPendingError extends Error { private var _responders:Array; mx_internal static const VERSION:String = "3.0.0.0"; 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 29
//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 30
//ToolTip (mx.controls.ToolTip) package mx.controls { import mx.core.*; import flash.display.*; import mx.styles.*; import flash.text.*; 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.0.0.0"; 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 31
//ApplicationGlobals (mx.core.ApplicationGlobals) package mx.core { public class ApplicationGlobals { public static var application:Object; public function ApplicationGlobals(){ super(); } } }//package mx.core
Section 32
//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "3.0.0.0"; public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ super(bitmapData, pixelSnapping, smoothing); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } 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; } } }//package mx.core
Section 33
//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.0.0.0"; 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 34
//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 35
//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.0.0.0"; 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 36
//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.0.0.0"; 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 37
//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.0.0.0"; 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 38
//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.0.0.0"; 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 39
//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.0.0.0"; public function EventPriority(){ super(); } } }//package mx.core
Section 40
//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ var bitmapData = bitmapData; var pixelSnapping = pixelSnapping; var smoothing = smoothing; super(bitmapData, pixelSnapping, smoothing); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 41
//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.0.0.0"; 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 42
//FlexMovieClip (mx.core.FlexMovieClip) package mx.core { import flash.display.*; import mx.utils.*; public class FlexMovieClip extends MovieClip { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexMovieClip(){ super(); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 43
//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.0.0.0"; 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 44
//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.0.0.0"; 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 45
//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.0.0.0"; 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 46
//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.0.0.0"; 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 47
//FontAsset (mx.core.FontAsset) package mx.core { import flash.text.*; public class FontAsset extends Font implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; public function FontAsset(){ super(); } } }//package mx.core
Section 48
//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.core
Section 49
//IButton (mx.core.IButton) package mx.core { public interface IButton extends IUIComponent { function get emphasized():Boolean; function set emphasized(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void; function callLater(_arg1:Function, _arg2:Array=null):void; } }//package mx.core
Section 50
//IChildList (mx.core.IChildList) package mx.core { import flash.display.*; import flash.geom.*; public interface IChildList { function get numChildren():int; function removeChild(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function getChildByName(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject; function removeChildAt(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject; function addChild(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function contains(flash.display:DisplayObject):Boolean; } }//package mx.core
Section 51
//IConstraintClient (mx.core.IConstraintClient) package mx.core { public interface IConstraintClient { function setConstraintValue(_arg1:String, _arg2):void; function getConstraintValue(*:String); } }//package mx.core
Section 52
//IContainer (mx.core.IContainer) package mx.core { import flash.display.*; import flash.geom.*; import flash.media.*; import mx.managers.*; import flash.text.*; 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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean; } }//package mx.core
Section 53
//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 54
//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 55
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 56
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.accessibility.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get visible():Boolean; function get rotation():Number; function localToGlobal(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 57
//IFlexModule (mx.core.IFlexModule) package mx.core { public interface IFlexModule { function set moduleFactory(:IFlexModuleFactory):void; function get moduleFactory():IFlexModuleFactory; } }//package mx.core
Section 58
//IFlexModuleFactory (mx.core.IFlexModuleFactory) package mx.core { public interface IFlexModuleFactory { function create(... _args):Object; function info():Object; } }//package mx.core
Section 59
//IFontContextComponent (mx.core.IFontContextComponent) package mx.core { public interface IFontContextComponent { function get fontContext():IFlexModuleFactory; function set fontContext(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IFontContextComponent.as:IFlexModuleFactory):void; } }//package mx.core
Section 60
//IIMESupport (mx.core.IIMESupport) package mx.core { public interface IIMESupport { function set imeMode(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IIMESupport.as:String):void; function get imeMode():String; } }//package mx.core
Section 61
//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 62
//IProgrammaticSkin (mx.core.IProgrammaticSkin) package mx.core { public interface IProgrammaticSkin { function validateNow():void; function validateDisplayList():void; } }//package mx.core
Section 63
//IPropertyChangeNotifier (mx.core.IPropertyChangeNotifier) package mx.core { import flash.events.*; public interface IPropertyChangeNotifier extends IEventDispatcher, IUID { } }//package mx.core
Section 64
//IRawChildrenContainer (mx.core.IRawChildrenContainer) package mx.core { public interface IRawChildrenContainer { function get rawChildren():IChildList; } }//package mx.core
Section 65
//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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void; function layoutBackgroundImage():void; } }//package mx.core
Section 66
//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 67
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get isDocument():Boolean; function set repeaters(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function initializeRepeaterArrays(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 68
//IStateClient (mx.core.IStateClient) package mx.core { public interface IStateClient { function get currentState():String; function set currentState(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void; } }//package mx.core
Section 69
//ITextFieldFactory (mx.core.ITextFieldFactory) package mx.core { import flash.text.*; public interface ITextFieldFactory { function createTextField(:IFlexModuleFactory):TextField; } }//package mx.core
Section 70
//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 71
//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 72
//IUID (mx.core.IUID) package mx.core { public interface IUID { function get uid():String; function set uid(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IUID.as:String):void; } }//package mx.core
Section 73
//IUITextField (mx.core.IUITextField) package mx.core { import flash.display.*; import flash.geom.*; import mx.styles.*; import mx.managers.*; import flash.text.*; 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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get maxScrollH():int; function set nestLevel(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function get numLines():int; function get scrollH():int; function setColor(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function getFirstCharInParagraph(value:int):int; function get type():String; function replaceSelectedText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function set borderColor(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function set useRichTextClipboard(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get selectionBeginIndex():int; function get selectable():Boolean; function set border(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set multiline(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set background(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set embedFonts(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set text(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get selectionEndIndex():int; function set mouseWheelEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function appendText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get antiAliasType():String; function set styleSheet(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:StyleSheet):void; function set nonInheritingStyles(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void; function set textColor(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function set alwaysShowSelection(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function getTextFormat(_arg1:int=-1, _arg2:int=-1):TextFormat; function set sharpness(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void; function set type(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function setTextFormat(_arg1:TextFormat, _arg2:int=-1, _arg3:int=-1):void; function set gridFitType(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function getUITextFormat():UITextFormat; function set inheritingStyles(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void; function setFocus():void; function get borderColor():uint; function set condenseWhite(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get textWidth():Number; function getLineOffset(value:int):int; function set displayAsPassword(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set autoSize(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void; function get embedFonts():Boolean; function set selectable(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get multiline():Boolean; function set maxChars(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get gridFitType():String; function get inheritingStyles():Object; function set ignorePadding(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set antiAliasType(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get backgroundColor():uint; function getCharIndexAtPoint(_arg1:Number, _arg2:Number):int; function set tabEnabled(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get tabEnabled():Boolean; function set thickness(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void; function getLineLength(value:int):int; function truncateToFit(:String=null):Boolean; function set htmlText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function getLineMetrics(antiAliasType:int):TextLineMetrics; function getStyle(*:String); } }//package mx.core
Section 74
//MovieClipAsset (mx.core.MovieClipAsset) package mx.core { public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder { private var _measuredHeight:Number; private var _measuredWidth:Number; mx_internal static const VERSION:String = "3.0.0.0"; public function MovieClipAsset(){ 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 75
//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 76
//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.0.0.0"; 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 77
//RSLItem (mx.core.RSLItem) package mx.core { import flash.events.*; import flash.display.*; import flash.system.*; import mx.events.*; import flash.net.*; 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; protected var url:String; mx_internal static const VERSION:String = "3.0.0.0"; public function RSLItem(url:String){ super(); this.url = url; } 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(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 78
//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.0.0.0"; 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 79
//Singleton (mx.core.Singleton) package mx.core { public class Singleton { mx_internal static const VERSION:String = "3.0.0.0"; 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 80
//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; public function SoundAsset(){ super(); } } }//package mx.core
Section 81
//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.0.0.0"; 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 82
//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.0.0.0"; 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 83
//UIComponent (mx.core.UIComponent) package mx.core { import flash.events.*; import flash.display.*; import flash.geom.*; import mx.styles.*; import flash.system.*; import mx.modules.*; import mx.events.*; import mx.resources.*; import mx.managers.*; import flash.text.*; import mx.automation.*; import mx.controls.*; import mx.states.*; import mx.effects.*; import mx.graphics.*; import mx.binding.*; import flash.utils.*; import mx.utils.*; import mx.validators.*; 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.0.0.0"; 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(); }; } 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 invalidateDisplayList():void{ if (!invalidateDisplayListFlag){ invalidateDisplayListFlag = true; if (((parent) && (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); } 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 = 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 == 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))){ if (UIComponentGlobals.callLaterDispatcherCount == 0){ sm.stage.focus = this; UIComponentGlobals.nextFocusObject = null; } else { UIComponentGlobals.nextFocusObject = this; sm.stage.addEventListener(Event.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 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; }; }; 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){ if ((((methodQueue.length > 0)) && (!(listeningForRender)))){ _systemManager.stage.addEventListener(Event.RENDER, callLaterDispatcher); _systemManager.stage.addEventListener(Event.ENTER_FRAME, callLaterDispatcher); listeningForRender = true; }; _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 (((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; }; 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))) && (!(_instanceIndices)))) && (!(parent.isDocument)))){ _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{ if (event.eventPhase != EventPhase.AT_TARGET){ return; }; if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){ event.stopImmediatePropagation(); return; }; } 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{ if (event.eventPhase != EventPhase.AT_TARGET){ return; }; if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){ event.stopImmediatePropagation(); return; }; _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))){ if (!listeningForRender){ sm.stage.addEventListener(Event.RENDER, callLaterDispatcher); sm.stage.addEventListener(Event.ENTER_FRAME, callLaterDispatcher); listeningForRender = true; }; 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))) && (listeningForRender))){ sm.stage.removeEventListener(Event.RENDER, callLaterDispatcher); sm.stage.removeEventListener(Event.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))){ if (listeningForRender){ sm.stage.removeEventListener(Event.RENDER, callLaterDispatcher); sm.stage.removeEventListener(Event.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 84
//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.0.0.0"; public static const OFF:String = "off"; public function UIComponentCachePolicy(){ super(); } } }//package mx.core
Section 85
//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.0.0.0"; public function UIComponentDescriptor(descriptorProperties:Object){ super(descriptorProperties); } override public function toString():String{ return (("UIComponentDescriptor_" + id)); } } }//package mx.core
Section 86
//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 87
//UITextField (mx.core.UITextField) package mx.core { import flash.events.*; import flash.display.*; import mx.styles.*; import mx.resources.*; import mx.managers.*; import flash.text.*; import mx.automation.*; import flash.utils.*; import mx.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.0.0.0"; 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 88
//UITextFormat (mx.core.UITextFormat) package mx.core { import mx.managers.*; import flash.text.*; 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.0.0.0"; 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; } 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 (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 89
//AddRemoveEffectTargetFilter (mx.effects.effectClasses.AddRemoveEffectTargetFilter) package mx.effects.effectClasses { import mx.core.*; import mx.effects.*; public class AddRemoveEffectTargetFilter extends EffectTargetFilter { public var add:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; 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 90
//HideShowEffectTargetFilter (mx.effects.effectClasses.HideShowEffectTargetFilter) package mx.effects.effectClasses { import mx.core.*; import mx.effects.*; public class HideShowEffectTargetFilter extends EffectTargetFilter { public var show:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; 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 91
//PropertyChanges (mx.effects.effectClasses.PropertyChanges) package mx.effects.effectClasses { import mx.core.*; public class PropertyChanges { public var target:Object; public var start:Object; public var end:Object; mx_internal static const VERSION:String = "3.0.0.0"; public function PropertyChanges(target:Object){ end = {}; start = {}; super(); this.target = target; } } }//package mx.effects.effectClasses
Section 92
//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.0.0.0"; 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 93
//ZoomInstance (mx.effects.effectClasses.ZoomInstance) package mx.effects.effectClasses { import flash.events.*; import mx.core.*; 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.0.0.0"; 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.mx_internal::_width = curWidth; }; }; if (!isNaN(origPercentHeight)){ curHeight = target.height; target.percentHeight = origPercentHeight; if (((target.parent) && ((target.parent.autoLayout == false)))){ target.mx_internal::_height = curHeight; }; }; super.onTweenEnd(value); if (mx_internal::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); tween.mx_internal::needToLayout = true; EffectManager.resumeEventHandling(); } } }//package mx.effects.effectClasses
Section 94
//Effect (mx.effects.Effect) package mx.effects { import flash.events.*; import mx.core.*; import mx.events.*; import mx.managers.*; 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.0.0.0"; 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 95
//EffectInstance (mx.effects.EffectInstance) package mx.effects { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 96
//EffectManager (mx.effects.EffectManager) package mx.effects { import flash.events.*; import mx.core.*; import flash.display.*; import mx.events.*; import mx.resources.*; import flash.utils.*; public class EffectManager extends EventDispatcher { mx_internal static const VERSION:String = "3.0.0.0"; 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 97
//EffectTargetFilter (mx.effects.EffectTargetFilter) package mx.effects { import mx.core.*; 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.0.0.0"; 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 98
//IAbstractEffect (mx.effects.IAbstractEffect) package mx.effects { import flash.events.*; public interface IAbstractEffect extends IEventDispatcher { } }//package mx.effects
Section 99
//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 100
//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 101
//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 102
//Tween (mx.effects.Tween) package mx.effects { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 103
//TweenEffect (mx.effects.TweenEffect) package mx.effects { import flash.events.*; import mx.core.*; import mx.events.*; import mx.effects.effectClasses.*; public class TweenEffect extends Effect { public var easingFunction:Function;// = null mx_internal static const VERSION:String = "3.0.0.0"; 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 104
//Zoom (mx.effects.Zoom) package mx.effects { import mx.core.*; 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.0.0.0"; 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 105
//ChildExistenceChangedEvent (mx.events.ChildExistenceChangedEvent) package mx.events { import flash.events.*; import mx.core.*; import flash.display.*; public class ChildExistenceChangedEvent extends Event { public var relatedObject:DisplayObject; public static const CHILD_REMOVE:String = "childRemove"; mx_internal static const VERSION:String = "3.0.0.0"; 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 106
//DragEvent (mx.events.DragEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 107
//DynamicEvent (mx.events.DynamicEvent) package mx.events { import flash.events.*; import mx.core.*; public dynamic class DynamicEvent extends Event { mx_internal static const VERSION:String = "3.0.0.0"; 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 108
//EffectEvent (mx.events.EffectEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 109
//FlexEvent (mx.events.FlexEvent) package mx.events { import flash.events.*; import mx.core.*; public class FlexEvent extends Event { public static const ADD:String = "add"; public static const TRANSFORM_CHANGE:String = "transformChange"; 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 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.0.0.0"; 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 110
//FlexMouseEvent (mx.events.FlexMouseEvent) package mx.events { import flash.events.*; import mx.core.*; import flash.display.*; 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.0.0.0"; 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 111
//ModuleEvent (mx.events.ModuleEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 112
//MoveEvent (mx.events.MoveEvent) package mx.events { import flash.events.*; import mx.core.*; public class MoveEvent extends Event { public var oldX:Number; public var oldY:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 113
//PropertyChangeEvent (mx.events.PropertyChangeEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 114
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind) package mx.events { import mx.core.*; public final class PropertyChangeEventKind { mx_internal static const VERSION:String = "3.0.0.0"; public static const UPDATE:String = "update"; public static const DELETE:String = "delete"; public function PropertyChangeEventKind(){ super(); } } }//package mx.events
Section 115
//ResizeEvent (mx.events.ResizeEvent) package mx.events { import flash.events.*; import mx.core.*; public class ResizeEvent extends Event { public var oldHeight:Number; public var oldWidth:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 116
//ResourceEvent (mx.events.ResourceEvent) package mx.events { import flash.events.*; import mx.core.*; public class ResourceEvent extends ProgressEvent { public var errorText:String; mx_internal static const VERSION:String = "3.0.0.0"; 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 117
//RSLEvent (mx.events.RSLEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 118
//StateChangeEvent (mx.events.StateChangeEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 119
//StyleEvent (mx.events.StyleEvent) package mx.events { import flash.events.*; import mx.core.*; public class StyleEvent extends ProgressEvent { public var errorText:String; mx_internal static const VERSION:String = "3.0.0.0"; 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 120
//ToolTipEvent (mx.events.ToolTipEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 121
//TweenEvent (mx.events.TweenEvent) package mx.events { import flash.events.*; import mx.core.*; public class TweenEvent extends Event { public var value:Object; public static const TWEEN_END:String = "tweenEnd"; mx_internal static const VERSION:String = "3.0.0.0"; 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 122
//ValidationResultEvent (mx.events.ValidationResultEvent) package mx.events { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 123
//RectangularDropShadow (mx.graphics.RectangularDropShadow) package mx.graphics { import mx.core.*; import flash.display.*; import flash.geom.*; 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.0.0.0"; 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 124
//RoundedRectangle (mx.graphics.RoundedRectangle) package mx.graphics { import mx.core.*; import flash.geom.*; public class RoundedRectangle extends Rectangle { public var cornerRadius:Number;// = 0 mx_internal static const VERSION:String = "3.0.0.0"; 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 125
//PriorityQueue (mx.managers.layoutClasses.PriorityQueue) package mx.managers.layoutClasses { import mx.core.*; import flash.display.*; 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.0.0.0"; 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 126
//CursorManager (mx.managers.CursorManager) package mx.managers { import mx.core.*; public class CursorManager { mx_internal static const VERSION:String = "3.0.0.0"; 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 127
//CursorManagerImpl (mx.managers.CursorManagerImpl) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; import mx.styles.*; import flash.text.*; 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 _currentCursorID:int;// = 0 private var listenForContextMenu:Boolean;// = false private var showCustomCursor:Boolean;// = false 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.0.0.0"; 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; } else { this.systemManager = ApplicationGlobals.application.systemManager; }; } public function set currentCursorYOffset(value:Number):void{ _currentCursorYOffset = value; } public function get currentCursorXOffset():Number{ return (_currentCursorXOffset); } public function removeCursor(cursorID:int):void{ var i:Object; var item:CursorQueueItem; for (i in cursorList) { item = cursorList[i]; if (item.cursorID == cursorID){ cursorList.splice(i, 1); showCurrentCursor(); break; }; }; } public function get currentCursorID():int{ return (_currentCursorID); } public function set currentCursorID(value:int):void{ _currentCursorID = value; } public function removeAllCursors():void{ 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 cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager"); var busyCursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursor"); busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW)); } public function showCursor():void{ if (cursorHolder){ cursorHolder.visible = true; }; } 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 tempSystemManager:ISystemManager; if (cursorList.length > 0){ if (!initialized){ cursorHolder = new FlexSprite(); cursorHolder.name = "cursorHolder"; cursorHolder.mouseEnabled = false; initialized = true; }; 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; }; tempSystemManager = (item.systemManager) ? item.systemManager : ApplicationGlobals.application.systemManager; if (((systemManager) && (!((systemManager == tempSystemManager))))){ systemManager.cursorChildren.removeChild(cursorHolder); }; systemManager = tempSystemManager; if (!systemManager.cursorChildren.contains(cursorHolder)){ systemManager.cursorChildren.addChild(cursorHolder); }; 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)){ cursorHolder.x = (SystemManager(systemManager).mouseX + item.x); cursorHolder.y = (SystemManager(systemManager).mouseY + item.y); } else { if ((systemManager is DisplayObject)){ cursorHolder.x = (DisplayObject(systemManager).mouseX + item.x); cursorHolder.y = (DisplayObject(systemManager).mouseY + item.y); } else { cursorHolder.x = item.x; cursorHolder.y = item.y; }; }; systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, 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; systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); 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; systemManager.stage.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); } public function hideCursor():void{ if (cursorHolder){ cursorHolder.visible = false; }; } public function registerToUseBusyCursor(source:Object):void{ 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 setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):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(); }; } public function removeBusyCursor():void{ if (busyCursorList.length > 0){ removeCursor(int(busyCursorList.pop())); }; } private function mouseMoveHandler(event:MouseEvent):void{ if ((systemManager is SystemManager)){ cursorHolder.x = (SystemManager(systemManager).mouseX + currentCursorXOffset); cursorHolder.y = (SystemManager(systemManager).mouseY + currentCursorYOffset); } else { if ((systemManager is DisplayObject)){ cursorHolder.x = (DisplayObject(systemManager).mouseX + currentCursorXOffset); cursorHolder.y = (DisplayObject(systemManager).mouseY + currentCursorYOffset); } else { cursorHolder.x = currentCursorXOffset; cursorHolder.y = currentCursorYOffset; }; }; 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; }; }; if (showSystemCursor){ showSystemCursor = false; cursorHolder.visible = false; Mouse.show(); }; if (showCustomCursor){ showCustomCursor = false; cursorHolder.visible = true; Mouse.hide(); }; } public function unRegisterToUseBusyCursor(source:Object):void{ 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{ systemManager.stage.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); mouseMoveHandler(event); } public function set currentCursorXOffset(value:Number):void{ _currentCursorXOffset = value; } public static function getInstance():ICursorManager{ if (!instance){ instance = new (CursorManagerImpl); }; return (instance); } } }//package mx.managers import mx.core.*; 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.0.0.0"; private function CursorQueueItem(){ super(); } }
Section 128
//CursorManagerPriority (mx.managers.CursorManagerPriority) package mx.managers { import mx.core.*; public final class CursorManagerPriority { public static const HIGH:int = 1; public static const MEDIUM:int = 2; mx_internal static const VERSION:String = "3.0.0.0"; public static const LOW:int = 3; public function CursorManagerPriority(){ super(); } } }//package mx.managers
Section 129
//ICursorManager (mx.managers.ICursorManager) package mx.managers { public interface ICursorManager { function removeAllCursors():void; function set currentCursorYOffset(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void; function removeBusyCursor():void; function unRegisterToUseBusyCursor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void; function hideCursor():void; function get currentCursorID():int; function registerToUseBusyCursor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void; function setBusyCursor():void; function showCursor():void; function set currentCursorID(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void; function get currentCursorXOffset():Number; function get currentCursorYOffset():Number; function set currentCursorXOffset(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void; } }//package mx.managers
Section 130
//IFocusManager (mx.managers.IFocusManager) package mx.managers { import mx.core.*; import flash.display.*; public interface IFocusManager { function get focusPane():Sprite; function getFocus():IFocusManagerComponent; function deactivate():void; function set defaultButton(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void; function set focusPane(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void; function set showFocusIndicator(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function get defaultButtonEnabled():Boolean; function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent; function get nextTabIndex():int; function get defaultButton():IButton; function get showFocusIndicator():Boolean; function setFocus(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function hideFocus():void; function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent; } }//package mx.managers
Section 131
//IFocusManagerComponent (mx.managers.IFocusManagerComponent) package mx.managers { public interface IFocusManagerComponent { function set focusEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void; function drawFocus(E:\dev\3.0.x\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 132
//IFocusManagerContainer (mx.managers.IFocusManagerContainer) package mx.managers { import flash.events.*; import flash.display.*; public interface IFocusManagerContainer extends IEventDispatcher { function set focusManager(E:\dev\3.0.x\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 133
//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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function set usePhasedInstantiation(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void; function invalidateSize(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function get usePhasedInstantiation():Boolean; function invalidateProperties(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; } }//package mx.managers
Section 134
//ILayoutManagerClient (mx.managers.ILayoutManagerClient) package mx.managers { import flash.events.*; public interface ILayoutManagerClient extends IEventDispatcher { function get updateCompletePendingFlag():Boolean; function set updateCompletePendingFlag(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; function set initialized(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void; function set nestLevel(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void; function set processedDescriptors(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; } }//package mx.managers
Section 135
//ISystemManager (mx.managers.ISystemManager) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; import flash.geom.*; import flash.text.*; public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory { function get focusPane():Sprite; function get loaderInfo():LoaderInfo; function get toolTipChildren():IChildList; function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void; function isTopLevel():Boolean; function get popUpChildren():IChildList; function get screen():Rectangle; function isFontFaceEmbedded(mx.managers:ISystemManager/mx.managers:ISystemManager:focusPane/get:TextFormat):Boolean; function get rawChildren():IChildList; function get topLevelSystemManager():ISystemManager; function getDefinitionByName(E:\dev\3.0.x\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 removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get document():Object; function get numModalWindows():int; function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get stage():Stage; } }//package mx.managers
Section 136
//IToolTipManager2 (mx.managers.IToolTipManager2) package mx.managers { import mx.core.*; import flash.display.*; import mx.effects.*; public interface IToolTipManager2 { function registerToolTip(_arg1:DisplayObject, _arg2:String, _arg3:String):void; function get enabled():Boolean; function set enabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Boolean):void; function get scrubDelay():Number; function set hideEffect(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void; function set hideDelay(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void; function get currentTarget():DisplayObject; function set showDelay(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void; function set toolTipClass(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Class):void; function sizeTip(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void; function set currentTarget(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:DisplayObject):void; function set showEffect(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void; } }//package mx.managers
Section 137
//IToolTipManagerClient (mx.managers.IToolTipManagerClient) package mx.managers { import mx.core.*; public interface IToolTipManagerClient extends IFlexDisplayObject { function get toolTip():String; function set toolTip(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void; } }//package mx.managers
Section 138
//LayoutManager (mx.managers.LayoutManager) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; 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.0.0.0"; 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 stage:Stage; if (_usePhasedInstantiation != value){ _usePhasedInstantiation = value; stage = SystemManagerGlobals.topLevelSystemManagers[0].stage; if (value){ originalFrameRate = stage.frameRate; stage.frameRate = 1000; } else { stage.frameRate = originalFrameRate; }; }; } 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; }; }; 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 139
//SystemChildrenList (mx.managers.SystemChildrenList) package mx.managers { import mx.core.*; import flash.display.*; import flash.geom.*; public class SystemChildrenList implements IChildList { private var lowerBoundReference:QName; private var upperBoundReference:QName; private var owner:SystemManager; mx_internal static const VERSION:String = "3.0.0.0"; 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 (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 140
//SystemManager (mx.managers.SystemManager) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; import flash.geom.*; import mx.styles.*; import flash.system.*; import mx.events.*; import mx.resources.*; import flash.text.*; import flash.utils.*; import mx.preloaders.*; import mx.messaging.config.*; public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager { mx_internal var nestLevel:int;// = 0 private var forms:Array; private var mouseCatcher:Sprite; private var _height:Number; private var preloader:Preloader; private var _document:Object; private var _topLevelSystemManager:ISystemManager; private var _toolTipIndex:int;// = 0 private var _rawChildren:SystemRawChildrenList; private var _explicitHeight:Number; private var _toolTipChildren:SystemChildrenList; private var form:IFocusManagerContainer; 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 private var topLevel:Boolean;// = true private var _cursorIndex:int;// = 0 mx_internal var _mouseX; mx_internal var _mouseY; private var _numModalWindows:int;// = 0 private var _screen:Rectangle; mx_internal var idleCounter:int;// = 0 private var _cursorChildren:SystemChildrenList; private var initCallbackFunctions:Array; private var _noTopMostIndex:int;// = 0 private var _applicationIndex:int;// = 1 private var idleTimer:Timer; private var doneExecutingInitCallbacks:Boolean;// = false private var _explicitWidth:Number; 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.0.0.0"; mx_internal static var lastSystemManager:SystemManager; mx_internal static var allSystemManagers:Dictionary = new Dictionary(true); public function SystemManager(){ initCallbackFunctions = []; forms = []; 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); }; } mx_internal function addingChild(child:DisplayObject):void{ var obj:DisplayObjectContainer; var newNestLevel = 1; if (!topLevel){ 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 idleTimer_timerHandler(event:TimerEvent):void{ idleCounter++; if ((idleCounter * IDLE_INTERVAL) > IDLE_THRESHOLD){ dispatchEvent(new FlexEvent(FlexEvent.IDLE)); }; } public function getExplicitOrMeasuredHeight():Number{ return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight); } 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{ allSystemManagers[this] = this.loaderInfo.url; root.loaderInfo.removeEventListener(Event.INIT, initHandler); var docFrame:int = ((totalFrames)==1) ? 0 : 1; addFrameScript(docFrame, docFrameHandler); var f:int = (docFrame + 1); while (f < totalFrames) { addFrameScript(f, extraFrameHandler); f++; }; initialize(); } 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); } 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 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; } 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); } override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ 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); } 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); }; forms.splice(i, 1); return; }; i++; }; } private function mouseMoveHandler(event:MouseEvent):void{ idleCounter = 0; } 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 j:int; var index:int; var newIndex:int; var childList:IChildList; idleCounter = 0; if (numModalWindows == 0){ if (forms.length > 1){ n = forms.length; p = DisplayObject(event.target); isApplication = document.rawChildren.contains(p); while (p) { i = 0; while (i < n) { if (forms[i] == p){ j = 0; if (((!((p == form))) && ((p is IFocusManagerContainer)))){ activate(IFocusManagerContainer(p)); }; if (popUpChildren.contains(p)){ childList = popUpChildren; } else { childList = this; }; index = childList.getChildIndex(p); newIndex = index; n = forms.length; j = 0; while (j < n) { if (childList.contains(forms[j])){ if (childList.getChildIndex(forms[j]) > index){ newIndex = Math.max(childList.getChildIndex(forms[j]), newIndex); }; }; j++; }; if ((((newIndex > index)) && (!(isApplication)))){ childList.setChildIndex(p, newIndex); }; return; }; i++; }; p = p.parent; }; }; }; } public function get screen():Rectangle{ if (!_screen){ Stage_resizeHandler(); }; return (_screen); } 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(); } private function Stage_resizeHandler(event:Event=null):void{ var w:Number = stage.stageWidth; var h:Number = stage.stageHeight; var m:Number = loaderInfo.width; var n:Number = loaderInfo.height; var x:Number = ((m - w) / 2); var y:Number = ((n - h) / 2); var align:String = stage.align; 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(); dispatchEvent(event); }; } 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{ var newForm:IFocusManagerContainer; var n:int; var i:int; var g:IFocusManagerContainer; if (form){ if ((((form == f)) && ((forms.length > 1)))){ form.focusManager.deactivate(); n = forms.length; i = 0; while (i < n) { g = forms[i]; if (g == f){ i = (i + 1); while (i < n) { g = forms[i]; if ((((Sprite(g).visible == true)) && (IUIComponent(g).enabled))){ newForm = g; }; i++; }; form = newForm; break; } else { if (((Sprite(g).visible) && (IUIComponent(g).enabled))){ newForm = g; }; }; i++; }; if (form){ form.focusManager.activate(); }; }; }; } override public function getChildByName(name:String):DisplayObject{ return (super.getChildByName(name)); } override public function addChildAt(child:DisplayObject, index:int):DisplayObject{ noTopMostIndex++; return (rawChildren_addChildAt(child, (applicationIndex + index))); } public function get measuredWidth():Number{ return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width); } 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)); } 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 set applicationIndex(value:int):void{ _applicationIndex = value; } private function executeCallbacks():void{ var initFunction:Function; if (!parent){ return; }; while (initCallbackFunctions.length > 0) { initFunction = initCallbackFunctions.shift(); initFunction(this); }; } 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); } public function set explicitHeight(value:Number):void{ _explicitHeight = value; } override public function removeChild(child:DisplayObject):DisplayObject{ noTopMostIndex--; return (rawChildren_removeChild(child)); } override public function addChild(child:DisplayObject):DisplayObject{ noTopMostIndex++; return (rawChildren_addChildAt(child, (noTopMostIndex - 1))); } 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 s:Stage = super.stage; if (s){ return (s); }; if (((!(topLevel)) && (_topLevelSystemManager))){ return (_topLevelSystemManager.stage); }; return (null); } 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); } override public function getChildIndex(child:DisplayObject):int{ return ((super.getChildIndex(child) - applicationIndex)); } private function mouseUpHandler(event:MouseEvent):void{ idleCounter = 0; } mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{ return (super.getChildIndex(child)); } public function activate(f:IFocusManagerContainer):void{ var z:IFocusManagerContainer; if (form){ if (((!((form == f))) && ((forms.length > 1)))){ z = form; z.focusManager.deactivate(); }; }; form = f; if (f.focusManager){ f.focusManager.activate(); }; } 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; if (mouseCatcher){ g = mouseCatcher.graphics; g.clear(); g.beginFill(0, 0); g.drawRect(0, 0, stage.stageWidth, stage.stageHeight); g.endFill(); }; } override public function get height():Number{ return (_height); } mx_internal function rawChildren_getChildAt(index:int):DisplayObject{ return (super.getChildAt(index)); } 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); } 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))))))); } mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{ super.setChildIndex(child, newIndex); } mx_internal function childAdded(child:DisplayObject):void{ child.dispatchEvent(new FlexEvent(FlexEvent.ADD)); if ((child is IUIComponent)){ IUIComponent(child).initialize(); }; } override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ 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 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 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.localeChain = compiledLocales; }; } 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); } 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); } 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 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)); } public function get preloaderBackgroundColor():uint{ var value:* = info()["backgroundColor"]; if (value == undefined){ return (StyleManager.NOT_A_COLOR); }; return (StyleManager.getColorName(value)); } public function get topLevelSystemManager():ISystemManager{ if (topLevel){ return (this); }; return (_topLevelSystemManager); } 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"]); rslList.push(cdNode); i++; }; }; if (((!((rsls == null))) && ((rsls.length > 0)))){ n = rsls.length; i = 0; while (i < n) { node = new RSLItem(rsls[i].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); } 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; }; }; } public function get measuredHeight():Number{ return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height); } mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{ addingChild(child); super.addChildAt(child, index); childAdded(child); return (child); } private function nextFrameTimerHandler(event:TimerEvent):void{ if ((currentFrame + 1) <= framesLoaded){ nextFrame(); nextFrameTimer.removeEventListener(TimerEvent.TIMER, nextFrameTimerHandler); nextFrameTimer.reset(); }; } mx_internal function childRemoved(child:DisplayObject):void{ if ((child is IUIComponent)){ IUIComponent(child).parentChanged(null); }; } mx_internal function get noTopMostIndex():int{ return (_noTopMostIndex); } override public function get numChildren():int{ return ((noTopMostIndex - applicationIndex)); } private function initializeTopLevelWindow(event:Event):void{ var app:IUIComponent; var obj:DisplayObjectContainer; initialized = true; if (!parent){ return; }; if (!topLevel){ obj = parent.parent; if (!obj){ return; }; while (obj) { if ((obj is IUIComponent)){ _topLevelSystemManager = IUIComponent(obj).systemManager; break; }; obj = obj.parent; }; }; addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true); if (((topLevel) && (stage))){ stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true); }; app = (topLevelWindow = IUIComponent(create())); document = app; if (document){ IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler); if (((topLevel) && (stage))){ LoaderConfig._url = loaderInfo.url; LoaderConfig._parameters = loaderInfo.parameters; _width = stage.stageWidth; _height = stage.stageHeight; IFlexDisplayObject(app).setActualSize(stage.stageWidth, stage.stageHeight); } else { IFlexDisplayObject(app).setActualSize(loaderInfo.width, loaderInfo.height); }; if (preloader){ preloader.registerApplication(app); }; addingChild(DisplayObject(app)); childAdded(DisplayObject(app)); } else { document = this; }; } public function get numModalWindows():int{ return (_numModalWindows); } public function isTopLevelWindow(object:DisplayObject):Boolean{ return ((((object is IUIComponent)) && ((IUIComponent(object) == topLevelWindow)))); } override public function get width():Number{ return (_width); } public function move(x:Number, y:Number):void{ } public function set explicitWidth(value:Number):void{ _explicitWidth = value; } private function preloader_initProgressHandler(event:Event):void{ preloader.removeEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler); deferredNextFrame(); } public function get explicitWidth():Number{ return (_explicitWidth); } 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); } 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); }; } } }//package mx.managers
Section 141
//SystemManagerGlobals (mx.managers.SystemManagerGlobals) package mx.managers { public class SystemManagerGlobals { public static var topLevelSystemManagers:Array = []; public static var bootstrapLoaderInfoURL:String; public function SystemManagerGlobals(){ super(); } } }//package mx.managers
Section 142
//SystemRawChildrenList (mx.managers.SystemRawChildrenList) package mx.managers { import mx.core.*; import flash.display.*; import flash.geom.*; public class SystemRawChildrenList implements IChildList { private var owner:SystemManager; mx_internal static const VERSION:String = "3.0.0.0"; 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 143
//ToolTipManager (mx.managers.ToolTipManager) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; import mx.effects.*; public class ToolTipManager extends EventDispatcher { mx_internal static const VERSION:String = "3.0.0.0"; 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 144
//ToolTipManagerImpl (mx.managers.ToolTipManagerImpl) package mx.managers { import flash.events.*; import mx.core.*; import flash.display.*; import flash.geom.*; import mx.styles.*; import mx.events.*; import mx.controls.*; import mx.effects.*; import flash.utils.*; import mx.validators.*; public class ToolTipManagerImpl extends EventDispatcher implements IToolTipManager2 { private var _enabled:Boolean;// = true mx_internal var isError:Boolean; 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 currentText:String; mx_internal var showTimer:Timer; private var _currentToolTip:IToolTip; mx_internal var scrubTimer:Timer; mx_internal var previousTarget:DisplayObject; private var _currentTarget:DisplayObject; private var _showEffect:IAbstractEffect; mx_internal var initialized:Boolean;// = false private var _hideDelay:Number;// = 10000 mx_internal static const VERSION:String = "3.0.0.0"; private static var instance:IToolTipManager2; public function ToolTipManagerImpl(){ _toolTipClass = ToolTip; super(); if (instance){ throw (new Error("Instance already exists.")); }; } mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void{ reset(); } public function set showDelay(value:Number):void{ _showDelay = value; } 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); } 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 : ApplicationGlobals.application.systemManager; sm.toolTipChildren.addChild(toolTip); 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; sm.toolTipChildren.removeChild(DisplayObject(currentToolTip)); currentToolTip = null; scrubTimer.delay = scrubDelay; scrubTimer.reset(); if (scrubDelay > 0){ scrubTimer.delay = scrubDelay; scrubTimer.start(); }; }; } public function get toolTipClass():Class{ return (_toolTipClass); } public function set currentToolTip(value:IToolTip):void{ _currentToolTip = value; } 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 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; sm.toolTipChildren.removeChild(DisplayObject(toolTip)); } public function get scrubDelay():Number{ return (_scrubDelay); } mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void{ if (!enabled){ return; }; findTarget(displayObject); if (currentTarget != previousTarget){ targetChanged(); previousTarget = currentTarget; }; } public function set toolTipClass(value:Class):void{ _toolTipClass = value; } private function getGlobalBounds(obj:DisplayObject):Rectangle{ var upperLeft:Point = new Point(0, 0); upperLeft = obj.localToGlobal(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 toolTipWidth:Number; var toolTipHeight:Number; var screenWidth:Number = currentToolTip.screen.width; var screenHeight:Number = currentToolTip.screen.height; if (isError){ targetGlobalBounds = getGlobalBounds(currentTarget); 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; pos = DisplayObject(ctt).root.globalToLocal(pos); x = pos.x; y = pos.y; } else { x = (ApplicationGlobals.application.mouseX + 11); y = (ApplicationGlobals.application.mouseY + 22); toolTipWidth = currentToolTip.width; if ((x + toolTipWidth) > screenWidth){ x = (screenWidth - toolTipWidth); }; toolTipHeight = currentToolTip.height; if ((y + toolTipHeight) > screenHeight){ y = (screenHeight - toolTipHeight); }; }; 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()); } mx_internal function showTimer_timerHandler(event:TimerEvent):void{ if (currentTarget){ createTip(); initializeTip(); positionTip(); showTip(); }; } mx_internal function hideTimer_timerHandler(event:TimerEvent):void{ hideTip(); } public function set showEffect(value:IAbstractEffect):void{ _showEffect = (value as IAbstractEffect); } public function set hideEffect(value:IAbstractEffect):void{ _hideEffect = (value as IAbstractEffect); } mx_internal function targetChanged():void{ var event:ToolTipEvent; if (!initialized){ initialize(); }; if (((previousTarget) && (currentToolTip))){ event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE); event.toolTip = currentToolTip; previousTarget.dispatchEvent(event); }; 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(); }; }; } mx_internal function initializeTip():void{ if ((currentToolTip is ToolTip)){ ToolTip(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); sm.toolTipChildren.addChild(DisplayObject(currentToolTip)); } public static function getInstance():IToolTipManager2{ if (!instance){ instance = new (ToolTipManagerImpl); }; return (instance); } } }//package mx.managers
Section 145
//LoaderConfig (mx.messaging.config.LoaderConfig) package mx.messaging.config { import mx.core.*; public class LoaderConfig { mx_internal static const VERSION:String = "3.0.0.0"; 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 146
//IModuleInfo (mx.modules.IModuleInfo) package mx.modules { import flash.events.*; import mx.core.*; import flash.system.*; public interface IModuleInfo extends IEventDispatcher { function get ready():Boolean; function get loaded():Boolean; function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void; function release():void; function get error():Boolean; function get data():Object; function publish(E:\dev\3.0.x\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void; function get factory():IFlexModuleFactory; function set data(E:\dev\3.0.x\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 147
//ModuleManager (mx.modules.ModuleManager) package mx.modules { import mx.core.*; public class ModuleManager { mx_internal static const VERSION:String = "3.0.0.0"; 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.events.*; import mx.core.*; import flash.display.*; import flash.system.*; import mx.events.*; 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):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); }; }; } 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); }; //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); 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); } 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):void{ if (_loaded){ return; }; _loaded = true; limbo = null; 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 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 148
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals) package mx.modules { public class ModuleManagerGlobals { public static var managerSingleton:Object = null; public function ModuleManagerGlobals(){ super(); } } }//package mx.modules
Section 149
//DownloadProgressBar (mx.preloaders.DownloadProgressBar) package mx.preloaders { import flash.events.*; import mx.core.*; import flash.display.*; import flash.geom.*; import flash.system.*; import mx.events.*; import flash.text.*; 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.0.0.0"; 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.parent); 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.system.*; import flash.text.*; 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 parentContainer:DisplayObjectContainer; private function ErrorField(parent:DisplayObjectContainer){ super(); this.parentContainer = parent; } public function show(errorText:String):void{ if ((((errorText == null)) || ((errorText.length == 0)))){ return; }; var stage:Stage = parentContainer.stage; 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), (stage.stageWidth - (TEXT_MARGIN_PX * 2))); textField.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), textField.width); textField.y = Math.max(0, ((stage.stageHeight - TEXT_MARGIN_PX) - textField.height)); textField.x = ((stage.stageWidth - textField.width) / 2); parentContainer.addChild(this); this.addChild(textField); } protected function get labelFormat():TextFormat{ var tf:TextFormat = new TextFormat(); tf.color = 0; tf.font = "Verdana"; tf.size = 10; return (tf); } }
Section 150
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay) package mx.preloaders { import flash.events.*; import flash.display.*; public interface IPreloaderDisplay extends IEventDispatcher { function set backgroundAlpha(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function get stageHeight():Number; function get stageWidth():Number; function set backgroundColor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:uint):void; function set preloader(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function get backgroundColor():uint; function set stageWidth(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function set backgroundImage(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Object):void; function set backgroundSize(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:String):void; function initialize():void; } }//package mx.preloaders
Section 151
//Preloader (mx.preloaders.Preloader) package mx.preloaders { import flash.events.*; import mx.core.*; import flash.display.*; 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.0.0.0"; 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 152
//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 153
//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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void; function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint; function addResourceBundle(E:\dev\3.0.x\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 findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle; function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number; } }//package mx.resources
Section 154
//IResourceModule (mx.resources.IResourceModule) package mx.resources { public interface IResourceModule { function get resourceBundles():Array; } }//package mx.resources
Section 155
//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.0.0.0"; 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 156
//ResourceManager (mx.resources.ResourceManager) package mx.resources { import mx.core.*; public class ResourceManager { mx_internal static const VERSION:String = "3.0.0.0"; 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")); }; return (instance); } } }//package mx.resources
Section 157
//ResourceManagerImpl (mx.resources.ResourceManagerImpl) package mx.resources { import flash.events.*; import mx.core.*; import flash.system.*; import mx.modules.*; import mx.events.*; 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.0.0.0"; 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 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 addResourceBundle(resourceBundle:IResourceBundle):void{ var locale:String = resourceBundle.locale; var bundleName:String = resourceBundle.bundleName; if (!localeMap[locale]){ localeMap[locale] = {}; }; localeMap[locale][bundleName] = resourceBundle; } private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{ supportNonFrameworkApps(); return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, 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 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 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 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 getBundleNamesForLocale(locale:String):Array{ var p:String; var bundleNames:Array = []; for (p in localeMap[locale]) { bundleNames.push(p); }; return (bundleNames); } public function removeResourceBundle(locale:String, bundleName:String):void{ delete localeMap[locale][bundleName]; if (getBundleNamesForLocale(locale).length == 0){ delete localeMap[locale]; }; } 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 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)); } 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.modules.*; import mx.events.*; 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 158
//IResponder (mx.rpc.IResponder) package mx.rpc { public interface IResponder { function fault(:Object):void; function result(:Object):void; } }//package mx.rpc
Section 159
//ButtonSkin (mx.skins.halo.ButtonSkin) package mx.skins.halo { import mx.core.*; import flash.display.*; import mx.styles.*; import mx.skins.*; import mx.utils.*; public class ButtonSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; 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 160
//HaloBorder (mx.skins.halo.HaloBorder) package mx.skins.halo { import mx.core.*; import flash.display.*; import mx.styles.*; import mx.graphics.*; import mx.skins.*; import mx.utils.*; 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.0.0.0"; 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 161
//HaloColors (mx.skins.halo.HaloColors) package mx.skins.halo { import mx.core.*; import mx.utils.*; public class HaloColors { mx_internal static const VERSION:String = "3.0.0.0"; 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 162
//HaloFocusRect (mx.skins.halo.HaloFocusRect) package mx.skins.halo { import mx.core.*; import flash.display.*; import mx.styles.*; import mx.skins.*; import mx.utils.*; public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient { private var _focusColor:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 163
//ListDropIndicator (mx.skins.halo.ListDropIndicator) package mx.skins.halo { import mx.core.*; import flash.display.*; import mx.skins.*; public class ListDropIndicator extends ProgrammaticSkin { public var direction:String;// = "horizontal" mx_internal static const VERSION:String = "3.0.0.0"; public function ListDropIndicator(){ super(); } override protected function updateDisplayList(w:Number, h:Number):void{ super.updateDisplayList(w, h); var g:Graphics = graphics; g.clear(); g.lineStyle(2, 2831164); if (direction == "horizontal"){ g.moveTo(0, 0); g.lineTo(w, 0); } else { g.moveTo(0, 0); g.lineTo(0, h); }; } } }//package mx.skins.halo
Section 164
//Border (mx.skins.Border) package mx.skins { import mx.core.*; public class Border extends ProgrammaticSkin implements IBorder { mx_internal static const VERSION:String = "3.0.0.0"; public function Border(){ super(); } public function get borderMetrics():EdgeMetrics{ return (EdgeMetrics.EMPTY); } } }//package mx.skins
Section 165
//ProgrammaticSkin (mx.skins.ProgrammaticSkin) package mx.skins { import mx.core.*; import flash.display.*; import flash.geom.*; import mx.styles.*; import mx.managers.*; 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.0.0.0"; private static var tempMatrix:Matrix = new Matrix(); public function ProgrammaticSkin(){ super(); _width = measuredWidth; _height = measuredHeight; } public function getStyle(styleProp:String){ return (_styleName.getStyle(styleProp)); } 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 166
//RectangularBorder (mx.skins.RectangularBorder) package mx.skins { import flash.events.*; import mx.core.*; import flash.display.*; import flash.geom.*; import mx.styles.*; import flash.system.*; import mx.resources.*; import flash.net.*; import flash.utils.*; 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.0.0.0"; 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 167
//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 168
//State (mx.states.State) package mx.states { import flash.events.*; import mx.core.*; 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.0.0.0"; 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 169
//Transition (mx.states.Transition) package mx.states { import mx.core.*; 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.0.0.0"; public function Transition(){ super(); } } }//package mx.states
Section 170
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration) package mx.styles { import flash.events.*; import mx.core.*; import flash.display.*; import mx.managers.*; 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.0.0.0"; 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 171
//ISimpleStyleClient (mx.styles.ISimpleStyleClient) package mx.styles { public interface ISimpleStyleClient { function set styleName(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void; function styleChanged(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void; function get styleName():Object; } }//package mx.styles
Section 172
//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 173
//IStyleManager (mx.styles.IStyleManager) package mx.styles { import flash.events.*; public interface IStyleManager { function isColorName(value:String):Boolean; function registerParentDisplayListInvalidatingStyle(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerInheritingStyle(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function set stylesRoot(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void; function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void; function getColorNames(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerSizeInvalidatingStyle(E:\dev\3.0.x\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 174
//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 175
//IStyleModule (mx.styles.IStyleModule) package mx.styles { public interface IStyleModule { function unload():void; } }//package mx.styles
Section 176
//StyleManager (mx.styles.StyleManager) package mx.styles { import flash.events.*; import mx.core.*; import flash.system.*; public class StyleManager { mx_internal static const VERSION:String = "3.0.0.0"; 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 177
//StyleManagerImpl (mx.styles.StyleManagerImpl) package mx.styles { import flash.events.*; import mx.core.*; import flash.system.*; import mx.modules.*; import mx.events.*; import mx.resources.*; import mx.managers.*; 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.0.0.0"; 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.modules.*; import mx.events.*; 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 178
//StyleProtoChain (mx.styles.StyleProtoChain) package mx.styles { import mx.core.*; import flash.display.*; public class StyleProtoChain { mx_internal static const VERSION:String = "3.0.0.0"; 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 179
//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.0.0.0"; 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 180
//ColorUtil (mx.utils.ColorUtil) package mx.utils { import mx.core.*; public class ColorUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 181
//GraphicsUtil (mx.utils.GraphicsUtil) package mx.utils { import mx.core.*; import flash.display.*; public class GraphicsUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 182
//NameUtil (mx.utils.NameUtil) package mx.utils { import mx.core.*; import flash.display.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.0.0.0"; private static var counter:int = 0; public function NameUtil(){ super(); } public static function displayObjectToString(displayObject:DisplayObject):String{ var result:String; var s:String; var indices:Array; var o:DisplayObject = 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; }; 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 183
//StringUtil (mx.utils.StringUtil) package mx.utils { import mx.core.*; public class StringUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 184
//IValidatorListener (mx.validators.IValidatorListener) package mx.validators { import mx.events.*; public interface IValidatorListener { function set errorString(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void; function get validationSubField():String; function validationResultHandler(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:ValidationResultEvent):void; function set validationSubField(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void; function get errorString():String; } }//package mx.validators
Section 185
//ValidationResult (mx.validators.ValidationResult) package mx.validators { import mx.core.*; 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.0.0.0"; 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 186
//_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 187
//_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 188
//_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 189
//_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 190
//_ButtonStyle (_ButtonStyle) package { import mx.core.*; import mx.styles.*; import mx.skins.halo.*; public class _ButtonStyle { public static function init(verticalGap:IFlexModuleFactory):void{ var fbs = verticalGap; 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.fontWeight = "bold"; this.paddingTop = 2; this.cornerRadius = 4; this.textAlign = "center"; this.verticalGap = 2; this.horizontalGap = 2; this.skin = ButtonSkin; this.paddingLeft = 10; this.paddingBottom = 2; this.paddingRight = 10; }; }; } } }//package
Section 191
//_comboDropdownStyle (_comboDropdownStyle) package { import mx.core.*; import mx.styles.*; public class _comboDropdownStyle { public static function init(leading:IFlexModuleFactory):void{ var fbs = leading; 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.shadowDirection = "center"; this.fontWeight = "normal"; this.dropShadowEnabled = true; this.leading = 0; this.backgroundColor = 0xFFFFFF; this.shadowDistance = 1; this.cornerRadius = 0; this.borderThickness = 0; this.paddingLeft = 5; this.paddingRight = 5; }; }; } } }//package
Section 192
//_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 193
//_dateFieldPopupStyle (_dateFieldPopupStyle) package { import mx.core.*; import mx.styles.*; public class _dateFieldPopupStyle { public static function init(_dateFieldPopupStyle.as$4:IFlexModuleFactory):void{ var fbs = _dateFieldPopupStyle.as$4; 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.backgroundColor = 0xFFFFFF; this.borderThickness = 0; }; }; } } }//package
Section 194
//_errorTipStyle (_errorTipStyle) package { import mx.core.*; import mx.styles.*; public class _errorTipStyle { public static function init(borderColor:IFlexModuleFactory):void{ var fbs = borderColor; 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.fontWeight = "bold"; this.borderStyle = "errorTipRight"; this.paddingTop = 4; this.borderColor = 13510953; this.color = 0xFFFFFF; this.fontSize = 9; this.shadowColor = 0; this.paddingLeft = 4; this.paddingBottom = 4; this.paddingRight = 4; }; }; } } }//package
Section 195
//_globalStyle (_globalStyle) package { import mx.core.*; import mx.styles.*; import mx.skins.halo.*; public class _globalStyle { public static function init(horizontalGridLines:IFlexModuleFactory):void{ var fbs = horizontalGridLines; 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.fillColor = 0xFFFFFF; this.kerning = false; this.iconColor = 0x111111; this.textRollOverColor = 2831164; this.horizontalAlign = "left"; this.shadowCapColor = 14015965; this.backgroundAlpha = 1; this.filled = true; this.textDecoration = "none"; this.roundedBottomCorners = true; this.fontThickness = 0; this.focusBlendMode = "normal"; this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE]; this.horizontalGap = 8; this.borderCapColor = 9542041; this.buttonColor = 7305079; this.indentation = 17; this.selectionDisabledColor = 0xDDDDDD; this.closeDuration = 250; this.embedFonts = false; this.paddingTop = 0; this.letterSpacing = 0; this.focusAlpha = 0.4; this.bevel = true; this.fontSize = 10; this.shadowColor = 0xEEEEEE; this.borderAlpha = 1; this.paddingLeft = 0; this.fontWeight = "normal"; this.indicatorGap = 14; this.focusSkin = HaloFocusRect; this.dropShadowEnabled = false; this.leading = 2; this.borderSkin = HaloBorder; this.fontSharpness = 0; this.modalTransparencyDuration = 100; this.borderThickness = 1; this.backgroundSize = "auto"; this.borderStyle = "inset"; this.borderColor = 12040892; this.fontAntiAliasType = "advanced"; this.errorColor = 0xFF0000; this.shadowDistance = 2; this.horizontalGridLineColor = 0xF7F7F7; this.stroked = false; this.modalTransparencyColor = 0xDDDDDD; this.cornerRadius = 0; this.verticalAlign = "top"; this.textIndent = 0; this.fillAlphas = [0.6, 0.4, 0.75, 0.65]; this.verticalGridLineColor = 14015965; this.themeColor = 40447; this.version = "3.0.0"; this.shadowDirection = "center"; this.modalTransparency = 0.5; this.repeatInterval = 35; this.openDuration = 250; this.textAlign = "left"; this.fontFamily = "Verdana"; this.textSelectedColor = 2831164; this.paddingBottom = 0; this.strokeWidth = 1; this.fontGridFitType = "pixel"; this.horizontalGridLines = false; this.useRollOver = true; this.verticalGridLines = true; this.repeatDelay = 500; this.fontStyle = "normal"; this.dropShadowColor = 0; this.focusThickness = 2; this.verticalGap = 6; this.disabledColor = 11187123; this.paddingRight = 0; this.focusRoundedCorners = "tl tr bl br"; this.borderSides = "left top right bottom"; this.disabledIconColor = 0x999999; this.modalTransparencyBlur = 3; this.color = 734012; this.selectionDuration = 250; this.highlightAlphas = [0.3, 0]; }; }; } } }//package
Section 196
//_headerDateTextStyle (_headerDateTextStyle) package { import mx.core.*; import mx.styles.*; public class _headerDateTextStyle { public static function init(bold:IFlexModuleFactory):void{ var fbs = bold; 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.fontWeight = "bold"; this.textAlign = "center"; }; }; } } }//package
Section 197
//_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 198
//_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.paddingBottom = 2; this.paddingRight = 2; }; }; } } }//package
Section 199
//_MenuStyle (_MenuStyle) package { import mx.core.*; import mx.styles.*; import mx.skins.halo.*; public class _MenuStyle { private static var _embed_css_Assets_swf_MenuBranchEnabled_830086026:Class = _MenuStyle__embed_css_Assets_swf_MenuBranchEnabled_830086026; private static var _embed_css_Assets_swf_MenuBranchDisabled_1144533735:Class = _MenuStyle__embed_css_Assets_swf_MenuBranchDisabled_1144533735; private static var _embed_css_Assets_swf_MenuSeparator_1913937056:Class = _MenuStyle__embed_css_Assets_swf_MenuSeparator_1913937056; private static var _embed_css_Assets_swf_MenuRadioDisabled_1616664418:Class = _MenuStyle__embed_css_Assets_swf_MenuRadioDisabled_1616664418; private static var _embed_css_Assets_swf_MenuRadioEnabled_1028143967:Class = _MenuStyle__embed_css_Assets_swf_MenuRadioEnabled_1028143967; private static var _embed_css_Assets_swf_MenuCheckEnabled_1085972354:Class = _MenuStyle__embed_css_Assets_swf_MenuCheckEnabled_1085972354; private static var _embed_css_Assets_swf_MenuCheckDisabled_580334369:Class = _MenuStyle__embed_css_Assets_swf_MenuCheckDisabled_580334369; public static function init(branchDisabledIcon:IFlexModuleFactory):void{ var fbs = branchDisabledIcon; var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Menu"); if (!style){ style = new CSSStyleDeclaration(); StyleManager.setStyleDeclaration("Menu", style, false); }; if (style.defaultFactory == null){ style.defaultFactory = function ():void{ this.radioIcon = _embed_css_Assets_swf_MenuRadioEnabled_1028143967; this.borderStyle = "menuBorder"; this.paddingTop = 1; this.rightIconGap = 15; this.branchIcon = _embed_css_Assets_swf_MenuBranchEnabled_830086026; this.checkDisabledIcon = _embed_css_Assets_swf_MenuCheckDisabled_580334369; this.verticalAlign = "middle"; this.paddingLeft = 1; this.paddingRight = 0; this.checkIcon = _embed_css_Assets_swf_MenuCheckEnabled_1085972354; this.radioDisabledIcon = _embed_css_Assets_swf_MenuRadioDisabled_1616664418; this.dropShadowEnabled = true; this.branchDisabledIcon = _embed_css_Assets_swf_MenuBranchDisabled_1144533735; this.dropIndicatorSkin = ListDropIndicator; this.separatorSkin = _embed_css_Assets_swf_MenuSeparator_1913937056; this.horizontalGap = 6; this.leftIconGap = 18; this.paddingBottom = 1; }; }; } } }//package
Section 200
//_MenuStyle__embed_css_Assets_swf_MenuBranchDisabled_1144533735 (_MenuStyle__embed_css_Assets_swf_MenuBranchDisabled_1144533735) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuBranchDisabled_1144533735 extends SpriteAsset { } }//package
Section 201
//_MenuStyle__embed_css_Assets_swf_MenuBranchEnabled_830086026 (_MenuStyle__embed_css_Assets_swf_MenuBranchEnabled_830086026) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuBranchEnabled_830086026 extends SpriteAsset { } }//package
Section 202
//_MenuStyle__embed_css_Assets_swf_MenuCheckDisabled_580334369 (_MenuStyle__embed_css_Assets_swf_MenuCheckDisabled_580334369) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuCheckDisabled_580334369 extends SpriteAsset { } }//package
Section 203
//_MenuStyle__embed_css_Assets_swf_MenuCheckEnabled_1085972354 (_MenuStyle__embed_css_Assets_swf_MenuCheckEnabled_1085972354) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuCheckEnabled_1085972354 extends SpriteAsset { } }//package
Section 204
//_MenuStyle__embed_css_Assets_swf_MenuRadioDisabled_1616664418 (_MenuStyle__embed_css_Assets_swf_MenuRadioDisabled_1616664418) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuRadioDisabled_1616664418 extends SpriteAsset { } }//package
Section 205
//_MenuStyle__embed_css_Assets_swf_MenuRadioEnabled_1028143967 (_MenuStyle__embed_css_Assets_swf_MenuRadioEnabled_1028143967) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuRadioEnabled_1028143967 extends SpriteAsset { } }//package
Section 206
//_MenuStyle__embed_css_Assets_swf_MenuSeparator_1913937056 (_MenuStyle__embed_css_Assets_swf_MenuSeparator_1913937056) package { import mx.core.*; public class _MenuStyle__embed_css_Assets_swf_MenuSeparator_1913937056 extends SpriteAsset { } }//package
Section 207
//_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.borderColor = 0xFFFFFF; this.backgroundColor = 0xFFFFFF; this.headerColors = [0xE7E7E7, 0xD9D9D9]; this.footerColors = [0xE7E7E7, 0xC7C7C7]; this.borderAlpha = 1; }; }; } } }//package
Section 208
//_plainStyle (_plainStyle) package { import mx.core.*; import mx.styles.*; public class _plainStyle { public static function init(backgroundImage:IFlexModuleFactory):void{ var fbs = backgroundImage; 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.backgroundColor = 0xFFFFFF; this.backgroundImage = ""; this.horizontalAlign = "left"; this.paddingLeft = 0; this.paddingBottom = 0; this.paddingRight = 0; }; }; } } }//package
Section 209
//_popUpMenuStyle (_popUpMenuStyle) package { import mx.core.*; import mx.styles.*; public class _popUpMenuStyle { public static function init(normal:IFlexModuleFactory):void{ var fbs = normal; 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.fontWeight = "normal"; this.textAlign = "left"; }; }; } } }//package
Section 210
//_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 211
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle) package { import mx.core.*; import mx.styles.*; public class _swatchPanelTextFieldStyle { public static function init(shadowCapColor:IFlexModuleFactory):void{ var fbs = shadowCapColor; 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.borderStyle = "inset"; this.borderColor = 14015965; this.highlightColor = 12897484; this.backgroundColor = 0xFFFFFF; this.shadowCapColor = 14015965; this.shadowColor = 14015965; this.paddingLeft = 5; this.buttonColor = 7305079; this.borderCapColor = 9542041; this.paddingRight = 5; }; }; } } }//package
Section 212
//_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 213
//_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 214
//_todayStyleStyle (_todayStyleStyle) package { import mx.core.*; import mx.styles.*; public class _todayStyleStyle { public static function init(color:IFlexModuleFactory):void{ var fbs = color; 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.color = 0xFFFFFF; this.textAlign = "center"; }; }; } } }//package
Section 215
//_weekDayStyleStyle (_weekDayStyleStyle) package { import mx.core.*; import mx.styles.*; public class _weekDayStyleStyle { public static function init(bold:IFlexModuleFactory):void{ var fbs = bold; 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.fontWeight = "bold"; this.textAlign = "center"; }; }; } } }//package
Section 216
//_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 217
//_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 218
//Animation (Animation) package { import flash.display.*; import flash.media.*; public class Animation extends Sprite { public var loopAnimation:Boolean;// = false private var timePlaying:int;// = 0 private var FPS:int;// = 40 private var playing:Boolean;// = false private var anim:MovieClip; private var currentFrame:int;// = 0 private var animationSWF:MovieClip; public static const EXPLOSION_SOUND:Sound = new EXPLOSION(); public static const ANIM_EXPLOSION:Class = Animation_ANIM_EXPLOSION; private static const EXPLOSION:Class = Animation_EXPLOSION; public function Animation(swfClass:Class){ super(); animationSWF = new (swfClass); addChild(animationSWF); animationSWF.stop(); } public function startAnimation(frameNr:int=0):void{ if (playing){ throw (new Error("Animation already being played")); }; animationSWF.gotoAndStop(frameNr); playing = true; } public function isPlaying():Boolean{ return (playing); } public function stop():void{ playing = false; } public function getFramesCount():int{ return (animationSWF.totalFrames); } public function updateAnimation(timePassed:int):Boolean{ if (!playing){ return (false); }; timePlaying = (timePlaying + timePassed); var newFrame:int = ((FPS * timePlaying) / 1000); if (newFrame >= animationSWF.totalFrames){ if (loopAnimation){ newFrame = (newFrame % animationSWF.totalFrames); timePlaying = (timePlaying - ((animationSWF.totalFrames * 1000) / FPS)); } else { removeChild(animationSWF); playing = false; return (false); }; }; if (newFrame != currentFrame){ animationSWF.gotoAndStop(newFrame); currentFrame = newFrame; }; return (true); } } }//package
Section 219
//Animation_ANIM_EXPLOSION (Animation_ANIM_EXPLOSION) package { import mx.core.*; public class Animation_ANIM_EXPLOSION extends MovieClipAsset { } }//package
Section 220
//Animation_EXPLOSION (Animation_EXPLOSION) package { import mx.core.*; public class Animation_EXPLOSION extends SoundAsset { } }//package
Section 221
//Ball (Ball) package { import flash.display.*; import flash.geom.*; public class Ball extends Sprite { private var img:Bitmap; private var invisibilityCounter:int;// = 0 private var blendingDelta:Number;// = 0.05 public var glued:Boolean;// = false public var bonusSpeedMultiplayer:Number;// = 1 public var speedMultiplayer:Number;// = 1 private var EXPLOSIVEBALL_PNG:Class; private var ballShadow:Bitmap; public var directionVector:Point; private var blendCounter:int;// = 0 public var VectorAngle:Number;// = 0 private var FIREBALL_PNG:Class; private static const BALL_PNG:Class = Ball_BALL_PNG; public static const RADIUS:int = 10; public static const SPEED:int = 9; public static const MAX_BOUNCE_ANGLE:int = 65; public function Ball(posX:int, posY:int){ directionVector = new Point(0, -1); FIREBALL_PNG = Ball_FIREBALL_PNG; EXPLOSIVEBALL_PNG = Ball_EXPLOSIVEBALL_PNG; super(); this.x = (posX - RADIUS); this.y = (posY - RADIUS); var colorTransform:ColorTransform = new ColorTransform(0, 0, 0, 1, -255, -255, -255); img = new BALL_PNG(); ballShadow = new BALL_PNG(); ballShadow.bitmapData.colorTransform(new Rectangle(0, 0, img.width, img.height), colorTransform); ballShadow.x = 4; ballShadow.y = 6; ballShadow.alpha = 0.3; addChild(ballShadow); addChild(img); } public function blend(time:Number):void{ blendCounter = (blendCounter + time); if (blendCounter < 31){ return; }; blendCounter = (blendCounter - 31); if (alpha >= 1){ blendingDelta = (blendingDelta * -1); }; if (alpha <= 0){ if (++invisibilityCounter < 6){ return; }; blendingDelta = (blendingDelta * -1); invisibilityCounter = 0; }; alpha = (alpha + blendingDelta); } public function posAfterMove(time:Number):Number{ var delta:Number = (((((SPEED * speedMultiplayer) * directionVector.x) * bonusSpeedMultiplayer) * time) / 31); if ((((delta > 0)) && ((delta < 0.06)))){ delta = 0.06; }; return ((x + delta)); } public function switchToExplosive():void{ removeChild(img); img = new EXPLOSIVEBALL_PNG(); addChild(img); } public function switchToFire():void{ removeChild(img); img = new FIREBALL_PNG(); addChild(img); } public function collideWithCorner(corner:Point):void{ var angle:Number; var ballCenter:Point = new Point((x + RADIUS), (y + RADIUS)); var normal:Point = new Point(((ballCenter.x - corner.x) / Point.distance(corner, ballCenter)), ((ballCenter.y - corner.y) / Point.distance(corner, ballCenter))); var newDirectionVector:Point = new Point((directionVector.x + (normal.x * 2)), (directionVector.y + (normal.y * 2))); var vLength:Number = Point.distance(new Point(0, 0), newDirectionVector); newDirectionVector.x = (newDirectionVector.x / vLength); newDirectionVector.y = (newDirectionVector.y / vLength); if (Math.abs(newDirectionVector.x) < 0.05){ angle = 90; } else { angle = Math.abs(Board.radianToDg(Math.atan((newDirectionVector.y / newDirectionVector.x)))); }; if (angle < 25){ angle = 25; newDirectionVector.x = ((newDirectionVector.x < 0)) ? -0.9 : 0.9; newDirectionVector.y = ((newDirectionVector.y < 0)) ? -0.42 : 0.42; }; speedMultiplayer = 1; x = (corner.x + (newDirectionVector.x * RADIUS)); y = (corner.y + (newDirectionVector.y * RADIUS)); directionVector = newDirectionVector; } public function switchToNormal():void{ removeChild(img); img = new BALL_PNG(); addChild(img); } public function yPosAfterMove(time:Number):Number{ return ((y + (((((SPEED * speedMultiplayer) * directionVector.y) * bonusSpeedMultiplayer) * time) / 31))); } } }//package
Section 222
//Ball_BALL_PNG (Ball_BALL_PNG) package { import mx.core.*; public class Ball_BALL_PNG extends BitmapAsset { } }//package
Section 223
//Ball_EXPLOSIVEBALL_PNG (Ball_EXPLOSIVEBALL_PNG) package { import mx.core.*; public class Ball_EXPLOSIVEBALL_PNG extends BitmapAsset { } }//package
Section 224
//Ball_FIREBALL_PNG (Ball_FIREBALL_PNG) package { import mx.core.*; public class Ball_FIREBALL_PNG extends BitmapAsset { } }//package
Section 225
//Block (Block) package { import flash.display.*; import flash.media.*; public class Block extends Sprite { private var shadowImg:Bitmap; public var steel:Boolean; public var bonus:int;// = 0 public var mobile:Boolean; public var color:int; private var bonusImg:Bitmap; public var stone:Boolean; public var hadCollision:Boolean;// = false public var bonusRevealed:Boolean;// = false public var gridRow:int; private var blockImg:Bitmap; public var gridColumn:int; public var mobileDirection:int;// = 1 public static const FIRE_BONUS_PNG:Class = Block_FIRE_BONUS_PNG; public static const VANISH_BONUS_PNG:Class = Block_VANISH_BONUS_PNG; public static const DISCOVER_BONUS_SOUND:Sound = new DISCOVER_BONUS(); public static const SLOW_BONUS_PNG:Class = Block_SLOW_BONUS_PNG; public static const SMALL_BLOCK_HEIGHT:int = 30; public static const SHRINK_BONUS_PNG:Class = Block_SHRINK_BONUS_PNG; public static const BLOCK_SMALL:int = 1; public static const BONUS_VANISHING_BALL:int = 5; private static const BLUE_BLOCK_PNG:Class = Block_BLUE_BLOCK_PNG; private static const STAR_BONUS_PNG:Class = Block_STAR_BONUS_PNG; public static const GROW_BONUS_PNG:Class = Block_GROW_BONUS_PNG; public static const BONUS_EXPLODING_BALL:int = 3; public static const BONUS_STAR:int = 19; private static const STEEL_BLOCK_PNG:Class = Block_STEEL_BLOCK_PNG; public static const BONUS_FIRE_BALL:int = 2; public static const COLOR_WOOD:int = 0; public static const BONUS_SHRINK_PLATFORM:int = 16; public static const CHAIN_BONUS_PNG:Class = Block_CHAIN_BONUS_PNG; private static const YELLOW_BLOCK_PNG:Class = Block_YELLOW_BLOCK_PNG; private static const BLOCK_PNG:Class = Block_BLOCK_PNG; public static const MOBILE_BLOCK_SPEED:int = 3; public static const BONUS_LIFE:int = 18; public static const BONUS_SLOW_BALL:int = 1; private static const STONE_HIT_SOUND:Sound = new HIT_STONE_BLOCK(); private static const STONE_BLOCK_PNG:Class = Block_STONE_BLOCK_PNG; public static const COLOR_STONE:int = 5; private static const WOOD_HIT_SOUND:Sound = new HIT_WOOD_BLOCK(); private static const SPLIT_BONUS_PNG:Class = Block_SPLIT_BONUS_PNG; private static const LIFE_BONUS_PNG:Class = Block_LIFE_BONUS_PNG; public static const EXPLOSIVE_BONUS_PNG:Class = Block_EXPLOSIVE_BONUS_PNG; public static const COLOR_BLUE:int = 1; private static const QUESTION_MARK_BONUS_PNG:Class = Block_QUESTION_MARK_BONUS_PNG; public static const NO_BONUS_PNG:Class = Block_NO_BONUS_PNG; private static const GREEN_BLOCK_PNG:Class = Block_GREEN_BLOCK_PNG; public static const BONUS_GROW_PLATFORM:int = 15; public static const BONUS_CHAIN:int = 17; public static const BONUS_SPLIT_BALL:int = 4; public static const COLOR_GREEN:int = 2; private static const RED_BLOCK_PNG:Class = Block_RED_BLOCK_PNG; private static const HIT_STONE_BLOCK:Class = Block_HIT_STONE_BLOCK; private static const DISCOVER_BONUS:Class = Block_DISCOVER_BONUS; public static const COLOR_YELLOW:int = 4; private static const HIT_STONE_BLOCK_PNG:Class = Block_HIT_STONE_BLOCK_PNG; public static const COLOR_RED:int = 3; public static const BONUS_NONE:int = 0; private static const SHADOW_PNG:Class = Block_SHADOW_PNG; private static const HIT_WOOD_BLOCK:Class = Block_HIT_WOOD_BLOCK; public static const SMALL_BLOCK_WIDTH:int = 30; public function Block(gridColumn:int, gridRow:int, color:int=0, steel:Boolean=false, stone:Boolean=false, mobile:Boolean=false){ super(); this.gridColumn = gridColumn; this.gridRow = gridRow; this.x = (gridColumn * SMALL_BLOCK_WIDTH); this.y = (gridRow * SMALL_BLOCK_HEIGHT); this.steel = steel; this.stone = (steel) ? false : stone; this.mobile = mobile; this.color = (stone) ? COLOR_STONE : color; if (steel){ blockImg = new STEEL_BLOCK_PNG(); } else { switch (this.color){ case COLOR_BLUE: blockImg = new BLUE_BLOCK_PNG(); break; case COLOR_GREEN: blockImg = new GREEN_BLOCK_PNG(); break; case COLOR_RED: blockImg = new RED_BLOCK_PNG(); break; case COLOR_YELLOW: blockImg = new YELLOW_BLOCK_PNG(); break; case COLOR_STONE: blockImg = new STONE_BLOCK_PNG(); break; default: blockImg = new BLOCK_PNG(); break; }; }; shadowImg = new SHADOW_PNG(); draw(); } public function toNormal():void{ stone = false; removeChild(blockImg); blockImg = new HIT_STONE_BLOCK_PNG(); addChild(blockImg); } public function addBonus(bonus:int, hidden:Boolean=false):void{ if (steel){ throw (new Error("can't add bonus to steel block")); }; this.bonus = bonus; if (hidden){ bonusImg = ((bonus == BONUS_STAR)) ? new STAR_BONUS_PNG() : new QUESTION_MARK_BONUS_PNG(); } else { switch (bonus){ case BONUS_SLOW_BALL: bonusImg = new SLOW_BONUS_PNG(); break; case BONUS_CHAIN: bonusImg = new CHAIN_BONUS_PNG(); break; case BONUS_EXPLODING_BALL: bonusImg = new EXPLOSIVE_BONUS_PNG(); break; case BONUS_FIRE_BALL: bonusImg = new FIRE_BONUS_PNG(); break; case BONUS_GROW_PLATFORM: bonusImg = new GROW_BONUS_PNG(); break; case BONUS_SHRINK_PLATFORM: bonusImg = new SHRINK_BONUS_PNG(); break; case BONUS_SPLIT_BALL: bonusImg = new SPLIT_BONUS_PNG(); break; case BONUS_VANISHING_BALL: bonusImg = new VANISH_BONUS_PNG(); break; case BONUS_LIFE: bonusImg = new LIFE_BONUS_PNG(); break; case BONUS_STAR: bonusImg = new STAR_BONUS_PNG(); break; }; }; } public function move(time:Number):void{ x = (x + (((MOBILE_BLOCK_SPEED * mobileDirection) * time) / 31)); } public function revealBonus():void{ addChild(bonusImg); bonusRevealed = true; } private function draw():void{ this.addChild(blockImg); addChild(shadowImg); } public function posAfterMove(time:Number):Number{ return ((x + (((MOBILE_BLOCK_SPEED * mobileDirection) * time) / 31))); } public function getDestroySound():Sound{ if (color == COLOR_STONE){ return (STONE_HIT_SOUND); }; return (WOOD_HIT_SOUND); } } }//package
Section 226
//Block_BLOCK_PNG (Block_BLOCK_PNG) package { import mx.core.*; public class Block_BLOCK_PNG extends BitmapAsset { } }//package
Section 227
//Block_BLUE_BLOCK_PNG (Block_BLUE_BLOCK_PNG) package { import mx.core.*; public class Block_BLUE_BLOCK_PNG extends BitmapAsset { } }//package
Section 228
//Block_CHAIN_BONUS_PNG (Block_CHAIN_BONUS_PNG) package { import mx.core.*; public class Block_CHAIN_BONUS_PNG extends BitmapAsset { } }//package
Section 229
//Block_DISCOVER_BONUS (Block_DISCOVER_BONUS) package { import mx.core.*; public class Block_DISCOVER_BONUS extends SoundAsset { } }//package
Section 230
//Block_EXPLOSIVE_BONUS_PNG (Block_EXPLOSIVE_BONUS_PNG) package { import mx.core.*; public class Block_EXPLOSIVE_BONUS_PNG extends BitmapAsset { } }//package
Section 231
//Block_FIRE_BONUS_PNG (Block_FIRE_BONUS_PNG) package { import mx.core.*; public class Block_FIRE_BONUS_PNG extends BitmapAsset { } }//package
Section 232
//Block_GREEN_BLOCK_PNG (Block_GREEN_BLOCK_PNG) package { import mx.core.*; public class Block_GREEN_BLOCK_PNG extends BitmapAsset { } }//package
Section 233
//Block_GROW_BONUS_PNG (Block_GROW_BONUS_PNG) package { import mx.core.*; public class Block_GROW_BONUS_PNG extends BitmapAsset { } }//package
Section 234
//Block_HIT_STONE_BLOCK (Block_HIT_STONE_BLOCK) package { import mx.core.*; public class Block_HIT_STONE_BLOCK extends SoundAsset { } }//package
Section 235
//Block_HIT_STONE_BLOCK_PNG (Block_HIT_STONE_BLOCK_PNG) package { import mx.core.*; public class Block_HIT_STONE_BLOCK_PNG extends BitmapAsset { } }//package
Section 236
//Block_HIT_WOOD_BLOCK (Block_HIT_WOOD_BLOCK) package { import mx.core.*; public class Block_HIT_WOOD_BLOCK extends SoundAsset { } }//package
Section 237
//Block_LIFE_BONUS_PNG (Block_LIFE_BONUS_PNG) package { import mx.core.*; public class Block_LIFE_BONUS_PNG extends BitmapAsset { } }//package
Section 238
//Block_NO_BONUS_PNG (Block_NO_BONUS_PNG) package { import mx.core.*; public class Block_NO_BONUS_PNG extends BitmapAsset { } }//package
Section 239
//Block_QUESTION_MARK_BONUS_PNG (Block_QUESTION_MARK_BONUS_PNG) package { import mx.core.*; public class Block_QUESTION_MARK_BONUS_PNG extends BitmapAsset { } }//package
Section 240
//Block_RED_BLOCK_PNG (Block_RED_BLOCK_PNG) package { import mx.core.*; public class Block_RED_BLOCK_PNG extends BitmapAsset { } }//package
Section 241
//Block_SHADOW_PNG (Block_SHADOW_PNG) package { import mx.core.*; public class Block_SHADOW_PNG extends BitmapAsset { } }//package
Section 242
//Block_SHRINK_BONUS_PNG (Block_SHRINK_BONUS_PNG) package { import mx.core.*; public class Block_SHRINK_BONUS_PNG extends BitmapAsset { } }//package
Section 243
//Block_SLOW_BONUS_PNG (Block_SLOW_BONUS_PNG) package { import mx.core.*; public class Block_SLOW_BONUS_PNG extends BitmapAsset { } }//package
Section 244
//Block_SPLIT_BONUS_PNG (Block_SPLIT_BONUS_PNG) package { import mx.core.*; public class Block_SPLIT_BONUS_PNG extends BitmapAsset { } }//package
Section 245
//Block_STAR_BONUS_PNG (Block_STAR_BONUS_PNG) package { import mx.core.*; public class Block_STAR_BONUS_PNG extends BitmapAsset { } }//package
Section 246
//Block_STEEL_BLOCK_PNG (Block_STEEL_BLOCK_PNG) package { import mx.core.*; public class Block_STEEL_BLOCK_PNG extends BitmapAsset { } }//package
Section 247
//Block_STONE_BLOCK_PNG (Block_STONE_BLOCK_PNG) package { import mx.core.*; public class Block_STONE_BLOCK_PNG extends BitmapAsset { } }//package
Section 248
//Block_VANISH_BONUS_PNG (Block_VANISH_BONUS_PNG) package { import mx.core.*; public class Block_VANISH_BONUS_PNG extends BitmapAsset { } }//package
Section 249
//Block_YELLOW_BLOCK_PNG (Block_YELLOW_BLOCK_PNG) package { import mx.core.*; public class Block_YELLOW_BLOCK_PNG extends BitmapAsset { } }//package
Section 250
//BlockSmashParticle (BlockSmashParticle) package { import flash.display.*; import flash.geom.*; public class BlockSmashParticle extends Sprite { private const pBlueImg:Bitmap; private const pRedImg:Bitmap; private const pWoodImg:Bitmap; private const pGreenImg:Bitmap; private const pYellowImg:Bitmap; private const pStoneImg:Bitmap; private const TIME_TO_LIVE:int = 2500; public var speed:Number;// = 0.2 public var directionVector:Point; private var particleImg:Bitmap; public var timeDelta:Number;// = 0 public var timeLived:int;// = 0 public static const SIZE:int = 5; private static const GRAVITY:Number = 3.5; private static const PARTICLE_WOOD_PNG:Class = BlockSmashParticle_PARTICLE_WOOD_PNG; public static const SPEED_MULTIPLAYER:Number = 0.2; private static const PARTICLE_GREEN_PNG:Class = BlockSmashParticle_PARTICLE_GREEN_PNG; private static const PARTICLE_STONE_PNG:Class = BlockSmashParticle_PARTICLE_STONE_PNG; private static const PARTICLE_YELLOW_PNG:Class = BlockSmashParticle_PARTICLE_YELLOW_PNG; private static const PARTICLE_RED_PNG:Class = BlockSmashParticle_PARTICLE_RED_PNG; private static const PARTICLE_BLUE_PNG:Class = BlockSmashParticle_PARTICLE_BLUE_PNG; public function BlockSmashParticle(){ directionVector = new Point(); pWoodImg = new PARTICLE_WOOD_PNG(); pRedImg = new PARTICLE_RED_PNG(); pYellowImg = new PARTICLE_YELLOW_PNG(); pGreenImg = new PARTICLE_GREEN_PNG(); pBlueImg = new PARTICLE_BLUE_PNG(); pStoneImg = new PARTICLE_STONE_PNG(); particleImg = pWoodImg; super(); addChild(particleImg); } public function switchTo(type:int):void{ removeChild(particleImg); switch (type){ case Block.COLOR_BLUE: particleImg = pBlueImg; break; case Block.COLOR_GREEN: particleImg = pGreenImg; break; case Block.COLOR_YELLOW: particleImg = pYellowImg; break; case Block.COLOR_RED: particleImg = pRedImg; break; case Block.COLOR_STONE: particleImg = pStoneImg; break; default: particleImg = pWoodImg; break; }; addChild(particleImg); } public function move(time:Number):void{ x = (x + (((speed * directionVector.x) * (time - timeDelta)) / 31)); y = (y + (((speed * directionVector.y) * (time - timeDelta)) / 31)); directionVector.y = (directionVector.y + ((GRAVITY * (time - timeDelta)) / 31)); timeDelta = 0; timeLived = (timeLived + (time - timeDelta)); if (timeLived > TIME_TO_LIVE){ alpha = (1 - (((timeLived - TIME_TO_LIVE) / 31) * 0.05)); }; } public function randomizeSpeed():void{ speed = SPEED_MULTIPLAYER; var change:Number = (Math.random() / 8); change = (change * ((Math.random() < 0.5)) ? -1 : 1); speed = (speed + change); } public function randomizeAngle(angleSpan:int=15):void{ var angle:Number = (Math.random() * angleSpan); angle = Board.dgToRadian(angle); angle = (angle * ((Math.random() < 0.5)) ? -1 : 1); var vectX:Number = ((directionVector.x * Math.cos(angle)) - (directionVector.y * Math.sin(angle))); var vectY:Number = ((directionVector.x * Math.sin(angle)) + (directionVector.y * Math.cos(angle))); directionVector.x = vectX; directionVector.y = vectY; } } }//package
Section 251
//BlockSmashParticle_PARTICLE_BLUE_PNG (BlockSmashParticle_PARTICLE_BLUE_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_BLUE_PNG extends BitmapAsset { } }//package
Section 252
//BlockSmashParticle_PARTICLE_GREEN_PNG (BlockSmashParticle_PARTICLE_GREEN_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_GREEN_PNG extends BitmapAsset { } }//package
Section 253
//BlockSmashParticle_PARTICLE_RED_PNG (BlockSmashParticle_PARTICLE_RED_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_RED_PNG extends BitmapAsset { } }//package
Section 254
//BlockSmashParticle_PARTICLE_STONE_PNG (BlockSmashParticle_PARTICLE_STONE_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_STONE_PNG extends BitmapAsset { } }//package
Section 255
//BlockSmashParticle_PARTICLE_WOOD_PNG (BlockSmashParticle_PARTICLE_WOOD_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_WOOD_PNG extends BitmapAsset { } }//package
Section 256
//BlockSmashParticle_PARTICLE_YELLOW_PNG (BlockSmashParticle_PARTICLE_YELLOW_PNG) package { import mx.core.*; public class BlockSmashParticle_PARTICLE_YELLOW_PNG extends BitmapAsset { } }//package
Section 257
//Board (Board) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.net.*; import flash.utils.*; import libs.de.polygonal.core.*; import flash.ui.*; public class Board extends Sprite { private const activeNormalBallBonusDuration:int = 15000; private const activeExplodingBallBonusDuration:int = 8000; private var activePlatformBonus:int;// = 0 private var levelInProgress:Boolean;// = false private var fireParticles:Array; private var fireParticlePool:ObjectPool; private var quitText:TextField; private var bonusesHidden:Boolean;// = false private var blocksForBonuses:Array; private var destroyableBlocksCount:int;// = 0 private var starsCaught:int;// = 0 private var blocksToAdd:Array; private var chainImg:Bitmap; private var pauseText:TextField; private var paused:Boolean;// = false private var nextLevel:String;// = "" private var balls:Array; private var levelStarted:Boolean;// = false private var splitBalls:Array; private var paperCardImg:Bitmap; private var loadingTimer:Timer; private var lastAction:int; private var platform:Platform; private var activePlatformChainDuration:int;// = 10000 private var activeBallBonusStartTime:int;// = 0 private var splitHappened:Boolean;// = false private var blocks:Array; private var level:XML; private var fallingBonuses:Array; private var readFromXml:Boolean;// = true private var fadeBoardTimer:Number;// = 0 private var blockParticles:Array; private var starsRevealed:Boolean;// = false private var activeBallBonusDuration:int;// = 15000 private var levelLoader:URLLoader; private var activePlatformBonusDuration:int;// = 30000 private var date:Date; private var animationsPlaying:Array; private var timeToFade:int;// = 0 private var timeToMoveParticle:int;// = 0 private var mobileBlocks:Array; private var levelPath:String; private var pseudoRandomArray:Array; private var activePlatformNormalBonusDuration:int;// = 30000 private var loadingFinished:Boolean;// = false private var timerFinished:Boolean;// = false private var fallingBonus:FallingBonus; private var timeToNextParticle:int;// = 0 private var levelLoadingInfo:TextField; private var activePlatformBonusStartTime:int;// = 0 private var board:Array; private var blockParticlePool:ObjectPool; private var format:TextFormat; private var activeBallBonus:int;// = 0 private var ball:Ball; public static const PLATFORM_POS_Y:int = 400; public static const NR_OF_ROWS:int = 30; private static const LIFE_LOST:Class = Board_LIFE_LOST; public static const PLATFORM_START_POS_X:int = 189; private static const PAPER_CARD_PNG:Class = Board_PAPER_CARD_PNG; public static const GAME_LOST:String = "gameLost"; private static const LIFE_LOST_SOUND:Sound = new LIFE_LOST(); public static const GAME_FINISHED:String = "gameFinished"; public static const WIDTH:int = 450; public static const HEIGHT:int = 480; private static const CHAIN_PNG:Class = Board_CHAIN_PNG; public static const GAME_WON:String = "gameWon"; public static const NR_OF_COLUMNS:int = 15; public static const LOADING_MIN_TIME:int = 1000; public static const CHAIN_POS_Y:int = (PLATFORM_POS_Y + Platform.NORMAL_HEIGHT); private static var font:Class = Board_font; public function Board(levelPath:String, starsHidden:Boolean=false, bonusesHidden:Boolean=false){ var j:int; paperCardImg = new PAPER_CARD_PNG(); board = new Array(NR_OF_ROWS); blocks = new Array(); mobileBlocks = new Array(); blocksToAdd = new Array(); blocksForBonuses = new Array(); balls = new Array(); fallingBonuses = new Array(); animationsPlaying = new Array(); fireParticles = new Array(); blockParticles = new Array(); blockParticlePool = new ObjectPool(true); fireParticlePool = new ObjectPool(true); levelLoadingInfo = new TextField(); format = new TextFormat(); levelLoader = new URLLoader(); splitBalls = new Array(2); pseudoRandomArray = [-1, 1, -1, 1, -1, 1, -1, 1]; super(); this.starsRevealed = !(starsHidden); this.bonusesHidden = bonusesHidden; Main.points = 0; Main.updateScore(0); Main.livesNumber = (Main.isAdventure()) ? 3 : 6; Main.updateLives(); loadingTimer = new Timer(LOADING_MIN_TIME, 0); loadingTimer.addEventListener(TimerEvent.TIMER, levelLoaded, false, 0, true); chainImg = new CHAIN_PNG(); this.levelPath = levelPath; if ((WIDTH % Block.SMALL_BLOCK_WIDTH) != 0){ throw (new Error("Board size must be the multiplity of largest block width")); }; var i:int; while (i < board.length) { board[i] = new Array(NR_OF_COLUMNS); j = 0; while (j < NR_OF_COLUMNS) { board[i][j] = 0; j++; }; i++; }; blockParticlePool.allocate(BlockSmashParticle, 120); fireParticlePool.allocate(FireParticle, 50); addEventListener(Event.ADDED_TO_STAGE, onAdded, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, onRemoved, false, 0, true); format.font = "Journal"; format.size = 30; format.align = TextFormatAlign.CENTER; levelLoadingInfo.selectable = false; levelLoadingInfo.embedFonts = true; levelLoadingInfo.defaultTextFormat = format; levelLoadingInfo.text = "Loading, please wait"; levelLoadingInfo.autoSize = TextFieldAutoSize.CENTER; levelLoadingInfo.x = ((WIDTH / 2) - (levelLoadingInfo.width / 2)); levelLoadingInfo.y = ((HEIGHT / 2) - (levelLoadingInfo.height / 2)); paperCardImg.x = (levelLoadingInfo.x - ((paperCardImg.width - levelLoadingInfo.width) / 2)); paperCardImg.y = (levelLoadingInfo.y - ((paperCardImg.height - levelLoadingInfo.height) / 2)); pauseText = new TextField(); pauseText.selectable = false; pauseText.embedFonts = true; pauseText.defaultTextFormat = format; pauseText.text = "Pause"; pauseText.autoSize = TextFieldAutoSize.CENTER; pauseText.y = HEIGHT; pauseText.x = 20; pauseText.addEventListener(MouseEvent.CLICK, pause, false, 0, true); quitText = new TextField(); quitText.selectable = false; quitText.embedFonts = true; quitText.defaultTextFormat = format; quitText.text = "Quit"; quitText.autoSize = TextFieldAutoSize.CENTER; quitText.y = HEIGHT; quitText.x = ((WIDTH - quitText.width) - 30); quitText.addEventListener(MouseEvent.CLICK, endGame, false, 0, true); } private function onKeyPressed(e:KeyboardEvent):void{ if (!levelStarted){ return; }; platform.mouseSteering = false; switch (e.keyCode){ case Keyboard.RIGHT: platform.startMove(Platform.RIGHT); break; case Keyboard.LEFT: platform.startMove(Platform.LEFT); break; case 80: pause(); break; case 32: if (balls.length > 0){ Ball(balls[0]).glued = false; }; break; case 81: endGame(); break; }; } private function caughtBonus(bonus:FallingBonus, time:int):void{ Main.updateScore(50); if (bonus.type == activePlatformBonus){ activePlatformBonusStartTime = time; Main.platformBonusTimeBar.restart(); return; }; var oldActivePlatformBonus:int = activePlatformBonus; if (bonus.type != Block.BONUS_STAR){ finishBonus(activePlatformBonus); }; if ((((bonus.type == Block.BONUS_SHRINK_PLATFORM)) && (!((oldActivePlatformBonus == Block.BONUS_GROW_PLATFORM))))){ Main.mp3PlayerInstance.playSound(Platform.RUBBER_SHRINK_SOUND); platform.shrinking = true; platform.growing = false; platform.returning = false; platform.animCounter = 0; activePlatformBonus = bonus.type; activePlatformBonusStartTime = time; activePlatformBonusDuration = activePlatformNormalBonusDuration; Main.platformBonusTimeBar.restart(); Main.platformBonusTimeBar.ANIM_TIME = activePlatformBonusDuration; Main.showBonusIcon(true, Block.SHRINK_BONUS_PNG); }; if ((((bonus.type == Block.BONUS_GROW_PLATFORM)) && (!((oldActivePlatformBonus == Block.BONUS_SHRINK_PLATFORM))))){ Main.mp3PlayerInstance.playSound(Platform.RUBBER_GROW_SOUND); platform.growing = true; platform.shrinking = false; platform.returning = false; platform.animCounter = 0; activePlatformBonus = bonus.type; activePlatformBonusStartTime = time; activePlatformBonusDuration = activePlatformNormalBonusDuration; Main.platformBonusTimeBar.restart(); Main.platformBonusTimeBar.ANIM_TIME = activePlatformBonusDuration; Main.showBonusIcon(true, Block.GROW_BONUS_PNG); }; if (bonus.type == Block.BONUS_CHAIN){ addChain(); activePlatformBonus = bonus.type; activePlatformBonusStartTime = time; activePlatformBonusDuration = activePlatformChainDuration; Main.platformBonusTimeBar.restart(); Main.platformBonusTimeBar.ANIM_TIME = activePlatformBonusDuration; Main.showBonusIcon(true, Block.CHAIN_BONUS_PNG); }; if (bonus.type == Block.BONUS_LIFE){ activePlatformBonus = Block.BONUS_NONE; Main.livesNumber++; Main.updateLives(); Main.mp3PlayerInstance.playSound(FallingBonus.EXTRA_LIFE_SOUND); }; if (bonus.type == Block.BONUS_STAR){ starsCaught++; Main.instance.showStar(starsCaught); Main.mp3PlayerInstance.playSound(FallingBonus.STAR_SOUND); }; } private function moveSmashedBlocksParticles(time:Number):void{ var bParticle:BlockSmashParticle; var i:int; while (i < blockParticles.length) { bParticle = blockParticles[i]; if (bParticle.alpha <= 0){ removeFromArray(blockParticles, bParticle); removeChild(bParticle); blockParticlePool.object = bParticle; i--; } else { bParticle.move(time); if (bParticle.y > (PLATFORM_POS_Y + Platform.NORMAL_HEIGHT)){ bParticle.alpha = (bParticle.alpha - 0.05); }; if (bParticle.x <= 0){ bParticle.x = (bParticle.x * -1); bParticle.directionVector.x = (bParticle.directionVector.x * -1); }; if ((bParticle.x + bParticle.width) >= WIDTH){ bParticle.x = ((WIDTH - ((bParticle.x + bParticle.width) - WIDTH)) - bParticle.width); bParticle.directionVector.x = (bParticle.directionVector.x * -1); }; if (bParticle.y <= 0){ bParticle.directionVector.y = Math.abs(bParticle.directionVector.y); bParticle.y = Math.abs(bParticle.y); }; }; i++; }; } private function addBonus(type:int, number:int=1, reveal:Boolean=false):void{ var index:int; var block:Block; var i:int; while (i < number) { if (blocksForBonuses.length == 0){ throw (new Error("Theres more bonuses then non-steel blocks!")); }; index = (Math.random() * blocksForBonuses.length); if (index == blocksForBonuses.length){ index--; }; block = blocksForBonuses[index]; block.addBonus(type, bonusesHidden); removeFromArray(blocksForBonuses, block); if (reveal){ block.revealBonus(); }; i++; }; } private function getMBlockPassingThrough(x:Number, y:Number):Block{ var mBlock:Block; var row:int = (y / Block.SMALL_BLOCK_HEIGHT); var m:int; while (m < mobileBlocks.length) { mBlock = mobileBlocks[m]; if (mBlock.steel){ } else { if ((((((mBlock.gridRow == row)) && ((x >= mBlock.x)))) && ((x < (mBlock.x + Block.SMALL_BLOCK_WIDTH))))){ return (mBlock); }; }; m++; }; return (null); } private function onMouseMove(e:MouseEvent):void{ if (!levelStarted){ return; }; if (paused){ return; }; platform.mouseSteering = true; var oldX:Number = platform.x; platform.x = (e.stageX - x); if (platform.x < 0){ platform.x = 0; } else { if ((platform.x + platform.pWidth) > WIDTH){ platform.x = (WIDTH - platform.pWidth); }; }; if ((((balls.length > 0)) && (Ball(balls[0]).glued))){ Ball(balls[0]).x = (Ball(balls[0]).x + (platform.x - oldX)); }; } private function destroyBlockAnimation(bX:Number, bY:Number, ball:Ball, color:int, timePassed:int, onlyHit:Boolean=false):void{ var j:int; var bParticle:BlockSmashParticle; var i:int; while (i < 6) { if (((onlyHit) && ((((((i == 1)) || ((i == 2)))) || ((i == 4)))))){ } else { j = 0; while (j < 3) { if (((onlyHit) && ((i == 1)))){ } else { bParticle = blockParticlePool.object; bParticle.scaleX = (onlyHit) ? 0.8 : 1; bParticle.scaleY = (onlyHit) ? 0.8 : 1; bParticle.timeDelta = timePassed; bParticle.timeLived = 0; bParticle.switchTo(color); bParticle.alpha = 1; bParticle.x = (bX + (i * BlockSmashParticle.SIZE)); bParticle.y = (bY + ((j * 2) * BlockSmashParticle.SIZE)); bParticle.directionVector.x = ((((bX + (i * BlockSmashParticle.SIZE)) + (0.5 * BlockSmashParticle.SIZE)) - ball.x) - Ball.RADIUS); bParticle.directionVector.y = ((((bY + ((j * 2) * BlockSmashParticle.SIZE)) + BlockSmashParticle.SIZE) - ball.y) - Ball.RADIUS); bParticle.randomizeSpeed(); bParticle.randomizeAngle(); bParticle.rotation = (Math.random() * 180); blockParticles.push(bParticle); addChild(bParticle); }; j++; }; }; i++; }; } private function isMBlockAt(row:int, column:int):Boolean{ var mBlock:Block; var m:int; while (m < mobileBlocks.length) { mBlock = mobileBlocks[m]; if ((((mBlock.gridColumn == column)) && ((mBlock.gridRow == row)))){ return (true); }; m++; }; return (false); } private function spawnParticle(type:Class, timeDelta:Number=0):void{ var radiusModifier:Number; var ballTmp:Ball = balls[0]; var fParticle:FireParticle = fireParticlePool.object; fParticle.setTo(type); if (timeDelta < 0){ fParticle.alphaDelta = 1; }; var tmpVector:Point = new Point(ballTmp.directionVector.y, (-1 * ballTmp.directionVector.x)); var vectorLength:Number = Math.sqrt((Math.pow(tmpVector.x, 2) + Math.pow(tmpVector.y, 2))); tmpVector.x = (tmpVector.x / vectorLength); tmpVector.y = (tmpVector.y / vectorLength); if (type == FireParticle.FIRE_PARTICLE_04){ radiusModifier = 0.4; } else { if (type == FireParticle.FIRE_PARTICLE_03){ radiusModifier = 0.5; } else { if (type == FireParticle.FIRE_PARTICLE_02){ radiusModifier = 0.3; } else { if (type == FireParticle.FIRE_PARTICLE_01){ radiusModifier = 0; }; }; }; }; var rnd:Number = Math.random(); rnd = (rnd * ((Math.random() > 0.5)) ? 1 : -1); rnd = (rnd * Math.random()); var directionAdjustment:Number = 4; fParticle.directionVector.x = (-1 * ballTmp.directionVector.x); fParticle.directionVector.y = (-1 * ballTmp.directionVector.y); fParticle.speed = 3; fParticle.alpha = 0.9; fParticle.x = (((ballTmp.x + Ball.RADIUS) - (fParticle.width / 2)) + (((rnd * Ball.RADIUS) * tmpVector.x) * radiusModifier)); fParticle.y = (((ballTmp.y + Ball.RADIUS) - (fParticle.height / 2)) + (((rnd * Ball.RADIUS) * tmpVector.y) * radiusModifier)); fireParticles.push(fParticle); addChild(fParticle); } private function onMouseClick(e:MouseEvent):void{ if (!levelStarted){ return; }; if (balls.length > 0){ Ball(balls[0]).glued = false; }; } private function createParticles(timeDelta:Number):void{ if (timeDelta > 0){ timeToNextParticle = (timeToNextParticle + timeDelta); }; if ((((timeToNextParticle > 15)) || ((timeDelta < 0)))){ spawnParticle(FireParticle.FIRE_PARTICLE_03, timeDelta); spawnParticle(FireParticle.FIRE_PARTICLE_03, timeDelta); spawnParticle(FireParticle.FIRE_PARTICLE_02, timeDelta); spawnParticle(FireParticle.FIRE_PARTICLE_01, timeDelta); if (timeDelta > 0){ timeToNextParticle = (timeToNextParticle - 15); }; }; } private function constructFromXml(xml:XML):Boolean{ var rBlock:XML; var row:int; var column:int; var color:int; var bonus:int; var steel:String; var steelB:Boolean; var stone:String; var stoneB:Boolean; var mobile:String; var mobileB:Boolean; var direction:String; var directionI:int; if (xml.child("blocks") == null){ return (false); }; if (xml.blocks.child("block") == null){ return (false); }; for each (rBlock in xml.blocks.children()) { if (rBlock.child("row") == null){ return (false); }; row = rBlock.row; if (rBlock.child("column") == null){ return (false); }; column = rBlock.column; color = ((rBlock.child("color") == null)) ? 0 : color = rBlock.color; color; bonus = ((rBlock.child("bonus") == null)) ? 0 : bonus = rBlock.bonus; bonus; steel = ((rBlock.child("steel") == null)) ? "false" : rBlock.steel; steelB = (steel.match("true")) ? true : false; stone = ((rBlock.child("stone") == null)) ? "false" : rBlock.stone; stoneB = (stone.match("true")) ? true : false; mobile = ((rBlock.child("mobile") == null)) ? "false" : rBlock.mobile; mobileB = (mobile.match("true")) ? true : false; direction = ((rBlock.child("direction") == null)) ? "right" : rBlock.direction; directionI = (direction.match("right")) ? 1 : -1; if (((stoneB) && (steelB))){ return (false); }; if (((steelB) && (!((bonus == Block.BONUS_NONE))))){ return (false); }; addBlock(row, column, color, 0, steelB, stoneB, mobileB, directionI); }; if (xml.child("bonuses") != null){ if (xml.bonuses.child("slow_ball") != null){ addBonus(Block.BONUS_SLOW_BALL, xml.bonuses.slow_ball); }; if (xml.bonuses.child("fire_ball") != null){ addBonus(Block.BONUS_FIRE_BALL, xml.bonuses.fire_ball); }; if (xml.bonuses.child("explosive_ball") != null){ addBonus(Block.BONUS_EXPLODING_BALL, xml.bonuses.explosive_ball); }; if (xml.bonuses.child("split_ball") != null){ addBonus(Block.BONUS_SPLIT_BALL, xml.bonuses.split_ball); }; if (xml.bonuses.child("grow_platform") != null){ addBonus(Block.BONUS_GROW_PLATFORM, xml.bonuses.grow_platform); }; if (xml.bonuses.child("shrink_platform") != null){ addBonus(Block.BONUS_SHRINK_PLATFORM, xml.bonuses.shrink_platform); }; if (xml.bonuses.child("vanishing_ball") != null){ addBonus(Block.BONUS_VANISHING_BALL, xml.bonuses.vanishing_ball); }; if (xml.bonuses.child("chain") != null){ addBonus(Block.BONUS_CHAIN, xml.bonuses.chain); }; if (xml.bonuses.child("life") != null){ addBonus(Block.BONUS_LIFE, xml.bonuses.life); }; if (xml.bonuses.child("star") != null){ addBonus(Block.BONUS_STAR, xml.bonuses.star, starsRevealed); }; }; Main.setPlaneRandomFactor(int(xml.plane_delay)); Main.setPlaneSpeedModifier(int(xml.plane_speed_mod)); return (true); } private function clean():void{ var j:int; var fParticle:FireParticle; var bParticle:BlockSmashParticle; var i:int; while (i < board.length) { board[i] = new Array(NR_OF_COLUMNS); j = 0; while (j < NR_OF_COLUMNS) { board[i][j] = 0; j++; }; i++; }; levelStarted = false; if (activeBallBonus){ finishBonus(activeBallBonus, balls[0]); }; if (activePlatformBonus){ finishBonus(activePlatformBonus); }; mobileBlocks = new Array(); blocksToAdd = new Array(); balls = new Array(); fallingBonuses = new Array(); animationsPlaying = new Array(); while (fireParticles.length > 0) { fParticle = fireParticles.pop(); removeChild(fParticle); fireParticlePool.object = fParticle; }; while (blockParticles.length > 0) { bParticle = blockParticles.pop(); removeChild(bParticle); blockParticlePool.object = bParticle; }; while (this.numChildren > 0) { this.removeChildAt(0); }; } public function finishBonus(bonus:int, ball:Ball=null):void{ var _local3:Ball; switch (bonus){ case Block.BONUS_VANISHING_BALL: if (ball == null){ ball = balls[0]; }; activeBallBonus = Block.BONUS_NONE; ball.alpha = 1; Main.ballBonusTimeBar.visible = false; Main.showBonusIcon(false, Block.NO_BONUS_PNG); break; case Block.BONUS_SLOW_BALL: if (ball == null){ ball = balls[0]; }; ball = Ball(balls[0]); ball.bonusSpeedMultiplayer = 1; activeBallBonus = Block.BONUS_NONE; Main.ballBonusTimeBar.visible = false; Main.showBonusIcon(false, Block.NO_BONUS_PNG); break; case Block.BONUS_SPLIT_BALL: if (ball == null){ throw (new Error("no ball added for Ball Split ending event")); }; while (balls.length > 0) { _local3 = Ball(balls.pop()); if (_local3 != ball){ removeChild(_local3); }; }; balls.push(ball); activeBallBonus = Block.BONUS_NONE; break; case Block.BONUS_EXPLODING_BALL: case Block.BONUS_FIRE_BALL: if (ball == null){ ball = balls[0]; }; ball.switchToNormal(); activeBallBonus = Block.BONUS_NONE; Main.ballBonusTimeBar.visible = false; Main.showBonusIcon(false, Block.NO_BONUS_PNG); break; case Block.BONUS_CHAIN: removeChild(chainImg); activePlatformBonus = Block.BONUS_NONE; Main.platformBonusTimeBar.visible = false; Main.showBonusIcon(true, Block.NO_BONUS_PNG); break; case Block.BONUS_SHRINK_PLATFORM: if (levelInProgress){ Main.mp3PlayerInstance.playSound(Platform.RUBBER_GROW_SOUND); }; platform.returning = true; platform.growing = false; platform.shrinking = false; platform.animCounter = 0; activePlatformBonus = Block.BONUS_NONE; Main.platformBonusTimeBar.visible = false; Main.showBonusIcon(true, Block.NO_BONUS_PNG); break; case Block.BONUS_GROW_PLATFORM: if (levelInProgress){ Main.mp3PlayerInstance.playSound(Platform.RUBBER_SHRINK_SOUND); }; platform.returning = true; platform.growing = false; platform.shrinking = false; platform.animCounter = 0; activePlatformBonus = Block.BONUS_NONE; Main.platformBonusTimeBar.visible = false; Main.showBonusIcon(true, Block.NO_BONUS_PNG); break; }; } private function boardFadeIn(e:Event):void{ if (contains(levelLoadingInfo)){ removeChild(levelLoadingInfo); removeChild(paperCardImg); }; var frame:int = ((new Date().getTime() - fadeBoardTimer) / 31); if (alpha <= 1){ alpha = (0.05 * frame); Main.setPlaneAlpha(alpha); } else { alpha = 1; removeEventListener(Event.ENTER_FRAME, boardFadeIn); addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true); date = new Date(); lastAction = date.getTime(); Main.startTime(); levelStarted = true; }; } private function levelFromCode():void{ var j:int; var i:int; while (i < 9) { j = 0; while (j < NR_OF_COLUMNS) { if ((((i == 1)) && ((j == 5)))){ addBlock(i, j, (j % 5), 0, false, true, true); } else { if ((((i == 1)) && ((j == 11)))){ addBlock(i, j, (j % 5), Block.BONUS_FIRE_BALL); } else { if ((((i == 2)) && ((j == 1)))){ addBlock(i, j, (j % 5), 0, true, false, true); } else { if ((((i == 2)) && ((j == 3)))){ addBlock(i, j, (j % 5), Block.BONUS_EXPLODING_BALL); } else { if ((((i == 2)) && ((j == 9)))){ addBlock(i, j, (j % 5), 0, true, false, true); } else { if ((((i == 4)) && ((j == 3)))){ addBlock(i, j, (j % 5), 0, false, true, true); } else { if ((((i == 4)) && ((j == 8)))){ addBlock(i, j, (j % 5), 0, false, true); } else { if ((((i == 5)) && ((j == 11)))){ addBlock(i, j, (j % 5), 0, true); } else { if ((((i == 6)) && ((j == 3)))){ addBlock(i, j, (j % 5), Block.BONUS_SPLIT_BALL); } else { if ((((i == 6)) && ((j == 6)))){ addBlock(i, j, (j % 5), Block.BONUS_GROW_PLATFORM, false, true); } else { if ((((i == 7)) && ((j == 1)))){ addBlock(i, j, (j % 5), Block.BONUS_SHRINK_PLATFORM, false, false, true); } else { if ((((i == 7)) && ((j == 10)))){ addBlock(i, j, (j % 5), 0, false, false, true); } else { if ((((i == 1)) && ((j == 8)))){ addBlock(i, j, (j % 5), Block.BONUS_CHAIN); } else { if ((((i == 3)) && ((j == 13)))){ addBlock(i, j, (j % 5), Block.BONUS_SHRINK_PLATFORM); } else { if ((((i == 3)) && ((j == 5)))){ addBlock(i, j, (j % 5), Block.BONUS_SLOW_BALL); } else { if ((((i == 8)) && ((j == 14)))){ addBlock(i, j, (j % 5), Block.BONUS_VANISHING_BALL); } else { addBlock(i, j, (j % 5)); }; }; }; }; }; }; }; }; }; }; }; }; }; }; }; }; j++; }; i++; }; } private function onKeyReleased(e:KeyboardEvent):void{ if (!levelStarted){ return; }; if (platform.mouseSteering){ return; }; switch (e.keyCode){ case Keyboard.RIGHT: platform.stopMove(Platform.RIGHT); break; case Keyboard.LEFT: platform.stopMove(Platform.LEFT); break; }; } private function onAdded(e:Event):void{ stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed, false, 0, true); stage.addEventListener(KeyboardEvent.KEY_UP, onKeyReleased, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true); stage.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true); alpha = 1; stage.focus = this; addChild(paperCardImg); addChild(levelLoadingInfo); loadingTimer.reset(); loadingTimer.start(); levelLoader.addEventListener(Event.COMPLETE, levelLoaded, false, 0, true); levelLoader.load(new URLRequest((Main.LEVEL_PATH + levelPath))); } private function endGame(e:MouseEvent=null):void{ removeEventListener(MouseEvent.CLICK, endGame); dispatchEvent(new Event(GAME_LOST)); dispatchEvent(new Event(GAME_FINISHED)); removeEventListener(Event.ENTER_FRAME, onEnterFrame); } private function moveParticle(time:Number):void{ var fParticle:FireParticle; timeToFade = (timeToFade + time); var k:int; while (k < fireParticles.length) { fParticle = fireParticles[k]; if (fParticle.alpha <= 0){ removeChild(fParticle); removeFromArray(fireParticles, fParticle); fireParticlePool.object = fParticle; k--; } else { fParticle.move(time); if (timeToFade > 15){ fParticle.fade(); }; }; k++; }; if (timeToFade > 15){ timeToFade = (timeToFade - 15); }; } private function onRemoved(e:Event):void{ stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed); stage.removeEventListener(KeyboardEvent.KEY_UP, onKeyReleased); stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); stage.removeEventListener(MouseEvent.CLICK, onMouseClick); } public function hideLoadingMsg():void{ if (contains(paperCardImg)){ removeChild(paperCardImg); }; if (contains(levelLoadingInfo)){ removeChild(levelLoadingInfo); }; } public function showLoadingMsg(useTimer:Boolean=false):void{ addChild(paperCardImg); addChild(levelLoadingInfo); if (useTimer){ loadingTimer.reset(); loadingTimer.start(); }; } private function boardFadeOut(e:Event):void{ var frame:int = ((new Date().getTime() - fadeBoardTimer) / 31); if (alpha >= 0){ alpha = (1 - (0.05 * frame)); Main.setPlaneAlpha(alpha); } else { alpha = 0; removeEventListener(Event.ENTER_FRAME, boardFadeOut); clean(); Main.resetPlane(); if (nextLevel != null){ if (Main.getStarsNeeded() <= starsCaught){ alpha = 1; addChild(paperCardImg); addChild(levelLoadingInfo); loadingTimer.reset(); loadingTimer.start(); levelLoader.load(new URLRequest((Main.LEVEL_PATH + nextLevel))); Main.clearBonusIcons(true); Main.showBonusIcon(true, Block.NO_BONUS_PNG); Main.showBonusIcon(false, Block.NO_BONUS_PNG); } else { dispatchEvent(new Event(GAME_LOST)); }; } else { if (Main.getStarsNeeded() <= starsCaught){ dispatchEvent(new Event(GAME_FINISHED)); dispatchEvent(new Event(GAME_WON)); } else { dispatchEvent(new Event(GAME_LOST)); }; }; }; } private function resolveBonus(block:Block, time:int, ball:Ball):void{ var _local4:Ball; if ((((block.bonus == activeBallBonus)) && (!((activeBallBonus == Block.BONUS_SPLIT_BALL))))){ Main.updateScore(50); activeBallBonusStartTime = time; Main.ballBonusTimeBar.restart(); return; }; if ((((block.bonus < Block.BONUS_GROW_PLATFORM)) && (!((activeBallBonus == block.bonus))))){ finishBonus(activeBallBonus, ball); }; switch (block.bonus){ case Block.BONUS_VANISHING_BALL: activeBallBonus = block.bonus; activeBallBonusStartTime = time; Main.updateScore(50); activeBallBonusDuration = activeExplodingBallBonusDuration; Main.ballBonusTimeBar.restart(); Main.ballBonusTimeBar.ANIM_TIME = activeExplodingBallBonusDuration; Main.showBonusIcon(false, Block.VANISH_BONUS_PNG); break; case Block.BONUS_SLOW_BALL: activeBallBonus = block.bonus; activeBallBonusStartTime = time; ball.bonusSpeedMultiplayer = 0.5; Main.updateScore(50); activeBallBonusDuration = activeNormalBallBonusDuration; Main.ballBonusTimeBar.restart(); Main.ballBonusTimeBar.ANIM_TIME = activeNormalBallBonusDuration; Main.showBonusIcon(false, Block.SLOW_BONUS_PNG); break; case Block.BONUS_FIRE_BALL: activeBallBonus = block.bonus; activeBallBonusStartTime = time; ball.switchToFire(); Main.updateScore(50); activeBallBonusDuration = activeNormalBallBonusDuration; Main.ballBonusTimeBar.restart(); Main.ballBonusTimeBar.ANIM_TIME = activeNormalBallBonusDuration; Main.showBonusIcon(false, Block.FIRE_BONUS_PNG); break; case Block.BONUS_EXPLODING_BALL: activeBallBonus = block.bonus; activeBallBonusStartTime = time; ball.switchToExplosive(); Main.updateScore(50); activeBallBonusDuration = activeExplodingBallBonusDuration; Main.ballBonusTimeBar.restart(); Main.ballBonusTimeBar.ANIM_TIME = activeExplodingBallBonusDuration; Main.showBonusIcon(false, Block.EXPLOSIVE_BONUS_PNG); break; case Block.BONUS_SPLIT_BALL: activeBallBonus = block.bonus; activeBallBonusStartTime = time; _local4 = new Ball((ball.x + Ball.RADIUS), (ball.y + Ball.RADIUS)); _local4.directionVector.y = (-1 * ball.directionVector.y); _local4.directionVector.x = (-1 * ball.directionVector.x); _local4.speedMultiplayer = ball.speedMultiplayer; addChild(_local4); swapChildren(_local4, platform); balls.push(_local4); Main.updateScore(50); splitBalls[0] = ball; splitBalls[1] = _local4; splitHappened = true; break; case Block.BONUS_SHRINK_PLATFORM: case Block.BONUS_GROW_PLATFORM: case Block.BONUS_CHAIN: case Block.BONUS_LIFE: case Block.BONUS_STAR: fallingBonus = new FallingBonus(block.x, block.y, block.bonus, bonusesHidden); addChild(fallingBonus); swapChildren(fallingBonus, platform); fallingBonuses.push(fallingBonus); break; }; } private function addBlock(row:int, column:int, color:int=0, bonus:int=0, steel:Boolean=false, stone:Boolean=false, mobile:Boolean=false, direction:int=1):void{ var index:int; if (board[row][column] != 0){ return; }; var block:Block = new Block(column, row, color, steel, stone, mobile); block.mobileDirection = direction; if (bonus > 0){ block.addBonus(bonus, bonusesHidden); }; addToBlocksToAdd(block); if (mobile == false){ index = blocks.push(block); board[row][column] = index; } else { mobileBlocks.push(block); }; if (!steel){ destroyableBlocksCount++; blocksForBonuses.push(block); }; } private function sortMobileBlocks():void{ var i:int; var mBlock1:Block; var mBlock2:Block; var sorted:Boolean; var k:int; while (k < mobileBlocks.length) { sorted = true; i = 0; while (i < ((mobileBlocks.length - k) - 1)) { mBlock1 = mobileBlocks[i]; mBlock2 = mobileBlocks[(i + 1)]; if (((mBlock1.gridRow * 100) + mBlock1.gridColumn) > ((mBlock2.gridRow * 100) + mBlock2.gridColumn)){ mobileBlocks[i] = mBlock2; mobileBlocks[(i + 1)] = mBlock1; sorted = false; }; i++; }; if (sorted){ break; }; k++; }; } private function getTimeBonus():int{ var time:int = Main.getTime(); if (time <= 30000){ return (500); }; if (time <= 60000){ return (400); }; if (time <= 90000){ return (300); }; if (time <= 120000){ return (200); }; if (time <= 150000){ return (100); }; return (0); } private function addToBlocksToAdd(block:Block):void{ var tmpBlock:Block; var tmpBlockIndex:int; var tmpArray:Array; var tmpArray2:Array; var blockIndex:int = ((block.gridRow * 100) + block.gridColumn); if (blocksToAdd.length == 0){ blocksToAdd.push(block); return; }; var k:int; while (k < blocksToAdd.length) { tmpBlock = blocksToAdd[k]; tmpBlockIndex = ((tmpBlock.gridRow * 100) + tmpBlock.gridColumn); if (blockIndex == tmpBlockIndex){ throw (new Error("adding brick to already used grid spot")); }; if (blockIndex > tmpBlockIndex){ if (k == 0){ blocksToAdd.unshift(block); return; }; tmpArray = blocksToAdd.slice(0, k); tmpArray.push(block); tmpArray2 = blocksToAdd.slice(k); blocksToAdd = tmpArray; while (tmpArray2.length > 0) { blocksToAdd.push(tmpArray2.shift()); }; return; }; k++; }; blocksToAdd.push(block); } private function addChain():void{ chainImg.x = 0; chainImg.y = CHAIN_POS_Y; addChild(chainImg); swapChildren(chainImg, platform); } private function levelLoaded(e:Event):void{ if ((e is TimerEvent)){ timerFinished = true; loadingTimer.stop(); } else { level = new XML(e.target.data); loadingFinished = true; }; if (((!(timerFinished)) || (!(loadingFinished)))){ return; }; timerFinished = false; loadingFinished = false; if (readFromXml){ if (constructFromXml(level) == false){ throw (new Error("error loading level: xml file contains errors")); }; } else { levelFromCode(); }; addBlocksToDisplayList(); sortMobileBlocks(); blocksForBonuses = new Array(); ball = new Ball((PLATFORM_START_POS_X + (Platform.NORMAL_WIDTH / 2)), (PLATFORM_POS_Y - Ball.RADIUS)); ball.glued = true; addChild(ball); balls.push(ball); platform = new Platform(PLATFORM_START_POS_X, PLATFORM_POS_Y); addChild(platform); alpha = 0; addEventListener(Event.ENTER_FRAME, boardFadeIn, false, 0, true); fadeBoardTimer = new Date().getTime(); levelInProgress = true; starsCaught = 0; if (!contains(pauseText)){ addChild(pauseText); }; if (!contains(quitText)){ addChild(quitText); }; } private function removeFromArray(array:Array, element):void{ var tmpB:*; var tmpA:Array = new Array(); while ((tmpB = array.pop()) != element) { if (tmpB == null){ throw (new Error("element to remove not found in Array")); }; tmpA.push(tmpB); }; while (tmpA.length > 0) { array.push(tmpA.pop()); }; } private function destroyBlock(block:Block, time:int, timePassed:int, ball:Ball, hitByExplosion:Boolean=false):Boolean{ var anim:Animation; var blockCenter:Point; var mBlock:Block; var i:int; var j:int; var column:int; var row:int; if (block.steel){ if (activeBallBonus == Block.BONUS_FIRE_BALL){ finishBonus(activeBallBonus); }; return (true); }; if (((((!((block.bonus == 0))) && (!((activeBallBonus == Block.BONUS_FIRE_BALL))))) && (!((activeBallBonus == Block.BONUS_EXPLODING_BALL))))){ if (block.bonusRevealed){ if (activeBallBonus != Block.BONUS_EXPLODING_BALL){ Main.mp3PlayerInstance.playSound(block.getDestroySound()); }; resolveBonus(block, time, ball); if (block.mobile){ removeFromArray(mobileBlocks, block); } else { board[block.gridRow][block.gridColumn] = 0; }; destroyableBlocksCount--; Main.updateScore(10); removeChild(block); destroyBlockAnimation(block.x, block.y, ball, block.color, timePassed); return (false); } else { if (block.stone){ block.toNormal(); destroyBlockAnimation(block.x, block.y, ball, Block.COLOR_STONE, timePassed, true); }; if (activeBallBonus != Block.BONUS_EXPLODING_BALL){ Main.mp3PlayerInstance.playSound(Block.DISCOVER_BONUS_SOUND); }; block.revealBonus(); return (false); }; } else { if (((block.stone) && (!((activeBallBonus == Block.BONUS_FIRE_BALL))))){ block.toNormal(); destroyBlockAnimation(block.x, block.y, ball, Block.COLOR_STONE, timePassed, true); if (activeBallBonus != Block.BONUS_EXPLODING_BALL){ Main.mp3PlayerInstance.playSound(block.getDestroySound()); }; if (activeBallBonus == Block.BONUS_EXPLODING_BALL){ block.bonus = Block.BONUS_NONE; }; } else { if (block.mobile){ removeFromArray(mobileBlocks, block); destroyableBlocksCount--; Main.updateScore(10); destroyBlockAnimation(block.x, block.y, ball, block.color, timePassed); if (activeBallBonus != Block.BONUS_EXPLODING_BALL){ Main.mp3PlayerInstance.playSound(block.getDestroySound()); }; removeChild(block); } else { if (board[block.gridRow][block.gridColumn] != 0){ board[block.gridRow][block.gridColumn] = 0; Main.updateScore(10); destroyableBlocksCount--; destroyBlockAnimation(block.x, block.y, ball, block.color, timePassed); if (activeBallBonus != Block.BONUS_EXPLODING_BALL){ Main.mp3PlayerInstance.playSound(block.getDestroySound()); }; removeChild(block); }; }; }; }; if ((((activeBallBonus == Block.BONUS_EXPLODING_BALL)) && (!(hitByExplosion)))){ anim = new Animation(Animation.ANIM_EXPLOSION); anim.x = ((block.x + (Block.SMALL_BLOCK_WIDTH / 2)) - (anim.width / 2)); anim.y = ((block.y + (Block.SMALL_BLOCK_HEIGHT / 2)) - (anim.height / 2)); anim.startAnimation(0); addChild(anim); animationsPlaying.push(anim); Main.mp3PlayerInstance.playSound(Animation.EXPLOSION_SOUND); blockCenter = new Point((block.x + (Block.SMALL_BLOCK_WIDTH / 2)), (block.y + (Block.SMALL_BLOCK_HEIGHT / 2))); i = -1; while (i < 2) { j = -1; while (j < 2) { if ((((i == 0)) && ((j == 0)))){ } else { column = ((blockCenter.x + (i * Block.SMALL_BLOCK_WIDTH)) / Block.SMALL_BLOCK_WIDTH); row = ((blockCenter.y + (j * Block.SMALL_BLOCK_HEIGHT)) / Block.SMALL_BLOCK_HEIGHT); if ((((((row < 0)) || ((column < 0)))) || ((column >= NR_OF_COLUMNS)))){ } else { if (board[row][column] != 0){ destroyBlock(blocks[(board[row][column] - 1)], time, timePassed, ball, true); } else { mBlock = getMBlockPassingThrough((blockCenter.x + (i * Block.SMALL_BLOCK_WIDTH)), (blockCenter.y + (j * Block.SMALL_BLOCK_HEIGHT))); if (mBlock != null){ destroyBlock(mBlock, time, timePassed, ball, true); }; }; }; }; j++; }; i++; }; }; return (false); } private function onEnterFrame(e:Event):void{ var fParticle:FireParticle; var moved:Number; var collisions:Array; var ballNr:int; var mBlock:Block; var blockXCorner:Number; var b:int; var mBlock2:Block; var ballXCorner:Number; var ballYCorner:Number; var ballX:Number; var ballY:Number; var centerColumn:int; var centerRow:int; var center:Point; var directionX:int; var directionY:int; var row:int; var column:int; var platformPart:Number; var angle:Number; var vectX:Number; var vectY:Number; var sign:int; var corner:Point; var oldCenter:Point; var dist:Number; var after:Number; var steel:Boolean; var coll:Collision; var anim:Animation; date = new Date(); var startTime:int = date.getTime(); var timeLeft:int = (startTime - lastAction); var timePassed:int; var collisionTmp:Collision = new Collision(); var firstCollision:Collision = new Collision(); var wasCollision:Boolean; var frameTime:int = timeLeft; var timeStep = 3; if (paused){ lastAction = startTime; activeBallBonusStartTime = (activeBallBonusStartTime + frameTime); activePlatformBonusStartTime = (activePlatformBonusStartTime + frameTime); return; }; if (destroyableBlocksCount == 0){ removeEventListener(Event.ENTER_FRAME, onEnterFrame); nextLevel = Main.nextLevel(); levelInProgress = false; if (!Main.isAdventure()){ fadeBoardTimer = new Date().getTime(); Main.instance.addEventListener(Main.COUNTDOWN_FINISHED, startCountDownAnimationFinished, false, 0, true); Main.instance.startCountDownAnimation(getTimeBonus()); } else { addEventListener(Event.ENTER_FRAME, boardFadeOut, false, 0, true); fadeBoardTimer = new Date().getTime(); }; return; }; var k:int; while (k < balls.length) { ball = balls[k]; if (ball.y > HEIGHT){ removeChild(ball); removeFromArray(balls, ball); while (fireParticles.length > 0) { fParticle = fireParticles.pop(); fireParticlePool.object = fParticle; removeChild(fParticle); }; }; if (balls.length == 0){ Main.livesNumber--; Main.updateLives(); Main.mp3PlayerInstance.playSound(LIFE_LOST_SOUND); if (Main.livesNumber == 0){ removeEventListener(Event.ENTER_FRAME, onEnterFrame); dispatchEvent(new Event(GAME_FINISHED)); dispatchEvent(new Event(GAME_LOST)); return; }; ball = new Ball((PLATFORM_START_POS_X + (Platform.NORMAL_WIDTH / 2)), (PLATFORM_POS_Y - Ball.RADIUS)); ball.glued = true; addChild(ball); balls.push(ball); ball = null; activeBallBonus = Block.BONUS_NONE; if (activePlatformBonus != Block.BONUS_NONE){ finishBonus(activePlatformBonus); }; Main.clearBonusIcons(); Main.showBonusIcon(true, Block.NO_BONUS_PNG); Main.showBonusIcon(false, Block.NO_BONUS_PNG); while (fallingBonuses.length > 0) { fallingBonus = fallingBonuses.pop(); removeChild(fallingBonus); }; removeChild(platform); platform = new Platform(PLATFORM_START_POS_X, PLATFORM_POS_Y); addChild(platform); }; k++; }; timePassed = 1; while (timePassed <= timeLeft) { if (platform.growing){ platform.grow(); }; if (platform.shrinking){ platform.shrink(); }; if (platform.returning){ platform.toNormal(); }; moved = platform.move(timeStep); if ((((balls.length > 0)) && (Ball(balls[0]).glued))){ Ball(balls[0]).x = (Ball(balls[0]).x + moved); }; k = 0; while (k < fallingBonuses.length) { fallingBonus = fallingBonuses[k]; fallingBonus.move(timeStep); if (fallingBonus.y > HEIGHT){ removeChild(fallingBonus); removeFromArray(fallingBonuses, fallingBonus); } else { if (((((fallingBonus.y + fallingBonus.pHeight) > PLATFORM_POS_Y)) && ((fallingBonus.y < (PLATFORM_POS_Y + platform.pHeight))))){ if (((((fallingBonus.x + fallingBonus.pWidth) > platform.x)) && ((fallingBonus.x < (platform.x + platform.pWidth))))){ caughtBonus(fallingBonus, (startTime + timePassed)); removeChild(fallingBonus); removeFromArray(fallingBonuses, fallingBonus); }; }; }; k++; }; collisions = new Array(); k = 0; while (k < mobileBlocks.length) { mBlock = mobileBlocks[k]; blockXCorner = (mBlock.hadCollision) ? mBlock.x : mBlock.posAfterMove(timeStep); mBlock.hadCollision = false; if ((((blockXCorner <= 0)) || (((blockXCorner + Block.SMALL_BLOCK_WIDTH) >= WIDTH)))){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); blockXCorner = mBlock.x; }; column = ((mBlock.mobileDirection < 0)) ? (blockXCorner / Block.SMALL_BLOCK_WIDTH) : ((blockXCorner + Block.SMALL_BLOCK_WIDTH) / Block.SMALL_BLOCK_WIDTH); if (board[mBlock.gridRow][column] != 0){ blockXCorner = mBlock.x; mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; b = 0; while (b < mobileBlocks.length) { if (k == b){ } else { mBlock2 = mobileBlocks[b]; if (mBlock2.gridRow != mBlock.gridRow){ } else { if (Math.abs((blockXCorner - mBlock2.x)) < Block.SMALL_BLOCK_WIDTH){ blockXCorner = mBlock.x; mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; }; }; b++; }; mBlock.x = blockXCorner; k++; }; if (Ball(balls[0]).glued){ } else { ballNr = 0; while (ballNr < balls.length) { ball = balls[ballNr]; ballXCorner = ball.posAfterMove(timeStep); ballYCorner = ball.yPosAfterMove(timeStep); ballX = (ballXCorner + Ball.RADIUS); ballY = (ballYCorner + Ball.RADIUS); centerColumn = (ballX / Block.SMALL_BLOCK_WIDTH); centerRow = (ballY / Block.SMALL_BLOCK_HEIGHT); center = new Point(ballX, ballY); if (ballXCorner < 0){ ballXCorner = (ballXCorner * -1); ball.directionVector.x = (ball.directionVector.x * -1); }; if ((ballXCorner + (2 * Ball.RADIUS)) > WIDTH){ ballXCorner = ((WIDTH - ((ballXCorner + (2 * Ball.RADIUS)) - WIDTH)) - (2 * Ball.RADIUS)); ball.directionVector.x = (ball.directionVector.x * -1); }; if (ballYCorner < 0){ ballYCorner = (ballYCorner * -1); ball.directionVector.y = (ball.directionVector.y * -1); }; if (((((((ballYCorner + (2 * Ball.RADIUS)) >= CHAIN_POS_Y)) && ((activePlatformBonus == Block.BONUS_CHAIN)))) && (((ballYCorner + Ball.RADIUS) < CHAIN_POS_Y)))){ ball.directionVector.y = (ball.directionVector.y * -1); ballYCorner = ((CHAIN_POS_Y - ((ballYCorner + (2 * Ball.RADIUS)) - CHAIN_POS_Y)) - (2 * Ball.RADIUS)); }; if ((ballYCorner + (2 * Ball.RADIUS)) >= PLATFORM_POS_Y){ if (((((((ballXCorner + Ball.RADIUS) >= platform.x)) && (((ballXCorner + Ball.RADIUS) <= (platform.x + platform.pWidth))))) && ((ballYCorner < (PLATFORM_POS_Y + platform.pHeight))))){ ballYCorner = ((PLATFORM_POS_Y - ((ballYCorner + (2 * Ball.RADIUS)) - PLATFORM_POS_Y)) - (2 * Ball.RADIUS)); ball.directionVector.y = (ball.directionVector.y * -1); platformPart = (((ball.x + Ball.RADIUS) - platform.x) / platform.pWidth); if (platformPart < 0){ platformPart = 0; }; if (platformPart > 1){ platformPart = 1; }; angle = (-90 + (platformPart * 180)); if (ball.directionVector.x == 0){ ball.VectorAngle = 0; } else { ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); ball.VectorAngle = (ball.VectorAngle * ((ball.directionVector.x < 0)) ? -1 : 1); }; if ((ball.VectorAngle + angle) < (-1 * Ball.MAX_BOUNCE_ANGLE)){ angle = ((-1 * Ball.MAX_BOUNCE_ANGLE) - ball.VectorAngle); }; if ((ball.VectorAngle + angle) > Ball.MAX_BOUNCE_ANGLE){ angle = (Ball.MAX_BOUNCE_ANGLE - ball.VectorAngle); }; vectX = ((ball.directionVector.x * Math.cos(dgToRadian(angle))) - (ball.directionVector.y * Math.sin(dgToRadian(angle)))); vectY = ((ball.directionVector.x * Math.sin(dgToRadian(angle))) + (ball.directionVector.y * Math.cos(dgToRadian(angle)))); if ((((Math.abs(vectX) < 0.05)) && ((Math.abs(ball.directionVector.x) < 0.05)))){ sign = (Math.random() * pseudoRandomArray.length); sign = pseudoRandomArray[sign]; vectX = ((ball.directionVector.x * Math.cos(dgToRadian((sign * 3)))) - (ball.directionVector.y * Math.sin(dgToRadian((sign * 3))))); vectY = ((ball.directionVector.x * Math.sin(dgToRadian((sign * 3)))) + (ball.directionVector.y * Math.cos(dgToRadian((sign * 3))))); }; ball.directionVector.x = vectX; ball.directionVector.y = vectY; ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); ball.VectorAngle = (ball.VectorAngle * ((ball.directionVector.x < 0)) ? -1 : 1); ball.speedMultiplayer = 1; platform.hit = true; Main.mp3PlayerInstance.playSound(Platform.BOUNCE_SOUND); } else { if ((((((((ballXCorner <= (platform.x + platform.pWidth))) && ((ballXCorner > platform.x)))) && (((ballYCorner + Ball.RADIUS) > PLATFORM_POS_Y)))) && ((ballYCorner < (PLATFORM_POS_Y + platform.pHeight))))){ ballXCorner = ((platform.x + platform.pWidth) + ((platform.x + platform.pWidth) - ballXCorner)); ball.directionVector.x = Math.abs(ball.directionVector.x); platform.x = (platform.x + (Platform.LEFT - 1)); Main.mp3PlayerInstance.playSound(Platform.BOUNCE_SOUND); } else { if (((((((((ballXCorner + (2 * Ball.RADIUS)) >= platform.x)) && ((ballXCorner < (platform.x + platform.pWidth))))) && (((ballYCorner + Ball.RADIUS) > PLATFORM_POS_Y)))) && ((ballYCorner < (PLATFORM_POS_Y + platform.pHeight))))){ ballXCorner = ((platform.x - ((ballXCorner + (2 * Ball.RADIUS)) - platform.x)) - (2 * Ball.RADIUS)); ball.directionVector.x = (-1 * Math.abs(ball.directionVector.x)); platform.x = (platform.x + (Platform.RIGHT - 1)); Main.mp3PlayerInstance.playSound(Platform.BOUNCE_SOUND); } else { center = new Point((ballXCorner + Ball.RADIUS), (ballYCorner + Ball.RADIUS)); if ((((ball.directionVector.x >= 0)) && (((ballXCorner + Ball.RADIUS) < platform.x)))){ corner = new Point(platform.x, PLATFORM_POS_Y); if (Point.distance(corner, center) <= Ball.RADIUS){ ball.directionVector.x = (-1 * Math.abs(ball.directionVector.x)); ball.directionVector.y = (-1 * Math.abs(ball.directionVector.y)); oldCenter = new Point(ball.x, ball.y); dist = (Point.distance(corner, oldCenter) - Point.distance(corner, center)); after = ((Point.distance(corner, oldCenter) - Ball.RADIUS) / dist); ballXCorner = ball.posAfterMove((timeStep * after)); ballYCorner = ball.yPosAfterMove((timeStep * after)); ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); angle = ((-1 * Ball.MAX_BOUNCE_ANGLE) + ball.VectorAngle); vectX = ((ball.directionVector.x * Math.cos(dgToRadian(angle))) - (ball.directionVector.y * Math.sin(dgToRadian(angle)))); vectY = ((ball.directionVector.x * Math.sin(dgToRadian(angle))) + (ball.directionVector.y * Math.cos(dgToRadian(angle)))); ball.directionVector.x = vectX; ball.directionVector.y = vectY; if (ball.directionVector.x == 0){ ball.VectorAngle = 0; } else { ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); }; ball.speedMultiplayer = 1; Main.mp3PlayerInstance.playSound(Platform.BOUNCE_SOUND); }; } else { (((ball.directionVector.x <= 0)) && (((ballXCorner + Ball.RADIUS) > (platform.x + platform.pWidth)))); }; corner = new Point((platform.x + platform.pWidth), PLATFORM_POS_Y); if (Point.distance(corner, center) <= Ball.RADIUS){ ball.directionVector.x = Math.abs(ball.directionVector.x); ball.directionVector.y = (-1 * Math.abs(ball.directionVector.y)); oldCenter = new Point(ball.x, ball.y); dist = (Point.distance(corner, oldCenter) - Point.distance(corner, center)); after = ((Point.distance(corner, oldCenter) - Ball.RADIUS) / dist); ballXCorner = ball.posAfterMove((timeStep * after)); ballYCorner = ball.yPosAfterMove((timeStep * after)); ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); angle = (Ball.MAX_BOUNCE_ANGLE - ball.VectorAngle); vectX = ((ball.directionVector.x * Math.cos(dgToRadian(angle))) - (ball.directionVector.y * Math.sin(dgToRadian(angle)))); vectY = ((ball.directionVector.x * Math.sin(dgToRadian(angle))) + (ball.directionVector.y * Math.cos(dgToRadian(angle)))); ball.directionVector.x = vectX; ball.directionVector.y = vectY; if (ball.directionVector.x == 0){ ball.VectorAngle = 0; } else { ball.VectorAngle = (90 - Math.abs(radianToDg(Math.atan((Math.abs(ball.directionVector.y) / Math.abs(ball.directionVector.x)))))); }; ball.speedMultiplayer = 1; Main.mp3PlayerInstance.playSound(Platform.BOUNCE_SOUND); }; }; }; }; }; directionX = ((ball.directionVector.x < 0)) ? -1 : 1; directionY = ((ball.directionVector.y < 0)) ? -1 : 1; ballX = (ballXCorner + Ball.RADIUS); ballY = (ballYCorner + Ball.RADIUS); row = ((ballY + (directionY * Ball.RADIUS)) / Block.SMALL_BLOCK_HEIGHT); column = (ballX / Block.SMALL_BLOCK_WIDTH); if ((((column < NR_OF_COLUMNS)) && (!((board[row][column] == 0))))){ steel = destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.directionVector.y = (ball.directionVector.y * -1); ballYCorner = (ballYCorner + (directionY * ((Math.abs((ballY - ((row + 0.5) * Block.SMALL_BLOCK_HEIGHT))) - (0.5 * Block.SMALL_BLOCK_HEIGHT)) - Ball.RADIUS))); ballYCorner = (ballYCorner - (directionY * 0.01)); }; if (((((steel) && ((Math.abs(ball.directionVector.x) <= 0.08)))) && ((ball.directionVector.y < 0)))){ angle = ((ball.directionVector.x < 0)) ? -8 : 8; vectX = ((ball.directionVector.x * Math.cos(dgToRadian(angle))) - (ball.directionVector.y * Math.sin(dgToRadian(angle)))); vectY = ((ball.directionVector.x * Math.sin(dgToRadian(angle))) + (ball.directionVector.y * Math.cos(dgToRadian(angle)))); ball.directionVector.x = vectX; ball.directionVector.y = vectY; }; }; ballX = (ballXCorner + Ball.RADIUS); ballY = (ballYCorner + Ball.RADIUS); row = (ballY / Block.SMALL_BLOCK_HEIGHT); column = ((ballX + (directionX * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); if ((((column < NR_OF_COLUMNS)) && (!((board[row][column] == 0))))){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.directionVector.x = (ball.directionVector.x * -1); ballXCorner = (ballXCorner + (directionX * ((Math.abs((ballX - ((column + 0.5) * Block.SMALL_BLOCK_HEIGHT))) - (0.5 * Block.SMALL_BLOCK_HEIGHT)) - Ball.RADIUS))); }; }; if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y < 0)))){ row = (ballYCorner / Block.SMALL_BLOCK_HEIGHT); column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); if (((((!((row == centerRow))) && (!((column == centerColumn))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); if ((((((((column < NR_OF_COLUMNS)) && (!((column == centerColumn))))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); row = ((ballYCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_HEIGHT); if (((((!((column == centerColumn))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; }; }; }; } else { if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y > 0)))){ row = ((ballYCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_HEIGHT); column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); if (((((!((row == centerRow))) && (!((column == centerColumn))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); if ((((((((column < NR_OF_COLUMNS)) && (!((column == centerColumn))))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); row = (ballYCorner / Block.SMALL_BLOCK_HEIGHT); if (((((!((column == centerColumn))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; }; }; }; } else { if ((((ball.directionVector.x > 0)) && ((ball.directionVector.y > 0)))){ row = ((ballYCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_HEIGHT); column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); if ((((((((column < NR_OF_COLUMNS)) && (!((row == centerRow))))) && (!((column == centerColumn))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); if (((((!((column == centerColumn))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); row = (ballYCorner / Block.SMALL_BLOCK_HEIGHT); if ((((((((column < NR_OF_COLUMNS)) && (!((column == centerColumn))))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; }; }; }; } else { if ((((ball.directionVector.x > 0)) && ((ball.directionVector.y < 0)))){ row = (ballYCorner / Block.SMALL_BLOCK_HEIGHT); column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); if ((((((((column < NR_OF_COLUMNS)) && (!((row == centerRow))))) && (!((column == centerColumn))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = (ballXCorner / Block.SMALL_BLOCK_WIDTH); if (((((!((column == centerColumn))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((centerColumn * Block.SMALL_BLOCK_WIDTH), (centerRow * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; } else { column = ((ballXCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_WIDTH); row = ((ballYCorner + (2 * Ball.RADIUS)) / Block.SMALL_BLOCK_HEIGHT); if ((((((((column < NR_OF_COLUMNS)) && (!((column == centerColumn))))) && (!((row == centerRow))))) && (!((board[row][column] == 0))))){ corner = new Point((column * Block.SMALL_BLOCK_WIDTH), (row * Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) <= Ball.RADIUS){ destroyBlock(blocks[(board[row][column] - 1)], (startTime + timePassed), timePassed, ball); if (activeBallBonus != Block.BONUS_FIRE_BALL){ ball.collideWithCorner(corner); }; }; }; }; }; }; }; }; }; k = 0; while (k < mobileBlocks.length) { coll = new Collision(); mBlock = mobileBlocks[k]; if ((((mBlock.y > (ballYCorner + (2 * Ball.RADIUS)))) || (((mBlock.y + Block.SMALL_BLOCK_HEIGHT) < ballYCorner)))){ } else { if ((((mBlock.x > (ballXCorner + (2 * Ball.RADIUS)))) || (((mBlock.x + Block.SMALL_BLOCK_HEIGHT) < ballXCorner)))){ } else { if ((((((((ballXCorner < (mBlock.x + Block.SMALL_BLOCK_WIDTH))) && ((ballXCorner > mBlock.x)))) && (((ballYCorner + Ball.RADIUS) > mBlock.y)))) && (((ballYCorner + Ball.RADIUS) < (mBlock.y + Block.SMALL_BLOCK_HEIGHT))))){ if ((ball.directionVector.x * mBlock.mobileDirection) <= 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.changeX = true; ballXCorner = ((mBlock.x + Block.SMALL_BLOCK_WIDTH) + ((mBlock.x + Block.SMALL_BLOCK_WIDTH) - ballXCorner)); }; coll.mBlockIndex = k; collisions.push(coll); } else { if (((((((((ballXCorner + (2 * Ball.RADIUS)) > mBlock.x)) && ((ballXCorner < mBlock.x)))) && (((ballYCorner + Ball.RADIUS) > mBlock.y)))) && (((ballYCorner + Ball.RADIUS) < (mBlock.y + Block.SMALL_BLOCK_HEIGHT))))){ if ((ball.directionVector.x * mBlock.mobileDirection) <= 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.changeX = true; ballXCorner = ((mBlock.x - ((ballXCorner + (2 * Ball.RADIUS)) - mBlock.x)) - (2 * Ball.RADIUS)); }; coll.mBlockIndex = k; collisions.push(coll); } else { if (((((((((ballYCorner + (2 * Ball.RADIUS)) > mBlock.y)) && ((ballYCorner < mBlock.y)))) && (((ballXCorner + Ball.RADIUS) > mBlock.x)))) && (((ballXCorner + Ball.RADIUS) < (mBlock.x + Block.SMALL_BLOCK_WIDTH))))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.changeY = true; ballYCorner = ((mBlock.y - ((ballYCorner + (2 * Ball.RADIUS)) - mBlock.y)) - (2 * Ball.RADIUS)); }; coll.mBlockIndex = k; collisions.push(coll); } else { if ((((((((ballYCorner < (mBlock.y + Block.SMALL_BLOCK_WIDTH))) && ((ballYCorner > mBlock.y)))) && (((ballXCorner + Ball.RADIUS) > mBlock.x)))) && (((ballXCorner + Ball.RADIUS) < (mBlock.x + Block.SMALL_BLOCK_HEIGHT))))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.changeY = true; ballYCorner = ((mBlock.y + Block.SMALL_BLOCK_WIDTH) + ((mBlock.y + Block.SMALL_BLOCK_WIDTH) - ballYCorner)); }; coll.mBlockIndex = k; collisions.push(coll); } else { center = new Point((ballXCorner + Ball.RADIUS), (ballYCorner + Ball.RADIUS)); corner = new Point(mBlock.x, mBlock.y); if (Point.distance(center, corner) <= Ball.RADIUS){ coll.mBlockIndex = k; if ((((ball.directionVector.x >= 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x >= 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x < 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) > 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; }; }; }; collisions.push(coll); } else { corner = new Point((mBlock.x + Block.SMALL_BLOCK_WIDTH), mBlock.y); if (Point.distance(corner, center) < Ball.RADIUS){ coll.mBlockIndex = k; if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x > 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) > 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; }; }; }; collisions.push(coll); } else { corner = new Point(mBlock.x, (mBlock.y + Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) < Ball.RADIUS){ coll.mBlockIndex = k; if ((((ball.directionVector.x >= 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x >= 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x < 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) > 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; }; }; }; collisions.push(coll); } else { corner = new Point((mBlock.x + Block.SMALL_BLOCK_WIDTH), (mBlock.y + Block.SMALL_BLOCK_HEIGHT)); if (Point.distance(corner, center) < Ball.RADIUS){ coll.mBlockIndex = k; if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x <= 0)) && ((ball.directionVector.y > 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) < 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; } else { if ((((ball.directionVector.x > 0)) && ((ball.directionVector.y < 0)))){ if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) || (mBlock.steel))){ coll.corner = corner; }; if ((ball.directionVector.x * mBlock.mobileDirection) > 0){ mBlock.mobileDirection = (mBlock.mobileDirection * -1); }; }; }; }; collisions.push(coll); }; }; }; }; }; }; }; }; }; }; k++; }; while (collisions.length > 0) { coll = collisions.shift(); destroyBlock(mobileBlocks[coll.mBlockIndex], (startTime + timePassed), timePassed, ball); if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) && (coll.changeX))){ ball.directionVector.x = (ball.directionVector.x * -1); }; if (((!((activeBallBonus == Block.BONUS_FIRE_BALL))) && (coll.changeY))){ ball.directionVector.y = (ball.directionVector.y * -1); }; if (((((((!((activeBallBonus == Block.BONUS_FIRE_BALL))) && (!(coll.changeX)))) && (!(coll.changeY)))) && (!((coll.corner == null))))){ ball.collideWithCorner(coll.corner); }; }; if (splitHappened){ if (Math.abs((splitBalls[0].directionVector.x - splitBalls[1].directionVector.x)) < 0.1){ vectX = ((splitBalls[1].directionVector.x * Math.cos(dgToRadian(10))) - (splitBalls[1].directionVector.y * Math.sin(dgToRadian(10)))); vectY = ((splitBalls[1].directionVector.x * Math.sin(dgToRadian(10))) + (splitBalls[1].directionVector.y * Math.cos(dgToRadian(10)))); angle = Math.abs(radianToDg(Math.atan((vectY / vectX)))); if (angle < 25){ vectX = ((splitBalls[1].directionVector.x * Math.cos(dgToRadian(-10))) - (splitBalls[1].directionVector.y * Math.sin(dgToRadian(-10)))); vectY = ((splitBalls[1].directionVector.x * Math.sin(dgToRadian(-10))) + (splitBalls[1].directionVector.y * Math.cos(dgToRadian(-10)))); }; splitBalls[1].directionVector.x = vectX; splitBalls[1].directionVector.y = vectY; }; splitHappened = false; }; ball.x = ballXCorner; ball.y = ballYCorner; if (fireParticles.length > 0){ moveParticle(timeStep); }; if (activeBallBonus == Block.BONUS_FIRE_BALL){ createParticles(timeStep); }; if (activeBallBonus == Block.BONUS_VANISHING_BALL){ ball.blend(timeStep); }; if (platform.hit){ platform.shake(timeStep); }; ballNr++; }; }; timePassed = (timePassed + timeStep); }; if (activeBallBonus == Block.BONUS_FIRE_BALL){ createParticles(-1); }; if (blockParticles.length > 0){ moveSmashedBlocksParticles(frameTime); }; k = 0; while (k < animationsPlaying.length) { anim = animationsPlaying[k]; if (!anim.updateAnimation(frameTime)){ removeChild(anim); removeFromArray(animationsPlaying, anim); k--; }; k++; }; date = new Date(); Main.movePlain(frameTime); if (((!((activePlatformBonus == Block.BONUS_NONE))) && (Main.platformBonusTimeBar.updateTime(((startTime + frameTime) - activePlatformBonusStartTime))))){ finishBonus(activePlatformBonus); }; if (((((!((activeBallBonus == Block.BONUS_NONE))) && (!((activeBallBonus == Block.BONUS_SPLIT_BALL))))) && (Main.ballBonusTimeBar.updateTime(((startTime + frameTime) - activeBallBonusStartTime))))){ finishBonus(activeBallBonus); }; if (Main.updateTime(frameTime)){ dispatchEvent(new Event(GAME_LOST)); removeEventListener(Event.ENTER_FRAME, onEnterFrame); return; }; lastAction = date.getTime(); } private function addBlocksToDisplayList():void{ while (blocksToAdd.length > 0) { addChild(blocksToAdd.pop()); }; } private function startCountDownAnimationFinished(e:Event):void{ Main.instance.removeEventListener(Main.COUNTDOWN_FINISHED, startCountDownAnimationFinished); addEventListener(Event.ENTER_FRAME, boardFadeOut, false, 0, true); fadeBoardTimer = new Date().getTime(); } private function getMBlockAt(row:int, column:int):Block{ var mBlock:Block; var m:int; while (m < mobileBlocks.length) { mBlock = mobileBlocks[m]; if ((((mBlock.gridColumn == column)) && ((mBlock.gridRow == row)))){ return (mBlock); }; m++; }; return (null); } private function pause(e:MouseEvent=null):void{ paused = !(paused); if (paused){ Main.pausePlaneSound(); } else { Main.resumePlaneSound(); }; } public static function dgToRadian(dg:Number):Number{ return (((dg * 3.14) / 180)); } public static function radianToDg(rad:Number):Number{ return (((rad * 180) / 3.14)); } } }//package
Section 258
//Board_CHAIN_PNG (Board_CHAIN_PNG) package { import mx.core.*; public class Board_CHAIN_PNG extends BitmapAsset { } }//package
Section 259
//Board_font (Board_font) package { import mx.core.*; public class Board_font extends FontAsset { } }//package
Section 260
//Board_LIFE_LOST (Board_LIFE_LOST) package { import mx.core.*; public class Board_LIFE_LOST extends SoundAsset { } }//package
Section 261
//Board_PAPER_CARD_PNG (Board_PAPER_CARD_PNG) package { import mx.core.*; public class Board_PAPER_CARD_PNG extends BitmapAsset { } }//package
Section 262
//Collision (Collision) package { import flash.geom.*; public class Collision { public var mBlockIndex:int;// = -1 public var corner:Point; public var changeX:Boolean;// = false public var changeY:Boolean;// = false public function Collision(){ super(); } } }//package
Section 263
//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 264
//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 265
//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 266
//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 267
//FallingBonus (FallingBonus) package { import flash.display.*; import flash.geom.*; import flash.media.*; public class FallingBonus extends Sprite { public var pWidth:int; public var pHeight:int; public var type:int; private var bonusImg:Bitmap; private var bonusShadow:Bitmap; public static const SPEED:int = 3; public static const STAR_SOUND:Sound = new STAR(); private static const CHAIN_BONUS_PNG:Class = FallingBonus_CHAIN_BONUS_PNG; private static const LIFE_BONUS_PNG:Class = FallingBonus_LIFE_BONUS_PNG; private static const QUESTION_MARK_BONUS_PNG:Class = FallingBonus_QUESTION_MARK_BONUS_PNG; private static const EXTRA_LIFE:Class = FallingBonus_EXTRA_LIFE; private static const SHRINK_BONUS_PNG:Class = FallingBonus_SHRINK_BONUS_PNG; private static const STAR:Class = FallingBonus_STAR; public static const EXTRA_LIFE_SOUND:Sound = new EXTRA_LIFE(); private static const STAR_BONUS_PNG:Class = FallingBonus_STAR_BONUS_PNG; private static const GROW_BONUS_PNG:Class = FallingBonus_GROW_BONUS_PNG; public function FallingBonus(x:int, y:int, type:int, hidden:Boolean=false):void{ super(); this.x = x; this.y = y; this.type = type; if (hidden){ bonusImg = ((type == Block.BONUS_STAR)) ? new STAR_BONUS_PNG() : new QUESTION_MARK_BONUS_PNG(); bonusShadow = ((type == Block.BONUS_STAR)) ? new STAR_BONUS_PNG() : new QUESTION_MARK_BONUS_PNG(); } else { switch (type){ case Block.BONUS_SHRINK_PLATFORM: bonusImg = new SHRINK_BONUS_PNG(); bonusShadow = new SHRINK_BONUS_PNG(); break; case Block.BONUS_GROW_PLATFORM: bonusImg = new GROW_BONUS_PNG(); bonusShadow = new GROW_BONUS_PNG(); break; case Block.BONUS_CHAIN: bonusImg = new CHAIN_BONUS_PNG(); bonusShadow = new CHAIN_BONUS_PNG(); break; case Block.BONUS_LIFE: bonusImg = new LIFE_BONUS_PNG(); bonusShadow = new LIFE_BONUS_PNG(); break; case Block.BONUS_STAR: bonusImg = new STAR_BONUS_PNG(); bonusShadow = new STAR_BONUS_PNG(); break; }; }; pWidth = bonusImg.width; pHeight = bonusImg.height; var colorTransform:ColorTransform = new ColorTransform(0, 0, 0, 1, -255, -255, -255); bonusShadow.bitmapData.colorTransform(new Rectangle(0, 0, bonusImg.width, bonusImg.height), colorTransform); bonusShadow.x = 4; bonusShadow.y = 8; bonusShadow.alpha = 0.3; addChild(bonusShadow); addChild(bonusImg); } public function move(time:int):void{ y = (y + ((SPEED * time) / 31)); } } }//package
Section 268
//FallingBonus_CHAIN_BONUS_PNG (FallingBonus_CHAIN_BONUS_PNG) package { import mx.core.*; public class FallingBonus_CHAIN_BONUS_PNG extends BitmapAsset { } }//package
Section 269
//FallingBonus_EXTRA_LIFE (FallingBonus_EXTRA_LIFE) package { import mx.core.*; public class FallingBonus_EXTRA_LIFE extends SoundAsset { } }//package
Section 270
//FallingBonus_GROW_BONUS_PNG (FallingBonus_GROW_BONUS_PNG) package { import mx.core.*; public class FallingBonus_GROW_BONUS_PNG extends BitmapAsset { } }//package
Section 271
//FallingBonus_LIFE_BONUS_PNG (FallingBonus_LIFE_BONUS_PNG) package { import mx.core.*; public class FallingBonus_LIFE_BONUS_PNG extends BitmapAsset { } }//package
Section 272
//FallingBonus_QUESTION_MARK_BONUS_PNG (FallingBonus_QUESTION_MARK_BONUS_PNG) package { import mx.core.*; public class FallingBonus_QUESTION_MARK_BONUS_PNG extends BitmapAsset { } }//package
Section 273
//FallingBonus_SHRINK_BONUS_PNG (FallingBonus_SHRINK_BONUS_PNG) package { import mx.core.*; public class FallingBonus_SHRINK_BONUS_PNG extends BitmapAsset { } }//package
Section 274
//FallingBonus_STAR (FallingBonus_STAR) package { import mx.core.*; public class FallingBonus_STAR extends SoundAsset { } }//package
Section 275
//FallingBonus_STAR_BONUS_PNG (FallingBonus_STAR_BONUS_PNG) package { import mx.core.*; public class FallingBonus_STAR_BONUS_PNG extends BitmapAsset { } }//package
Section 276
//FireParticle (FireParticle) package { import flash.display.*; import flash.geom.*; public class FireParticle extends Sprite { public var directionVector:Point; private var img:Bitmap; public var speed:Number; private var fp03Img:Bitmap; private var fp02Img:Bitmap; private var fp01Img:Bitmap; public var alphaDelta:Number; private var fp04Img:Bitmap; public static const FIRE_PARTICLE_01:Class = FireParticle_FIRE_PARTICLE_01; public static const FIRE_PARTICLE_02:Class = FireParticle_FIRE_PARTICLE_02; public static const FIRE_PARTICLE_03:Class = FireParticle_FIRE_PARTICLE_03; public static const FIRE_PARTICLE_04:Class = FireParticle_FIRE_PARTICLE_04; public function FireParticle(){ directionVector = new Point(); fp02Img = new FIRE_PARTICLE_02(); fp01Img = new FIRE_PARTICLE_01(); fp03Img = new FIRE_PARTICLE_03(); fp04Img = new FIRE_PARTICLE_04(); img = fp01Img; super(); addChild(img); } public function fade():void{ alpha = (alpha - alphaDelta); } public function move(time:Number):void{ x = (x + (((speed * directionVector.x) * time) / 31)); y = (y + (((speed * directionVector.y) * time) / 31)); } public function setTo(particle:Class):void{ removeChild(img); if (particle == FIRE_PARTICLE_04){ alphaDelta = 0.12; img = fp04Img; } else { if (particle == FIRE_PARTICLE_03){ alphaDelta = 0.1; img = fp03Img; } else { if (particle == FIRE_PARTICLE_02){ alphaDelta = 0.15; img = fp02Img; } else { if (particle == FIRE_PARTICLE_01){ alphaDelta = 0.34; img = fp01Img; }; }; }; }; addChild(img); } } }//package
Section 277
//FireParticle_FIRE_PARTICLE_01 (FireParticle_FIRE_PARTICLE_01) package { import mx.core.*; public class FireParticle_FIRE_PARTICLE_01 extends BitmapAsset { } }//package
Section 278
//FireParticle_FIRE_PARTICLE_02 (FireParticle_FIRE_PARTICLE_02) package { import mx.core.*; public class FireParticle_FIRE_PARTICLE_02 extends BitmapAsset { } }//package
Section 279
//FireParticle_FIRE_PARTICLE_03 (FireParticle_FIRE_PARTICLE_03) package { import mx.core.*; public class FireParticle_FIRE_PARTICLE_03 extends BitmapAsset { } }//package
Section 280
//FireParticle_FIRE_PARTICLE_04 (FireParticle_FIRE_PARTICLE_04) package { import mx.core.*; public class FireParticle_FIRE_PARTICLE_04 extends BitmapAsset { } }//package
Section 281
//HighScoresGUI (HighScoresGUI) package { import flash.events.*; import flash.display.*; import flash.text.*; public class HighScoresGUI extends Sprite { private var msgText:TextField; private var continueText:TextField; private var nameText:TextField; private static const MAX_CHARS:int = 12; private static const PAPER_CARD_PNG:Class = HighScoresGUI_PAPER_CARD_PNG; public function HighScoresGUI(continueHandler:Function){ msgText = new TextField(); nameText = new TextField(); continueText = new TextField(); super(); addChild(new PAPER_CARD_PNG()); Menu.format.color = 0; msgText.selectable = false; msgText.embedFonts = true; msgText.defaultTextFormat = Menu.format; msgText.multiline = true; msgText.wordWrap = true; msgText.x = 10; msgText.y = 20; msgText.width = (this.width - 20); msgText.height = 200; msgText.text = (("You scored " + Main.points) + "!\nEnter you name below"); addChild(msgText); nameText.embedFonts = true; nameText.defaultTextFormat = Menu.format; nameText.x = 10; nameText.y = 130; nameText.width = (width - 20); nameText.maxChars = MAX_CHARS; nameText.type = TextFieldType.INPUT; nameText.selectable = true; addChild(nameText); continueText.selectable = false; continueText.embedFonts = true; continueText.defaultTextFormat = Menu.format; continueText.text = "Continue"; continueText.autoSize = TextFieldAutoSize.CENTER; continueText.x = ((width - continueText.width) / 2); continueText.y = 190; continueText.addEventListener(MouseEvent.MOUSE_OVER, Menu.onMouseOver); continueText.addEventListener(MouseEvent.MOUSE_OUT, Menu.onMouseOut); continueText.addEventListener(MouseEvent.CLICK, continueHandler); addChild(continueText); x = (Main.MENU_X + ((Board.WIDTH - width) / 2)); y = (Main.MENU_Y + ((Board.HEIGHT - height) / 2)); } public function showSendOk(rank:int):void{ msgText.text = "Your score has been saved.\n"; removeChild(nameText); continueText.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OUT)); } public function showSendFailed():void{ msgText.text = "Problem connecting to database. Highscore has not been saved."; removeChild(nameText); continueText.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OUT)); } private function getEnd(rank:int):String{ switch (rank){ case 1: return ("st"); case 2: return ("nd"); case 3: return ("rd"); default: return ("th"); }; } public function getName():String{ return (nameText.text); } public function focusOnName():void{ stage.focus = nameText; } public function removeContListeners(continueHandler:Function):void{ continueText.removeEventListener(MouseEvent.CLICK, continueHandler); continueText.removeEventListener(MouseEvent.MOUSE_OVER, Menu.onMouseOver); continueText.removeEventListener(MouseEvent.MOUSE_OUT, Menu.onMouseOut); } public function addContListeners(continueHandler:Function):void{ continueText.addEventListener(MouseEvent.CLICK, continueHandler); continueText.addEventListener(MouseEvent.MOUSE_OVER, Menu.onMouseOver); continueText.addEventListener(MouseEvent.MOUSE_OUT, Menu.onMouseOut); } } }//package
Section 282
//HighScoresGUI_PAPER_CARD_PNG (HighScoresGUI_PAPER_CARD_PNG) package { import mx.core.*; public class HighScoresGUI_PAPER_CARD_PNG extends BitmapAsset { } }//package
Section 283
//HighscoresManager (HighscoresManager) package { import flash.events.*; import libs.com.gamelion.utils.*; import flash.errors.*; public class HighscoresManager extends EventDispatcher { private const gameId:int = 4; private var testedScore:int; private var highScoreSystem:HighScoresSystem; public static const SCORE_IS_TOP_10:String = "ScoreTop10"; private static const SERVER_ADRESS:String = "http://fac.game-lion.com/amfphp/gateway.php"; public static const HIGHSCORE_CONN_ERROR:String = "DatabaseConnError"; public static const SCORE_IS_NOT_TOP_10:String = "ScoreNotTop10"; private static var _highscoresManager:HighscoresManager; public function HighscoresManager(caller:Function=null){ super(); if (caller != getInstance){ throw (new IllegalOperationError("This class is a singleton class")); }; highScoreSystem = new HighScoresSystem(SERVER_ADRESS); } private function onScoresSaved(e:HighScoreSavedEvent):void{ highScoreSystem.removeEventListener(HighScoreSavedEvent.COMPLETE, onScoresSaved); highScoreSystem.removeEventListener(HighScoresSystem.SAVE_SCORES_ERROR, onSaveScoresError); highScoreSystem.removeEventListener(HighScoresSystem.CONN_ERROR, onSaveScoresError); dispatchEvent(new HighScoreSavedEvent(HighScoreSavedEvent.COMPLETE, 0)); } public function sendScore(score:int, name:String):void{ highScoreSystem.addEventListener(HighScoreSavedEvent.COMPLETE, onScoresSaved, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.SAVE_SCORES_ERROR, onSaveScoresError, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.CONN_ERROR, onSaveScoresError, false, 0, true); highScoreSystem.saveScore(gameId, name, score, HighScoresSystem.DESCENDING_ORDER); } private function onSaveScoresError(e:Event):void{ highScoreSystem.removeEventListener(HighScoreSavedEvent.COMPLETE, onScoresSaved); highScoreSystem.removeEventListener(HighScoresSystem.SAVE_SCORES_ERROR, onSaveScoresError); highScoreSystem.removeEventListener(HighScoresSystem.CONN_ERROR, onSaveScoresError); dispatchEvent(new Event(HIGHSCORE_CONN_ERROR)); } public function isScoreTop10(score:int):void{ testedScore = score; highScoreSystem.addEventListener(HighScoreRceivedEvent.TOP_SCORES, onScoreTest, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.GET_SCORES_ERROR, onGetScoresError, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.CONN_ERROR, onGetScoresError, false, 0, true); highScoreSystem.getTopScores(gameId, 10, HighScoresSystem.DESCENDING_ORDER); } private function onGetScoresError(event:Event):void{ highScoreSystem.removeEventListener(HighScoreRceivedEvent.TOP_SCORES, onScoreTest); highScoreSystem.removeEventListener(HighScoresSystem.GET_SCORES_ERROR, onGetScoresError); highScoreSystem.removeEventListener(HighScoresSystem.CONN_ERROR, onGetScoresError); dispatchEvent(new Event(SCORE_IS_NOT_TOP_10)); } public function cleanTop10Listeners(onSucces:Function, onFailed:Function):void{ highScoreSystem.removeEventListener(HighScoreRceivedEvent.TOP_SCORES, onSucces); highScoreSystem.removeEventListener(HighScoresSystem.GET_SCORES_ERROR, onFailed); highScoreSystem.removeEventListener(HighScoresSystem.CONN_ERROR, onFailed); } private function onScoreTest(event:HighScoreRceivedEvent):void{ highScoreSystem.removeEventListener(HighScoreRceivedEvent.TOP_SCORES, onScoreTest); highScoreSystem.removeEventListener(HighScoresSystem.GET_SCORES_ERROR, onGetScoresError); highScoreSystem.removeEventListener(HighScoresSystem.CONN_ERROR, onGetScoresError); if ((((event.highScores.length < 10)) || ((event.highScores[9].score < testedScore)))){ dispatchEvent(new Event(SCORE_IS_TOP_10)); } else { dispatchEvent(new Event(SCORE_IS_NOT_TOP_10)); }; } public function getTop10(onSucces:Function, onFailed:Function):void{ highScoreSystem.addEventListener(HighScoreRceivedEvent.TOP_SCORES, onSucces, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.GET_SCORES_ERROR, onFailed, false, 0, true); highScoreSystem.addEventListener(HighScoresSystem.CONN_ERROR, onFailed, false, 0, true); highScoreSystem.getTopScores(gameId, 10, HighScoresSystem.DESCENDING_ORDER); } public static function getInstance():HighscoresManager{ if (_highscoresManager == null){ _highscoresManager = new HighscoresManager(getInstance); }; return (_highscoresManager); } } }//package
Section 284
//Main (Main) package { import flash.events.*; import libs.com.gamelion.utils.*; import flash.display.*; import mp3Player.*; import flash.text.*; import flash.net.*; public class Main extends Sprite { private const COUNTDOWN_ANIM_TIME:int = 5000; private var countDownStartTime:Number; private var starsSprite:Sprite; private var timeFloat:Number; private var pointsGoal:Number; private var starsImg:Bitmap; public var hScoreMgr:HighscoresManager; private var levelLoader:URLLoader; private var timeStep:Number; private var starHudImg:Bitmap; private var nextFadeOut:Number;// = 0 private var pointsFloat:Number; private var hScoreGui:HighScoresGUI; private var lastCountDownFrame:Number; private var pointsStep:Number; private var menu:Menu; private var board:Board; private var levelListXml:XML; private var format:TextFormat; private static const STARS_PNG:Class = Main_STARS_PNG; public static const BG_PNG:Class = Main_BG_PNG; public static const LEVEL_PATH:String = ("" + "http://playlion.com/games/arkanoid/"); public static const WIDTH:int = 750; public static const HEIGHT:int = 600; public static const ADV_BG_1_PNG:Class = Main_ADV_BG_1_PNG; public static const ADV_BG_2_PNG:Class = Main_ADV_BG_2_PNG; public static const ADV_BG_3_PNG:Class = Main_ADV_BG_3_PNG; public static const ADV_BG_4_PNG:Class = Main_ADV_BG_4_PNG; public static const ADV_BG_5_PNG:Class = Main_ADV_BG_5_PNG; private static const STAR_HUD_PNG:Class = Main_STAR_HUD_PNG; private static const font:Class = Main_font; public static const COUNTDOWN_FINISHED:String = "countdownFinished"; public static const MENU_Y:int = 76; public static const MENU_X:int = 151; public static var ballBonusIcon:Sprite; private static var level:TextField = new TextField(); public static var platformBonusIcon:Sprite; public static var ballBonusTimeBar:TimeBar; private static var lives:TextField = new TextField(); private static var adventureObjectives:Array = new Array(); public static var currentLevel:int = 1; public static var instance:Main; private static var score:TextField = new TextField(); private static var adventureLevels:Array = new Array(); private static var classicLevels:Array = new Array(); private static var ballBonusIconImg:Bitmap; public static var loopLevels:Boolean = false; public static var mp3PlayerInstance:SoundPlayer; public static var livesNumber:int = 3; private static var bgImg:Bitmap; private static var time:TextField = new TextField(); public static var currentTable:int = -1; private static var sTime:int; public static var points:int = 0; public static var starImages:Array; private static var plane:Plane = new Plane(); public static var platformBonusTimeBar:TimeBar; private static var platformBonusIconImg:Bitmap; public function Main():void{ format = new TextFormat(); levelLoader = new URLLoader(); super(); } private function gameFinished(e:Event):void{ plane.alpha = 0; mp3PlayerInstance.stopLoopSound(); board.removeEventListener(Board.GAME_FINISHED, gameFinished); board.showLoadingMsg(); nextFadeOut = (new Date().getTime() + Menu.FADE_OUT_DELAY); hScoreMgr.addEventListener(HighscoresManager.SCORE_IS_NOT_TOP_10, processHighScore); hScoreMgr.addEventListener(HighscoresManager.SCORE_IS_TOP_10, processHighScore); hScoreMgr.isScoreTop10(points); } public function init(did_load):void{ MochiBot.track(this, "b1cbbc7a"); instance = this; levelLoader.addEventListener(Event.COMPLETE, levelListLoaded); levelLoader.load(new URLRequest((LEVEL_PATH + "level_list.xml"))); hScoreMgr = HighscoresManager.getInstance(); } public function getTableObjectives(currentTable:int):String{ var _local2:String; switch (currentTable){ case 0: _local2 = (((("You must pass all " + (adventureLevels[currentTable] as Array).length) + " levels \nin ") + adventureObjectives[currentTable].levelTime) + " seconds"); break; case 1: _local2 = (((("You must pass all " + (adventureLevels[currentTable] as Array).length) + " levels \nin ") + adventureObjectives[currentTable].levelTime) + " seconds\nLook out for the plane!"); break; case 2: _local2 = "Time stays the same but now you must gather at least 3 stars to pass each level"; break; case 3: _local2 = "Time stays the same but can you do it when stars are hidden?"; break; case 4: _local2 = "You get even less time and now each bonus is a surprise.\nRemember about the stars."; break; }; return (_local2); } public function clearStars():void{ var i:int; while (i < starImages.length) { if (starsSprite.contains(starImages[i])){ starsSprite.removeChild(starImages[i]); }; i++; }; } private function getTable(startEvent:Event):int{ if (startEvent.type == Menu.START_ADVENTURE_1){ return (0); }; if (startEvent.type == Menu.START_ADVENTURE_2){ return (1); }; if (startEvent.type == Menu.START_ADVENTURE_3){ return (2); }; if (startEvent.type == Menu.START_ADVENTURE_4){ return (3); }; if (startEvent.type == Menu.START_ADVENTURE_5){ return (4); }; return (-1); } public function switchBg(newBg:Class):void{ var oldBg:Bitmap = bgImg; bgImg = new (newBg); addChild(bgImg); swapChildren(bgImg, oldBg); removeChild(oldBg); if (newBg == BG_PNG){ clearBonusIcons(); } else { showBonusIcon(true, Block.NO_BONUS_PNG); showBonusIcon(false, Block.NO_BONUS_PNG); }; } private function saveFailed(e:Event):void{ board.hideLoadingMsg(); addChild(hScoreGui); hScoreGui.showSendFailed(); hScoreMgr.removeEventListener(HighScoreSavedEvent.COMPLETE, savedOk); hScoreMgr.removeEventListener(HighscoresManager.HIGHSCORE_CONN_ERROR, saveFailed); hScoreGui.addContListeners(proceedToMenu); } private function addStartGameListeners():void{ menu.addEventListener(Menu.START_CLASSIC, startClassic, false, 0, true); menu.addEventListener(Menu.START_ADVENTURE_1, startAdventure, false, 0, true); menu.addEventListener(Menu.START_ADVENTURE_2, startAdventure, false, 0, true); menu.addEventListener(Menu.START_ADVENTURE_3, startAdventure, false, 0, true); menu.addEventListener(Menu.START_ADVENTURE_4, startAdventure, false, 0, true); menu.addEventListener(Menu.START_ADVENTURE_5, startAdventure, false, 0, true); } private function showYouLostScreen(e:Event):void{ removeEventListener(Menu.FADE_OUT_FINISHED, showYouLostScreen); menu = new Menu(true); menu.x = MENU_X; menu.y = MENU_Y; addChild(menu); menu.showYouLostScreen(); addStartGameListeners(); } public function startCountDownAnimation(bonusPoints:int):void{ if (bonusPoints == 0){ dispatchEvent(new Event(COUNTDOWN_FINISHED)); return; }; timeStep = (getTime() / COUNTDOWN_ANIM_TIME); pointsStep = (bonusPoints / COUNTDOWN_ANIM_TIME); pointsGoal = (points + bonusPoints); addEventListener(Event.ENTER_FRAME, countDown, false, 0, true); countDownStartTime = new Date().getTime(); lastCountDownFrame = countDownStartTime; pointsFloat = points; timeFloat = getTime(); } private function gameLost(e:Event):void{ mp3PlayerInstance.stopLoopSound(); board.removeEventListener(Board.GAME_LOST, gameLost); nextFadeOut = (new Date().getTime() + Menu.FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOutBoard); addEventListener(Menu.FADE_OUT_FINISHED, showYouLostScreen); } private function savedOk(e:HighScoreSavedEvent):void{ board.hideLoadingMsg(); addChild(hScoreGui); hScoreGui.showSendOk(0); hScoreMgr.removeEventListener(HighScoreSavedEvent.COMPLETE, savedOk); hScoreMgr.removeEventListener(HighscoresManager.HIGHSCORE_CONN_ERROR, saveFailed); hScoreGui.addContListeners(proceedToMenu); } public function parseLevelListXml(xml:XML):Boolean{ var levelFile:String; var tableObjectives:TableInfo; var k:int; if (xml.child("classic") == null){ return (false); }; if (xml.child("adventure") == null){ return (false); }; var levelsTmp:XMLList = xml.child("classic").child("level"); if (levelsTmp.length() == 0){ return (false); }; var i:int; while (i < levelsTmp.length()) { levelFile = levelsTmp[i]; classicLevels.push(levelFile); i++; }; if (xml.classsic.child("loop") != null){ levelFile = xml.classic.loop; if (levelFile.match("true")){ loopLevels = true; }; }; var tablesTmp:XMLList = xml.child("adventure").child("table"); if (tablesTmp.length() == 0){ return (false); }; i = 0; while (i < tablesTmp.length()) { tableObjectives = new TableInfo(tablesTmp[i].time); if (tablesTmp[i].child("stars_needed").length() > 0){ tableObjectives.starsNeeded = tablesTmp[i].stars_needed; }; if (tablesTmp[i].child("stars_hidden").length() > 0){ if (String(tablesTmp[i].stars_hidden).match("true")){ tableObjectives.starsHidden = true; }; }; if (tablesTmp[i].child("bonuses_hidden").length() > 0){ if (String(tablesTmp[i].bonuses_hidden).match("true")){ tableObjectives.bonusesHidden = true; }; }; adventureObjectives[i] = tableObjectives; adventureLevels[i] = new Array(); levelsTmp = tablesTmp[i].child("level"); if (levelsTmp.length() == 0){ return (false); }; k = 0; while (k < levelsTmp.length()) { levelFile = levelsTmp[k]; (adventureLevels[i] as Array).push(levelFile); k++; }; i++; }; return (true); } private function gameWon(e:Event):void{ mp3PlayerInstance.stopLoopSound(); board.removeEventListener(Board.GAME_WON, gameWon); nextFadeOut = (new Date().getTime() + Menu.FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOutBoard); addEventListener(Menu.FADE_OUT_FINISHED, showYouWonScreen); } private function startAdventure(e:Event):void{ removeStartGameListeners(); currentLevel = 1; currentTable = getTable(e); level.text = "1"; board = new Board(("" + adventureLevels[currentTable][0]), adventureObjectives[currentTable].starsHidden, adventureObjectives[currentTable].bonusesHidden); board.removeEventListener(Board.GAME_FINISHED, gameFinished); board.addEventListener(Board.GAME_WON, gameWon); board.addEventListener(Board.GAME_LOST, gameLost); board.y = MENU_Y; board.x = MENU_X; board.alpha = 0; removeChild(menu); menu = null; addChild(board); plane.x = -1000; plane.y = -1000; plane.alpha = 1; addChild(plane); } private function proceedToMenu(e:Event):void{ removeChild(hScoreGui); hScoreGui.removeContListeners(proceedToMenu); hScoreGui = null; nextFadeOut = (new Date().getTime() + Menu.FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOutBoard); addEventListener(Menu.FADE_OUT_FINISHED, showHighscoresAfterClassic); } private function startClassic(e:Event):void{ removeStartGameListeners(); currentLevel = 1; currentTable = -1; level.text = "1"; board = new Board(("" + classicLevels[0])); board.addEventListener(Board.GAME_FINISHED, gameFinished); board.removeEventListener(Board.GAME_WON, gameWon); board.removeEventListener(Board.GAME_LOST, gameLost); board.y = MENU_Y; board.x = MENU_X; board.alpha = 0; removeChild(menu); menu = null; addChild(board); plane.reset(); addChild(plane); if (contains(starsSprite)){ removeChild(starsSprite); }; } private function fadeOutBoard(e:Event):void{ var frames:int = ((new Date().getTime() - nextFadeOut) / Menu.FADE_OUT_DELAY); if (frames < 0){ return; }; nextFadeOut = (nextFadeOut + (Menu.FADE_OUT_DELAY * (frames + 1))); board.alpha = (board.alpha - (0.1 * (frames + 1))); plane.alpha = (plane.alpha - 0.1); if (board.alpha <= 0){ removeChild(board); removeChild(plane); board = null; removeEventListener(Event.ENTER_FRAME, fadeOutBoard); dispatchEvent(new Event(Menu.FADE_OUT_FINISHED)); }; } public function hideHUD():void{ if (contains(lives)){ removeChild(lives); }; if (contains(score)){ removeChild(score); }; if (contains(level)){ removeChild(level); }; if (contains(time)){ removeChild(time); }; if (contains(starsSprite)){ removeChild(starsSprite); }; } private function removeStartGameListeners():void{ menu.removeEventListener(Menu.START_CLASSIC, startClassic); menu.removeEventListener(Menu.START_ADVENTURE_1, startAdventure); menu.removeEventListener(Menu.START_ADVENTURE_2, startAdventure); menu.removeEventListener(Menu.START_ADVENTURE_3, startAdventure); menu.removeEventListener(Menu.START_ADVENTURE_4, startAdventure); menu.removeEventListener(Menu.START_ADVENTURE_5, startAdventure); } private function countDown(e:Event):void{ var timeOffset:Number = (new Date().getTime() - countDownStartTime); if (timeOffset >= COUNTDOWN_ANIM_TIME){ removeEventListener(Event.ENTER_FRAME, countDown); score.text = ("" + pointsGoal); points = pointsGoal; startTime(); updateTime(0); dispatchEvent(new Event(COUNTDOWN_FINISHED)); } else { timeOffset = (new Date().getTime() - lastCountDownFrame); pointsFloat = (pointsFloat + (pointsStep * timeOffset)); timeFloat = (timeFloat - (timeStep * timeOffset)); updateScore((pointsFloat - points)); updateTime((timeFloat - getTime())); }; lastCountDownFrame = new Date().getTime(); } private function showHighscoresAfterClassic(e:Event):void{ removeEventListener(Menu.FADE_OUT_FINISHED, showHighscoresAfterClassic); menu = new Menu(true); menu.x = MENU_X; menu.y = MENU_Y; addChild(menu); menu.showHighscoresAfterClassic(); addStartGameListeners(); } private function showYouWonScreen(e:Event):void{ removeEventListener(Menu.FADE_OUT_FINISHED, showYouWonScreen); menu = new Menu(true); menu.x = MENU_X; menu.y = MENU_Y; addChild(menu); menu.showYouWonScreen((currentTable + 1)); addStartGameListeners(); } private function processHighScore(e:Event):void{ board.hideLoadingMsg(); hScoreMgr.removeEventListener(HighscoresManager.SCORE_IS_NOT_TOP_10, processHighScore); hScoreMgr.removeEventListener(HighscoresManager.SCORE_IS_TOP_10, processHighScore); if (e.type == HighscoresManager.SCORE_IS_TOP_10){ hScoreGui = new HighScoresGUI(sendScore); hScoreGui.x = (MENU_X + ((Board.WIDTH - hScoreGui.width) / 2)); hScoreGui.y = (MENU_Y + ((Board.HEIGHT - hScoreGui.height) / 2)); addChild(hScoreGui); hScoreGui.focusOnName(); } else { nextFadeOut = (new Date().getTime() + Menu.FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOutBoard); addEventListener(Menu.FADE_OUT_FINISHED, showHighscoresAfterClassic); }; } private function startMusic(e:Event):void{ mp3PlayerInstance.removeEventListener(SoundPlayer.INIT_COMPLETED, startMusic); mp3PlayerInstance.play(); } private function levelListLoaded(e:Event):void{ levelListXml = new XML(e.target.data); if (!parseLevelListXml(levelListXml)){ throw (new Error("problem parsing level list")); }; format.font = "BorisBlackBloxx"; format.size = 15; format.align = TextFormatAlign.RIGHT; format.color = 0xFFFFFF; level.selectable = false; level.embedFonts = true; level.defaultTextFormat = format; score.selectable = false; score.embedFonts = true; score.defaultTextFormat = format; lives.selectable = false; lives.embedFonts = true; lives.defaultTextFormat = format; format.align = TextFormatAlign.LEFT; time.selectable = false; time.embedFonts = true; time.defaultTextFormat = format; bgImg = new BG_PNG(); addChild(bgImg); starsImg = new STARS_PNG(); starsSprite = new Sprite(); starsSprite.y = 232; starsSprite.x = 32; starsSprite.addChild(starsImg); starImages = new Array(); starHudImg = new STAR_HUD_PNG(); starHudImg.x = -2; starHudImg.y = 2; starImages.push(starHudImg); starHudImg = new STAR_HUD_PNG(); starHudImg.x = 20; starHudImg.y = 0; starImages.push(starHudImg); starHudImg = new STAR_HUD_PNG(); starHudImg.x = 43; starHudImg.y = -2; starImages.push(starHudImg); mp3PlayerInstance = SoundPlayer.getInstance(); mp3PlayerInstance.addEventListener(SoundPlayer.INIT_COMPLETED, startMusic); mp3PlayerInstance.x = (WIDTH - 125); mp3PlayerInstance.y = 2; addChild(mp3PlayerInstance); createMenu(null); level.rotation = -4; level.text = "1"; level.x = 10; level.y = 268; score.rotation = -4; score.text = "0"; score.x = 15; score.y = 303; lives.rotation = 14; lives.text = ("" + livesNumber); lives.x = 15; lives.y = 335; time.rotation = 12; time.text = "00:00"; time.x = 55; time.y = 383; platformBonusTimeBar = new TimeBar(32, 6); platformBonusTimeBar.x = 21; platformBonusTimeBar.y = 221; platformBonusTimeBar.rotation = -6; addChild(platformBonusTimeBar); ballBonusTimeBar = new TimeBar(32, 6); ballBonusTimeBar.x = 69; ballBonusTimeBar.y = 215; ballBonusTimeBar.rotation = -6; addChild(ballBonusTimeBar); addChild(menu); platformBonusIcon = new Sprite(); ballBonusIcon = new Sprite(); platformBonusIcon.x = 18; platformBonusIcon.y = 186; platformBonusIcon.rotation = -6; ballBonusIcon.x = 66; ballBonusIcon.y = 180; ballBonusIcon.rotation = -6; addChild(platformBonusIcon); addChild(ballBonusIcon); platformBonusIcon.visible = false; ballBonusIcon.visible = false; platformBonusTimeBar.visible = false; ballBonusTimeBar.visible = false; } public function showStar(star:int):void{ if (star <= starImages.length){ starsSprite.addChild(starImages[(star - 1)]); }; } public function prepareHUD(table:int):void{ if (table >= 0){ lives.text = "3"; score.text = "0"; level.text = "1"; sTime = (adventureObjectives[table].levelTime * 1000); updateTime(0); if (adventureObjectives[table].starsNeeded > 0){ clearStars(); if (!contains(starsSprite)){ addChild(starsSprite); }; } else { if (contains(starsSprite)){ removeChild(starsSprite); }; }; } else { lives.text = "6"; score.text = "0"; level.text = "1"; time.text = "00:00"; }; addChild(lives); addChild(score); addChild(level); addChild(time); } private function sendScore(e:Event):void{ if (hScoreGui.getName().length == 0){ hScoreGui.focusOnName(); return; }; removeChild(hScoreGui); hScoreGui.removeContListeners(sendScore); hScoreMgr.addEventListener(HighScoreSavedEvent.COMPLETE, savedOk); hScoreMgr.addEventListener(HighscoresManager.HIGHSCORE_CONN_ERROR, saveFailed); board.showLoadingMsg(); hScoreMgr.sendScore(points, hScoreGui.getName()); } private function createMenu(e:Event):void{ removeEventListener(Menu.FADE_OUT_FINISHED, createMenu); menu = new Menu(); menu.x = MENU_X; menu.y = MENU_Y; addChild(menu); addStartGameListeners(); } public static function isAdventure():Boolean{ if (currentTable > -1){ return (true); }; return (false); } public static function pausePlaneSound():void{ plane.pauseSound(); } public static function movePlain(time:int):void{ plane.move(time); } public static function updateTime(timePassed:Number):Boolean{ if (isAdventure()){ sTime = (sTime - timePassed); } else { sTime = (sTime + timePassed); }; var timeSec:int = (sTime / 1000); var minutes:int = (timeSec / 60); var seconds:int = (timeSec % 60); var minutesString:String = ((minutes < 10)) ? ("0" + minutes) : ("" + minutes); var secondsString:String = ((seconds < 10)) ? ("0" + seconds) : ("" + seconds); time.text = ((("" + minutesString) + ":") + secondsString); if (((isAdventure()) && ((sTime <= 0)))){ return (true); }; return (false); } public static function setPlaneRandomFactor(spawnRandomDelay:Number):void{ plane.SpawnTimeRandomRange = spawnRandomDelay; } public static function getTime():int{ return (sTime); } public static function setPlaneSpeedModifier(speedModifier:Number):void{ if (speedModifier == 0){ speedModifier = 1; }; plane.speedModifier = speedModifier; } public static function updateScore(pointsAdded:int):void{ if (isAdventure()){ if (int((points / 1500)) != int(((points + pointsAdded) / 1500))){ mp3PlayerInstance.playSound(FallingBonus.EXTRA_LIFE_SOUND); livesNumber++; updateLives(); }; }; points = (points + pointsAdded); score.text = ("" + Main.points); } public static function showBonusIcon(platform:Boolean, icon:Class):void{ if (platform){ if (platformBonusIconImg != null){ platformBonusIcon.removeChild(platformBonusIconImg); }; platformBonusIconImg = new (icon); platformBonusIcon.addChild(platformBonusIconImg); platformBonusIconImg.smoothing = true; platformBonusIcon.visible = true; if (icon == Block.NO_BONUS_PNG){ platformBonusIcon.x = 18; } else { platformBonusIcon.x = 20; }; } else { if (ballBonusIconImg != null){ ballBonusIcon.removeChild(ballBonusIconImg); }; ballBonusIconImg = new (icon); ballBonusIcon.addChild(ballBonusIconImg); ballBonusIconImg.smoothing = true; ballBonusIcon.visible = true; if (icon == Block.NO_BONUS_PNG){ ballBonusIcon.x = 66; } else { ballBonusIcon.x = 68; }; }; } public static function nextLevel():String{ var levels:Array = ((currentTable == -1)) ? classicLevels : adventureLevels[currentTable]; var loop:Boolean = ((currentTable == -1)) ? Main.loopLevels : false; if (currentLevel == levels.length){ if (loop){ currentLevel = 1; level.text = "1"; return (levels[0]); }; return (null); } else { if (isAdventure()){ Main.instance.clearStars(); }; level.text = ("" + ++currentLevel); }; return (!NULL!); } public static function updateLives():void{ lives.text = ("" + livesNumber); } public static function resumePlaneSound():void{ plane.resumeSound(); } public static function setPlaneAlpha(alpha:Number):void{ plane.alpha = alpha; } public static function resetPlane():void{ plane.reset(); } public static function getStarsNeeded():int{ if (isAdventure() == false){ return (0); }; return (adventureObjectives[currentTable].starsNeeded); } public static function startTime():void{ if (!isAdventure()){ sTime = 0; } else { if (currentLevel == 1){ sTime = (adventureObjectives[currentTable].levelTime * 1000); }; }; } public static function clearBonusIcons(onlyBar:Boolean=false):void{ if (!onlyBar){ platformBonusIcon.visible = false; ballBonusIcon.visible = false; }; platformBonusTimeBar.visible = false; ballBonusTimeBar.visible = false; } public static function getTableBg(currentTable:int):Class{ switch (currentTable){ case 0: return (ADV_BG_1_PNG); case 1: return (ADV_BG_2_PNG); case 2: return (ADV_BG_3_PNG); case 3: return (ADV_BG_4_PNG); case 4: return (ADV_BG_5_PNG); default: return (BG_PNG); }; } } }//package
Section 285
//Main_ADV_BG_1_PNG (Main_ADV_BG_1_PNG) package { import mx.core.*; public class Main_ADV_BG_1_PNG extends BitmapAsset { } }//package
Section 286
//Main_ADV_BG_2_PNG (Main_ADV_BG_2_PNG) package { import mx.core.*; public class Main_ADV_BG_2_PNG extends BitmapAsset { } }//package
Section 287
//Main_ADV_BG_3_PNG (Main_ADV_BG_3_PNG) package { import mx.core.*; public class Main_ADV_BG_3_PNG extends BitmapAsset { } }//package
Section 288
//Main_ADV_BG_4_PNG (Main_ADV_BG_4_PNG) package { import mx.core.*; public class Main_ADV_BG_4_PNG extends BitmapAsset { } }//package
Section 289
//Main_ADV_BG_5_PNG (Main_ADV_BG_5_PNG) package { import mx.core.*; public class Main_ADV_BG_5_PNG extends BitmapAsset { } }//package
Section 290
//Main_BG_PNG (Main_BG_PNG) package { import mx.core.*; public class Main_BG_PNG extends BitmapAsset { } }//package
Section 291
//Main_font (Main_font) package { import mx.core.*; public class Main_font extends FontAsset { } }//package
Section 292
//Main_STAR_HUD_PNG (Main_STAR_HUD_PNG) package { import mx.core.*; public class Main_STAR_HUD_PNG extends BitmapAsset { } }//package
Section 293
//Main_STARS_PNG (Main_STARS_PNG) package { import mx.core.*; public class Main_STARS_PNG extends BitmapAsset { } }//package
Section 294
//Menu (Menu) package { import flash.events.*; import libs.com.gamelion.utils.*; import flash.display.*; import flash.geom.*; import flash.media.*; import gs.*; import flash.text.*; import flash.net.*; import flash.utils.*; public class Menu extends Sprite { private const noAdds:Boolean = false; private const s:String = "Programming: Sokol Slawomir"; private const sequence:Array; private var logoImg:Bitmap; private var table5Img:Bitmap; private var instr2Img:Bitmap; private var fadeInArray:Array; private var table1:Sprite; private var offsetX:Number; private var offsetY:Number; private var playLionImg:Bitmap; private var play:TextField; private var instrImg:Bitmap; private var domekImg:Bitmap; private var loading:TextField; private var bgImg:Bitmap; private var backPositions:Array; public var PAPER_Y:int; private var fadeOutArray:Array; private var reset:TextField; private var objectives:TextField; private var playLionSprite:Sprite; private var table3Img:Bitmap; private var animLastFrame:Number;// = 0 private var loadingTimer:Timer; private var fadeInProcess:Boolean;// = false private var glLogoImg:Bitmap; private var top10Names:TextField; private var top10Scores:TextField; private var rubberAnimDirectionV:Point; private var msg:TextField; private var playLionSprite2:Sprite; private var tableSelected:int;// = -1 private var nextFadeIn:Number; private var table1Img:Bitmap; private var menuItems:Array; private var forMoreGames:TextField; private var yellowHighlight:Sprite; private var inClassic:Boolean;// = false private var rubber:Sprite; private var startingClasssic:Boolean;// = false public var lockedBitmaps:Array; private var highlight:Sprite; private var table4Img:Bitmap; private var nextFadeOut:Number; private var playLionText:TextField; private var nextPrev:TextField; private var seqIndex:int;// = 0 private var top10Header:TextField; private var back:TextField; private var top10Img:Bitmap; private var next:TextField; private var tablesArray:Array; private var zoomInValue:Number; private var rubberImg:Bitmap; private var table2Img:Bitmap; private static const INTRO_FINISHED:String = "introFinished"; public static const FADE_IN_FINISHED:String = "fadeInFinished"; public static const FADE_OUT_DELAY:int = 30; private static const PLAY_LION_PNG:Class = Menu_PLAY_LION_PNG; private static const BG_PNG:Class = Menu_BG_PNG; private static const INSTRUCTION_BACK:int = 2; public static const FONT_SIZE_SMALL:int = 20; private static const INSTR_PNG:Class = Menu_INSTR_PNG; public static const START_ADVENTURE_1:String = "startAdventure1"; public static const START_ADVENTURE_2:String = "startAdventure2"; public static const HEIGHT:int = 480; public static const START_ADVENTURE_4:String = "startAdventure4"; public static const START_ADVENTURE_5:String = "startAdventure5"; private static const menuItemsHandlers:Array = ["adventure", "classic", "highscores", "instructions", "moreGames"]; public static const START_ADVENTURE_3:String = "startAdventure3"; private static const TABLE_3_PNG:Class = Menu_TABLE_3_PNG; private static const MOER_GAMES_BACK:int = 4; private static const TOP_10_PNG:Class = Menu_TOP_10_PNG; private static const MENU_SOUND:Class = Menu_MENU_SOUND; private static const TABLE_5_PNG:Class = Menu_TABLE_5_PNG; private static const TABLE_1_PNG:Class = Menu_TABLE_1_PNG; public static const FADE_OUT_FINISHED:String = "fadeOutFinished"; private static const INSTR_2_PNG:Class = Menu_INSTR_2_PNG; private static const ADV_LEVEL_LOST:String = "You failed. Maybe next time you will have better luck."; private static const OBJECTIVE_BACK:int = 3; private static const font:Class = Menu_font; private static const HOUSE_PNG:Class = Menu_HOUSE_PNG; private static const HIGHSCORES_BACK:int = 1; private static const ADV_LEVEL_WON:String = "Congratulations!! You made it! Try the next table for greater challenge"; private static const LOCKED_SMALL:Class = Menu_LOCKED_SMALL; public static const START_CLASSIC:String = "statrClassic"; private static const LOGO_PNG:Class = Menu_LOGO_PNG; public static const FONT_SIZE_MEDIUM:int = 30; public static const menuItemsStrings:Array = ["Adventure Mode", "Classic Mode", "Best Scores", "Instructions", "More Games"]; public static const WIDTH:int = 450; private static const TABLE_2_PNG:Class = Menu_TABLE_2_PNG; private static const TABLE_4_PNG:Class = Menu_TABLE_4_PNG; public static const GAP:int = 10; public static const ZOOM_TIME:Number = 1.5; private static const GL_LOGO:Class = Menu_GL_LOGO; private static const ADVENTURE_BACK:int = 0; private static const ADV_LAST_LEVEL_WON:String = "Congratulations!! You made it through all the tables!"; private static const LOCKED_WIDE:Class = Menu_LOCKED_WIDE; private static const menuSound:Sound = new MENU_SOUND(); public static const FONT_SIZE:int = 40; private static const RUBBER_PNG:Class = Menu_RUBBER_PNG; public static var CENTER:int = -1; private static var LOCKED_WIDE_WIDTH:int; private static var LOCKED_SMALL_WIDTH:int; private static var firstRun:Boolean = true; private static var tablesLocked:Array = [false, true, true, true, true]; public static var format:TextFormat = new TextFormat(); public function Menu(inactive:Boolean=false){ var textField:TextField; rubber = new Sprite(); back = new TextField(); reset = new TextField(); objectives = new TextField(); play = new TextField(); next = new TextField(); top10Names = new TextField(); top10Scores = new TextField(); top10Header = new TextField(); loading = new TextField(); msg = new TextField(); forMoreGames = new TextField(); playLionText = new TextField(); nextPrev = new TextField(); backPositions = new Array(); tablesArray = new Array(); menuItems = new Array(); fadeOutArray = new Array(); fadeInArray = new Array(); lockedBitmaps = new Array(); sequence = [65, 85, 84, 72, 79, 82]; super(); initGraphic(); addChild(playLionSprite); addChild(bgImg); var startY:Number = ((((HEIGHT + logoImg.y) + logoImg.height) - (menuItemsStrings.length * FONT_SIZE)) - ((menuItemsStrings.length - 1) * GAP)); startY = ((startY / 2) - 20); var end:int = (noAdds) ? (menuItemsStrings.length - 1) : menuItemsStrings.length; var i:int; while (i < end) { textField = new TextField(); textField.selectable = false; textField.embedFonts = true; textField.defaultTextFormat = format; textField.text = menuItemsStrings[i]; textField.autoSize = TextFieldAutoSize.CENTER; textField.addEventListener(MouseEvent.CLICK, this[menuItemsHandlers[i]], false, 0, true); textField.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true); textField.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true); textField.y = ((startY + (i * FONT_SIZE)) + (i * GAP)); textField.x = ((WIDTH - textField.width) / 2); textField.alpha = 0; if (!inactive){ addChild(textField); }; menuItems.push(textField); i++; }; if (!inactive){ addEventListener(Event.ADDED_TO_STAGE, onAdded); }; } private function startTimer(e:Event):void{ loadingTimer = new Timer(1200, 0); loadingTimer.start(); loadingTimer.addEventListener(TimerEvent.TIMER, startFadeOut, false, 0, true); } private function zoomOutFinished():void{ fadeInProcess = false; if (tableSelected >= 0){ showObjectives(); } else { if (startingClasssic){ startAnim(null); } else { if (inClassic){ showMenu(); inClassic = false; } else { showAdventure(null); }; }; }; } private function adventure(noIdea):void{ if (((fadeInProcess) || (firstRun))){ return; }; fadeInProcess = true; fadeOutArray = new Array(); var k:int; while (k < menuItems.length) { fadeOutArray.push(menuItems[k]); k++; }; startFadeOut(); addEventListener(FADE_OUT_FINISHED, showAdventure); } private function showHighscores(e:HighScoreRceivedEvent):void{ var k:int; Main.instance.hScoreMgr.cleanTop10Listeners(showHighscores, connFailed); if (contains(loading)){ removeChild(loading); }; top10Img.alpha = 0; addChild(top10Img); var backPos:Point = backPositions[HIGHSCORES_BACK]; back.x = backPos.x; back.y = backPos.y; back.alpha = 0; addChild(back); addChild(top10Header); if (((!((e == null))) && (!((e.highScores == null))))){ top10Names.text = ""; top10Scores.text = ""; k = 0; while (k < e.highScores.length) { top10Names.appendText((("" + e.highScores[k].name) + "\n")); top10Scores.appendText((("" + e.highScores[k].score) + "\n")); k++; }; addChild(top10Names); addChild(top10Scores); }; fadeInArray = new Array(); fadeInArray.push(top10Img); fadeInArray.push(back); fadeInArray.push(top10Names); fadeInArray.push(top10Scores); fadeInArray.push(top10Header); startFadeIn(); addEventListener(FADE_IN_FINISHED, setHighscores); } private function setInstructions(e:Event):void{ removeEventListener(FADE_IN_FINISHED, setInstructions); back.addEventListener(MouseEvent.CLICK, hideInstruction); } private function hideHighscores(e:Event):void{ if (fadeInProcess){ return; }; back.removeEventListener(MouseEvent.CLICK, hideHighscores); fadeOutArray = new Array(); fadeOutArray.push(top10Img); fadeOutArray.push(back); fadeOutArray.push(top10Names); fadeOutArray.push(top10Scores); fadeOutArray.push(top10Header); nextFadeOut = (new Date().getTime + FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOut); if (inClassic){ addEventListener(FADE_OUT_FINISHED, startZoomIn); } else { addEventListener(FADE_OUT_FINISHED, showMenu); }; } public function showYouLostScreen():void{ animLastFrame = new Date().getTime(); fadeInArray = new Array(); fadeInArray.push(logoImg); fadeInArray.push(objectives); fadeInArray.push(next); fadeOutArray.push(objectives); fadeOutArray.push(next); if (!contains(logoImg)){ addChild(logoImg); }; logoImg.alpha = 0; if (!contains(objectives)){ addChild(objectives); }; objectives.alpha = 0; objectives.text = ADV_LEVEL_LOST; next.alpha = 0; next.addEventListener(MouseEvent.CLICK, startFadeOut); addChild(next); tableSelected = -1; zoomInValue = 3; offsetX = -800; offsetY = -600; addEventListener(Event.ENTER_FRAME, menuIntro); addEventListener(INTRO_FINISHED, startFadeIn); addEventListener(FADE_OUT_FINISHED, startZoomIn); } private function resetLocked(e:MouseEvent):void{ var locked:Bitmap; var pos:Point; var table:Sprite; fadeInArray = new Array(); var i:int = (tablesLocked.length - 1); while (i > 0) { if (tablesLocked[i] == false){ locked = ((i)!=(tablesLocked.length - 1)) ? new LOCKED_SMALL() : new LOCKED_WIDE(); pos = getLockedPosition(i); locked.x = pos.x; locked.y = pos.y; locked.alpha = 0; tablesLocked[i] = true; addChild(locked); locked.alpha = 0; lockedBitmaps.push(locked); fadeInArray.push(locked); table = tablesArray[i]; table.removeEventListener(MouseEvent.MOUSE_OVER, advOnMouseOver); table.removeEventListener(MouseEvent.MOUSE_OUT, advOnMouseOut); table.removeEventListener(MouseEvent.CLICK, advOnClick); table.buttonMode = false; }; i--; }; if (fadeInArray.length > 0){ startFadeIn(); addEventListener(FADE_IN_FINISHED, clearFadeIn); }; } private function fadeOut(e:Event):void{ var b:DisplayObject; var finished:Boolean; var frames:int = ((new Date().getTime() - nextFadeOut) / FADE_OUT_DELAY); if (frames < 0){ return; }; if (frames == 0){ frames = 1; }; nextFadeOut = (nextFadeOut + (FADE_OUT_DELAY * frames)); for each (b in fadeOutArray) { b.alpha = (b.alpha - (0.1 * frames)); if (b.alpha <= 0){ if (contains(b)){ removeChild(b); }; } else { finished = false; }; }; if (finished){ removeEventListener(Event.ENTER_FRAME, fadeOut); dispatchEvent(new Event(FADE_OUT_FINISHED)); }; } private function setHighscores(e:Event):void{ removeEventListener(FADE_IN_FINISHED, setHighscores); back.addEventListener(MouseEvent.CLICK, hideHighscores); } private function hideObjectives(e:MouseEvent):void{ if (fadeInProcess){ return; }; back.removeEventListener(MouseEvent.CLICK, hideObjectives); fadeOutArray = new Array(); fadeOutArray.push(objectives); fadeOutArray.push(play); fadeOutArray.push(back); tableSelected = -1; startFadeOut(); zoomInValue = 3; offsetX = -800; offsetY = -600; addEventListener(FADE_OUT_FINISHED, startZoomIn); } private function getLockedPosition(table:int):Point{ var tmp:Sprite = tablesArray[table]; if (table == 4){ return (new Point((tmp.x + ((tmp.width - LOCKED_WIDE_WIDTH) / 2)), (tmp.y - 8))); }; return (new Point((tmp.x + ((tmp.width - LOCKED_SMALL_WIDTH) / 2)), (tmp.y - 8))); } private function hideMoreGames(e:Event):void{ if (fadeInProcess){ return; }; removeEventListener(FADE_OUT_FINISHED, startFadeIn); back.removeEventListener(MouseEvent.CLICK, hideMoreGames); fadeOutArray = new Array(); fadeOutArray.push(forMoreGames); fadeOutArray.push(playLionSprite2); fadeOutArray.push(playLionText); fadeOutArray.push(back); startFadeOut(); addEventListener(FADE_OUT_FINISHED, showMenu); } private function highscores(noIdea):void{ if (((fadeInProcess) || (firstRun))){ return; }; fadeInProcess = true; fadeOutArray = new Array(); var k:int; while (k < menuItems.length) { fadeOutArray.push(menuItems[k]); k++; }; fadeOutArray.push(logoImg); startFadeOut(); addEventListener(FADE_OUT_FINISHED, getTop10); } public function menuIntro(e:Event):void{ var timePassed:Number = (new Date().getTime() - animLastFrame); bgImg.y = (bgImg.y - (timePassed / 3)); if (bgImg.y <= PAPER_Y){ bgImg.y = PAPER_Y; removeEventListener(Event.ENTER_FRAME, menuIntro); fadeInProcess = true; dispatchEvent(new Event(INTRO_FINISHED)); }; animLastFrame = new Date().getTime(); } public function showHighscoresAfterClassic():void{ animLastFrame = new Date().getTime(); inClassic = true; tableSelected = -1; zoomInValue = 3; offsetX = -800; offsetY = -600; addEventListener(Event.ENTER_FRAME, menuIntro); addEventListener(INTRO_FINISHED, getTop10); } private function showObjectives():void{ objectives.alpha = 0; play.alpha = 0; addChild(objectives); addChild(play); var backPos:Point = backPositions[OBJECTIVE_BACK]; back.x = backPos.x; back.y = backPos.y; back.alpha = 0; back.addEventListener(MouseEvent.CLICK, hideObjectives); addChild(back); fadeInArray = new Array(); fadeInArray.push(objectives); fadeInArray.push(back); fadeInArray.push(play); startFadeIn(); } private function advOnMouseOver(e:MouseEvent):void{ var s:DisplayObjectContainer = DisplayObjectContainer(e.target); highlight.scaleX = (s.width / 213); highlight.scaleY = (s.height / 41); highlight.x = s.x; highlight.y = s.y; addChild(highlight); swapChildren(highlight, s); } private function showInstructions(e:Event):void{ removeEventListener(FADE_OUT_FINISHED, showInstructions); instrImg.alpha = 0; addChild(instrImg); var backPos:Point = backPositions[INSTRUCTION_BACK]; back.x = backPos.x; back.y = backPos.y; back.alpha = 0; addChild(back); nextPrev.alpha = 0; addChild(nextPrev); fadeInArray = new Array(); fadeInArray.push(instrImg); fadeInArray.push(back); fadeInArray.push(nextPrev); startFadeIn(); addEventListener(FADE_IN_FINISHED, setInstructions); } private function moreGames(noIdea):void{ if (((fadeInProcess) || (firstRun))){ return; }; fadeInProcess = true; fadeOutArray = new Array(); var k:int; while (k < menuItems.length) { fadeOutArray.push(menuItems[k]); k++; }; back.x = backPositions[MOER_GAMES_BACK].x; back.y = backPositions[MOER_GAMES_BACK].y; back.addEventListener(MouseEvent.CLICK, hideMoreGames); back.alpha = 0; addChild(forMoreGames); addChild(playLionSprite2); addChild(playLionText); addChild(back); fadeInArray = new Array(); fadeInArray.push(forMoreGames); fadeInArray.push(playLionSprite2); fadeInArray.push(playLionText); fadeInArray.push(back); startFadeOut(); addEventListener(FADE_OUT_FINISHED, startFadeIn); } private function onAdded(e:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAdded); animLastFrame = new Date().getTime(); addEventListener(Event.ENTER_FRAME, menuIntro); fadeInProcess = true; if (firstRun){ addChild(glLogoImg); fadeInArray = new Array(); fadeInArray.push(glLogoImg); fadeOutArray = new Array(); fadeOutArray.push(glLogoImg); addEventListener(INTRO_FINISHED, startFadeIn); addEventListener(FADE_IN_FINISHED, startTimer); addEventListener(FADE_OUT_FINISHED, showMenu); } else { addEventListener(INTRO_FINISHED, showMenu); }; stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); } private function startZoomIn(e:Event):void{ fadeInProcess = true; removeEventListener(FADE_OUT_FINISHED, startZoomIn); TweenLite.to(parent, ZOOM_TIME, {scaleX:zoomInValue, scaleY:zoomInValue, x:offsetX, y:offsetY, onComplete:zoomInFinished}); } private function startFadeOut(e:Event=null):void{ fadeInProcess = true; nextFadeOut = (new Date().getTime() + FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOut); } private function advOnMouseOut(e:MouseEvent):void{ removeChild(highlight); } private function getTop10(e:Event):void{ removeEventListener(FADE_OUT_FINISHED, getTop10); addChild(loading); Main.instance.hScoreMgr.getTop10(showHighscores, connFailed); } private function drawAnim(e:Event):void{ var timePassed:Number = (new Date().getTime() - animLastFrame); if ((bgImg.y + this.y) < Main.HEIGHT){ bgImg.y = (bgImg.y + (timePassed / 3)); } else { if (rubberAnimDirectionV == null){ rubberAnimDirectionV = new Point((Board.PLATFORM_START_POS_X - rubber.x), (Board.PLATFORM_POS_Y - rubber.y)); }; if ((rubber.y - Board.PLATFORM_POS_Y) > 2){ rubber.x = (rubber.x + (((rubberAnimDirectionV.x * 0.08) * timePassed) / 31)); rubber.y = (rubber.y + (((rubberAnimDirectionV.y * 0.08) * timePassed) / 31)); if ((rubber.y - Board.PLATFORM_POS_Y) <= 2){ rubber.y = Board.PLATFORM_POS_Y; rubber.x = Board.PLATFORM_START_POS_X; }; if (rubber.rotation < 0){ rubber.rotation = (rubber.rotation + (timePassed / 7)); if (rubber.rotation > 0){ rubber.rotation = 0; }; }; } else { if (rubber.scaleX > 0.5){ rubber.scaleX = (rubber.scaleX - ((0.02 * timePassed) / 31)); rubber.scaleY = (rubber.scaleY - ((0.02 * timePassed) / 31)); } else { removeEventListener(Event.ENTER_FRAME, drawAnim); switch (tableSelected){ case 0: dispatchEvent(new Event(START_ADVENTURE_1)); return; case 1: dispatchEvent(new Event(START_ADVENTURE_2)); return; case 2: dispatchEvent(new Event(START_ADVENTURE_3)); return; case 3: dispatchEvent(new Event(START_ADVENTURE_4)); return; case 4: dispatchEvent(new Event(START_ADVENTURE_5)); return; default: dispatchEvent(new Event(START_CLASSIC)); return; }; }; }; }; animLastFrame = new Date().getTime(); } private function clearFadeIn(e:Event):void{ removeEventListener(FADE_IN_FINISHED, clearFadeIn); } private function connFailed(e:Event):void{ removeChild(loading); showHighscores(null); } private function classic(noIdea):void{ if (((fadeInProcess) || (firstRun))){ return; }; fadeInProcess = true; fadeOutArray = new Array(); var k:int; while (k < menuItems.length) { fadeOutArray.push(menuItems[k]); k++; }; fadeOutArray.push(logoImg); startFadeOut(); zoomInValue = 3; offsetX = -800; offsetY = -600; startingClasssic = true; addEventListener(FADE_OUT_FINISHED, startZoomIn); } private function startAnim(e:Event):void{ removeEventListener(FADE_OUT_FINISHED, startAnim); animLastFrame = new Date().getTime(); addEventListener(Event.ENTER_FRAME, drawAnim); } private function showAdventure(e:Event):void{ var locked:Bitmap; var table:Sprite; var pos:Point; lockedBitmaps = new Array(); fadeInArray = new Array(); removeEventListener(FADE_OUT_FINISHED, showAdventure); domekImg.alpha = 0; addChild(domekImg); fadeInArray.push(domekImg); var i:int = (tablesArray.length - 1); while (i >= 0) { table = tablesArray[i]; table.alpha = 0; if (!tablesLocked[i]){ table.buttonMode = true; table.addEventListener(MouseEvent.MOUSE_OVER, advOnMouseOver, false, 0, true); table.addEventListener(MouseEvent.MOUSE_OUT, advOnMouseOut, false, 0, true); table.addEventListener(MouseEvent.CLICK, advOnClick, false, 0, true); addChild(table); } else { locked = ((i < (tablesArray.length - 1))) ? new LOCKED_SMALL() : new LOCKED_WIDE(); pos = getLockedPosition(i); locked.smoothing = true; locked.x = pos.x; locked.y = pos.y; locked.alpha = 0; table.buttonMode = false; lockedBitmaps.push(locked); addChild(table); addChild(locked); fadeInArray.push(locked); }; fadeInArray.push(table); i--; }; reset.alpha = 0; addChild(reset); var backPos:Point = backPositions[ADVENTURE_BACK]; back.x = backPos.x; back.y = backPos.y; back.alpha = 0; addChild(back); fadeInArray.push(reset); fadeInArray.push(back); startFadeIn(); addEventListener(FADE_IN_FINISHED, setAdventure); } private function instructions(noIdea):void{ if (((fadeInProcess) || (firstRun))){ return; }; fadeInProcess = true; fadeOutArray = new Array(); var k:int; while (k < menuItems.length) { fadeOutArray.push(menuItems[k]); k++; }; startFadeOut(); addEventListener(FADE_OUT_FINISHED, showInstructions); } private function onPlay(e:Event):void{ if (fadeInProcess){ return; }; fadeInProcess = true; fadeOutArray = new Array(); fadeOutArray.push(logoImg); fadeOutArray.push(objectives); fadeOutArray.push(play); fadeOutArray.push(back); startFadeOut(); addEventListener(FADE_OUT_FINISHED, startAnim); } private function advOnClick(e:Event):void{ var table:Sprite; var s:Sprite = Sprite(e.target); if (s == tablesArray[0]){ tableSelected = 0; zoomInValue = 2; offsetX = -390; offsetY = -420; }; if (s == tablesArray[1]){ tableSelected = 1; zoomInValue = 2; offsetX = -390; offsetY = -420; }; if (s == tablesArray[2]){ tableSelected = 2; zoomInValue = 2; offsetX = -390; offsetY = -420; }; if (s == tablesArray[3]){ tableSelected = 3; zoomInValue = 2; offsetX = -390; offsetY = -420; }; if (s == tablesArray[4]){ tableSelected = 4; zoomInValue = 2; offsetX = -390; offsetY = -420; }; for each (table in tablesArray) { table.removeEventListener(MouseEvent.CLICK, advOnClick); table.removeEventListener(MouseEvent.MOUSE_OUT, advOnMouseOut); table.removeEventListener(MouseEvent.MOUSE_OVER, advOnMouseOver); }; if (contains(highlight)){ removeChild(highlight); }; yellowHighlight.scaleX = (s.width / 213); yellowHighlight.scaleY = (s.height / 41); yellowHighlight.x = s.x; yellowHighlight.y = s.y; yellowHighlight.alpha = 0.5; addChild(yellowHighlight); swapChildren(yellowHighlight, s); startZoomIn(null); } public function initGraphic():void{ PAPER_Y = 10; format.font = "Journal"; format.size = FONT_SIZE; format.align = TextFormatAlign.CENTER; format.color = 0; bgImg = new BG_PNG(); bgImg.x = ((WIDTH - bgImg.width) / 2); bgImg.y = (Main.HEIGHT - this.y); bgImg.smoothing = true; playLionSprite = new Sprite(); playLionImg = new PLAY_LION_PNG(); playLionSprite.addChild(playLionImg); playLionSprite.x = ((bgImg.x + bgImg.width) - 70); playLionSprite.y = ((PAPER_Y + bgImg.height) - 135); playLionSprite.alpha = 0; playLionSprite.buttonMode = true; playLionSprite.addEventListener(MouseEvent.CLICK, openPlayLion, false, 0, true); if (noAdds){ playLionSprite.visible = false; }; logoImg = new LOGO_PNG(); logoImg.y = (PAPER_Y + 15); logoImg.x = (bgImg.x + ((bgImg.width - logoImg.width) / 2)); logoImg.alpha = 0; glLogoImg = new GL_LOGO(); glLogoImg.y = (PAPER_Y + 15); glLogoImg.x = (bgImg.x + ((bgImg.width - glLogoImg.width) / 2)); glLogoImg.alpha = 0; rubberImg = new RUBBER_PNG(); rubber.addChild(rubberImg); rubber.rotation = -30; rubber.x = (WIDTH - 160); rubber.y = (HEIGHT - 10); domekImg = new HOUSE_PNG(); domekImg.x = (bgImg.x + ((bgImg.width - domekImg.width) / 2)); domekImg.y = (PAPER_Y + ((bgImg.height - domekImg.height) / 2)); domekImg.smoothing = true; table1 = new Sprite(); table1Img = new TABLE_1_PNG(); table1Img.scaleX = 0.25; table1Img.scaleY = 0.25; table1.addChild(table1Img); table1.x = (domekImg.x + 18); table1.y = (domekImg.y + 67); tablesArray.push(table1); table1 = new Sprite(); table2Img = new TABLE_2_PNG(); table2Img.scaleX = 0.25; table2Img.scaleY = 0.25; table1.buttonMode = true; table1.addChild(table2Img); table1.x = (domekImg.x + 128); table1.y = (domekImg.y + 67); tablesArray.push(table1); table1 = new Sprite(); table3Img = new TABLE_3_PNG(); table3Img.scaleX = 0.25; table3Img.scaleY = 0.25; table1.buttonMode = true; table1.addChild(table3Img); table1.x = (domekImg.x + 18); table1.y = (domekImg.y + 115); tablesArray.push(table1); table1 = new Sprite(); table4Img = new TABLE_4_PNG(); table4Img.scaleX = 0.25; table4Img.scaleY = 0.25; table1.buttonMode = true; table1.addChild(table4Img); table1.x = (domekImg.x + 128); table1.y = (domekImg.y + 115); tablesArray.push(table1); table1 = new Sprite(); table5Img = new TABLE_5_PNG(); table5Img.scaleX = 0.25; table5Img.scaleY = 0.25; table1.buttonMode = true; table1.addChild(table5Img); table1.x = (domekImg.x + 19); table1.y = (domekImg.y + 166); tablesArray.push(table1); top10Img = new TOP_10_PNG(); top10Img.x = (bgImg.x + ((bgImg.width - top10Img.width) / 2)); top10Img.y = (PAPER_Y + 20); instrImg = new INSTR_PNG(); instrImg.x = (bgImg.x + ((bgImg.width - instrImg.width) / 2)); instrImg.y = ((logoImg.y + logoImg.height) + 20); instr2Img = new INSTR_2_PNG(); instr2Img.x = (bgImg.x + ((bgImg.width - instr2Img.width) / 2)); instr2Img.y = (PAPER_Y + 30); var b:Bitmap = new LOCKED_SMALL(); LOCKED_SMALL_WIDTH = b.width; b = new LOCKED_WIDE(); LOCKED_WIDE_WIDTH = b.width; b = null; highlight = new Sprite(); highlight.graphics.beginFill(41141, 0.5); highlight.graphics.drawRect(0, 0, 213, 41); highlight.graphics.endFill(); highlight.alpha = 0.25; yellowHighlight = new Sprite(); yellowHighlight.graphics.beginFill(0xFFFF00, 0.5); yellowHighlight.graphics.drawRect(0, 0, 213, 41); yellowHighlight.graphics.endFill(); yellowHighlight.alpha = 0.25; reset.selectable = false; reset.embedFonts = true; reset.defaultTextFormat = format; reset.text = "Reset"; reset.autoSize = TextFieldAutoSize.CENTER; reset.x = ((domekImg.x + domekImg.width) - reset.width); reset.y = ((domekImg.y + domekImg.height) + 20); reset.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); reset.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); reset.addEventListener(MouseEvent.CLICK, resetLocked); play.selectable = false; play.embedFonts = true; play.defaultTextFormat = format; play.text = "Play"; play.autoSize = TextFieldAutoSize.CENTER; play.x = rubber.x; play.y = ((rubber.y - play.height) - 30); play.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); play.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); play.addEventListener(MouseEvent.CLICK, onPlay); next.selectable = false; next.embedFonts = true; next.defaultTextFormat = format; next.text = "Continue"; next.autoSize = TextFieldAutoSize.CENTER; next.x = (bgImg.x + ((bgImg.width - next.width) / 2)); next.y = (((PAPER_Y + bgImg.height) - next.height) - 20); next.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); next.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); objectives.selectable = false; objectives.embedFonts = true; objectives.defaultTextFormat = format; objectives.multiline = true; objectives.wordWrap = true; objectives.x = (bgImg.x + 20); objectives.y = ((logoImg.y + logoImg.height) + 10); objectives.width = (bgImg.width - 40); objectives.height = ((play.y - objectives.y) - 20); format.size = FONT_SIZE_SMALL; format.align = TextFormatAlign.LEFT; top10Names.selectable = false; top10Names.embedFonts = true; top10Names.defaultTextFormat = format; top10Names.multiline = true; top10Names.wordWrap = true; top10Names.x = (top10Img.x + 10); top10Names.y = (top10Img.y + 70); top10Names.width = (top10Img.width - 30); top10Names.height = (top10Img.height - 70); top10Names.alpha = 0; format.align = TextFormatAlign.RIGHT; top10Scores.selectable = false; top10Scores.embedFonts = true; top10Scores.defaultTextFormat = format; top10Scores.multiline = true; top10Scores.wordWrap = true; top10Scores.x = (top10Img.x + 10); top10Scores.y = (top10Img.y + 70); top10Scores.width = (top10Img.width - 30); top10Scores.height = (top10Img.height - 70); top10Scores.alpha = 0; format.align = TextFormatAlign.CENTER; format.size = FONT_SIZE_MEDIUM; top10Header.selectable = false; top10Header.embedFonts = true; top10Header.defaultTextFormat = format; top10Header.text = "TOP 10"; top10Header.autoSize = TextFieldAutoSize.CENTER; top10Header.x = (top10Img.x + 10); top10Header.y = (top10Img.y + 15); top10Header.width = (top10Img.width - 20); top10Header.height = (top10Img.height - 70); top10Header.alpha = 0; format.size = FONT_SIZE; loading.selectable = false; loading.embedFonts = true; loading.defaultTextFormat = format; loading.text = "Loading..."; top10Header.autoSize = TextFieldAutoSize.CENTER; loading.x = (top10Img.x + ((top10Img.width - loading.width) / 2)); loading.y = (top10Img.y + ((top10Img.height - loading.height) / 2)); format.color = 0xFFD700; msg.selectable = false; msg.embedFonts = true; msg.defaultTextFormat = format; msg.autoSize = TextFieldAutoSize.CENTER; msg.y = (HEIGHT - 10); msg.x = 230; format.color = 0; forMoreGames.selectable = false; forMoreGames.embedFonts = true; forMoreGames.defaultTextFormat = format; forMoreGames.autoSize = TextFieldAutoSize.CENTER; forMoreGames.y = (HEIGHT - 320); forMoreGames.x = (bgImg.x + ((bgImg.width - forMoreGames.width) / 2)); forMoreGames.text = "For more games visit"; forMoreGames.alpha = 0; playLionSprite2 = new Sprite(); playLionSprite2.addChild(new PLAY_LION_PNG()); playLionSprite2.x = (bgImg.x + ((bgImg.width - playLionSprite2.width) / 2)); playLionSprite2.y = (forMoreGames.y + forMoreGames.height); playLionSprite2.buttonMode = true; playLionSprite2.alpha = 0; playLionSprite2.addEventListener(MouseEvent.CLICK, openPlayLion, false, 0, true); playLionText.selectable = false; playLionText.embedFonts = true; playLionText.defaultTextFormat = format; playLionText.autoSize = TextFieldAutoSize.CENTER; playLionText.y = (playLionSprite2.y + playLionSprite2.height); playLionText.x = (bgImg.x + ((bgImg.width - playLionText.width) / 2)); playLionText.text = "www.playlion.com"; playLionText.alpha = 0; playLionText.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true); playLionText.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true); playLionText.addEventListener(MouseEvent.CLICK, openPlayLion, false, 0, true); back.selectable = false; back.embedFonts = true; back.defaultTextFormat = format; back.text = "Back"; back.autoSize = TextFieldAutoSize.CENTER; backPositions.push(new Point(domekImg.x, ((domekImg.y + domekImg.height) + 20))); backPositions.push(new Point((bgImg.x + ((bgImg.width - back.width) / 2)), ((top10Img.y + top10Img.height) + 5))); backPositions.push(new Point(instrImg.x, (instr2Img.y + instr2Img.height))); backPositions.push(new Point((bgImg.x + 60), ((rubber.y - back.height) - 30))); backPositions.push(new Point((bgImg.x + ((bgImg.width - back.width) / 2)), ((playLionText.y + playLionText.height) + 5))); back.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); back.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); nextPrev.selectable = false; nextPrev.embedFonts = true; nextPrev.defaultTextFormat = format; nextPrev.autoSize = TextFieldAutoSize.CENTER; nextPrev.y = (instr2Img.y + instr2Img.height); nextPrev.text = "Next"; nextPrev.x = (instrImg.x + (instrImg.width - nextPrev.width)); nextPrev.alpha = 0; nextPrev.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true); nextPrev.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true); nextPrev.addEventListener(MouseEvent.CLICK, changePage, false, 0, true); } private function startZoomOut():void{ fadeInProcess = true; TweenLite.to(parent, ZOOM_TIME, {scaleX:1, scaleY:1, x:0, y:0, onComplete:zoomOutFinished}); } private function startFadeIn(e:Event=null):void{ fadeInProcess = true; nextFadeIn = (new Date().getTime() + FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeIn); } private function fadeIn(e:Event):void{ var b:DisplayObject; var date:Date = new Date(); var finished:Boolean; var frames:int = ((date.getTime() - nextFadeIn) / FADE_OUT_DELAY); if (frames < 0){ return; }; if (frames == 0){ frames = 1; }; nextFadeIn = (nextFadeIn + (FADE_OUT_DELAY * frames)); for each (b in fadeInArray) { b.alpha = (b.alpha + (0.1 * frames)); if (b.alpha < 1){ finished = false; }; }; if (finished){ removeEventListener(Event.ENTER_FRAME, fadeIn); dispatchEvent(new Event(FADE_IN_FINISHED)); fadeInProcess = false; }; } private function onKeyDown(e:KeyboardEvent):void{ if (e.keyCode == sequence[seqIndex]){ seqIndex++; } else { seqIndex = 0; }; if (seqIndex == sequence.length){ msg.text = s; addChild(msg); }; } private function setAdventure(e:Event):void{ removeEventListener(FADE_IN_FINISHED, setAdventure); back.addEventListener(MouseEvent.CLICK, hideAdventure); } private function openPlayLion(e:MouseEvent):void{ navigateToURL(new URLRequest("http://www.playlion.com"), "_blank"); } public function showYouWonScreen(tableUnlocked:int):void{ animLastFrame = new Date().getTime(); fadeInArray = new Array(); fadeInArray.push(logoImg); fadeInArray.push(objectives); fadeInArray.push(next); fadeOutArray.push(objectives); fadeOutArray.push(next); if (!contains(logoImg)){ addChild(logoImg); }; logoImg.alpha = 0; if (!contains(objectives)){ addChild(objectives); }; objectives.alpha = 0; if (tableUnlocked < tablesLocked.length){ objectives.text = ADV_LEVEL_WON; tablesLocked[tableUnlocked] = false; } else { objectives.text = ADV_LAST_LEVEL_WON; }; next.alpha = 0; next.addEventListener(MouseEvent.CLICK, startFadeOut); addChild(next); tableSelected = -1; zoomInValue = 3; offsetX = -800; offsetY = -600; addEventListener(Event.ENTER_FRAME, menuIntro); addEventListener(INTRO_FINISHED, startFadeIn); addEventListener(FADE_OUT_FINISHED, startZoomIn); } private function changePage(e:Event):void{ if (fadeInProcess){ return; }; if (contains(instrImg)){ fadeOutArray = new Array(); fadeOutArray.push(instrImg); fadeOutArray.push(logoImg); fadeInArray = new Array(); fadeInArray.push(instr2Img); addChild(instr2Img); instr2Img.alpha = 0; addEventListener(FADE_OUT_FINISHED, startFadeIn); startFadeOut(); nextPrev.text = "Prev"; } else { fadeOutArray = new Array(); fadeOutArray.push(instr2Img); fadeInArray = new Array(); fadeInArray.push(instrImg); fadeInArray.push(logoImg); addChild(instrImg); addChild(logoImg); instrImg.alpha = 0; logoImg.alpha = 0; addEventListener(FADE_OUT_FINISHED, startFadeIn); startFadeOut(); nextPrev.text = "Next"; }; } private function hideInstruction(e:Event):void{ if (fadeInProcess){ return; }; back.removeEventListener(MouseEvent.CLICK, hideInstruction); removeEventListener(FADE_OUT_FINISHED, startFadeIn); nextPrev.text = "Next"; fadeOutArray = new Array(); if (contains(instrImg)){ fadeOutArray.push(instrImg); } else { fadeOutArray.push(instr2Img); addChild(logoImg); logoImg.alpha = 0; }; fadeOutArray.push(back); fadeOutArray.push(nextPrev); startFadeOut(); addEventListener(FADE_OUT_FINISHED, showMenu); } private function hideAdventure(e:Event):void{ if (fadeInProcess){ return; }; back.removeEventListener(MouseEvent.CLICK, hideAdventure); fadeOutArray = new Array(); fadeOutArray.push(domekImg); var i:int; while (i < tablesArray.length) { fadeOutArray.push(tablesArray[i]); i++; }; fadeOutArray.push(reset); fadeOutArray.push(back); var k:int; while (k < lockedBitmaps.length) { fadeOutArray.push(lockedBitmaps[k]); k++; }; if (contains(yellowHighlight)){ fadeOutArray.push(yellowHighlight); }; nextFadeOut = (new Date().getTime + FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeOut); if (e != null){ addEventListener(FADE_OUT_FINISHED, showMenu); tableSelected = -1; } else { Main.instance.switchBg(Main.getTableBg(tableSelected)); objectives.text = Main.instance.getTableObjectives(tableSelected); Main.instance.prepareHUD(tableSelected); startZoomOut(); }; } private function zoomInFinished():void{ fadeInProcess = false; if (tableSelected >= 0){ hideAdventure(null); addChild(rubber); playLionSprite.visible = false; } else { if (startingClasssic){ Main.instance.switchBg(Main.getTableBg(0)); Main.instance.prepareHUD(-1); addChild(rubber); playLionSprite.visible = false; } else { Main.instance.switchBg(Main.getTableBg(-1)); Main.instance.hideHUD(); if (!noAdds){ playLionSprite.visible = true; }; playLionSprite.alpha = 1; if (contains(rubber)){ removeChild(rubber); }; }; startZoomOut(); }; } public function showMenu(e:Event=null):void{ var b:DisplayObject; if (firstRun){ loadingTimer.removeEventListener(TimerEvent.TIMER, startFadeOut); removeEventListener(INTRO_FINISHED, startFadeIn); removeEventListener(FADE_IN_FINISHED, startTimer); removeEventListener(FADE_OUT_FINISHED, showMenu); firstRun = false; }; if (e != null){ removeEventListener(FADE_OUT_FINISHED, showMenu); removeEventListener(INTRO_FINISHED, showMenu); }; fadeInProcess = true; fadeInArray = new Array(); var i:int; while (i < menuItems.length) { fadeInArray.push(menuItems[i]); i++; }; if (logoImg.alpha <= 0){ fadeInArray.push(logoImg); }; if (playLionSprite.alpha <= 0){ fadeInArray.push(playLionSprite); }; for each (b in fadeInArray) { if (!contains(b)){ addChild(b); }; }; nextFadeIn = (new Date().getTime + FADE_OUT_DELAY); addEventListener(Event.ENTER_FRAME, fadeIn); } public static function onMouseOver(e:MouseEvent):void{ if (e.target.alpha < 1){ return; }; Main.mp3PlayerInstance.playSound(menuSound); format.color = 0xFF0000; TextField(e.target).setTextFormat(format); } public static function onMouseOut(e:MouseEvent):void{ format.color = 0; TextField(e.target).setTextFormat(format); } } }//package
Section 295
//Menu_BG_PNG (Menu_BG_PNG) package { import mx.core.*; public class Menu_BG_PNG extends BitmapAsset { } }//package
Section 296
//Menu_font (Menu_font) package { import mx.core.*; public class Menu_font extends FontAsset { } }//package
Section 297
//Menu_GL_LOGO (Menu_GL_LOGO) package { import mx.core.*; public class Menu_GL_LOGO extends BitmapAsset { } }//package
Section 298
//Menu_HOUSE_PNG (Menu_HOUSE_PNG) package { import mx.core.*; public class Menu_HOUSE_PNG extends BitmapAsset { } }//package
Section 299
//Menu_INSTR_2_PNG (Menu_INSTR_2_PNG) package { import mx.core.*; public class Menu_INSTR_2_PNG extends BitmapAsset { } }//package
Section 300
//Menu_INSTR_PNG (Menu_INSTR_PNG) package { import mx.core.*; public class Menu_INSTR_PNG extends BitmapAsset { } }//package
Section 301
//Menu_LOCKED_SMALL (Menu_LOCKED_SMALL) package { import mx.core.*; public class Menu_LOCKED_SMALL extends BitmapAsset { } }//package
Section 302
//Menu_LOCKED_WIDE (Menu_LOCKED_WIDE) package { import mx.core.*; public class Menu_LOCKED_WIDE extends BitmapAsset { } }//package
Section 303
//Menu_LOGO_PNG (Menu_LOGO_PNG) package { import mx.core.*; public class Menu_LOGO_PNG extends BitmapAsset { } }//package
Section 304
//Menu_MENU_SOUND (Menu_MENU_SOUND) package { import mx.core.*; public class Menu_MENU_SOUND extends SoundAsset { } }//package
Section 305
//Menu_PLAY_LION_PNG (Menu_PLAY_LION_PNG) package { import mx.core.*; public class Menu_PLAY_LION_PNG extends BitmapAsset { } }//package
Section 306
//Menu_RUBBER_PNG (Menu_RUBBER_PNG) package { import mx.core.*; public class Menu_RUBBER_PNG extends BitmapAsset { } }//package
Section 307
//Menu_TABLE_1_PNG (Menu_TABLE_1_PNG) package { import mx.core.*; public class Menu_TABLE_1_PNG extends BitmapAsset { } }//package
Section 308
//Menu_TABLE_2_PNG (Menu_TABLE_2_PNG) package { import mx.core.*; public class Menu_TABLE_2_PNG extends BitmapAsset { } }//package
Section 309
//Menu_TABLE_3_PNG (Menu_TABLE_3_PNG) package { import mx.core.*; public class Menu_TABLE_3_PNG extends BitmapAsset { } }//package
Section 310
//Menu_TABLE_4_PNG (Menu_TABLE_4_PNG) package { import mx.core.*; public class Menu_TABLE_4_PNG extends BitmapAsset { } }//package
Section 311
//Menu_TABLE_5_PNG (Menu_TABLE_5_PNG) package { import mx.core.*; public class Menu_TABLE_5_PNG extends BitmapAsset { } }//package
Section 312
//Menu_TOP_10_PNG (Menu_TOP_10_PNG) package { import mx.core.*; public class Menu_TOP_10_PNG extends BitmapAsset { } }//package
Section 313
//MochiAd (MochiAd) package { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.system.*; import flash.net.*; public class MochiAd { public function MochiAd(){ super(); } public static function getVersion():String{ return ("2.6"); } 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]; 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; }; 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")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; 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 bar: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{ }}; 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); bar = createEmptyMovieClip(chk, "_mochiad_bar", 4); if (options.no_progress_bar){ bar.visible = false; delete options.no_progress_bar; } else { bar.x = 10; bar.y = (h - 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((w - 20), 0); backing.lineTo((w - 20), 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((w - 20), 0); inside.lineTo((w - 20), 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((w - 20), 0); outline.lineTo((w - 20), 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); }; }; clip.loaderInfo.addEventListener(Event.COMPLETE, f); if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; }; }; 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
Section 314
//MochiBot (MochiBot) package { import flash.display.*; import flash.system.*; import flash.net.*; public dynamic class MochiBot extends Sprite { public function MochiBot(){ super(); } public static function track(parent:Sprite, tag:String):MochiBot{ if (Security.sandboxType == "localWithFile"){ return (null); }; var self:MochiBot = new (MochiBot); parent.addChild(self); Security.allowDomain("*"); Security.allowInsecureDomain("*"); var server:String = "http://core.mochibot.com/my/core.swf"; var lv:URLVariables = new URLVariables(); lv["sb"] = Security.sandboxType; lv["v"] = Capabilities.version; lv["swfid"] = tag; lv["mv"] = "8"; lv["fv"] = "9"; var url:String = self.root.loaderInfo.loaderURL; if (url.indexOf("http") == 0){ lv["url"] = url; } else { lv["url"] = "local"; }; var req:URLRequest = new URLRequest(server); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; var loader:Loader = new Loader(); self.addChild(loader); loader.load(req); return (self); } } }//package
Section 315
//Plane (Plane) package { import flash.display.*; import flash.geom.*; import flash.media.*; public class Plane extends Sprite { private var planeImg:Bitmap; private var spawnDelay:int; private var spawnRandomFactor:Number;// = 0 private var planeShadowImg:Bitmap; private var destination:int; private var speed:Number;// = 3 private var directionVector:Point; private var start:int;// = -1 private var spawnTimeRandomRange:Number;// = 3000 public var speedModifier:Number;// = 1 private static const PLANE_PNG:Class = Plane_PLANE_PNG; public static const LEFT:int = 6; private static const PLANE_SHADOW_PNG:Class = Plane_PLANE_SHADOW_PNG; public static const UPPER_LEFT_CORNER:int = 7; public static const UPPER_RIGHT_CORNER:int = 1; public static const LOWER_RIGHT_CORNER:int = 3; public static const BOTTOM:int = 4; private static const PLANE_MP3:Class = Plane_PLANE_MP3; public static const LOWER_LEFT_CORNER:int = 5; public static const SPAWN_TIME:int = 5000; private static const PLANE_SOUND:Sound = new PLANE_MP3(); public static const TOP:int = 0; public static const RIGHT:int = 2; public function Plane(){ directionVector = new Point(); super(); planeImg = new PLANE_PNG(); planeImg.smoothing = true; planeShadowImg = new PLANE_SHADOW_PNG(); planeShadowImg.alpha = 0.3; planeShadowImg.x = 43; planeShadowImg.y = 77; planeShadowImg.smoothing = true; addChild(planeShadowImg); addChild(planeImg); spawnDelay = SPAWN_TIME; } public function reset():void{ x = -1000; y = -1000; alpha = 1; spawnDelay = SPAWN_TIME; moveEnded(); } public function move(time:Number):void{ if (speedModifier == -1){ return; }; if (start == -1){ spawnDelay = (spawnDelay + time); if (spawnDelay >= (SPAWN_TIME + spawnRandomFactor)){ spawn(); time = ((spawnDelay - SPAWN_TIME) - spawnRandomFactor); spawnDelay = 0; spawnRandomFactor = (Math.random() * spawnTimeRandomRange); } else { return; }; }; x = (x + int(((((speed * directionVector.x) * time) * speedModifier) / 31))); y = (y + int(((((speed * directionVector.y) * time) * speedModifier) / 31))); switch (destination){ case BOTTOM: if (y > (Main.WIDTH + (planeImg.height / 2))){ moveEnded(); }; break; case TOP: if (y < ((-(planeImg.height) / 2) - 80)){ moveEnded(); }; break; case LOWER_LEFT_CORNER: if (x < 0){ moveEnded(); }; break; case UPPER_RIGHT_CORNER: if (x > Main.WIDTH){ moveEnded(); }; break; case LEFT: if (x < ((-0.5 * planeImg.width) - 40)){ moveEnded(); }; break; case RIGHT: if (x > (Main.WIDTH + (0.5 * planeImg.width))){ moveEnded(); }; break; case UPPER_LEFT_CORNER: if (y < (-0.5 * planeImg.height)){ moveEnded(); }; break; case LOWER_RIGHT_CORNER: if (y > Main.HEIGHT){ moveEnded(); }; break; }; } public function set SpawnTimeRandomRange(val:Number):void{ spawnTimeRandomRange = val; spawnRandomFactor = (Math.random() * spawnTimeRandomRange); } public function moveEnded():void{ start = -1; Main.mp3PlayerInstance.stopLoopSound(); } public function resumeSound():void{ if (start != -1){ Main.mp3PlayerInstance.playLoopSound(PLANE_SOUND); }; } public function pauseSound():void{ if (start != -1){ Main.mp3PlayerInstance.stopLoopSound(); }; } private function spawn(where:int=-1):void{ var index:int = ((where == -1)) ? (Math.random() * (UPPER_LEFT_CORNER + 1)) : where; if (index > UPPER_LEFT_CORNER){ index = UPPER_LEFT_CORNER; }; start = index; destination = ((start + 4) % 8); switch (start){ case TOP: planeImg.rotation = 135; planeShadowImg.rotation = 135; y = (-(planeImg.height) / 2); x = (((Main.WIDTH / 2) + (planeImg.width / 2)) - 50); directionVector.x = 0; directionVector.y = 1; break; case UPPER_RIGHT_CORNER: planeImg.rotation = 180; planeShadowImg.rotation = 180; y = (-(planeImg.height) / 4); x = (Main.WIDTH + planeImg.width); directionVector.x = -1; directionVector.y = 1; break; case RIGHT: planeImg.rotation = 225; planeShadowImg.rotation = 225; y = planeImg.height; x = (Main.WIDTH + (0.5 * planeImg.width)); directionVector.x = -1; directionVector.y = 0; break; case LOWER_RIGHT_CORNER: planeImg.rotation = 270; planeShadowImg.rotation = 270; y = (Main.HEIGHT + planeImg.height); x = Main.WIDTH; directionVector.x = -1; directionVector.y = -1; break; case BOTTOM: planeImg.rotation = 315; planeShadowImg.rotation = 315; y = (Main.HEIGHT + (planeImg.height / 2)); x = (((Main.WIDTH / 2) - (planeImg.width / 2)) + 50); directionVector.x = 0; directionVector.y = -1; break; case LOWER_LEFT_CORNER: planeImg.rotation = 0; planeShadowImg.rotation = 0; y = Main.HEIGHT; x = (-0.8 * planeImg.width); directionVector.x = 1; directionVector.y = -1; break; case LEFT: planeImg.rotation = 45; planeShadowImg.rotation = 45; x = (-0.5 * planeImg.width); y = ((Main.HEIGHT / 2) - (planeImg.height / 3)); directionVector.x = 1; directionVector.y = 0; break; case UPPER_LEFT_CORNER: planeImg.rotation = 90; planeShadowImg.rotation = 90; y = -(planeImg.height); x = 0; directionVector.x = 1; directionVector.y = 1; break; }; Main.mp3PlayerInstance.playLoopSound(PLANE_SOUND); } } }//package
Section 316
//Plane_PLANE_MP3 (Plane_PLANE_MP3) package { import mx.core.*; public class Plane_PLANE_MP3 extends SoundAsset { } }//package
Section 317
//Plane_PLANE_PNG (Plane_PLANE_PNG) package { import mx.core.*; public class Plane_PLANE_PNG extends BitmapAsset { } }//package
Section 318
//Plane_PLANE_SHADOW_PNG (Plane_PLANE_SHADOW_PNG) package { import mx.core.*; public class Plane_PLANE_SHADOW_PNG extends BitmapAsset { } }//package
Section 319
//Platform (Platform) package { import flash.display.*; import flash.media.*; public class Platform extends Sprite { public var shrinking:Boolean;// = false private var animDelay:int;// = 20 public var mouseSteering:Boolean;// = false public var destinationX:int;// = 0 private var shakePhase:int;// = 0 private var shakeTimeCounter:int;// = 0 public var hit:Boolean;// = false private var normalImg:Bitmap; public var animCounter:int;// = 0 private var movingRight:Boolean;// = false public var growing:Boolean;// = false public var returning:Boolean;// = false public var pWidth:Number;// = 72 public var pHeight:int;// = 23 private var movingLeft:Boolean;// = false private var moveDirection:int;// = 0 public static const GROW_WIDTH:int = 108; private static const RUBBER_GROW:Class = Platform_RUBBER_GROW; public static const NORMAL_HEIGHT:int = 23; public static const LEFT:int = -14; private static const BOUNCE:Class = Platform_BOUNCE; public static const NORMAL_WIDTH:int = 72; private static const RUBBER_SHRINK:Class = Platform_RUBBER_SHRINK; public static const RUBBER_SHRINK_SOUND:Sound = new RUBBER_SHRINK(); public static const GROW_DELTA:Number = 3.6; public static const SHRINK_WIDTH:int = 36; public static const RUBBER_GROW_SOUND:Sound = new RUBBER_GROW(); public static const BOUNCE_SOUND:Sound = new BOUNCE(); public static const RIGHT:int = 14; private static const PLATFORM_PNG:Class = Platform_PLATFORM_PNG; public function Platform(posX:int, posY:int){ super(); this.x = posX; this.y = posY; normalImg = new PLATFORM_PNG(); addChild(normalImg); } public function stopMove(direction:int):void{ if (direction == LEFT){ movingLeft = false; if (movingRight){ moveDirection = RIGHT; } else { moveDirection = 0; }; } else { movingRight = false; if (movingLeft){ moveDirection = LEFT; } else { moveDirection = 0; }; }; } public function getDirection():int{ return (moveDirection); } public function shake(time:Number):void{ shakeTimeCounter = (shakeTimeCounter + time); if (shakeTimeCounter < 31){ return; }; shakeTimeCounter = (shakeTimeCounter - 31); switch (shakePhase){ case 0: case 1: case 2: case 3: case 12: case 13: case 14: case 15: normalImg.scaleX = (normalImg.scaleX + 0.05); normalImg.x = (normalImg.x - (GROW_DELTA / 2)); normalImg.scaleY = (normalImg.scaleY - 0.05); normalImg.y = (normalImg.y + (NORMAL_HEIGHT * 0.05)); shakePhase++; break; case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: normalImg.scaleX = (normalImg.scaleX - 0.05); normalImg.x = (normalImg.x + (GROW_DELTA / 2)); normalImg.scaleY = (normalImg.scaleY + 0.05); normalImg.y = (normalImg.y - (NORMAL_HEIGHT * 0.05)); shakePhase++; break; case 16: shakePhase = 0; hit = false; shakeTimeCounter = 0; break; }; } public function shrink():void{ if ((animCounter = (++animCounter % animDelay)) != 0){ return; }; if (normalImg.scaleX > 0.51){ normalImg.scaleX = (normalImg.scaleX - 0.05); } else { shrinking = false; return; }; x = (x + (GROW_DELTA / 2)); pWidth = (pWidth - GROW_DELTA); } public function move(time:Number):Number{ var oldX:Number = x; if (mouseSteering){ return (0); }; if (moveDirection == 0){ return (0); }; if ((((((x == 0)) && ((moveDirection == LEFT)))) || (((((x + pWidth) == Board.WIDTH)) && ((moveDirection == RIGHT)))))){ return (0); }; x = (x + ((moveDirection * time) / 31)); if (x < 0){ x = 0; } else { if ((x + pWidth) > Board.WIDTH){ x = (Board.WIDTH - pWidth); }; }; return ((x - oldX)); } public function startMove(direction:int):void{ moveDirection = direction; if (direction == LEFT){ movingLeft = true; } else { movingRight = true; }; } public function grow():void{ if ((animCounter = (++animCounter % animDelay)) != 0){ return; }; if (normalImg.scaleX < 1.49){ normalImg.scaleX = (normalImg.scaleX + 0.05); } else { growing = false; return; }; x = (x - (GROW_DELTA / 2)); pWidth = (pWidth + GROW_DELTA); if (x < 0){ x = 0; }; if ((x + pWidth) > Board.WIDTH){ x = (Board.WIDTH - pWidth); }; } public function toNormal():void{ if ((animCounter = (++animCounter % animDelay)) != 0){ return; }; if ((((normalImg.scaleX > 0.98)) && ((normalImg.scaleX < 1.02)))){ returning = false; return; }; if (normalImg.scaleX > 1){ normalImg.scaleX = (normalImg.scaleX - 0.05); x = (x + (GROW_DELTA / 2)); pWidth = (pWidth - GROW_DELTA); } else { normalImg.scaleX = (normalImg.scaleX + 0.05); x = (x - (GROW_DELTA / 2)); pWidth = (pWidth + GROW_DELTA); if (x < 0){ x = 0; }; if ((x + pWidth) > Board.WIDTH){ x = (Board.WIDTH - pWidth); }; }; } } }//package
Section 320
//Platform_BOUNCE (Platform_BOUNCE) package { import mx.core.*; public class Platform_BOUNCE extends SoundAsset { } }//package
Section 321
//Platform_PLATFORM_PNG (Platform_PLATFORM_PNG) package { import mx.core.*; public class Platform_PLATFORM_PNG extends BitmapAsset { } }//package
Section 322
//Platform_RUBBER_GROW (Platform_RUBBER_GROW) package { import mx.core.*; public class Platform_RUBBER_GROW extends SoundAsset { } }//package
Section 323
//Platform_RUBBER_SHRINK (Platform_RUBBER_SHRINK) package { import mx.core.*; public class Platform_RUBBER_SHRINK extends SoundAsset { } }//package
Section 324
//Preloader (Preloader) package { import flash.events.*; import flash.display.*; import flash.utils.*; public dynamic class Preloader extends MovieClip { private var did_load:Boolean; public static var GAME_OPTIONS:Object = {id:"f596f2ae22dbab2f", res:"720x600"}; public static var MAIN_CLASS:String = "Main"; public function Preloader(){ var k:String; super(); var f:Function = function (ev:IOErrorEvent):void{ }; loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); var opts:Object = {}; for (k in GAME_OPTIONS) { opts[k] = GAME_OPTIONS[k]; }; opts.ad_started = function ():void{ did_load = true; }; opts.ad_finished = function ():void{ var mainClass:Class = Class(getDefinitionByName(MAIN_CLASS)); var app:Object = new (mainClass); addChild((app as DisplayObject)); if (app.init){ app.init(did_load); }; }; opts.clip = this; MochiAd.showPreGameAd(opts); } } }//package
Section 325
//TableInfo (TableInfo) package { public class TableInfo { public var levelTime:int; public var bonusesHidden:Boolean;// = false public var starsHidden:Boolean;// = false public var starsNeeded:int;// = 0 public function TableInfo(levelTime:int, starsNeeded:int=0, starsHidden:Boolean=false, bonusesHiddedn:Boolean=false){ super(); this.levelTime = levelTime; this.starsNeeded = starsNeeded; this.starsHidden = starsHidden; this.bonusesHidden = bonusesHidden; } } }//package
Section 326
//TimeBar (TimeBar) package { import flash.display.*; public class TimeBar extends Sprite { private const MAIN_BAR_START_THRESHOLD:int = 20; private var _ANIM_TIME:int;// = 30000 private var colors:Array; private var bar:Sprite; private var FRAME_NR:int; private var multiplayer:Number; public function TimeBar(width:int, height:int){ colors = [0xFF00, 0x545454]; super(); FRAME_NR = (width - 2); graphics.beginFill(colors[1]); graphics.drawRect(0, 0, width, height); graphics.endFill(); graphics.lineStyle(0, 0); bar = new Sprite(); bar.graphics.beginFill(colors[0]); bar.graphics.drawRect(0, 0, width, height); bar.graphics.endFill(); addChild(bar); bar.scaleX = 0; bar.x = 0; bar.y = 0; } public function updateTime(timePassed:Number):Boolean{ if (timePassed > _ANIM_TIME){ return (true); }; bar.scaleX = (timePassed / _ANIM_TIME); return (false); } public function restart():void{ bar.scaleX = 0; visible = true; } public function set ANIM_TIME(value:int):void{ _ANIM_TIME = value; multiplayer = (FRAME_NR / value); } } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuRadioEnabled_1028143967} [MenuRadioEnabled]Uses:1
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuCheckEnabled_1085972354} [MenuCheckEnabled]Uses:3
Symbol 5 GraphicUsed by:6
Symbol 6 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuBranchEnabled_830086026} [MenuBranchEnabled]Uses:5
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuSeparator_1913937056} [MenuSeparator]Uses:7
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuCheckDisabled_580334369} [MenuCheckDisabled]Uses:9
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuRadioDisabled_1616664418} [MenuRadioDisabled]Uses:11
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClip {_MenuStyle__embed_css_Assets_swf_MenuBranchDisabled_1144533735} [MenuBranchDisabled]Uses:13
Symbol 15 Sound {Menu_MENU_SOUND} [Menu_MENU_SOUND]
Symbol 16 Sound {Plane_PLANE_MP3} [Plane_PLANE_MP3]
Symbol 17 Sound {Board_LIFE_LOST} [Board_LIFE_LOST]
Symbol 18 Sound {FallingBonus_STAR} [FallingBonus_STAR]
Symbol 19 Sound {FallingBonus_EXTRA_LIFE} [FallingBonus_EXTRA_LIFE]
Symbol 20 Sound {Block_HIT_WOOD_BLOCK} [Block_HIT_WOOD_BLOCK]
Symbol 21 Sound {Block_DISCOVER_BONUS} [Block_DISCOVER_BONUS]
Symbol 22 Sound {Block_HIT_STONE_BLOCK} [Block_HIT_STONE_BLOCK]
Symbol 23 Sound {Platform_BOUNCE} [Platform_BOUNCE]
Symbol 24 Sound {Platform_RUBBER_SHRINK} [Platform_RUBBER_SHRINK]
Symbol 25 Sound {Platform_RUBBER_GROW} [Platform_RUBBER_GROW]
Symbol 26 Sound {Animation_EXPLOSION} [Animation_EXPLOSION]
Symbol 27 BitmapUsed by:28
Symbol 28 GraphicUses:27Used by:71
Symbol 29 BitmapUsed by:30
Symbol 30 GraphicUses:29Used by:71
Symbol 31 BitmapUsed by:32
Symbol 32 GraphicUses:31Used by:71
Symbol 33 BitmapUsed by:34
Symbol 34 GraphicUses:33Used by:71
Symbol 35 BitmapUsed by:36
Symbol 36 GraphicUses:35Used by:71
Symbol 37 BitmapUsed by:38
Symbol 38 GraphicUses:37Used by:71
Symbol 39 BitmapUsed by:40
Symbol 40 GraphicUses:39Used by:71
Symbol 41 BitmapUsed by:42
Symbol 42 GraphicUses:41Used by:71
Symbol 43 BitmapUsed by:44
Symbol 44 GraphicUses:43Used by:71
Symbol 45 BitmapUsed by:46
Symbol 46 GraphicUses:45Used by:71
Symbol 47 BitmapUsed by:48
Symbol 48 GraphicUses:47Used by:71
Symbol 49 BitmapUsed by:50
Symbol 50 GraphicUses:49Used by:71
Symbol 51 BitmapUsed by:52
Symbol 52 GraphicUses:51Used by:71
Symbol 53 BitmapUsed by:54
Symbol 54 GraphicUses:53Used by:71
Symbol 55 BitmapUsed by:56
Symbol 56 GraphicUses:55Used by:71
Symbol 57 BitmapUsed by:58
Symbol 58 GraphicUses:57Used by:71
Symbol 59 BitmapUsed by:60
Symbol 60 GraphicUses:59Used by:71
Symbol 61 BitmapUsed by:62
Symbol 62 GraphicUses:61Used by:71
Symbol 63 BitmapUsed by:64
Symbol 64 GraphicUses:63Used by:71
Symbol 65 BitmapUsed by:66
Symbol 66 GraphicUses:65Used by:71
Symbol 67 BitmapUsed by:68
Symbol 68 GraphicUses:67Used by:71
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:71
Symbol 71 MovieClip {Animation_ANIM_EXPLOSION} [blow]Uses:28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70
Symbol 72 Bitmap {Menu_GL_LOGO}
Symbol 73 Bitmap {Block_RED_BLOCK_PNG}
Symbol 74 Bitmap {Main_STARS_PNG}
Symbol 75 Bitmap {Menu_TABLE_5_PNG}
Symbol 76 Bitmap {mp3Player.Button_TURN_OFF}
Symbol 77 Bitmap {FallingBonus_LIFE_BONUS_PNG}
Symbol 78 Bitmap {Plane_PLANE_SHADOW_PNG}
Symbol 79 Bitmap {mp3Player.Button_SONG_MUTE_OVER}
Symbol 80 Font {Board_font}
Symbol 81 Bitmap {Block_QUESTION_MARK_BONUS_PNG}
Symbol 82 Bitmap {mp3Player.Button_SONG_PLAY}
Symbol 83 Bitmap {FallingBonus_STAR_BONUS_PNG}
Symbol 84 Bitmap {Ball_FIREBALL_PNG}
Symbol 85 Bitmap {Block_NO_BONUS_PNG}
Symbol 86 Bitmap {BlockSmashParticle_PARTICLE_STONE_PNG}
Symbol 87 Bitmap {mp3Player.Button_SONG_BACK_OVER}
Symbol 88 Bitmap {Menu_TABLE_2_PNG}
Symbol 89 Bitmap {Main_ADV_BG_1_PNG}
Symbol 90 Bitmap {Block_CHAIN_BONUS_PNG}
Symbol 91 Bitmap {Block_BLUE_BLOCK_PNG}
Symbol 92 Bitmap {Menu_BG_PNG}
Symbol 93 Bitmap {Block_SLOW_BONUS_PNG}
Symbol 94 Bitmap {mp3Player.Button_SONG_BACK}
Symbol 95 Bitmap {mp3Player.Button_VOLUME_DOWN}
Symbol 96 Bitmap {Main_BG_PNG}
Symbol 97 Bitmap {Block_SHRINK_BONUS_PNG}
Symbol 98 Bitmap {Menu_LOCKED_SMALL}
Symbol 99 Bitmap {Block_BLOCK_PNG}
Symbol 100 Bitmap {mp3Player.Button_SONG_MUTE}
Symbol 101 Bitmap {mp3Player.Button_VOLUME_UP}
Symbol 102 Bitmap {Menu_LOGO_PNG}
Symbol 103 Bitmap {Board_PAPER_CARD_PNG}
Symbol 104 Bitmap {Ball_BALL_PNG}
Symbol 105 Bitmap {BlockSmashParticle_PARTICLE_BLUE_PNG}
Symbol 106 Bitmap {mp3Player.Button_SONG_PLAY_OVER}
Symbol 107 Bitmap {BlockSmashParticle_PARTICLE_WOOD_PNG}
Symbol 108 Bitmap {FallingBonus_GROW_BONUS_PNG}
Symbol 109 Bitmap {Menu_LOCKED_WIDE}
Symbol 110 Bitmap {Block_SHADOW_PNG}
Symbol 111 Bitmap {Platform_PLATFORM_PNG}
Symbol 112 Bitmap {Block_VANISH_BONUS_PNG}
Symbol 113 Bitmap {FireParticle_FIRE_PARTICLE_01}
Symbol 114 Bitmap {FireParticle_FIRE_PARTICLE_02}
Symbol 115 Bitmap {FireParticle_FIRE_PARTICLE_03}
Symbol 116 Bitmap {Main_ADV_BG_4_PNG}
Symbol 117 Bitmap {FireParticle_FIRE_PARTICLE_04}
Symbol 118 Bitmap {BlockSmashParticle_PARTICLE_GREEN_PNG}
Symbol 119 Bitmap {Menu_HOUSE_PNG}
Symbol 120 Font {Main_font}
Symbol 121 Bitmap {Main_ADV_BG_5_PNG}
Symbol 122 Bitmap {Menu_TABLE_3_PNG}
Symbol 123 Bitmap {Board_CHAIN_PNG}
Symbol 124 Bitmap {Menu_TABLE_4_PNG}
Symbol 125 Bitmap {mp3Player.Button_VOLUME_UP_OVER}
Symbol 126 Bitmap {BlockSmashParticle_PARTICLE_RED_PNG}
Symbol 127 Bitmap {Menu_INSTR_2_PNG}
Symbol 128 Bitmap {mp3Player.Button_SONG_FORWARD}
Symbol 129 Bitmap {Ball_EXPLOSIVEBALL_PNG}
Symbol 130 Bitmap {Main_STAR_HUD_PNG}
Symbol 131 Bitmap {BlockSmashParticle_PARTICLE_YELLOW_PNG}
Symbol 132 Bitmap {Plane_PLANE_PNG}
Symbol 133 Bitmap {Main_ADV_BG_3_PNG}
Symbol 134 Bitmap {Block_FIRE_BONUS_PNG}
Symbol 135 Bitmap {Menu_TOP_10_PNG}
Symbol 136 Bitmap {mp3Player.Button_SONG_FORWARD_OVER}
Symbol 137 Bitmap {Block_GREEN_BLOCK_PNG}
Symbol 138 Bitmap {Block_HIT_STONE_BLOCK_PNG}
Symbol 139 Bitmap {Block_YELLOW_BLOCK_PNG}
Symbol 140 Bitmap {Menu_TABLE_1_PNG}
Symbol 141 Bitmap {Menu_INSTR_PNG}
Symbol 142 Bitmap {HighScoresGUI_PAPER_CARD_PNG}
Symbol 143 Bitmap {Block_STEEL_BLOCK_PNG}
Symbol 144 Bitmap {Block_EXPLOSIVE_BONUS_PNG}
Symbol 145 Bitmap {Menu_RUBBER_PNG}
Symbol 146 Bitmap {Block_STONE_BLOCK_PNG}
Symbol 147 Bitmap {Menu_PLAY_LION_PNG}
Symbol 148 Bitmap {mp3Player.Button_TURN_OFF_OVER}
Symbol 149 Bitmap {mp3Player.Button_VOLUME_DOWN_OVER}
Symbol 150 Bitmap {Block_SPLIT_BONUS_PNG}
Symbol 151 Bitmap {Main_ADV_BG_2_PNG}

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1457 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
ExportAssets (56)Timeline Frame 2Symbol 2 as "MenuRadioEnabled"
ExportAssets (56)Timeline Frame 2Symbol 4 as "MenuCheckEnabled"
ExportAssets (56)Timeline Frame 2Symbol 6 as "MenuBranchEnabled"
ExportAssets (56)Timeline Frame 2Symbol 8 as "MenuSeparator"
ExportAssets (56)Timeline Frame 2Symbol 10 as "MenuCheckDisabled"
ExportAssets (56)Timeline Frame 2Symbol 12 as "MenuRadioDisabled"
ExportAssets (56)Timeline Frame 2Symbol 14 as "MenuBranchDisabled"
ExportAssets (56)Timeline Frame 2Symbol 15 as "Menu_MENU_SOUND"
ExportAssets (56)Timeline Frame 2Symbol 16 as "Plane_PLANE_MP3"
ExportAssets (56)Timeline Frame 2Symbol 17 as "Board_LIFE_LOST"
ExportAssets (56)Timeline Frame 2Symbol 18 as "FallingBonus_STAR"
ExportAssets (56)Timeline Frame 2Symbol 19 as "FallingBonus_EXTRA_LIFE"
ExportAssets (56)Timeline Frame 2Symbol 20 as "Block_HIT_WOOD_BLOCK"
ExportAssets (56)Timeline Frame 2Symbol 21 as "Block_DISCOVER_BONUS"
ExportAssets (56)Timeline Frame 2Symbol 22 as "Block_HIT_STONE_BLOCK"
ExportAssets (56)Timeline Frame 2Symbol 23 as "Platform_BOUNCE"
ExportAssets (56)Timeline Frame 2Symbol 24 as "Platform_RUBBER_SHRINK"
ExportAssets (56)Timeline Frame 2Symbol 25 as "Platform_RUBBER_GROW"
ExportAssets (56)Timeline Frame 2Symbol 26 as "Animation_EXPLOSION"
ExportAssets (56)Timeline Frame 2Symbol 71 as "blow"
EnableDebugger2 (64)Timeline Frame 131 bytes "u.$1$Bm$BQ/4qZiAwYtAN6LkxYw.80."
DebugMX1 (63)Timeline Frame 1
SerialNumber (41)Timeline Frame 1

Labels

"Preloader"Frame 1
"Main"Frame 2
"Main"Frame 3




http://swfchan.com/47/231531/info.shtml
Created: 7/2 -2020 20:44:26 Last modified: 7/2 -2020 20:44:26 Server time: 09/05 -2024 12:49:48