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>

Kraken Attack.swf

This is the info page for
Flash #132916

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


Text
COMBO X5

won

GAME

score

HOW TO PLAY

Move kraken using arrow keys.
Jump on to the boats to destroy them. You
will get more points if you chain the
destruction. Use SPACE to eat dolphins
and bite on flying machines.
Jump to the flying machines and bite on
it. Then use DOWN arrow to pull down
and destroy. Dive to the very bottom and
then press UP to jump higher.
Watch for fire blobs and avoid them.
Inspired by the hit game
'SHARK ATTACK'

KRAKEN

attack

over

s

h

a

r

e

g

m

s

h

a

r

e

g

m

ActionScript [AS3]

Section 1
//Debug (com.carlcalderon.arthropod.Debug) package com.carlcalderon.arthropod { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.system.*; import flash.net.*; public class Debug { private static const MEMORY_OPERATION:String = "debugMemory"; public static const NAME:String = "Debug"; private static const ERROR_OPERATION:String = "debugError"; private static const CLEAR_OPERATION:String = "debugClear"; private static const BITMAP_OPERATION:String = "debugBitmapData"; public static const VERSION:String = "0.74"; private static const TYPE:String = "app"; private static const ARRAY_OPERATION:String = "debugArray"; private static const DOMAIN:String = "com.carlcalderon.Arthropod"; private static const OBJECT_OPERATION:String = "debugObject"; private static const WARNING_OPERATION:String = "debugWarning"; private static const CONNECTION:String = "arthropod"; private static const CHECK:String = ".161E714B6C1A76DE7B9865F88B32FCCE8FABA7B5.1"; private static const LOG_OPERATION:String = "debug"; public static var LIGHT_BLUE:uint = 0xCCCC; public static var secureDomain:String = "*"; public static var password:String = "CDC309AF"; public static var allowLog:Boolean = true; public static var BLUE:uint = 6710988; public static var GREEN:uint = 0xCC00; public static var ignoreStatus:Boolean = true; public static var RED:uint = 0xCC0000; public static var secure:Boolean = false; public static var YELLOW:uint = 0xCCCC00; public static var PINK:uint = 0xCC00CC; private static var lc:LocalConnection = new LocalConnection(); private static var hasEventListeners:Boolean = false; public function Debug(){ super(); } public static function memory():Boolean{ return (send(MEMORY_OPERATION, System.totalMemory, null)); } public static function error(message):Boolean{ return (send(ERROR_OPERATION, String(message), 0xCC0000)); } public static function warning(message):Boolean{ return (send(WARNING_OPERATION, String(message), 0xCCCC00)); } private static function send(operation:String, value, prop):Boolean{ var operation = operation; var value = value; var prop = prop; if (!secure){ lc.allowInsecureDomain("*"); } else { lc.allowDomain(secureDomain); }; if (!hasEventListeners){ if (ignoreStatus){ lc.addEventListener(StatusEvent.STATUS, ignore); } else { lc.addEventListener(StatusEvent.STATUS, status); }; hasEventListeners = true; }; if (allowLog){ lc.send((((((TYPE + "#") + DOMAIN) + CHECK) + ":") + CONNECTION), operation, password, value, prop); return (true); //unresolved jump var _slot1 = e; return (false); }; return (false); } public static function bitmap(bmd, label:String=null):Boolean{ var bm:BitmapData = new BitmapData(100, 100, true, 0xFFFFFF); var mtx:Matrix = new Matrix(); var s:Number = (100 / ((bmd.width)>=bmd.height) ? bmd.width : bmd.height); mtx.scale(s, s); bm.draw(bmd, mtx, null, null, null, true); var bounds:Rectangle = new Rectangle(0, 0, Math.floor((bmd.width * s)), Math.floor((bmd.height * s))); return (send(BITMAP_OPERATION, bm.getPixels(bounds), {bounds:bounds, lbl:label})); } public static function object(obj):Boolean{ return (send(OBJECT_OPERATION, obj, null)); } public static function clear():Boolean{ return (send(CLEAR_OPERATION, 0, 0)); } private static function ignore(e:StatusEvent):void{ } public static function log(message, color:uint=0xFEFEFE):Boolean{ return (send(LOG_OPERATION, String(message), color)); } public static function array(arr:Array):Boolean{ return (send(ARRAY_OPERATION, arr, null)); } public static function snapshot(stage:Stage, label:String=null):Boolean{ if (stage){ return (bitmap(stage, label)); }; return (false); } private static function status(e:StatusEvent):void{ trace(("Arthropod status:\n" + e.toString())); } } }//package com.carlcalderon.arthropod
Section 2
//State (com.csharks.juwalbose.cFlashtory.core.State) package com.csharks.juwalbose.cFlashtory.core { public class State { public var exit:Function; public var _parent:State; public var from:Object; public var name:String; public var enter:Function; public var children:Array; public function State(name:String, from:Object=null, enter:Function=null, exit:Function=null, parent:State=null){ super(); this.name = name; if (!from){ from = "*"; }; this.from = from; this.enter = enter; this.exit = exit; this.children = []; if (parent){ _parent = parent; _parent.children.push(this); }; } public function get parents():Array{ var parentList:Array = []; var parentState:State = _parent; if (parentState){ parentList.push(parentState); while (parentState.parent) { parentState = parentState.parent; parentList.push(parentState); }; }; return (parentList); } public function get root():State{ var parentState:State = _parent; if (parentState){ while (parentState.parent) { parentState = parentState.parent; }; }; return (parentState); } public function toString():String{ return (this.name); } public function get parent():State{ return (_parent); } public function set parent(parent:State):void{ _parent = parent; _parent.children.push(this); } } }//package com.csharks.juwalbose.cFlashtory.core
Section 3
//StateMachine (com.csharks.juwalbose.cFlashtory.core.StateMachine) package com.csharks.juwalbose.cFlashtory.core { import flash.utils.*; import org.osflash.signals.*; public class StateMachine { public var response:Signal; public var path:Array; public var parentState:State; public var _states:Dictionary; public var parentStates:Array; public var _state:String; public var id:String; public function StateMachine(){ response = new Signal(); super(); _states = new Dictionary(); } public function changeState(stateTo:String):void{ var _exitCallbackEvent:Object; var i:int; var _enterCallbackEvent:Object; var k:int; if (!(stateTo in _states)){ trace("[StateMachine]", id, (("Cannot make transition: State " + stateTo) + " is not defined")); return; }; if (!canChangeStateTo(stateTo)){ trace("[StateMachine]", id, (("Transition to " + stateTo) + " denied")); response.dispatch("TRANSITION_DENIED", stateTo, _state, _states[stateTo].from); return; }; path = findPath(_state, stateTo); if (path[0] > 0){ _exitCallbackEvent = new Object(); _exitCallbackEvent.toState = stateTo; _exitCallbackEvent.fromState = _state; _exitCallbackEvent.event = "EXIT_CALLBACK"; _exitCallbackEvent.currentTarget = this; if (_states[_state].exit){ _exitCallbackEvent.currentState = _state; _states[_state].exit.call(null, _exitCallbackEvent); }; parentState = _states[_state]; i = 0; while (i < (path[0] - 1)) { parentState = parentState.parent; if (parentState.exit != null){ _exitCallbackEvent.currentState = parentState.name; parentState.exit.call(null, _exitCallbackEvent); }; i++; }; }; var oldState:String = _state; _state = stateTo; if (path[1] > 0){ _enterCallbackEvent = new Object(); _enterCallbackEvent.toState = stateTo; _enterCallbackEvent.fromState = oldState; _enterCallbackEvent.event = "ENTER_CALLBACK"; _enterCallbackEvent.currentTarget = this; if (_states[stateTo].root){ parentStates = _states[stateTo].parents; k = (path[1] - 2); while (k >= 0) { if (((parentStates[k]) && (parentStates[k].enter))){ _enterCallbackEvent.currentState = parentStates[k].name; parentStates[k].enter.call(null, _enterCallbackEvent); }; k--; }; }; if (_states[_state].enter){ _enterCallbackEvent.currentState = _state; _states[_state].enter.call(null, _enterCallbackEvent); }; }; trace("[StateMachine]", id, ("State Changed to " + _state)); response.dispatch("TRANSITION_COMPLETE", stateTo, oldState); } public function get states():Dictionary{ return (_states); } public function addState(stateName:String, stateData:Object=null):void{ if ((stateName in _states)){ trace("[StateMachine]", id, ("Overriding existing state " + stateName)); }; if (stateData == null){ stateData = {}; }; _states[stateName] = new State(stateName, stateData.from, stateData.enter, stateData.exit, _states[stateData.parent]); } public function get state():String{ return (_states[_state]); } public function canChangeStateTo(stateName:String):Boolean{ return (((!((stateName == _state))) && (((!((_states[stateName].from.indexOf(_state) == -1))) || ((_states[stateName].from == "*")))))); } public function set initialState(stateName:String):void{ var _callbackEvent:Object; var j:int; if ((((_state == null)) && ((stateName in _states)))){ _state = stateName; _callbackEvent = new Object(); _callbackEvent.toState = stateName; _callbackEvent.event = "ENTER_CALLBACK"; _callbackEvent.currentTarget = this; if (_states[_state].root){ parentStates = _states[_state].parents; j = (_states[_state].parents.length - 1); while (j >= 0) { if (parentStates[j].enter){ _callbackEvent.currentState = parentStates[j].name; parentStates[j].enter.call(null, _callbackEvent); }; j--; }; }; if (_states[_state].enter){ _callbackEvent.currentState = _state; _states[_state].enter.call(null, _callbackEvent); }; response.dispatch("TRANSITION_COMPLETE", stateName); }; } public function getStateByName(name:String):State{ var s:State; for each (s in _states) { if (s.name == name){ return (s); }; }; return (null); } public function findPath(stateFrom:String, stateTo:String):Array{ var toState:State; var fromState:State = _states[stateFrom]; var c:int; var d:int; while (fromState) { d = 0; toState = _states[stateTo]; while (toState) { if (fromState == toState){ return ([c, d]); }; d++; toState = toState.parent; }; c++; fromState = fromState.parent; }; return ([c, d]); } } }//package com.csharks.juwalbose.cFlashtory.core
Section 4
//PreloaderMochi (com.csharks.juwalbose.cFlashtory.preloaders.PreloaderMochi) package com.csharks.juwalbose.cFlashtory.preloaders { import flash.events.*; import com.inruntime.utils.*; import flash.display.*; import mochi.as3.*; import flash.utils.*; public dynamic class PreloaderMochi extends MovieClip { private var gameVars:Global; private var did_load:Boolean; public static const ButtonFont:Class = PreloaderMochi_ButtonFont; public static const MenuFont:Class = PreloaderMochi_MenuFont; private static var GAME_OPTIONS:Object; public function PreloaderMochi(){ var k:String; Config.initialise(); gameVars = Global.getInstance(); gameVars.menuFont = new MenuFont().fontName; gameVars.buttonFont = new ButtonFont().fontName; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; gameVars.mochiEnabled = true; GAME_OPTIONS = new Object(); GAME_OPTIONS = {id:"7d0d81c0c3c9ec6d", res:(((gameVars.stageMiddleX * 2).toString() + "x") + (gameVars.stageMiddleY * 2).toString())}; MochiBot.track(this, "c1941634"); 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 app:Object; var mainClass:Class = Class(getDefinitionByName(gameVars.gameName)); if (mainClass){ app = new (mainClass); addChild((app as DisplayObject)); }; }; opts.clip = this; MochiAd.showPreGameAd(opts); } } }//package com.csharks.juwalbose.cFlashtory.preloaders
Section 5
//PreloaderMochi_ButtonFont (com.csharks.juwalbose.cFlashtory.preloaders.PreloaderMochi_ButtonFont) package com.csharks.juwalbose.cFlashtory.preloaders { import mx.core.*; public class PreloaderMochi_ButtonFont extends FontAsset { } }//package com.csharks.juwalbose.cFlashtory.preloaders
Section 6
//PreloaderMochi_MenuFont (com.csharks.juwalbose.cFlashtory.preloaders.PreloaderMochi_MenuFont) package com.csharks.juwalbose.cFlashtory.preloaders { import mx.core.*; public class PreloaderMochi_MenuFont extends FontAsset { } }//package com.csharks.juwalbose.cFlashtory.preloaders
Section 7
//cFlashtory (com.csharks.juwalbose.cFlashtory.cFlashtory) package com.csharks.juwalbose.cFlashtory { import flash.events.*; import flash.display.*; import com.csharks.juwalbose.utils.ui.*; import com.greensock.*; import flash.utils.*; import com.csharks.juwalbose.cFlashtory.core.*; import flash.media.*; import com.inruntime.utils.*; import com.senocular.utils.*; import net.hires.debug.*; import com.greensock.easing.*; import com.carlcalderon.arthropod.*; import mochi.as3.*; import flash.net.*; public dynamic class cFlashtory extends Sprite { protected var game_mc; protected var Music:Class; protected var GameOver:Class; protected var musicIsPlaying:Boolean;// = false protected var HelpDisplay:Class; protected var gameMusicChannel:SoundChannel; protected var gameVars:Global; protected var creditLogo:Sprite; protected var HelpClip:Class; protected var helpDisplay_mc; protected var help_mc:Sprite; protected var key:KeyObject; protected var invincibleMode:Boolean;// = false protected var menu:MovieClip; protected var GameWin:Class; protected var gameWin_mc:MovieClip; protected var intro:MovieClip; protected var MenuClip:Class; protected var gameMusic_snd:Sound; protected var TemplateBg:Class; protected var GameClip:Class; protected var gameOver_mc:MovieClip; protected var levelUp_mc:MovieClip; protected var helpDisplayed:Boolean; protected var logo:Sprite; protected var templateMc:MovieClip; protected var LeveUp:Class; protected var gameStats:Stats; protected var focusSoundMute:Boolean; protected var gameSequence:StateMachine; protected var gameEngine:StateMachine; protected var finalCreditText:UiBox; protected var pauseTime:uint; protected var shareBtn:SimpleButton; public function cFlashtory():void{ MenuClip = cFlashtory_MenuClip; HelpClip = cFlashtory_HelpClip; Music = cFlashtory_Music; GameClip = cFlashtory_GameClip; HelpDisplay = cFlashtory_HelpDisplay; LeveUp = cFlashtory_LeveUp; GameOver = cFlashtory_GameOver; GameWin = cFlashtory_GameWin; TemplateBg = cFlashtory_TemplateBg; super(); } protected function highscoresExit(evnt:Object):void{ removeChild(templateMc); } protected function gotoHelpPage(evnth:MouseEvent):void{ gameSequence.changeState("Help"); } protected function levelUpAdded(evnt:Event):void{ } protected function gameoverExit(evnt:Object):void{ Debug.log("game over exit"); SceneManager.removeButton(gameOver_mc, "Play Again", gameOver2Game); if (gameVars.mochiEnabled){ SceneManager.removeButton(gameOver_mc, "Submit Score", submitScore); }; removeChild(gameOver_mc); } protected function menuInit(evnt:Object):void{ var evnt = evnt; Debug.log("menu init"); menu = new MenuClip(); menu.addEventListener(Event.ENTER_FRAME, assignMenu); addChild(menu); if (!musicIsPlaying){ musicIsPlaying = true; gameMusic_snd = new Music(); gameMusicChannel = gameMusic_snd.play(); //unresolved jump var _slot1 = e; gameMusicChannel.addEventListener(Event.SOUND_COMPLETE, musicCompleteHandler); }; } protected function gameHelpExit(evnt:Object=null):void{ Debug.log("game help exit"); SceneManager.removeButton(helpDisplay_mc, "Back to Game", backToGame); helpDisplayed = false; removeChild(helpDisplay_mc); } protected function gameHelpInit(evnt:Object):void{ Debug.log("game help init"); helpDisplayed = true; helpDisplay_mc = new HelpDisplay(); helpDisplay_mc.x = (gameVars.stageMiddleX - (helpDisplay_mc.width / 2)); helpDisplay_mc.y = (gameVars.stageMiddleY - (helpDisplay_mc.height / 2)); helpDisplay_mc.addEventListener(Event.ADDED_TO_STAGE, helpAdded); addChild(helpDisplay_mc); } protected function gameEngineInit(evnt:Object):void{ game_mc = new GameClip(); game_mc.addEventListener(Event.ADDED_TO_STAGE, initGameUI); addChild(game_mc); } protected function clearCanvas():void{ if (helpDisplayed){ gameHelpExit(); }; if (this.hasEventListener(Event.ENTER_FRAME)){ removeEventListener(Event.ENTER_FRAME, action); }; if (stage.hasEventListener(Event.DEACTIVATE)){ stage.removeEventListener(Event.DEACTIVATE, windowNotActive); }; if (stage.hasEventListener(Event.ACTIVATE)){ stage.removeEventListener(Event.ACTIVATE, windowActive); }; key = null; if (gameVars.developerMode){ if (gameStats != null){ removeChild(gameStats); }; gameStats = null; }; SceneManager.removeAllChildren(game_mc); removeChild(game_mc); } protected function levelUpExit(evnt:Object):void{ Debug.log("level up exit"); SceneManager.removeButton(levelUp_mc, "Next Level", levelUp2Game); setVariable("level", String((gameVars.level + 1)), "levelUpExit", "N"); removeChild(levelUp_mc); } protected function windowActive(evnt:Event):void{ Debug.log("Window focus return", Debug.RED); if (!helpDisplayed){ unpauseGame(); }; } protected function pauseGame(evnt:Object=null):void{ removeEventListener(Event.ENTER_FRAME, action); key = null; if (gameVars.developerMode){ removeChild(gameStats); gameStats = null; }; } protected function gameWin2Game(evnt:MouseEvent):void{ gameSequence.changeState("Game"); } protected function menuExit(event:Object):void{ Debug.log("menu exit"); if (logo){ logo.removeEventListener(MouseEvent.CLICK, gotoSite); SceneManager.removeItem(menu, "Logo"); }; if (gameVars.brandUsed != "Csharks"){ if (gameVars.showCredits != null){ SceneManager.removeItem(menu, "CreditText"); creditLogo.removeEventListener(MouseEvent.CLICK, gotoCsharksSite); SceneManager.removeItem(menu, "Credit Logo"); }; }; if (shareBtn){ shareBtn.removeEventListener(MouseEvent.CLICK, postToStream); SceneManager.removeItem(menu, "Share"); }; SceneManager.removeButton(menu, "Start Game", gameStart); SceneManager.removeButton(menu, "Game Help", gotoHelpPage); SceneManager.removeButton(menu, "More Games", gotoSite); if (gameVars.mochiEnabled){ SceneManager.removeButton(menu, "Leaderboard", showHighScores); }; SceneManager.removeMultiStateButton(menu, "Toggle Sound", toggleGlobalSound); removeChild(menu); } protected function gameInit(evnt:Object):void{ gameEngine = new StateMachine(); gameEngine.addState("GameInit", {enter:gameEngineInit}); gameEngine.addState("LevelInit", {enter:levelInit, from:["LevelUp", "GameInit"]}); gameEngine.addState("Action", {enter:unpauseGame, exit:pauseGame, from:["Paused", "LevelInit", "GameHelp"]}); gameEngine.addState("GameHelp", {enter:gameHelpInit, exit:gameHelpExit, from:"Action"}); gameEngine.addState("Paused", {enter:unpauseGame, exit:pauseGame, from:"Action"}); gameEngine.addState("LevelUp", {enter:levelUpInit, exit:levelUpExit, from:"Action"}); gameEngine.response.add(transitionFunction); } protected function gameOver2Game(evnt:MouseEvent):void{ gameSequence.changeState("Game"); } protected function checkAddMochiAds(evnt:Event):void{ } protected function setVariable(which:String, to:String, from:String, type:String):void{ Debug.log(((((("Changing variable " + which) + " to ") + to) + " by ") + from), Debug.LIGHT_BLUE); if (((invincibleMode) && ((which == "life")))){ return; }; if (type == "N"){ gameVars[which] = Number(to); } else { if (type == "S"){ gameVars[which] = String(to); } else { if (type == "B"){ gameVars[which] = Boolean(to); }; }; }; } protected function soundRollOver(evntsrov:MouseEvent):void{ if (gameVars.soundReady){ evntsrov.currentTarget.gotoAndStop(4); } else { evntsrov.currentTarget.gotoAndStop(3); }; } protected function action(evnt:Event):void{ } protected function gameExit(evnt:Object=null):void{ clearCanvas(); gameEngine = null; } protected function toggleGlobalSound(evnt:MouseEvent=null):void{ var btn:MultiStateUiButton; var sTransform:SoundTransform = new SoundTransform(); if (gameVars.soundReady){ gameVars.soundReady = false; sTransform.volume = 0; if (evnt != null){ if (getQualifiedClassName(evnt.currentTarget).split("::")[1] == "MovieClip"){ evnt.currentTarget.gotoAndStop(2); } else { btn = (evnt.currentTarget as MultiStateUiButton); btn.label = "Sound On"; }; }; } else { gameVars.soundReady = true; sTransform.volume = 1; if (evnt != null){ if (getQualifiedClassName(evnt.currentTarget).split("::")[1] == "MovieClip"){ evnt.currentTarget.gotoAndStop(1); } else { btn = (evnt.currentTarget as MultiStateUiButton); btn.label = "Sound Off"; }; }; }; SoundMixer.soundTransform = sTransform; } protected function initGameUI(evt:Event):void{ evt.currentTarget.sound_Mc.buttonMode = true; if (gameVars.soundReady){ evt.currentTarget.sound_Mc.gotoAndStop(2); } else { evt.currentTarget.sound_Mc.gotoAndStop(1); }; helpDisplayed = false; pauseTime = getTimer(); evt.currentTarget.sound_Mc.addEventListener(MouseEvent.CLICK, toggleGlobalSound); evt.currentTarget.sound_Mc.addEventListener(MouseEvent.ROLL_OVER, soundRollOver); evt.currentTarget.sound_Mc.addEventListener(MouseEvent.ROLL_OUT, soundRollOut); evt.currentTarget.help_Btn.addEventListener(MouseEvent.CLICK, helpDisplay); evt.currentTarget.menu_Btn.addEventListener(MouseEvent.CLICK, menuDisplay); evt.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, initGameUI); gameEngine.changeState("LevelInit"); } protected function helpAdded(evnt:Event):void{ } protected function helpDisplay(evnt:MouseEvent):void{ if (!helpDisplayed){ gameEngine.changeState("GameHelp"); }; } protected function showHighScores(evnt:MouseEvent):void{ if (!MochiServices.connected){ return; }; gameSequence.changeState("Highscores"); } protected function removeIntro(evt:Event):void{ if (evt.currentTarget.currentFrame == evt.currentTarget.totalFrames){ evt.currentTarget.removeEventListener(Event.ENTER_FRAME, removeIntro); gameSequence.changeState("Menu"); }; } protected function gotoSite(evntm:MouseEvent):void{ var evntm = evntm; Debug.log(("Checking " + gameVars.siteUrl)); var request:URLRequest = new URLRequest(gameVars.siteUrl); navigateToURL(request, "_blank"); //unresolved jump var _slot1 = e; } protected function transitionFunction():void{ switch (arguments[0]){ case "TRANSITION_DENIED": Debug.error(((((("Tried change to " + arguments[1]) + " from ") + arguments[2]) + ". Can only transition from the following state/s: ") + arguments[3])); break; case "TRANSITION_COMPLETE": break; }; } protected function submitScore(evnt:MouseEvent):void{ if (!MochiServices.connected){ return; }; gameSequence.changeState("SubmitScore"); } protected function menuDisplay(evnt:MouseEvent):void{ setVariable("level", "1", "menuDisplay", "N"); Debug.log("back"); gameSequence.changeState("Menu"); } protected function levelUp2Game(evnt:MouseEvent):void{ gameEngine.changeState("GameInit"); } protected function showLevelUp():void{ levelUp_mc.visible = true; levelUp_mc.gotoAndPlay(1); levelUp_mc.addEventListener(Event.ENTER_FRAME, levelUpAdded); } protected function cFlashtoryInit():void{ gameVars = Global.getInstance(); if (gameVars.developerMode){ gameStats = new Stats(); }; gameSequence = new StateMachine(); gameSequence.addState("Intro", {enter:introInit, exit:introExit}); gameSequence.addState("Help", {enter:helpInit, exit:helpExit, from:"Menu"}); gameSequence.addState("Menu", {enter:menuInit, exit:menuExit, from:["Intro", "Help", "Game", "GameWin", "GameOver", "Highscores", "SubmitScore"]}); gameSequence.addState("Game", {enter:gameInit, exit:gameExit, from:["Menu", "LevelUp", "GameWin", "GameOver"]}); gameSequence.addState("GameWin", {enter:gamewinInit, exit:gamewinExit, from:"Game"}); gameSequence.addState("GameOver", {enter:gameoverInit, exit:gameoverExit, from:"Game"}); if (gameVars.mochiEnabled){ gameSequence.addState("Highscores", {enter:highscoresInit, exit:highscoresExit, from:"Menu"}); gameSequence.addState("SubmitScore", {enter:submitscoreInit, exit:highscoresExit, from:["GameWin", "GameOver"]}); }; gameSequence.response.add(transitionFunction); } protected function gameStart(evntp:MouseEvent):void{ gameSequence.changeState("Game"); } protected function soundRollOut(evntsrot:MouseEvent):void{ if (gameVars.soundReady){ evntsrot.currentTarget.gotoAndStop(2); } else { evntsrot.currentTarget.gotoAndStop(1); }; } protected function introInit(evnt:Object):void{ if (gameVars.brandUsed == "Csharks"){ intro = (new IntroCgs_mc() as MovieClip); } else { if (gameVars.brandUsed == "OIG"){ intro = (new IntroOIG_mc() as MovieClip); } else { Debug.error("No Custom Intro found, skipping intro"); gameSequence.changeState("Menu"); return; }; }; intro.x = gameVars.stageMiddleX; intro.y = gameVars.stageMiddleY; intro.addEventListener(Event.ENTER_FRAME, removeIntro); addChild(intro); } protected function gameWinAdded(evnt:Event):void{ } protected function unpauseGame(evnt:Object=null):void{ var virtualClick:MouseEvent; Debug.log("action"); addEventListener(Event.ENTER_FRAME, action); key = new KeyObject(this.stage); stage.focus = stage; if (gameVars.developerMode){ if (gameStats == null){ gameStats = new Stats(); }; addChild(gameStats); }; if ((((evnt == null)) || (((!((evnt == null))) && ((((evnt.fromState == "Paused")) || ((evnt.fromState == "GameHelp")))))))){ SceneManager.removeItem(game_mc, "PausedText"); }; if (focusSoundMute){ virtualClick = new MouseEvent(MouseEvent.CLICK); game_mc.sound_Mc.dispatchEvent(virtualClick); focusSoundMute = false; }; setVariable("Paused", "", "unpauseGame", "B"); Debug.log((("Game was paused for " + (getTimer() - pauseTime)) + " Millisecs"), Debug.PINK); } protected function backBtnFn(evnt:MouseEvent):void{ if (((!((gameVars.showCredits == null))) && ((evnt.currentTarget.parent == templateMc)))){ evnt.currentTarget.parent.removeChild(finalCreditText); finalCreditText.removeEventListener(MouseEvent.CLICK, gotoSite); }; Debug.log("back to menu after submit"); SceneManager.removeButton(evnt.currentTarget.parent, "Back to Menu", backBtnFn); gameSequence.changeState("Menu"); } protected function windowNotActive(evnt:Event):void{ var virtualClick:MouseEvent; Debug.log("Window focus lost", Debug.RED); if (!helpDisplayed){ if (((musicIsPlaying) && (gameVars.soundReady))){ virtualClick = new MouseEvent(MouseEvent.CLICK); game_mc.sound_Mc.dispatchEvent(virtualClick); focusSoundMute = true; }; pauseGame(); }; } protected function introExit(evnt:Object):void{ if (intro){ removeChild(intro); }; } protected function submitscoreInit(evnt:Object):void{ templateMc = new TemplateBg(); templateMc.addEventListener(Event.ADDED_TO_STAGE, assignSubmitScore); addChild(templateMc); } protected function assignHighScores(evnt:Event):void{ } protected function levelInit(evnt:Object):void{ Debug.log("level init"); stage.addEventListener(Event.DEACTIVATE, windowNotActive); stage.addEventListener(Event.ACTIVATE, windowActive); focusSoundMute = false; gameEngine.changeState("Action"); } protected function gameOverAdded(evnt:Event):void{ } protected function checkTemplate(evt:Event):void{ var backButton:UiButton; var link:String; if (evt.currentTarget.currentFrame == evt.currentTarget.totalFrames){ evt.currentTarget.stop(); if (gameVars.showCredits != null){ link = gameVars.siteUrl.toString().split("//")[1]; finalCreditText = new UiBox("Play more games at", 300, 70, UiBoxTypes.TextOnly, 20, 0xFFFFFF, link); finalCreditText.name = "CreditText"; finalCreditText.x = (gameVars.stageMiddleX - (finalCreditText.width / 2)); finalCreditText.y = ((gameVars.stageMiddleY - (finalCreditText.height / 2)) + 100); evt.currentTarget.addChild(finalCreditText); finalCreditText.addEventListener(MouseEvent.CLICK, gotoSite); finalCreditText.buttonMode = true; }; evt.currentTarget.removeEventListener(Event.ENTER_FRAME, checkTemplate); backButton = SceneManager.addButton(evt.currentTarget, "Back to Menu", backBtnFn); backButton.x = (gameVars.stageMiddleX - (backButton.width / 2)); backButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(backButton, 1, {y:480, ease:Elastic.easeOut}); }; } protected function gotoCsharksSite(evntm:MouseEvent):void{ var evntm = evntm; var request:URLRequest = new URLRequest("http://www.csharks.com"); navigateToURL(request, "_blank"); //unresolved jump var _slot1 = e; } protected function assignHelp(evnt:Event):void{ evnt.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, assignHelp); var backButton:UiButton = SceneManager.addButton(evnt.currentTarget, "Back to Menu", backBtnFn); backButton.x = (gameVars.stageMiddleX - (backButton.width / 2)); backButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(backButton, 1, {y:500, ease:Elastic.easeOut}); } protected function gamewinInit(evnt:Object):void{ Debug.log("game win init"); gameWin_mc = new GameWin(); gameWin_mc.addEventListener(Event.ENTER_FRAME, gameWinAdded); addChild(gameWin_mc); } protected function gamewinExit(evnt:Object):void{ Debug.log("game win exit"); SceneManager.removeButton(gameWin_mc, "Play Again", gameWin2Game); if (gameVars.mochiEnabled){ SceneManager.removeButton(gameWin_mc, "Submit Score", submitScore); }; removeChild(gameWin_mc); } protected function assignSubmitScore(evnt:Event):void{ } protected function backToGame(evnt:MouseEvent):void{ gameEngine.changeState("Action"); stage.focus = stage; } protected function assignMenu(event:Event):void{ } protected function levelUpInit(evnt:Object):void{ Debug.log("level up init"); clearCanvas(); levelUp_mc = new LeveUp(); levelUp_mc.addEventListener(Event.ADDED_TO_STAGE, checkAddMochiAds); addChild(levelUp_mc); } protected function helpInit(evnt:Object):void{ help_mc = new HelpClip(); help_mc.addEventListener(Event.ADDED_TO_STAGE, assignHelp); addChild(help_mc); } protected function highscoresInit(evnt:Object):void{ templateMc = new TemplateBg(); templateMc.addEventListener(Event.ADDED_TO_STAGE, assignHighScores); addChild(templateMc); } protected function gameoverInit(evnt:Object):void{ Debug.log("game over init"); gameOver_mc = new GameOver(); gameOver_mc.addEventListener(Event.ENTER_FRAME, gameOverAdded); addChild(gameOver_mc); } protected function musicCompleteHandler(evnt:Event):void{ var evnt = evnt; gameMusic_snd = new Music(); gameMusicChannel = gameMusic_snd.play(); //unresolved jump var _slot1 = e; gameMusicChannel.addEventListener(Event.SOUND_COMPLETE, musicCompleteHandler); } protected function helpExit(evnt:Object):void{ removeChild(help_mc); } protected static function postToStream(e=null):void{ MochiSocial.postToStream({message:"Enjoying this awesome game, check it out!"}); MochiSocial.addEventListener(MochiSocial.ACTION_COMPLETE, actionComplete); MochiSocial.addEventListener(MochiSocial.ACTION_CANCELED, actionCanceled); } protected static function actionCanceled(e:Object):void{ MochiSocial.removeEventListener(MochiSocial.ACTION_COMPLETE, actionComplete); MochiSocial.removeEventListener(MochiSocial.ACTION_CANCELED, actionCanceled); } protected static function actionComplete(e:Object):void{ MochiSocial.removeEventListener(MochiSocial.ACTION_COMPLETE, actionComplete); MochiSocial.removeEventListener(MochiSocial.ACTION_CANCELED, actionCanceled); } } }//package com.csharks.juwalbose.cFlashtory
Section 8
//cFlashtory_GameClip (com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip) package com.csharks.juwalbose.cFlashtory { import flash.display.*; import mx.core.*; public class cFlashtory_GameClip extends SpriteAsset { public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package com.csharks.juwalbose.cFlashtory
Section 9
//cFlashtory_GameOver (com.csharks.juwalbose.cFlashtory.cFlashtory_GameOver) package com.csharks.juwalbose.cFlashtory { import mx.core.*; public class cFlashtory_GameOver extends MovieClipAsset { } }//package com.csharks.juwalbose.cFlashtory
Section 10
//cFlashtory_GameWin (com.csharks.juwalbose.cFlashtory.cFlashtory_GameWin) package com.csharks.juwalbose.cFlashtory { import flash.display.*; import mx.core.*; public class cFlashtory_GameWin extends MovieClipAsset { public var play_btn:DisplayObject; public var more_btn:DisplayObject; public var leaderBoard_btn:DisplayObject; public var sound_btn:DisplayObject; public var help_btn:DisplayObject; } }//package com.csharks.juwalbose.cFlashtory
Section 11
//cFlashtory_HelpClip (com.csharks.juwalbose.cFlashtory.cFlashtory_HelpClip) package com.csharks.juwalbose.cFlashtory { import flash.display.*; import mx.core.*; public class cFlashtory_HelpClip extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package com.csharks.juwalbose.cFlashtory
Section 12
//cFlashtory_HelpDisplay (com.csharks.juwalbose.cFlashtory.cFlashtory_HelpDisplay) package com.csharks.juwalbose.cFlashtory { import mx.core.*; public class cFlashtory_HelpDisplay extends MovieClipAsset { } }//package com.csharks.juwalbose.cFlashtory
Section 13
//cFlashtory_LeveUp (com.csharks.juwalbose.cFlashtory.cFlashtory_LeveUp) package com.csharks.juwalbose.cFlashtory { import flash.display.*; import mx.core.*; public class cFlashtory_LeveUp extends MovieClipAsset { public var play_btn:DisplayObject; public var more_btn:DisplayObject; public var leaderBoard_btn:DisplayObject; public var sound_btn:DisplayObject; public var help_btn:DisplayObject; } }//package com.csharks.juwalbose.cFlashtory
Section 14
//cFlashtory_MenuClip (com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip) package com.csharks.juwalbose.cFlashtory { import flash.display.*; import mx.core.*; public class cFlashtory_MenuClip extends MovieClipAsset { public var play_btn:DisplayObject; public var more_btn:DisplayObject; public var leaderBoard_btn:DisplayObject; public var sound_btn:DisplayObject; public var help_btn:DisplayObject; } }//package com.csharks.juwalbose.cFlashtory
Section 15
//cFlashtory_Music (com.csharks.juwalbose.cFlashtory.cFlashtory_Music) package com.csharks.juwalbose.cFlashtory { import mx.core.*; public class cFlashtory_Music extends SoundAsset { } }//package com.csharks.juwalbose.cFlashtory
Section 16
//cFlashtory_TemplateBg (com.csharks.juwalbose.cFlashtory.cFlashtory_TemplateBg) package com.csharks.juwalbose.cFlashtory { import mx.core.*; public class cFlashtory_TemplateBg extends MovieClipAsset { } }//package com.csharks.juwalbose.cFlashtory
Section 17
//LibraryFontTextField (com.csharks.juwalbose.utils.ui.LibraryFontTextField) package com.csharks.juwalbose.utils.ui { import flash.text.*; public class LibraryFontTextField extends TextField { private var formatting:TextFormat; public function LibraryFontTextField(fontName:String, iSize:uint=8, iColor:int=0, iText:String=""){ super(); formatting = new TextFormat(); formatting.font = fontName; formatting.align = TextFormatAlign.CENTER; formatting.size = iSize; formatting.color = iColor; defaultTextFormat = formatting; embedFonts = true; antiAliasType = AntiAliasType.ADVANCED; text = iText; } public function set size(iSize:uint):void{ var currentText:String = this.text; var currentColor:int = this.textColor; formatting.size = iSize; defaultTextFormat = formatting; this.text = currentText; this.textColor = currentColor; } } }//package com.csharks.juwalbose.utils.ui
Section 18
//MultiStateUiButton (com.csharks.juwalbose.utils.ui.MultiStateUiButton) package com.csharks.juwalbose.utils.ui { import flash.display.*; public class MultiStateUiButton extends UiButton { private var newTextUpColor:uint; private var newText:String; private var newTextSize:uint; public function MultiStateUiButton(buttonUpClip:Class, buttonOverClip:Class, buttonDownClip:Class, iSizeX:int, iSizeY:int, itext:String="Button", itextSize:uint=20, itextUpColor:uint=0, itextOverColor:uint=0xFFFFFF, itextDownColor:uint=0xFF00FF){ super(buttonUpClip, buttonOverClip, buttonDownClip, iSizeX, iSizeY, itext, itextSize, itextUpColor, itextOverColor, itextDownColor); newText = itext; newTextSize = itextSize; newTextUpColor = itextUpColor; } public function changeButton(stateClip:Class, itext:String="", itextSize:uint=0, itextUpColor=-1):void{ setState("up", stateClip, itext, itextSize, itextUpColor); setState("over", stateClip, itext, itextSize, itextUpColor); setState("down", stateClip, itext, itextSize, itextUpColor); enabled = true; } override public function set enabled(value:Boolean):void{ super.enabled = value; this.mouseEnabled = enabled; if (enabled){ this.alpha = 1; } else { this.alpha = 0.5; }; } public function setState(flag:String, stateClip:Class, itext:String="", itextSize:uint=0, itextUpColor=-1):void{ var clipSX:uint; var clipSY:uint; var tSize:uint; var _local11:Sprite; if (itext != ""){ newText = itext; }; if (itextSize != 0){ newTextSize = itextSize; }; if (itextUpColor > -1){ newTextUpColor = itextUpColor; }; clipSX = super.sizeX; clipSY = super.sizeY; tSize = newTextSize; var tOffset:uint = 2; var offset:uint = 5; switch (flag){ case "up": upState = (hitTestState = (new UiBox("", super.sizeX, super.sizeY, UiBoxTypes.TextWithBackground, newTextSize, newTextUpColor, newText, stateClip, null, null, super.ButtonFont) as Sprite)); break; case "down": tSize = (newTextSize - tOffset); clipSX = (super.sizeX - offset); clipSY = (super.sizeY - offset); _local11 = (new UiBox("", clipSX, clipSY, UiBoxTypes.TextWithBackground, tSize, newTextUpColor, newText, stateClip, null, null, super.ButtonFont) as Sprite); _local11.x = ((super.sizeX / 2) - (clipSX / 2)); _local11.y = ((super.sizeY / 2) - (clipSY / 2)); downState = _local11; break; case "over": clipSX = (super.sizeX + offset); clipSY = (super.sizeY + offset); tSize = (newTextSize + tOffset); _local11 = (new UiBox("", clipSX, clipSY, UiBoxTypes.TextWithBackground, tSize, newTextUpColor, newText, stateClip, null, null, super.ButtonFont) as Sprite); _local11.x = ((super.sizeX / 2) - (clipSX / 2)); _local11.y = ((super.sizeY / 2) - (clipSY / 2)); overState = _local11; break; }; } } }//package com.csharks.juwalbose.utils.ui
Section 19
//Scale9Helper (com.csharks.juwalbose.utils.ui.Scale9Helper) package com.csharks.juwalbose.utils.ui { import flash.display.*; import flash.geom.*; public class Scale9Helper { public function Scale9Helper(){ super(); } public static function showScaleGrid(target:Sprite, lineColor:uint=0xFF00):void{ var targetScaleRect:Rectangle = target.scale9Grid; target.graphics.lineStyle(2, lineColor); target.graphics.moveTo(0, targetScaleRect.y); target.graphics.lineTo(target.width, targetScaleRect.y); target.graphics.moveTo(targetScaleRect.x, 0); target.graphics.lineTo(targetScaleRect.x, target.height); target.graphics.moveTo(0, (targetScaleRect.y + targetScaleRect.height)); target.graphics.lineTo(target.width, (targetScaleRect.y + targetScaleRect.height)); target.graphics.moveTo((targetScaleRect.x + targetScaleRect.width), 0); target.graphics.lineTo((targetScaleRect.x + targetScaleRect.width), target.height); } public static function setScaleGrid(target:Sprite, offset:uint):void{ var grid:Rectangle = new Rectangle(offset, offset, (target.width - (offset << 1)), (target.height - (offset << 1))); target.scale9Grid = grid; } } }//package com.csharks.juwalbose.utils.ui
Section 20
//SceneManager (com.csharks.juwalbose.utils.ui.SceneManager) package com.csharks.juwalbose.utils.ui { import flash.events.*; import flash.display.*; import com.inruntime.utils.*; public class SceneManager { private static var ButtonDownClip:Class = SceneManager_ButtonDownClip; private static var ButtonUpClip:Class = SceneManager_ButtonUpClip; private static var ButtonOverClip:Class = SceneManager_ButtonOverClip; public function SceneManager(){ super(); } public static function getCircle(radius:uint, color:uint=0, lineWidth:uint=1):Sprite{ var mS:Sprite = new Sprite(); mS.graphics.lineStyle(lineWidth, color); mS.graphics.drawCircle(0, 0, radius); return (mS); } public static function addMultiStateButton(parent, btnName:String="Button", callback:Function=null, staticMode:Boolean=false, buttonWidth:uint=130, buttonHeight:uint=45):MultiStateUiButton{ var button:MultiStateUiButton; var gameVars:Global = Global.getInstance(); if (staticMode){ button = new MultiStateUiButton(ButtonUpClip, ButtonOverClip, ButtonDownClip, buttonWidth, buttonHeight, btnName, gameVars.buttonFontSize, gameVars.buttonFontNormalColor, gameVars.buttonFontOverColor, gameVars.buttonFontDownColor); } else { button = new MultiStateUiButton(ButtonUpClip, ButtonOverClip, ButtonDownClip, -1, -1, btnName, gameVars.buttonFontSize, gameVars.buttonFontNormalColor, gameVars.buttonFontOverColor, gameVars.buttonFontDownColor); }; button.name = btnName; if (callback != null){ button.addEventListener(MouseEvent.CLICK, callback); }; parent.addChild(button); return (button); } public static function removeMultiStateButton(parent, btnName:String="Button", callback:Function=null):void{ var button:UiButton; if (parent.getChildByName(btnName)){ button = (parent.getChildByName(btnName) as UiButton); if (callback != null){ button.removeEventListener(MouseEvent.CLICK, callback); }; parent.removeChild(button); }; } public static function resizeThis(mc:DisplayObject, maxW:Number, maxH:Number=0, constrainProportions:Boolean=true):void{ maxH = ((maxH == 0)) ? maxW : maxH; mc.width = maxW; mc.height = maxH; if (constrainProportions){ if ((mc.scaleX < mc.scaleY)){ mc.scaleY = mc.scaleX; } else { mc.scaleX = mc.scaleY; }; }; } public static function addButton(parent, btnName:String="Button", callback:Function=null, staticMode:Boolean=false, buttonWidth:uint=130, buttonHeight:uint=45):UiButton{ var button:UiButton; var gameVars:Global = Global.getInstance(); if (staticMode){ button = new UiButton(ButtonUpClip, ButtonOverClip, ButtonDownClip, buttonWidth, buttonHeight, btnName, gameVars.buttonFontSize, gameVars.buttonFontNormalColor, gameVars.buttonFontOverColor, gameVars.buttonFontDownColor); } else { button = new UiButton(ButtonUpClip, ButtonOverClip, ButtonDownClip, -1, -1, btnName, gameVars.buttonFontSize, gameVars.buttonFontNormalColor, gameVars.buttonFontOverColor, gameVars.buttonFontDownColor); }; button.name = btnName; if (callback != null){ button.addEventListener(MouseEvent.CLICK, callback); }; parent.addChild(button); return (button); } public static function addTitleBox(parent, type:uint=1, btnName:String="Title", boxWidth:uint=130, boxHeight:uint=45):UiBox{ var gameVars:Global = Global.getInstance(); var title:String = btnName; var button:UiBox = new UiBox("", boxWidth, boxHeight, type, gameVars.buttonFontSize, gameVars.buttonFontNormalColor, title, ButtonUpClip); button.name = btnName; parent.addChild(button); return (button); } public static function removeButton(parent, btnName:String="Button", callback:Function=null):void{ var button:UiButton; if (parent.getChildByName(btnName)){ button = (parent.getChildByName(btnName) as UiButton); if (callback != null){ button.removeEventListener(MouseEvent.CLICK, callback); }; parent.removeChild(button); }; } public static function removeItem(parent, name:String="Button"):void{ var item:*; if (parent.getChildByName(name)){ item = parent.getChildByName(name); parent.removeChild(item); }; } public static function getRectangle(radius:uint, color:uint=0, lineWidth:uint=1):Sprite{ var mS:Sprite = new Sprite(); mS.graphics.lineStyle(lineWidth, color); mS.graphics.drawRect(-(radius), (-(radius) / 2), (radius * 2), radius); return (mS); } public static function removeAllChildren(parent):void{ while (parent.numChildren) { parent.removeChildAt(0); }; } } }//package com.csharks.juwalbose.utils.ui
Section 21
//SceneManager_ButtonDownClip (com.csharks.juwalbose.utils.ui.SceneManager_ButtonDownClip) package com.csharks.juwalbose.utils.ui { import flash.display.*; import mx.core.*; public class SceneManager_ButtonDownClip extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package com.csharks.juwalbose.utils.ui
Section 22
//SceneManager_ButtonOverClip (com.csharks.juwalbose.utils.ui.SceneManager_ButtonOverClip) package com.csharks.juwalbose.utils.ui { import flash.display.*; import mx.core.*; public class SceneManager_ButtonOverClip extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package com.csharks.juwalbose.utils.ui
Section 23
//SceneManager_ButtonUpClip (com.csharks.juwalbose.utils.ui.SceneManager_ButtonUpClip) package com.csharks.juwalbose.utils.ui { import flash.display.*; import mx.core.*; public class SceneManager_ButtonUpClip extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package com.csharks.juwalbose.utils.ui
Section 24
//UiBox (com.csharks.juwalbose.utils.ui.UiBox) package com.csharks.juwalbose.utils.ui { import flash.events.*; import flash.display.*; import com.inruntime.utils.*; public class UiBox extends Sprite { private var heading:String; private var itemClip:Class; private var barClip:Class; private var myBg:Sprite; private var destinationValue:Number; private var offset:Number; private var headingTxt:LibraryFontTextField; private var myClip:Sprite; private var myTxt:LibraryFontTextField; private var boxType:uint; private var maxBarValue; private var bgClip:Class; private var textColor:uint; private var updating:Boolean;// = false private var myBar:MovieClip; private var textSize:uint; private var iWidth:uint; public var runningUpdate:Boolean;// = false private var MenuFont:String; private var increment:int; private var iHeight:uint; private var currentValue; private var barUpdating:Boolean;// = false public function UiBox(iheading:String="", iwidth:uint=100, iheight:uint=20, itype:uint=1, itextSize:uint=8, itextColor:uint=0, ilinkedVariable=null, ibgClip:Class=null, iitemClip:Class=null, ibarClip:Class=null, fontName:String=null, ioffset:Number=0){ super(); var gameVars:Global = Global.getInstance(); MenuFont = (gameVars.menuFont as String); boxType = itype; iWidth = iwidth; iHeight = iheight; textSize = itextSize; textColor = itextColor; bgClip = ibgClip; barClip = ibarClip; itemClip = iitemClip; heading = iheading; offset = ioffset; if (fontName != null){ MenuFont = fontName; }; if (heading != ""){ headingTxt = new LibraryFontTextField(MenuFont, textSize, textColor, heading); headingTxt.selectable = false; headingTxt.mouseEnabled = false; headingTxt.width = iwidth; headingTxt.x = ((iWidth / 2) - (headingTxt.width / 2)); headingTxt.y = offset; }; switch (itype){ case UiBoxTypes.BackgroundOnly: addBG(); if (heading != ""){ addChild(headingTxt); }; break; case UiBoxTypes.BarOnly: addBar(ilinkedVariable); break; case UiBoxTypes.BarWithBackground: addBG(); addBar(ilinkedVariable); break; case UiBoxTypes.ClipOnly: myClip = new Sprite(); addChild(myClip); addClip(ilinkedVariable); break; case UiBoxTypes.ClipWithBackground: addBG(); myClip = new Sprite(); addChild(myClip); addClip(ilinkedVariable.toString()); break; case UiBoxTypes.TextOnly: addText(ilinkedVariable); break; case UiBoxTypes.TextWithBackground: addBG(); addText(ilinkedVariable.toString()); break; }; } private function clearSprite(clip:Sprite):void{ while (clip.numChildren) { clip.removeChildAt(0); }; } private function addClip(linkedVar=null):void{ var clip:Sprite; if (linkedVar <= 0){ return; }; if (isNaN(linkedVar)){ linkedVar = 1; } else { linkedVar = int(linkedVar); }; if (maxBarValue == null){ maxBarValue = linkedVar; if (heading != ""){ addChild(headingTxt); }; }; var margin:Number = (iWidth / maxBarValue); var i:uint; while (i < maxBarValue) { clip = (new itemClip() as Sprite); myClip.addChild(clip); if (heading != ""){ clip.y = ((headingTxt.y + headingTxt.textHeight) + 5); } else { clip.y = ((iHeight / 2) - (clip.height / 2)); }; if ((i + 1) > linkedVar){ clip.alpha = 0.5; }; clip.x = (((i * margin) / 2) + ((((i + 1) * margin) / 2) - (clip.width / 2))); i++; }; } private function updateBar(e:Event):void{ currentValue = myBar.currentFrame; myBar.gotoAndStop((currentValue + increment)); if ((((((myBar.currentFrame == destinationValue)) || ((((increment > 0)) && ((destinationValue < currentValue)))))) || ((((increment < 0)) && ((destinationValue > currentValue)))))){ currentValue = null; barUpdating = false; myBar.gotoAndStop(destinationValue); removeEventListener(Event.ENTER_FRAME, updateBar); }; } private function addBG():void{ myBg = (new bgClip() as Sprite); addChild(myBg); Scale9Helper.setScaleGrid(myBg, 12); myBg.width = iWidth; myBg.height = iHeight; } private function updateField(e:Event):void{ var oldIncrement:int = increment; increment = int(((destinationValue - currentValue) / 2)); currentValue = Number(myTxt.text); myTxt.text = String((currentValue + increment)); if ((((currentValue == destinationValue)) || (!(((increment / oldIncrement) == Math.abs((increment / oldIncrement))))))){ currentValue = null; updating = false; myTxt.text = destinationValue.toString(); removeEventListener(Event.ENTER_FRAME, updateField); }; myTxt.x = ((iWidth / 2) - (myTxt.width / 2)); } private function addBar(linkedVar=null):void{ if (linkedVar <= 0){ return; }; if (isNaN(linkedVar)){ linkedVar = 1; }; if (maxBarValue == null){ maxBarValue = linkedVar; }; myBar = (new barClip() as MovieClip); addChild(myBar); if (heading != ""){ addChild(headingTxt); myBar.y = ((headingTxt.y + headingTxt.textHeight) + 5); } else { myBar.y = ((iHeight / 2) - (myBar.height / 2)); }; myBar.x = ((iWidth / 2) - (myBar.width / 2)); myBar.addEventListener(Event.ADDED_TO_STAGE, initBar); } public function update(linkedVariable):void{ if ((((boxType == UiBoxTypes.TextOnly)) || ((boxType == UiBoxTypes.TextWithBackground)))){ if (((((runningUpdate) && (!(isNaN(linkedVariable))))) && (!((Number(myTxt.text) == Number(linkedVariable)))))){ if (!updating){ updating = true; if (currentValue == null){ currentValue = Number(myTxt.text); destinationValue = Number(linkedVariable); increment = int(((destinationValue - currentValue) / 2)); addEventListener(Event.ENTER_FRAME, updateField); }; } else { destinationValue = Number(linkedVariable); currentValue = Number(myTxt.text); increment = int(((destinationValue - currentValue) / 2)); }; } else { myTxt.text = linkedVariable; myTxt.x = ((iWidth / 2) - (myTxt.width / 2)); }; } else { if ((((((boxType == UiBoxTypes.BarOnly)) || ((boxType == UiBoxTypes.BarWithBackground)))) && (!(isNaN(linkedVariable))))){ if (((runningUpdate) && (!(isNaN(linkedVariable))))){ if (!barUpdating){ barUpdating = true; if (currentValue == null){ currentValue = myBar.currentFrame; destinationValue = (1 + int(((linkedVariable / maxBarValue) * (myBar.totalFrames - 1)))); if (Math.max(destinationValue, currentValue) == destinationValue){ increment = 1; } else { increment = -1; }; addEventListener(Event.ENTER_FRAME, updateBar); }; } else { destinationValue = (1 + int(((linkedVariable / maxBarValue) * (myBar.totalFrames - 1)))); if (Math.max(destinationValue, currentValue) == destinationValue){ increment = 1; } else { increment = -1; }; }; } else { myBar.gotoAndStop((1 + int(((linkedVariable / maxBarValue) * (myBar.totalFrames - 1))))); }; } else { if ((((boxType == UiBoxTypes.ClipOnly)) || ((boxType == UiBoxTypes.ClipWithBackground)))){ clearSprite(myClip); addClip(linkedVariable); }; }; }; } private function initBar(e:Event):void{ e.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, initBar); e.currentTarget.gotoAndStop(e.currentTarget.totalFrames); } private function addText(itext:String):void{ myTxt = new LibraryFontTextField(MenuFont, textSize, textColor, itext); addChild(myTxt); myTxt.selectable = false; myTxt.mouseEnabled = false; myTxt.multiline = true; myTxt.wordWrap = true; myTxt.width = (iWidth - 5); myTxt.height = (iHeight - 5); myTxt.x = ((iWidth / 2) - (myTxt.width / 2)); if (heading != ""){ addChild(headingTxt); myTxt.y = (((iHeight - (headingTxt.y + headingTxt.textHeight)) / 2) - (myTxt.textHeight / 2)); if ((headingTxt.y + headingTxt.textHeight) > myTxt.y){ myTxt.y = (headingTxt.y + headingTxt.textHeight); }; } else { myTxt.y = ((iHeight / 2) - (myTxt.textHeight / 2)); }; } } }//package com.csharks.juwalbose.utils.ui
Section 25
//UiBoxTypes (com.csharks.juwalbose.utils.ui.UiBoxTypes) package com.csharks.juwalbose.utils.ui { public class UiBoxTypes { public static const TextWithBackground:uint = 3; public static const ClipWithBackground:uint = 7; public static const BarWithBackground:uint = 5; public static const TextOnly:uint = 1; public static const BackgroundOnly:uint = 2; public static const ClipOnly:uint = 6; public static const BarOnly:uint = 4; public function UiBoxTypes(){ super(); } } }//package com.csharks.juwalbose.utils.ui
Section 26
//UiButton (com.csharks.juwalbose.utils.ui.UiButton) package com.csharks.juwalbose.utils.ui { import flash.display.*; import com.inruntime.utils.*; public class UiButton extends SimpleButton { public var ButtonFont:String; private var ButtonDownClip:Class; private var textOverColor:uint; private var ButtonUpClip:Class; private var textSize:uint; private var title:String; private var textUpColor:uint; private var textDownColor:uint; public var sizeY:uint; private var ButtonOverClip:Class; public var sizeX:uint; public function UiButton(buttonUpClip:Class, buttonOverClip:Class, buttonDownClip:Class, iSizeX:int=-1, iSizeY:int=-1, text:String="Button", itextSize:uint=20, itextUpColor:uint=0, itextOverColor:uint=0xFFFFFF, itextDownColor:uint=0xFF00FF){ super(); var gameVars:Global = Global.getInstance(); ButtonFont = (gameVars.buttonFont as String); ButtonUpClip = buttonUpClip; ButtonOverClip = buttonOverClip; ButtonDownClip = buttonDownClip; textDownColor = itextDownColor; textOverColor = itextOverColor; textUpColor = itextUpColor; textSize = itextSize; title = text; var tmpTxt:LibraryFontTextField = new LibraryFontTextField(ButtonFont, textSize, itextUpColor, text); if (iSizeX == -1){ sizeX = (tmpTxt.textWidth + 30); } else { sizeX = iSizeX; }; if (iSizeY == -1){ sizeY = (tmpTxt.textHeight + 15); } else { sizeY = iSizeY; }; tmpTxt = null; upState = (hitTestState = setGraphics(ButtonUpClip, textUpColor)); overState = setGraphics(ButtonOverClip, textOverColor); downState = setGraphics(ButtonDownClip, textDownColor); } private function setGraphics(ButtonClip:Class, textColor:uint):Sprite{ var clipSX:uint; var clipSY:uint; var tSize:uint = textSize; var tOffset:uint; var offset:uint = 1; if (ButtonClip == ButtonUpClip){ clipSX = sizeX; clipSY = sizeY; } else { if (ButtonClip == ButtonOverClip){ clipSX = (sizeX + offset); clipSY = (sizeY + offset); tSize = (tSize + tOffset); } else { if (ButtonClip == ButtonDownClip){ clipSX = (sizeX - offset); clipSY = (sizeY - offset); tSize = (tSize - tOffset); }; }; }; var gSprite:Sprite = (new UiBox("", clipSX, clipSY, UiBoxTypes.TextWithBackground, tSize, textColor, title, ButtonClip, null, null, ButtonFont) as Sprite); gSprite.x = ((sizeX / 2) - (clipSX / 2)); gSprite.y = ((sizeY / 2) - (clipSY / 2)); return (gSprite); } public function set label(text:String):void{ title = text; upState = (hitTestState = setGraphics(ButtonUpClip, textUpColor)); overState = setGraphics(ButtonOverClip, textOverColor); downState = setGraphics(ButtonDownClip, textDownColor); } } }//package com.csharks.juwalbose.utils.ui
Section 27
//Counter (com.csharks.juwalbose.utils.Counter) package com.csharks.juwalbose.utils { import flash.events.*; import flash.utils.*; public class Counter { private var callbackFunction:Function; private var counterType:String; private var _timer:Timer; private var counterMax:uint; public var currentTime:uint; private var counterMin:uint; private var range:uint; public function Counter(maxValue:uint, minValue:uint=0, type:String="down", callback:Function=null){ super(); counterMax = maxValue; counterMin = 0; counterType = type; callbackFunction = callback; range = (counterMax - counterMin); if (counterType == "up"){ currentTime = 0; } else { currentTime = range; }; } public function start(delay:Number=1):void{ _timer = new Timer((delay * 1000)); _timer.addEventListener(TimerEvent.TIMER, timerTick); _timer.start(); } private function timerTick(evnt:TimerEvent):void{ counterMin++; if (counterType == "up"){ currentTime = counterMin; if (currentTime >= counterMax){ timerComplete(); }; } else { currentTime = (range - counterMin); if (currentTime <= 0){ timerComplete(); }; }; } public function unPause():void{ _timer.start(); } public function pause():void{ _timer.stop(); } private function timerComplete():void{ _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, timerTick); _timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete); if (callbackFunction != null){ callbackFunction.call(); }; } public function dispose():void{ _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, timerTick); _timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete); } } }//package com.csharks.juwalbose.utils
Section 28
//Environment (com.csharks.juwalbose.utils.Environment) package com.csharks.juwalbose.utils { import flash.system.*; import flash.net.*; public class Environment { public function Environment(){ super(); } public static function get IS_IN_BROWSER():Boolean{ return ((((Capabilities.playerType == "PlugIn")) || ((Capabilities.playerType == "ActiveX")))); } public static function get DOMAIN():String{ return (new LocalConnection().domain); } public static function get IS_IN_AIR():Boolean{ return ((Capabilities.playerType == "Desktop")); } public static function get IS_OIG():Boolean{ return ((DOMAIN == "onlineindiangames.com")); } public static function get IS_CSHARKS():Boolean{ return ((((((((DOMAIN == "www.csharks.com")) || ((DOMAIN == "csharks.com")))) || ((DOMAIN == "www.csharksgames.com")))) || ((DOMAIN == "csharksgames.com")))); } public static function get IS_ON_SERVER():Boolean{ return ((Security.sandboxType == Security.REMOTE)); } } }//package com.csharks.juwalbose.utils
Section 29
//RandomHelper (com.csharks.juwalbose.utils.RandomHelper) package com.csharks.juwalbose.utils { public class RandomHelper { public function RandomHelper(){ super(); } public static function randomSign():int{ var temp:int = ((2 * int((Math.random() * 2))) - 1); return (temp); } public static function randomIntTill(max:uint):int{ var temp:int = int((Math.random() * max)); return (temp); } public static function randomWithProbability(sectionsArray:Array, probabilityArray:Array, length:uint):Array{ var i:uint; var j:uint; var temp:Array = new Array(); var sections:uint = (sectionsArray.length - 1); var totalProbability:Number = 0; var finalProbability:Number = 0; i = 0; while (i < probabilityArray.length) { totalProbability = (totalProbability + probabilityArray[i]); i++; }; if (totalProbability < 1){ finalProbability = (1 - totalProbability); if (probabilityArray.length < sections){ j = 0; while (j < (sections - probabilityArray.length)) { probabilityArray.push(finalProbability); j++; }; trace("recalculated result: ", probabilityArray); }; } else { if (totalProbability > 1){ i = 0; while (i < probabilityArray.length) { probabilityArray[i] = (probabilityArray[i] / totalProbability); i++; }; trace("recalculated result: ", probabilityArray); }; }; var currentSection:uint = 1; var currentProbability:int = int((length * probabilityArray[(currentSection - 1)])); var iterator:uint; i = 0; while (i < length) { if (iterator == currentProbability){ currentSection++; iterator = 0; currentProbability = int((length * probabilityArray[(currentSection - 1)])); }; temp.push(randomBetween(sectionsArray[(currentSection - 1)], sectionsArray[currentSection])); iterator++; i++; }; return (temp); } public static function randomBetween(min:Number, max:Number):Number{ var temp:Number; if (max < min){ temp = min; min = max; max = temp; }; temp = (min + (Math.random() * (max - min))); return (temp); } public static function randomSignWithZero():int{ var temp:int = (int((Math.random() * 3)) - 1); return (temp); } } }//package com.csharks.juwalbose.utils
Section 30
//Tick (com.csharks.juwalbose.utils.Tick) package com.csharks.juwalbose.utils { import flash.utils.*; public class Tick { public static var fps:uint = 0; public static var timeMultiplier:Number = 0; public static var secs:uint = getTimer(); public static var fps_txt:uint = 0; private static var oldtime:int = 0; public function Tick(){ super(); } public static function run():void{ timeMultiplier = ((getTimer() - oldtime) / 1000); fps++; if ((getTimer() - secs) > 1000){ secs = getTimer(); fps_txt = fps; fps = 0; }; oldtime = getTimer(); } public static function reset():void{ oldtime = getTimer(); } } }//package com.csharks.juwalbose.utils
Section 31
//ParallaxScroller (com.csharks.vinod.ParallaxScroller) package com.csharks.vinod { import flash.display.*; import flash.geom.*; import com.csharks.juwalbose.utils.*; public class ParallaxScroller extends MovieClip { public var screens:Array; public var brightnessEffect:Boolean;// = true public var offsetSpacing:Number;// = 0 public var bottomRight:Point; public var topLeft:Point; public function ParallaxScroller(left:Number, top:Number, right:Number, bottom:Number){ super(); screens = new Array(); topLeft = new Point(left, top); bottomRight = new Point(right, bottom); } public function update(speedMultiplier:Number=1):void{ var screen:Object; var currentScreen:Object; var obj:DisplayObject; for each (screen in screens) { currentScreen = screens[screenIndexOf(screen.screen)]; for each (obj in currentScreen.addedObjects) { obj.x = (obj.x - (currentScreen.speedX * speedMultiplier)); obj.y = (obj.y - (currentScreen.speedY * speedMultiplier)); currentScreen.prevPos = (currentScreen.addedObjects[(currentScreen.addedObjects.length - 1)].x + currentScreen.addedObjects[(currentScreen.addedObjects.length - 1)].width); if (obj.x <= (topLeft.x - (obj.width * 2))){ removeObjectFromScreen(currentScreen, obj); }; }; addObjectToScreen(currentScreen); }; } public function dispose():void{ var screen:Object; for each (screen in screens) { while (MovieClip(this.getChildByName(screen.screen)).numChildren > 0) { MovieClip(this.getChildByName(screen.screen)).removeChildAt(0); }; this.removeChild(MovieClip(this.getChildByName(screen.screen))); }; screens = null; } public function includeObjects(screenName:String, screenItems:Array):void{ var screen:Object = screens[screenIndexOf(screenName)]; screen.objects.concat(screenItems); } public function addScreen(screenName:String, speed:Number, screenItems:Array, spacingMin:Number, spacingMax:Number, baseLine:Number, heightVariation:Number, sizeX:Number, sizeY:Number, level:Number):void{ offsetSpacing = (spacingMin * -1); var screen:MovieClip = new MovieClip(); addChild(screen); this.setChildIndex(screen, level); screen.name = screenName; this.screens.push({screen:screenName, baseLine:baseLine, speedX:speed, speedY:0, objects:screenItems, spacingMin:spacingMin, spacingMax:spacingMax, heightVariation:heightVariation, sX:sizeX, sY:sizeY, addedObjects:[], prevPos:0}); addObjectToScreen(screen); } private function addObjectToScreen(screen:Object):void{ var randomObject:DisplayObject; var color:ColorTransform; var perc:Number; while (screen.prevPos < (bottomRight.x + offsetSpacing)) { randomObject = new (screen.objects[int((Math.random() * screen.objects.length))]); MovieClip(this.getChildByName(screen.screen)).addChild(randomObject); screen.addedObjects.push(randomObject); randomObject.scaleX = (randomObject.scaleX + (RandomHelper.randomSign() * screen.sX)); randomObject.scaleY = (randomObject.scaleY + (RandomHelper.randomSign() * screen.sY)); if (brightnessEffect == true){ color = new ColorTransform(); perc = Math.max(randomObject.scaleX, randomObject.scaleY); color.redOffset = (-100 + (80 * perc)); color.greenOffset = (-100 + (80 * perc)); color.blueOffset = (-100 + (80 * perc)); randomObject.transform.colorTransform = color; }; randomObject.x = (screen.prevPos + (screen.spacingMin + (Math.random() * (screen.spacingMax - screen.spacingMin)))); randomObject.y = (screen.baseLine + (RandomHelper.randomSign() * screen.heightVariation)); screen.prevPos = (randomObject.x + randomObject.width); }; } public function removeObjects(screenName:String, items:Array):void{ var screen:Object = screens[screenIndexOf(screenName)]; var i:uint; while (i < items.length) { screen.objects.splice(screen.objects.indexOf(items[i]), 1); i++; }; } private function removeObjectFromScreen(screen:Object, obj:DisplayObject):void{ screen.addedObjects.splice(screen.addedObjects.indexOf(obj), 1); obj.parent.removeChild(obj); } private function screenIndexOf(screenName:String):Number{ var i:uint; while (i < screens.length) { if (screens[i].screen == screenName){ return (i); }; i++; }; return (-1); } public function removeScreen(screenName:String):void{ var screen:Object = screens[screenIndexOf(screenName)]; while (MovieClip(this.getChildByName(screen.screen)).numChildren > 0) { MovieClip(this.getChildByName(screen.screen)).removeChildAt(0); }; screens.splice(screenIndexOf(screenName), 1); this.removeChild(MovieClip(this.getChildByName(screen.screen))); } } }//package com.csharks.vinod
Section 32
//GCam (com.eckyputrady.GameCamera.GCam) package com.eckyputrady.GameCamera { import flash.display.*; import flash.geom.*; import com.greensock.*; public class GCam { private var _lastZoomAmount:Number; private var _lastX:Number; private var _lastY:Number; private var _canvas:Sprite; private var _bound:Rectangle; public function GCam(canvas:Sprite, bound:Rectangle){ super(); _canvas = canvas; _bound = bound; } public function get lastZoomAmount():Number{ return (_lastZoomAmount); } public function get lastX():Number{ return (_lastX); } public function get lastY():Number{ return (_lastY); } public function to(x:Number, y:Number, zoomAmount:Number, duration:Number):void{ var xx:Number = (x * zoomAmount); var yy:Number = (y * zoomAmount); var hx:Number = (_canvas.stage.stageWidth / 2); var hy:Number = (_canvas.stage.stageHeight / 2); if ((xx - (_bound.left * zoomAmount)) < hx){ xx = ((_bound.left * zoomAmount) + hx); } else { if (((_bound.right * zoomAmount) - xx) < hx){ xx = ((_bound.right * zoomAmount) - hx); }; }; if ((yy - (_bound.top * zoomAmount)) < hy){ yy = ((_bound.top * zoomAmount) + hy); } else { if (((_bound.bottom * zoomAmount) - yy) < hy){ yy = ((_bound.bottom * zoomAmount) - hy); }; }; var tgtx:Number = ((_canvas.stage.stageWidth * 0.5) - xx); var tgty:Number = ((_canvas.stage.stageHeight * 0.5) - yy); TweenLite.to(_canvas, duration, {x:tgtx, y:tgty, scaleX:zoomAmount, scaleY:zoomAmount}); _lastX = x; _lastY = y; _lastZoomAmount = zoomAmount; } } }//package com.eckyputrady.GameCamera
Section 33
//PropTween (com.greensock.core.PropTween) package com.greensock.core { public class PropTween { public var priority:int; public var start:Number; public var prevNode:PropTween; public var change:Number; public var target:Object; public var name:String; public var property:String; public var nextNode:PropTween; public var isPlugin:Boolean; public function PropTween(target:Object, property:String, start:Number, change:Number, name:String, isPlugin:Boolean, nextNode:PropTween=null, priority:int=0){ super(); this.target = target; this.property = property; this.start = start; this.change = change; this.name = name; this.isPlugin = isPlugin; if (nextNode){ nextNode.prevNode = this; this.nextNode = nextNode; }; this.priority = priority; } } }//package com.greensock.core
Section 34
//SimpleTimeline (com.greensock.core.SimpleTimeline) package com.greensock.core { public class SimpleTimeline extends TweenCore { public var autoRemoveChildren:Boolean; protected var _lastChild:TweenCore; protected var _firstChild:TweenCore; public function SimpleTimeline(vars:Object=null){ super(0, vars); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var dur:Number; var next:TweenCore; var tween:TweenCore = _firstChild; this.cachedTotalTime = time; this.cachedTime = time; while (tween) { next = tween.nextNode; if (((tween.active) || ((((((time >= tween.cachedStartTime)) && (!(tween.cachedPaused)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; } public function addChild(tween:TweenCore):void{ if (((!(tween.gc)) && (tween.timeline))){ tween.timeline.remove(tween, true); }; tween.timeline = this; if (tween.gc){ tween.setEnabled(true, true); }; if (_firstChild){ _firstChild.prevNode = tween; }; tween.nextNode = _firstChild; _firstChild = tween; tween.prevNode = null; } public function remove(tween:TweenCore, skipDisable:Boolean=false):void{ if (tween.gc){ return; }; if (!skipDisable){ tween.setEnabled(false, true); }; if (tween.nextNode){ tween.nextNode.prevNode = tween.prevNode; } else { if (_lastChild == tween){ _lastChild = tween.prevNode; }; }; if (tween.prevNode){ tween.prevNode.nextNode = tween.nextNode; } else { if (_firstChild == tween){ _firstChild = tween.nextNode; }; }; } public function get rawTime():Number{ return (this.cachedTotalTime); } } }//package com.greensock.core
Section 35
//TweenCore (com.greensock.core.TweenCore) package com.greensock.core { import com.greensock.*; public class TweenCore { public var initted:Boolean; protected var _hasUpdate:Boolean; public var active:Boolean; protected var _delay:Number; public var cachedTime:Number; public var cachedReversed:Boolean; public var nextNode:TweenCore; protected var _rawPrevTime:Number;// = -1 public var vars:Object; public var cachedTotalTime:Number; public var timeline:SimpleTimeline; public var data; public var cachedStartTime:Number; public var prevNode:TweenCore; public var cachedDuration:Number; public var gc:Boolean; protected var _pauseTime:Number; public var cacheIsDirty:Boolean; public var cachedPaused:Boolean; public var cachedTimeScale:Number; public var cachedTotalDuration:Number; public static const version:Number = 1.13; protected static var _classInitted:Boolean; public function TweenCore(duration:Number=0, vars:Object=null){ super(); this.vars = ((vars) || ({})); this.cachedDuration = (this.cachedTotalDuration = ((duration) || (0))); _delay = ((this.vars.delay) || (0)); this.cachedTimeScale = ((this.vars.timeScale) || (1)); this.active = Boolean((((((duration == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false))))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!_classInitted){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var tl:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.cachedStartTime = (tl.cachedTotalTime + _delay); tl.addChild(this); if (this.vars.reversed){ this.cachedReversed = true; }; if (this.vars.paused){ this.paused = true; }; } public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ } public function get delay():Number{ return (_delay); } public function get duration():Number{ return (this.cachedDuration); } public function restart(includeDelay:Boolean=false, suppressEvents:Boolean=true):void{ this.reversed = false; this.paused = false; this.setTotalTime((includeDelay) ? -(_delay) : 0, suppressEvents); } public function set reversed(b:Boolean):void{ if (b != this.cachedReversed){ this.cachedReversed = b; setTotalTime(this.cachedTotalTime, true); }; } public function set startTime(n:Number):void{ var adjust:Boolean = Boolean(((!((this.timeline == null))) && (((!((n == this.cachedStartTime))) || (this.gc))))); this.cachedStartTime = n; if (adjust){ this.timeline.addChild(this); }; } public function set delay(n:Number):void{ this.startTime = (this.startTime + (n - _delay)); _delay = n; } public function resume():void{ this.paused = false; } public function get paused():Boolean{ return (this.cachedPaused); } public function play():void{ this.reversed = false; this.paused = false; } public function set duration(n:Number):void{ this.cachedDuration = (this.cachedTotalDuration = n); setDirtyCache(false); } public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{ if (!skipRender){ renderTime(this.cachedTotalDuration, suppressEvents, false); return; }; if (this.timeline.autoRemoveChildren){ this.setEnabled(false, false); } else { this.active = false; }; if (!suppressEvents){ if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); } else { if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); }; }; }; } public function invalidate():void{ } public function get totalTime():Number{ return (this.cachedTotalTime); } public function get reversed():Boolean{ return (this.cachedReversed); } public function get startTime():Number{ return (this.cachedStartTime); } public function set currentTime(n:Number):void{ setTotalTime(n, false); } protected function setDirtyCache(includeSelf:Boolean=true):void{ var tween:TweenCore = (includeSelf) ? this : this.timeline; while (tween) { tween.cacheIsDirty = true; tween = tween.timeline; }; } public function reverse(forceResume:Boolean=true):void{ this.reversed = true; if (forceResume){ this.paused = false; } else { if (this.gc){ this.setEnabled(true, false); }; }; } public function set paused(b:Boolean):void{ if (((!((b == this.cachedPaused))) && (this.timeline))){ if (b){ _pauseTime = this.timeline.rawTime; } else { this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime)); _pauseTime = NaN; setDirtyCache(false); }; this.cachedPaused = b; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(b)) && (this.gc))){ this.setTotalTime(this.cachedTotalTime, false); this.setEnabled(true, false); }; } public function kill():void{ setEnabled(false, false); } public function set totalTime(n:Number):void{ setTotalTime(n, false); } public function get currentTime():Number{ return (this.cachedTime); } protected function setTotalTime(time:Number, suppressEvents:Boolean=false):void{ var tlTime:Number; var dur:Number; if (this.timeline){ tlTime = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; if (this.cachedReversed){ dur = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; this.cachedStartTime = (tlTime - ((dur - time) / this.cachedTimeScale)); } else { this.cachedStartTime = (tlTime - (time / this.cachedTimeScale)); }; if (!this.timeline.cacheIsDirty){ setDirtyCache(false); }; if (this.cachedTotalTime != time){ renderTime(time, suppressEvents, false); }; }; } public function pause():void{ this.paused = true; } public function set totalDuration(n:Number):void{ this.duration = n; } public function get totalDuration():Number{ return (this.cachedTotalDuration); } public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{ if (enabled){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); if (((!(ignoreTimeline)) && (this.gc))){ this.timeline.addChild(this); }; } else { this.active = false; if (!ignoreTimeline){ this.timeline.remove(this, true); }; }; this.gc = !(enabled); return (false); } } }//package com.greensock.core
Section 36
//Back (com.greensock.easing.Back) package com.greensock.easing { public class Back { public function Back(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = ((t / d) - 1); return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = (t / d); return (((((c * t) * t) * (((s + 1) * t) - s)) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = (t / (d * 0.5)); if (t < 1){ s = (s * 1.525); return ((((c * 0.5) * ((t * t) * (((s + 1) * t) - s))) + b)); }; t = (t - 2); s = (s * 1.525); return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b)); } } }//package com.greensock.easing
Section 37
//Elastic (com.greensock.easing.Elastic) package com.greensock.easing { public class Elastic { private static const _2PI:Number = (Math.PI * 2); public function Elastic(){ super(); } public static function easeIn(t:Number, b:Number, c:Number, d:Number, a:Number=0, p:Number=0):Number{ var s:Number; if (t == 0){ return (b); }; t = (t / d); if (t == 1){ return ((b + c)); }; if (!p){ p = (d * 0.3); }; if (((((!(a)) || ((((c > 0)) && ((a < c)))))) || ((((c < 0)) && ((a < -(c))))))){ a = c; s = (p / 4); } else { s = ((p / _2PI) * Math.asin((c / a))); }; --t; return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * _2PI) / p)))) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number, a:Number=0, p:Number=0):Number{ var s:Number; if (t == 0){ return (b); }; t = (t / (d * 0.5)); if (t == 2){ return ((b + c)); }; if (!p){ p = (d * (0.3 * 1.5)); }; if (((((!(a)) || ((((c > 0)) && ((a < c)))))) || ((((c < 0)) && ((a < -(c))))))){ a = c; s = (p / 4); } else { s = ((p / _2PI) * Math.asin((c / a))); }; if (t < 1){ --t; return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * _2PI) / p)))) + b)); }; --t; return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * _2PI) / p))) * 0.5) + c) + b)); } public static function easeOut(t:Number, b:Number, c:Number, d:Number, a:Number=0, p:Number=0):Number{ var s:Number; if (t == 0){ return (b); }; t = (t / d); if (t == 1){ return ((b + c)); }; if (!p){ p = (d * 0.3); }; if (((((!(a)) || ((((c > 0)) && ((a < c)))))) || ((((c < 0)) && ((a < -(c))))))){ a = c; s = (p / 4); } else { s = ((p / _2PI) * Math.asin((c / a))); }; return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * _2PI) / p))) + c) + b)); } } }//package com.greensock.easing
Section 38
//Linear (com.greensock.easing.Linear) package com.greensock.easing { public class Linear { public static const power:uint = 0; public function Linear(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } } }//package com.greensock.easing
Section 39
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.*; public class ColorTransformPlugin extends TintPlugin { public static const API:Number = 1; public function ColorTransformPlugin(){ super(); this.propName = "colorTransform"; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ var p:String; var ratio:Number; if (!(target is DisplayObject)){ return (false); }; var end:ColorTransform = target.transform.colorTransform; for (p in value) { if ((((p == "tint")) || ((p == "color")))){ if (value[p] != null){ end.color = int(value[p]); }; } else { if ((((((p == "tintAmount")) || ((p == "exposure")))) || ((p == "brightness")))){ } else { end[p] = value[p]; }; }; }; if (!isNaN(value.tintAmount)){ ratio = (value.tintAmount / (1 - (((end.redMultiplier + end.greenMultiplier) + end.blueMultiplier) / 3))); end.redOffset = (end.redOffset * ratio); end.greenOffset = (end.greenOffset * ratio); end.blueOffset = (end.blueOffset * ratio); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - value.tintAmount))); } else { if (!isNaN(value.exposure)){ end.redOffset = (end.greenOffset = (end.blueOffset = (0xFF * (value.exposure - 1)))); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = 1)); } else { if (!isNaN(value.brightness)){ end.redOffset = (end.greenOffset = (end.blueOffset = Math.max(0, ((value.brightness - 1) * 0xFF)))); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - Math.abs((value.brightness - 1))))); }; }; }; _ignoreAlpha = Boolean(((!((tween.vars.alpha == undefined))) && ((value.alphaMultiplier == undefined)))); init((target as DisplayObject), end); return (true); } } }//package com.greensock.plugins
Section 40
//TintPlugin (com.greensock.plugins.TintPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.*; import com.greensock.core.*; public class TintPlugin extends TweenPlugin { protected var _ct:ColorTransform; protected var _transform:Transform; protected var _ignoreAlpha:Boolean; public static const API:Number = 1; protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"]; public function TintPlugin(){ super(); this.propName = "tint"; this.overwriteProps = ["tint"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (!(target is DisplayObject)){ return (false); }; var end:ColorTransform = new ColorTransform(); if (((!((value == null))) && (!((tween.vars.removeTint == true))))){ end.color = uint(value); }; _ignoreAlpha = true; init((target as DisplayObject), end); return (true); } override public function set changeFactor(n:Number):void{ var ct:ColorTransform; updateTweens(n); if (_ignoreAlpha){ ct = _transform.colorTransform; _ct.alphaMultiplier = ct.alphaMultiplier; _ct.alphaOffset = ct.alphaOffset; }; _transform.colorTransform = _ct; } public function init(target:DisplayObject, end:ColorTransform):void{ var p:String; _transform = target.transform; _ct = _transform.colorTransform; var i:int = _props.length; while (i--) { p = _props[i]; if (_ct[p] != end[p]){ _tweens[_tweens.length] = new PropTween(_ct, p, _ct[p], (end[p] - _ct[p]), "tint", false); }; }; } } }//package com.greensock.plugins
Section 41
//TweenPlugin (com.greensock.plugins.TweenPlugin) package com.greensock.plugins { import com.greensock.*; import com.greensock.core.*; public class TweenPlugin { public var activeDisable:Boolean; protected var _changeFactor:Number;// = 0 protected var _tweens:Array; public var onDisable:Function; public var propName:String; public var round:Boolean; public var onEnable:Function; public var priority:int;// = 0 public var overwriteProps:Array; public var onComplete:Function; public static const VERSION:Number = 1.31; public static const API:Number = 1; public function TweenPlugin(){ _tweens = []; super(); } protected function updateTweens(changeFactor:Number):void{ var pt:PropTween; var val:Number; var i:int = _tweens.length; if (this.round){ while (--i > -1) { pt = _tweens[i]; val = (pt.start + (pt.change * changeFactor)); pt.target[pt.property] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5)); }; } else { while (--i > -1) { pt = _tweens[i]; pt.target[pt.property] = (pt.start + (pt.change * changeFactor)); }; }; } protected function addTween(object:Object, propName:String, start:Number, end, overwriteProp:String=null):void{ var change:Number; if (end != null){ change = ((typeof(end))=="number") ? (Number(end) - start) : Number(end); if (change != 0){ _tweens[_tweens.length] = new PropTween(object, propName, start, change, ((overwriteProp) || (propName)), false); }; }; } public function get changeFactor():Number{ return (_changeFactor); } public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ addTween(target, this.propName, target[this.propName], value, this.propName); return (true); } public function killProps(lookup:Object):void{ var i:int = this.overwriteProps.length; while (--i > -1) { if ((this.overwriteProps[i] in lookup)){ this.overwriteProps.splice(i, 1); }; }; i = _tweens.length; while (--i > -1) { if ((PropTween(_tweens[i]).name in lookup)){ _tweens.splice(i, 1); }; }; } public function set changeFactor(n:Number):void{ updateTweens(n); _changeFactor = n; } public static function activate(plugins:Array):Boolean{ var instance:Object; TweenLite.onPluginEvent = TweenPlugin.onTweenEvent; var i:int = plugins.length; while (--i > -1) { if (plugins[i].hasOwnProperty("API")){ instance = new ((plugins[i] as Class)); TweenLite.plugins[instance.propName] = plugins[i]; }; }; return (true); } private static function onTweenEvent(type:String, tween:TweenLite):Boolean{ var changed:Boolean; var tweens:Array; var i:int; var pt:PropTween = tween.cachedPT1; if (type == "onInit"){ tweens = []; while (pt) { tweens[tweens.length] = pt; pt = pt.nextNode; }; tweens.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); i = tweens.length; while (--i > -1) { PropTween(tweens[i]).nextNode = tweens[(i + 1)]; PropTween(tweens[i]).prevNode = tweens[(i - 1)]; }; tween.cachedPT1 = tweens[0]; } else { while (pt) { if (((pt.isPlugin) && (pt.target[type]))){ if (pt.target.activeDisable){ changed = true; }; var _local7 = pt.target; _local7[type](); }; pt = pt.nextNode; }; }; return (changed); } } }//package com.greensock.plugins
Section 42
//TweenLite (com.greensock.TweenLite) package com.greensock { import flash.events.*; import flash.display.*; import flash.utils.*; import com.greensock.core.*; import com.greensock.plugins.*; public class TweenLite extends TweenCore { protected var _hasPlugins:Boolean; public var propTweenLookup:Object; public var cachedPT1:PropTween; protected var _overwrite:uint; protected var _ease:Function; public var target:Object; public var ratio:Number;// = 0 protected var _overwrittenProps:Object; protected var _notifyPluginsOfEnabled:Boolean; public static const version:Number = 11.32; public static var rootTimeline:SimpleTimeline; public static var fastEaseLookup:Dictionary = new Dictionary(false); public static var onPluginEvent:Function; public static var rootFramesTimeline:SimpleTimeline; public static var defaultEase:Function = TweenLite.easeOut; public static var plugins:Object = {}; public static var masterList:Dictionary = new Dictionary(false); public static var overwriteManager:Object; public static var rootFrame:Number; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; private static var _shape:Shape = new Shape(); protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1}; public function TweenLite(target:Object, duration:Number, vars:Object){ var sibling:TweenLite; super(duration, vars); this.target = target; if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){ this.cachedTimeScale = 1; }; propTweenLookup = {}; _ease = defaultEase; _overwrite = (((!((Number(vars.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((vars.overwrite > 1)))))) ? overwriteManager.mode : int(vars.overwrite); var a:Array = masterList[target]; if (!a){ masterList[target] = [this]; } else { if (_overwrite == 1){ for each (sibling in a) { if (!sibling.gc){ sibling.setEnabled(false, false); }; }; masterList[target] = [this]; } else { a[a.length] = this; }; }; if (((this.active) || (this.vars.immediateRender))){ renderTime(0, false, true); }; } protected function easeProxy(t:Number, b:Number, c:Number, d:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var isComplete:Boolean; var prevTime:Number = this.cachedTime; if (time >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); this.ratio = 1; isComplete = true; if (this.cachedDuration == 0){ if ((((((time == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == time))))){ force = true; }; _rawPrevTime = time; }; } else { if (time <= 0){ this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (time < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ force = true; isComplete = true; }; _rawPrevTime = time; }; }; if (((this.cachedReversed) && (!((prevTime == 0))))){ isComplete = true; }; } else { this.cachedTotalTime = (this.cachedTime = time); this.ratio = _ease(time, 0, 1, this.cachedDuration); }; }; if ((((this.cachedTime == prevTime)) && (!(force)))){ return; }; if (!this.initted){ init(); if (((!(isComplete)) && (this.cachedTime))){ this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if ((((((((prevTime == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(suppressEvents)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; var pt:PropTween = this.cachedPT1; while (pt) { pt.target[pt.property] = (pt.start + (this.ratio * pt.change)); pt = pt.nextNode; }; if (((_hasUpdate) && (!(suppressEvents)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (isComplete){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, suppressEvents); }; } override public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{ var a:Array; if (enabled){ a = TweenLite.masterList[this.target]; if (!a){ TweenLite.masterList[this.target] = [this]; } else { a[a.length] = this; }; }; super.setEnabled(enabled, ignoreTimeline); if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ return (onPluginEvent((enabled) ? "onEnable" : "onDisable", this)); }; return (false); } protected function init():void{ var p:String; var i:int; var plugin:*; var prioritize:Boolean; var siblings:Array; var pt:PropTween; if (this.vars.onInit){ this.vars.onInit.apply(null, this.vars.onInitParams); }; if (typeof(this.vars.ease) == "function"){ _ease = this.vars.ease; }; if (this.vars.easeParams){ this.vars.proxiedEase = _ease; _ease = easeProxy; }; this.cachedPT1 = null; this.propTweenLookup = {}; for (p in this.vars) { if ((((p in _reservedProps)) && (!((((p == "timeScale")) && ((this.target is TweenCore))))))){ } else { if ((((p in plugins)) && (new ((plugins[p] as Class)).onInitTween(this.target, this.vars[p], this)))){ this.cachedPT1 = new PropTween(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); if (this.cachedPT1.name == "_MULTIPLE_"){ i = plugin.overwriteProps.length; while (--i > -1) { this.propTweenLookup[plugin.overwriteProps[i]] = this.cachedPT1; }; } else { this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; }; if (plugin.priority){ this.cachedPT1.priority = plugin.priority; prioritize = true; }; if (((plugin.onDisable) || (plugin.onEnable))){ _notifyPluginsOfEnabled = true; }; _hasPlugins = true; } else { this.cachedPT1 = new PropTween(this.target, p, Number(this.target[p]), ((typeof(this.vars[p]))=="number") ? (Number(this.vars[p]) - this.target[p]) : Number(this.vars[p]), p, false, this.cachedPT1); this.propTweenLookup[p] = this.cachedPT1; }; }; }; if (prioritize){ onPluginEvent("onInit", this); }; if (this.vars.runBackwards){ pt = this.cachedPT1; while (pt) { pt.start = (pt.start + pt.change); pt.change = -(pt.change); pt = pt.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps){ killVars(_overwrittenProps); if (this.cachedPT1 == null){ this.setEnabled(false, false); }; }; if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((siblings.length > 1)))){ if (overwriteManager.manageOverwrites(this, this.propTweenLookup, siblings, _overwrite)){ init(); }; }; this.initted = true; } public function killVars(vars:Object, permanent:Boolean=true):Boolean{ var p:String; var pt:PropTween; var changed:Boolean; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (p in vars) { if ((p in propTweenLookup)){ pt = propTweenLookup[p]; if (((pt.isPlugin) && ((pt.name == "_MULTIPLE_")))){ pt.target.killProps(vars); if (pt.target.overwriteProps.length == 0){ pt.name = ""; }; }; if (pt.name != "_MULTIPLE_"){ if (pt.nextNode){ pt.nextNode.prevNode = pt.prevNode; }; if (pt.prevNode){ pt.prevNode.nextNode = pt.nextNode; } else { if (this.cachedPT1 == pt){ this.cachedPT1 = pt.nextNode; }; }; if (((pt.isPlugin) && (pt.target.onDisable))){ pt.target.onDisable(); if (pt.target.activeDisable){ changed = true; }; }; delete propTweenLookup[p]; }; }; if (((permanent) && (!((vars == _overwrittenProps))))){ _overwrittenProps[p] = 1; }; }; return (changed); } override public function invalidate():void{ if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ onPluginEvent("onDisable", this); }; this.cachedPT1 = null; _overwrittenProps = null; _hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false))); this.propTweenLookup = {}; } public static function initClass():void{ rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.cachedStartTime = (getTimer() * 0.001); rootFramesTimeline.cachedStartTime = rootFrame; rootTimeline.autoRemoveChildren = true; rootFramesTimeline.autoRemoveChildren = true; _shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function killTweensOf(target:Object, complete:Boolean=false, vars:Object=null):void{ var a:Array; var i:int; var tween:TweenLite; if ((target in masterList)){ a = masterList[target]; i = a.length; while (--i > -1) { tween = a[i]; if (!tween.gc){ if (complete){ tween.complete(false, false); }; if (vars != null){ tween.killVars(vars); }; if ((((vars == null)) || ((((tween.cachedPT1 == null)) && (tween.initted))))){ tween.setEnabled(false, false); }; }; }; if (vars == null){ delete masterList[target]; }; }; } public static function from(target:Object, duration:Number, vars:Object):TweenLite{ vars.runBackwards = true; if (!("immediateRender" in vars)){ vars.immediateRender = true; }; return (new TweenLite(target, duration, vars)); } protected static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (1 - (t / d)); return ((1 - (t * t))); } public static function delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array=null, useFrames:Boolean=false):TweenLite{ return (new TweenLite(onComplete, 0, {delay:delay, onComplete:onComplete, onCompleteParams:onCompleteParams, immediateRender:false, useFrames:useFrames, overwrite:0})); } protected static function updateAll(e:Event=null):void{ var ml:Dictionary; var tgt:Object; var a:Array; var i:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); rootFrame++; rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); if (!(rootFrame % 60)){ ml = masterList; for (tgt in ml) { a = ml[tgt]; i = a.length; while (--i > -1) { if (TweenLite(a[i]).gc){ a.splice(i, 1); }; }; if (a.length == 0){ delete ml[tgt]; }; }; }; } public static function to(target:Object, duration:Number, vars:Object):TweenLite{ return (new TweenLite(target, duration, vars)); } } }//package com.greensock
Section 43
//Global (com.inruntime.utils.Global) package com.inruntime.utils { import flash.events.*; import flash.utils.*; public dynamic class Global extends Proxy implements IEventDispatcher { private var globalKeychain:GlobalHashMap; private var globalIncrement:int;// = 1 private var globalRepository:GlobalHashMap; private var dispatcher:EventDispatcher; private static var allowInstantiation:Boolean = false; private static var instance:Global = null; public function Global(useWeakReferences:Boolean=true){ super(); if (!allowInstantiation){ throw (new Error("Error: Instantiation failed: Use Global.getInstance() instead of new Global().")); }; globalRepository = new GlobalHashMap(useWeakReferences); globalKeychain = new GlobalHashMap(useWeakReferences); dispatcher = new EventDispatcher(this); } public function containsKey(name:String):Boolean{ var retval:Boolean = globalRepository.containsKey(name); return (retval); } public function remove(name:String):void{ globalRepository.remove(name); globalKeychain.remove(name); } public function willTrigger(type:String):Boolean{ return (dispatcher.willTrigger(type)); } public function take(name){ return (globalRepository.getValue(name)); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){ return (globalRepository.getValue(name)); } public function put(name:String, value):void{ globalRepository.put(name, value); } public function getId(name:String):int{ return (globalKeychain.getValue(name)); } public function containsValue(value):Boolean{ var retval:Boolean = globalRepository.containsValue(value); return (retval); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(methodName, ... _args){ var result:*; switch (methodName.toString()){ default: result = globalRepository.getValue(methodName).apply(globalRepository, _args); break; }; return (result); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{ if (index < (globalIncrement - 1)){ if (containsId((index + 1))){ return ((index + 1)); }; return (nextNameIndex((index + 1))); //unresolved jump }; return (0); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{ var oldValue:* = globalRepository.getValue(name); if (!oldValue){ globalKeychain.put(name, globalIncrement.toString()); globalIncrement++; }; globalRepository.put(name, value); if (oldValue !== value){ dispatchEvent(new GlobalEvent(GlobalEvent.PROPERTY_CHANGED, name)); }; } public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ dispatcher.removeEventListener(type, listener, useCapture); } public function containsId(id:int):Boolean{ var retval:Boolean = globalKeychain.containsValue(id); return (retval); } public function clear():void{ globalRepository.clear(); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{ return (getKey(index)); } public function dispatchEvent(evt:Event):Boolean{ return (dispatcher.dispatchEvent(evt)); } public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ dispatcher.addEventListener(type, listener, useCapture, priority); } public function get length():int{ var retval:int = globalRepository.size(); return (retval); } public function getKey(id:int):String{ return (globalKeychain.getKey(id)); } public function toString():String{ var key:*; var temp:Array = new Array(); for (key in globalRepository) { if (globalRepository[key] != null){ temp.push((((("{" + key) + ":") + globalRepository[key]) + "}")); }; }; return (temp.join(",")); } public function hasEventListener(type:String):Boolean{ return (dispatcher.hasEventListener(type)); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(index:int){ var prop:String = getKey(index); return (globalRepository.getValue(prop)); } public static function getInstance(useWeakReferences:Boolean=true):Global{ if (Global.instance == null){ Global.allowInstantiation = true; Global.instance = new Global(useWeakReferences); Global.allowInstantiation = false; }; return (Global.instance); } } }//package com.inruntime.utils import flash.utils.*; dynamic class GlobalHashMap extends Dictionary { private function GlobalHashMap(useWeakReferences:Boolean=true){ super(useWeakReferences); } public function containsKey(key:String):Boolean{ return (!((this[key] == null))); } public function size():int{ var prop:String; var size:int; for (prop in this) { if (this[prop] != null){ size++; }; }; return (size); } public function containsValue(value):Boolean{ var prop:String; for (prop in this) { if (this[prop] == value){ return (true); }; }; return (false); } public function remove(key:String):void{ this[key] = null; } public function getKey(value):String{ var prop:String; for (prop in this) { if (this[prop] == value){ return (prop); }; }; return (null); } public function isEmpty():Boolean{ var prop:String; var size:int; for (prop in this) { if (this[prop] != null){ size++; }; }; return ((size <= 0)); } public function getValue(key:String){ if (this[key] != null){ return (this[key]); }; } public function clear():void{ var prop:String; for (prop in this) { this[prop] = null; }; } public function put(key:String, value):void{ this[key] = value; } }
Section 44
//GlobalEvent (com.inruntime.utils.GlobalEvent) package com.inruntime.utils { import flash.events.*; public class GlobalEvent extends Event { public var property; public static const PROPERTY_CHANGED:String = "globalPropertyChanged"; public function GlobalEvent(type:String, property, bubbles:Boolean=false, cancelable:Boolean=false){ this.property = property; super(type, bubbles, cancelable); } override public function clone():Event{ return (new GlobalEvent(type, property, bubbles, cancelable)); } } }//package com.inruntime.utils
Section 45
//KeyObject (com.senocular.utils.KeyObject) package com.senocular.utils { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.ui.*; public dynamic class KeyObject extends Proxy { private static var keysDown:Object; private static var stage:Stage; public function KeyObject(stage:Stage){ super(); construct(stage); } private function keyReleased(evt:KeyboardEvent):void{ delete keysDown[evt.keyCode]; } public function deconstruct():void{ stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased); keysDown = new Object(); _slot1.stage = null; } public function construct(stage:Stage):void{ _slot1.stage = stage; keysDown = new Object(); stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased); } private function keyPressed(evt:KeyboardEvent):void{ keysDown[evt.keyCode] = true; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){ return (((name in Keyboard)) ? Keyboard[name] : -1); } public function isDown(keyCode:uint):Boolean{ return (Boolean((keyCode in keysDown))); } } }//package com.senocular.utils
Section 46
//MochiAd (mochi.as3.MochiAd) package mochi.as3 { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiAd { public function MochiAd(){ super(); } public static function getVersion():String{ return (MochiServices.getVersion()); } public static function showClickAwayAd(options:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = options; var DEFAULTS:Object = {ad_timeout:5500, 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); }; chk["onEnterFrame"] = function ():void{ var total:Number; if (!this.parent){ delete this.onEnterFrame; return; }; var ad_clip:Object = this.parent._mochiad_ctr; var elapsed:Number = (getTimer() - this.started); var finished:Boolean; if (!chk.showing){ total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (total > 0){ chk.showing = true; finished = true; chk.started = getTimer(); } else { if (elapsed > chk.ad_timeout){ options.ad_failed(); finished = true; }; }; }; if (this.root == null){ finished = true; }; if (finished){ delete this.onEnterFrame; }; }; doOnEnterFrame(chk); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function _allowDomains(server:String):String{ var hostname:String = server.split("/")[2].split(":")[0]; if (Security.sandboxType == "application"){ return (hostname); }; Security.allowDomain("*"); Security.allowDomain(hostname); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(hostname); return (hostname); } public static function unload(clip:Object):Boolean{ if (((clip.clip) && (clip.clip._mochiad))){ clip = clip.clip; }; if (clip.origFrameRate != undefined){ clip.stage.frameRate = clip.origFrameRate; }; if (!clip._mochiad){ return (false); }; if (clip._mochiad._containerLCName != undefined){ clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"}); }; if (clip._mochiad.onUnload){ clip._mochiad.onUnload(); }; delete clip._mochiad_loaded; delete clip._mochiad; return (true); } public static function showInterLevelAd(options:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = options; var DEFAULTS:Object = {ad_timeout:5500, 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 mc:MovieClip; 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 (!(clip is DisplayObject)){ trace("Warning: Object passed as container clip not a descendant of the DisplayObject type"); return (null); }; if (MovieClip(clip).stage == null){ trace("Warning: Container clip for ad is not attached to the stage"); return (null); }; 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; mc = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = MochiAd._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; if (clip.loaderInfo.loaderURL.indexOf("http") == 0){ options.as3_swf = clip.loaderInfo.loaderURL; } else { trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal"); }; var lv:URLVariables = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; mc.lcName = name; lv.lc = name; lv.st = getTimer(); mc.regContLC = function (lc_name:String):void{ mc._containerLCName = lc_name; }; loader = new Loader(); g = function (ev:Object):void{ ev.target.removeEventListener(ev.type, arguments.callee); MochiAd.unload(clip); }; loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g); req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime())); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (io:IOErrorEvent):void{ trace("[MochiAds] Blocked URL"); }); if (!options.skip){ 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.right - b.left); h = (b.top - b.bottom); }; if ((((w == 0)) || ((h == 0)))){ w = clip.stage.stageWidth; h = clip.stage.stageHeight; }; return ([w, h]); } public static function adShowing(mc:Object):void{ mc.origFrameRate = mc.stage.frameRate; mc.stage.frameRate = 30; } public static function getValue(base:Object, objectName:String):Object{ var nameArray:Array = objectName.split("."); var i:Number = 0; while (i < (nameArray.length - 1)) { if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){ return (undefined); }; base = base[nameArray[i]]; i++; }; return (base[nameArray[i]]); } public static function rpc(clip:Object, callbackID:Number, arg:Object):void{ var _local4:Object; var _local5:Object; switch (arg.id){ case "setValue": MochiAd.setValue(clip, arg.objectName, arg.value); break; case "getValue": _local4 = MochiAd.getValue(clip, arg.objectName); clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4); break; case "runMethod": _local5 = MochiAd.runMethod(clip, arg.method, arg.args); clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5); break; default: trace(("[mochiads rpc] unknown rpc id: " + arg.id)); }; } public static function setValue(base:Object, objectName:String, value:Object):void{ var nameArray:Array = objectName.split("."); var i:Number = 0; while (i < (nameArray.length - 1)) { if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){ return; }; base = base[nameArray[i]]; i++; }; base[nameArray[i]] = value; } public static function showPreGameAd(options:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var complete:Boolean; var unloaded:Boolean; var sendHostProgress:Boolean; var fn:Function; var r:MovieClip; var options = options; var DEFAULTS:Object = {ad_timeout:5500, 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{ }, progress_override:function (_clip:Object):Number{ return (NaN); }, bar_offset:0}; options = MochiAd._parseOptions(options, DEFAULTS); if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){ options.ad_started(); fn = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); return; }; clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; if (options.skip){ ad_timeout = 0; }; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); var fn:Function = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4); if (options.no_progress_bar){ bar.visible = false; delete options.no_progress_bar; } else { bar.x = (10 + options.bar_offset); bar.y = (h - 20); }; var bar_w:Number = ((w - bar.x) - 10); var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo(bar_w, 0); backing.lineTo(bar_w, 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo(bar_w, 0); inside.lineTo(bar_w, 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo(bar_w, 0); outline.lineTo(bar_w, 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (p > 0){ this.parent.alpha = (p * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; complete = false; unloaded = false; var progress:Number = Math.min(1, options.progress_override(clip)); var f:Function = function (ev:Event):void{ ev.target.removeEventListener(ev.type, arguments.callee); complete = true; if (unloaded){ MochiAd.unload(clip); }; }; if (!isNaN(progress)){ complete = (progress == 1); } else { if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){ complete = true; } else { if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; } else { clip.loaderInfo.addEventListener(Event.COMPLETE, f); }; } else { clip.loaderInfo.addEventListener(Event.COMPLETE, f); }; }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (msec:Number):void{ var _chk:Object = mc._mochiad_wait; _chk.server_control = true; _chk.showing = true; _chk.started = getTimer(); _chk.ad_msec = msec; }; mc.rpc = function (callbackID:Number, arg:Object):void{ MochiAd.rpc(clip, callbackID, arg); }; mc.rpcTestFn = function (s:String):Object{ trace(("[MOCHIAD rpcTestFn] " + s)); return (s); }; 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; var clip_progress:Number = Math.min(1, options.progress_override(_clip)); if (clip_progress == 1){ complete = true; }; if (complete){ clip_loaded = Math.max(1, clip_loaded); clip_total = clip_loaded; }; var clip_pcnt:Number = ((100 * clip_loaded) / clip_total); if (!isNaN(clip_progress)){ clip_pcnt = (100 * clip_progress); }; 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 (unloaded){ MochiAd.unload(_clip); } else { if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; }; doOnEnterFrame(chk); } public static function showPreloaderAd(options:Object):void{ trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0"); MochiAd.showPreGameAd(options); } public static function showTimedAd(options:Object):void{ trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0"); MochiAd.showInterLevelAd(options); } public static function doOnEnterFrame(mc:MovieClip):void{ var mc = mc; var f:Function = function (ev:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { ev.target.removeEventListener(ev.type, arguments.callee); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package mochi.as3
Section 47
//MochiCoins (mochi.as3.MochiCoins) package mochi.as3 { public class MochiCoins { public static const STORE_HIDE:String = "StoreHide"; public static const NO_USER:String = "NoUser"; public static const IO_ERROR:String = "IOError"; public static const ITEM_NEW:String = "ItemNew"; public static const ITEM_OWNED:String = "ItemOwned"; public static const STORE_ITEMS:String = "StoreItems"; public static const ERROR:String = "Error"; public static const STORE_SHOW:String = "StoreShow"; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public static var _inventory:MochiInventory; public function MochiCoins(){ super(); } public static function triggerEvent(eventType:String, args:Object):void{ _dispatcher.triggerEvent(eventType, args); } public static function removeEventListener(eventType:String, delegate:Function):void{ _dispatcher.removeEventListener(eventType, delegate); } public static function addEventListener(eventType:String, delegate:Function):void{ _dispatcher.addEventListener(eventType, delegate); } public static function getStoreItems():void{ MochiServices.send("coins_getStoreItems"); } public static function get inventory():MochiInventory{ return (_inventory); } public static function showStore(options:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("coins_showStore", {options:options}, null, null); } public static function requestFunding(properties:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_requestFunding", properties); } public static function showItem(options:Object=null):void{ if (((!(options)) || (!((typeof(options.item) == "string"))))){ trace("ERROR: showItem call must pass an Object with an item key"); return; }; MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("coins_showItem", {options:options}, null, null); } public static function getVersion():String{ return (MochiServices.getVersion()); } public static function showVideo(options:Object=null):void{ if (((!(options)) || (!((typeof(options.item) == "string"))))){ trace("ERROR: showVideo call must pass an Object with an item key"); return; }; MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("coins_showVideo", {options:options}, null, null); } addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{ _inventory = new MochiInventory(); }); addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{ _inventory = null; }); } }//package mochi.as3
Section 48
//MochiDigits (mochi.as3.MochiDigits) package mochi.as3 { public final class MochiDigits { private var Sibling:MochiDigits; private var Fragment:Number; private var Encoder:Number; public function MochiDigits(digit:Number=0, index:uint=0):void{ super(); Encoder = 0; setValue(digit, index); } public function reencode():void{ var newEncode:uint = int((2147483647 * Math.random())); Fragment = (Fragment ^ (newEncode ^ Encoder)); Encoder = newEncode; } public function set value(v:Number):void{ setValue(v); } public function toString():String{ var s:String = String.fromCharCode((Fragment ^ Encoder)); if (Sibling != null){ s = (s + Sibling.toString()); }; return (s); } public function setValue(digit:Number=0, index:uint=0):void{ var s:String = digit.toString(); var _temp1 = index; index = (index + 1); Fragment = (s.charCodeAt(_temp1) ^ Encoder); if (index < s.length){ Sibling = new MochiDigits(digit, index); } else { Sibling = null; }; reencode(); } public function get value():Number{ return (Number(this.toString())); } public function addValue(inc:Number):void{ value = (value + inc); } } }//package mochi.as3
Section 49
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher) package mochi.as3 { public class MochiEventDispatcher { private var eventTable:Object; public function MochiEventDispatcher():void{ super(); eventTable = {}; } public function triggerEvent(event:String, args:Object):void{ var i:Object; if (eventTable[event] == undefined){ return; }; for (i in eventTable[event]) { var _local6 = eventTable[event]; _local6[i](args); }; } public function removeEventListener(event:String, delegate:Function):void{ var s:Object; if (eventTable[event] == undefined){ eventTable[event] = []; return; }; for (s in eventTable[event]) { if (eventTable[event][s] != delegate){ } else { eventTable[event].splice(Number(s), 1); }; }; } public function addEventListener(event:String, delegate:Function):void{ removeEventListener(event, delegate); eventTable[event].push(delegate); } } }//package mochi.as3
Section 50
//MochiEvents (mochi.as3.MochiEvents) package mochi.as3 { import flash.display.*; public class MochiEvents { public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL"; public static const FORMAT_LONG:String = "LongForm"; public static const ALIGN_BOTTOM:String = "ALIGN_B"; public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived"; public static const FORMAT_SHORT:String = "ShortForm"; public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR"; public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR"; public static const ALIGN_TOP:String = "ALIGN_T"; public static const ALIGN_LEFT:String = "ALIGN_L"; public static const ALIGN_RIGHT:String = "ALIGN_R"; public static const ALIGN_TOP_LEFT:String = "ALIGN_TL"; public static const ALIGN_CENTER:String = "ALIGN_C"; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); private static var gameStart:Number; private static var levelStart:Number; public function MochiEvents(){ super(); } public static function endPlay():void{ MochiServices.send("events_clearRoundID", null, null, null); } public static function addEventListener(eventType:String, delegate:Function):void{ _dispatcher.addEventListener(eventType, delegate); } public static function trackEvent(tag:String, value=null):void{ MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null); } public static function removeEventListener(eventType:String, delegate:Function):void{ _dispatcher.removeEventListener(eventType, delegate); } public static function startSession(achievementID:String):void{ MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null); } public static function triggerEvent(eventType:String, args:Object):void{ _dispatcher.triggerEvent(eventType, args); } public static function setNotifications(clip:MovieClip, style:Object):void{ var s:Object; var args:Object = {}; for (s in style) { args[s] = style[s]; }; args.clip = clip; MochiServices.send("events_setNotifications", args, null, null); } public static function getVersion():String{ return (MochiServices.getVersion()); } public static function startPlay(tag:String="gameplay"):void{ MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null); } } }//package mochi.as3
Section 51
//MochiInventory (mochi.as3.MochiInventory) package mochi.as3 { import flash.events.*; import flash.utils.*; public dynamic class MochiInventory extends Proxy { private var _timer:Timer; private var _names:Array; private var _syncID:Number; private var _consumableProperties:Object; private var _storeSync:Object; private var _outstandingID:Number; private var _syncPending:Boolean; public static const READY:String = "InvReady"; public static const ERROR:String = "Error"; public static const IO_ERROR:String = "IoError"; private static const KEY_SALT:String = " syncMaint"; public static const WRITTEN:String = "InvWritten"; public static const NOT_READY:String = "InvNotReady"; public static const VALUE_ERROR:String = "InvValueError"; private static const CONSUMER_KEY:String = "MochiConsumables"; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public function MochiInventory():void{ super(); MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned); MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems); MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn); MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut); _storeSync = new Object(); _syncPending = false; _outstandingID = 0; _syncID = 0; _timer = new Timer(1000); _timer.addEventListener(TimerEvent.TIMER, sync); _timer.start(); if (MochiSocial.loggedIn){ loggedIn(); } else { loggedOut(); }; } private function newItems(event:Object):void{ if (!this[(event.id + KEY_SALT)]){ this[(event.id + KEY_SALT)] = 0; }; if (!this[event.id]){ this[event.id] = 0; }; this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count); this[event.id] = (this[event.id] + event.count); if (((event.privateProperties) && (event.privateProperties.consumable))){ if (!this[event.privateProperties.tag]){ this[event.privateProperties.tag] = 0; }; this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count)); }; } public function release():void{ MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems); MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn); MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){ if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return (-1); }; if (_consumableProperties[name]){ return (MochiDigits(_consumableProperties[name]).value); }; return (undefined); } private function loggedIn(args:Object=null):void{ MochiUserData.get(CONSUMER_KEY, getConsumableBag); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{ if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return (false); }; if (_consumableProperties[name] == undefined){ return (false); }; return (true); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{ return (((index)>=_names.length) ? 0 : (index + 1)); } private function putConsumableBag(userData:MochiUserData):void{ _syncPending = false; if (userData.error){ triggerEvent(ERROR, {type:IO_ERROR, error:userData.error}); _outstandingID = -1; }; triggerEvent(WRITTEN, {}); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{ var d:MochiDigits; if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return; }; if (!(value is Number)){ triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value}); return; }; if (_consumableProperties[name]){ d = MochiDigits(_consumableProperties[name]); if (d.value == value){ return; }; d.value = value; } else { _names.push(name); _consumableProperties[name] = new MochiDigits(value); }; _syncID++; } private function itemOwned(event:Object):void{ _storeSync[event.id] = {properties:event.properties, count:event.count}; } private function sync(e:Event=null):void{ var key:String; if (((_syncPending) || ((_syncID == _outstandingID)))){ return; }; _outstandingID = _syncID; var output:Object = {}; for (key in _consumableProperties) { output[key] = MochiDigits(_consumableProperties[key]).value; }; MochiUserData.put(CONSUMER_KEY, output, putConsumableBag); _syncPending = true; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{ return (_names[(index - 1)]); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{ if (!_consumableProperties[name]){ return (false); }; _names.splice(_names.indexOf(name), 1); delete _consumableProperties[name]; return (true); } private function getConsumableBag(userData:MochiUserData):void{ var key:String; var unsynced:Number; if (userData.error){ triggerEvent(ERROR, {type:IO_ERROR, error:userData.error}); return; }; _consumableProperties = {}; _names = new Array(); if (userData.data){ for (key in userData.data) { _names.push(key); _consumableProperties[key] = new MochiDigits(userData.data[key]); }; }; for (key in _storeSync) { unsynced = _storeSync[key].count; if (_consumableProperties[(key + KEY_SALT)]){ unsynced = (unsynced - _consumableProperties[(key + KEY_SALT)].value); }; if (unsynced == 0){ } else { newItems({id:key, count:unsynced, properties:_storeSync[key].properties}); }; }; triggerEvent(READY, {}); } private function loggedOut(args:Object=null):void{ _consumableProperties = null; } public static function triggerEvent(eventType:String, args:Object):void{ _dispatcher.triggerEvent(eventType, args); } public static function removeEventListener(eventType:String, delegate:Function):void{ _dispatcher.removeEventListener(eventType, delegate); } public static function addEventListener(eventType:String, delegate:Function):void{ _dispatcher.addEventListener(eventType, delegate); } } }//package mochi.as3
Section 52
//MochiScores (mochi.as3.MochiScores) package mochi.as3 { import flash.display.*; import flash.text.*; public class MochiScores { private static var boardID:String; public static var onErrorHandler:Object; public static var onCloseHandler:Object; public function MochiScores(){ super(); } public static function showLeaderboard(options:Object=null):void{ var n:Number; var options = options; if (options != null){ delete options.clip; MochiServices.setContainer(); MochiServices.bringToTop(); if (options.name != null){ if ((options.name is TextField)){ if (options.name.text.length > 0){ options.name = options.name.text; }; }; }; if (options.score != null){ if ((options.score is TextField)){ if (options.score.text.length > 0){ options.score = options.score.text; }; } else { if ((options.score is MochiDigits)){ options.score = options.score.value; }; }; n = Number(options.score); if (isNaN(n)){ trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'")); } else { if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){ trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite")); } else { if (Math.floor(n) != n){ trace((("WARNING: Submitted score '" + options.score) + "' will be truncated")); }; options.score = n; }; }; }; if (options.onDisplay != null){ options.onDisplay(); } else { if (MochiServices.clip != null){ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; }; } else { options = {}; if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; if (options.onClose != null){ onCloseHandler = options.onClose; } else { onCloseHandler = function ():void{ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.play(); } else { trace("Warning: Container is not a MovieClip, cannot call default onClose."); }; }; }; if (options.onError != null){ onErrorHandler = options.onError; } else { onErrorHandler = null; }; if (options.boardID == null){ if (MochiScores.boardID != null){ options.boardID = MochiScores.boardID; }; }; MochiServices.warnID(options.boardID, true); trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal"); MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose); } public static function closeLeaderboard():void{ MochiServices.send("scores_closeLeaderboard"); } public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{ MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod); } public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{ MochiServices.send("scores_requestList", null, callbackObj, callbackMethod); } public static function scoresArrayToObjects(scores:Object):Object{ var i:Number; var j:Number; var o:Object; var row_obj:Object; var item:String; var param:String; var so:Object = {}; for (item in scores) { if (typeof(scores[item]) == "object"){ if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){ so[item] = []; o = scores[item]; j = 0; while (j < o.rows.length) { row_obj = {}; i = 0; while (i < o.cols.length) { row_obj[o.cols[i]] = o.rows[j][i]; i++; }; so[item].push(row_obj); j++; }; } else { so[item] = {}; for (param in scores[item]) { so[item][param] = scores[item][param]; }; }; } else { so[item] = scores[item]; }; }; return (so); } public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{ score = Number(score); if (isNaN(score)){ trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'")); } else { if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){ trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite")); } else { if (Math.floor(score) != score){ trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated")); }; score = Number(score); }; }; MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod); } public static function onClose(args:Object=null):void{ if (((((args) && ((args.error == true)))) && (onErrorHandler))){ if (args.errorCode == null){ args.errorCode = "IOError"; }; onErrorHandler(args.errorCode); MochiServices.doClose(); return; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(boardID:String):void{ MochiServices.warnID(boardID, true); MochiScores.boardID = boardID; MochiServices.send("scores_setBoardID", {boardID:boardID}); } } }//package mochi.as3
Section 53
//MochiServices (mochi.as3.MochiServices) package mochi.as3 { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.net.*; import flash.system.*; import flash.geom.*; public class MochiServices { public static const CONNECTED:String = "onConnected"; private static var _container:Object; private static var _connected:Boolean = false; private static var _queue:Array; private static var _swfVersion:String; private static var _preserved:Object; public static var netupAttempted:Boolean = false; private static var _sendChannel:LocalConnection; private static var _nextCallbackID:Number; private static var _clip:MovieClip; private static var _loader:Loader; private static var _id:String; private static var _services:String = "services.swf"; private static var _servURL:String = "http://www.mochiads.com/static/lib/services/"; public static var widget:Boolean = false; private static var _timer:Timer; private static var _sendChannelName:String; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); private static var _callbacks:Object; private static var _connecting:Boolean = false; private static var _mochiLocalConnection:MovieClip; private static var _listenChannelName:String = "__ms_"; public static var onError:Object; public static var netup:Boolean = true; private static var _mochiLC:String = "MochiLC.swf"; public function MochiServices(){ super(); } public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function get connected():Boolean{ return (_connected); } private static function onReceive(pkg:Object):void{ var methodName:String; var pkg = pkg; var cb:String = pkg.callbackID; var cblst:Object = _callbacks[cb]; if (!cblst){ return; }; var method:* = cblst.callbackMethod; methodName = ""; var obj:Object = cblst.callbackObject; if (((obj) && ((typeof(method) == "string")))){ methodName = method; if (obj[method] != null){ method = obj[method]; } else { trace((("Error: Method " + method) + " does not exist.")); }; }; if (method != undefined){ method.apply(obj, pkg.args); //unresolved jump var _slot1 = error; trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString())); } else { if (obj != null){ obj(pkg.args); //unresolved jump var _slot1 = error; trace(("Error invoking method on object: " + _slot1.toString())); }; }; delete _callbacks[cb]; } public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{ if (_connected){ _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName)); handleError(args, callbackObject, callbackMethod); flush(true); return; }; _queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID}); }; if (_clip != null){ if (_callbacks != null){ _callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod}; _nextCallbackID++; }; }; } private static function init(id:String, clip:Object):void{ _id = id; if (clip != null){ _container = clip; loadCommunicator(id, _container); }; } private static function clickMovie(url:String, cb:Function):MovieClip{ var b:int; var loader:Loader; var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23]; var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3]; var footer:Array = [0, 64, 0, 0, 0]; var mc:MovieClip = new MovieClip(); var lc:LocalConnection = new LocalConnection(); var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time)); lc = new LocalConnection(); mc.lc = lc; mc.click = cb; lc.client = mc; lc.connect(lc_name); var ba:ByteArray = new ByteArray(); var cpool:ByteArray = new ByteArray(); cpool.endian = Endian.LITTLE_ENDIAN; cpool.writeShort(1); cpool.writeUTFBytes(((url + " ") + lc_name)); cpool.writeByte(0); var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4); var fileLength:uint = (actionLength + 35); ba.endian = Endian.LITTLE_ENDIAN; ba.writeUTFBytes("FWS"); ba.writeByte(8); ba.writeUnsignedInt(fileLength); for each (b in header) { ba.writeByte(b); }; ba.writeUnsignedInt(actionLength); ba.writeByte(136); ba.writeShort(cpool.length); ba.writeBytes(cpool); for each (b in avm1_bytecode) { ba.writeByte(b); }; for each (b in footer) { ba.writeByte(b); }; loader = new Loader(); loader.loadBytes(ba); mc.addChild(loader); return (mc); } private static function detach(event:Event):void{ var loader:LoaderInfo = LoaderInfo(event.target); loader.removeEventListener(Event.COMPLETE, detach); loader.removeEventListener(IOErrorEvent.IO_ERROR, detach); loader.removeEventListener(Event.COMPLETE, loadLCBridgeComplete); loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError); } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } private static function loadLCBridgeComplete(e:Event):void{ var loader:Loader = LoaderInfo(e.target).loader; _mochiLocalConnection = MovieClip(loader.content); listen(); } public static function disconnect():void{ if (((_connected) || (_connecting))){ if (_clip != null){ if (_clip.parent != null){ if ((_clip.parent is Sprite)){ Sprite(_clip.parent).removeChild(_clip); _clip = null; }; }; }; _connecting = (_connected = false); flush(true); _mochiLocalConnection.close(); //unresolved jump var _slot1 = error; }; if (_timer != null){ _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, connectWait); _timer = null; //unresolved jump var _slot1 = error; }; } public static function allowDomains(server:String):String{ var hostname:String; if (Security.sandboxType != "application"){ Security.allowDomain("*"); Security.allowInsecureDomain("*"); }; if (server.indexOf("http://") != -1){ hostname = server.split("/")[2].split(":")[0]; if (Security.sandboxType != "application"){ Security.allowDomain(hostname); Security.allowInsecureDomain(hostname); }; }; return (hostname); } public static function getVersion():String{ return ("3.9.1 as3"); } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); } public static function warnID(bid:String, leaderboard:Boolean):void{ bid = bid.toLowerCase(); if (bid.length != 16){ trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length")); return; } else { if (bid == "1e113c7239048b3f"){ if (leaderboard){ trace("WARNING: Using testing board ID"); } else { trace("WARNING: Using testing board ID as game ID"); }; return; } else { if (bid == "84993a1de4031cd8"){ if (leaderboard){ trace("WARNING: Using testing game ID as board ID"); } else { trace("WARNING: Using testing game ID"); }; return; }; }; }; var i:Number = 0; while (i < bid.length) { switch (bid.charAt(i)){ case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": case "a": case "b": case "c": case "d": case "e": case "f": break; default: trace(("WARNING: Board ID contains illegal characters: " + bid)); return; }; i++; }; } private static function flush(error:Boolean):void{ var request:Object; var callback:Object; if (((_clip) && (_queue))){ while (_queue.length > 0) { request = _queue.shift(); callback = null; if (request != null){ if (request.callbackID != null){ callback = _callbacks[request.callbackID]; }; delete _callbacks[request.callbackID]; if (((error) && (!((callback == null))))){ handleError(request.args, callback.callbackObject, callback.callbackMethod); }; }; }; }; } public static function get id():String{ return (_id); } private static function onEvent(pkg:Object):void{ var target:String = pkg.target; var event:String = pkg.event; switch (target){ case "services": MochiServices.triggerEvent(pkg.event, pkg.args); break; case "events": MochiEvents.triggerEvent(pkg.event, pkg.args); break; case "coins": MochiCoins.triggerEvent(pkg.event, pkg.args); break; case "social": MochiSocial.triggerEvent(pkg.event, pkg.args); break; }; } private static function urlOptions(clip:Object):Object{ var options:String; var pairs:Array; var i:Number; var kv:Array; var opts:Object = {}; if (clip.stage){ options = clip.stage.loaderInfo.parameters.mochiad_options; } else { options = clip.loaderInfo.parameters.mochiad_options; }; if (options){ pairs = options.split("&"); i = 0; while (i < pairs.length) { kv = pairs[i].split("="); opts[unescape(kv[0])] = unescape(kv[1]); i++; }; }; return (opts); } public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{ var avm1Click:DisplayObject; var x:String; var req:URLRequest; var loader:Loader; var setURL:Function; var err:Function; var complete:Function; var url = url; var burl = burl; var btn = btn; var onClick = onClick; var vars:Object = new Object(); vars["mav"] = getVersion(); vars["swfv"] = "9"; vars["swfurl"] = btn.loaderInfo.loaderURL; vars["fv"] = Capabilities.version; vars["os"] = Capabilities.os; vars["lang"] = Capabilities.language; vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY); var s = "?"; var i:Number = 0; for (x in vars) { if (i != 0){ s = (s + "&"); }; i = (i + 1); s = (((s + x) + "=") + escape(vars[x])); }; req = new URLRequest("http://link.mochiads.com/linkping.swf"); loader = new Loader(); setURL = function (url:String):void{ if (avm1Click){ btn.removeChild(avm1Click); }; avm1Click = clickMovie(url, onClick); var rect:Rectangle = btn.getBounds(btn); btn.addChild(avm1Click); avm1Click.x = rect.x; avm1Click.y = rect.y; avm1Click.scaleX = (0.01 * rect.width); avm1Click.scaleY = (0.01 * rect.height); }; err = function (ev:Object):void{ netup = false; ev.target.removeEventListener(ev.type, arguments.callee); setURL(burl); }; complete = function (ev:Object):void{ ev.target.removeEventListener(ev.type, arguments.callee); }; if (netup){ setURL((url + s)); } else { setURL(burl); }; if (!((netupAttempted) || (_connected))){ netupAttempted = true; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete); loader.load(req); }; } public static function setContainer(container:Object=null, doAdd:Boolean=true):void{ if (_clip.parent){ _clip.parent.removeChild(_clip); }; if (container != null){ if ((container is DisplayObjectContainer)){ _container = container; }; }; if (doAdd){ if ((_container is DisplayObjectContainer)){ DisplayObjectContainer(_container).addChild(_clip); }; }; } private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{ var args = args; var callbackObject = callbackObject; var callbackMethod = callbackMethod; if (args != null){ if (args.onError != null){ args.onError.apply(null, ["NotConnected"]); }; if (((!((args.options == null))) && (!((args.options.onError == null))))){ args.options.onError.apply(null, ["NotConnected"]); }; }; if (callbackMethod != null){ args = {}; args.error = true; args.errorCode = "NotConnected"; if (((!((callbackObject == null))) && ((callbackMethod is String)))){ var _local5 = callbackObject; _local5[callbackMethod](args); //unresolved jump var _slot1 = error; } else { if (callbackMethod != null){ callbackMethod.apply(args); //unresolved jump var _slot1 = error; }; }; }; } private static function loadError(ev:Object):void{ if (_clip != null){ _clip._mochiad_ctr_failed = true; }; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); } public static function get childClip():Object{ return (_clip); } private static function initComChannels():void{ if (!_connected){ trace("[SERVICES_API] connected!"); _connecting = false; _connected = true; _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL}); _clip.onReceive = onReceive; _clip.onEvent = onEvent; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; while (_queue.length > 0) { _mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift()); }; }; } public static function triggerEvent(eventType:String, args:Object):void{ _dispatcher.triggerEvent(eventType, args); } public static function removeEventListener(eventType:String, delegate:Function):void{ _dispatcher.removeEventListener(eventType, delegate); } private static function listen():void{ _mochiLocalConnection.connect(_listenChannelName); _clip.handshake = function (args:Object):void{ MochiServices.comChannelName = args.newChannel; }; trace("Waiting for MochiAds services to connect..."); } public static function addEventListener(eventType:String, delegate:Function):void{ _dispatcher.addEventListener(eventType, delegate); } private static function loadLCBridge(clip:Object):void{ var loader:Loader = new Loader(); var mochiLCURL:String = (_servURL + _mochiLC); var req:URLRequest = new URLRequest(mochiLCURL); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); loader.load(req); clip.addChild(loader); } public static function set comChannelName(val:String):void{ if (val != null){ if (val.length > 3){ _sendChannelName = (val + "_fromgame"); initComChannels(); }; }; } private static function loadCommunicator(id:String, clip:Object):MovieClip{ if (_clip != null){ return (_clip); }; if (!MochiServices.isNetworkAvailable()){ return (null); }; if (urlOptions(clip).servURL){ _servURL = urlOptions(clip).servURL; }; var servicesURL:String = (_servURL + _services); if (urlOptions(clip).servicesURL){ servicesURL = urlOptions(clip).servicesURL; }; _listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999)))); MochiServices.allowDomains(servicesURL); _clip = new MovieClip(); loadLCBridge(_clip); _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); var req:URLRequest = new URLRequest(servicesURL); var vars:URLVariables = new URLVariables(); vars.listenLC = _listenChannelName; vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options; vars.api_version = getVersion(); if (widget){ vars.widget = true; }; req.data = vars; _loader.load(req); _clip.addChild(_loader); _sendChannel = new LocalConnection(); _queue = []; _nextCallbackID = 0; _callbacks = {}; _timer = new Timer(10000, 1); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); return (_clip); } public static function get clip():Object{ return (_container); } public static function connect(id:String, clip:Object, onError:Object=null):void{ var id = id; var clip = clip; var onError = onError; warnID(id, false); if ((clip is DisplayObject)){ if (clip.stage == null){ trace("MochiServices connect requires the containing clip be attached to the stage"); }; if (((!(_connected)) && ((_clip == null)))){ trace("MochiServices Connecting..."); _connecting = true; init(id, clip); }; } else { trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage."); }; if (onError != null){ MochiServices.onError = onError; } else { if (MochiServices.onError == null){ MochiServices.onError = function (errorCode:String):void{ trace(errorCode); }; }; }; } public static function bringToTop(e:Event=null):void{ var e = e; if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){ if (MochiServices.clip.numChildren > 1){ MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1)); }; //unresolved jump var _slot1 = errorObject; trace("Warning: Depth sort error."); _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); }; } public static function connectWait(e:TimerEvent):void{ if (!_connected){ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load. (timeout)"); MochiServices.disconnect(); MochiServices.onError("IOError"); } else { _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, connectWait); _timer = null; }; } } }//package mochi.as3
Section 54
//MochiSocial (mochi.as3.MochiSocial) package mochi.as3 { public class MochiSocial { public static const LOGGED_IN:String = "LoggedIn"; public static const ACTION_CANCELED:String = "onCancel"; public static const PROPERTIES_SIZE:String = "PropertiesSize"; public static const IO_ERROR:String = "IOError"; public static const NO_USER:String = "NoUser"; public static const FRIEND_LIST:String = "FriendsList"; public static const PROFILE_DATA:String = "ProfileData"; public static const GAMEPLAY_DATA:String = "GameplayData"; public static const ACTION_COMPLETE:String = "onComplete"; public static const LOGIN_SHOW:String = "LoginShow"; public static const PROFILE_HIDE:String = "ProfileHide"; public static const USER_INFO:String = "UserInfo"; public static const PROPERTIES_SAVED:String = "PropertySaved"; public static const WIDGET_LOADED:String = "WidgetLoaded"; public static const ERROR:String = "Error"; public static const LOGGED_OUT:String = "LoggedOut"; public static const PROFILE_SHOW:String = "ProfileShow"; public static const LOGIN_HIDE:String = "LoginHide"; public static const LOGIN_SHOWN:String = "LoginShown"; public static var _user_info:Object = null; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public function MochiSocial(){ super(); } public static function requestFan(properties:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_requestFan", properties); } public static function postToStream(properties:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_postToStream", properties); } public static function getFriendsList(properties:Object=null):void{ MochiServices.send("social_getFriendsList", properties); } public static function requestLogin(properties:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_requestLogin", properties); } public static function getVersion():String{ return (MochiServices.getVersion()); } public static function saveUserProperties(properties:Object):void{ MochiServices.send("social_saveUserProperties", properties); } public static function triggerEvent(eventType:String, args:Object):void{ _dispatcher.triggerEvent(eventType, args); } public static function removeEventListener(eventType:String, delegate:Function):void{ _dispatcher.removeEventListener(eventType, delegate); } public static function inviteFriends(properties:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_inviteFriends", properties); } public static function get loggedIn():Boolean{ return (!((_user_info == null))); } public static function addEventListener(eventType:String, delegate:Function):void{ _dispatcher.addEventListener(eventType, delegate); } public static function showLoginWidget(options:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("social_showLoginWidget", {options:options}); } public static function getAPIURL():String{ if (!_user_info){ return (null); }; return (_user_info.api_url); } public static function hideLoginWidget():void{ MochiServices.send("social_hideLoginWidget"); } public static function getAPIToken():String{ if (!_user_info){ return (null); }; return (_user_info.api_token); } MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{ _user_info = args; }); MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{ _user_info = null; }); } }//package mochi.as3
Section 55
//MochiUserData (mochi.as3.MochiUserData) package mochi.as3 { import flash.events.*; import flash.utils.*; import flash.net.*; public class MochiUserData extends EventDispatcher { public var callback:Function;// = null public var operation:String;// = null public var error:Event;// = null public var data;// = null public var _loader:URLLoader; public var key:String;// = null public function MochiUserData(key:String="", callback:Function=null){ super(); this.key = key; this.callback = callback; } public function serialize(obj):ByteArray{ var arr:ByteArray = new ByteArray(); arr.objectEncoding = ObjectEncoding.AMF3; arr.writeObject(obj); arr.compress(); return (arr); } public function errorHandler(event:IOErrorEvent):void{ data = null; error = event; if (callback != null){ performCallback(); } else { dispatchEvent(event); }; close(); } public function putEvent(obj):void{ request("put", serialize(obj)); } public function deserialize(arr:ByteArray){ arr.objectEncoding = ObjectEncoding.AMF3; arr.uncompress(); return (arr.readObject()); } public function securityErrorHandler(event:SecurityErrorEvent):void{ errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString()))); } public function getEvent():void{ request("get", serialize(null)); } override public function toString():String{ return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]")); } public function performCallback():void{ callback(this); //unresolved jump var _slot1 = e; trace(("[MochiUserData] exception during callback: " + _slot1)); } public function request(_operation:String, _data:ByteArray):void{ var _operation = _operation; var _data = _data; operation = _operation; var api_url:String = MochiSocial.getAPIURL(); var api_token:String = MochiSocial.getAPIToken(); if ((((api_url == null)) || ((api_token == null)))){ errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in")); return; }; _loader = new URLLoader(); var args:URLVariables = new URLVariables(); args.op = _operation; args.key = key; var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString())); req.method = URLRequestMethod.POST; req.contentType = "application/x-mochi-userdata"; req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)]; req.data = _data; _loader.dataFormat = URLLoaderDataFormat.BINARY; _loader.addEventListener(Event.COMPLETE, completeHandler); _loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); _loader.load(req); //unresolved jump var _slot1 = e; errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString()))); } public function completeHandler(event:Event):void{ var event = event; if (_loader.data.length){ data = deserialize(_loader.data); } else { data = null; }; //unresolved jump var _slot1 = e; errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString()))); return; if (callback != null){ performCallback(); } else { dispatchEvent(event); }; close(); } public function close():void{ if (_loader){ _loader.removeEventListener(Event.COMPLETE, completeHandler); _loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); _loader.close(); _loader = null; }; error = null; callback = null; } public static function get(key:String, callback:Function):void{ var userData:MochiUserData = new MochiUserData(key, callback); userData.getEvent(); } public static function put(key:String, obj, callback:Function):void{ var userData:MochiUserData = new MochiUserData(key, callback); userData.putEvent(obj); } } }//package mochi.as3
Section 56
//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.3.0.4852"; 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 57
//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.3.0.4852"; 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 58
//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.3.0.4852"; 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 59
//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.3.0.4852"; 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 60
//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.3.0.4852"; 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 61
//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.3.0.4852"; 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 62
//FontAsset (mx.core.FontAsset) package mx.core { import flash.text.*; public class FontAsset extends Font implements IFlexAsset { mx_internal static const VERSION:String = "3.3.0.4852"; public function FontAsset(){ super(); } } }//package mx.core
Section 63
//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.core
Section 64
//IButton (mx.core.IButton) package mx.core { public interface IButton extends IUIComponent { function get emphasized():Boolean; function set emphasized(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void; function callLater(_arg1:Function, _arg2:Array=null):void; } }//package mx.core
Section 65
//IChildList (mx.core.IChildList) package mx.core { import flash.display.*; import flash.geom.*; public interface IChildList { function get numChildren():int; function removeChild(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function getChildByName(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject; function removeChildAt(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject; function getChildIndex(:DisplayObject):int; function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject; function getObjectsUnderPoint(child:Point):Array; function setChildIndex(_arg1:DisplayObject, _arg2:int):void; function getChildAt(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject; function addChild(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function contains(flash.display:DisplayObject):Boolean; } }//package mx.core
Section 66
//IContainer (mx.core.IContainer) package mx.core { import flash.display.*; import flash.geom.*; import mx.managers.*; import flash.media.*; 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(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:DisplayObject):Boolean; function get verticalScrollPosition():Number; function set defaultButton(mx.core:IContainer/mx.core:IContainer:graphics/get:IFlexDisplayObject):void; function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void; function set horizontalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void; function get focusManager():IFocusManager; function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void; function set mouseEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void; function getChildAt(Graphics:int):DisplayObject; function set soundTransform(mx.core:IContainer/mx.core:IContainer:graphics/get:SoundTransform):void; function get tabChildren():Boolean; function get tabIndex():int; function set focusRect(mx.core:IContainer/mx.core:IContainer:graphics/get:Object):void; function get hitArea():Sprite; function get mouseChildren():Boolean; function removeChildAt(Graphics:int):DisplayObject; function get defaultButton():IFlexDisplayObject; function stopDrag():void; function set tabEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void; function get horizontalScrollPosition():Number; function get focusRect():Object; function get viewMetrics():EdgeMetrics; function set verticalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void; function get dropTarget():DisplayObject; function get mouseEnabled():Boolean; function set tabChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void; function set buttonMode(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void; function get tabEnabled():Boolean; function get buttonMode():Boolean; function removeChild(Graphics:DisplayObject):DisplayObject; function set tabIndex(mx.core:IContainer/mx.core:IContainer:graphics/get:int):void; function addChild(Graphics:DisplayObject):DisplayObject; function areInaccessibleObjectsUnderPoint(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean; } }//package mx.core
Section 67
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 68
//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 69
//IFlexModuleFactory (mx.core.IFlexModuleFactory) package mx.core { public interface IFlexModuleFactory { function create(... _args):Object; function info():Object; } }//package mx.core
Section 70
//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 71
//IProgrammaticSkin (mx.core.IProgrammaticSkin) package mx.core { public interface IProgrammaticSkin { function validateNow():void; function validateDisplayList():void; } }//package mx.core
Section 72
//IRawChildrenContainer (mx.core.IRawChildrenContainer) package mx.core { public interface IRawChildrenContainer { function get rawChildren():IChildList; } }//package mx.core
Section 73
//IRectangularBorder (mx.core.IRectangularBorder) package mx.core { import flash.geom.*; public interface IRectangularBorder extends IBorder { function get backgroundImageBounds():Rectangle; function get hasBackgroundImage():Boolean; function set backgroundImageBounds(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void; function layoutBackgroundImage():void; } }//package mx.core
Section 74
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get isDocument():Boolean; function set repeaters(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function initializeRepeaterArrays(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 75
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup) package mx.core { import flash.events.*; public interface ISWFBridgeGroup { function getChildBridgeProvider(mx.core:ISWFBridgeGroup/mx.core:ISWFBridgeGroup:parentBridge/get:IEventDispatcher):ISWFBridgeProvider; function removeChildBridge(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void; function get parentBridge():IEventDispatcher; function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void; function set parentBridge(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void; function containsBridge(IEventDispatcher:IEventDispatcher):Boolean; function getChildBridges():Array; } }//package mx.core
Section 76
//ISWFBridgeProvider (mx.core.ISWFBridgeProvider) package mx.core { import flash.events.*; public interface ISWFBridgeProvider { function get childAllowsParent():Boolean; function get swfBridge():IEventDispatcher; function get parentAllowsChild():Boolean; } }//package mx.core
Section 77
//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 78
//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.3.0.4852"; 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 79
//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 80
//Singleton (mx.core.Singleton) package mx.core { public class Singleton { mx_internal static const VERSION:String = "3.3.0.4852"; 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 81
//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.3.0.4852"; public function SoundAsset(){ super(); } } }//package mx.core
Section 82
//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.3.0.4852"; 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 83
//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 84
//ModuleEvent (mx.events.ModuleEvent) package mx.events { import flash.events.*; import mx.modules.*; public class ModuleEvent extends ProgressEvent { public var errorText:String; private var _module:IModuleInfo; public static const READY:String = "ready"; public static const ERROR:String = "error"; public static const PROGRESS:String = "progress"; mx_internal static const VERSION:String = "3.3.0.4852"; 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 85
//ResourceEvent (mx.events.ResourceEvent) package mx.events { import flash.events.*; public class ResourceEvent extends ProgressEvent { public var errorText:String; mx_internal static const VERSION:String = "3.3.0.4852"; 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 86
//StyleEvent (mx.events.StyleEvent) package mx.events { import flash.events.*; public class StyleEvent extends ProgressEvent { public var errorText:String; mx_internal static const VERSION:String = "3.3.0.4852"; 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 87
//RectangularDropShadow (mx.graphics.RectangularDropShadow) package mx.graphics { import flash.display.*; import mx.core.*; 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.3.0.4852"; 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 88
//IFocusManager (mx.managers.IFocusManager) package mx.managers { import flash.events.*; import flash.display.*; import mx.core.*; public interface IFocusManager { function get focusPane():Sprite; function getFocus():IFocusManagerComponent; function deactivate():void; function set defaultButton(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void; function set focusPane(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void; function set showFocusIndicator(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function moveFocus(_arg1:String, _arg2:DisplayObject=null):void; function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void; function removeSWFBridge(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IEventDispatcher):void; function get defaultButtonEnabled():Boolean; function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent; function get nextTabIndex():int; function get defaultButton():IButton; function get showFocusIndicator():Boolean; function setFocus(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function hideFocus():void; function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent; } }//package mx.managers
Section 89
//IFocusManagerComponent (mx.managers.IFocusManagerComponent) package mx.managers { public interface IFocusManagerComponent { function set focusEnabled(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void; function drawFocus(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void; function setFocus():void; function get focusEnabled():Boolean; function get tabEnabled():Boolean; function get tabIndex():int; function get mouseFocusEnabled():Boolean; } }//package mx.managers
Section 90
//IFocusManagerContainer (mx.managers.IFocusManagerContainer) package mx.managers { import flash.events.*; import flash.display.*; public interface IFocusManagerContainer extends IEventDispatcher { function set focusManager(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;IFocusManagerContainer.as:IFocusManager):void; function get focusManager():IFocusManager; function get systemManager():ISystemManager; function contains(mx.managers:DisplayObject):Boolean; } }//package mx.managers
Section 91
//ILayoutManager (mx.managers.ILayoutManager) package mx.managers { import flash.events.*; public interface ILayoutManager extends IEventDispatcher { function validateNow():void; function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void; function isInvalid():Boolean; function invalidateDisplayList(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function set usePhasedInstantiation(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void; function invalidateSize(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function get usePhasedInstantiation():Boolean; function invalidateProperties(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; } }//package mx.managers
Section 92
//ILayoutManagerClient (mx.managers.ILayoutManagerClient) package mx.managers { import flash.events.*; public interface ILayoutManagerClient extends IEventDispatcher { function get updateCompletePendingFlag():Boolean; function set updateCompletePendingFlag(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; function set initialized(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; function validateProperties():void; function validateDisplayList():void; function get nestLevel():int; function get initialized():Boolean; function get processedDescriptors():Boolean; function validateSize(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void; function set nestLevel(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void; function set processedDescriptors(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; } }//package mx.managers
Section 93
//ISystemManager (mx.managers.ISystemManager) package mx.managers { import flash.events.*; import flash.display.*; import mx.core.*; import flash.geom.*; import flash.text.*; public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory { function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void; function get toolTipChildren():IChildList; function useSWFBridge():Boolean; function isFontFaceEmbedded(flash.display:TextFormat):Boolean; function deployMouseShields(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Boolean):void; function get rawChildren():IChildList; function get topLevelSystemManager():ISystemManager; function dispatchEventFromSWFBridges(_arg1:Event, _arg2:IEventDispatcher=null, _arg3:Boolean=false, _arg4:Boolean=false):void; function getSandboxRoot():DisplayObject; function get swfBridgeGroup():ISWFBridgeGroup; function removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function addChildToSandboxRoot(_arg1:String, _arg2:DisplayObject):void; function get document():Object; function get focusPane():Sprite; function get loaderInfo():LoaderInfo; function addChildBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void; function getTopLevelRoot():DisplayObject; function removeChildBridge(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IEventDispatcher):void; function isDisplayObjectInABridgedApplication(flash.display:DisplayObject):Boolean; function get popUpChildren():IChildList; function get screen():Rectangle; function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void; function getDefinitionByName(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\managers;ISystemManager.as:String):Object; function activate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function deactivate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get cursorChildren():IChildList; function set document(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Object):void; function get embeddedFontList():Object; function set numModalWindows(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:int):void; function isTopLevel():Boolean; function isTopLevelRoot():Boolean; function get numModalWindows():int; function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get stage():Stage; function getVisibleApplicationRect(value:Rectangle=null):Rectangle; } }//package mx.managers
Section 94
//SystemManagerGlobals (mx.managers.SystemManagerGlobals) package mx.managers { public class SystemManagerGlobals { public static var topLevelSystemManagers:Array = []; public static var changingListenersInOtherSystemManagers:Boolean; public static var bootstrapLoaderInfoURL:String; public static var showMouseCursor:Boolean; public function SystemManagerGlobals(){ super(); } } }//package mx.managers
Section 95
//IModuleInfo (mx.modules.IModuleInfo) package mx.modules { import flash.events.*; import mx.core.*; import flash.utils.*; import flash.system.*; public interface IModuleInfo extends IEventDispatcher { function get ready():Boolean; function get loaded():Boolean; function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void; function release():void; function get error():Boolean; function get data():Object; function publish(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void; function get factory():IFlexModuleFactory; function set data(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:Object):void; function get url():String; function get setup():Boolean; function unload():void; } }//package mx.modules
Section 96
//ModuleManager (mx.modules.ModuleManager) package mx.modules { import mx.core.*; public class ModuleManager { mx_internal static const VERSION:String = "3.3.0.4852"; 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 flash.display.*; import mx.core.*; import flash.utils.*; import flash.system.*; import mx.events.*; import flash.net.*; class ModuleInfoProxy extends EventDispatcher implements IModuleInfo { private var _data:Object; private var info:ModuleInfo; private var referenced:Boolean;// = false private function ModuleInfoProxy(info:ModuleInfo){ super(); this.info = info; info.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true); info.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true); info.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true); info.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true); info.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true); } public function get loaded():Boolean{ return (info.loaded); } public function release():void{ if (referenced){ info.removeReference(); referenced = false; }; } public function get error():Boolean{ return (info.error); } public function get factory():IFlexModuleFactory{ return (info.factory); } public function publish(factory:IFlexModuleFactory):void{ info.publish(factory); } public function set data(value:Object):void{ _data = value; } public function get ready():Boolean{ return (info.ready); } public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{ var moduleEvent:ModuleEvent; info.resurrect(); if (!referenced){ info.addReference(); referenced = true; }; if (info.error){ dispatchEvent(new ModuleEvent(ModuleEvent.ERROR)); } else { if (info.loaded){ if (info.setup){ dispatchEvent(new ModuleEvent(ModuleEvent.SETUP)); if (info.ready){ moduleEvent = new ModuleEvent(ModuleEvent.PROGRESS); moduleEvent.bytesLoaded = info.size; moduleEvent.bytesTotal = info.size; dispatchEvent(moduleEvent); dispatchEvent(new ModuleEvent(ModuleEvent.READY)); }; }; } else { info.load(applicationDomain, securityDomain, bytes); }; }; } private function moduleEventHandler(event:ModuleEvent):void{ dispatchEvent(event); } public function get url():String{ return (info.url); } public function get data():Object{ return (_data); } public function get setup():Boolean{ return (info.setup); } public function unload():void{ info.unload(); info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler); info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler); info.removeEventListener(ModuleEvent.READY, moduleEventHandler); info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler); info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler); } } class ModuleManagerImpl extends EventDispatcher { private var moduleList:Object; private function ModuleManagerImpl(){ moduleList = {}; super(); } public function getModule(url:String):IModuleInfo{ var info:ModuleInfo = (moduleList[url] as ModuleInfo); if (!info){ info = new ModuleInfo(url); moduleList[url] = info; }; return (new ModuleInfoProxy(info)); } public function getAssociatedFactory(object:Object):IFlexModuleFactory{ var m:Object; var info:ModuleInfo; var domain:ApplicationDomain; var cls:Class; var object = object; var className:String = getQualifiedClassName(object); for each (m in moduleList) { info = (m as ModuleInfo); if (!info.ready){ } else { domain = info.applicationDomain; cls = Class(domain.getDefinition(className)); if ((object is cls)){ return (info.factory); }; //unresolved jump var _slot1 = error; }; }; return (null); } } class ModuleInfo extends EventDispatcher { private var _error:Boolean;// = false private var loader:Loader; private var factoryInfo:FactoryInfo; private var limbo:Dictionary; private var _loaded:Boolean;// = false private var _ready:Boolean;// = false private var numReferences:int;// = 0 private var _url:String; private var _setup:Boolean;// = false private function ModuleInfo(url:String){ super(); _url = url; } private function clearLoader():void{ if (loader){ if (loader.contentLoaderInfo){ loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler); loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler); loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler); loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); }; if (loader.content){ loader.content.removeEventListener("ready", readyHandler); loader.content.removeEventListener("error", moduleErrorHandler); }; //unresolved jump var _slot1 = error; if (_loaded){ loader.close(); //unresolved jump var _slot1 = error; }; loader.unload(); //unresolved jump var _slot1 = error; loader = null; }; } public function get size():int{ return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0); } public function get loaded():Boolean{ return ((limbo) ? false : _loaded); } public function release():void{ if (((_ready) && (!(limbo)))){ limbo = new Dictionary(true); limbo[factoryInfo] = 1; factoryInfo = null; } else { unload(); }; } public function get error():Boolean{ return ((limbo) ? false : _error); } public function get factory():IFlexModuleFactory{ return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null); } public function completeHandler(event:Event):void{ var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable); moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded; moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal; dispatchEvent(moduleEvent); } public function publish(factory:IFlexModuleFactory):void{ if (factoryInfo){ return; }; if (_url.indexOf("published://") != 0){ return; }; factoryInfo = new FactoryInfo(); factoryInfo.factory = factory; _loaded = true; _setup = true; _ready = true; _error = false; dispatchEvent(new ModuleEvent(ModuleEvent.SETUP)); dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS)); dispatchEvent(new ModuleEvent(ModuleEvent.READY)); } public function initHandler(event:Event):void{ var moduleEvent:ModuleEvent; var event = event; factoryInfo = new FactoryInfo(); factoryInfo.factory = (loader.content as IFlexModuleFactory); //unresolved jump var _slot1 = error; if (!factoryInfo.factory){ moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable); moduleEvent.bytesLoaded = 0; moduleEvent.bytesTotal = 0; moduleEvent.errorText = "SWF is not a loadable module"; dispatchEvent(moduleEvent); return; }; loader.content.addEventListener("ready", readyHandler); loader.content.addEventListener("error", moduleErrorHandler); factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain; //unresolved jump var _slot1 = error; _setup = true; dispatchEvent(new ModuleEvent(ModuleEvent.SETUP)); } public function resurrect():void{ var f:Object; if (((!(factoryInfo)) && (limbo))){ for (f in limbo) { factoryInfo = (f as FactoryInfo); break; }; limbo = null; }; if (!factoryInfo){ if (_loaded){ dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD)); }; loader = null; _loaded = false; _setup = false; _ready = false; _error = false; }; } public function errorHandler(event:ErrorEvent):void{ _error = true; var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable); moduleEvent.bytesLoaded = 0; moduleEvent.bytesTotal = 0; moduleEvent.errorText = event.text; dispatchEvent(moduleEvent); } public function get ready():Boolean{ return ((limbo) ? false : _ready); } private function loadBytes(applicationDomain:ApplicationDomain, bytes:ByteArray):void{ var c:LoaderContext = new LoaderContext(); c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain); if (("allowLoadBytesCodeExecution" in c)){ c["allowLoadBytesCodeExecution"] = true; }; loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); loader.loadBytes(bytes, c); } public function removeReference():void{ numReferences--; if (numReferences == 0){ release(); }; } public function addReference():void{ numReferences++; } public function progressHandler(event:ProgressEvent):void{ var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable); moduleEvent.bytesLoaded = event.bytesLoaded; moduleEvent.bytesTotal = event.bytesTotal; dispatchEvent(moduleEvent); } public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{ if (_loaded){ return; }; _loaded = true; limbo = null; if (bytes){ loadBytes(applicationDomain, bytes); return; }; if (_url.indexOf("published://") == 0){ return; }; var r:URLRequest = new URLRequest(_url); var c:LoaderContext = new LoaderContext(); c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain); c.securityDomain = securityDomain; if ((((securityDomain == null)) && ((Security.sandboxType == Security.REMOTE)))){ c.securityDomain = SecurityDomain.currentDomain; }; loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); loader.load(r, c); } public function get url():String{ return (_url); } public function get applicationDomain():ApplicationDomain{ return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null); } public function moduleErrorHandler(event:Event):void{ var errorEvent:ModuleEvent; _ready = true; factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal; clearLoader(); if ((event is ModuleEvent)){ errorEvent = ModuleEvent(event); } else { errorEvent = new ModuleEvent(ModuleEvent.ERROR); }; dispatchEvent(errorEvent); } public function readyHandler(event:Event):void{ _ready = true; factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal; clearLoader(); dispatchEvent(new ModuleEvent(ModuleEvent.READY)); } public function get setup():Boolean{ return ((limbo) ? false : _setup); } public function unload():void{ clearLoader(); if (_loaded){ dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD)); }; limbo = null; factoryInfo = null; _loaded = false; _setup = false; _ready = false; _error = false; } } class FactoryInfo { public var bytesTotal:int;// = 0 public var factory:IFlexModuleFactory; public var applicationDomain:ApplicationDomain; private function FactoryInfo(){ super(); } }
Section 97
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals) package mx.modules { public class ModuleManagerGlobals { public static var managerSingleton:Object = null; public function ModuleManagerGlobals(){ super(); } } }//package mx.modules
Section 98
//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 99
//IResourceManager (mx.resources.IResourceManager) package mx.resources { import flash.events.*; import flash.system.*; public interface IResourceManager extends IEventDispatcher { function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher; function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean; function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class; function getLocales():Array; function removeResourceBundlesForLocale(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:String):void; function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle; function get localeChain():Array; function getInt(_arg1:String, _arg2:String, _arg3:String=null):int; function update():void; function set localeChain(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void; function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint; function addResourceBundle(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:IResourceBundle):void; function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array; function getBundleNamesForLocale(:String):Array; function removeResourceBundle(_arg1:String, _arg2:String):void; function getObject(_arg1:String, _arg2:String, _arg3:String=null); function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String; function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void; function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void; function getPreferredLocaleChain():Array; function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle; function initializeLocaleChain(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void; function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number; } }//package mx.resources
Section 100
//IResourceModule (mx.resources.IResourceModule) package mx.resources { public interface IResourceModule { function get resourceBundles():Array; } }//package mx.resources
Section 101
//LocaleSorter (mx.resources.LocaleSorter) package mx.resources { public class LocaleSorter { mx_internal static const VERSION:String = "3.3.0.4852"; public function LocaleSorter(){ super(); } private static function normalizeLocale(locale:String):String{ return (locale.toLowerCase().replace(/-/g, "_")); } public static function sortLocalesByPreference(appLocales:Array, systemPreferences:Array, ultimateFallbackLocale:String=null, addAll:Boolean=false):Array{ var result:Array; var hasLocale:Object; var i:int; var j:int; var k:int; var l:int; var locale:String; var plocale:LocaleID; var appLocales = appLocales; var systemPreferences = systemPreferences; var ultimateFallbackLocale = ultimateFallbackLocale; var addAll = addAll; var promote:Function = function (locale:String):void{ if (typeof(hasLocale[locale]) != "undefined"){ result.push(appLocales[hasLocale[locale]]); delete hasLocale[locale]; }; }; result = []; hasLocale = {}; var locales:Array = trimAndNormalize(appLocales); var preferenceLocales:Array = trimAndNormalize(systemPreferences); addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale); j = 0; while (j < locales.length) { hasLocale[locales[j]] = j; j = (j + 1); }; i = 0; l = preferenceLocales.length; while (i < l) { plocale = LocaleID.fromString(preferenceLocales[i]); promote(preferenceLocales[i]); promote(plocale.toString()); while (plocale.transformToParent()) { promote(plocale.toString()); }; plocale = LocaleID.fromString(preferenceLocales[i]); j = 0; while (j < l) { locale = preferenceLocales[j]; if (plocale.isSiblingOf(LocaleID.fromString(locale))){ promote(locale); }; j = (j + 1); }; j = 0; k = locales.length; while (j < k) { locale = locales[j]; if (plocale.isSiblingOf(LocaleID.fromString(locale))){ promote(locale); }; j = (j + 1); }; i = (i + 1); }; if (addAll){ j = 0; k = locales.length; while (j < k) { promote(locales[j]); j = (j + 1); }; }; return (result); } private static function addUltimateFallbackLocale(preferenceLocales:Array, ultimateFallbackLocale:String):void{ var locale:String; if (((!((ultimateFallbackLocale == null))) && (!((ultimateFallbackLocale == ""))))){ locale = normalizeLocale(ultimateFallbackLocale); if (preferenceLocales.indexOf(locale) == -1){ preferenceLocales.push(locale); }; }; } private static function trimAndNormalize(list:Array):Array{ var resultList:Array = []; var i:int; while (i < list.length) { resultList.push(normalizeLocale(list[i])); i++; }; return (resultList); } } }//package mx.resources class LocaleID { private var privateLangs:Boolean;// = false private var script:String;// = "" private var variants:Array; private var privates:Array; private var extensions:Object; private var lang:String;// = "" private var region:String;// = "" private var extended_langs:Array; public static const STATE_PRIMARY_LANGUAGE:int = 0; public static const STATE_REGION:int = 3; public static const STATE_EXTENDED_LANGUAGES:int = 1; public static const STATE_EXTENSIONS:int = 5; public static const STATE_SCRIPT:int = 2; public static const STATE_VARIANTS:int = 4; public static const STATE_PRIVATES:int = 6; private function LocaleID(){ extended_langs = []; variants = []; extensions = {}; privates = []; super(); } public function equals(locale:LocaleID):Boolean{ return ((toString() == locale.toString())); } public function canonicalize():void{ var i:String; for (i in extensions) { if (extensions.hasOwnProperty(i)){ if (extensions[i].length == 0){ delete extensions[i]; } else { extensions[i] = extensions[i].sort(); }; }; }; extended_langs = extended_langs.sort(); variants = variants.sort(); privates = privates.sort(); if (script == ""){ script = LocaleRegistry.getScriptByLang(lang); }; if ((((script == "")) && (!((region == ""))))){ script = LocaleRegistry.getScriptByLangAndRegion(lang, region); }; if ((((region == "")) && (!((script == ""))))){ region = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script); }; } public function toString():String{ var i:String; var stack:Array = [lang]; Array.prototype.push.apply(stack, extended_langs); if (script != ""){ stack.push(script); }; if (region != ""){ stack.push(region); }; Array.prototype.push.apply(stack, variants); for (i in extensions) { if (extensions.hasOwnProperty(i)){ stack.push(i); Array.prototype.push.apply(stack, extensions[i]); }; }; if (privates.length > 0){ stack.push("x"); Array.prototype.push.apply(stack, privates); }; return (stack.join("_")); } public function isSiblingOf(other:LocaleID):Boolean{ return ((((lang == other.lang)) && ((script == other.script)))); } public function transformToParent():Boolean{ var i:String; var lastExtension:Array; var defaultRegion:String; if (privates.length > 0){ privates.splice((privates.length - 1), 1); return (true); }; var lastExtensionName:String; for (i in extensions) { if (extensions.hasOwnProperty(i)){ lastExtensionName = i; }; }; if (lastExtensionName){ lastExtension = extensions[lastExtensionName]; if (lastExtension.length == 1){ delete extensions[lastExtensionName]; return (true); }; lastExtension.splice((lastExtension.length - 1), 1); return (true); }; if (variants.length > 0){ variants.splice((variants.length - 1), 1); return (true); }; if (script != ""){ if (LocaleRegistry.getScriptByLang(lang) != ""){ script = ""; return (true); }; if (region == ""){ defaultRegion = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script); if (defaultRegion != ""){ region = defaultRegion; script = ""; return (true); }; }; }; if (region != ""){ if (!(((script == "")) && ((LocaleRegistry.getScriptByLang(lang) == "")))){ region = ""; return (true); }; }; if (extended_langs.length > 0){ extended_langs.splice((extended_langs.length - 1), 1); return (true); }; return (false); } public static function fromString(str:String):LocaleID{ var last_extension:Array; var subtag:String; var subtag_length:int; var firstChar:String; var localeID:LocaleID = new (LocaleID); var state:int = STATE_PRIMARY_LANGUAGE; var subtags:Array = str.replace(/-/g, "_").split("_"); var i:int; var l:int = subtags.length; while (i < l) { subtag = subtags[i].toLowerCase(); if (state == STATE_PRIMARY_LANGUAGE){ if (subtag == "x"){ localeID.privateLangs = true; } else { if (subtag == "i"){ localeID.lang = (localeID.lang + "i-"); } else { localeID.lang = (localeID.lang + subtag); state = STATE_EXTENDED_LANGUAGES; }; }; } else { subtag_length = subtag.length; if (subtag_length == 0){ } else { firstChar = subtag.charAt(0).toLowerCase(); if ((((state <= STATE_EXTENDED_LANGUAGES)) && ((subtag_length == 3)))){ localeID.extended_langs.push(subtag); if (localeID.extended_langs.length == 3){ state = STATE_SCRIPT; }; } else { if ((((state <= STATE_SCRIPT)) && ((subtag_length == 4)))){ localeID.script = subtag; state = STATE_REGION; } else { if ((((state <= STATE_REGION)) && ((((subtag_length == 2)) || ((subtag_length == 3)))))){ localeID.region = subtag; state = STATE_VARIANTS; } else { if ((((state <= STATE_VARIANTS)) && ((((((((firstChar >= "a")) && ((firstChar <= "z")))) && ((subtag_length >= 5)))) || ((((((firstChar >= "0")) && ((firstChar <= "9")))) && ((subtag_length >= 4)))))))){ localeID.variants.push(subtag); state = STATE_VARIANTS; } else { if ((((state < STATE_PRIVATES)) && ((subtag_length == 1)))){ if (subtag == "x"){ state = STATE_PRIVATES; last_extension = localeID.privates; } else { state = STATE_EXTENSIONS; last_extension = ((localeID.extensions[subtag]) || ([])); localeID.extensions[subtag] = last_extension; }; } else { if (state >= STATE_EXTENSIONS){ last_extension.push(subtag); }; }; }; }; }; }; }; }; i++; }; localeID.canonicalize(); return (localeID); } } class LocaleRegistry { private static const SCRIPT_ID_BY_LANG:Object = {ab:5, af:1, am:2, ar:3, as:4, ay:1, be:5, bg:5, bn:4, bs:1, ca:1, ch:1, cs:1, cy:1, da:1, de:1, dv:6, dz:7, el:8, en:1, eo:1, es:1, et:1, eu:1, fa:3, fi:1, fj:1, fo:1, fr:1, frr:1, fy:1, ga:1, gl:1, gn:1, gu:9, gv:1, he:10, hi:11, hr:1, ht:1, hu:1, hy:12, id:1, in:1, is:1, it:1, iw:10, ja:13, ka:14, kk:5, kl:1, km:15, kn:16, ko:17, la:1, lb:1, ln:1, lo:18, lt:1, lv:1, mg:1, mh:1, mk:5, ml:19, mo:1, mr:11, ms:1, mt:1, my:20, na:1, nb:1, nd:1, ne:11, nl:1, nn:1, no:1, nr:1, ny:1, om:1, or:21, pa:22, pl:1, ps:3, pt:1, qu:1, rn:1, ro:1, ru:5, rw:1, sg:1, si:23, sk:1, sl:1, sm:1, so:1, sq:1, ss:1, st:1, sv:1, sw:1, ta:24, te:25, th:26, ti:2, tl:1, tn:1, to:1, tr:1, ts:1, uk:5, ur:3, ve:1, vi:1, wo:1, xh:1, yi:10, zu:1, cpe:1, dsb:1, frs:1, gsw:1, hsb:1, kok:11, mai:11, men:1, nds:1, niu:1, nqo:27, nso:1, son:1, tem:1, tkl:1, tmh:1, tpi:1, tvl:1, zbl:28}; private static const SCRIPTS:Array = ["", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"]; private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object = {bg:{5:"bg"}, ca:{1:"es"}, zh:{30:"tw", 29:"cn"}, cs:{1:"cz"}, da:{1:"dk"}, de:{1:"de"}, el:{8:"gr"}, en:{1:"us"}, es:{1:"es"}, fi:{1:"fi"}, fr:{1:"fr"}, he:{10:"il"}, hu:{1:"hu"}, is:{1:"is"}, it:{1:"it"}, ja:{13:"jp"}, ko:{17:"kr"}, nl:{1:"nl"}, nb:{1:"no"}, pl:{1:"pl"}, pt:{1:"br"}, ro:{1:"ro"}, ru:{5:"ru"}, hr:{1:"hr"}, sk:{1:"sk"}, sq:{1:"al"}, sv:{1:"se"}, th:{26:"th"}, tr:{1:"tr"}, ur:{3:"pk"}, id:{1:"id"}, uk:{5:"ua"}, be:{5:"by"}, sl:{1:"si"}, et:{1:"ee"}, lv:{1:"lv"}, lt:{1:"lt"}, fa:{3:"ir"}, vi:{1:"vn"}, hy:{12:"am"}, az:{1:"az", 5:"az"}, eu:{1:"es"}, mk:{5:"mk"}, af:{1:"za"}, ka:{14:"ge"}, fo:{1:"fo"}, hi:{11:"in"}, ms:{1:"my"}, kk:{5:"kz"}, ky:{5:"kg"}, sw:{1:"ke"}, uz:{1:"uz", 5:"uz"}, tt:{5:"ru"}, pa:{22:"in"}, gu:{9:"in"}, ta:{24:"in"}, te:{25:"in"}, kn:{16:"in"}, mr:{11:"in"}, sa:{11:"in"}, mn:{5:"mn"}, gl:{1:"es"}, kok:{11:"in"}, syr:{32:"sy"}, dv:{6:"mv"}, nn:{1:"no"}, sr:{1:"cs", 5:"cs"}, cy:{1:"gb"}, mi:{1:"nz"}, mt:{1:"mt"}, quz:{1:"bo"}, tn:{1:"za"}, xh:{1:"za"}, zu:{1:"za"}, nso:{1:"za"}, se:{1:"no"}, smj:{1:"no"}, sma:{1:"no"}, sms:{1:"fi"}, smn:{1:"fi"}, bs:{1:"ba"}}; private static const SCRIPT_BY_ID:Object = {latn:1, ethi:2, arab:3, beng:4, cyrl:5, thaa:6, tibt:7, grek:8, gujr:9, hebr:10, deva:11, armn:12, jpan:13, geor:14, khmr:15, knda:16, kore:17, laoo:18, mlym:19, mymr:20, orya:21, guru:22, sinh:23, taml:24, telu:25, thai:26, nkoo:27, blis:28, hans:29, hant:30, mong:31, syrc:32}; private static const SCRIPT_ID_BY_LANG_AND_REGION:Object = {zh:{cn:29, sg:29, tw:30, hk:30, mo:30}, mn:{cn:31, sg:5}, pa:{pk:3, in:22}, ha:{gh:1, ne:1}}; private function LocaleRegistry(){ super(); } public static function getScriptByLangAndRegion(lang:String, region:String):String{ var langRegions:Object = SCRIPT_ID_BY_LANG_AND_REGION[lang]; if (langRegions == null){ return (""); }; var scriptID:Object = langRegions[region]; if (scriptID == null){ return (""); }; return (SCRIPTS[int(scriptID)].toLowerCase()); } public static function getScriptByLang(lang:String):String{ var scriptID:Object = SCRIPT_ID_BY_LANG[lang]; if (scriptID == null){ return (""); }; return (SCRIPTS[int(scriptID)].toLowerCase()); } public static function getDefaultRegionForLangAndScript(lang:String, script:String):String{ var langObj:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[lang]; var scriptID:Object = SCRIPT_BY_ID[script]; if ((((langObj == null)) || ((scriptID == null)))){ return (""); }; return (((langObj[int(scriptID)]) || (""))); } }
Section 102
//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.3.0.4852"; 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 103
//ResourceManager (mx.resources.ResourceManager) package mx.resources { import mx.core.*; public class ResourceManager { mx_internal static const VERSION:String = "3.3.0.4852"; private static var implClassDependency:ResourceManagerImpl; private static var instance:IResourceManager; public function ResourceManager(){ super(); } public static function getInstance():IResourceManager{ if (!instance){ instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager")); //unresolved jump var _slot1 = e; instance = new ResourceManagerImpl(); }; return (instance); } } }//package mx.resources
Section 104
//ResourceManagerImpl (mx.resources.ResourceManagerImpl) package mx.resources { import flash.events.*; import mx.core.*; import flash.utils.*; import flash.system.*; import mx.modules.*; import mx.events.*; 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.3.0.4852"; private static var instance:IResourceManager; public function ResourceManagerImpl(){ localeMap = {}; resourceModules = {}; super(); } public function get localeChain():Array{ return (_localeChain); } public function set localeChain(value:Array):void{ _localeChain = value; update(); } public function getStringArray(bundleName:String, resourceName:String, locale:String=null):Array{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (null); }; var value:* = resourceBundle.content[resourceName]; var array:Array = String(value).split(","); var n:int = array.length; var i:int; while (i < n) { array[i] = StringUtil.trim(array[i]); i++; }; return (array); } mx_internal function installCompiledResourceBundle(applicationDomain:ApplicationDomain, locale:String, bundleName:String):void{ var packageName:String; var localName:String = bundleName; var colonIndex:int = bundleName.indexOf(":"); if (colonIndex != -1){ packageName = bundleName.substring(0, colonIndex); localName = bundleName.substring((colonIndex + 1)); }; if (getResourceBundle(locale, bundleName)){ return; }; var resourceBundleClassName = (((locale + "$") + localName) + "_properties"); if (packageName != null){ resourceBundleClassName = ((packageName + ".") + resourceBundleClassName); }; var bundleClass:Class; if (applicationDomain.hasDefinition(resourceBundleClassName)){ bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName)); }; if (!bundleClass){ resourceBundleClassName = bundleName; if (applicationDomain.hasDefinition(resourceBundleClassName)){ bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName)); }; }; if (!bundleClass){ resourceBundleClassName = (bundleName + "_properties"); if (applicationDomain.hasDefinition(resourceBundleClassName)){ bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName)); }; }; if (!bundleClass){ throw (new Error((((("Could not find compiled resource bundle '" + bundleName) + "' for locale '") + locale) + "'."))); }; var resourceBundle:ResourceBundle = ResourceBundle(new (bundleClass)); resourceBundle.mx_internal::_locale = locale; resourceBundle.mx_internal::_bundleName = bundleName; addResourceBundle(resourceBundle); } public function getString(bundleName:String, resourceName:String, parameters:Array=null, locale:String=null):String{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (null); }; var value:String = String(resourceBundle.content[resourceName]); if (parameters){ value = StringUtil.substitute(value, parameters); }; return (value); } public function loadResourceModule(url:String, updateFlag:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{ var moduleInfo:IModuleInfo; var resourceEventDispatcher:ResourceEventDispatcher; var timer:Timer; var timerHandler:Function; var url = url; var updateFlag = updateFlag; var applicationDomain = applicationDomain; var securityDomain = securityDomain; moduleInfo = ModuleManager.getModule(url); resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo); var readyHandler:Function = function (event:ModuleEvent):void{ var resourceModule:* = event.module.factory.create(); resourceModules[event.module.url].resourceModule = resourceModule; if (updateFlag){ update(); }; }; moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true); var errorHandler:Function = function (event:ModuleEvent):void{ var resourceEvent:ResourceEvent; var message:String = ("Unable to load resource module from " + url); if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){ resourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable); resourceEvent.bytesLoaded = 0; resourceEvent.bytesTotal = 0; resourceEvent.errorText = message; resourceEventDispatcher.dispatchEvent(resourceEvent); } else { throw (new Error(message)); }; }; moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true); resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler); timer = new Timer(0); timerHandler = function (event:TimerEvent):void{ timer.removeEventListener(TimerEvent.TIMER, timerHandler); timer.stop(); moduleInfo.load(applicationDomain, securityDomain); }; timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true); timer.start(); return (resourceEventDispatcher); } public function getLocales():Array{ var p:String; var locales:Array = []; for (p in localeMap) { locales.push(p); }; return (locales); } public function removeResourceBundlesForLocale(locale:String):void{ delete localeMap[locale]; } public function getResourceBundle(locale:String, bundleName:String):IResourceBundle{ var bundleMap:Object = localeMap[locale]; if (!bundleMap){ return (null); }; return (bundleMap[bundleName]); } private function dumpResourceModule(resourceModule):void{ var bundle:ResourceBundle; var p:String; for each (bundle in resourceModule.resourceBundles) { trace(bundle.locale, bundle.bundleName); for (p in bundle.content) { }; }; } public function addResourceBundle(resourceBundle:IResourceBundle):void{ var locale:String = resourceBundle.locale; var bundleName:String = resourceBundle.bundleName; if (!localeMap[locale]){ localeMap[locale] = {}; }; localeMap[locale][bundleName] = resourceBundle; } public function getObject(bundleName:String, resourceName:String, locale:String=null){ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (undefined); }; return (resourceBundle.content[resourceName]); } public function getInt(bundleName:String, resourceName:String, locale:String=null):int{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (0); }; var value:* = resourceBundle.content[resourceName]; return (int(value)); } private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{ supportNonFrameworkApps(); return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, resourceName)); } private function supportNonFrameworkApps():void{ if (initializedForNonFrameworkApp){ return; }; initializedForNonFrameworkApp = true; if (getLocales().length > 0){ return; }; var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain; if (!applicationDomain.hasDefinition("_CompiledResourceBundleInfo")){ return; }; var c:Class = Class(applicationDomain.getDefinition("_CompiledResourceBundleInfo")); var locales:Array = c.compiledLocales; var bundleNames:Array = c.compiledResourceBundleNames; installCompiledResourceBundles(applicationDomain, locales, bundleNames); localeChain = locales; } public function getBundleNamesForLocale(locale:String):Array{ var p:String; var bundleNames:Array = []; for (p in localeMap[locale]) { bundleNames.push(p); }; return (bundleNames); } public function getPreferredLocaleChain():Array{ return (LocaleSorter.sortLocalesByPreference(getLocales(), getSystemPreferredLocales(), null, true)); } public function getNumber(bundleName:String, resourceName:String, locale:String=null):Number{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (NaN); }; var value:* = resourceBundle.content[resourceName]; return (Number(value)); } public function update():void{ dispatchEvent(new Event(Event.CHANGE)); } public function getClass(bundleName:String, resourceName:String, locale:String=null):Class{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (null); }; var value:* = resourceBundle.content[resourceName]; return ((value as Class)); } public function removeResourceBundle(locale:String, bundleName:String):void{ delete localeMap[locale][bundleName]; if (getBundleNamesForLocale(locale).length == 0){ delete localeMap[locale]; }; } public function initializeLocaleChain(compiledLocales:Array):void{ localeChain = LocaleSorter.sortLocalesByPreference(compiledLocales, getSystemPreferredLocales(), null, true); } public function findResourceBundleWithResource(bundleName:String, resourceName:String):IResourceBundle{ var locale:String; var bundleMap:Object; var bundle:ResourceBundle; if (!_localeChain){ return (null); }; var n:int = _localeChain.length; var i:int; while (i < n) { locale = localeChain[i]; bundleMap = localeMap[locale]; if (!bundleMap){ } else { bundle = bundleMap[bundleName]; if (!bundle){ } else { if ((resourceName in bundle.content)){ return (bundle); }; }; }; i++; }; return (null); } public function getUint(bundleName:String, resourceName:String, locale:String=null):uint{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (0); }; var value:* = resourceBundle.content[resourceName]; return (uint(value)); } private function getSystemPreferredLocales():Array{ var systemPreferences:Array; if (Capabilities["languages"]){ systemPreferences = Capabilities["languages"]; } else { systemPreferences = [Capabilities.language]; }; return (systemPreferences); } public function installCompiledResourceBundles(applicationDomain:ApplicationDomain, locales:Array, bundleNames:Array):void{ var locale:String; var j:int; var bundleName:String; var n:int = (locales) ? locales.length : 0; var m:int = (bundleNames) ? bundleNames.length : 0; var i:int; while (i < n) { locale = locales[i]; j = 0; while (j < m) { bundleName = bundleNames[j]; mx_internal::installCompiledResourceBundle(applicationDomain, locale, bundleName); j++; }; i++; }; } public function getBoolean(bundleName:String, resourceName:String, locale:String=null):Boolean{ var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale); if (!resourceBundle){ return (false); }; var value:* = resourceBundle.content[resourceName]; return ((String(value).toLowerCase() == "true")); } public function unloadResourceModule(url:String, update:Boolean=true):void{ throw (new Error("unloadResourceModule() is not yet implemented.")); } public static function getInstance():IResourceManager{ if (!instance){ instance = new (ResourceManagerImpl); }; return (instance); } } }//package mx.resources import flash.events.*; import mx.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 105
//HaloBorder (mx.skins.halo.HaloBorder) package mx.skins.halo { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.skins.*; import mx.graphics.*; 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.3.0.4852"; 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 106
//HaloFocusRect (mx.skins.halo.HaloFocusRect) package mx.skins.halo { 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.3.0.4852"; 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(); if (focusBlendMode){ 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 107
//Border (mx.skins.Border) package mx.skins { import mx.core.*; public class Border extends ProgrammaticSkin implements IBorder { mx_internal static const VERSION:String = "3.3.0.4852"; public function Border(){ super(); } public function get borderMetrics():EdgeMetrics{ return (EdgeMetrics.EMPTY); } } }//package mx.skins
Section 108
//ProgrammaticSkin (mx.skins.ProgrammaticSkin) package mx.skins { import flash.display.*; import mx.core.*; 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.3.0.4852"; private static var tempMatrix:Matrix = new Matrix(); public function ProgrammaticSkin(){ super(); _width = measuredWidth; _height = measuredHeight; } public function getStyle(styleProp:String){ return ((_styleName) ? _styleName.getStyle(styleProp) : null); } protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ } public function get nestLevel():int{ return (_nestLevel); } public function set nestLevel(value:int):void{ _nestLevel = value; invalidateDisplayList(); } override public function get height():Number{ return (_height); } public function get updateCompletePendingFlag():Boolean{ return (_updateCompletePendingFlag); } protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{ return (rotatedGradientMatrix(x, y, width, height, 90)); } public function validateSize(recursive:Boolean=false):void{ } public function invalidateDisplayList():void{ if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){ invalidateDisplayListFlag = true; UIComponentGlobals.layoutManager.invalidateDisplayList(this); }; } public function set updateCompletePendingFlag(value:Boolean):void{ _updateCompletePendingFlag = value; } protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{ return (rotatedGradientMatrix(x, y, width, height, 0)); } override public function set height(value:Number):void{ _height = value; invalidateDisplayList(); } public function set processedDescriptors(value:Boolean):void{ _processedDescriptors = value; } public function validateDisplayList():void{ invalidateDisplayListFlag = false; updateDisplayList(width, height); } public function get measuredWidth():Number{ return (0); } override public function set width(value:Number):void{ _width = value; invalidateDisplayList(); } public function get measuredHeight():Number{ return (0); } public function set initialized(value:Boolean):void{ _initialized = value; } protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object=null, color:Object=null, alpha:Object=null, gradientMatrix:Matrix=null, gradientType:String="linear", gradientRatios:Array=null, hole:Object=null):void{ var ellipseSize:Number; var alphas:Array; var holeR:Object; var g:Graphics = graphics; if ((((width == 0)) || ((height == 0)))){ return; }; if (color !== null){ if ((color is uint)){ g.beginFill(uint(color), Number(alpha)); } else { if ((color is Array)){ alphas = ((alpha is Array)) ? (alpha as Array) : [alpha, alpha]; if (!gradientRatios){ gradientRatios = [0, 0xFF]; }; g.beginGradientFill(gradientType, (color as Array), alphas, gradientRatios, gradientMatrix); }; }; }; if (!cornerRadius){ g.drawRect(x, y, width, height); } else { if ((cornerRadius is Number)){ ellipseSize = (Number(cornerRadius) * 2); g.drawRoundRect(x, y, width, height, ellipseSize, ellipseSize); } else { GraphicsUtil.drawRoundRectComplex(g, x, y, width, height, cornerRadius.tl, cornerRadius.tr, cornerRadius.bl, cornerRadius.br); }; }; if (hole){ holeR = hole.r; if ((holeR is Number)){ ellipseSize = (Number(holeR) * 2); g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize); } else { GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br); }; }; if (color !== null){ g.endFill(); }; } public function get processedDescriptors():Boolean{ return (_processedDescriptors); } public function set styleName(value:Object):void{ if (_styleName != value){ _styleName = (value as IStyleClient); invalidateDisplayList(); }; } public function setActualSize(newWidth:Number, newHeight:Number):void{ var changed:Boolean; if (_width != newWidth){ _width = newWidth; changed = true; }; if (_height != newHeight){ _height = newHeight; changed = true; }; if (changed){ invalidateDisplayList(); }; } public function styleChanged(styleProp:String):void{ invalidateDisplayList(); } override public function get width():Number{ return (_width); } public function invalidateProperties():void{ } public function get initialized():Boolean{ return (_initialized); } protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix{ tempMatrix.createGradientBox(width, height, ((rotation * Math.PI) / 180), x, y); return (tempMatrix); } public function move(x:Number, y:Number):void{ this.x = x; this.y = y; } public function get styleName():Object{ return (_styleName); } public function validateNow():void{ if (invalidateDisplayListFlag){ validateDisplayList(); }; } public function invalidateSize():void{ } public function validateProperties():void{ } } }//package mx.skins
Section 109
//RectangularBorder (mx.skins.RectangularBorder) package mx.skins { import flash.events.*; import flash.display.*; import mx.core.*; import flash.geom.*; import flash.utils.*; import mx.styles.*; import flash.system.*; import mx.resources.*; import flash.net.*; 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.3.0.4852"; 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 110
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration) package mx.styles { import flash.events.*; import flash.display.*; import mx.core.*; import flash.utils.*; import mx.managers.*; 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.3.0.4852"; 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 111
//ISimpleStyleClient (mx.styles.ISimpleStyleClient) package mx.styles { public interface ISimpleStyleClient { function set styleName(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void; function styleChanged(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void; function get styleName():Object; } }//package mx.styles
Section 112
//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 113
//IStyleManager (mx.styles.IStyleManager) package mx.styles { import flash.events.*; public interface IStyleManager { function isColorName(value:String):Boolean; function registerParentDisplayListInvalidatingStyle(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerInheritingStyle(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function set stylesRoot(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void; function get typeSelectorCache():Object; function styleDeclarationsChanged():void; function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void; function isParentDisplayListInvalidatingStyle(value:String):Boolean; function isSizeInvalidatingStyle(value:String):Boolean; function get inheritingStyles():Object; function isValidStyleValue(value):Boolean; function isParentSizeInvalidatingStyle(value:String):Boolean; function getColorName(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/set:Object):uint; function set typeSelectorCache(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void; function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void; function getColorNames(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Array):void; function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher; function isInheritingStyle(value:String):Boolean; function set inheritingStyles(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void; function get stylesRoot():Object; function initProtoChainRoots():void; function registerColorName(_arg1:String, _arg2:uint):void; function registerParentSizeInvalidatingStyle(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerSizeInvalidatingStyle(C:\autobuild\3.3.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void; function isInheritingTextFormatStyle(value:String):Boolean; function getStyleDeclaration(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/get:String):CSSStyleDeclaration; } }//package mx.styles
Section 114
//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 115
//IStyleModule (mx.styles.IStyleModule) package mx.styles { public interface IStyleModule { function unload():void; } }//package mx.styles
Section 116
//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.3.0.4852"; 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 117
//StyleManagerImpl (mx.styles.StyleManagerImpl) package mx.styles { import flash.events.*; import mx.core.*; import flash.utils.*; import flash.system.*; import mx.modules.*; import mx.events.*; import mx.resources.*; import mx.managers.*; 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.3.0.4852"; 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 118
//ColorUtil (mx.utils.ColorUtil) package mx.utils { public class ColorUtil { mx_internal static const VERSION:String = "3.3.0.4852"; 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 119
//GraphicsUtil (mx.utils.GraphicsUtil) package mx.utils { import flash.display.*; public class GraphicsUtil { mx_internal static const VERSION:String = "3.3.0.4852"; 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 120
//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.3.0.4852"; private static var counter:int = 0; public function NameUtil(){ super(); } public static function displayObjectToString(displayObject:DisplayObject):String{ var result:String; var o:DisplayObject; var s:String; var indices:Array; var displayObject = displayObject; o = displayObject; while (o != null) { if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){ break; }; s = o.name; if ((o is IRepeaterClient)){ indices = IRepeaterClient(o).instanceIndices; if (indices){ s = (s + (("[" + indices.join("][")) + "]")); }; }; result = ((result == null)) ? s : ((s + ".") + result); o = o.parent; }; //unresolved jump var _slot1 = e; return (result); } public static function createUniqueName(object:Object):String{ if (!object){ return (null); }; var name:String = getQualifiedClassName(object); var index:int = name.indexOf("::"); if (index != -1){ name = name.substr((index + 2)); }; var charCode:int = name.charCodeAt((name.length - 1)); if ((((charCode >= 48)) && ((charCode <= 57)))){ name = (name + "_"); }; return ((name + counter++)); } } }//package mx.utils
Section 121
//StringUtil (mx.utils.StringUtil) package mx.utils { public class StringUtil { mx_internal static const VERSION:String = "3.3.0.4852"; 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 122
//Stats (net.hires.debug.Stats) package net.hires.debug { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; import flash.system.*; import flash.text.*; public class Stats extends Sprite { protected const WIDTH:uint = 70; protected const HEIGHT:uint = 100; protected var timer:uint; protected var mem_max_graph:uint; protected var theme:Object; protected var mem:Number; protected var xml:XML; protected var graph:Bitmap; protected var mem_graph:uint; protected var fps:uint; protected var ms_prev:uint; protected var text:TextField; protected var rectangle:Rectangle; protected var style:StyleSheet; protected var ms:uint; protected var fps_graph:uint; protected var mem_max:Number; public function Stats(_theme:Object=null):void{ theme = {bg:51, fps:0xFFFF00, ms:0xFF00, mem:0xFFFF, memmax:0xFF0070}; super(); if (_theme){ if (_theme.bg != null){ theme.bg = _theme.bg; }; if (_theme.fps != null){ theme.fps = _theme.fps; }; if (_theme.ms != null){ theme.ms = _theme.ms; }; if (_theme.mem != null){ theme.mem = _theme.mem; }; if (_theme.memmax != null){ theme.memmax = _theme.memmax; }; }; mem_max = 0; xml = <xml><fps>FPS:</fps><ms>MS:</ms><mem>MEM:</mem><memMax>MAX:</memMax></xml> ; style = new StyleSheet(); style.setStyle("xml", {fontSize:"9px", fontFamily:"_sans", leading:"-2px"}); style.setStyle("fps", {color:hex2css(theme.fps)}); style.setStyle("ms", {color:hex2css(theme.ms)}); style.setStyle("mem", {color:hex2css(theme.mem)}); style.setStyle("memMax", {color:hex2css(theme.memmax)}); text = new TextField(); text.width = WIDTH; text.height = 50; text.styleSheet = style; text.condenseWhite = true; text.selectable = false; text.mouseEnabled = false; graph = new Bitmap(); graph.y = 50; rectangle = new Rectangle((WIDTH - 1), 0, 1, (HEIGHT - 50)); addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, destroy, false, 0, true); } private function destroy(e:Event):void{ graphics.clear(); while (numChildren > 0) { removeChildAt(0); }; graph.bitmapData.dispose(); removeEventListener(MouseEvent.CLICK, onClick); removeEventListener(Event.ENTER_FRAME, update); } private function onClick(e:MouseEvent):void{ if (((mouseY / height) > 0.5)){ stage.frameRate--; } else { stage.frameRate++; }; xml.fps = ((("FPS: " + fps) + " / ") + stage.frameRate); text.htmlText = xml; } private function init(e:Event):void{ graphics.beginFill(theme.bg); graphics.drawRect(0, 0, WIDTH, HEIGHT); graphics.endFill(); addChild(text); graph.bitmapData = new BitmapData(WIDTH, (HEIGHT - 50), false, theme.bg); addChild(graph); addEventListener(MouseEvent.CLICK, onClick); addEventListener(Event.ENTER_FRAME, update); } private function update(e:Event):void{ timer = getTimer(); if ((timer - 1000) > ms_prev){ ms_prev = timer; mem = Number((System.totalMemory * 9.54E-7).toFixed(3)); mem_max = ((mem_max > mem)) ? mem_max : mem; fps_graph = Math.min(graph.height, ((fps / stage.frameRate) * graph.height)); mem_graph = (Math.min(graph.height, Math.sqrt(Math.sqrt((mem * 5000)))) - 2); mem_max_graph = (Math.min(graph.height, Math.sqrt(Math.sqrt((mem_max * 5000)))) - 2); graph.bitmapData.scroll(-1, 0); graph.bitmapData.fillRect(rectangle, theme.bg); graph.bitmapData.setPixel((graph.width - 1), (graph.height - fps_graph), theme.fps); graph.bitmapData.setPixel((graph.width - 1), (graph.height - ((timer - ms) >> 1)), theme.ms); graph.bitmapData.setPixel((graph.width - 1), (graph.height - mem_graph), theme.mem); graph.bitmapData.setPixel((graph.width - 1), (graph.height - mem_max_graph), theme.memmax); xml.fps = ((("FPS: " + fps) + " / ") + stage.frameRate); xml.mem = ("MEM: " + mem); xml.memMax = ("MAX: " + mem_max); fps = 0; }; fps++; xml.ms = ("MS: " + (timer - ms)); ms = timer; text.htmlText = xml; } private function hex2css(color:int):String{ return (("#" + color.toString(16))); } } }//package net.hires.debug
Section 123
//IDispatcher (org.osflash.signals.IDispatcher) package org.osflash.signals { public interface IDispatcher { function dispatch(... _args):void; } }//package org.osflash.signals
Section 124
//ISignal (org.osflash.signals.ISignal) package org.osflash.signals { public interface ISignal { function add(org.osflash.signals:ISignal/org.osflash.signals:ISignal:valueClasses/get:Function):Function; function addOnce(org.osflash.signals:ISignal/org.osflash.signals:ISignal:valueClasses/get:Function):Function; function remove(org.osflash.signals:ISignal/org.osflash.signals:ISignal:valueClasses/get:Function):Function; function get valueClasses():Array; function get numListeners():uint; } }//package org.osflash.signals
Section 125
//Signal (org.osflash.signals.Signal) package org.osflash.signals { import flash.utils.*; import flash.errors.*; public class Signal implements ISignal, IDispatcher { protected var listenersNeedCloning:Boolean;// = false protected var onceListeners:Dictionary; protected var _valueClasses:Array; protected var listeners:Array; public function Signal(... _args){ super(); listeners = []; onceListeners = new Dictionary(); if ((((_args.length == 1)) && ((_args[0] is Array)))){ var valueClasses:Array = _args[0]; }; setValueClasses(_args); } public function add(listener:Function):Function{ registerListener(listener); return (listener); } public function addOnce(listener:Function):Function{ registerListener(listener, true); return (listener); } public function remove(listener:Function):Function{ var index:int = listeners.indexOf(listener); if (index == -1){ return (listener); }; if (listenersNeedCloning){ listeners = listeners.slice(); listenersNeedCloning = false; }; listeners.splice(index, 1); delete onceListeners[listener]; return (listener); } protected function registerListener(listener:Function, once:Boolean=false):void{ var argumentString:String; if (listener.length < _valueClasses.length){ argumentString = ((listener.length)==1) ? "argument" : "arguments"; throw (new ArgumentError((((((("Listener has " + listener.length) + " ") + argumentString) + " but it needs at least ") + _valueClasses.length) + " to match the given value classes."))); }; if (!listeners.length){ listeners[0] = listener; if (once){ onceListeners[listener] = true; }; return; }; if (listeners.indexOf(listener) >= 0){ if (((onceListeners[listener]) && (!(once)))){ throw (new IllegalOperationError("You cannot addOnce() then add() the same listener without removing the relationship first.")); }; if (((!(onceListeners[listener])) && (once))){ throw (new IllegalOperationError("You cannot add() then addOnce() the same listener without removing the relationship first.")); }; return; }; if (listenersNeedCloning){ listeners = listeners.slice(); listenersNeedCloning = false; }; listeners[listeners.length] = listener; if (once){ onceListeners[listener] = true; }; } protected function setValueClasses(valueClasses:Array):void{ _valueClasses = ((valueClasses) || ([])); var i:int = _valueClasses.length; while (i--) { if (!(_valueClasses[i] is Class)){ throw (new ArgumentError((((("Invalid valueClasses argument: item at index " + i) + " should be a Class but was:<") + _valueClasses[i]) + ">."))); }; }; } public function get numListeners():uint{ return (listeners.length); } public function dispatch(... _args):void{ var valueObject:Object; var valueClass:Class; var listener:Function; var numValueClasses:int = _valueClasses.length; if (_args.length < numValueClasses){ throw (new ArgumentError((((("Incorrect number of arguments. Expected at least " + numValueClasses) + " but received ") + _args.length) + "."))); }; var i:int; while (i < numValueClasses) { valueObject = _args[i]; if ((((valueObject === null)) || ((valueObject is _valueClasses[i])))){ } else { throw (new ArgumentError((((("Value object <" + valueObject) + "> is not an instance of <") + valueClass) + ">."))); }; i++; }; if (!listeners.length){ return; }; listenersNeedCloning = true; switch (_args.length){ case 0: for each (listener in listeners) { if (onceListeners[listener]){ remove(listener); }; listener(); }; break; case 1: for each (listener in listeners) { if (onceListeners[listener]){ remove(listener); }; listener(_args[0]); }; break; default: for each (listener in listeners) { if (onceListeners[listener]){ remove(listener); }; listener.apply(null, _args); }; }; listenersNeedCloning = false; } public function get valueClasses():Array{ return (_valueClasses); } public function removeAll():void{ var i:uint = listeners.length; while (i--) { remove((listeners[i] as Function)); }; } } }//package org.osflash.signals
Section 126
//_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 127
//_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 128
//_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 129
//_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 130
//_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 131
//_dateFieldPopupStyle (_dateFieldPopupStyle) package { import mx.core.*; import mx.styles.*; public class _dateFieldPopupStyle { public static function init(_dateFieldPopupStyle.as$3:IFlexModuleFactory):void{ var fbs = _dateFieldPopupStyle.as$3; 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 132
//_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 133
//_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 134
//_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 135
//_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 136
//_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 137
//_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 138
//_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 139
//_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 140
//_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 141
//_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 142
//_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 143
//_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 144
//_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 145
//_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 146
//_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 147
//_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 148
//Config (Config) package { import com.inruntime.utils.*; import flash.utils.*; public class Config { public function Config(){ super(); } public static function initialise():void{ var gameVars:Global = Global.getInstance(); gameVars.developerMode = false; gameVars.mochiEnabled = false; gameVars.showInterLevelAds = 2; gameVars.gameName = "KrakenAttack"; gameVars.stageMiddleX = 325; gameVars.stageMiddleY = 275; gameVars.soundReady = true; gameVars.life = 5; gameVars.health = 100; gameVars.maxHealth = 100; gameVars.lifeMax = 5; gameVars.score = 0; gameVars.level = 1; gameVars.levelMax = 5; gameVars.timer = 0; gameVars.timerMax = 90; gameVars.Paused = false; gameVars.startTime = getTimer(); gameVars.dolphinScore = 50; gameVars.boatScores = {boat2:50, boat1:100, boat3:200}; gameVars.flyMachineScores = {flyMachine1:100, flyMachine2:200, flyMachine3:500}; gameVars.showShareButton = true; gameVars.brandUsed = "OIG"; gameVars.siteUrl = "http://www.onlineindiangames.com"; gameVars.showCredits = "Developed by csharks"; gameVars.buttonFontSize = 16; gameVars.buttonFontNormalColor = 6768165; gameVars.buttonFontOverColor = 2431502; gameVars.buttonFontDownColor = 6768165; } } }//package
Section 149
//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 150
//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 151
//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 152
//IntroCgs_mc (IntroCgs_mc) package { import flash.display.*; public dynamic class IntroCgs_mc extends MovieClip { } }//package
Section 153
//IntroOIG_mc (IntroOIG_mc) package { import flash.display.*; public dynamic class IntroOIG_mc extends MovieClip { } }//package
Section 154
//KrakenAttack (KrakenAttack) package { import flash.events.*; import flash.display.*; import flash.geom.*; import com.csharks.juwalbose.utils.ui.*; import com.greensock.*; import flash.utils.*; import com.csharks.juwalbose.cFlashtory.core.*; import flash.media.*; import com.csharks.juwalbose.cFlashtory.*; import com.csharks.vinod.*; import com.csharks.juwalbose.utils.*; import com.eckyputrady.GameCamera.*; import com.greensock.easing.*; import com.carlcalderon.arthropod.*; import mochi.as3.*; import com.greensock.plugins.*; import flash.ui.*; public class KrakenAttack extends cFlashtory { private var FrontBuilding2:Class; private var HurtSound:Class; private var WaterMine:Class; private var DolphinSkeleton:Class; private var kraken:MovieClip; private var FlyMachine1:Class; private var FlyMachine2:Class; private var FlyMachine3:Class; private var gameTimerText:UiBox; private var dolphins:Array; private var Kraken:Class; private var splash:MovieClip; private var seaLevel:Number;// = 350 private var blobs:Array; private var krakenState:StateMachine; protected var ButtonUpClip:Class; private var Waves:Class; protected var ButtonDownClip:Class; private var Splash:Class; private var acc:Number;// = 0 private var bubble:MovieClip; private var krakenYPos:Number; private var waves:MovieClip; private var flyMachines:Array; private var Bubble:Class; private var currentFlyMachine:MovieClip; private var krakenRightLeg:MovieClip; private var BackBuilding1:Class; private var BackBuilding2:Class; private var BackBuilding3:Class; private var stillWave:MovieClip; private var vx:Number;// = 0 private var vy:Number;// = 0 private var SplashSound:Class; private var Boat1:Class; private var Boat2:Class; private var Boat3:Class; private var ZoomSound:Class; private var persistentData:Object; private var krakenJumpLevel:Number;// = 100 private var krakenLeftLeg:MovieClip; private var WaterSnd:Class; private var friction:Number;// = 0.8 private var gameLevelText:UiBox; private var gameScoreText:UiBox; private var dolphinSpawnTimer:Timer; private var FireBlob:Class; private var ExplosionSound:Class; private var camZoomedOut:Boolean;// = true private var boatsToBeRemoved:Array; private var boats:Array; private var waterSfxChannel:SoundChannel; private var Smoke:Class; private var flyMachineTimer:Timer; protected var BgClip:Class; private var KrakenLeg:Class; private var gameSpeed:Number;// = 1 private var krakenJump:String;// = "no" private var arrow_mc:MovieClip; private var combo:Number; private var parallax:ParallaxScroller; private var tempSound:Sound; private var point:Point; private var blobTimer:Timer; private var gameCounter:Counter; protected var ButtonOverClip:Class; private var Dolphin:Class; private var fxChannel:SoundChannel; private var jumpInitPoint:Number; private var pullKey:Boolean; private var blobDelay:Number;// = 10000 private var Arrow:Class; private var boatSpawnTimer:Timer; private var waterSfx:Sound; private var gCam:GCam; private var FrontBuilding3:Class; private var FrontBuilding4:Class; private var FrontBuilding6:Class; private var FrontBuilding1:Class; private var FrontBuilding5:Class; public function KrakenAttack(){ tempSound = new Sound(); BgClip = KrakenAttack_BgClip; ButtonUpClip = KrakenAttack_ButtonUpClip; ButtonDownClip = KrakenAttack_ButtonDownClip; ButtonOverClip = KrakenAttack_ButtonOverClip; BackBuilding1 = KrakenAttack_BackBuilding1; BackBuilding2 = KrakenAttack_BackBuilding2; BackBuilding3 = KrakenAttack_BackBuilding3; FrontBuilding1 = KrakenAttack_FrontBuilding1; FrontBuilding2 = KrakenAttack_FrontBuilding2; FrontBuilding3 = KrakenAttack_FrontBuilding3; FrontBuilding4 = KrakenAttack_FrontBuilding4; FrontBuilding5 = KrakenAttack_FrontBuilding5; FrontBuilding6 = KrakenAttack_FrontBuilding6; Smoke = KrakenAttack_Smoke; Waves = KrakenAttack_Waves; Dolphin = KrakenAttack_Dolphin; DolphinSkeleton = KrakenAttack_DolphinSkeleton; Kraken = KrakenAttack_Kraken; Splash = KrakenAttack_Splash; Bubble = KrakenAttack_Bubble; Boat1 = KrakenAttack_Boat1; Boat2 = KrakenAttack_Boat2; Boat3 = KrakenAttack_Boat3; FlyMachine1 = KrakenAttack_FlyMachine1; FlyMachine2 = KrakenAttack_FlyMachine2; FlyMachine3 = KrakenAttack_FlyMachine3; KrakenLeg = KrakenAttack_KrakenLeg; Arrow = KrakenAttack_Arrow; FireBlob = KrakenAttack_FireBlob; WaterMine = KrakenAttack_WaterMine; SplashSound = KrakenAttack_SplashSound; ExplosionSound = KrakenAttack_ExplosionSound; HurtSound = KrakenAttack_HurtSound; ZoomSound = KrakenAttack_ZoomSound; WaterSnd = KrakenAttack_WaterSnd; waterSfx = new WaterSnd(); super(); if (stage){ init(); } else { addEventListener(Event.ADDED_TO_STAGE, init); }; } private function pullRelease(e:KeyboardEvent):void{ pullKey = true; } private function createFlyMachines(e:TimerEvent):void{ var flyMachine:MovieClip; if (gameVars.Paused == true){ flyMachineTimer.delay = (int(RandomHelper.randomBetween(8, 12)) * 1000); flyMachineTimer.reset(); flyMachineTimer.start(); return; }; var r:Number = RandomHelper.randomSignWithZero(); if (r < 0){ flyMachine = new FlyMachine1(); flyMachine.y = 17.7; } else { if (r > 0){ flyMachine = new FlyMachine2(); flyMachine.y = 42; } else { flyMachine = new FlyMachine3(); flyMachine.y = 1; }; }; arrow_mc = new Arrow(); arrow_mc.x = -50; arrow_mc.y = 0; game_mc.main_mc.addChild(arrow_mc); game_mc.main_mc.addChild(flyMachine); game_mc.main_mc.swapChildren(flyMachine, kraken); game_mc.main_mc.setChildIndex(waves, game_mc.main_mc.getChildIndex(kraken)); game_mc.main_mc.setChildIndex(splash, game_mc.main_mc.getChildIndex(waves)); flyMachine.name = (int(RandomHelper.randomBetween(4, 7)).toString() + flyMachine.name); flyMachine.x = -(flyMachine.width); flyMachines.push(flyMachine); flyMachine.gotoAndPlay("idle"); flyMachine.addEventListener(Event.ENTER_FRAME, moveFlyMachine, false, 0, true); currentFlyMachine = flyMachine; } override protected function gameoverExit(evnt:Object):void{ super.gameoverExit(evnt); } override protected function clearCanvas():void{ var dolphin:MovieClip; var boat:MovieClip; var rboat:MovieClip; var flyMachine:MovieClip; var blob:MovieClip; stage.removeEventListener(KeyboardEvent.KEY_UP, onReleaseKey); stage.removeEventListener(KeyboardEvent.KEY_UP, pullRelease); parallax.dispose(); game_mc.main_mc.removeChild(parallax); parallax = null; game_mc.main_mc.removeChild(waves); waves = null; game_mc.main_mc.removeChild(stillWave); stillWave = null; dolphinSpawnTimer.removeEventListener(TimerEvent.TIMER, addDolphins); dolphinSpawnTimer = null; game_mc.main_mc.removeChild(splash); game_mc.main_mc.removeChild(bubble); splash = null; bubble = null; game_mc.main_mc.removeChild(kraken); kraken = null; krakenState = null; for each (dolphin in dolphins) { if (game_mc.main_mc.getChildByName(dolphin.name) != null){ dolphin.removeEventListener(Event.ENTER_FRAME, moveDolphin); game_mc.main_mc.removeChild(dolphin); }; }; dolphins = null; boatSpawnTimer.removeEventListener(TimerEvent.TIMER, createBoats); boatSpawnTimer = null; for each (boat in boats) { if (boat.hasEventListener(Event.ENTER_FRAME)){ boat.removeEventListener(Event.ENTER_FRAME, moveBoat); boat.removeEventListener(Event.ENTER_FRAME, removeBoat); }; game_mc.main_mc.removeChild(boat); }; boats = null; for each (rboat in boatsToBeRemoved) { if (game_mc.main_mc[rboat.name] != null){ rboat.removeEventListener(Event.ENTER_FRAME, removeBoat); game_mc.main_mc.removeChild(rboat); }; }; boatsToBeRemoved = null; flyMachineTimer.removeEventListener(TimerEvent.TIMER, createFlyMachines); flyMachineTimer = null; for each (flyMachine in flyMachines) { if (flyMachine.hasEventListener(Event.ENTER_FRAME)){ flyMachine.removeEventListener(Event.ENTER_FRAME, moveFlyMachine); flyMachine.removeEventListener(Event.ENTER_FRAME, pullFlyMachine); flyMachine.removeEventListener(Event.ENTER_FRAME, destroyFlyMachine); flyMachine.removeEventListener(Event.ENTER_FRAME, removeFlyMachine); }; game_mc.main_mc.removeChild(flyMachine); }; flyMachines = null; if (arrow_mc){ game_mc.main_mc.removeChild(arrow_mc); //unresolved jump var _slot1 = e; }; blobTimer.removeEventListener(TimerEvent.TIMER, spawnBlobs); blobTimer = null; for each (blob in blobs) { blob.removeEventListener(Event.ENTER_FRAME, blobMove); game_mc.main_mc.removeChild(blob); }; blobs = null; gCam = null; SceneManager.removeItem(game_mc, "Score"); super.clearCanvas(); } private function addDolphins(e:TimerEvent):void{ var dolphin:MovieClip; var scale:Number; if (gameVars.Paused == true){ return; }; var num:int = RandomHelper.randomBetween(1, 8); while (num > 0) { dolphin = new Dolphin(); game_mc.main_mc.addChild(dolphin); dolphins.push(dolphin); dolphin.x = RandomHelper.randomBetween(((gameVars.stageMiddleX * 2) + 20), ((gameVars.stageMiddleX * 2) + 40)); dolphin.y = RandomHelper.randomBetween(350, 500); if (Math.random() > 0.5){ dolphin.scaleX = -1; dolphin.x = RandomHelper.randomBetween(-80, -20); }; scale = RandomHelper.randomBetween(0.3, 1); dolphin.scaleX = (dolphin.scaleX * scale); dolphin.scaleY = (dolphin.scaleY * scale); dolphin.addEventListener(Event.ENTER_FRAME, moveDolphin, false, 0, true); num--; }; } private function onReleaseKey(e:KeyboardEvent):void{ jumpInitPoint = undefined; kraken.rotation = 0; if (e.keyCode == Keyboard.LEFT){ vx = -35; } else { if (e.keyCode == Keyboard.RIGHT){ vx = 35; } else { if (e.keyCode == Keyboard.DOWN){ vy = (vy + 25); } else { if (e.keyCode == Keyboard.UP){ if (kraken.y > 450){ vy = -15; } else { if (kraken.y < ((gameVars.stageMiddleY * 2) - 50)){ vy = -15; } else { vy = -15; }; }; }; }; }; }; } override protected function gameInit(evnt:Object):void{ super.gameInit(evnt); if ((((gameVars.level == gameVars.levelMax)) || ((gameVars.level == 1)))){ setVariable("level", "1", "gameEngineInit", "N"); setVariable("score", "0", "gameEngineInit", "N"); setVariable("life", String(gameVars.lifeMax), "gameEngineInit", "N"); } else { setVariable("level", "1", "gameEngineInit", "N"); setVariable("score", "0", "gameEngineInit", "N"); setVariable("life", String(gameVars.lifeMax), "gameEngineInit", "N"); }; gameEngine.initialState = "GameInit"; } override protected function gameExit(evnt:Object=null):void{ waterSfxChannel.stop(); waterSfxChannel.removeEventListener(Event.SOUND_COMPLETE, loopWaterSound); super.gameExit(evnt); } override protected function action(evnt:Event):void{ gameLoop(); if (gameVars.timer != gameCounter.currentTime){ setVariable("timer", String(gameCounter.currentTime), "action", "N"); }; super.action(evnt); } protected function playSound(which:Class, from:String):void{ var which = which; var from = from; if (gameVars.soundReady){ tempSound = null; Debug.log(((("Playing Sound " + String(which)) + " by ") + from), Debug.PINK); tempSound = new (which); fxChannel = tempSound.play(); //unresolved jump var _slot1 = e; }; } override protected function helpAdded(evnt:Event):void{ var backButton:UiButton = SceneManager.addButton(evnt.currentTarget, "BACK", backToGame, true, 100, 35); evnt.currentTarget.x = 0; evnt.currentTarget.y = 0; backButton.x = 420; backButton.y = 450; evnt.currentTarget.addFrameScript((evnt.currentTarget.totalFrames - 1), evnt.currentTarget.stop); evnt.target.removeEventListener(Event.ADDED_TO_STAGE, helpAdded); } private function soundButtonOut(e:MouseEvent):void{ if (e.currentTarget.currentFrame == 3){ e.currentTarget.gotoAndStop(1); } else { e.currentTarget.gotoAndStop(2); }; } private function pullFlyMachine(e:Event):void{ if (e.currentTarget.currentFrame == 20){ e.currentTarget.gotoAndPlay("pull"); }; } override protected function unpauseGame(evnt:Object=null):void{ gameCounter.unPause(); Tick.reset(); super.unpauseGame(evnt); waterSfxChannel = waterSfx.play(); waterSfxChannel.addEventListener(Event.SOUND_COMPLETE, loopWaterSound, false, 0, true); } protected function timesUp():void{ } override protected function gameWinAdded(evnt:Event):void{ var scoreText:UiBox; var playAgainButton:UiButton; var submitScoreButton:UiButton; if (evnt.target.currentFrame == evnt.target.totalFrames){ evnt.target.stop(); scoreText = new UiBox("", 150, 40, UiBoxTypes.TextOnly, 15, 7950891, gameVars.score, BgClip); scoreText.runningUpdate = true; scoreText.name = "Score"; evnt.currentTarget.addChild(scoreText); scoreText.update(gameVars.score); scoreText.y = 240; scoreText.x = 400; evnt.target.removeEventListener(Event.ENTER_FRAME, gameWinAdded); playAgainButton = SceneManager.addButton(evnt.currentTarget, "Play Again", gameWin2Game, true, 130, 30); if (gameVars.mochiEnabled){ submitScoreButton = SceneManager.addButton(evnt.currentTarget, "Submit Score", submitScore); submitScoreButton.x = ((gameVars.stageMiddleX - (submitScoreButton.width / 2)) - 8); submitScoreButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(submitScoreButton, 1, {y:500, ease:Elastic.easeOut}); }; playAgainButton.x = (gameVars.stageMiddleX - (playAgainButton.width / 2)); playAgainButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(playAgainButton, 1, {y:450, ease:Elastic.easeOut}); }; } override protected function assignHighScores(evnt:Event):void{ var evnt = evnt; evnt.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, assignHighScores); evnt.currentTarget.stop(); var o:Object = {n:[3, 12, 12, 4, 6, 3, 14, 13, 5, 6, 2, 5, 7, 3, 2, 8], f:function (i:Number, s:String):String{ if (s.length == 16){ return (s); }; return (this.f((i + 1), (s + this.n[i].toString(16)))); }}; var boardID:String = o.f(0, ""); MochiScores.showLeaderboard({boardID:boardID, res:(((gameVars.stageMiddleX * 2).toString() + "x") + (gameVars.stageMiddleY * 2).toString()), clip:evnt.currentTarget, onClose:function ():void{ templateMc.gotoAndPlay(2); }}); templateMc.addEventListener(Event.ENTER_FRAME, checkTemplate); } override protected function gameOverAdded(evnt:Event):void{ var scoreText:UiBox; var playAgainButton:UiButton; var submitScoreButton:UiButton; if (evnt.target.currentFrame == evnt.target.totalFrames){ evnt.target.stop(); scoreText = new UiBox("", 150, 40, UiBoxTypes.TextOnly, 15, 7950891, gameVars.score, BgClip); scoreText.runningUpdate = true; scoreText.name = "Score"; evnt.currentTarget.addChild(scoreText); scoreText.update(gameVars.score); scoreText.y = 240; scoreText.x = 400; evnt.target.removeEventListener(Event.ENTER_FRAME, gameOverAdded); playAgainButton = SceneManager.addButton(evnt.currentTarget, "Play Again", gameWin2Game, true, 130, 30); if (gameVars.mochiEnabled){ submitScoreButton = SceneManager.addButton(evnt.currentTarget, "Submit Score", submitScore); submitScoreButton.x = (gameVars.stageMiddleX - (submitScoreButton.width / 2)); submitScoreButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(submitScoreButton, 1, {y:500, ease:Elastic.easeOut}); }; playAgainButton.x = (gameVars.stageMiddleX - (playAgainButton.width / 2)); playAgainButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(playAgainButton, 1, {y:450, ease:Elastic.easeOut}); }; } override protected function levelInit(evnt:Object):void{ if (gameVars.mochiEnabled){ MochiSocial.hideLoginWidget(); }; gameScoreText = new UiBox("", 150, 40, UiBoxTypes.TextWithBackground, 15, 7950891, gameVars.score, BgClip); gameScoreText.runningUpdate = true; gameScoreText.name = "Score"; game_mc.addChild(gameScoreText); setVariable("timer", String(gameVars.timerMax), "levelInit", "N"); gameCounter = new Counter(gameVars.timer, 0, "up", timesUp); gameCounter.start(1); gameScoreText.y = 8; gameScoreText.x = 400; initArea(); super.levelInit(evnt); } private function droppingControls():void{ var boat:MovieClip; if (key.isDown(Keyboard.LEFT)){ if (kraken.x > 80){ kraken.x = (kraken.x - 25); }; } else { if (key.isDown(Keyboard.RIGHT)){ if (kraken.x < ((gameVars.stageMiddleX * 2) - 80)){ kraken.x = (kraken.x + 25); }; }; }; if (kraken.y < seaLevel){ kraken.rotation = 30; kraken.y = (kraken.y + 40); if ((int(kraken.y) + 15) >= int(seaLevel)){ kraken.rotation = 0; splashEffect(); vy = Utils.minMaxPerc(350, 100, krakenJumpLevel, 5, 20); krakenState.changeState("swimming"); }; }; for each (boat in boats) { if (boat.hitTestPoint(kraken.x, kraken.y)){ if (krakenJumpLevel < 250){ if (boatsToBeRemoved.indexOf(boat) == -1){ combo = 0; explodeBoat(boat); }; } else { shakeBoat(boat); }; }; }; } private function moveBoat(e:Event):void{ if (gameVars.Paused == false){ if (e.currentTarget.name.charAt(0) == "M"){ e.currentTarget.x = (e.currentTarget.x + (4 * gameSpeed)); if (e.currentTarget.x > ((gameVars.stageMiddleX * 2) + e.currentTarget.width)){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, moveBoat); e.currentTarget.parent.removeChild(e.currentTarget); boats.splice(e.currentTarget, 1); }; } else { e.currentTarget.x = (e.currentTarget.x - (3 * gameSpeed)); if (e.currentTarget.x < -(e.currentTarget.width)){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, moveBoat); e.currentTarget.parent.removeChild(e.currentTarget); boats.splice(e.currentTarget, 1); }; }; }; } private function removeDolphin(dolphin:MovieClip):void{ if (game_mc.main_mc[dolphin] != null){ game_mc.main_mc.removeChild(dolphin); }; } private function swimmingControls():void{ var depth:Number; var dolphin:MovieClip; var dolphinSkeleton:Sprite; if (kraken.y > 350){ depth = (((kraken.y - 350) * 100) / (((gameVars.stageMiddleY * 2) - 50) - 350)); kraken.transform.colorTransform = new ColorTransform(1, 1, 1, 1, -(depth), -(depth), -(depth), 0); }; if (key.isDown(Keyboard.LEFT)){ kraken.x = (kraken.x - 25); } else { if (key.isDown(Keyboard.RIGHT)){ kraken.x = (kraken.x + 25); }; }; if (key.isDown(Keyboard.DOWN)){ kraken.rotation = 0; if (kraken.y < ((gameVars.stageMiddleY * 2) - 50)){ kraken.y = (kraken.y + 25); }; }; if (key.isDown(Keyboard.UP)){ if (!jumpInitPoint){ jumpInitPoint = kraken.y; }; kraken.rotation = -40; kraken.y = (kraken.y - 35); if (kraken.y < 350){ krakenJumpLevel = Utils.minMaxPerc(350, ((gameVars.stageMiddleY * 2) - 50), jumpInitPoint, 300, 100); splashEffect(); krakenState.changeState("jumping"); }; } else { vx = (vx * friction); vy = (vy * friction); }; kraken.x = (kraken.x + vx); kraken.y = (kraken.y + vy); if (key.isDown(Keyboard.SPACE)){ if (kraken.head_mc.currentFrame == 1){ kraken.head_mc.play(); for each (dolphin in dolphins) { if (((kraken.hitTestPoint(dolphin.x, dolphin.y, true)) && ((dolphin.x > kraken.x)))){ createScorePopup(gameVars.dolphinScore, dolphin.x, dolphin.y); dolphin.removeEventListener(Event.ENTER_FRAME, moveDolphin); dolphinSkeleton = new DolphinSkeleton(); game_mc.main_mc.addChild(dolphinSkeleton); dolphinSkeleton.x = dolphin.x; dolphinSkeleton.y = dolphin.y; dolphinSkeleton.scaleX = dolphin.scaleX; dolphinSkeleton.scaleY = dolphin.scaleY; dolphinSkeleton.alpha = 0.8; game_mc.main_mc.swapChildren(dolphinSkeleton, kraken); TweenLite.to(dolphinSkeleton, 2, {rotation:359, y:(gameVars.stageMiddleY * 2), x:Number(((dolphin.x - 100) * gameSpeed)), onComplete:removeDolphinSkeleton, onCompleteParams:[dolphinSkeleton]}); TweenLite.to(dolphin, 0.5, {alpha:0, onComplete:removeDolphin, onCompleteParams:[dolphin]}); dolphins.splice(dolphins.indexOf(dolphin), 1); return; }; }; }; }; if (kraken.x < 80){ kraken.x = 80; }; if (kraken.x > ((gameVars.stageMiddleX * 2) - 80)){ kraken.x = ((gameVars.stageMiddleX * 2) - 80); }; if (kraken.y < 350){ kraken.y = 350; }; if (kraken.y > ((gameVars.stageMiddleY * 2) - 50)){ kraken.y = ((gameVars.stageMiddleY * 2) - 50); }; } private function moveDolphin(e:Event):void{ var e = e; if (gameVars.Paused == false){ if (e.currentTarget.scaleX < 0){ e.currentTarget.x = (e.currentTarget.x + ((2 + (e.currentTarget.scaleY * 8)) * gameSpeed)); if (e.currentTarget.x > (gameVars.stageMiddleX * 2)){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, moveDolphin); dolphins.splice(dolphins.indexOf(e.currentTarget), 1); e.currentTarget.parent.removeChild(e.currentTarget); //unresolved jump var _slot1 = e; }; } else { e.currentTarget.x = (e.currentTarget.x - ((2 + (e.currentTarget.scaleY * 8)) * gameSpeed)); if (e.currentTarget.x < -20){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, moveDolphin); dolphins.splice(dolphins.indexOf(e.currentTarget), 1); e.currentTarget.parent.removeChild(e.currentTarget); //unresolved jump var _slot1 = e; }; }; }; } override protected function assignHelp(evnt:Event):void{ evnt.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, assignHelp); evnt.currentTarget.back_btn.addEventListener(MouseEvent.CLICK, backBtnFn); evnt.currentTarget.addFrameScript((evnt.currentTarget.totalFrames - 1), evnt.currentTarget.stop); } private function splashEffect():void{ splash.x = kraken.x; splash.y = 305; bubble.x = kraken.x; bubble.y = (kraken.y + 80); splash.visible = (bubble.visible = true); splash.gotoAndPlay(1); bubble.gotoAndPlay(1); playSound(SplashSound, "splashEffect"); } private function explodeNearBy(initBoat:MovieClip):void{ var boat:MovieClip; for each (boat in boats) { if ((((boat == initBoat)) || (!((boatsToBeRemoved.indexOf(boat) == -1))))){ } else { if (Utils.distBetween(boat, initBoat) < (100 + (boat.width / 2))){ explodeBoat(boat); }; }; }; } override protected function gamewinExit(evnt:Object):void{ super.gamewinExit(evnt); } override protected function assignSubmitScore(evnt:Event):void{ var evnt = evnt; evnt.currentTarget.removeEventListener(Event.ADDED_TO_STAGE, assignSubmitScore); evnt.currentTarget.stop(); var o:Object = {n:[3, 12, 12, 4, 6, 3, 14, 13, 5, 6, 2, 5, 7, 3, 2, 8], f:function (i:Number, s:String):String{ if (s.length == 16){ return (s); }; return (this.f((i + 1), (s + this.n[i].toString(16)))); }}; var boardID:String = o.f(0, ""); MochiScores.showLeaderboard({boardID:boardID, score:gameVars.score, res:(((gameVars.stageMiddleX * 2).toString() + "x") + (gameVars.stageMiddleY * 2).toString()), clip:evnt.currentTarget, onClose:function ():void{ templateMc.gotoAndPlay(2); }}); templateMc.addEventListener(Event.ENTER_FRAME, checkTemplate); } override protected function assignMenu(event:Event):void{ if (event.currentTarget.currentFrame == event.currentTarget.totalFrames){ event.currentTarget.stop(); menu.leaderBoard_btn.visible = false; menu.play_btn.addEventListener(MouseEvent.CLICK, gameStart); menu.help_btn.addEventListener(MouseEvent.CLICK, gotoHelpPage); menu.more_btn.addEventListener(MouseEvent.CLICK, gotoSite); menu.sound_btn.gotoAndStop(1); menu.sound_btn.buttonMode = true; menu.sound_btn.addEventListener(MouseEvent.ROLL_OVER, soundButtonOver); menu.sound_btn.addEventListener(MouseEvent.ROLL_OUT, soundButtonOut); menu.sound_btn.addEventListener(MouseEvent.CLICK, toggleGlobalSound); if (gameVars.mochiEnabled){ menu.leaderBoard_btn.visible = true; menu.leaderBoard_btn.addEventListener(MouseEvent.CLICK, showHighScores); }; menu.play_btn.x = 388; menu.play_btn.y = 392; menu.help_btn.x = 437; menu.help_btn.y = 414.7; menu.sound_btn.x = 487; menu.sound_btn.y = 436.6; menu.leaderBoard_btn.x = 591.1; menu.leaderBoard_btn.y = 479; menu.more_btn.x = 540; menu.more_btn.y = 457.4; TweenLite.from(menu.play_btn, 0.5, {x:652.5, y:484.4, ease:Back.easeOut}); TweenLite.from(menu.help_btn, 0.5, {delay:0.1, x:701.5, y:506.4, ease:Back.easeOut}); TweenLite.from(menu.sound_btn, 0.5, {delay:0.2, x:751.5, y:529, ease:Back.easeOut}); TweenLite.from(menu.more_btn, 0.5, {delay:0.3, x:804.5, y:549.8, ease:Back.easeOut}); if (gameVars.mochiEnabled){ TweenLite.from(menu.leaderBoard_btn, 0.5, {delay:0.4, x:855.6, y:571.4, ease:Back.easeOut}); }; event.target.removeEventListener(Event.ENTER_FRAME, assignMenu); }; } override protected function levelUpExit(evnt:Object):void{ super.levelUpExit(evnt); } override protected function levelUpAdded(evnt:Event):void{ var levelText:UiBox; var scoreText:UiBox; var lifeText:UiBox; var timerText:UiBox; var okButton:UiButton; if (evnt.currentTarget.currentFrame == evnt.currentTarget.totalFrames){ evnt.currentTarget.stop(); levelText = new UiBox("Level", 150, 40, UiBoxTypes.TextWithBackground, 15, 0xFFFFFF, gameVars.level, BgClip); levelText.name = "Level"; evnt.currentTarget.addChild(levelText); scoreText = new UiBox("Score", 150, 40, UiBoxTypes.TextWithBackground, 15, 0xFFFFFF, gameVars.score, BgClip); scoreText.runningUpdate = true; scoreText.name = "Score"; evnt.currentTarget.addChild(scoreText); lifeText = new UiBox("Life", 150, 40, UiBoxTypes.TextWithBackground, 15, 0xFFFFFF, gameVars.life, BgClip); lifeText.name = "Life"; evnt.currentTarget.addChild(lifeText); timerText = new UiBox("Timer", 150, 40, UiBoxTypes.TextWithBackground, 15, 0xFFFFFF, gameVars.timer, BgClip); timerText.name = "Timer"; evnt.currentTarget.addChild(timerText); scoreText.y = (levelText.y = (lifeText.y = (timerText.y = 250))); levelText.x = 10; scoreText.x = ((gameVars.stageMiddleX - timerText.width) - 10); lifeText.x = (gameVars.stageMiddleX + 10); timerText.x = (((2 * gameVars.stageMiddleX) - timerText.width) - 10); okButton = SceneManager.addButton(evnt.currentTarget, "Next Level", levelUp2Game); evnt.currentTarget.removeEventListener(Event.ENTER_FRAME, levelUpAdded); okButton.x = (gameVars.stageMiddleX - (okButton.width / 2)); okButton.y = (2 * gameVars.stageMiddleY); TweenLite.to(okButton, 1, {y:500, ease:Elastic.easeOut}); }; } private function pullExit(o:Object):void{ game_mc.keyHelp_mc.visible = false; kraken.play(); kraken.head_mc.gotoAndStop(1); stage.removeEventListener(KeyboardEvent.KEY_UP, pullRelease); } private function comboTextNotify():void{ game_mc.combo_mc.text_txt.text = ("COMBO X" + combo); game_mc.combo_mc.visible = true; game_mc.combo_mc.scaleX = (game_mc.combo_mc.scaleY = 1.5); TweenLite.to(game_mc.combo_mc, 0.5, {scaleX:1, scaleY:1, onComplete:function ():void{ var d:*; d = setTimeout(function ():void{ clearTimeout(d); game_mc.combo_mc.visible = false; }, 500); }, ease:Back.easeOut}); } private function moveFlyMachine(e:Event):void{ arrow_mc.x = e.currentTarget.x; arrow_mc.y = 275; if (e.currentTarget.currentFrame == 10){ e.currentTarget.gotoAndPlay(1); }; if (gameVars.Paused == false){ e.currentTarget.x = (e.currentTarget.x + (int(e.currentTarget.name.charAt(0)) * gameSpeed)); if (e.currentTarget.x > ((gameVars.stageMiddleX * 2) + e.currentTarget.width)){ removeFlyMachine((e.currentTarget as MovieClip)); }; }; } private function blobMove(e:Event):void{ var e = e; if (gameVars.Paused == true){ return; }; e.currentTarget.x = (e.currentTarget.x - (20 * gameSpeed)); if (e.currentTarget.x < (-(e.currentTarget.width) - 50)){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, blobMove); blobs.splice(blobs.indexOf(e.currentTarget), 1); game_mc.main_mc.removeChild(e.currentTarget); //unresolved jump var _slot1 = e; }; } override protected function menuInit(evnt:Object):void{ var creditText:UiBox; super.menuInit(evnt); if (gameVars.mochiEnabled){ MochiSocial.showLoginWidget(); }; if (gameVars.brandUsed == "Csharks"){ logo = (new LogoCsharks() as Sprite); } else { if (gameVars.brandUsed == "OIG"){ logo = (new LogoOIG() as Sprite); }; }; if (logo){ logo.buttonMode = true; logo.name = "Logo"; menu.addChild(logo); logo.addEventListener(MouseEvent.CLICK, gotoSite); logo.x = 550; logo.y = 80; }; if (((gameVars.mochiEnabled) && (gameVars.showShareButton))){ shareBtn = new ShareThis(); shareBtn.name = "Share"; menu.addChild(shareBtn); shareBtn.addEventListener(MouseEvent.CLICK, postToStream); shareBtn.x = 5; shareBtn.y = 40; }; if (gameVars.brandUsed != "Csharks"){ if (gameVars.showCredits != null){ creditText = new UiBox("", 200, 70, UiBoxTypes.TextOnly, 12, 0xFFFFFF, gameVars.showCredits); creditText.name = "CreditText"; creditText.x = 0; creditText.y = 500; menu.addChild(creditText); creditLogo = (new LogoCsharks() as Sprite); creditLogo.buttonMode = true; creditLogo.name = "Credit Logo"; menu.addChild(creditLogo); creditLogo.addEventListener(MouseEvent.CLICK, gotoCsharksSite); creditLogo.x = 100; creditLogo.y = 500; }; }; } private function init(e:Event=null):void{ if (hasEventListener(Event.ADDED_TO_STAGE)){ removeEventListener(Event.ADDED_TO_STAGE, init); }; stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; if (Environment.IS_CSHARKS){ }; if (Environment.IS_OIG){ }; TweenPlugin.activate([ColorTransformPlugin]); super.cFlashtoryInit(); if (gameVars.mochiEnabled){ MochiServices.connect("7d0d81c0c3c9ec6d", root); }; if (gameVars.developerMode){ gameSequence.initialState = "Menu"; } else { gameSequence.initialState = "Intro"; }; } override protected function menuExit(event:Object):void{ Debug.log("menu exit"); if (logo){ logo.removeEventListener(MouseEvent.CLICK, gotoSite); SceneManager.removeItem(menu, "Logo"); }; if (gameVars.brandUsed != "Csharks"){ if (gameVars.showCredits != null){ SceneManager.removeItem(menu, "CreditText"); creditLogo.removeEventListener(MouseEvent.CLICK, gotoCsharksSite); SceneManager.removeItem(menu, "Credit Logo"); }; }; if (shareBtn){ shareBtn.removeEventListener(MouseEvent.CLICK, postToStream); SceneManager.removeItem(menu, "Share"); }; removeChild(menu); menu.play_btn.removeEventListener(MouseEvent.CLICK, gameStart); menu.help_btn.removeEventListener(MouseEvent.CLICK, gotoHelpPage); menu.more_btn.removeEventListener(MouseEvent.CLICK, gotoSite); menu.sound_btn.removeEventListener(MouseEvent.ROLL_OVER, soundButtonOver); menu.sound_btn.removeEventListener(MouseEvent.ROLL_OUT, soundButtonOut); menu.sound_btn.removeEventListener(MouseEvent.CLICK, toggleGlobalSound); } protected function forceGameWin(evnth:MouseEvent):void{ gameSequence.changeState("GameWin"); } private function removeDolphinSkeleton(dolphinSkeleton:Sprite):void{ if (game_mc){ game_mc.main_mc.removeChild(dolphinSkeleton); }; } override protected function pauseGame(evnt:Object=null):void{ super.pauseGame(evnt); waterSfxChannel.stop(); waterSfxChannel.removeEventListener(Event.SOUND_COMPLETE, loopWaterSound); var pausedText:UiBox = new UiBox("", 150, 40, UiBoxTypes.TextWithBackground, 15, 0xFFFFFF, "Game Paused", BgClip); pausedText.name = "PausedText"; pausedText.x = (gameVars.stageMiddleX - (pausedText.width / 2)); pausedText.y = (gameVars.stageMiddleY - (pausedText.height / 2)); game_mc.addChild(pausedText); gameCounter.pause(); setVariable("Paused", "1", "pauseGame", "B"); pauseTime = getTimer(); } private function swimEnter(o:Object):void{ kraken.transform.colorTransform = new ColorTransform(1, 1, 1, 1, -10, -10, -10, 0); stage.addEventListener(KeyboardEvent.KEY_UP, onReleaseKey, false, 0, true); } override protected function checkAddMochiAds(evnt:Event):void{ levelUp_mc.removeEventListener(Event.ADDED_TO_STAGE, checkAddMochiAds); if (((((gameVars.mochiEnabled) && ((gameVars.showInterLevelAds < gameVars.levelMax)))) && (((gameVars.level % gameVars.showInterLevelAds) == 0)))){ levelUp_mc.gotoAndStop(1); MochiAd.showInterLevelAd({clip:root, id:"test", res:(((gameVars.stageMiddleX * 2).toString() + "x") + (gameVars.stageMiddleY * 2).toString()), ad_finished:showLevelUp}); } else { showLevelUp(); }; } private function pullingControls():void{ krakenRightLeg.rotation = (kraken.rotation + 180); krakenLeftLeg.rotation = (kraken.rotation + 180); game_mc.main_mc.setChildIndex(currentFlyMachine, (game_mc.main_mc.getChildIndex(kraken) - 1)); game_mc.main_mc.setChildIndex(krakenRightLeg, game_mc.main_mc.getChildIndex(kraken)); game_mc.main_mc.setChildIndex(krakenLeftLeg, (game_mc.main_mc.getChildIndex(currentFlyMachine) - 1)); if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine1") != -1){ kraken.x = ((currentFlyMachine.x + currentFlyMachine.krakenBite_mc.x) - 45); kraken.y = ((currentFlyMachine.y + currentFlyMachine.krakenBite_mc.y) + 27); krakenYPos = 359; } else { if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine2") != -1){ kraken.x = ((currentFlyMachine.x + currentFlyMachine.krakenBite_mc.x) - 48); kraken.y = ((currentFlyMachine.y + currentFlyMachine.krakenBite_mc.y) + 32); krakenYPos = 369; } else { if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine3") != -1){ kraken.x = ((currentFlyMachine.x + currentFlyMachine.krakenBite_mc.x) - 45); kraken.y = ((currentFlyMachine.y + currentFlyMachine.krakenBite_mc.y) + 25); krakenYPos = 380; }; }; }; krakenRightLeg.x = (kraken.x + 45); krakenRightLeg.y = (kraken.y - 25); krakenLeftLeg.x = (kraken.x + 45); krakenLeftLeg.y = (kraken.y - 25); if ((((kraken.y > 250)) && ((camZoomedOut == false)))){ camZoomedOut = true; gCam.to(gameVars.stageMiddleX, gameVars.stageMiddleY, 1, 1); }; if (((key.isDown(Keyboard.DOWN)) && (pullKey))){ currentFlyMachine.y = (currentFlyMachine.y + 10); kraken.y = (kraken.y + 10); krakenRightLeg.y = (krakenRightLeg.y + 10); krakenLeftLeg.y = (krakenLeftLeg.y + 10); pullKey = false; }; if (kraken.y >= krakenYPos){ currentFlyMachine.removeEventListener(Event.ENTER_FRAME, pullFlyMachine); currentFlyMachine.addEventListener(Event.ENTER_FRAME, destroyFlyMachine, false, 0, true); if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine1") != -1){ createScorePopup(gameVars.flyMachineScores["flyMachine1"], currentFlyMachine.x, currentFlyMachine.y); } else { if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine2") != -1){ createScorePopup(gameVars.flyMachineScores["flyMachine2"], currentFlyMachine.x, currentFlyMachine.y); } else { if (getQualifiedClassName(currentFlyMachine).indexOf("FlyMachine3") != -1){ createScorePopup(gameVars.flyMachineScores["flyMachine3"], currentFlyMachine.x, currentFlyMachine.y); }; }; }; currentFlyMachine.gotoAndPlay("explode"); playSound(ExplosionSound, "pullingControls"); explodeNearBy(currentFlyMachine); game_mc.main_mc.removeChild(krakenLeftLeg); game_mc.main_mc.removeChild(krakenRightLeg); kraken.rotation = 0; vy = 15; krakenState.changeState("swimming"); }; } private function createScorePopup(score:Number, xPos:Number, yPos:Number):void{ var scorePopup:UiBox; var score = score; var xPos = xPos; var yPos = yPos; scorePopup = new UiBox("", 100, 50, UiBoxTypes.TextOnly, 18, 0xFFFFFF, score, null, null, null, "Impact"); scorePopup.x = xPos; scorePopup.y = yPos; scorePopup.update(score); game_mc.addChild(scorePopup); TweenLite.to(scorePopup, 0.8, {x:gameScoreText.x, y:gameScoreText.y, onComplete:function ():void{ gameVars.score = (gameVars.score + score); gameScoreText.update(gameVars.score); if (scorePopup != null){ game_mc.removeChild(scorePopup); //unresolved jump var _slot1 = e; }; }, ease:Linear.easeInOut}); } private function shakeBoat(boat:MovieClip):void{ var tgtRot:Number; var duration:Number; if (getQualifiedClassName(boat).indexOf("Boat1") != -1){ tgtRot = 5; duration = 0.07; } else { if (getQualifiedClassName(boat).indexOf("Boat2") != -1){ tgtRot = 10; duration = 0.04; } else { tgtRot = 3; duration = 0.1; }; }; TweenLite.to(boat, duration, {rotation:-(tgtRot), onComplete:shakeBoat2, onCompleteParams:[boat], ease:Linear.easeNone}); } private function shakeBoat3(boat:MovieClip):void{ TweenLite.to(boat, 0.1, {rotation:0}); } private function pullEnter(o:Object):void{ game_mc.keyHelp_mc.visible = true; kraken.gotoAndStop(10); kraken.head_mc.gotoAndStop(4); stage.addEventListener(KeyboardEvent.KEY_UP, pullRelease, false, 0, true); } private function soundButtonOver(e:MouseEvent):void{ if (e.currentTarget.currentFrame == 1){ e.currentTarget.gotoAndStop(3); } else { e.currentTarget.gotoAndStop(4); }; } override protected function backBtnFn(evnt:MouseEvent):void{ evnt.currentTarget.removeEventListener(MouseEvent.CLICK, backBtnFn); if (((!((gameVars.showCredits == null))) && ((evnt.currentTarget.parent == templateMc)))){ evnt.currentTarget.parent.removeChild(finalCreditText); finalCreditText.removeEventListener(MouseEvent.CLICK, gotoSite); }; Debug.log("back to menu after submit"); gameSequence.changeState("Menu"); } private function createBoats(e:TimerEvent):void{ var boat:MovieClip; if (gameVars.Paused == true){ return; }; var r:Number = RandomHelper.randomSignWithZero(); if (r < 0){ boat = new Boat1(); boat.y = 253; } else { if (r > 0){ boat = new Boat2(); boat.y = 280; } else { boat = new Boat3(); boat.y = 250; }; }; game_mc.main_mc.addChild(boat); game_mc.main_mc.swapChildren(boat, kraken); game_mc.main_mc.setChildIndex(waves, game_mc.main_mc.getChildIndex(kraken)); game_mc.main_mc.setChildIndex(splash, game_mc.main_mc.getChildIndex(waves)); boat.x = ((gameVars.stageMiddleX * 2) + boat.width); boat.name = ("I" + boat.name); if (Math.random() > 0.5){ boat.x = -(boat.width); boat.name = ("M" + boat.name); }; boats.push(boat); boat.gotoAndStop("idle"); boat.addEventListener(Event.ENTER_FRAME, moveBoat, false, 0, true); } private function shakeBoat2(boat:MovieClip):void{ var tgtRot:Number; var duration:Number; if (getQualifiedClassName(boat).indexOf("Boat1") != -1){ tgtRot = 2; duration = 0.07; } else { if (getQualifiedClassName(boat).indexOf("Boat2") != -1){ tgtRot = 5; duration = 0.04; } else { tgtRot = 1; duration = 0.1; }; }; TweenLite.to(boat, duration, {rotation:tgtRot, onComplete:shakeBoat3, onCompleteParams:[boat], ease:Linear.easeNone}); } private function spawnBlobs(e:TimerEvent):void{ var r:Number; var blob:MovieClip; var arrow:MovieClip; var d:uint; var e = e; if ((((gameVars.Paused == true)) || ((blobs.length > 4)))){ return; }; if (blobTimer.delay > 2000){ blobTimer.delay = (blobTimer.delay - 250); }; if (Math.random() < 0.5){ r = RandomHelper.randomBetween(50, 300); blob = new FireBlob(); } else { r = RandomHelper.randomBetween(370, ((gameVars.stageMiddleX * 2) - 130)); blob = new WaterMine(); }; blobs.push(blob); game_mc.main_mc.addChild(blob); blob.x = (((gameVars.stageMiddleX * 2) + blob.width) + 50); blob.y = r; arrow = new Arrow(); game_mc.main_mc.addChild(arrow); arrow.x = 600; arrow.y = r; arrow.rotation = 90; d = setTimeout(function ():void{ clearTimeout(d); game_mc.main_mc.removeChild(arrow); blob.addEventListener(Event.ENTER_FRAME, blobMove, false, 0, true); }, 2000); } private function initArea():void{ gameVars.health = gameVars.maxHealth; gCam = new GCam(game_mc.main_mc, new Rectangle(0, 0, (gameVars.stageMiddleX * 2), (gameVars.stageMiddleY * 2))); game_mc.distance_mc.gotoAndStop(1); game_mc.combo_mc.visible = false; game_mc.keyHelp_mc.visible = false; parallax = new ParallaxScroller(0, 0, (gameVars.stageMiddleX * 2), (gameVars.stageMiddleY * 2)); game_mc.main_mc.addChild(parallax); parallax.addScreen("backScreen", 3, [BackBuilding1, BackBuilding2, BackBuilding3], -10, 40, 30, 30, 0.1, 0.1, 0); parallax.addScreen("smokeScreen", 2, [Smoke], -5, 0, -40, 0, 0, 0, 1); parallax.addScreen("frontScreen", 5, [FrontBuilding1, FrontBuilding2, FrontBuilding3, FrontBuilding4, FrontBuilding5, FrontBuilding6], -20, -20, 230, 0, 0, 0, 2); parallax.y = 100; stillWave = new Waves(); game_mc.main_mc.addChild(stillWave); stillWave.waveAnimation_mc.gotoAndStop(5); stillWave.x = -28; stillWave.y = 325; dolphinSpawnTimer = new Timer(10000); dolphinSpawnTimer.addEventListener(TimerEvent.TIMER, addDolphins, false, 0, true); dolphinSpawnTimer.start(); dolphins = new Array(); kraken = new Kraken(); game_mc.main_mc.addChild(kraken); kraken.x = 180; kraken.y = 350; kraken.head_mc.gotoAndStop(1); kraken.head_mc.addFrameScript(0, function ():void{ if (kraken != null){ kraken.head_mc.stop(); }; }); waves = new Waves(); game_mc.main_mc.addChild(waves); waves.x = -28; waves.y = 335; waves.alpha = 0.8; krakenState = new StateMachine(); krakenState.addState("swimming", {enter:swimEnter, exit:swimExit}); krakenState.addState("jumping"); krakenState.addState("dropping"); krakenState.addState("pulling", {enter:pullEnter, exit:pullExit}); krakenState.initialState = "swimming"; splash = new Splash(); bubble = new Bubble(); game_mc.main_mc.addChild(splash); game_mc.main_mc.addChild(bubble); splash.scaleX = (splash.scaleY = 0.7); splash.visible = false; bubble.visible = false; splash.addFrameScript((splash.totalFrames - 1), function ():void{ if (splash != null){ splash.stop(); splash.visible = false; }; }); bubble.addFrameScript((bubble.totalFrames - 1), function ():void{ if (bubble != null){ bubble.stop(); bubble.visible = false; }; }); boats = new Array(); boatsToBeRemoved = new Array(); boatSpawnTimer = new Timer(3000); boatSpawnTimer.addEventListener(TimerEvent.TIMER, createBoats, false, 0, true); boatSpawnTimer.start(); flyMachines = new Array(); flyMachineTimer = new Timer(8000, 1); flyMachineTimer.addEventListener(TimerEvent.TIMER, createFlyMachines, false, 0, true); flyMachineTimer.start(); blobTimer = new Timer(blobDelay); blobTimer.addEventListener(TimerEvent.TIMER, spawnBlobs, false, 0, true); blobTimer.start(); blobs = new Array(); combo = 0; } private function explodeBoat(boat:MovieClip):void{ var currentScore:Number; boat.removeEventListener(Event.ENTER_FRAME, moveBoat); boat.addEventListener(Event.ENTER_FRAME, removeBoat, false, 0, true); boat.gotoAndPlay("explode"); playSound(ExplosionSound, "explodeBoat"); boatsToBeRemoved.push(boat); combo++; if (getQualifiedClassName(boat).indexOf("Boat1") != -1){ currentScore = gameVars.boatScores["boat1"]; } else { if (getQualifiedClassName(boat).indexOf("Boat2") != -1){ currentScore = gameVars.boatScores["boat2"]; } else { if (getQualifiedClassName(boat).indexOf("Boat3") != -1){ currentScore = gameVars.boatScores["boat3"]; }; }; }; if (combo > 1){ comboTextNotify(); }; if ((((combo >= 3)) && ((gameSpeed < 2)))){ gameSpeed = (gameSpeed + 0.2); }; currentScore = (currentScore * combo); createScorePopup(currentScore, boat.x, boat.y); } private function gameLoop():void{ var blob:MovieClip; parallax.update(gameSpeed); switch (krakenState.state){ case "swimming": swimmingControls(); break; case "jumping": jumpingControls(); break; case "dropping": droppingControls(); break; case "pulling": pullingControls(); break; default: break; }; game_mc.distance_mc.gotoAndStop((int(((gameVars.health * 19) / 100)) + 1)); if (gameVars.health <= 0){ gameSequence.changeState("GameOver"); }; for each (blob in blobs) { if (Utils.distBetween(kraken, blob) < 50){ gameVars.health = (gameVars.health - 10); playSound(HurtSound, "gameLoop"); if (gameSpeed >= 1.2){ gameSpeed = (gameSpeed - 0.2); }; TweenLite.to(game_mc, 0.3, {colorTransform:{tint:0xFF0000, tintAmount:0.5}, onComplete:function ():void{ TweenLite.to(game_mc, 0.2, {colorTransform:{tint:0xFFFFFF, tintAmount:0}}); }}); blob.removeEventListener(Event.ENTER_FRAME, blobMove); blobs.splice(blobs.indexOf(blob), 1); game_mc.main_mc.removeChild(blob); }; }; } private function swimExit(o:Object):void{ vx = 0; vy = 0; jumpInitPoint = undefined; stage.removeEventListener(KeyboardEvent.KEY_UP, onReleaseKey); kraken.transform.colorTransform = new ColorTransform(); } private function jumpingControls():void{ if (key.isDown(Keyboard.LEFT)){ if (kraken.x > 80){ kraken.x = (kraken.x - 25); }; } else { if (key.isDown(Keyboard.RIGHT)){ if (kraken.x < ((gameVars.stageMiddleX * 2) - 80)){ kraken.x = (kraken.x + 25); }; }; }; if (kraken.y > krakenJumpLevel){ kraken.rotation = -40; kraken.y = (kraken.y + ((krakenJumpLevel - kraken.y) * 0.5)); if ((int(kraken.y) - 5) <= int(krakenJumpLevel)){ krakenState.changeState("dropping"); }; }; if (key.isDown(Keyboard.SPACE)){ if (currentFlyMachine != null){ if (Utils.distBetween(kraken, currentFlyMachine) < 150){ krakenState.changeState("pulling"); gCam.to(kraken.x, kraken.y, 2, 1); playSound(ZoomSound, "jumpingControls"); krakenLeftLeg = new KrakenLeg(); krakenRightLeg = new KrakenLeg(); game_mc.main_mc.addChild(krakenLeftLeg); game_mc.main_mc.addChild(krakenRightLeg); krakenLeftLeg.scaleX = (krakenLeftLeg.scaleY = 0.6); krakenRightLeg.scaleX = (krakenRightLeg.scaleY = 0.7); krakenLeftLeg.gotoAndPlay(int((krakenLeftLeg.totalFrames / 2))); camZoomedOut = false; currentFlyMachine.gotoAndPlay("pull"); if (arrow_mc != null){ game_mc.main_mc.removeChild(arrow_mc); }; currentFlyMachine.removeEventListener(Event.ENTER_FRAME, moveFlyMachine); currentFlyMachine.addEventListener(Event.ENTER_FRAME, pullFlyMachine, false, 0, true); }; }; }; } protected function forceLevelUp(evnth:MouseEvent):void{ gameEngine.changeState("LevelUp"); } private function removeBoat(e:Event):void{ if ((((e.currentTarget.currentFrame == e.currentTarget.totalFrames)) && (!((e.currentTarget == null))))){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, removeBoat); e.currentTarget.stop(); if (boats.indexOf(e.currentTarget) != -1){ boats.splice(boats.indexOf(e.currentTarget), 1); }; if (game_mc.main_mc[e.currentTarget.name] != null){ game_mc.main_mc.removeChild(e.currentTarget); }; boatsToBeRemoved.splice(boatsToBeRemoved.indexOf(e.currentTarget), 1); }; if (e.currentTarget.currentFrame == 20){ explodeNearBy((e.currentTarget as MovieClip)); }; } protected function forceGameOver(evnth:MouseEvent):void{ gameSequence.changeState("GameOver"); } private function removeFlyMachine(flyMachine:MovieClip):void{ flyMachine.removeEventListener(Event.ENTER_FRAME, moveFlyMachine); flyMachine.removeEventListener(Event.ENTER_FRAME, destroyFlyMachine); if (game_mc.main_mc.getChildByName(arrow_mc.name) != null){ game_mc.main_mc.removeChild(arrow_mc); }; flyMachine.parent.removeChild(flyMachine); flyMachines.splice(flyMachine, 1); currentFlyMachine = null; flyMachineTimer.delay = (int(RandomHelper.randomBetween(8, 12)) * 1000); flyMachineTimer.reset(); flyMachineTimer.start(); } private function loopWaterSound(e:Event):void{ waterSfxChannel = waterSfx.play(); waterSfxChannel.addEventListener(Event.SOUND_COMPLETE, loopWaterSound, false, 0, true); } private function destroyFlyMachine(e:Event):void{ if (e.currentTarget.currentFrame == e.currentTarget.totalFrames){ e.currentTarget.removeEventListener(Event.ENTER_FRAME, destroyFlyMachine); removeFlyMachine((e.currentTarget as MovieClip)); }; } } }//package
Section 155
//KrakenAttack_Arrow (KrakenAttack_Arrow) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Arrow extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 156
//KrakenAttack_BackBuilding1 (KrakenAttack_BackBuilding1) package { import flash.display.*; import mx.core.*; public class KrakenAttack_BackBuilding1 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 157
//KrakenAttack_BackBuilding2 (KrakenAttack_BackBuilding2) package { import flash.display.*; import mx.core.*; public class KrakenAttack_BackBuilding2 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 158
//KrakenAttack_BackBuilding3 (KrakenAttack_BackBuilding3) package { import flash.display.*; import mx.core.*; public class KrakenAttack_BackBuilding3 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 159
//KrakenAttack_BgClip (KrakenAttack_BgClip) package { import flash.display.*; import mx.core.*; public class KrakenAttack_BgClip extends SpriteAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 160
//KrakenAttack_Boat1 (KrakenAttack_Boat1) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Boat1 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 161
//KrakenAttack_Boat2 (KrakenAttack_Boat2) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Boat2 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 162
//KrakenAttack_Boat3 (KrakenAttack_Boat3) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Boat3 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 163
//KrakenAttack_Bubble (KrakenAttack_Bubble) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Bubble extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 164
//KrakenAttack_ButtonDownClip (KrakenAttack_ButtonDownClip) package { import flash.display.*; import mx.core.*; public class KrakenAttack_ButtonDownClip extends SpriteAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 165
//KrakenAttack_ButtonOverClip (KrakenAttack_ButtonOverClip) package { import flash.display.*; import mx.core.*; public class KrakenAttack_ButtonOverClip extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 166
//KrakenAttack_ButtonUpClip (KrakenAttack_ButtonUpClip) package { import flash.display.*; import mx.core.*; public class KrakenAttack_ButtonUpClip extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 167
//KrakenAttack_Dolphin (KrakenAttack_Dolphin) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Dolphin extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 168
//KrakenAttack_DolphinSkeleton (KrakenAttack_DolphinSkeleton) package { import flash.display.*; import mx.core.*; public class KrakenAttack_DolphinSkeleton extends SpriteAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 169
//KrakenAttack_ExplosionSound (KrakenAttack_ExplosionSound) package { import flash.display.*; import mx.core.*; public class KrakenAttack_ExplosionSound extends SoundAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 170
//KrakenAttack_FireBlob (KrakenAttack_FireBlob) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FireBlob extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 171
//KrakenAttack_FlyMachine1 (KrakenAttack_FlyMachine1) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FlyMachine1 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 172
//KrakenAttack_FlyMachine2 (KrakenAttack_FlyMachine2) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FlyMachine2 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 173
//KrakenAttack_FlyMachine3 (KrakenAttack_FlyMachine3) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FlyMachine3 extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 174
//KrakenAttack_FrontBuilding1 (KrakenAttack_FrontBuilding1) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding1 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 175
//KrakenAttack_FrontBuilding2 (KrakenAttack_FrontBuilding2) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding2 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 176
//KrakenAttack_FrontBuilding3 (KrakenAttack_FrontBuilding3) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding3 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 177
//KrakenAttack_FrontBuilding4 (KrakenAttack_FrontBuilding4) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding4 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 178
//KrakenAttack_FrontBuilding5 (KrakenAttack_FrontBuilding5) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding5 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 179
//KrakenAttack_FrontBuilding6 (KrakenAttack_FrontBuilding6) package { import flash.display.*; import mx.core.*; public class KrakenAttack_FrontBuilding6 extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 180
//KrakenAttack_HurtSound (KrakenAttack_HurtSound) package { import flash.display.*; import mx.core.*; public class KrakenAttack_HurtSound extends SoundAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 181
//KrakenAttack_Kraken (KrakenAttack_Kraken) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Kraken extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 182
//KrakenAttack_KrakenLeg (KrakenAttack_KrakenLeg) package { import flash.display.*; import mx.core.*; public class KrakenAttack_KrakenLeg extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 183
//KrakenAttack_Smoke (KrakenAttack_Smoke) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Smoke extends SpriteAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 184
//KrakenAttack_Splash (KrakenAttack_Splash) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Splash extends MovieClipAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 185
//KrakenAttack_SplashSound (KrakenAttack_SplashSound) package { import flash.display.*; import mx.core.*; public class KrakenAttack_SplashSound extends SoundAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 186
//KrakenAttack_WaterMine (KrakenAttack_WaterMine) package { import flash.display.*; import mx.core.*; public class KrakenAttack_WaterMine extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 187
//KrakenAttack_WaterSnd (KrakenAttack_WaterSnd) package { import flash.display.*; import mx.core.*; public class KrakenAttack_WaterSnd extends SoundAsset { public var back_btn:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var main_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 188
//KrakenAttack_Waves (KrakenAttack_Waves) package { import flash.display.*; import mx.core.*; public class KrakenAttack_Waves extends MovieClipAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 189
//KrakenAttack_ZoomSound (KrakenAttack_ZoomSound) package { import flash.display.*; import mx.core.*; public class KrakenAttack_ZoomSound extends SoundAsset { public var back_btn:DisplayObject; public var waveAnimation_mc:DisplayObject; public var play_btn:DisplayObject; public var head_mc:DisplayObject; public var menu_Btn:DisplayObject; public var help_btn:DisplayObject; public var distance_mc:DisplayObject; public var krakenBite_mc:DisplayObject; public var text_txt:DisplayObject; public var sound_Mc:DisplayObject; public var combo_mc:DisplayObject; public var main_mc:DisplayObject; public var sound_btn:DisplayObject; public var more_btn:DisplayObject; public var keyHelp_mc:DisplayObject; public var leaderBoard_btn:DisplayObject; public var help_Btn:DisplayObject; } }//package
Section 190
//LogoCsharks (LogoCsharks) package { import flash.display.*; public dynamic class LogoCsharks extends Sprite { } }//package
Section 191
//LogoOIG (LogoOIG) package { import flash.display.*; public dynamic class LogoOIG extends Sprite { } }//package
Section 192
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; 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 193
//ShareThis (ShareThis) package { import flash.display.*; public dynamic class ShareThis extends SimpleButton { } }//package
Section 194
//Utils (Utils) package { public class Utils { public function Utils(){ super(); } public static function minMaxPerc(fromMin:Number, fromMax:Number, fromVal:Number, toMin:Number, toMax:Number):Number{ var perc:Number; var temp:Number; var reverse:Boolean; var tmpFMin:Number = fromMin; var tmpFMax:Number = fromMax; if (tmpFMin > tmpFMax){ reverse = true; temp = tmpFMax; tmpFMax = tmpFMin; tmpFMin = temp; }; tmpFMax = (tmpFMax - tmpFMin); fromVal = (fromVal - tmpFMin); tmpFMin = 0; perc = (fromVal / tmpFMax); if (reverse){ perc = (1 - perc); }; perc = Number(perc.toFixed(2)); reverse = false; tmpFMin = toMin; tmpFMax = toMax; if (tmpFMin > tmpFMax){ reverse = true; temp = tmpFMax; tmpFMax = tmpFMin; tmpFMin = temp; }; tmpFMax = (tmpFMax - tmpFMin); if (reverse){ perc = (1 - perc); }; perc = (perc * tmpFMax); perc = (perc + tmpFMin); return (perc); } public static function distBetween(objA, objB):Number{ var dx:Number = (objA.x - objB.x); var dy:Number = (objA.y - objB.y); return (Math.sqrt(((dx * dx) + (dy * dy)))); } public static function almostEqual(num1:Number, num2:Number, pow:Number):Boolean{ var e:Number = Math.pow(10, -(pow)); return ((Math.abs((num1 - num2)) <= (e * Math.abs(num1)))); } } }//package

Library Items

Symbol 1 Font {com.csharks.juwalbose.cFlashtory.preloaders.PreloaderMochi_MenuFont}
Symbol 2 Font {com.csharks.juwalbose.cFlashtory.preloaders.PreloaderMochi_ButtonFont}
Symbol 3 BitmapUsed by:4
Symbol 4 GraphicUses:3Used by:28
Symbol 5 GraphicUsed by:28
Symbol 6 BitmapUsed by:8
Symbol 7 BitmapUsed by:8
Symbol 8 GraphicUses:6 7Used by:28
Symbol 9 BitmapUsed by:10
Symbol 10 GraphicUses:9Used by:28
Symbol 11 GraphicUsed by:28
Symbol 12 GraphicUsed by:28
Symbol 13 GraphicUsed by:28
Symbol 14 GraphicUsed by:28
Symbol 15 GraphicUsed by:28
Symbol 16 GraphicUsed by:28
Symbol 17 GraphicUsed by:28
Symbol 18 GraphicUsed by:28
Symbol 19 GraphicUsed by:28
Symbol 20 GraphicUsed by:28
Symbol 21 GraphicUsed by:28
Symbol 22 GraphicUsed by:28
Symbol 23 GraphicUsed by:28
Symbol 24 GraphicUsed by:28
Symbol 25 GraphicUsed by:28
Symbol 26 GraphicUsed by:28
Symbol 27 GraphicUsed by:28
Symbol 28 MovieClip {IntroOIG_mc} [IntroOIG_mc]Uses:4 5 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Symbol 29 GraphicUsed by:61
Symbol 30 MovieClipUsed by:61
Symbol 31 GraphicUsed by:37
Symbol 32 GraphicUsed by:37
Symbol 33 ShapeTweeningUsed by:37
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClipUses:34Used by:37
Symbol 36 GraphicUsed by:37
Symbol 37 MovieClipUses:31 32 33 35 36Used by:61
Symbol 38 GraphicUsed by:43
Symbol 39 GraphicUsed by:43
Symbol 40 GraphicUsed by:43 47 52
Symbol 41 GraphicUsed by:43
Symbol 42 GraphicUsed by:43 47
Symbol 43 ButtonUses:38 39 40 41 42Used by:61
Symbol 44 GraphicUsed by:47
Symbol 45 GraphicUsed by:47
Symbol 46 GraphicUsed by:47
Symbol 47 ButtonUses:44 45 40 46 42Used by:61
Symbol 48 GraphicUsed by:52
Symbol 49 GraphicUsed by:52
Symbol 50 GraphicUsed by:52
Symbol 51 GraphicUsed by:52
Symbol 52 MovieClipUses:40 48 49 50 51Used by:61
Symbol 53 FontUsed by:54
Symbol 54 EditableTextUses:53Used by:55
Symbol 55 MovieClipUses:54Used by:61
Symbol 56 GraphicUsed by:60
Symbol 57 GraphicUsed by:59
Symbol 58 GraphicUsed by:59
Symbol 59 MovieClipUses:57 58Used by:60
Symbol 60 MovieClipUses:56 59Used by:61
Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc]Uses:29 30 37 43 47 52 55 60
Symbol 62 GraphicUsed by:72 88 128 129
Symbol 63 GraphicUsed by:72 128
Symbol 64 GraphicUsed by:72 128
Symbol 65 FontUsed by:66 68 71 83 123 124 127
Symbol 66 TextUses:65Used by:72
Symbol 67 GraphicUsed by:72 125 128 129
Symbol 68 TextUses:65Used by:72 128
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:72 128
Symbol 71 TextUses:65Used by:72 128
Symbol 72 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameWin} [GameWin_mc]Uses:62 63 64 66 67 68 70 71
Symbol 73 GraphicUsed by:87 125
Symbol 74 GraphicUsed by:87 125
Symbol 75 GraphicUsed by:87 125
Symbol 76 GraphicUsed by:87 125
Symbol 77 GraphicUsed by:87 125
Symbol 78 GraphicUsed by:81 113 114 117 119 121
Symbol 79 GraphicUsed by:81
Symbol 80 GraphicUsed by:81 113 114 119 121
Symbol 81 ButtonUses:78 79 80Used by:87
Symbol 82 GraphicUsed by:87 88
Symbol 83 TextUses:65Used by:87 88
Symbol 84 FontUsed by:86
Symbol 85 FontUsed by:86
Symbol 86 TextUses:84 85Used by:87 88
Symbol 87 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_HelpClip} [Help_mc]Uses:73 74 75 76 77 81 82 83 86
Symbol 88 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_HelpDisplay} [HelpDisplay_mc]Uses:62 82 83 86
Symbol 89 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_LeveUp} [LevelUp_mc]
Symbol 90 GraphicUsed by:111
Symbol 91 GraphicUsed by:111
Symbol 92 GraphicUsed by:111
Symbol 93 GraphicUsed by:111
Symbol 94 GraphicUsed by:111
Symbol 95 GraphicUsed by:111
Symbol 96 GraphicUsed by:111
Symbol 97 GraphicUsed by:111
Symbol 98 GraphicUsed by:111
Symbol 99 GraphicUsed by:107
Symbol 100 GraphicUsed by:107
Symbol 101 GraphicUsed by:107
Symbol 102 GraphicUsed by:107
Symbol 103 GraphicUsed by:107
Symbol 104 GraphicUsed by:107
Symbol 105 GraphicUsed by:107
Symbol 106 GraphicUsed by:107
Symbol 107 MovieClipUses:99 100 101 102 103 104 105 106Used by:111
Symbol 108 GraphicUsed by:111
Symbol 109 GraphicUsed by:111
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClip {IntroCgs_mc} [IntroCgs_mc]Uses:90 91 92 93 94 95 96 97 98 107 108 109 110
Symbol 112 GraphicUsed by:113
Symbol 113 ButtonUses:78 112 80Used by:125
Symbol 114 ButtonUses:78 80Used by:125
Symbol 115 GraphicUsed by:117
Symbol 116 GraphicUsed by:117
Symbol 117 MovieClipUses:78 115 116Used by:125
Symbol 118 GraphicUsed by:119
Symbol 119 ButtonUses:78 118 80Used by:125
Symbol 120 GraphicUsed by:121
Symbol 121 ButtonUses:78 120 80Used by:125
Symbol 122 GraphicUsed by:125 129
Symbol 123 TextUses:65Used by:125 129
Symbol 124 TextUses:65Used by:125 129
Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc]Uses:73 74 75 76 77 113 114 117 119 121 122 123 124 67
Symbol 126 Sound {com.csharks.juwalbose.cFlashtory.cFlashtory_Music} [Music]
Symbol 127 TextUses:65Used by:128
Symbol 128 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameOver} [GameOver_mc]Uses:62 63 64 68 127 67 70 71
Symbol 129 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_TemplateBg} [Template]Uses:62 122 123 124 67
Symbol 130 GraphicUsed by:131
Symbol 131 MovieClip {KrakenAttack_BgClip} [BgClip]Uses:130
Symbol 132 GraphicUsed by:138
Symbol 133 GraphicUsed by:138
Symbol 134 GraphicUsed by:138
Symbol 135 GraphicUsed by:138
Symbol 136 GraphicUsed by:138
Symbol 137 GraphicUsed by:138
Symbol 138 MovieClip {KrakenAttack_Bubble} [bubbleEffect]Uses:132 133 134 135 136 137
Symbol 139 GraphicUsed by:149
Symbol 140 ShapeTweeningUsed by:149
Symbol 141 GraphicUsed by:149
Symbol 142 GraphicUsed by:149
Symbol 143 GraphicUsed by:149
Symbol 144 GraphicUsed by:149
Symbol 145 ShapeTweeningUsed by:149
Symbol 146 GraphicUsed by:149
Symbol 147 GraphicUsed by:149
Symbol 148 GraphicUsed by:149
Symbol 149 MovieClip {KrakenAttack_Splash} [splashEffect]Uses:139 140 141 142 143 144 145 146 147 148
Symbol 150 ShapeTweeningUsed by:159
Symbol 151 ShapeTweeningUsed by:159
Symbol 152 ShapeTweeningUsed by:159
Symbol 153 ShapeTweeningUsed by:159
Symbol 154 ShapeTweeningUsed by:159
Symbol 155 ShapeTweeningUsed by:159
Symbol 156 ShapeTweeningUsed by:159
Symbol 157 ShapeTweeningUsed by:159
Symbol 158 GraphicUsed by:159
Symbol 159 MovieClipUses:150 151 152 153 154 155 156 157 158Used by:200
Symbol 160 ShapeTweeningUsed by:200
Symbol 161 ShapeTweeningUsed by:200
Symbol 162 ShapeTweeningUsed by:200
Symbol 163 ShapeTweeningUsed by:200
Symbol 164 ShapeTweeningUsed by:171
Symbol 165 ShapeTweeningUsed by:171
Symbol 166 ShapeTweeningUsed by:171
Symbol 167 ShapeTweeningUsed by:171
Symbol 168 ShapeTweeningUsed by:171
Symbol 169 ShapeTweeningUsed by:171
Symbol 170 GraphicUsed by:171
Symbol 171 MovieClipUses:164 165 166 167 168 169 170Used by:200 270 272 274
Symbol 172 ShapeTweeningUsed by:178
Symbol 173 ShapeTweeningUsed by:178
Symbol 174 ShapeTweeningUsed by:178
Symbol 175 ShapeTweeningUsed by:178
Symbol 176 GraphicUsed by:178
Symbol 177 GraphicUsed by:178
Symbol 178 MovieClipUses:172 173 174 175 176 177Used by:200
Symbol 179 ShapeTweeningUsed by:184
Symbol 180 ShapeTweeningUsed by:184
Symbol 181 ShapeTweeningUsed by:184
Symbol 182 ShapeTweeningUsed by:184
Symbol 183 GraphicUsed by:184
Symbol 184 MovieClipUses:179 180 181 182 183Used by:200 274
Symbol 185 ShapeTweeningUsed by:194
Symbol 186 ShapeTweeningUsed by:194
Symbol 187 ShapeTweeningUsed by:194
Symbol 188 ShapeTweeningUsed by:194
Symbol 189 ShapeTweeningUsed by:194
Symbol 190 ShapeTweeningUsed by:194
Symbol 191 ShapeTweeningUsed by:194
Symbol 192 ShapeTweeningUsed by:194
Symbol 193 GraphicUsed by:194
Symbol 194 MovieClipUses:185 186 187 188 189 190 191 192 193Used by:200
Symbol 195 ShapeTweeningUsed by:200
Symbol 196 ShapeTweeningUsed by:200
Symbol 197 ShapeTweeningUsed by:200
Symbol 198 ShapeTweeningUsed by:200
Symbol 199 GraphicUsed by:200
Symbol 200 MovieClipUses:159 160 161 162 163 171 178 184 194 195 196 197 198 199Used by:205
Symbol 201 ShapeTweeningUsed by:204
Symbol 202 ShapeTweeningUsed by:204
Symbol 203 GraphicUsed by:204
Symbol 204 MovieClipUses:201 202 203Used by:205
Symbol 205 MovieClip {KrakenAttack_Waves} [waves]Uses:200 204
Symbol 206 GraphicUsed by:218
Symbol 207 GraphicUsed by:218 325
Symbol 208 ShapeTweeningUsed by:218
Symbol 209 ShapeTweeningUsed by:218
Symbol 210 ShapeTweeningUsed by:218
Symbol 211 GraphicUsed by:218 325
Symbol 212 GraphicUsed by:218 325
Symbol 213 ShapeTweeningUsed by:218
Symbol 214 GraphicUsed by:218
Symbol 215 ShapeTweeningUsed by:218
Symbol 216 ShapeTweeningUsed by:218
Symbol 217 GraphicUsed by:218
Symbol 218 MovieClip {KrakenAttack_FireBlob} [fireBlob]Uses:206 207 208 209 210 211 212 213 214 215 216 217
Symbol 219 GraphicUsed by:222 223
Symbol 220 GraphicUsed by:222 223
Symbol 221 GraphicUsed by:222 223
Symbol 222 MovieClipUses:219 220 221Used by:224
Symbol 223 MovieClip {KrakenAttack_KrakenLeg} [krakenleg]Uses:219 220 221Used by:224
Symbol 224 MovieClipUses:222 223Used by:238
Symbol 225 GraphicUsed by:237
Symbol 226 ShapeTweeningUsed by:229
Symbol 227 ShapeTweeningUsed by:229
Symbol 228 GraphicUsed by:229 232
Symbol 229 MovieClipUses:226 227 228Used by:237
Symbol 230 ShapeTweeningUsed by:232
Symbol 231 ShapeTweeningUsed by:232
Symbol 232 MovieClipUses:230 231 228Used by:237
Symbol 233 GraphicUsed by:237
Symbol 234 GraphicUsed by:237
Symbol 235 GraphicUsed by:237
Symbol 236 GraphicUsed by:237
Symbol 237 MovieClipUses:225 229 232 233 234 235 236Used by:238
Symbol 238 MovieClip {KrakenAttack_Kraken} [kraken]Uses:224 237
Symbol 239 Sound {KrakenAttack_ExplosionSound} [explosionSnd]
Symbol 240 BitmapUsed by:241
Symbol 241 GraphicUses:240Used by:242
Symbol 242 MovieClip {LogoOIG} [LogoOIG]Uses:241
Symbol 243 ShapeTweeningUsed by:247
Symbol 244 GraphicUsed by:247
Symbol 245 ShapeTweeningUsed by:247
Symbol 246 GraphicUsed by:247
Symbol 247 MovieClipUses:243 244 245 246Used by:270 272 274
Symbol 248 GraphicUsed by:270
Symbol 249 GraphicUsed by:270 272 274 292 297 302
Symbol 250 GraphicUsed by:270 272 274 292 297 302
Symbol 251 GraphicUsed by:270 272 274 292 297 302
Symbol 252 GraphicUsed by:270 272 274 292 297 302
Symbol 253 GraphicUsed by:270 272 274 292 297 302
Symbol 254 GraphicUsed by:270 272 274 292 297 302
Symbol 255 GraphicUsed by:270 272 274 292 297 302
Symbol 256 GraphicUsed by:270 272 274 292 297 302
Symbol 257 GraphicUsed by:270 272 274 292 297 302
Symbol 258 GraphicUsed by:270 272 274 292 297 302
Symbol 259 GraphicUsed by:270 272 274 292 297 302
Symbol 260 GraphicUsed by:270 272 274 292 297 302
Symbol 261 GraphicUsed by:270 272 274 292 297 302
Symbol 262 GraphicUsed by:270 272 274 292 297 302
Symbol 263 GraphicUsed by:270 272 274 292 297 302
Symbol 264 GraphicUsed by:270 272 274 292 297 302
Symbol 265 GraphicUsed by:270 272 274 292 297 302
Symbol 266 GraphicUsed by:270 272 274 292 297 302
Symbol 267 GraphicUsed by:270 272 274 292 297 302
Symbol 268 GraphicUsed by:270 272 274 292 297 302
Symbol 269 GraphicUsed by:270 272 274 292 297 302
Symbol 270 MovieClip {KrakenAttack_Boat3} [boat3]Uses:247 171 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
Symbol 271 GraphicUsed by:272
Symbol 272 MovieClip {KrakenAttack_Boat2} [boat2]Uses:271 247 171 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
Symbol 273 GraphicUsed by:274
Symbol 274 MovieClip {KrakenAttack_Boat1} [boat1]Uses:247 171 184 273 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
Symbol 275 Sound {KrakenAttack_SplashSound} [splashSnd]
Symbol 276 BitmapUsed by:277
Symbol 277 GraphicUses:276Used by:278
Symbol 278 MovieClip {LogoCsharks} [LogoCsharks]Uses:277
Symbol 279 GraphicUsed by:280
Symbol 280 MovieClip {KrakenAttack_DolphinSkeleton} [dolphinSkeleton]Uses:279
Symbol 281 GraphicUsed by:292
Symbol 282 GraphicUsed by:292
Symbol 283 GraphicUsed by:284
Symbol 284 MovieClipUses:283Used by:292 297 302
Symbol 285 GraphicUsed by:292
Symbol 286 GraphicUsed by:287
Symbol 287 MovieClipUses:286Used by:292 297 302
Symbol 288 GraphicUsed by:292
Symbol 289 GraphicUsed by:292 297 302
Symbol 290 GraphicUsed by:292 297 302
Symbol 291 GraphicUsed by:292 297 302
Symbol 292 MovieClip {KrakenAttack_FlyMachine2} [flyMachine2]Uses:281 282 284 285 287 249 250 251 252 253 254 288 255 256 257 289 258 259 260 261 290 262 263 264 291 265 266 267 268 269
Symbol 293 GraphicUsed by:297
Symbol 294 GraphicUsed by:297
Symbol 295 GraphicUsed by:297
Symbol 296 GraphicUsed by:297
Symbol 297 MovieClip {KrakenAttack_FlyMachine1} [flyMachine1]Uses:293 294 284 295 287 249 250 251 296 252 253 254 289 255 256 257 290 258 259 260 261 291 262 263 264 265 266 267 268 269
Symbol 298 GraphicUsed by:302
Symbol 299 GraphicUsed by:302
Symbol 300 GraphicUsed by:302
Symbol 301 GraphicUsed by:302
Symbol 302 MovieClip {KrakenAttack_FlyMachine3} [flyMachine3]Uses:298 284 299 300 287 249 250 251 252 253 254 301 255 256 257 289 258 259 260 290 262 263 261 291 265 264 266 267 268 269
Symbol 303 Sound {KrakenAttack_HurtSound} [hurtSnd]
Symbol 304 GraphicUsed by:305
Symbol 305 MovieClip {KrakenAttack_Smoke} [smoke]Uses:304
Symbol 306 Sound {KrakenAttack_WaterSnd} [waterSnd]
Symbol 307 GraphicUsed by:315
Symbol 308 GraphicUsed by:315
Symbol 309 GraphicUsed by:315
Symbol 310 GraphicUsed by:315
Symbol 311 GraphicUsed by:315
Symbol 312 GraphicUsed by:315
Symbol 313 GraphicUsed by:315
Symbol 314 GraphicUsed by:315
Symbol 315 MovieClip {KrakenAttack_Dolphin} [dolphin]Uses:307 308 309 310 311 312 313 314
Symbol 316 GraphicUsed by:325
Symbol 317 GraphicUsed by:325
Symbol 318 GraphicUsed by:325
Symbol 319 ShapeTweeningUsed by:325
Symbol 320 ShapeTweeningUsed by:325
Symbol 321 GraphicUsed by:325
Symbol 322 ShapeTweeningUsed by:325
Symbol 323 ShapeTweeningUsed by:325
Symbol 324 GraphicUsed by:325
Symbol 325 MovieClip {KrakenAttack_WaterMine} [waterMine]Uses:316 207 317 318 319 320 211 212 321 322 323 324
Symbol 326 GraphicUsed by:327
Symbol 327 MovieClip {KrakenAttack_BackBuilding2} [backbuilding2]Uses:326
Symbol 328 GraphicUsed by:329
Symbol 329 MovieClip {KrakenAttack_BackBuilding3} [backbuilding3]Uses:328
Symbol 330 GraphicUsed by:348
Symbol 331 BitmapUsed by:332
Symbol 332 GraphicUses:331Used by:348
Symbol 333 FontUsed by:334 335 336 337 338 339 340 341 342 343 344 345 346 347
Symbol 334 TextUses:333Used by:348
Symbol 335 TextUses:333Used by:348
Symbol 336 TextUses:333Used by:348
Symbol 337 TextUses:333Used by:348
Symbol 338 TextUses:333Used by:348
Symbol 339 TextUses:333Used by:348
Symbol 340 TextUses:333Used by:348
Symbol 341 TextUses:333Used by:348
Symbol 342 TextUses:333Used by:348
Symbol 343 TextUses:333Used by:348
Symbol 344 TextUses:333Used by:348
Symbol 345 TextUses:333Used by:348
Symbol 346 TextUses:333Used by:348
Symbol 347 TextUses:333Used by:348
Symbol 348 Button {ShareThis} [ShareThis]Uses:330 332 334 335 336 337 338 339 340 341 342 343 344 345 346 347
Symbol 349 GraphicUsed by:350
Symbol 350 MovieClip {KrakenAttack_BackBuilding1} [backbuilding1]Uses:349
Symbol 351 Sound {KrakenAttack_ZoomSound} [zoomSnd]
Symbol 352 GraphicUsed by:353
Symbol 353 MovieClip {KrakenAttack_FrontBuilding5} [frontbuilding5]Uses:352
Symbol 354 GraphicUsed by:355
Symbol 355 MovieClip {KrakenAttack_FrontBuilding4} [frontbuilding4]Uses:354
Symbol 356 GraphicUsed by:357
Symbol 357 MovieClip {KrakenAttack_FrontBuilding6} [frontbuilding6]Uses:356
Symbol 358 GraphicUsed by:359
Symbol 359 MovieClip {KrakenAttack_FrontBuilding1} [frontbuilding1]Uses:358
Symbol 360 GraphicUsed by:361
Symbol 361 MovieClip {KrakenAttack_FrontBuilding3} [frontbuilding3]Uses:360
Symbol 362 GraphicUsed by:363
Symbol 363 MovieClip {KrakenAttack_FrontBuilding2} [frontbuilding2]Uses:362
Symbol 364 GraphicUsed by:366
Symbol 365 GraphicUsed by:366
Symbol 366 MovieClip {KrakenAttack_Arrow} [arrow]Uses:364 365
Symbol 367 GraphicUsed by:368
Symbol 368 MovieClip {com.csharks.juwalbose.utils.ui.SceneManager_ButtonDownClip} [ButtonDownClip]Uses:367
Symbol 369 GraphicUsed by:370
Symbol 370 MovieClip {KrakenAttack_ButtonUpClip} [ButtonUpClip]Uses:369
Symbol 371 GraphicUsed by:372
Symbol 372 MovieClip {KrakenAttack_ButtonOverClip} [ButtonOverClip]Uses:371

Instance Names

"text_txt"Symbol 55 MovieClip Frame 1Symbol 54 EditableText
"main_mc"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 30 MovieClip
"distance_mc"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 37 MovieClip
"help_Btn"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 43 Button
"menu_Btn"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 47 Button
"sound_Mc"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 52 MovieClip
"combo_mc"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 55 MovieClip
"keyHelp_mc"Symbol 61 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_GameClip} [Game_mc] Frame 1Symbol 60 MovieClip
"back_btn"Symbol 87 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_HelpClip} [Help_mc] Frame 1Symbol 81 Button
"play_btn"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1Symbol 113 Button
"help_btn"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1Symbol 114 Button
"sound_btn"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1Symbol 117 MovieClip
"more_btn"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1Symbol 119 Button
"leaderBoard_btn"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1Symbol 121 Button
"waveAnimation_mc"Symbol 205 MovieClip {KrakenAttack_Waves} [waves] Frame 1Symbol 200 MovieClip
"head_mc"Symbol 238 MovieClip {KrakenAttack_Kraken} [kraken] Frame 1Symbol 237 MovieClip
"krakenBite_mc"Symbol 292 MovieClip {KrakenAttack_FlyMachine2} [flyMachine2] Frame 1Symbol 287 MovieClip
"krakenBite_mc"Symbol 297 MovieClip {KrakenAttack_FlyMachine1} [flyMachine1] Frame 1Symbol 287 MovieClip
"krakenBite_mc"Symbol 302 MovieClip {KrakenAttack_FlyMachine3} [flyMachine3] Frame 1Symbol 287 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1458 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 28 as "IntroOIG_mc"
ExportAssets (56)Timeline Frame 2Symbol 61 as "Game_mc"
ExportAssets (56)Timeline Frame 2Symbol 72 as "GameWin_mc"
ExportAssets (56)Timeline Frame 2Symbol 87 as "Help_mc"
ExportAssets (56)Timeline Frame 2Symbol 88 as "HelpDisplay_mc"
ExportAssets (56)Timeline Frame 2Symbol 89 as "LevelUp_mc"
ExportAssets (56)Timeline Frame 2Symbol 111 as "IntroCgs_mc"
ExportAssets (56)Timeline Frame 2Symbol 125 as "Menu_mc"
ExportAssets (56)Timeline Frame 2Symbol 126 as "Music"
ExportAssets (56)Timeline Frame 2Symbol 128 as "GameOver_mc"
ExportAssets (56)Timeline Frame 2Symbol 129 as "Template"
ExportAssets (56)Timeline Frame 2Symbol 131 as "BgClip"
ExportAssets (56)Timeline Frame 2Symbol 138 as "bubbleEffect"
ExportAssets (56)Timeline Frame 2Symbol 149 as "splashEffect"
ExportAssets (56)Timeline Frame 2Symbol 205 as "waves"
ExportAssets (56)Timeline Frame 2Symbol 218 as "fireBlob"
ExportAssets (56)Timeline Frame 2Symbol 238 as "kraken"
ExportAssets (56)Timeline Frame 2Symbol 239 as "explosionSnd"
ExportAssets (56)Timeline Frame 2Symbol 242 as "LogoOIG"
ExportAssets (56)Timeline Frame 2Symbol 270 as "boat3"
ExportAssets (56)Timeline Frame 2Symbol 272 as "boat2"
ExportAssets (56)Timeline Frame 2Symbol 274 as "boat1"
ExportAssets (56)Timeline Frame 2Symbol 275 as "splashSnd"
ExportAssets (56)Timeline Frame 2Symbol 223 as "krakenleg"
ExportAssets (56)Timeline Frame 2Symbol 278 as "LogoCsharks"
ExportAssets (56)Timeline Frame 2Symbol 280 as "dolphinSkeleton"
ExportAssets (56)Timeline Frame 2Symbol 292 as "flyMachine2"
ExportAssets (56)Timeline Frame 2Symbol 297 as "flyMachine1"
ExportAssets (56)Timeline Frame 2Symbol 302 as "flyMachine3"
ExportAssets (56)Timeline Frame 2Symbol 303 as "hurtSnd"
ExportAssets (56)Timeline Frame 2Symbol 305 as "smoke"
ExportAssets (56)Timeline Frame 2Symbol 306 as "waterSnd"
ExportAssets (56)Timeline Frame 2Symbol 315 as "dolphin"
ExportAssets (56)Timeline Frame 2Symbol 325 as "waterMine"
ExportAssets (56)Timeline Frame 2Symbol 327 as "backbuilding2"
ExportAssets (56)Timeline Frame 2Symbol 329 as "backbuilding3"
ExportAssets (56)Timeline Frame 2Symbol 348 as "ShareThis"
ExportAssets (56)Timeline Frame 2Symbol 350 as "backbuilding1"
ExportAssets (56)Timeline Frame 2Symbol 351 as "zoomSnd"
ExportAssets (56)Timeline Frame 2Symbol 353 as "frontbuilding5"
ExportAssets (56)Timeline Frame 2Symbol 355 as "frontbuilding4"
ExportAssets (56)Timeline Frame 2Symbol 357 as "frontbuilding6"
ExportAssets (56)Timeline Frame 2Symbol 359 as "frontbuilding1"
ExportAssets (56)Timeline Frame 2Symbol 361 as "frontbuilding3"
ExportAssets (56)Timeline Frame 2Symbol 363 as "frontbuilding2"
ExportAssets (56)Timeline Frame 2Symbol 366 as "arrow"
ExportAssets (56)Timeline Frame 2Symbol 368 as "ButtonDownClip"
ExportAssets (56)Timeline Frame 2Symbol 370 as "ButtonUpClip"
ExportAssets (56)Timeline Frame 2Symbol 372 as "ButtonOverClip"
EnableDebugger2 (64)Timeline Frame 131 bytes "u.$1$7m$c7amXnQ45p/wdqw1bmFNB/."
DebugMX1 (63)Timeline Frame 1
SerialNumber (41)Timeline Frame 1

Labels

"com_csharks_juwalbose_cFlashtory_preloaders_PreloaderMochi"Frame 1
"KrakenAttack"Frame 2
"menu"Symbol 87 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_HelpClip} [Help_mc] Frame 1
"menu"Symbol 125 MovieClip {com.csharks.juwalbose.cFlashtory.cFlashtory_MenuClip} [Menu_mc] Frame 1
"idle"Symbol 270 MovieClip {KrakenAttack_Boat3} [boat3] Frame 1
"explode"Symbol 270 MovieClip {KrakenAttack_Boat3} [boat3] Frame 14
"idle"Symbol 272 MovieClip {KrakenAttack_Boat2} [boat2] Frame 1
"explode"Symbol 272 MovieClip {KrakenAttack_Boat2} [boat2] Frame 14
"idle"Symbol 274 MovieClip {KrakenAttack_Boat1} [boat1] Frame 1
"explode"Symbol 274 MovieClip {KrakenAttack_Boat1} [boat1] Frame 15
"idle"Symbol 292 MovieClip {KrakenAttack_FlyMachine2} [flyMachine2] Frame 1
"pull"Symbol 292 MovieClip {KrakenAttack_FlyMachine2} [flyMachine2] Frame 11
"explode"Symbol 292 MovieClip {KrakenAttack_FlyMachine2} [flyMachine2] Frame 21
"idle"Symbol 297 MovieClip {KrakenAttack_FlyMachine1} [flyMachine1] Frame 1
"pull"Symbol 297 MovieClip {KrakenAttack_FlyMachine1} [flyMachine1] Frame 11
"explode"Symbol 297 MovieClip {KrakenAttack_FlyMachine1} [flyMachine1] Frame 21
"idle"Symbol 302 MovieClip {KrakenAttack_FlyMachine3} [flyMachine3] Frame 1
"pull"Symbol 302 MovieClip {KrakenAttack_FlyMachine3} [flyMachine3] Frame 11
"explode"Symbol 302 MovieClip {KrakenAttack_FlyMachine3} [flyMachine3] Frame 21




http://swfchan.com/27/132916/info.shtml
Created: 17/2 -2019 09:06:59 Last modified: 17/2 -2019 09:06:59 Server time: 09/05 -2024 12:51:00