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

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

Gridshock.swf

This is the info page for
Flash #67653

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


Text
Gridshock

IS LOADING...

<p align="left"><font face="Orator Std Medium" size="14" color="#bbff00" letterSpacing="0.000000" kerning="1">DEBUG</font></p>

<p align="center"><font face="Cracked" size="120" color="#ffffff" letterSpacing="0.000000" kerning="1">GAME OVER!</font></p>

<p align="center"><font face="Cracked" size="60" color="#ffffff" letterSpacing="0.000000" kerning="1">click to play again</font></p>

<p align="right"><font face="Orator Std Medium" size="24" color="#bbff00" letterSpacing="-0.900000" kerning="1">000312345</font></p>

SCORE

<p align="center"><font face="Orator Std Medium" size="16" color="#bbff00" letterSpacing="-0.900000" kerning="1">LEVEL 1</font></p>

P = PAUSE    R = RESTART GAME    S = TOGGLE SOUND

BY BOWLER HAT GAMES

Gridshock

BOWLER HAT GAMES

CREATED BY

A NEW ROW is added to
the grid when the
TIMER reaches the top.
Don't let the whole grid
light up!

Higher LEVELS mean
that the timer fills up
FASTER. Only the best
players will be able to
keep up!

CLICK ANYWHERE TO CONTINUE

Use your MOUSE to activate a new light on the
grid. Try to MATCH THREE OR MORE connecting
lights to earn points and clear the grid before it
fills up. Make more than one match in a row to
earn BIG COMBO POINTS!

KEYBOARD CONTROLS: Use the UP and DOWN arrow keys and the SPACEBAR.

ActionScript [AS3]

Section 1
//GameRoot (com.bowlerhatgames.display.GameRoot) package com.bowlerhatgames.display { import flash.display.*; import flash.events.*; import net.hires.debug.*; import flash.net.*; import flash.ui.*; public class GameRoot extends Sprite { private var _stats:Stats; public function GameRoot(){ this.createContextMenuItems(); this.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler, false, 10000); } protected function playMoreItemSelectHandler(_arg1:ContextMenuEvent):void{ navigateToURL(new URLRequest("http://bowlerhatgames.com/"), "_blank"); } private function removedFromStageHandler(_arg1:Event):void{ if (this._stats){ this.stage.removeChild(this._stats); this._stats = null; }; if (this.loaderInfo.parentAllowsChild){ this.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); }; } private function addedToStageHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this.createDebugDashboard(); this.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler); } private function keyDownHandler(_arg1:KeyboardEvent):void{ if ((((((Keyboard.UP == _arg1.keyCode)) && (_arg1.altKey))) && (_arg1.ctrlKey))){ if (this._stats){ this._stats.visible = !(this._stats.visible); }; }; } protected function createdByItemSelectHandler(_arg1:ContextMenuEvent):void{ navigateToURL(new URLRequest("http://bowlerhatgames.com/"), "_blank"); } protected function createDebugDashboard():void{ if (!this.loaderInfo.parentAllowsChild){ return; }; this._stats = new Stats(); this._stats.visible = false; this.stage.addChildAt(this._stats, 1); this.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false, 0, true); } protected function createContextMenuItems():void{ var _local1:ContextMenu = new ContextMenu(); _local1.hideBuiltInItems(); var _local2:ContextMenuItem = new ContextMenuItem("Play More Games!", true); _local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, playMoreItemSelectHandler); var _local3:ContextMenuItem = new ContextMenuItem("Created by Bowler Hat Games"); _local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, createdByItemSelectHandler); _local1.customItems = [_local2, _local3]; this.contextMenu = _local1; } } }//package com.bowlerhatgames.display
Section 2
//ColorFlash (com.bowlerhatgames.effects.gs.ColorFlash) package com.bowlerhatgames.effects.gs { import gs.*; import org.josht.utils.*; import gs.plugins.*; public class ColorFlash extends TweenMax { public function ColorFlash(_arg1:Object, _arg2:uint=0xFFFFFF, _arg3:Number=1, _arg4:int=1, _arg5:Number=0.05){ _arg3 = Math.max(Math.min(_arg3, 1), 0); var _local6:Number = (1 - _arg3); var _local7:uint = (ColorUtil.red(_arg2) * _arg3); var _local8:uint = (ColorUtil.green(_arg2) * _arg3); var _local9:uint = (ColorUtil.blue(_arg2) * _arg3); super(_arg1, _arg5, {colorTransform:{redMultiplier:_local6, greenMultiplier:_local6, blueMultiplier:_local6, redOffset:_local7, greenOffset:_local8, blueOffset:_local9}, repeat:((_arg4 * 2) - 1), yoyo:true}); } TweenPlugin.activate([ColorTransformPlugin]); } }//package com.bowlerhatgames.effects.gs
Section 3
//ActionSound (com.bowlerhatgames.gridshock.assets.soundfx.ActionSound) package com.bowlerhatgames.gridshock.assets.soundfx { import com.bowlerhatgames.gridshock.*; import flash.media.*; import mx.core.*; public class ActionSound extends SoundAsset { override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{ if (GlobalSettings.defaultSettings.soundsOff){ return (null); }; return (super.play(_arg1, _arg2, _arg3)); } } }//package com.bowlerhatgames.gridshock.assets.soundfx
Section 4
//FinalRowWarningSound (com.bowlerhatgames.gridshock.assets.soundfx.FinalRowWarningSound) package com.bowlerhatgames.gridshock.assets.soundfx { import com.bowlerhatgames.gridshock.*; import flash.media.*; import mx.core.*; public class FinalRowWarningSound extends SoundAsset { override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{ if (GlobalSettings.defaultSettings.soundsOff){ return (null); }; return (super.play(_arg1, _arg2, _arg3)); } } }//package com.bowlerhatgames.gridshock.assets.soundfx
Section 5
//MatchSound (com.bowlerhatgames.gridshock.assets.soundfx.MatchSound) package com.bowlerhatgames.gridshock.assets.soundfx { import com.bowlerhatgames.gridshock.*; import flash.media.*; import mx.core.*; public class MatchSound extends SoundAsset { override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{ if (GlobalSettings.defaultSettings.soundsOff){ return (null); }; return (super.play(_arg1, _arg2, _arg3)); } } }//package com.bowlerhatgames.gridshock.assets.soundfx
Section 6
//NewLevelSound (com.bowlerhatgames.gridshock.assets.soundfx.NewLevelSound) package com.bowlerhatgames.gridshock.assets.soundfx { import com.bowlerhatgames.gridshock.*; import flash.media.*; import mx.core.*; public class NewLevelSound extends SoundAsset { override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{ if (GlobalSettings.defaultSettings.soundsOff){ return (null); }; return (super.play(_arg1, _arg2, _arg3)); } } }//package com.bowlerhatgames.gridshock.assets.soundfx
Section 7
//NewRowSound (com.bowlerhatgames.gridshock.assets.soundfx.NewRowSound) package com.bowlerhatgames.gridshock.assets.soundfx { import com.bowlerhatgames.gridshock.*; import flash.media.*; import mx.core.*; public class NewRowSound extends SoundAsset { override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{ if (GlobalSettings.defaultSettings.soundsOff){ return (null); }; return (super.play(_arg1, _arg2, _arg3)); } } }//package com.bowlerhatgames.gridshock.assets.soundfx
Section 8
//GameBoard (com.bowlerhatgames.gridshock.GameBoard) package com.bowlerhatgames.gridshock { import flash.display.*; import flash.events.*; import gs.*; import flash.geom.*; import mochi.as3.*; import com.yahoo.astra.utils.*; import com.bowlerhatgames.effects.gs.*; import com.bowlerhatgames.gridshock.assets.soundfx.*; import flash.utils.*; import flash.text.*; import flash.net.*; import flash.errors.*; import flash.ui.*; public class GameBoard extends Sprite { private var _initialized:Boolean;// = false private var _matchTimer:Timer; private var _newRowTimerStartTime:int; public var buttonBarLeft:Sprite; private var _lights:Array; public var grid:Sprite; private var _progressBarFullEffect:TweenMax; private var _currentColor:uint;// = 0 private var _comboPoints:uint; private var _paused:Boolean;// = true private var _showHideNotification:TweenMax; public var lightDebugger:LightDebugger; public var actionIndicator:Sprite; private var _ignoreStateChanges:Boolean;// = false private var _level:int;// = 1 public var scoreField:TextField; private var _score:uint;// = 0 private var _progressBarTimer:Timer; private var _lastMatchSound:int; public var progressBar:ProgressLight; private var _nextColor:uint;// = 0 private var _activeButton:LightBase;// = null private var _leftButtons:Array; public var moreGamesButton:Sprite; public var nextColorLight:LightBase; private var _newRowTimerSavedTime:int; private var _progressBarDelay:int; public var levelField:TextField; private var _animatingLights:Array; private var _matchCount:int; public var notification:Notification; private var _progressBarFlag:Boolean;// = false private var _objectives:Array; private var _mochiContainer:MovieClip; private static const OBJECTIVES:Array = [10000, 25000, 50000, 100000, 150000, 200000, 300000, 400000, 550000, 700000, 850000, 1000000]; private static const ROW_TIMER_DELAY:int = 15000; private static const PROGRESS_UPDATE_TIMER_DELAY:int = 20; private static const ADDITIONAL_ITEM_MATCH_SCORE:uint = 500; private static const THREE_ITEM_MATCH_SCORE:uint = 1000; private static const SINGLE_MOVE_SCORE:uint = 100; private static const LIGHTS_PER_ROW:int = 12; public function GameBoard(){ _lights = []; _leftButtons = []; _animatingLights = []; super(); this.buttonBarLeft.mouseEnabled = (this.buttonBarLeft.mouseChildren = false); this.initialize(); } private function stageKeyDownHandler(_arg1:KeyboardEvent):void{ var _local2:int; if (((!(this._initialized)) || (this.paused))){ return; }; switch (_arg1.keyCode){ case Keyboard.UP: if (!this.activeButton){ this.activeButton = LightBase(this._leftButtons[(this._leftButtons.length - 1)]); break; }; _local2 = this._leftButtons.indexOf(this._activeButton); _local2--; _local2 = Math.max(_local2, 0); this.activeButton = LightBase(this._leftButtons[_local2]); break; case Keyboard.DOWN: if (!this.activeButton){ this.activeButton = LightBase(this._leftButtons[0]); break; }; _local2 = this._leftButtons.indexOf(this._activeButton); _local2++; _local2 = Math.min(_local2, (this._leftButtons.length - 1)); this.activeButton = LightBase(this._leftButtons[_local2]); break; case Keyboard.SPACE: if (!this.activeButton){ break; }; this.action(this.activeButton); break; }; } public function set level(_arg1:int):void{ this._level = _arg1; this.levelField.text = ("LEVEL " + this._level.toString()); } private function lightButtonRollOverHandler(_arg1:MouseEvent):void{ var _local2:LightBase = LightBase(_arg1.currentTarget); this.activeButton = _local2; } public function set score(_arg1:uint):void{ this._score = _arg1; this.scoreField.text = StringUtil.padFront(this._score.toString(), 9, "0"); } public function get paused():Boolean{ return (this._paused); } public function get nextColor():uint{ return (this._nextColor); } private function matchTimerCompleteHandler(_arg1:TimerEvent):void{ this.endCombo(); } private function action(_arg1:LightBase):void{ var _local7:int; var _local8:LightBase; var _local9:int; var _local10:LightBase; var _local2:int = this._leftButtons.indexOf(_arg1); var _local3:LightBase = this._lights[(LIGHTS_PER_ROW * _local2)]; if (((!((_local3.currentState == LightBase.STATE_OFF))) && (!((_local3.currentState == LightBase.STATE_FLASH))))){ new FinalRowWarningSound().play(); return; }; if (this._matchTimer){ this.endCombo(); }; var _local4:int = (this._lights.length / LIGHTS_PER_ROW); var _local5:int = (this._lights.length / _local4); var _local6:int; while (_local6 < _local5) { _local7 = ((LIGHTS_PER_ROW * _local2) + _local6); _local8 = LightBase(this._lights[_local7]); _local8.color = this.currentColor; _local9 = (((LIGHTS_PER_ROW * _local2) + _local6) + 1); _local10 = (this._lights[_local9] as LightBase); if ((((((_local6 == (_local5 - 1))) || (!(_local10)))) || (((!((_local10.currentState == LightBase.STATE_OFF))) && (!((_local10.currentState == LightBase.STATE_FLASH))))))){ _local8.currentState = LightBase.STATE_ACTIVATING; new ActionSound().play(); this.score = (this.score + SINGLE_MOVE_SCORE); break; } else { _local8.currentState = LightBase.STATE_FLASH; }; _local6++; }; _local3 = this._lights[(LIGHTS_PER_ROW * _local2)]; if (((!((_local3.currentState == LightBase.STATE_OFF))) && (!((_local3.currentState == LightBase.STATE_FLASH))))){ new FinalRowWarningSound().play(); }; this.currentColor = this.nextColor; this.nextColor = this.randomColor(); _arg1.color = this.currentColor; } private function lightStateChangeHandler(_arg1:Event):void{ var _local4:int; var _local2:LightBase = LightBase(_arg1.currentTarget); if (((!((_local2.currentState == LightBase.STATE_ON))) && (!((_local2.currentState == LightBase.STATE_OFF))))){ if (this._animatingLights.indexOf(_local2) < 0){ this._animatingLights.push(_local2); }; } else { _local4 = this._animatingLights.indexOf(_local2); if (_local4 >= 0){ this._animatingLights.splice(_local4, 1); }; }; if (((this._progressBarFlag) && ((this._animatingLights.length == 0)))){ this._progressBarFlag = false; this.handleProgressBar(); }; if (((this._ignoreStateChanges) || (!(this._initialized)))){ return; }; var _local3:int = this._lights.indexOf(_local2); if (_local2.currentState == LightBase.STATE_ON){ this.handleMatchesAtIndex(_local3); }; this.gravity(); } private function addStageEventsAndStart():void{ this.graphics.clear(); this.graphics.beginFill(0xFF00FF, 0); this.graphics.drawRect(0, 0, this.loaderInfo.width, this.loaderInfo.height); this.graphics.endFill(); this.stage.addEventListener(KeyboardEvent.KEY_UP, stageKeyUpHandler); this.stage.addEventListener(KeyboardEvent.KEY_DOWN, stageKeyDownHandler); this.stage.addEventListener(MouseEvent.MOUSE_MOVE, stageMouseMoveHandler); this.paused = false; } private function progressBarTimerUpdateHandler(_arg1:TimerEvent):void{ var _local2:Number = ((this._newRowTimerSavedTime + (getTimer() - this._newRowTimerStartTime)) / this._progressBarDelay); this.progressBar.progress = Math.min(1, _local2); if (_local2 >= 1){ this._progressBarTimer.stop(); new NewRowSound().play(); this._progressBarFullEffect = new ColorFlash(this.progressBar, 0xFFFFFF, 1, 2); this._progressBarFullEffect.addEventListener(Event.COMPLETE, progressBarFullEffectCompleteHandler); }; } private function handleMatchesAtIndices(_arg1:Array):void{ var _local5:int; var _local6:LightBase; var _local7:uint; var _local8:uint; var _local9:int; var _local2:Array = this.getMatchesForIndices(_arg1); var _local3:int = _local2.length; var _local4:int; while (_local4 < _local3) { _local5 = (_local2[_local4] as int); _local6 = LightBase(this._lights[_local5]); _local6.currentState = LightBase.STATE_WARNING; _local4++; }; if (_local3 > 0){ _local7 = (THREE_ITEM_MATCH_SCORE + ((_local3 - 3) * ADDITIONAL_ITEM_MATCH_SCORE)); if (this._matchTimer){ this._matchCount++; this._matchTimer.reset(); this._matchTimer.start(); this.notification.primaryField.text = (this._matchCount + "x combo!"); this.showNotification(); } else { this._matchCount = 1; this._comboPoints = 0; this._matchTimer = new Timer(750, 1); this._matchTimer.addEventListener(TimerEvent.TIMER_COMPLETE, matchTimerCompleteHandler); this._matchTimer.start(); }; _local8 = (this._matchCount * _local7); this._comboPoints = (this._comboPoints + _local8); this.score = (this.score + _local8); this.notification.secondaryField.text = (this._comboPoints + " points"); _local9 = getTimer(); if ((_local9 - this._lastMatchSound) > 250){ new MatchSound().play(); this._lastMatchSound = _local9; }; this.checkForNextObjective(); }; } private function gravity():void{ var _local5:int; var _local6:int; var _local7:LightBase; var _local8:int; var _local9:int; var _local10:LightBase; var _local1:Array = []; this._ignoreStateChanges = true; var _local2:int = (this._lights.length / LIGHTS_PER_ROW); var _local3:int = (this._lights.length / _local2); var _local4:int = (_local3 - 1); while (_local4 >= 0) { _local5 = 0; while (_local5 < _local2) { _local6 = ((_local5 * _local3) + _local4); _local7 = LightBase(this._lights[_local6]); if ((((_local7.currentState == LightBase.STATE_OFF)) || ((_local7.currentState == LightBase.STATE_FLASH)))){ _local8 = _local4; while (_local8 > 0) { _local8--; _local9 = ((_local5 * _local3) + _local8); _local10 = LightBase(this._lights[_local9]); if (((!((_local10.currentState == LightBase.STATE_OFF))) && (!((_local10.currentState == LightBase.STATE_FLASH))))){ _local7.copyState(_local10); _local10.currentState = LightBase.STATE_OFF; if (_local7.currentState == LightBase.STATE_ON){ _local1.push(_local6); }; break; }; }; }; _local5++; }; _local4--; }; this._ignoreStateChanges = false; this.handleMatchesAtIndices(_local1); } private function reset():void{ var _local1:LightBase; for each (_local1 in this._lights) { _local1.currentState = LightBase.STATE_OFF; }; if (this._progressBarFullEffect){ this._progressBarFullEffect.pause(); this._progressBarFullEffect.removeEventListener(Event.COMPLETE, progressBarFullEffectCompleteHandler); this._progressBarFullEffect = null; }; this.score = 0; this.level = 1; this._objectives = OBJECTIVES.concat(); this.addRandomRow(); this.addRandomRow(); this.currentColor = this.randomColor(); this.nextColor = this.randomColor(); this.progressBar.progress = 0; this._newRowTimerSavedTime = 0; this._progressBarDelay = ROW_TIMER_DELAY; this.buttonBarLeft.mouseEnabled = (this.buttonBarLeft.mouseChildren = false); this.notification.visible = (this.notification.visible = false); this.notification.alpha = (this.notification.alpha = 0); if (this.loaderInfo.url.indexOf("file://") < 0){ MochiBot.track(this, "e3579a37"); }; } private function hideNotification():void{ if (this._showHideNotification){ this._showHideNotification.removeEventListener(Event.COMPLETE, notificationShowHideCompleteHandler); this._showHideNotification.pause(); this._showHideNotification = null; }; this._showHideNotification = new TweenMax(this.notification, 0.15, {autoAlpha:0, scaleX:0.5, scaleY:0.5}); this._showHideNotification.addEventListener(Event.COMPLETE, notificationShowHideCompleteHandler); } private function handleProgressBar():void{ this.addRandomRow(); this._newRowTimerSavedTime = 0; if (!this._paused){ this._newRowTimerStartTime = getTimer(); this._progressBarTimer.reset(); this._progressBarTimer.start(); }; } public function set nextColor(_arg1:uint):void{ this._nextColor = _arg1; this.nextColorLight.animateColor(this._nextColor); } public function set paused(_arg1:Boolean):void{ this._paused = _arg1; if (this._paused){ this._newRowTimerSavedTime = (this._newRowTimerSavedTime + (getTimer() - this._newRowTimerStartTime)); this._progressBarTimer.stop(); this.showNotification(); } else { this._newRowTimerStartTime = getTimer(); this._progressBarTimer.start(); this._initialized = true; this.hideNotification(); }; this.buttonBarLeft.mouseEnabled = (this.buttonBarLeft.mouseChildren = !(this._paused)); this.notification.primaryField.text = "PAUSED!"; this.notification.secondaryField.text = "press p to continue"; } private function checkForNextObjective():void{ if (this._objectives.length == 0){ return; }; var _local1:uint = (this._objectives[0] as uint); if (this.score >= _local1){ this._objectives.shift(); this.level++; this._newRowTimerSavedTime = 0; this._newRowTimerStartTime = getTimer(); this._progressBarDelay = (this._progressBarDelay * 0.95); new ColorFlash(this.levelField, 0xFFFFFF, 1, 2); new NewLevelSound().play(); }; } private function randomColor():uint{ var _local1:Array = [0x6EB300, 0xB36100, 28339, 0xA000B3, 0x5800B3]; return (_local1[int((Math.random() * _local1.length))]); } public function get currentColor():uint{ return (this._currentColor); } private function stageMouseMoveHandler(_arg1:MouseEvent):void{ var _local3:DisplayObject; var _local4:LightBase; if (this.lightDebugger.alpha == 0){ return; }; var _local2:Array = this.grid.getObjectsUnderPoint(new Point(this.stage.mouseX, this.stage.mouseY)); for each (_local3 in _local2) { if ((_local3.parent.parent is LightBase)){ _local4 = LightBase(_local3.parent.parent); if (this._lights.indexOf(_local4) >= 0){ this.lightDebugger.light = _local4; }; }; }; } private function endCombo():void{ this._matchTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, matchTimerCompleteHandler); this._matchTimer = null; this.hideNotification(); } private function getMatchesForIndices(_arg1:Array):Array{ var _local5:int; var _local6:Array; var _local7:int; var _local8:int; var _local9:int; var _local2:Array = []; var _local3:int = _arg1.length; var _local4:int; while (_local4 < _local3) { _local5 = (_arg1[_local4] as int); _local6 = this.getMatchesForIndex(_local5); _local7 = _local6.length; _local8 = 0; while (_local8 < _local7) { _local9 = (_local6[_local8] as int); if (_local2.indexOf(_local9) < 0){ _local2.push(_local9); }; _local8++; }; _local4++; }; return (_local2); } private function addRandomRow():void{ var _local6:int; var _local7:int; var _local8:LightBase; var _local9:int; var _local10:LightBase; var _local11:uint; this._ignoreStateChanges = true; var _local1:int = (this._lights.length / LIGHTS_PER_ROW); var _local2:int = (this._lights.length / _local1); var _local3:uint; var _local4:Boolean; var _local5:int; while (_local5 < _local2) { _local6 = 0; while (_local6 < _local1) { _local7 = ((_local6 * _local2) + _local5); _local8 = LightBase(this._lights[_local7]); if (_local5 == 0){ if (((!((_local8.currentState == LightBase.STATE_OFF))) && (!((_local8.currentState == LightBase.STATE_FLASH))))){ _local4 = true; }; }; if (_local5 < (_local2 - 1)){ _local9 = ((_local6 * _local2) + (_local5 + 1)); _local10 = LightBase(this._lights[_local9]); _local8.copyState(_local10); if ((((((_local5 == 0)) && (!((_local8.currentState == LightBase.STATE_OFF))))) && (!((_local8.currentState == LightBase.STATE_FLASH))))){ new FinalRowWarningSound().play(); }; } else { _local11 = _local3; while (_local11 == _local3) { _local11 = this.randomColor(); }; _local8.color = _local11; _local3 = _local11; _local8.currentState = LightBase.STATE_OFF; _local8.currentState = LightBase.STATE_ACTIVATING; }; _local6++; }; _local5++; }; if (_local4){ new ColorFlash(this.root, 0xFFFFFF, 1, 2); this.gameOver(); return; }; this._ignoreStateChanges = false; } private function moreGamesButtonClickHandler(_arg1:MouseEvent):void{ navigateToURL(new URLRequest(GlobalSettings.MORE_GAMES_URL), "_blank"); } private function lightButtonRollOutHandler(_arg1:MouseEvent):void{ if (this.activeButton == _arg1.currentTarget){ this.activeButton = null; }; } public function get level():int{ return (this._level); } private function notificationShowHideCompleteHandler(_arg1:Event):void{ this._showHideNotification.pause(); this._showHideNotification.removeEventListener(Event.COMPLETE, notificationShowHideCompleteHandler); this._showHideNotification = null; } private function findButtons():void{ var _local3:LightBase; var _local1:int = this.buttonBarLeft.numChildren; var _local2:int; while (_local2 < _local1) { _local3 = (this.buttonBarLeft.getChildAt(_local2) as LightBase); if (!_local3){ } else { _local3.currentState = LightBase.STATE_OFF; _local3.addEventListener(MouseEvent.ROLL_OVER, lightButtonRollOverHandler); this._leftButtons.push(_local3); }; _local2++; }; } private function initialize():void{ this.findButtons(); this.findGridLights(); this.notification.mouseEnabled = (this.notification.mouseChildren = false); this.notification.scaleX = (this.notification.scaleY = 0.5); this.moreGamesButton.buttonMode = (this.moreGamesButton.useHandCursor = true); this.moreGamesButton.addEventListener(MouseEvent.CLICK, moreGamesButtonClickHandler); this._progressBarTimer = new Timer(PROGRESS_UPDATE_TIMER_DELAY); this._progressBarTimer.addEventListener(TimerEvent.TIMER, progressBarTimerUpdateHandler); this.progressBar.currentState = LightBase.STATE_ON; this.nextColorLight.currentState = LightBase.STATE_ON; this._mochiContainer = new MovieClip(); this.addChild(this._mochiContainer); this.reset(); if (this.stage){ this.addStageEventsAndStart(); } else { this.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler); }; } public function get score():uint{ return (this._score); } private function findGridLights():void{ var _local3:LightBase; var _local4:int; var _local5:int; var _local6:int; var _local1:int = this.grid.numChildren; var _local2:int; while (_local2 < _local1) { _local3 = (this.grid.getChildAt(_local2) as LightBase); if (!_local3){ } else { _local4 = this._lights.length; _local5 = (_local4 % LIGHTS_PER_ROW); _local6 = (_local4 / LIGHTS_PER_ROW); _local3.addEventListener(Event.CHANGE, lightStateChangeHandler); this._lights.push(_local3); }; _local2++; }; } private function showNotification():void{ if (this._showHideNotification){ this._showHideNotification.removeEventListener(Event.COMPLETE, notificationShowHideCompleteHandler); this._showHideNotification.pause(); this._showHideNotification = null; }; this._showHideNotification = new TweenMax(this.notification, 0.15, {autoAlpha:1, scaleX:1, scaleY:1}); this._showHideNotification.addEventListener(Event.COMPLETE, notificationShowHideCompleteHandler); } private function addedToStageHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this.addStageEventsAndStart(); } private function gameOverClickHandler(_arg1:MouseEvent):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); var _local3:Object = {id:"38ef553de9d1dbe6", clip:this._mochiContainer, res:"640x480", color:0x88FF00, background:0, outline:0x88BB00, ad_finished:interLevelAdComplete}; MochiAd.showInterLevelAd(_local3); this.hideNotification(); } private function progressBarFullEffectCompleteHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this._progressBarFullEffect = null; this.handleProgressBar(); } private function getMatchesForIndex(_arg1:int):Array{ var _local5:int; var _local6:LightBase; var _local7:uint; var _local8:int; var _local9:int; var _local10:LightBase; var _local11:int; var _local12:LightBase; var _local13:LightBase; var _local14:int; var _local15:LightBase; var _local2:Array = []; var _local3:Array = [_arg1]; while (_local3.length > 0) { _local5 = (_local3.shift() as int); _local6 = LightBase(this._lights[_local5]); if (_local6.currentState != LightBase.STATE_ON){ throw (new IllegalOperationError("Cannot find matches for a light that is not on.")); }; _local7 = _local6.color; _local8 = (_local5 - LIGHTS_PER_ROW); if (_local8 >= 0){ _local10 = LightBase(this._lights[_local8]); if ((((((((_local2.indexOf(_local8) < 0)) && ((_local3.indexOf(_local8) < 0)))) && ((_local10.currentState == LightBase.STATE_ON)))) && ((_local10.color == _local7)))){ _local3.push(_local8); }; }; if ((_local5 % LIGHTS_PER_ROW) < (LIGHTS_PER_ROW - 1)){ _local11 = (_local5 + 1); _local12 = LightBase(this._lights[_local11]); if ((((((((_local2.indexOf(_local11) < 0)) && ((_local3.indexOf(_local11) < 0)))) && ((_local12.currentState == LightBase.STATE_ON)))) && ((_local12.color == _local7)))){ _local3.push(_local11); }; }; _local9 = (_local5 + LIGHTS_PER_ROW); if (_local9 < this._lights.length){ _local13 = LightBase(this._lights[_local9]); if ((((((((_local2.indexOf(_local9) < 0)) && ((_local3.indexOf(_local9) < 0)))) && ((_local13.currentState == LightBase.STATE_ON)))) && ((_local13.color == _local7)))){ _local3.push(_local9); }; }; if ((_local5 % LIGHTS_PER_ROW) > 0){ _local14 = (_local5 - 1); _local15 = LightBase(this._lights[_local14]); if ((((((((_local2.indexOf(_local14) < 0)) && ((_local3.indexOf(_local14) < 0)))) && ((_local15.currentState == LightBase.STATE_ON)))) && ((_local15.color == _local7)))){ _local3.push(_local14); }; }; _local2.push(_local5); }; var _local4:int = _local2.length; if (_local4 >= 3){ return (_local2); }; return ([]); } public function set activeButton(_arg1:LightBase):void{ if (this._activeButton){ this.deactivateLightButton(this._activeButton); this._activeButton = null; }; this._activeButton = _arg1; if (this._activeButton){ this.activateLightButton(this._activeButton); }; } private function interLevelAdComplete():void{ this.reset(); this.paused = false; } private function matchAnimationCompleteHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); var _local3:TweenMax = TweenMax(_arg1.currentTarget); var _local4:LightBase = LightBase(_local3.target); _local4.currentState = LightBase.STATE_DEACTIVATING; } private function stageKeyUpHandler(_arg1:KeyboardEvent):void{ if (!this._initialized){ return; }; var _local2:String = String.fromCharCode(_arg1.charCode).toLowerCase(); if (_local2 == "p"){ this.paused = !(this.paused); } else { if (_local2 == "s"){ GlobalSettings.defaultSettings.soundsOff = !(GlobalSettings.defaultSettings.soundsOff); } else { if (_local2 == "r"){ this.reset(); this.paused = false; } else { if (_local2 == "d"){ this.lightDebugger.alpha = ((this.lightDebugger.alpha == 0)) ? 1 : 0; }; }; }; }; } private function lightButtonClickHandler(_arg1:MouseEvent):void{ var _local2:LightBase = LightBase(_arg1.currentTarget); this.action(_local2); } public function set currentColor(_arg1:uint):void{ this._currentColor = _arg1; this.progressBar.animateColor(this._currentColor); } public function get activeButton():LightBase{ return (this._activeButton); } private function deactivateLightButton(_arg1:LightBase):void{ _arg1.removeEventListener(MouseEvent.ROLL_OUT, lightButtonRollOutHandler); _arg1.removeEventListener(MouseEvent.CLICK, lightButtonClickHandler); _arg1.currentState = LightBase.STATE_DEACTIVATING; _arg1.buttonMode = false; } private function gameOver():void{ this._initialized = false; this.paused = true; this.notification.primaryField.text = "GAME OVER!"; this.notification.secondaryField.text = "click to play again"; this.hideNotification(); var o:Object = {n:[5, 4, 7, 8, 12, 12, 15, 6, 13, 9, 7, 8, 10, 8, 0, 11], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; var boardID:String = o.f(0, ""); MochiScores.showLeaderboard({boardID:boardID, score:this.score, res:"640x480", onClose:function ():void{ showNotification(); addEventListener(MouseEvent.CLICK, gameOverClickHandler); }}); } private function handleMatchesAtIndex(_arg1:int):void{ this.handleMatchesAtIndices([_arg1]); } private function activateLightButton(_arg1:LightBase):void{ _arg1.addEventListener(MouseEvent.CLICK, lightButtonClickHandler); _arg1.addEventListener(MouseEvent.ROLL_OUT, lightButtonRollOutHandler); _arg1.color = this.currentColor; _arg1.currentState = LightBase.STATE_ACTIVATING; _arg1.buttonMode = true; } } }//package com.bowlerhatgames.gridshock
Section 9
//GlobalSettings (com.bowlerhatgames.gridshock.GlobalSettings) package com.bowlerhatgames.gridshock { import flash.events.*; public class GlobalSettings extends EventDispatcher { private var _soundsOff:Boolean;// = false public static const MORE_GAMES_URL:String = "http://www.frosmo.com/uk/ui/?ref=gridlock"; public static const SOUNDS_CHANGE:String = "soundsChange"; private static var _defaultSettings:GlobalSettings = new (GlobalSettings); ; public function get soundsOff():Boolean{ return (this._soundsOff); } public function set soundsOff(_arg1:Boolean):void{ this._soundsOff = _arg1; this.dispatchEvent(new Event(SOUNDS_CHANGE)); } public static function get defaultSettings():GlobalSettings{ return (_defaultSettings); } } }//package com.bowlerhatgames.gridshock
Section 10
//LightBase (com.bowlerhatgames.gridshock.LightBase) package com.bowlerhatgames.gridshock { import flash.display.*; import flash.events.*; import gs.*; import flash.geom.*; import gs.easing.*; import org.josht.utils.*; import gs.plugins.*; import gs.events.*; import com.bowlerhatgames.effects.gs.*; import flash.errors.*; public class LightBase extends Sprite { public var base:Sprite; private var _warningTween:TweenMax; private var _baseInternalAlphaTween:TweenMax; private var _color:uint;// = 0 private var _colorTween:TweenMax; protected var baseInternal:Shape; private var _currentState:String;// = "off" private var _flashTween:TimelineMax; public static const STATE_OFF:String = "off"; public static const STATE_FLASH:String = "flash"; public static const STATE_ON:String = "on"; public static const STATE_WARNING:String = "warning"; public static const STATE_ACTIVATING:String = "activating"; public static const STATE_DEACTIVATING:String = "deactivating"; public function LightBase(){ this.baseInternal = Shape(this.base.getChildAt(0)); this.baseInternal.alpha = 0; this.baseInternal.visible = false; } public function animateColor(_arg1:uint):void{ if (this._colorTween){ this._colorTween.pause(); this._colorTween = null; }; this._color = _arg1; var _local2:uint = ColorUtil.red(this._color); var _local3:uint = ColorUtil.green(this._color); var _local4:uint = ColorUtil.blue(this._color); this._colorTween = new TweenMax(this.base, 0.25, {colorTransform:{redOffset:_local2, greenOffset:_local3, blueOffset:_local4}, onComplete:colorTweenComplete}); } public function set color(_arg1:uint):void{ if (this._colorTween){ this._colorTween.pause(); TweenMax.removeTween(this._colorTween); this._colorTween = null; }; this._color = _arg1; var _local2:uint = ColorUtil.red(this._color); var _local3:uint = ColorUtil.green(this._color); var _local4:uint = ColorUtil.blue(this._color); this.base.transform.colorTransform = new ColorTransform(1, 1, 1, 1, _local2, _local3, _local4, 0); } private function activationTweenCompleteHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this._baseInternalAlphaTween = null; if (this._currentState == LightBase.STATE_ACTIVATING){ this.currentState = LightBase.STATE_ON; } else { if (this._currentState == LightBase.STATE_DEACTIVATING){ this.currentState = LightBase.STATE_OFF; } else { throw (new IllegalOperationError("Invalid light state. Animation was not properly removed.")); }; }; } public function get currentState():String{ return (this._currentState); } private function colorTweenComplete():void{ this._colorTween = null; } public function get color():uint{ return (this._color); } private function warningTweenCompleteHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this._warningTween = null; this.currentState = LightBase.STATE_DEACTIVATING; } public function copyState(_arg1:LightBase):void{ var _local2:String = ((_arg1.currentState)==STATE_FLASH) ? STATE_OFF : _arg1.currentState; this.color = _arg1.color; this.baseInternal.visible = _arg1.baseInternal.visible; this.baseInternal.alpha = _arg1.baseInternal.alpha; this.currentState = _local2; if (this._baseInternalAlphaTween){ this._baseInternalAlphaTween.progress = _arg1._baseInternalAlphaTween.progress; }; if (this._warningTween){ this._warningTween.progress = _arg1._warningTween.progress; }; } public function set currentState(_arg1:String):void{ var _local3:Number; var _local4:Number; var _local2:String = this._currentState; this._currentState = _arg1; if (this._baseInternalAlphaTween){ this._baseInternalAlphaTween.pause(); this._baseInternalAlphaTween.removeEventListener(Event.COMPLETE, activationTweenCompleteHandler); TweenMax.removeTween(this._baseInternalAlphaTween); this._baseInternalAlphaTween = null; }; if (this._flashTween){ this._flashTween.stop(); this._flashTween.removeEventListener(TweenEvent.COMPLETE, flashTweenCompleteHandler); this._flashTween = null; }; if (this._warningTween){ this._warningTween.pause(); this._warningTween.removeEventListener(Event.COMPLETE, warningTweenCompleteHandler); TweenMax.removeTween(this._warningTween); this._warningTween = null; }; this.transform.colorTransform = new ColorTransform(); switch (this._currentState){ case STATE_ON: this.baseInternal.alpha = 1; this.baseInternal.visible = true; break; case STATE_OFF: this.baseInternal.alpha = 0; this.baseInternal.visible = false; break; case STATE_WARNING: this.baseInternal.alpha = 1; this.baseInternal.visible = true; this._warningTween = new ColorFlash(this, 0xFF9900, 1, 3); this._warningTween.addEventListener(Event.COMPLETE, warningTweenCompleteHandler); break; case STATE_FLASH: if (((!((_local2 == STATE_OFF))) && (!((_local2 == STATE_FLASH))))){ throw (new IllegalOperationError("Can't flash a light that's on!")); }; this.baseInternal.alpha = 0; this.baseInternal.visible = false; this._flashTween = new TimelineMax(); this._flashTween.append(new TweenMax(this.baseInternal, 0.1, {autoAlpha:1})); this._flashTween.append(new TweenMax(this.baseInternal, 0.25, {autoAlpha:0})); this._flashTween.addEventListener(TweenEvent.COMPLETE, flashTweenCompleteHandler); break; default: _local3 = ((this._currentState == STATE_ACTIVATING)) ? 1 : 0; _local4 = 0.15; this._baseInternalAlphaTween = new TweenMax(this.baseInternal, _local4, {autoAlpha:_local3}); this._baseInternalAlphaTween.ease = Quad.easeOut; this._baseInternalAlphaTween.addEventListener(Event.COMPLETE, activationTweenCompleteHandler); }; this.dispatchEvent(new Event(Event.CHANGE)); } private function flashTweenCompleteHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this._flashTween = null; this.currentState = STATE_OFF; } TweenPlugin.activate([ColorTransformPlugin]); } }//package com.bowlerhatgames.gridshock
Section 11
//LightDebugger (com.bowlerhatgames.gridshock.LightDebugger) package com.bowlerhatgames.gridshock { import flash.events.*; import org.josht.display.*; import com.yahoo.astra.utils.*; import flash.text.*; public class LightDebugger extends InvalidatingSprite { private var _light:LightBase; public var textField:TextField; override protected function draw():void{ if (!this._light){ this.textField.text = "NO DATA."; return; }; this.textField.text = ("NAME: " + this.light.name.toUpperCase()); this.textField.appendText(("\nCOLOR: " + StringUtil.padFront(this.light.color.toString(16).toUpperCase(), 6, "0"))); this.textField.appendText(("\nSTATE: " + this.light.currentState.toUpperCase())); } public function get light():LightBase{ return (this._light); } private function lightChangeHandler(_arg1:Event):void{ this.invalidate(); } public function set light(_arg1:LightBase):void{ if (this._light){ this._light.removeEventListener(Event.CHANGE, lightChangeHandler); this._light = null; }; this._light = _arg1; this._light.addEventListener(Event.CHANGE, lightChangeHandler); this.invalidate(); } } }//package com.bowlerhatgames.gridshock
Section 12
//Notification (com.bowlerhatgames.gridshock.Notification) package com.bowlerhatgames.gridshock { import flash.display.*; import flash.text.*; public class Notification extends Sprite { public var primaryField:TextField; public var secondaryField:TextField; } }//package com.bowlerhatgames.gridshock
Section 13
//Preloader (com.bowlerhatgames.gridshock.Preloader) package com.bowlerhatgames.gridshock { import flash.events.*; import com.gskinner.motion.*; import flash.utils.*; import flash.display.*; import flash.net.*; import flash.ui.*; public class Preloader extends MovieClip { public var fadeIn:GTween; public var splashScreen:Sprite; public var sponsorAd:Sprite; private static const MINIMUM_AD_TIME:int = 5000; private static const ROOT_CLASS:String = "Gridshock"; public function Preloader(){ addFrameScript(1, frame2, 2, frame3); super(); stop(); var _local1:ContextMenu = new ContextMenu(); _local1.hideBuiltInItems(); this.contextMenu = _local1; if (this.stage){ this.stage.align = StageAlign.TOP_LEFT; }; this.loaderInfo.addEventListener(Event.INIT, swfInitHandler); } function frame2(){ fadeIn = new GTween(this.splashScreen, 0.25, {alpha:1}); fadeIn.addEventListener(Event.COMPLETE, fadeInCompleteListener); } public function instructionsCompleteHandler(_arg1:Event):void{ if ((_arg1.target is FrosmoSponsorButton)){ navigateToURL(new URLRequest("http://www.frosmo.com/uk/ui/?ref=gridlock"), "_blank"); return; }; this.stage.removeEventListener(MouseEvent.CLICK, instructionsCompleteHandler); gotoAndStop((currentFrame + 1)); } function frame3(){ this.stage.addEventListener(MouseEvent.CLICK, instructionsCompleteHandler, false, 0, true); } public function fadeInCompleteListener(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); setTimeout(timerComplete, 1750); } private function enterFrameHandler(_arg1:Event):void{ var _local2:Number = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal); _local2 = Math.min(_local2, (getTimer() / MINIMUM_AD_TIME)); if (_local2 >= 1){ this.loadGame(); return; }; var _local3:Number = 30; var _local4:Number = 25; this.graphics.clear(); this.graphics.beginFill(0x88BB00); this.graphics.drawRect(_local3, ((this.loaderInfo.height - _local4) - 20), (this.loaderInfo.width - (2 * _local3)), _local4); this.graphics.endFill(); this.graphics.beginFill(0); this.graphics.drawRect((_local3 + 2), ((this.loaderInfo.height - (_local4 - 2)) - 20), ((this.loaderInfo.width - (2 * _local3)) - 4), (_local4 - 4)); this.graphics.endFill(); this.graphics.beginFill(0x88FF00); this.graphics.drawRect((_local3 + 5), ((this.loaderInfo.height - (_local4 - 5)) - 20), (_local2 * ((this.loaderInfo.width - (2 * _local3)) - 10)), (_local4 - 10)); this.graphics.endFill(); } private function sponsorAdClickHandler(_arg1:MouseEvent):void{ navigateToURL(new URLRequest("http://www.frosmo.com/uk/ui/?ref=gridlock"), "_blank"); } private function loadGame():void{ this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); this.removeChild(this.sponsorAd); this.sponsorAd.removeEventListener(MouseEvent.CLICK, sponsorAdClickHandler); this.sponsorAd = null; this.graphics.clear(); this.gotoAndStop(2); } public function timerComplete():void{ new GTween(this.splashScreen, 0.15, {alpha:0}); this.gotoAndStop((currentFrame + 1)); } private function swfInitHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(Event.INIT, swfInitHandler); this.sponsorAd.buttonMode = true; this.sponsorAd.addEventListener(MouseEvent.CLICK, sponsorAdClickHandler); this.addEventListener(Event.ENTER_FRAME, enterFrameHandler); } } }//package com.bowlerhatgames.gridshock
Section 14
//ProgressLight (com.bowlerhatgames.gridshock.ProgressLight) package com.bowlerhatgames.gridshock { import flash.display.*; public class ProgressLight extends LightBase { private var _initialMaskHeight:Number; public var progressMask:Sprite; private var _progress:Number;// = 0 public function ProgressLight(){ this.base.mask = this.progressMask; this._initialMaskHeight = this.progressMask.height; this.progress = 0; } public function set progress(_arg1:Number):void{ this._progress = Math.min(Math.max(_arg1, 0), 1); this.progressMask.height = (this._progress * this._initialMaskHeight); this.progressMask.y = (this._initialMaskHeight - this.progressMask.height); } public function get progress():Number{ return (this._progress); } } }//package com.bowlerhatgames.gridshock
Section 15
//GTween (com.gskinner.motion.GTween) package com.gskinner.motion { import flash.events.*; import flash.utils.*; public class GTween extends EventDispatcher { public var autoPlay:Boolean;// = true protected var _position:Number;// = 0 protected var ticker:ITicker; protected var _delay:Number;// = 0 public var duration:Number;// = 1 public var repeat:int;// = 0 protected var positionOffset:Number; protected var _previousPosition:Number; protected var startValues:Object; public var data; protected var inited:Boolean; protected var _target:Object; protected var _tweenPosition:Number;// = 0 protected var _reversed:Boolean; public var snapping:Boolean;// = false public var reflect:Boolean;// = false public var nextTween:GTween; protected var assignmentProperty:String; public var autoVisible:Boolean;// = true protected var assignmentTarget:Object; protected var _lockStartProperties:Boolean; public var autoRotation:Boolean;// = false protected var endValues:Object; protected var inTick:Boolean; protected var _paused:Boolean;// = true protected var _propertyTarget:Object; public var ease:Function; protected var _proxy:TargetProxy; protected var _previousTweenPosition:Number; public static const START:String = "start"; public static const FRAME:String = "frame"; public static const TWEEN:String = "tween"; public static const TIME:String = "time"; public static const DELAY:String = "delay"; public static const END:String = "end"; public static const HYBRID:String = "hybrid"; public static var snappingProperties:Object = {x:true, y:true}; public static var pauseAll:Boolean = false; protected static var activeTweens:Dictionary = new Dictionary(); protected static var _activeTicker:ITicker; protected static var _timeInterval:uint = 40; public static var rotationProperties:Object = {rotation:true, rotationX:true, rotationY:true, rotationZ:true}; public static var defaultEase:Function; protected static var _timingMode:String; public function GTween(_arg1:Object=null, _arg2:Number=10, _arg3:Object=null, _arg4:Object=null){ ease = linearEase; super(); ticker = activeTicker; this.target = _arg1; this.duration = _arg2; ease = ((defaultEase) || (linearEase)); setProperties(_arg3); setTweenProperties(_arg4); } protected function setGCLock(_arg1:Boolean):void{ if (_arg1){ if ((_target is IEventDispatcher)){ _target.addEventListener("GDS__NONEXISTENT_EVENT", nullListener, false, 0, false); } else { activeTweens[this] = true; }; } else { if ((_target is IEventDispatcher)){ _target.removeEventListener("GDS__NONEXISTENT_EVENT", nullListener); }; delete activeTweens[this]; }; } public function get target():Object{ return (_target); } public function get delay():Number{ return (_delay); } public function set delay(_arg1:Number):void{ if (_position == -(_delay)){ setPosition(-(_arg1)); }; _delay = _arg1; } protected function init():void{ var _local1:String; var _local2:Number; var _local3:Number; inited = true; if (_lockStartProperties){ return; }; startValues = {}; if (((assignmentTarget) && (assignmentProperty))){ _propertyTarget = assignmentTarget[assignmentProperty]; }; for (_local1 in endValues) { if (((autoRotation) && (rotationProperties[_local1]))){ _local2 = (endValues[_local1] = (endValues[_local1] % 360)); _local3 = (_propertyTarget[_local1] % 360); startValues[_local1] = (_local3 + ((Math.abs((_local3 - _local2)))<180) ? 0 : ((_local3)>_local2) ? -360 : 360); } else { startValues[_local1] = _propertyTarget[_local1]; }; }; } public function get state():String{ return (((((_position == -(_delay))) && (_paused))) ? START : ((_position)<0) ? DELAY : (((!((repeat == -1))) && ((_position >= ((repeat + 1) * duration))))) ? END : TWEEN); } public function get lockStartProperties():Boolean{ return (_lockStartProperties); } public function deleteProperty(_arg1:String):Boolean{ return (delete endValues[_arg1]); } public function set target(_arg1:Object):void{ _propertyTarget = (_target = ((_arg1)===null) ? {} : _arg1); inited = false; } public function set reversed(_arg1:Boolean):void{ if (_arg1 == _reversed){ return; }; _reversed = _arg1; if (!inited){ init(); }; setPosition(_position, true); } public function get position():Number{ return (_position); } public function setPosition(_arg1:Number, _arg2:Boolean=true):void{ var _local4:Number; _previousPosition = _position; _position = _arg1; if (((!(inTick)) && (!(paused)))){ updatePositionOffset(); }; var _local3:Number = ((repeat + 1) * duration); if (_arg1 < 0){ _local4 = (_reversed) ? duration : 0; } else { if ((((repeat == -1)) || ((_arg1 < _local3)))){ _local4 = (_arg1 % duration); if (((reflect) && ((((_arg1 / duration) % 2) >= 1))) != _reversed){ _local4 = (duration - _local4); }; } else { _local4 = ((((reflect) && (((repeat % 2) >= 1))))!=_reversed) ? 0 : duration; }; }; if (_local4 == _tweenPosition){ return; }; _previousTweenPosition = _tweenPosition; _tweenPosition = _local4; if (((!(_arg2)) && (hasEventListener(Event.CHANGE)))){ dispatchEvent(new Event(Event.CHANGE)); }; if (((((!(inited)) && ((_previousPosition <= 0)))) && ((_position >= 0)))){ init(); if (((!(_arg2)) && (hasEventListener(Event.INIT)))){ dispatchEvent(new Event(Event.INIT)); }; }; updateProperties(); if (((((!((repeat == -1))) && ((_previousPosition < _local3)))) && ((_arg1 >= _local3)))){ if (((!(_arg2)) && (hasEventListener(Event.COMPLETE)))){ dispatchEvent(new Event(Event.COMPLETE)); }; paused = true; if (nextTween){ nextTween.paused = false; }; }; } public function set lockStartProperties(_arg1:Boolean):void{ if (((_arg1) && (!(inited)))){ init(); }; _lockStartProperties = _arg1; } public function get paused():Boolean{ return (_paused); } public function get tweenPosition():Number{ return (_tweenPosition); } public function invalidate():void{ inited = false; if (_position > 0){ _position = 0; updatePositionOffset(); }; if (autoPlay){ paused = false; }; } public function getProperties():Object{ return (copyObject(endValues)); } public function get propertyTarget():Object{ return (_propertyTarget); } public function play():void{ paused = false; } public function setAssignment(_arg1:Object=null, _arg2:String=null):void{ this.assignmentTarget = _arg1; this.assignmentProperty = _arg2; inited = false; } public function get reversed():Boolean{ return (_reversed); } public function set position(_arg1:Number):void{ setPosition(_arg1, true); } protected function updateProperty(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Number = (_arg2 + ((_arg3 - _arg2) * _arg4)); if (((snapping) && (snappingProperties[_arg1]))){ _local5 = Math.round(_local5); }; if (_arg1 == "currentFrame"){ _propertyTarget.gotoAndStop((_local5 << 0)); } else { _propertyTarget[_arg1] = _local5; }; } public function setProperties(_arg1:Object):void{ var _local2:String; endValues = {}; for (_local2 in _arg1) { setProperty(_local2, _arg1[_local2]); }; } public function getProperty(_arg1:String):Number{ return (endValues[_arg1]); } public function end():void{ setPosition(((repeat)==-1) ? duration : ((repeat + 1) * duration)); } public function set paused(_arg1:Boolean):void{ if (_arg1 == _paused){ return; }; _paused = _arg1; if (_arg1){ ticker.removeEventListener("tick", handleTick); } else { ticker.addEventListener("tick", handleTick, false, 0, true); if (((!((repeat == -1))) && ((_position >= (duration * (repeat + 1)))))){ position = 0; } else { updatePositionOffset(); }; }; setGCLock(!(_arg1)); } public function beginning():void{ setPosition(-(_delay)); } public function setProperty(_arg1:String, _arg2:Number):void{ if (isNaN(_arg2)){ return; }; endValues[_arg1] = _arg2; if (((_lockStartProperties) && ((startValues[_arg1] == null)))){ startValues[_arg1] = _propertyTarget[_arg1]; }; invalidate(); } protected function updatePositionOffset():void{ positionOffset = (ticker.position - _position); } protected function copyObject(_arg1:Object):Object{ var _local3:String; var _local2:Object = {}; for (_local3 in _arg1) { _local2[_arg1] = _arg1[_local3]; }; return (_local2); } public function setTweenProperties(_arg1:Object):void{ var _local2:Number; var _local3:String; if (!_arg1){ return; }; if (("position" in _arg1)){ _local2 = _arg1.position; delete _arg1.position; }; if (("initListener" in _arg1)){ addEventListener(Event.INIT, _arg1.initListener, false, 0, true); delete _arg1.initListener; }; if (("completeListener" in _arg1)){ addEventListener(Event.COMPLETE, _arg1.completeListener, false, 0, true); delete _arg1.completeListener; }; if (("changeListener" in _arg1)){ addEventListener(Event.CHANGE, _arg1.changeListener, false, 0, true); delete _arg1.changeListener; }; for (_local3 in _arg1) { this[_local3] = _arg1[_local3]; }; if (!isNaN(_local2)){ position = _local2; }; } protected function updateProperties():void{ var _local2:String; var _local1:Number = ease((_tweenPosition / duration), 0, 1, 1); for (_local2 in endValues) { updateProperty(_local2, startValues[_local2], endValues[_local2], _local1); }; if (((((((autoVisible) && (("alpha" in endValues)))) && (("alpha" in _propertyTarget)))) && (("visible" in _propertyTarget)))){ _propertyTarget.visible = (_propertyTarget.alpha > 0); }; if (((assignmentTarget) && (assignmentProperty))){ assignmentTarget[assignmentProperty] = _propertyTarget; }; } public function reverse(_arg1:Boolean=true):void{ var _local2:Number = ((repeat == -1)) ? (duration - (_position % duration)) : (((repeat + 1) * duration) - _position); if (reflect){ _reversed = !((((((position / duration) % 2) >= 1) == (((_local2 / duration) % 2) >= 1)) == _reversed)); } else { _reversed = !(_reversed); }; setPosition(_local2, _arg1); } public function setStartProperties(_arg1:Object):void{ startValues = copyObject(_arg1); inited = true; } protected function handleTick(_arg1:Event):void{ if (_paused){ return; }; inTick = true; if (pauseAll){ updatePositionOffset(); } else { setPosition((ticker.position - positionOffset), false); }; inTick = false; } public function get proxy():Object{ if (_proxy == null){ _proxy = new TargetProxy(this); }; return (_proxy); } public function pause():void{ paused = true; } protected function nullListener(_arg1:Event):void{ } public function getStartProperties():Object{ return (copyObject(startValues)); } public static function set timeInterval(_arg1:uint):void{ _timeInterval = _arg1; if ((_activeTicker is TimeTicker)){ (_activeTicker as TimeTicker).interval = (_timeInterval / 1000); }; } public static function get timingMode():String{ return (_timingMode); } public static function get activeTicker():ITicker{ if (_timingMode == null){ timingMode = HYBRID; }; return (_activeTicker); } public static function set timingMode(_arg1:String):void{ _arg1 = ((((_arg1 == FRAME)) || ((_arg1 == TIME)))) ? _arg1 : HYBRID; if (_arg1 == _timingMode){ return; }; _timingMode = _arg1; if (_timingMode == TIME){ _activeTicker = new TimeTicker(); (_activeTicker as TimeTicker).interval = (_timeInterval / 1000); } else { if (_timingMode == FRAME){ _activeTicker = new FrameTicker(); } else { _activeTicker = new HybridTicker(); }; }; } public static function linearEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (_arg1); } public static function get timeInterval():uint{ return (_timeInterval); } } }//package com.gskinner.motion import flash.events.*; import flash.utils.*; import flash.display.*; class HybridTicker extends EventDispatcher implements ITicker { protected var shape:Shape; private function HybridTicker():void{ shape = new Shape(); shape.addEventListener(Event.ENTER_FRAME, tick); } public function get position():Number{ return ((getTimer() / 1000)); } protected function tick(_arg1:Event):void{ dispatchEvent(new Event("tick")); } } class TimeTicker extends EventDispatcher implements ITicker { protected var timer:Timer; private function TimeTicker():void{ timer = new Timer(20); timer.addEventListener(TimerEvent.TIMER, tick); timer.start(); } public function get position():Number{ return ((getTimer() / 1000)); } public function set interval(_arg1:Number):void{ timer.delay = (_arg1 * 1000); } protected function tick(_arg1:TimerEvent):void{ dispatchEvent(new Event("tick")); _arg1.updateAfterEvent(); } } interface ITicker extends IEventDispatcher { "GTween.as$51:ITicker"?? function get position():Number; } class FrameTicker extends EventDispatcher implements ITicker { protected var shape:Shape; protected var _position:Number;// = 0 private function FrameTicker():void{ shape = new Shape(); shape.addEventListener(Event.ENTER_FRAME, tick); } public function get position():Number{ return (_position); } protected function tick(_arg1:Event):void{ _position++; dispatchEvent(new Event("tick")); } } dynamic class TargetProxy extends Proxy { private var gTween:GTween; private function TargetProxy(_arg1:GTween):void{ this.gTween = _arg1; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{ return (gTween.deleteProperty(_arg1)); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){ return (gTween.propertyTarget[_arg1].apply(null, _args)); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{ if (isNaN(_arg2)){ gTween.propertyTarget[_arg1] = _arg2; } else { gTween.setProperty(String(_arg1), Number(_arg2)); }; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){ var _local2:Number = gTween.getProperty(_arg1); return ((isNaN(_local2)) ? gTween.propertyTarget[_arg1] : _local2); } }
Section 16
//StringUtil (com.yahoo.astra.utils.StringUtil) package com.yahoo.astra.utils { public class StringUtil { public static function padFront(_arg1:String, _arg2:int, _arg3:String):String{ var _local4:int = (_arg2 - _arg1.length); if (_local4 <= 0){ return (_arg1); }; var _local5:int; while (_local5 < _local4) { _arg1 = (_arg3 + _arg1); _local5++; }; return (_arg1); } } }//package com.yahoo.astra.utils
Section 17
//PropTween (gs.core.tween.PropTween) package gs.core.tween { 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(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){ this.target = _arg1; this.property = _arg2; this.start = _arg3; this.change = _arg4; this.name = _arg5; this.isPlugin = _arg6; this.nextNode = _arg7; this.priority = _arg8; } } }//package gs.core.tween
Section 18
//SimpleTimeline (gs.core.tween.SimpleTimeline) package gs.core.tween { public class SimpleTimeline extends Tweenable { public var autoRemoveChildren:Boolean; protected var _lastChild:Tweenable; protected var _firstChild:Tweenable; public function SimpleTimeline(_arg1:Object=null){ super(0, _arg1); } override public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ this.cachedTotalTime = (this.cachedTime = _arg1); var _local3:Tweenable = _firstChild; while (_local3 != null) { if (((_local3.active) || ((((_arg1 >= _local3.startTime)) && (!(_local3.cachedPaused)))))){ _local3.renderTime(((_arg1 - _local3.startTime) * _local3.cachedTimeScale)); }; _local3 = _local3.nextNode; }; } public function addChild(_arg1:Tweenable):void{ if (((!((_arg1.timeline == null))) && (!(_arg1.gc)))){ _arg1.timeline.remove(_arg1, true); }; _arg1.timeline = this; if (_arg1.gc){ _arg1.enabled = true; return; }; if (_firstChild != null){ _firstChild.prevNode = _arg1; _arg1.nextNode = _firstChild; } else { _arg1.nextNode = null; }; _firstChild = _arg1; _arg1.prevNode = null; } public function remove(_arg1:Tweenable, _arg2:Boolean=false):void{ if (((!(_arg1.gc)) && (!(_arg2)))){ _arg1.enabled = false; return; }; if (_arg1.nextNode != null){ _arg1.nextNode.prevNode = _arg1.prevNode; } else { if (_lastChild == _arg1){ _lastChild = _arg1.prevNode; }; }; if (_arg1.prevNode != null){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (_firstChild == _arg1){ _firstChild = _arg1.nextNode; }; }; } } }//package gs.core.tween
Section 19
//Tweenable (gs.core.tween.Tweenable) package gs.core.tween { import gs.*; public class Tweenable { public var timeline:SimpleTimeline; public var initted:Boolean; protected var _hasUpdate:Boolean; public var active:Boolean; protected var _delay:Number; public var startTime:Number; public var nextNode:Tweenable; public var cachedTime:Number; public var gc:Boolean; public var cachedDuration:Number; public var prevNode:Tweenable; public var cacheIsDirty:Boolean; public var vars:Object; public var cachedTotalTime:Number; public var cachedPaused:Boolean; public var cachedTotalDuration:Number; public var data; public var cachedTimeScale:Number; public static const version:Number = 0.49; protected static var _classInitted:Boolean; public function Tweenable(_arg1:Number=0, _arg2:Object=null){ this.vars = ((_arg2) || ({})); this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0))); _delay = ((this.vars.delay) || (0)); this.cachedTimeScale = ((this.vars.timeScale) || (1)); this.active = Boolean((((_arg1 == 0)) && ((_delay == 0)))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!_classInitted){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.startTime = (_local3.cachedTotalTime + _delay); _local3.addChild(this); } public function complete(_arg1:Boolean=false):void{ } public function set enabled(_arg1:Boolean):void{ if (_arg1 == this.gc){ this.gc = !(_arg1); if (_arg1){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); this.timeline.addChild(this); } else { this.active = false; this.timeline.remove(this); }; }; } public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ } public function get enabled():Boolean{ return (!(this.gc)); } public function get delay():Number{ return (_delay); } public function get duration():Number{ return (this.cachedDuration); } public function set delay(_arg1:Number):void{ this.startTime = (this.startTime + (_arg1 - _delay)); _delay = _arg1; } public function set totalDuration(_arg1:Number):void{ this.duration = _arg1; } public function set duration(_arg1:Number):void{ this.cachedDuration = (this.cachedTotalDuration = _arg1); } public function get totalDuration():Number{ return (this.cachedTotalDuration); } } }//package gs.core.tween
Section 20
//Quad (gs.easing.Quad) package gs.easing { public class Quad { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((_arg3 * _arg1) * _arg1) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2)); }; --_arg1; return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2)); } } }//package gs.easing
Section 21
//TweenEvent (gs.events.TweenEvent) package gs.events { import flash.events.*; public class TweenEvent extends Event { public static const COMPLETE:String = "complete"; public static const START:String = "init"; public static const UPDATE:String = "change"; public static const REVERSE_COMPLETE:String = "reverseComplete"; public static const version:Number = 1; public static const REPEAT:String = "repeat"; public function TweenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function clone():Event{ return (new TweenEvent(this.type, this.bubbles, this.cancelable)); } } }//package gs.events
Section 22
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin) package gs.plugins { import flash.display.*; import gs.*; public class AutoAlphaPlugin extends VisiblePlugin { protected var _ignoreVisible:Boolean; public static const VERSION:Number = 2.1; public static const API:Number = 1; public function AutoAlphaPlugin(){ this.propName = "autoAlpha"; this.overwriteProps = ["alpha", "visible"]; } override public function killProps(_arg1:Object):void{ super.killProps(_arg1); _ignoreVisible = Boolean(("visible" in _arg1)); } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ init(_arg1, Boolean(!((_arg2 == 0))), _arg3); addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha"); return (true); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); if (!_ignoreVisible){ _target.visible = Boolean(!((_target.alpha == 0))); }; } } }//package gs.plugins
Section 23
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.filters.*; public class BevelFilterPlugin extends FilterPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function BevelFilterPlugin(){ this.propName = "bevelFilter"; this.overwriteProps = ["bevelFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = BevelFilter; initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2)))); return (true); } } }//package gs.plugins
Section 24
//BezierPlugin (gs.plugins.BezierPlugin) package gs.plugins { import gs.core.tween.*; import gs.*; public class BezierPlugin extends TweenPlugin { protected var _future:Object; protected var _orient:Boolean; protected var _orientData:Array; protected var _target:Object; protected var _beziers:Object; protected static const _RAD2DEG:Number = 57.2957795130823; public static const VERSION:Number = 2.01; public static const API:Number = 1; public function BezierPlugin(){ _future = {}; super(); this.propName = "bezier"; this.overwriteProps = []; } override public function killProps(_arg1:Object):void{ var _local2:String; for (_local2 in _beziers) { if ((_local2 in _arg1)){ delete _beziers[_local2]; }; }; super.killProps(_arg1); } protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{ var _local6:int; var _local7:String; var _local8:Object; _target = _arg1.target; var _local4:Object = ((_arg1.vars.isTV)==true) ? _arg1.vars.exposedVars : _arg1.vars; if (_local4.orientToBezier == true){ _orientData = [["x", "y", "rotation", 0]]; _orient = true; } else { if ((_local4.orientToBezier is Array)){ _orientData = _local4.orientToBezier; _orient = true; }; }; var _local5:Object = {}; _local6 = 0; while (_local6 < _arg2.length) { for (_local7 in _arg2[_local6]) { if (_local5[_local7] == undefined){ _local5[_local7] = [_arg1.target[_local7]]; }; if (typeof(_arg2[_local6][_local7]) == "number"){ _local5[_local7].push(_arg2[_local6][_local7]); } else { _local5[_local7].push((_arg1.target[_local7] + Number(_arg2[_local6][_local7]))); }; }; _local6++; }; for (_local7 in _local5) { this.overwriteProps[this.overwriteProps.length] = _local7; if (_local4[_local7] != undefined){ if (typeof(_local4[_local7]) == "number"){ _local5[_local7].push(_local4[_local7]); } else { _local5[_local7].push((_arg1.target[_local7] + Number(_local4[_local7]))); }; _local8 = {}; _local8[_local7] = true; _arg1.killVars(_local8, false); delete _local4[_local7]; }; }; _beziers = parseBeziers(_local5, _arg3); } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg2 is Array)){ return (false); }; init(_arg3, (_arg2 as Array), false); return (true); } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:String; var _local4:Object; var _local5:Number; var _local6:uint; var _local7:Number; var _local8:int; var _local9:Object; var _local10:Boolean; var _local11:Number; var _local12:Number; var _local13:Array; var _local14:Number; if (_arg1 == 1){ for (_local3 in _beziers) { _local2 = (_beziers[_local3].length - 1); _target[_local3] = _beziers[_local3][_local2][2]; }; } else { for (_local3 in _beziers) { _local6 = _beziers[_local3].length; if (_arg1 < 0){ _local2 = 0; } else { if (_arg1 >= 1){ _local2 = (_local6 - 1); } else { _local2 = int((_local6 * _arg1)); }; }; _local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6); _local4 = _beziers[_local3][_local2]; if (this.round){ _local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0]))))); _local8 = ((_local7)<0) ? -1 : 1; _target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7); } else { _target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0]))))); }; }; }; if (_orient){ _local9 = _target; _local10 = this.round; _target = _future; this.round = false; _orient = false; this.changeFactor = (_arg1 + 0.01); _target = _local9; this.round = _local10; _orient = true; _local2 = 0; while (_local2 < _orientData.length) { _local13 = _orientData[_local2]; _local14 = ((_local13[3]) || (0)); _local11 = (_future[_local13[0]] - _target[_local13[0]]); _local12 = (_future[_local13[1]] - _target[_local13[1]]); _target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14); _local2++; }; }; } public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{ var _local3:int; var _local4:Array; var _local5:Object; var _local6:String; var _local7:Object = {}; if (_arg2){ for (_local6 in _arg1) { _local4 = _arg1[_local6]; _local5 = []; _local7[_local6] = _local5; if (_local4.length > 2){ _local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]]; _local3 = 1; while (_local3 < (_local4.length - 1)) { _local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]]; _local3++; }; } else { _local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]]; }; }; } else { for (_local6 in _arg1) { _local4 = _arg1[_local6]; _local5 = []; _local7[_local6] = _local5; if (_local4.length > 3){ _local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)]; _local3 = 2; while (_local3 < (_local4.length - 2)) { _local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)]; _local3++; }; _local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]]; } else { if (_local4.length == 3){ _local5[_local5.length] = [_local4[0], _local4[1], _local4[2]]; } else { if (_local4.length == 2){ _local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]]; }; }; }; }; }; return (_local7); } } }//package gs.plugins
Section 25
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin) package gs.plugins { import gs.*; public class BezierThroughPlugin extends BezierPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function BezierThroughPlugin(){ this.propName = "bezierThrough"; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg2 is Array)){ return (false); }; init(_arg3, (_arg2 as Array), true); return (true); } } }//package gs.plugins
Section 26
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.filters.*; public class BlurFilterPlugin extends FilterPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function BlurFilterPlugin(){ this.propName = "blurFilter"; this.overwriteProps = ["blurFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = BlurFilter; initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2)))); return (true); } } }//package gs.plugins
Section 27
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.filters.*; public class ColorMatrixFilterPlugin extends FilterPlugin { protected var _matrix:Array; protected var _matrixTween:EndArrayPlugin; public static const API:Number = 1; public static const VERSION:Number = 1.1; protected static var _lumG:Number = 0.71516; protected static var _lumR:Number = 0.212671; protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; protected static var _lumB:Number = 0.072169; public function ColorMatrixFilterPlugin(){ this.propName = "colorMatrixFilter"; this.overwriteProps = ["colorMatrixFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = ColorMatrixFilter; var _local4:Object = _arg2; initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice())); _matrix = ColorMatrixFilter(_filter).matrix; var _local5:Array = []; if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){ _local5 = _local4.matrix; } else { if (_local4.relative == true){ _local5 = _matrix.slice(); } else { _local5 = _idMatrix.slice(); }; _local5 = setBrightness(_local5, _local4.brightness); _local5 = setContrast(_local5, _local4.contrast); _local5 = setHue(_local5, _local4.hue); _local5 = setSaturation(_local5, _local4.saturation); _local5 = setThreshold(_local5, _local4.threshold); if (!isNaN(_local4.colorize)){ _local5 = colorize(_local5, _local4.colorize, _local4.amount); }; }; _matrixTween = new EndArrayPlugin(); _matrixTween.init(_matrix, _local5); return (true); } override public function set changeFactor(_arg1:Number):void{ _matrixTween.changeFactor = _arg1; ColorMatrixFilter(_filter).matrix = _matrix; super.changeFactor = _arg1; } public static function setSaturation(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; var _local3:Number = (1 - _arg2); var _local4:Number = (_local3 * _lumR); var _local5:Number = (_local3 * _lumG); var _local6:Number = (_local3 * _lumB); var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(_local7, _arg1)); } public static function setHue(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = (_arg2 * (Math.PI / 180)); var _local3:Number = Math.cos(_arg2); var _local4:Number = Math.sin(_arg2); var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]; return (applyMatrix(_local5, _arg1)); } public static function setThreshold(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0]; return (applyMatrix(_local3, _arg1)); } public static function applyMatrix(_arg1:Array, _arg2:Array):Array{ var _local6:int; var _local7:int; if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){ return (_arg2); }; var _local3:Array = []; var _local4:int; var _local5:int; _local6 = 0; while (_local6 < 4) { _local7 = 0; while (_local7 < 5) { if (_local7 == 4){ _local5 = _arg1[(_local4 + 4)]; } else { _local5 = 0; }; _local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5); _local7++; }; _local4 = (_local4 + 5); _local6++; }; return (_local3); } public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{ if (isNaN(_arg2)){ return (_arg1); }; if (isNaN(_arg3)){ _arg3 = 1; }; var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF); var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF); var _local6:Number = ((_arg2 & 0xFF) / 0xFF); var _local7:Number = (1 - _arg3); var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(_local8, _arg1)); } public static function setBrightness(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = ((_arg2 * 100) - 100); return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1)); } public static function setContrast(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = (_arg2 + 0.01); var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0]; return (applyMatrix(_local3, _arg1)); } } }//package gs.plugins
Section 28
//ColorTransformPlugin (gs.plugins.ColorTransformPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.geom.*; public class ColorTransformPlugin extends TintPlugin { public static const VERSION:Number = 1.5; public static const API:Number = 1; public function ColorTransformPlugin(){ this.propName = "colorTransform"; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local5:String; var _local6:Number; if (!(_arg1 is DisplayObject)){ return (false); }; var _local4:ColorTransform = _arg1.transform.colorTransform; if (_arg2.isTV == true){ _arg2 = _arg2.exposedVars; }; for (_local5 in _arg2) { if ((((_local5 == "tint")) || ((_local5 == "color")))){ if (_arg2[_local5] != null){ _local4.color = int(_arg2[_local5]); }; } else { if ((((((_local5 == "tintAmount")) || ((_local5 == "exposure")))) || ((_local5 == "brightness")))){ } else { _local4[_local5] = _arg2[_local5]; }; }; }; if (!isNaN(_arg2.tintAmount)){ _local6 = (_arg2.tintAmount / (1 - (((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3))); _local4.redOffset = (_local4.redOffset * _local6); _local4.greenOffset = (_local4.greenOffset * _local6); _local4.blueOffset = (_local4.blueOffset * _local6); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - _arg2.tintAmount))); } else { if (!isNaN(_arg2.exposure)){ _local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = (0xFF * (_arg2.exposure - 1)))); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = 1)); } else { if (!isNaN(_arg2.brightness)){ _local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = Math.max(0, ((_arg2.brightness - 1) * 0xFF)))); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - Math.abs((_arg2.brightness - 1))))); }; }; }; _ignoreAlpha = Boolean(((!((_arg3.vars.alpha == undefined))) && ((_arg2.alphaMultiplier == undefined)))); init((_arg1 as DisplayObject), _local4); return (true); } } }//package gs.plugins
Section 29
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.filters.*; public class DropShadowFilterPlugin extends FilterPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function DropShadowFilterPlugin(){ this.propName = "dropShadowFilter"; this.overwriteProps = ["dropShadowFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = DropShadowFilter; initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject)); return (true); } } }//package gs.plugins
Section 30
//EndArrayPlugin (gs.plugins.EndArrayPlugin) package gs.plugins { import flash.display.*; import gs.*; public class EndArrayPlugin extends TweenPlugin { protected var _a:Array; protected var _info:Array; public static const VERSION:Number = 1.5; public static const API:Number = 1; public function EndArrayPlugin(){ _info = []; super(); this.propName = "endArray"; this.overwriteProps = ["endArray"]; } public function init(_arg1:Array, _arg2:Array):void{ _a = _arg1; var _local3:int = (_arg2.length - 1); while (_local3 > -1) { if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){ _info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3])); }; _local3--; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){ return (false); }; init((_arg1 as Array), _arg2); return (true); } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:ArrayTweenInfo; var _local4:Number; var _local5:int; if (this.round){ _local2 = (_info.length - 1); while (_local2 > -1) { _local3 = _info[_local2]; _local4 = (_local3.start + (_local3.change * _arg1)); _local5 = ((_local4)<0) ? -1 : 1; _a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4); _local2--; }; } else { _local2 = (_info.length - 1); while (_local2 > -1) { _local3 = _info[_local2]; _a[_local3.index] = (_local3.start + (_local3.change * _arg1)); _local2--; }; }; } } }//package gs.plugins class ArrayTweenInfo { public var change:Number; public var start:Number; public var index:uint; private function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){ this.index = _arg1; this.start = _arg2; this.change = _arg3; } }
Section 31
//FilterPlugin (gs.plugins.FilterPlugin) package gs.plugins { import flash.display.*; import gs.core.tween.*; import gs.*; import flash.filters.*; public class FilterPlugin extends TweenPlugin { protected var _remove:Boolean; protected var _target:Object; protected var _index:int; protected var _filter:BitmapFilter; protected var _type:Class; public static const VERSION:Number = 1.03; public static const API:Number = 1; public function onCompleteTween():void{ var _local1:int; var _local2:Array; if (_remove){ _local2 = _target.filters; if (!(_local2[_index] is _type)){ _local1 = (_local2.length - 1); while (_local1 > -1) { if ((_local2[_local1] is _type)){ _local2.splice(_local1, 1); break; }; _local1--; }; } else { _local2.splice(_index, 1); }; _target.filters = _local2; }; } protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{ var _local4:String; var _local5:int; var _local6:HexColorsPlugin; var _local3:Array = _target.filters; _index = -1; if (_arg1.index != null){ _index = _arg1.index; } else { _local5 = (_local3.length - 1); while (_local5 > -1) { if ((_local3[_local5] is _type)){ _index = _local5; break; }; _local5--; }; }; if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){ _index = ((_arg1.index)!=null) ? _arg1.index : _local3.length; _local3[_index] = _arg2; _target.filters = _local3; }; _filter = _local3[_index]; _remove = Boolean((_arg1.remove == true)); if (_remove){ this.onComplete = onCompleteTween; }; var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1; for (_local4 in _local7) { if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){ } else { if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){ _local6 = new HexColorsPlugin(); _local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]); _tweens[_tweens.length] = new PropTween(_local6, "changeFactor", 0, 1, _local4, false); } else { if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){ _filter[_local4] = _local7[_local4]; } else { addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4); }; }; }; }; } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:PropTween; var _local4:Array = _target.filters; _local2 = (_tweens.length - 1); while (_local2 > -1) { _local3 = _tweens[_local2]; _local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1)); _local2--; }; if (!(_local4[_index] is _type)){ _index = (_local4.length - 1); _local2 = (_local4.length - 1); while (_local2 > -1) { if ((_local4[_local2] is _type)){ _index = _local2; break; }; _local2--; }; }; _local4[_index] = _filter; _target.filters = _local4; } } }//package gs.plugins
Section 32
//FramePlugin (gs.plugins.FramePlugin) package gs.plugins { import flash.display.*; import gs.*; public class FramePlugin extends TweenPlugin { protected var _target:MovieClip; public var frame:int; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function FramePlugin(){ this.propName = "frame"; this.overwriteProps = ["frame", "frameLabel"]; this.round = true; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){ return (false); }; _target = (_arg1 as MovieClip); this.frame = _target.currentFrame; addTween(this, "frame", this.frame, _arg2, "frame"); return (true); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.gotoAndStop(this.frame); } } }//package gs.plugins
Section 33
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.filters.*; public class GlowFilterPlugin extends FilterPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function GlowFilterPlugin(){ this.propName = "glowFilter"; this.overwriteProps = ["glowFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = GlowFilter; initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout)); return (true); } } }//package gs.plugins
Section 34
//HexColorsPlugin (gs.plugins.HexColorsPlugin) package gs.plugins { import flash.display.*; import gs.*; public class HexColorsPlugin extends TweenPlugin { protected var _colors:Array; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function HexColorsPlugin(){ this.propName = "hexColors"; this.overwriteProps = []; _colors = []; } override public function killProps(_arg1:Object):void{ var _local2:int = (_colors.length - 1); while (_local2 > -1) { if (_arg1[_colors[_local2][1]] != undefined){ _colors.splice(_local2, 1); }; _local2--; }; super.killProps(_arg1); } public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{ var _local5:Number; var _local6:Number; var _local7:Number; if (_arg3 != _arg4){ _local5 = (_arg3 >> 16); _local6 = ((_arg3 >> 8) & 0xFF); _local7 = (_arg3 & 0xFF); _colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)]; this.overwriteProps[this.overwriteProps.length] = _arg2; }; } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:Array; _local2 = (_colors.length - 1); while (_local2 > -1) { _local3 = _colors[_local2]; _local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7]))); _local2--; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local4:String; for (_local4 in _arg2) { initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4])); }; return (true); } } }//package gs.plugins
Section 35
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin) package gs.plugins { public class RemoveTintPlugin extends TintPlugin { public static const VERSION:Number = 1.01; public static const API:Number = 1; public function RemoveTintPlugin(){ this.propName = "removeTint"; } } }//package gs.plugins
Section 36
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin) package gs.plugins { import flash.display.*; import gs.*; public class RoundPropsPlugin extends TweenPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function RoundPropsPlugin(){ this.propName = "roundProps"; this.overwriteProps = []; this.round = true; } public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{ addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2); this.overwriteProps[this.overwriteProps.length] = _arg2; } } }//package gs.plugins
Section 37
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin) package gs.plugins { import flash.display.*; import gs.*; public class ShortRotationPlugin extends TweenPlugin { public static const VERSION:Number = 1; public static const API:Number = 1; public function ShortRotationPlugin(){ this.propName = "shortRotation"; this.overwriteProps = []; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local4:String; if (typeof(_arg2) == "number"){ trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})"); return (false); }; for (_local4 in _arg2) { initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]); }; return (true); } public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{ var _local5:Number = ((_arg4 - _arg3) % 360); if (((_arg4 - _arg3) % 360) != (_local5 % 180)){ _local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360); }; addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2); this.overwriteProps[this.overwriteProps.length] = _arg2; } } }//package gs.plugins
Section 38
//TintPlugin (gs.plugins.TintPlugin) package gs.plugins { import flash.display.*; import gs.core.tween.*; import gs.*; import flash.geom.*; public class TintPlugin extends TweenPlugin { protected var _target:DisplayObject; protected var _ct:ColorTransform; protected var _ignoreAlpha:Boolean; public static const VERSION:Number = 1.1; public static const API:Number = 1; protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"]; public function TintPlugin(){ this.propName = "tint"; this.overwriteProps = ["tint"]; } public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{ var _local3:int; var _local4:String; _target = _arg1; _ct = _target.transform.colorTransform; _local3 = (_props.length - 1); while (_local3 > -1) { _local4 = _props[_local3]; if (_ct[_local4] != _arg2[_local4]){ _tweens[_tweens.length] = new PropTween(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false); }; _local3--; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg1 is DisplayObject)){ return (false); }; var _local4:ColorTransform = new ColorTransform(); if (((!((_arg2 == null))) && (!((_arg3.vars.removeTint == true))))){ _local4.color = uint(_arg2); }; _ignoreAlpha = true; init((_arg1 as DisplayObject), _local4); return (true); } override public function set changeFactor(_arg1:Number):void{ var _local2:ColorTransform; updateTweens(_arg1); if (_ignoreAlpha){ _local2 = _target.transform.colorTransform; _ct.alphaMultiplier = _local2.alphaMultiplier; _ct.alphaOffset = _local2.alphaOffset; }; _target.transform.colorTransform = _ct; } } }//package gs.plugins
Section 39
//TweenPlugin (gs.plugins.TweenPlugin) package gs.plugins { import gs.core.tween.*; import gs.*; public class TweenPlugin { public var onEnable:Function; public var priority:int;// = 0 public var overwriteProps:Array; protected var _tweens:Array; public var onDisable:Function; public var propName:String; public var round:Boolean; public var onComplete:Function; protected var _changeFactor:Number;// = 0 public static const VERSION:Number = 1.1; public static const API:Number = 1; public function TweenPlugin(){ _tweens = []; super(); } protected function updateTweens(_arg1:Number):void{ var _local2:int; var _local3:PropTween; var _local4:Number; var _local5:int; if (this.round){ _local2 = (_tweens.length - 1); while (_local2 > -1) { _local3 = _tweens[_local2]; _local4 = (_local3.start + (_local3.change * _arg1)); _local5 = ((_local4)<0) ? -1 : 1; _local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4); _local2--; }; } else { _local2 = (_tweens.length - 1); while (_local2 > -1) { _local3 = _tweens[_local2]; _local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1)); _local2--; }; }; } public function get changeFactor():Number{ return (_changeFactor); } public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _changeFactor = _arg1; } protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{ var _local6:Number; if (_arg4 != null){ _local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4); if (_local6 != 0){ _tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false); }; }; } public function killProps(_arg1:Object):void{ var _local2:int; _local2 = (this.overwriteProps.length - 1); while (_local2 > -1) { if ((this.overwriteProps[_local2] in _arg1)){ this.overwriteProps.splice(_local2, 1); }; _local2--; }; _local2 = (_tweens.length - 1); while (_local2 > -1) { if ((_tweens[_local2].name in _arg1)){ _tweens.splice(_local2, 1); }; _local2--; }; } public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName); return (true); } public static function activate(_arg1:Array):Boolean{ var _local2:int; var _local3:Object; TweenLite.onPluginEvent = TweenPlugin.onTweenEvent; _local2 = (_arg1.length - 1); while (_local2 > -1) { _local3 = new (_arg1[_local2]); TweenLite.plugins[_local3.propName] = _arg1[_local2]; _local2--; }; return (true); } private static function onTweenEvent(_arg1:String, _arg2:PropTween):PropTween{ var _local4:Array; var _local5:int; var _local3:PropTween = _arg2; if (_arg1 == "onInit"){ _local4 = []; while (_local3 != null) { _local4[_local4.length] = _local3; _local3 = _local3.nextNode; }; _local4.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); _local5 = _local4.length; while (_local5-- > 0) { _local4[_local5].nextNode = _local4[(_local5 + 1)]; _local4[_local5].prevNode = _local4[(_local5 - 1)]; }; _local3 = _local4[0]; } else { while (_local3 != null) { if (((_local3.isPlugin) && (!((_local3.target[_arg1] == null))))){ var _local6 = _local3.target; _local6[_arg1](); }; _local3 = _local3.nextNode; }; }; return (_local3); } } }//package gs.plugins
Section 40
//VisiblePlugin (gs.plugins.VisiblePlugin) package gs.plugins { import flash.display.*; import gs.*; public class VisiblePlugin extends TweenPlugin { protected var _tween:TweenLite; protected var _hideAtStart:Boolean; protected var _target:Object; protected var _visible:Boolean; public static const VERSION:Number = 1.52; public static const API:Number = 1; public function VisiblePlugin(){ this.propName = "visible"; this.overwriteProps = ["visible"]; this.onComplete = onCompleteTween; } public function onCompleteTween():void{ if (((!(_hideAtStart)) && (((!((_tween.cachedTime == 0))) || ((_tween.duration == 0)))))){ _target.visible = _visible; }; } protected function init(_arg1:Object, _arg2:Boolean, _arg3:TweenLite):void{ _target = _arg1; _tween = _arg3; _visible = _arg2; if ((((((_tween.vars.runBackwards == true)) && (!((_tween.vars.renderOnStart == false))))) && ((_arg2 == false)))){ _hideAtStart = true; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ init(_arg1, Boolean(_arg2), _arg3); return (true); } override public function set changeFactor(_arg1:Number):void{ if (((_hideAtStart) && ((_tween.cachedTotalTime == 0)))){ _target.visible = false; } else { if (_target.visible != true){ _target.visible = true; }; }; } } }//package gs.plugins
Section 41
//VolumePlugin (gs.plugins.VolumePlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.media.*; public class VolumePlugin extends TweenPlugin { protected var _target:Object; protected var _st:SoundTransform; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function VolumePlugin(){ this.propName = "volume"; this.overwriteProps = ["volume"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){ return (false); }; _target = _arg1; _st = _target.soundTransform; addTween(_st, "volume", _st.volume, _arg2, "volume"); return (true); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.soundTransform = _st; } } }//package gs.plugins
Section 42
//OverwriteManager (gs.OverwriteManager) package gs { import gs.core.tween.*; import flash.utils.*; import flash.errors.*; public class OverwriteManager { public static const ALL:int = 1; public static const NONE:int = 0; public static const AUTO:int = 2; public static const CONCURRENT:int = 3; public static const version:Number = 5.01; public static var mode:int; public static var enabled:Boolean; public static function getGlobalActive(_arg1:Tweenable):Boolean{ var _local2:Tweenable = _arg1; while (_local2 != null) { if (!_local2.active){ return (false); }; _local2 = _local2.timeline; }; return (true); } public static function manageOverwrites(_arg1:TweenLite, _arg2:Object, _arg3:Array):void{ var _local9:int; var _local10:TweenLite; var _local11:Number; var _local12:Number; var _local13:Tweenable; var _local14:Number; var _local15:SimpleTimeline; var _local4:Object = _arg1.vars; var _local5:int = ((_local4.overwrite)==undefined) ? mode : int(_local4.overwrite); if ((((_local5 < 2)) || ((_arg3 == null)))){ return; }; var _local6:Number = _arg1.startTime; var _local7:Array = []; var _local8:Array = []; _local9 = (_arg3.length - 1); while (_local9 > -1) { _local10 = _arg3[_local9]; if ((((_local10 == _arg1)) || (_local10.gc))){ } else { if (_local10.timeline != _arg1.timeline){ _local8[_local8.length] = _local10; } else { if ((((((_local10.startTime <= _local6)) && (((_local10.startTime + _local10.totalDuration) > _local6)))) && (getGlobalActive(_local10)))){ _local7[_local7.length] = _local10; }; }; }; _local9--; }; if (_local8.length != 0){ _local11 = _arg1.cachedTimeScale; _local12 = _local6; _local15 = _arg1.timeline; while (_local15 != null) { _local11 = (_local11 * _local15.cachedTimeScale); _local12 = (_local12 + _local15.startTime); _local15 = _local15.timeline; }; _local6 = (_local11 * _local12); _local9 = (_local8.length - 1); while (_local9 > -1) { _local13 = _local8[_local9]; _local11 = _local13.cachedTimeScale; _local12 = _local13.startTime; _local15 = _local13.timeline; while (_local15 != null) { _local11 = (_local11 * _local15.cachedTimeScale); _local12 = (_local12 + _local15.startTime); _local15 = _local15.timeline; }; _local14 = (_local11 * _local12); if ((((_local14 <= _local6)) && (((_local14 + (_local13.totalDuration * _local11)) > _local6)))){ _local7[_local7.length] = _local13; }; _local9--; }; }; if (_local7.length == 0){ return; }; if (_local5 == AUTO){ _local9 = (_local7.length - 1); while (_local9 > -1) { _local7[_local9].killVars(_arg2); _local9--; }; } else { _local9 = (_local7.length - 1); while (_local9 > -1) { _local7[_local9].enabled = false; _local9--; }; }; } public static function init(_arg1:int=2):int{ if (TweenLite.version < 11.097){ trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com."); }; TweenLite.overwriteManager = OverwriteManager; mode = _arg1; enabled = true; return (mode); } } }//package gs
Section 43
//TimelineLite (gs.TimelineLite) package gs { import gs.core.tween.*; import flash.utils.*; public class TimelineLite extends SimpleTimeline { protected var _labels:Object; protected var _reversed:Boolean; protected var _disabledChildren:Array; public static const ALIGN_START:String = "start"; public static const ALIGN_INIT:String = "init"; public static const version:Number = 0.55; public static const ALIGN_SEQUENCE:String = "sequence"; protected static var _defaultTweenClass:Class; private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(); ; public function TimelineLite(_arg1:Object=null){ var $vars = _arg1; super($vars); if (this.vars.paused == true){ this.paused = true; }; _labels = {}; this.autoRemoveChildren = Boolean((this.vars.autoRemoveChildren == true)); _hasUpdate = Boolean((typeof(this.vars.onUpdate) == "function")); if (_defaultTweenClass == null){ try { _defaultTweenClass = (getDefinitionByName("gs.TweenMax") as Class); } catch($e:Error) { _defaultTweenClass = TweenLite; }; }; if ((this.vars.tweens is Array)){ this.insertMultiple(this.vars.tweens, 0, ((this.vars.align) || (ALIGN_INIT)), ((this.vars.stagger) || (0)), this.vars.tweenClass); }; if (this.vars.reversed == true){ _reversed = true; }; } public function insert(_arg1:Tweenable, _arg2=0):void{ if (typeof(_arg2) == "string"){ if (!(_arg2 in _labels)){ addLabel(_arg2, this.duration); }; _arg2 = Number(_labels[_arg2]); }; _arg1.startTime = (Number(_arg2) + _arg1.delay); addChild(_arg1); } public function set timeScale(_arg1:Number):void{ if (_arg1 == 0){ _arg1 = 0.0001; }; this.startTime = (this.timeline.cachedTotalTime - (((this.timeline.cachedTotalTime - this.startTime) * this.cachedTimeScale) / _arg1)); this.cachedTimeScale = _arg1; setDirtyCache(false); } override public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ var _local5:Tweenable; var _local6:Boolean; var _local7:Boolean; var _local8:Boolean; if (this.gc){ this.enabled = true; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; var _local3:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var _local4:Number = this.cachedTime; if (_arg1 >= _local3){ if (_reversed){ forceChildrenToBeginning(_local4); } else { forceChildrenToEnd(_local4); }; _local7 = true; _local6 = _local7; } else { if (_arg1 <= 0){ if (_arg1 < 0){ this.active = false; }; if (_reversed){ forceChildrenToEnd(_local4); } else { forceChildrenToBeginning(_local4); }; _local7 = true; } else { this.cachedTotalTime = (this.cachedTime = (_reversed) ? (_local3 - _arg1) : _arg1); }; }; if (!this.initted){ _local8 = true; this.initted = _local8; if (this.vars.onStart != null){ this.vars.onStart.apply(null, this.vars.onStartParams); }; } else { if ((((this.cachedTime == _local4)) && (!(_arg2)))){ return; }; }; if (_local7){ } else { if ((this.cachedTime - _local4) > 0){ _local5 = _firstChild; while (_local5 != null) { if (((_local5.active) || (((((!(_local5.cachedPaused)) && ((_local5.startTime <= this.cachedTime)))) && (!((_local5.cachedDuration == 0))))))){ _local5.renderTime(((this.cachedTime - _local5.startTime) * _local5.cachedTimeScale)); } else { if ((((((((_local5.cachedDuration == 0)) && ((((_local5.startTime > _local4)) || (_local8))))) && ((_local5.startTime <= this.cachedTime)))) && (!(_local5.cachedPaused)))){ _local5.renderTime(0, true); }; }; _local5 = _local5.nextNode; }; } else { _local5 = _lastChild; while (_local5 != null) { if (((_local5.active) || (((((!(_local5.cachedPaused)) && ((_local5.startTime <= _local4)))) && (!((_local5.cachedDuration == 0))))))){ _local5.renderTime(((this.cachedTime - _local5.startTime) * _local5.cachedTimeScale)); } else { if ((((((((_local5.cachedDuration == 0)) && ((_local5.startTime < _local4)))) && ((_local5.startTime >= this.cachedTime)))) && (!(_local5.cachedPaused)))){ _local5.renderTime(0, true); }; }; _local5 = _local5.prevNode; }; }; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local6){ complete(true); }; } override public function remove(_arg1:Tweenable, _arg2:Boolean=false):void{ super.remove(_arg1, _arg2); setDirtyCache(true); } override public function set delay(_arg1:Number):void{ super.delay = _arg1; setDirtyCache(true); } public function set time(_arg1:Number):void{ this.totalTime = _arg1; } public function gotoAndPlay(_arg1):void{ goto(_arg1); this.paused = false; } public function stop():void{ this.paused = true; } override public function addChild(_arg1:Tweenable):void{ var _local2:Tweenable; var _local3:Number; if (((!((_arg1.timeline == null))) && (!(_arg1.gc)))){ _arg1.timeline.remove(_arg1, true); }; _arg1.timeline = this; if (_arg1.gc){ _arg1.enabled = true; return; }; setDirtyCache(true); if (_firstChild == null){ _firstChild = (_lastChild = _arg1); _arg1.nextNode = (_arg1.prevNode = null); } else { _local2 = _lastChild; _local3 = _arg1.startTime; while (((!((_local2 == null))) && ((_local3 < _local2.startTime)))) { _local2 = _local2.prevNode; }; if (_local2 == null){ _firstChild.prevNode = _arg1; _arg1.nextNode = _firstChild; _arg1.prevNode = null; _firstChild = _arg1; } else { if (_local2.nextNode != null){ _local2.nextNode.prevNode = _arg1; } else { if (_local2 == _lastChild){ _lastChild = _arg1; }; }; _arg1.prevNode = _local2; _arg1.nextNode = _local2.nextNode; _local2.nextNode = _arg1; }; }; } public function set reversed(_arg1:Boolean):void{ if (_arg1 != _reversed){ reverse(true); }; } public function get time():Number{ return (this.cachedTime); } public function prepend(_arg1:Tweenable, _arg2:Boolean=false):void{ var _local4:Number; var _local5:Tweenable; var _local6:String; var _local3:Number = 0; if (_firstChild != null){ _local3 = _firstChild.startTime; _local4 = ((_arg1.totalDuration / _arg1.cachedTimeScale) + _arg1.delay); _local5 = _firstChild; while (_local5 != null) { _local5.startTime = (_local5.startTime + _local4); _local5 = _local5.nextNode; }; if (_arg2){ for (_local6 in _labels) { _labels[_local6] = (_labels[_local6] + _local4); }; }; }; insert(_arg1, _local3); } public function restart(_arg1:Boolean=false):void{ this.totalTime = (_arg1) ? -(_delay) : 0; this.paused = false; } public function get totalProgress():Number{ return ((_reversed) ? (1 - (this.cachedTotalTime / this.totalDuration)) : (this.cachedTotalTime / this.totalDuration)); } protected function setDirtyCache(_arg1:Boolean=true):void{ var _local2:Tweenable = (_arg1) ? this : this.timeline; while (_local2 != null) { _local2.cacheIsDirty = true; _local2 = _local2.timeline; }; } public function addLabel(_arg1:String, _arg2:Number):void{ _labels[_arg1] = _arg2; } override public function get duration():Number{ var _local1:Number; if (this.cacheIsDirty){ _local1 = this.totalDuration; }; return (this.cachedDuration); } public function getTweensOf(_arg1:Object, _arg2:Boolean=true):Array{ var _local5:int; var _local3:Array = getChildren(_arg2, true, false); var _local4:Array = []; var _local6:uint = _local3.length; _local5 = 0; while (_local5 < _local6) { if (_local3[_local5].target == _arg1){ _local4[_local4.length] = _local3[_local5]; }; _local5++; }; return (_local4); } public function gotoAndStop(_arg1):void{ goto(_arg1); this.paused = true; } public function append(_arg1:Tweenable):void{ insert(_arg1, ((_lastChild)==null) ? 0 : (_lastChild.startTime + (_lastChild.totalDuration / _lastChild.cachedTimeScale))); } public function set totalTime(_arg1:Number):void{ this.startTime = (this.timeline.cachedTotalTime - (_arg1 / this.cachedTimeScale)); renderTime(_arg1); setDirtyCache(false); } public function set paused(_arg1:Boolean):void{ var _local2:Number; if (_arg1 != this.cachedPaused){ if (!_arg1){ _local2 = (_reversed) ? (this.totalDuration - this.cachedTotalTime) : this.cachedTotalTime; this.startTime = (this.timeline.cachedTotalTime - (_local2 / this.cachedTimeScale)); }; setDirtyCache(false); this.cachedPaused = _arg1; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(_arg1)) && (this.gc))){ this.enabled = true; }; } public function killTweensOf(_arg1:Object, _arg2:Boolean=true):void{ var _local4:int; var _local3:Array = getTweensOf(_arg1, _arg2); _local4 = (_local3.length - 1); while (_local4 > -1) { _local3[_local4].enabled = false; _local4--; }; } public function reverse(_arg1:Boolean=true):void{ this.startTime = (this.timeline.cachedTotalTime - (((1 - this.totalProgress) * this.totalDuration) / this.cachedTimeScale)); _reversed = !(_reversed); setDirtyCache(false); if (_arg1){ this.paused = false; if (this.progress == 1){ this.totalTime = 0; }; } else { if (this.gc){ this.enabled = true; }; }; } public function goto(_arg1):void{ if (typeof(_arg1) == "string"){ _arg1 = _labels[_arg1]; }; if (!isNaN(_arg1)){ this.totalTime = Number(_arg1); }; } public function get reversed():Boolean{ return (_reversed); } public function get useFrames():Boolean{ var _local1:SimpleTimeline = this.timeline; while (_local1.timeline != null) { _local1 = _local1.timeline; }; return (Boolean((_local1 == TweenLite.rootFramesTimeline))); } override public function set duration(_arg1:Number):void{ if (((!((this.duration == 0))) && (!((_arg1 == 0))))){ this.timeScale = (this.duration / _arg1); }; } public function insertMultiple(_arg1:Array, _arg2=0, _arg3:String="init", _arg4:Number=0, _arg5:Class=null):void{ var _local6:int; var _local7:Object; var _local8:Tweenable; if (_arg5 == null){ _arg5 = _defaultTweenClass; }; var _local9:Number = ((Number(_arg2)) || (0)); var _local10:uint = _arg1.length; if (typeof(_arg2) == "string"){ if (!(_arg2 in _labels)){ addLabel(_arg2, this.duration); }; _local9 = _labels[_arg2]; }; _local6 = 0; while (_local6 < _local10) { _local7 = _arg1[_local6]; if ((_local7 is Tweenable)){ _local8 = (_local7 as Tweenable); } else { if ((_local7 is Array)){ _local8 = new _arg5(_local7[0], _local7[1], _local7[2]); } else { if ((_local7 is Function)){ _local8 = new TweenLite(_local7, 0, {onComplete:_local7, overwrite:0, immediateRender:false}); } else { _local8 = new TimelineLite(_local7); }; }; }; insert(_local8, _local9); if (_arg3 == ALIGN_SEQUENCE){ _local9 = (_local8.startTime + _local8.totalDuration); } else { if (_arg3 == ALIGN_START){ _local8.startTime = (_local8.startTime - _local8.delay); }; }; _local9 = (_local9 + _arg4); _local6++; }; setDirtyCache(true); } public function get totalTime():Number{ return (this.cachedTotalTime); } public function get progress():Number{ return ((_reversed) ? (1 - (this.cachedTime / this.duration)) : (this.cachedTime / this.duration)); } public function get paused():Boolean{ return (this.cachedPaused); } override public function set enabled(_arg1:Boolean):void{ var _local2:Tweenable; if (_arg1 == this.gc){ _local2 = _firstChild; if (!_arg1){ _disabledChildren = []; while (_local2 != null) { _local2.enabled = _arg1; if (!_arg1){ _disabledChildren[_disabledChildren.length] = _local2; }; _local2 = _local2.nextNode; }; } else { for each (_local2 in _disabledChildren) { _local2.enabled = true; }; _disabledChildren = []; }; super.enabled = _arg1; }; } override public function set totalDuration(_arg1:Number):void{ if (((!((this.totalDuration == 0))) && (!((_arg1 == 0))))){ this.timeScale = (this.totalDuration / _arg1); }; } public function set totalProgress(_arg1:Number):void{ this.totalTime = (_reversed) ? ((1 - _arg1) * this.totalDuration) : (this.totalDuration * _arg1); } public function set progress(_arg1:Number):void{ this.totalTime = (_reversed) ? ((1 - _arg1) * this.duration) : (this.duration * _arg1); } public function play():void{ this.paused = false; } public function getChildren(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=true):Array{ var _local4:Array = []; var _local5:Tweenable = _firstChild; while (_local5 != null) { if ((_local5 is TweenLite)){ if (_arg2){ _local4[_local4.length] = _local5; }; } else { if (_arg3){ _local4[_local4.length] = _local5; }; if (_arg1){ _local4.concat((_local5 as TimelineLite).getChildren(true, _arg2, _arg3)); }; }; _local5 = _local5.nextNode; }; return (_local4); } protected function forceChildrenToEnd(_arg1:Number, _arg2:Boolean=false):void{ this.cachedTotalTime = this.cachedTotalDuration; this.cachedTime = this.cachedDuration; var _local3:Tweenable = _firstChild; while (_local3 != null) { if (((_local3.active) || (((!(_local3.cachedPaused)) && (!((_local3.cachedTotalTime == _local3.cachedTotalDuration))))))){ _local3.renderTime(_local3.cachedTotalDuration); } else { if ((((((((_local3.cachedDuration == 0)) && (!(_arg2)))) && ((_local3.startTime > _arg1)))) && (!(_local3.cachedPaused)))){ _local3.renderTime(0, true); }; }; _local3 = _local3.nextNode; }; } protected function forceChildrenToBeginning(_arg1:Number, _arg2:Boolean=false):void{ this.cachedTotalTime = (this.cachedTime = 0); var _local3:Tweenable = _lastChild; while (_local3 != null) { if (((_local3.active) || (((!(_local3.cachedPaused)) && (!((_local3.cachedTotalTime == 0))))))){ _local3.renderTime(0); } else { if ((((((((((_local3.cachedDuration == 0)) && (!(_arg2)))) && ((_local3.startTime < _arg1)))) && ((_local3.startTime >= 0)))) && (!(_local3.cachedPaused)))){ _local3.renderTime(0, true); }; }; _local3 = _local3.prevNode; }; } override public function complete(_arg1:Boolean=false):void{ if (!_arg1){ renderTime(this.totalDuration); return; }; if (this.timeline.autoRemoveChildren){ this.enabled = false; } else { this.active = false; }; if (this.vars.onComplete != null){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); }; } public function get timeScale():Number{ return (this.cachedTimeScale); } override public function get totalDuration():Number{ var _local1:Boolean; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Tweenable; var _local6:Number; var _local7:Tweenable; if (this.cacheIsDirty){ if (this.gc){ _local1 = true; this.enabled = _local1; }; _local2 = 0; _local3 = 0; _local5 = _firstChild; _local6 = -(Infinity); while (_local5 != null) { _local7 = _local5.nextNode; if (((!(_local5.cachedPaused)) || (this.cachedPaused))){ if (_local5.startTime < _local6){ this.addChild(_local5); _local6 = _local5.prevNode.startTime; } else { _local6 = _local5.startTime; }; if (_local5.startTime < _local2){ _local2 = _local5.startTime; }; _local4 = (_local5.startTime + (_local5.totalDuration / _local5.cachedTimeScale)); if (_local4 > _local3){ _local3 = _local4; }; }; _local5 = _local7; }; this.cachedDuration = (this.cachedTotalDuration = (_local3 - _local2)); this.cacheIsDirty = false; if (_local1){ this.enabled = false; }; }; return (this.cachedTotalDuration); } } }//package gs
Section 44
//TimelineMax (gs.TimelineMax) package gs { import flash.events.*; import gs.core.tween.*; import gs.events.*; import flash.utils.*; public class TimelineMax extends TimelineLite implements IEventDispatcher { protected var _cyclesComplete:uint; protected var _dispatcher:EventDispatcher; protected var _hasUpdateListener:Boolean; public var yoyo:Boolean; protected var _repeatDelay:Number; protected var _repeat:int; public static const version:Number = 0.53; public static const ALIGN_INIT:String = "init"; public static const ALIGN_SEQUENCE:String = "sequence"; public static const ALIGN_START:String = "start"; public function TimelineMax(_arg1:Object=null){ super(_arg1); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); _cyclesComplete = 0; this.yoyo = ((this.vars.yoyo) || (false)); this.cacheIsDirty = true; if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){ initDispatcher(); }; } public function dispatchEvent(_arg1:Event):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(_arg1)); } override public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ var _local5:Tweenable; var _local6:Boolean; var _local7:Boolean; var _local8:Boolean; var _local9:Boolean; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Boolean; if (this.gc){ this.enabled = true; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; var _local3:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var _local4:Number = this.cachedTime; if (_arg1 >= _local3){ if (((_reversed) || (((this.yoyo) && (!(((_repeat % 2) == 0))))))){ forceChildrenToBeginning(_local4); } else { forceChildrenToEnd(_local4); }; _local7 = true; _local6 = _local7; } else { if (_arg1 <= 0){ if (_arg1 < 0){ this.active = false; }; if (((_reversed) || (((this.yoyo) && (!(((_repeat % 2) == 0))))))){ forceChildrenToEnd(_local4); _local6 = true; } else { forceChildrenToBeginning(_local4); }; _local7 = true; } else { this.cachedTotalTime = (this.cachedTime = (_reversed) ? (_local3 - _arg1) : _arg1); }; }; if (_repeat != 0){ _local10 = (this.cachedDuration + _repeatDelay); this.cachedTime = (((((this.yoyo) && ((((this.cachedTotalTime / _local10) % 2) >= 1)))) || (((!(this.yoyo)) && (!(((this.cachedTotalTime / _local10) % 1))))))) ? (this.cachedDuration - (this.cachedTotalTime % _local10)) : (this.cachedTotalTime % _local10); if (this.cachedTime >= this.cachedDuration){ this.cachedTime = this.cachedDuration; } else { if (this.cachedTime <= 0){ this.cachedTime = 0; }; }; if (((!((_cyclesComplete == int((this.cachedTotalTime / _local10))))) && (!(_local6)))){ _local8 = true; _cyclesComplete = int((this.cachedTotalTime / _local10)); _local11 = this.cachedTime; _local12 = this.cachedTotalTime; _local13 = Boolean(((!(this.yoyo)) || (((_cyclesComplete % 2) == 1)))); if (_reversed){ _local13 = !(_local13); }; if (_local13){ forceChildrenToEnd(_local4, false); if (!this.yoyo){ forceChildrenToBeginning(this.cachedDuration, true); }; } else { forceChildrenToBeginning(_local4, false); if (!this.yoyo){ forceChildrenToEnd(0, true); }; }; _local4 = this.cachedTime; this.cachedTime = _local11; this.cachedTotalTime = _local12; }; }; if (!this.initted){ _local9 = true; this.initted = _local9; if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START)); }; } else { if ((((this.cachedTime == _local4)) && (!(_arg2)))){ return; }; }; if (_local7){ } else { if ((this.cachedTime - _local4) > 0){ _local5 = _firstChild; while (_local5 != null) { if (((_local5.active) || (((((!(_local5.cachedPaused)) && ((_local5.startTime <= this.cachedTime)))) && (!((_local5.cachedDuration == 0))))))){ _local5.renderTime(((this.cachedTime - _local5.startTime) * _local5.cachedTimeScale)); } else { if ((((((((_local5.cachedDuration == 0)) && ((((_local5.startTime > _local4)) || (_local9))))) && ((_local5.startTime <= this.cachedTime)))) && (!(_local5.cachedPaused)))){ _local5.renderTime(0, true); }; }; _local5 = _local5.nextNode; }; } else { _local5 = _lastChild; while (_local5 != null) { if (((_local5.active) || (((((!(_local5.cachedPaused)) && ((_local5.startTime <= _local4)))) && (!((_local5.cachedDuration == 0))))))){ _local5.renderTime(((this.cachedTime - _local5.startTime) * _local5.cachedTimeScale)); } else { if ((((((((_local5.cachedDuration == 0)) && ((_local5.startTime < _local4)))) && ((_local5.startTime >= this.cachedTime)))) && (!(_local5.cachedPaused)))){ _local5.renderTime(0, true); }; }; _local5 = _local5.prevNode; }; }; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_hasUpdateListener){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); }; if (_local6){ if (!_reversed){ complete(true); } else { if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE)); }; }; } else { if (((_local8) && (!((_dispatcher == null))))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT)); }; }; } public function set repeatDelay(_arg1:Number):void{ _repeatDelay = _arg1; setDirtyCache(true); } public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ if (_dispatcher != null){ _dispatcher.removeEventListener(_arg1, _arg2, _arg3); }; } public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ if (_dispatcher == null){ initDispatcher(); }; if (_arg1 == TweenEvent.UPDATE){ _hasUpdateListener = true; }; _dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } public function addCallback(_arg1:Function, _arg2, _arg3:Array=null):TweenLite{ var _local4:TweenLite = new TweenLite(_arg1, 0, {onComplete:_arg1, onCompleteParams:_arg3, overwrite:0, immediateRender:false}); insert(_local4, _arg2); return (_local4); } public function hasEventListener(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(_arg1)); } protected function initDispatcher():void{ if (_dispatcher == null){ _dispatcher = new EventDispatcher(this); if ((this.vars.onStartListener is Function)){ _dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true); }; if ((this.vars.onUpdateListener is Function)){ _dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true); _hasUpdateListener = true; }; if ((this.vars.onCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true); }; }; } public function get repeat():int{ return (_repeat); } public function willTrigger(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(_arg1)); } public function removeCallback(_arg1:Function, _arg2=null):Boolean{ var _local4:int; var _local5:Boolean; var _local3:Array = getTweensOf(_arg1, false); if (typeof(_arg2) == "string"){ if (!(_arg2 in _labels)){ return (false); }; _arg2 = ((_labels[_arg2]) || (0)); }; _local4 = (_local3.length - 1); while (_local4 > -1) { if ((((_arg2 == null)) || ((_local3[_local4].startTime == _arg2)))){ remove((_local3[_local4] as Tweenable)); _local5 = true; }; _local4--; }; return (_local5); } public function get repeatDelay():Number{ return (_repeatDelay); } public function set repeat(_arg1:int):void{ _repeat = _arg1; setDirtyCache(true); } override public function get totalDuration():Number{ var _local1:Number; if (this.cacheIsDirty){ _local1 = super.totalDuration; this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat)); }; return (this.cachedTotalDuration); } override public function complete(_arg1:Boolean=false):void{ super.complete(_arg1); if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; } public function getActive(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=false):Array{ var _local6:int; var _local4:Array = []; var _local5:Array = getChildren(_arg1, _arg2, _arg3); var _local7:uint = _local5.length; _local6 = 0; while (_local6 < _local7) { if (_local5[_local6].active){ _local4[_local4.length] = _local5[_local6]; }; _local6++; }; return (_local4); } } }//package gs
Section 45
//TweenLite (gs.TweenLite) package gs { import flash.display.*; import flash.events.*; import gs.core.tween.*; import gs.plugins.*; import flash.utils.*; public class TweenLite extends Tweenable { protected var _hasPlugins:Boolean; public var propTweenLookup:Object; protected var _overwrittenProps:Object; public var target:Object; protected var _notifyPluginsOfEnabled:Boolean; public var ease:Function; protected var _firstPropTween:PropTween; public static const version:Number = 11.097; public static var rootTimeline:SimpleTimeline; 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; public static var timingSprite:Sprite = new Sprite(); 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, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, persist:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1}; public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){ var _local4:int; var _local5:Array; var _local6:TweenLite; super(_arg2, _arg3); this.ease = ((typeof(this.vars.ease))!="function") ? defaultEase : this.vars.ease; this.target = _arg1; if (this.vars.easeParams != null){ this.vars.proxiedEase = this.ease; this.ease = easeProxy; }; propTweenLookup = {}; if (!(_arg1 in masterList)){ masterList[_arg1] = [this]; } else { _local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); if (_local4 == 1){ _local5 = masterList[_arg1]; for each (_local6 in _local5) { if (!_local6.gc){ _local6.enabled = false; }; }; masterList[_arg1] = [this]; } else { masterList[_arg1].push(this); }; }; if (((((this.active) && (!((this.vars.immediateRender == false))))) || ((this.vars.immediateRender == true)))){ renderTime(0); }; } protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } override public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; var _local4:Boolean; var _local5:Number = this.cachedTime; this.active = true; if (_arg1 >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); _local3 = 1; _local4 = true; } else { if (_arg1 <= 0){ _local3 = 0; this.cachedTotalTime = (this.cachedTime = _local3); if (_arg1 < 0){ this.active = false; }; } else { this.cachedTotalTime = (this.cachedTime = _arg1); _local3 = this.ease(_arg1, 0, 1, this.cachedDuration); }; }; if (!this.initted){ init(); if (this.vars.onStart != null){ this.vars.onStart.apply(null, this.vars.onStartParams); }; } else { if ((((this.cachedTime == _local5)) && (!(_arg2)))){ return; }; }; var _local6:PropTween = _firstPropTween; while (_local6 != null) { _local6.target[_local6.property] = (_local6.start + (_local3 * _local6.change)); _local6 = _local6.nextNode; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local4){ complete(true); }; } protected function removePropTween(_arg1:PropTween):void{ if (((_arg1.isPlugin) && (!((_arg1.target.onDisable == null))))){ _arg1.target.onDisable(); }; if (_arg1.nextNode != null){ _arg1.nextNode.prevNode = _arg1.prevNode; }; if (_arg1.prevNode != null){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (_firstPropTween == _arg1){ _firstPropTween = _arg1.nextNode; }; }; } protected function insertPropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String, _arg6:Boolean, _arg7:PropTween):PropTween{ var _local9:Array; var _local10:int; var _local8:PropTween = new PropTween(_arg1, _arg2, _arg3, ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4), _arg5, _arg6, _arg7); if (_arg7 != null){ _arg7.prevNode = _local8; }; if (((_arg6) && ((_arg5 == "_MULTIPLE_")))){ _local9 = _arg1.overwriteProps; _local10 = (_local9.length - 1); while (_local10 > -1) { propTweenLookup[_local9[_local10]] = _local8; _local10--; }; } else { propTweenLookup[_arg5] = _local8; }; return (_local8); } protected function init():void{ var _local1:String; var _local2:int; var _local3:*; var _local4:Boolean; var _local6:PropTween; var _local5:Object = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars; propTweenLookup = {}; if (((!((_local5.timeScale == undefined))) && ((this.target is Tweenable)))){ _firstPropTween = insertPropTween(this.target, "timeScale", this.target.timeScale, _local5.timeScale, "timeScale", false, _firstPropTween); }; for (_local1 in _local5) { if ((_local1 in _reservedProps)){ } else { if ((_local1 in plugins)){ _local3 = new (plugins[_local1]); if (_local3.onInitTween(this.target, _local5[_local1], this) == false){ _firstPropTween = insertPropTween(this.target, _local1, this.target[_local1], _local5[_local1], _local1, false, _firstPropTween); } else { _firstPropTween = insertPropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, _firstPropTween); _hasPlugins = true; if (_local3.priority != 0){ _firstPropTween.priority = _local3.priority; _local4 = true; }; if (((!((_local3.onDisable == null))) || (!((_local3.onEnable == null))))){ _notifyPluginsOfEnabled = true; }; }; } else { _firstPropTween = insertPropTween(this.target, _local1, this.target[_local1], _local5[_local1], _local1, false, _firstPropTween); }; }; }; if (_local4){ _firstPropTween = onPluginEvent("onInit", _firstPropTween); }; if (this.vars.runBackwards == true){ _local6 = _firstPropTween; while (_local6 != null) { _local6.start = (_local6.start + _local6.change); _local6.change = -(_local6.change); _local6 = _local6.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps != null){ killVars(_overwrittenProps); }; if (((((TweenLite.overwriteManager.enabled) && (!((_firstPropTween == null))))) && ((this.target in masterList)))){ overwriteManager.manageOverwrites(this, propTweenLookup, masterList[this.target]); }; this.initted = true; } override public function complete(_arg1:Boolean=false):void{ if (!_arg1){ renderTime(this.cachedTotalDuration); return; }; if (_hasPlugins){ onPluginEvent("onComplete", _firstPropTween); }; if (this.timeline.autoRemoveChildren){ this.enabled = false; } else { this.active = false; }; if (this.vars.onComplete != null){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); }; } override public function set enabled(_arg1:Boolean):void{ if (_arg1 == this.gc){ if (_arg1){ if (!(this.target in TweenLite.masterList)){ TweenLite.masterList[this.target] = [this]; } else { TweenLite.masterList[this.target].push(this); }; }; super.enabled = _arg1; if (_notifyPluginsOfEnabled){ onPluginEvent((_arg1) ? "onEnable" : "onDisable", _firstPropTween); }; }; } public function killVars(_arg1:Object, _arg2:Boolean=true):void{ var _local3:String; var _local4:PropTween; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (_local3 in _arg1) { if ((_local3 in propTweenLookup)){ _local4 = propTweenLookup[_local3]; if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){ _local4.target.killProps(_arg1); if (_local4.target.overwriteProps.length == 0){ removePropTween(_local4); delete propTweenLookup[_local3]; }; } else { removePropTween(_local4); delete propTweenLookup[_local3]; }; }; if (_arg2){ _overwrittenProps[_local3] = 1; }; }; } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{ return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, useFrames:_arg4, overwrite:0})); } public static function removeTween(_arg1:TweenLite):void{ if (_arg1 != null){ _arg1.enabled = false; }; } public static function initClass():void{ TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]); rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.startTime = (getTimer() * 0.001); rootFramesTimeline.startTime = rootFrame; rootTimeline.autoRemoveChildren = (rootFramesTimeline.autoRemoveChildren = true); timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{ var _local3:Array; var _local4:int; if (((!((_arg1 == null))) && ((_arg1 in masterList)))){ _local3 = masterList[_arg1]; _local4 = _local3.length; while (_local4-- > 0) { if (!_local3[_local4].gc){ if (_arg2){ _local3[_local4].complete(false); } else { _local3[_local4].enabled = false; }; }; }; delete masterList[_arg1]; }; } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ _arg3.runBackwards = true; if (_arg3.immediateRender != false){ _arg3.immediateRender = true; }; return (new TweenLite(_arg1, _arg2, _arg3)); } protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } protected static function updateAll(_arg1:Event=null):void{ var _local2:Dictionary; var _local3:Object; var _local4:Array; var _local5:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.startTime) * rootTimeline.cachedTimeScale)); rootFrame++; rootFramesTimeline.renderTime((rootFrame * rootFramesTimeline.cachedTimeScale)); if (!(rootFrame % 60)){ _local2 = masterList; for (_local3 in _local2) { _local4 = _local2[_local3]; _local5 = _local4.length; while (_local5-- > 0) { if (_local4[_local5].gc){ _local4.splice(_local5, 1); }; }; if (_local4.length == 0){ delete _local2[_local3]; }; }; }; } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ return (new TweenLite(_arg1, _arg2, _arg3)); } } }//package gs
Section 46
//TweenMax (gs.TweenMax) package gs { import flash.display.*; import flash.events.*; import gs.core.tween.*; import gs.plugins.*; import gs.events.*; import flash.utils.*; public class TweenMax extends TweenLite implements IEventDispatcher { protected var _reversed:Boolean; public var yoyo:Boolean; protected var _repeat:int; protected var _cyclesComplete:uint; protected var _dispatcher:EventDispatcher; protected var _hasUpdateListener:Boolean; protected var _pauseTime:Number; protected var _repeatDelay:Number; public static const version:Number = 11.0971; public static var removeTween:Function = TweenLite.removeTween; private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(); ; private static var _pauseAllTime:Number; public static var killTweensOf:Function = TweenLite.killTweensOf; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]); public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){ super(_arg1, _arg2, _arg3); if (TweenLite.version < 11.097){ trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com."); }; if ((((typeof(this.vars.yoyo) == "number")) || (!((this.vars.loop == undefined))))){ trace("WARNING: Your tween uses the old 'yoyo' or 'loop' syntax which technically still works for now but has been deprecated in favor of the new, more flexible 'repeat' and 'yoyo' usage. See http://www.TweenMax.com for details."); }; _cyclesComplete = 0; if ((((this.vars.yoyo == true)) || (!(isNaN(this.vars.yoyo))))){ this.yoyo = true; }; _repeat = ((this.vars.loop)!=undefined) ? ((this.vars.loop)==0) ? -1 : Number(this.vars.loop) : ((((typeof(this.vars.yoyo))=="number") ? ((this.vars.yoyo)==0) ? -1 : this.vars.yoyo : this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); this.cacheIsDirty = true; if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){ initDispatcher(); if ((((_arg2 == 0)) && ((this.delay == 0)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; }; if (this.vars.reversed == true){ _reversed = true; }; } override public function renderTime(_arg1:Number, _arg2:Boolean=false):void{ var _local4:Tweenable; var _local6:Boolean; var _local7:Number; var _local8:Boolean; var _local10:Number; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; var _local3:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var _local5:Number = this.cachedTime; if (_arg1 >= _local3){ if (((_reversed) || (((this.yoyo) && (!(((_repeat % 2) == 0))))))){ _local7 = 0; this.cachedTotalTime = (this.cachedTime = _local7); } else { this.cachedTotalTime = _local3; this.cachedTime = this.cachedDuration; _local7 = 1; }; _local6 = true; } else { if (_arg1 <= 0){ if (_arg1 < 0){ this.active = false; }; if (((_reversed) || (((this.yoyo) && (!(((_repeat % 2) == 0))))))){ this.cachedTotalTime = _local3; this.cachedTime = this.cachedDuration; _local7 = 1; _local6 = true; } else { _local7 = 0; this.cachedTotalTime = (this.cachedTime = _local7); }; } else { this.cachedTotalTime = (this.cachedTime = (_reversed) ? (_local3 - _arg1) : _arg1); if (_repeat == 0){ _local7 = this.ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; }; if (_repeat != 0){ _local10 = (this.cachedDuration + _repeatDelay); this.cachedTime = (((((this.yoyo) && ((((this.cachedTotalTime / _local10) % 2) >= 1)))) || (((!(this.yoyo)) && (!(((this.cachedTotalTime / _local10) % 1))))))) ? (this.cachedDuration - (this.cachedTotalTime % _local10)) : (this.cachedTotalTime % _local10); if (this.cachedTime >= this.cachedDuration){ this.cachedTime = this.cachedDuration; _local7 = 1; } else { if (this.cachedTime <= 0){ _local7 = 0; this.cachedTime = _local7; } else { _local7 = this.ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!((_cyclesComplete == int((this.cachedTotalTime / _local10))))) && (!(_local6)))){ _local8 = true; _cyclesComplete = int((this.cachedTotalTime / _local10)); }; }; if (!this.initted){ init(); if (this.vars.onStart != null){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START)); }; } else { if ((((_local5 == this.cachedTime)) && (!(_arg2)))){ return; }; }; var _local9:PropTween = _firstPropTween; while (_local9 != null) { _local9.target[_local9.property] = (_local9.start + (_local7 * _local9.change)); _local9 = _local9.nextNode; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_hasUpdateListener){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); }; if (_local6){ if (!_reversed){ complete(true); } else { if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE)); }; }; } else { if (((_local8) && (!((_dispatcher == null))))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT)); }; }; } public function set reversed(_arg1:Boolean):void{ if (_arg1 != _reversed){ reverse(true); }; } public function willTrigger(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(_arg1)); } public function restart(_arg1:Boolean=false):void{ this.totalTime = (_arg1) ? -(_delay) : 0; this.paused = false; } override protected function init():void{ var _local1:int; var _local2:int; var _local3:String; var _local4:String; var _local5:Array; var _local6:Object; var _local7:PropTween; if (this.vars.startAt != null){ this.vars.startAt.overwrite = 0; new TweenMax(this.target, 0, this.vars.startAt); }; super.init(); if ((((this.vars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){ _local5 = this.vars.roundProps; _local1 = (_local5.length - 1); while (_local1 > -1) { _local3 = _local5[_local1]; _local7 = this._firstPropTween; while (_local7 != null) { if (_local7.name == _local3){ if (_local7.isPlugin){ _local7.target.round = true; } else { if (_local6 == null){ _local6 = new TweenLite.plugins.roundProps(); _local6.add(_local7.target, _local3, _local7.start, _local7.change); _hasPlugins = true; _firstPropTween = insertPropTween(_local6, "changeFactor", 0, 1, "_MULTIPLE_", true, _firstPropTween); } else { _local6.add(_local7.target, _local3, _local7.start, _local7.change); this.removePropTween(_local7); }; }; } else { if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){ _local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " "); if (_local4.indexOf(((" " + _local3) + " ")) != -1){ _local7.target.round = true; }; }; }; _local7 = _local7.nextNode; }; _local1--; }; }; } public function get totalProgress():Number{ return ((_reversed) ? (1 - (this.cachedTotalTime / this.totalDuration)) : (this.cachedTotalTime / this.totalDuration)); } protected function adjustStartValues():void{ var _local2:Number; var _local3:Number; var _local4:PropTween; var _local5:Number; var _local6:int; var _local1:Number = this.progress; if (_local1 != 0){ _local2 = this.ease(_local1, 0, 1, 1); _local3 = (1 / (1 - _local2)); _local4 = _firstPropTween; while (_local4 != null) { _local5 = (_local4.start + _local4.change); if (_local4.isPlugin){ _local4.change = ((_local5 - _local2) * _local3); } else { _local4.change = ((_local5 - _local4.target[_local4.property]) * _local3); }; _local4.start = (_local5 - _local4.change); _local4 = _local4.nextNode; }; }; } public function set time(_arg1:Number):void{ this.totalTime = _arg1; } override public function set delay(_arg1:Number):void{ super.delay = _arg1; setDirtyCache(true); } public function set totalProgress(_arg1:Number):void{ this.totalTime = (_reversed) ? ((1 - _arg1) * this.totalDuration) : (this.totalDuration * _arg1); } override public function set duration(_arg1:Number):void{ this.cachedDuration = _arg1; this.setDirtyCache(true); } public function resume():void{ this.paused = false; } public function get paused():Boolean{ return (this.cachedPaused); } public function killProperties(_arg1:Array):void{ var _local3:int; var _local2:Object = {}; _local3 = (_arg1.length - 1); while (_local3 > -1) { _local2[_arg1[_local3]] = true; _local3--; }; killVars(_local2); } public function get progress():Number{ return ((_reversed) ? (1 - (this.cachedTime / this.duration)) : (this.cachedTime / this.duration)); } public function get totalTime():Number{ return (this.cachedTotalTime); } override public function complete(_arg1:Boolean=false):void{ super.complete(_arg1); if (_dispatcher != null){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; } public function invalidate():void{ _firstPropTween = null; _overwrittenProps = null; _hasUpdate = (_hasUpdateListener = false); if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){ initDispatcher(); }; if ((((this.vars.yoyo == true)) || (!(isNaN(this.vars.yoyo))))){ this.yoyo = true; }; if (!isNaN(this.vars.repeat)){ _repeat = this.vars.repeat; }; if (!isNaN(this.vars.repeatDelay)){ _repeatDelay = this.vars.repeatDelay; }; this.initted = (this.active = false); } public function dispatchEvent(_arg1:Event):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(_arg1)); } public function get reversed():Boolean{ return (_reversed); } public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ if (_dispatcher != null){ _dispatcher.removeEventListener(_arg1, _arg2, _arg3); }; } public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{ var _local4:Object = {}; _local4[_arg1] = _arg2; updateProperties(_local4, _arg3); } public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ if (_dispatcher == null){ initDispatcher(); }; if (_arg1 == TweenEvent.UPDATE){ _hasUpdateListener = true; }; _dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } protected function initDispatcher():void{ if (_dispatcher == null){ _dispatcher = new EventDispatcher(this); }; if ((this.vars.onStartListener is Function)){ _dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true); }; if ((this.vars.onUpdateListener is Function)){ _dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true); _hasUpdateListener = true; }; if ((this.vars.onCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true); }; } protected function setDirtyCache(_arg1:Boolean=true):void{ var _local2:Tweenable = (_arg1) ? this : this.timeline; while (_local2 != null) { _local2.cacheIsDirty = true; _local2 = _local2.timeline; }; } public function set progress(_arg1:Number):void{ this.totalTime = (_reversed) ? ((1 - _arg1) * this.duration) : (this.duration * _arg1); } protected function updateProperties(_arg1:Object, _arg2:Boolean=true):void{ var _local5:String; var _local6:Object; var _local7:Boolean; var _local3:PropTween = _firstPropTween; var _local4:Number = this.cachedTotalTime; if (this.initted){ if (!_arg2){ this.time = 0; }; killVars(_arg1); for (_local5 in _arg1) { if ((_local5 in _reservedProps)){ } else { if ((_local5 in plugins)){ _local6 = new (plugins[_local5]); if (_local6.onInitTween(this.target, _arg1[_local5], this) == false){ _firstPropTween = insertPropTween(this.target, _local5, this.target[_local5], _arg1[_local5], _local5, false, _firstPropTween); } else { _firstPropTween = insertPropTween(_local6, "changeFactor", 0, 1, ((_local6.overwriteProps.length)==1) ? _local6.overwriteProps[0] : "_MULTIPLE_", true, _firstPropTween); _hasPlugins = true; if (_local6.priority != 0){ _firstPropTween.priority = _local6.priority; _local7 = true; }; }; } else { _firstPropTween = insertPropTween(this.target, _local5, this.target[_local5], _arg1[_local5], _local5, false, _firstPropTween); }; }; this.vars[_local5] = _arg1[_local5]; }; if (_local7){ _firstPropTween = onPluginEvent("onInit", _firstPropTween); }; if (((_arg2) && (!((this.cachedTotalTime == 0))))){ adjustStartValues(); this.time = _local4; }; } else { for (_local5 in _arg1) { this.vars[_local5] = _arg1[_local5]; }; }; } public function set totalTime(_arg1:Number):void{ this.startTime = (this.timeline.cachedTotalTime - (_arg1 / this.cachedTimeScale)); renderTime(_arg1); setDirtyCache(false); } public function set paused(_arg1:Boolean):void{ var _local2:Number; if (_arg1 != this.cachedPaused){ if (!_arg1){ _local2 = (_reversed) ? (this.totalDuration - this.cachedTotalTime) : this.cachedTotalTime; this.startTime = (this.timeline.cachedTotalTime - (_local2 / this.cachedTimeScale)); }; setDirtyCache(false); this.cachedPaused = _arg1; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(_arg1)) && (this.gc))){ this.enabled = true; }; } public function get time():Number{ return (this.cachedTime); } public function reverse(_arg1:Boolean=true):void{ this.startTime = (this.timeline.cachedTotalTime - (((1 - this.progress) * this.totalDuration) / this.cachedTimeScale)); _reversed = !(_reversed); setDirtyCache(false); if (_arg1){ this.paused = false; if (this.progress == 1){ this.time = 0; }; } else { if (this.gc){ this.enabled = true; }; }; } public function hasEventListener(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(_arg1)); } public function pause():void{ this.paused = true; } override public function set totalDuration(_arg1:Number):void{ this.timeScale = (this.totalDuration / _arg1); } override public function get totalDuration():Number{ if (this.cacheIsDirty){ this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat)); this.cacheIsDirty = false; }; return (this.cachedTotalDuration); } public function set timeScale(_arg1:Number):void{ this.startTime = (this.cachedTotalTime - (((this.cachedTotalTime - this.startTime) * this.cachedTimeScale) / _arg1)); this.cachedTimeScale = _arg1; } public function get timeScale():Number{ return (this.cachedTimeScale); } public static function set globalTimeScale(_arg1:Number):void{ TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = _arg1); } public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{ changePause(true, _arg1, _arg2); } public static function getTweensOf(_arg1:Object):Array{ var _local4:int; var _local2:Array = masterList[_arg1]; var _local3:Array = []; if (_local2 != null){ _local4 = _local2.length; while (_local4-- > 0) { if (!_local2[_local4].gc){ _local3[_local3.length] = _local2[_local4]; }; }; }; return (_local3); } public static function killAllDelayedCalls(_arg1:Boolean=false):void{ killAll(_arg1, false, true); } public static function get globalTimeScale():Number{ return (TweenLite.rootTimeline.cachedTimeScale); } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{ return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, useFrames:_arg4, overwrite:0})); } public static function isTweening(_arg1:Object):Boolean{ var _local2:Array = getTweensOf(_arg1); var _local3:int = _local2.length; while (_local3-- > 0) { if (((((_local2[_local3].active) || ((_local2[_local3].startTime == _local2[_local3].cachedTime)))) && (!(_local2[_local3].gc)))){ return (true); }; }; return (false); } public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{ var _local5:Boolean; var _local4:Array = getAllTweens(); var _local6:int = _local4.length; while (_local6-- > 0) { _local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete); if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){ if (_arg1){ _local4[_local6].complete(false); } else { _local4[_local6].enabled = false; }; }; }; } public static function killChildTweensOf(_arg1:DisplayObjectContainer, _arg2:Boolean=false):void{ var _local4:Object; var _local5:DisplayObjectContainer; var _local3:Array = getAllTweens(); var _local6:int = _local3.length; while (_local6-- > 0) { _local4 = _local3[_local6].target; if ((_local4 is DisplayObject)){ _local5 = _local4.parent; while (_local5 != null) { if (_local5 == _arg1){ if (_arg2){ _local3[_local6].complete(false); } else { _local3[_local6].enabled = false; }; }; _local5 = _local5.parent; }; }; }; } public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{ var _local5:Boolean; var _local4:Array = getAllTweens(); var _local6:int = _local4.length; while (_local6-- > 0) { _local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete); if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){ (_local4[_local6] as TweenMax).paused = _arg1; }; }; } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{ _arg3.runBackwards = true; if (_arg3.immediateRender != false){ _arg3.immediateRender = true; }; return (new TweenMax(_arg1, _arg2, _arg3)); } public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{ _arg3.runBackwards = true; if (_arg3.immediateRender != false){ _arg3.immediateRender = true; }; return (allTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6)); } public static function killAllTweens(_arg1:Boolean=false):void{ killAll(_arg1, true, false); } public static function getAllTweens():Array{ var _local3:Array; var _local4:int; var _local1:Dictionary = masterList; var _local2:Array = []; for each (_local3 in _local1) { _local4 = _local3.length; while (_local4-- > 0) { if (!_local3[_local4].gc){ _local2[_local2.length] = _local3[_local4]; }; }; }; return (_local2); } public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{ changePause(false, _arg1, _arg2); } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{ return (new TweenMax(_arg1, _arg2, _arg3)); } public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{ var i:int; var vars:Object; var p:String; var onCompleteProxy:Function; var onCompleteParamsProxy:Array; var $targets = _arg1; var $duration = _arg2; var $vars = _arg3; var $stagger = _arg4; var $onCompleteAll = _arg5; var $onCompleteAllParams = _arg6; var l:uint = $targets.length; var a:Array = []; var curDelay:Number = (($vars.delay) || (0)); onCompleteProxy = $vars.onComplete; onCompleteParamsProxy = $vars.onCompleteParams; var lastIndex:int = (($stagger)<=0) ? 0 : (l - 1); i = 0; while (i < l) { vars = {}; for (p in $vars) { vars[p] = $vars[p]; }; vars.delay = curDelay; if ((((i == lastIndex)) && (!(($onCompleteAll == null))))){ vars.onComplete = function ():void{ if (onCompleteProxy != null){ onCompleteProxy.apply(null, onCompleteParamsProxy); }; $onCompleteAll.apply(null, $onCompleteAllParams); }; }; a[a.length] = new TweenMax($targets[i], $duration, vars); curDelay = (curDelay + $stagger); i = (i + 1); }; return (a); } } }//package gs
Section 47
//MochiAd (mochi.as3.MochiAd) package mochi.as3 { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("3.0 as3"); } public static function showClickAwayAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{ }, ad_finished:function ():void{ }, ad_loaded:function (_arg1:Number, _arg2: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 (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; var sendHostProgress:Boolean; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; _local3 = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (this.root == null){ _local3 = true; }; if (_local3){ delete this.onEnterFrame; }; }; doOnEnterFrame(chk); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function _allowDomains(_arg1:String):String{ var _local2:String = _arg1.split("/")[2].split(":")[0]; if (Security.sandboxType == "application"){ return (_local2); }; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (_arg1.origFrameRate != undefined){ _arg1.stage.frameRate = _arg1.origFrameRate; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad._containerLCName != undefined){ _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"}); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function showInterLevelAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2: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 _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 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 (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (_local2 > chk.ad_msec){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; if (_local3.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.")); }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; if (_local3.id == "test"){ trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!"); }; return (_local3); } public static function _cleanup(_arg1:Object):void{ var k:String; var lc:LocalConnection; var f:Function; var mc = _arg1; if (("lc" in mc)){ lc = mc.lc; f = function ():void{ try { lc.client = null; lc.close(); } catch(e:Error) { }; }; 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(_arg1:Object):MovieClip{ var clip:Object; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var g:Function; var req:URLRequest; var v:Object; var options = _arg1; var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); clip = options.clip; if (!MochiAd._isNetworkAvailable()){ return (null); }; try { if (clip._mochiad_loaded){ return (null); }; } catch(e:Error) { throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; var depth:Number = options.depth; delete options.depth; var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = MochiAd._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; if (clip.loaderInfo.loaderURL.indexOf("http") == 0){ options.as3_swf = clip.loaderInfo.loaderURL; } else { trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal"); }; var lv:URLVariables = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; mc.lcName = name; lv.lc = name; lv.st = getTimer(); loader = new Loader(); g = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.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 (_arg1:IOErrorEvent):void{ trace("[MochiAds] Blocked URL"); }); loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return (undefined); }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; if (typeof(_arg1[_local4[_local5]]) == "function"){ return (_arg1[_local4[_local5]].apply(_arg1, _arg3)); }; return (undefined); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local6:Array; var _local3:Object = _arg2.getBounds(_arg2.root); var _local4:Number = 0; var _local5:Number = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function adShowing(_arg1:Object):void{ _arg1.origFrameRate = _arg1.stage.frameRate; _arg1.stage.frameRate = 30; } public static function getValue(_arg1:Object, _arg2:String):Object{ var _local3:Array = _arg2.split("."); var _local4:Number = 0; while (_local4 < (_local3.length - 1)) { if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){ return (undefined); }; _arg1 = _arg1[_local3[_local4]]; _local4++; }; return (_arg1[_local3[_local4]]); } public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{ var _local4:Object; var _local5:Object; switch (_arg3.id){ case "setValue": MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value); break; case "getValue": _local4 = MochiAd.getValue(_arg1, _arg3.objectName); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4); break; case "runMethod": _local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5); break; default: trace(("[mochiads rpc] unknown rpc id: " + _arg3.id)); }; } public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return; }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; _arg1[_local4[_local5]] = _arg3; } public static function showPreGameAd(_arg1: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 = _arg1; var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2: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 (_arg1:Number):void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){ options.ad_started(); fn = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); return; }; clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); var fn:Function = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); 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; bar.y = (h - 20); }; var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; complete = false; unloaded = false; var f:Function = function (_arg1:Event):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); complete = true; if (unloaded){ MochiAd.unload(clip); }; }; clip.loaderInfo.addEventListener(Event.COMPLETE, f); if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; mc.rpcTestFn = function (_arg1:String):Object{ trace(("[MOCHIAD rpcTestFn] " + _arg1)); return (_arg1); }; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; sendHostProgress = false; mc.sendHostLoadProgress = function (_arg1:String):void{ sendHostProgress = true; }; chk["onEnterFrame"] = function ():void{ var _local11:Number; if (((!(this.parent)) || (!(this.parent.parent)))){ delete this["onEnterFrame"]; return; }; var _local1:Object = this.parent.parent.root; var _local2:Object = this.parent._mochiad_ctr; var _local3:Number = (getTimer() - this.started); var _local4:Boolean; var _local5:Number = _local1.loaderInfo.bytesTotal; var _local6:Number = _local1.loaderInfo.bytesLoaded; if (complete){ _local6 = Math.max(1, _local6); _local5 = _local6; }; var _local7:Number = ((100 * _local6) / _local5); var _local8:Number = ((100 * _local3) / chk.ad_msec); var _local9:Object = this._mochiad_bar._inside; var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); options.ad_progress(_local10); if (sendHostProgress){ clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7}); if (_local7 == 100){ sendHostProgress = false; }; }; if (!chk.showing){ _local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local11 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){ options.ad_failed(); _local4 = true; }; }; }; if (_local3 > chk.ad_msec){ _local4 = true; }; if (((complete) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function showPreloaderAd(_arg1:Object):void{ trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0"); MochiAd.showPreGameAd(_arg1); } public static function showTimedAd(_arg1:Object):void{ trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0"); MochiAd.showInterLevelAd(_arg1); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var mc = _arg1; var f:Function = function (_arg1:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { _arg1.target.removeEventListener(_arg1.type, arguments.callee); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//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(_arg1:Number=0, _arg2:uint=0):void{ Encoder = 0; setValue(_arg1, _arg2); } public function reencode():void{ var _local1:uint = int((2147483647 * Math.random())); Fragment = (Fragment ^ (_local1 ^ Encoder)); Encoder = _local1; } public function set value(_arg1:Number):void{ setValue(_arg1); } public function toString():String{ var _local1:String = String.fromCharCode((Fragment ^ Encoder)); if (Sibling != null){ _local1 = (_local1 + Sibling.toString()); }; return (_local1); } public function setValue(_arg1:Number=0, _arg2:uint=0):void{ var _local3:String = _arg1.toString(); var _temp1 = _arg2; _arg2 = (_arg2 + 1); Fragment = (_local3.charCodeAt(_temp1) ^ Encoder); if (_arg2 < _local3.length){ Sibling = new MochiDigits(_arg1, _arg2); } else { Sibling = null; }; reencode(); } public function get value():Number{ return (Number(this.toString())); } public function addValue(_arg1:Number):void{ value = (value + _arg1); } } }//package mochi.as3
Section 49
//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 static function showLeaderboard(_arg1:Object=null):void{ var n:Number; var options = _arg1; if (options != null){ if (options.clip != null){ if ((options.clip is Sprite)){ MochiServices.setContainer(options.clip); }; delete options.clip; } else { MochiServices.setContainer(); }; MochiServices.stayOnTop(); 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; }; }; 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(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2); } public static function requestList(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_requestList", null, _arg1, _arg2); } public static function scoresArrayToObjects(_arg1:Object):Object{ var _local3:Number; var _local4:Number; var _local5:Object; var _local6:Object; var _local7:String; var _local8:String; var _local2:Object = {}; for (_local7 in _arg1) { if (typeof(_arg1[_local7]) == "object"){ if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){ _local2[_local7] = []; _local5 = _arg1[_local7]; _local4 = 0; while (_local4 < _local5.rows.length) { _local6 = {}; _local3 = 0; while (_local3 < _local5.cols.length) { _local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3]; _local3++; }; _local2[_local7].push(_local6); _local4++; }; } else { _local2[_local7] = {}; for (_local8 in _arg1[_local7]) { _local2[_local7][_local8] = _arg1[_local7][_local8]; }; }; } else { _local2[_local7] = _arg1[_local7]; }; }; return (_local2); } public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{ _arg1 = Number(_arg1); if (isNaN(_arg1)){ trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'")); } else { if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){ trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite")); } else { if (Math.floor(_arg1) != _arg1){ trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated")); }; _arg1 = Number(_arg1); }; }; MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4); } public static function onClose(_arg1:Object=null):void{ if (_arg1 != null){ if (_arg1.error != null){ if (_arg1.error == true){ if (onErrorHandler != null){ if (_arg1.errorCode == null){ _arg1.errorCode = "IOError"; }; onErrorHandler(_arg1.errorCode); MochiServices.doClose(); return; }; }; }; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(_arg1:String):void{ MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } } }//package mochi.as3
Section 50
//MochiServices (mochi.as3.MochiServices) package mochi.as3 { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiServices { private static var _container:Object; private static var _connected:Boolean = false; private static var _swfVersion:String; public static var netupAttempted:Boolean = false; private static var _sendChannel:LocalConnection; private static var _clip:MovieClip; private static var _loader:Loader; private static var _id:String; private static var _listenChannel:LocalConnection; public static var widget:Boolean = false; private static var _timer:Timer; private static var _sendChannelName:String; private static var _connecting:Boolean = false; public static var onError:Object; private static var _listenChannelName:String = "__ms_"; private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf"; public static var netup:Boolean = true; public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function get connected():Boolean{ return (_connected); } private static function flush(_arg1:Boolean):void{ var _local2:Object; var _local3:Object; if (_clip != null){ if (_clip._queue != null){ while (_clip._queue.length > 0) { _local2 = _clip._queue.shift(); _local3 = null; if (_local2 != null){ if (_local2.callbackID != null){ _local3 = _clip._callbacks[_local2.callbackID]; }; delete _clip._callbacks[_local2.callbackID]; if (((_arg1) && (!((_local3 == null))))){ handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod); }; }; }; }; }; } public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{ if (_connected){ _sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ onError("NotConnected"); handleError(_arg2, _arg3, _arg4); flush(true); return; }; _clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); }; if (_clip != null){ if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){ _clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4}; _clip._nextcallbackID++; }; }; } private static function init(_arg1:String, _arg2:Object):void{ _id = _arg1; if (_arg2 != null){ _container = _arg2; loadCommunicator(_arg1, _container); }; } public static function get childClip():Object{ return (_clip); } private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{ var _local4:int; var _local14:Loader; var _local3: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 _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3]; var _local6:Array = [0, 64, 0, 0, 0]; var _local7:MovieClip = new MovieClip(); var _local8:LocalConnection = new LocalConnection(); var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime())); _local8 = new LocalConnection(); _local7.lc = _local8; _local7.click = _arg2; _local8.client = _local7; _local8.connect(_local9); var _local10:ByteArray = new ByteArray(); var _local11:ByteArray = new ByteArray(); _local11.endian = Endian.LITTLE_ENDIAN; _local11.writeShort(1); _local11.writeUTFBytes(((_arg1 + " ") + _local9)); _local11.writeByte(0); var _local12:uint = ((_local3.length + _local11.length) + 4); var _local13:uint = (_local12 + 35); _local10.endian = Endian.LITTLE_ENDIAN; _local10.writeUTFBytes("FWS"); _local10.writeByte(8); _local10.writeUnsignedInt(_local13); for each (_local4 in _local5) { _local10.writeByte(_local4); }; _local10.writeUnsignedInt(_local12); _local10.writeByte(136); _local10.writeShort(_local11.length); _local10.writeBytes(_local11); for each (_local4 in _local3) { _local10.writeByte(_local4); }; for each (_local4 in _local6) { _local10.writeByte(_local4); }; _local14 = new Loader(); _local14.loadBytes(_local10); _local7.addChild(_local14); return (_local7); } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4: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 = _arg1; var burl = _arg2; var btn = _arg3; var onClick = _arg4; var vars:Object = new Object(); vars["mav"] = getVersion(); vars["swfv"] = "9"; vars["swfurl"] = btn.loaderInfo.loaderURL; vars["fv"] = Capabilities.version; vars["os"] = Capabilities.os; vars["lang"] = Capabilities.language; vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY); var s = "?"; var i:Number = 0; for (x in vars) { if (i != 0){ s = (s + "&"); }; i = (i + 1); s = (((s + x) + "=") + escape(vars[x])); }; req = new URLRequest("http://x.mochiads.com/linkping.swf"); loader = new Loader(); setURL = function (_arg1:String):void{ if (avm1Click){ btn.removeChild(avm1Click); }; avm1Click = clickMovie(_arg1, onClick); var _local2:Rectangle = btn.getBounds(btn); btn.addChild(avm1Click); avm1Click.x = _local2.x; avm1Click.y = _local2.y; avm1Click.scaleX = (0.01 * _local2.width); avm1Click.scaleY = (0.01 * _local2.height); }; err = function (_arg1:Object):void{ netup = false; _arg1.target.removeEventListener(_arg1.type, arguments.callee); setURL(burl); }; complete = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.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 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); try { _listenChannel.close(); } catch(error:Error) { }; }; if (_timer != null){ try { _timer.stop(); } catch(error:Error) { }; }; } public static function allowDomains(_arg1:String):String{ var _local2:String; if (Security.sandboxType != "application"){ Security.allowDomain("*"); Security.allowInsecureDomain("*"); }; if (_arg1.indexOf("http://") != -1){ _local2 = _arg1.split("/")[2].split(":")[0]; if (Security.sandboxType != "application"){ Security.allowDomain(_local2); Security.allowInsecureDomain(_local2); }; }; return (_local2); } public static function getVersion():String{ return ("3.0"); } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); if (_clip.parent != null){ Sprite(_clip.parent).removeChild(_clip); }; } private static function onStatus(_arg1:StatusEvent):void{ switch (_arg1.level){ case "error": _connected = false; _listenChannel.connect(_listenChannelName); break; }; } public static function get id():String{ return (_id); } private static function urlOptions(_arg1:Object):Object{ var _local4:Array; var _local5:Number; var _local6:Array; var _local2:Object = {}; var _local3:String = _arg1.loaderInfo.parameters.mochiad_options; if (_local3){ _local4 = _local3.split("&"); _local5 = 0; while (_local5 < _local4.length) { _local6 = _local4[_local5].split("="); _local2[unescape(_local6[0])] = unescape(_local6[1]); _local5++; }; }; return (_local2); } public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{ if (_arg1 != null){ if ((_arg1 is Sprite)){ _container = _arg1; }; }; if (_arg2){ if ((_container is Sprite)){ Sprite(_container).addChild(_clip); }; }; } private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{ var args = _arg1; var callbackObject = _arg2; var callbackMethod = _arg3; 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)))){ try { var _local5 = callbackObject; _local5[callbackMethod](args); } catch(error:Error) { }; } else { if (callbackMethod != null){ try { callbackMethod.apply(args); } catch(error:Error) { }; }; }; }; } private static function initComChannels():void{ if (!_connected){ _sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL}); _listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _clip.onReceive = function (_arg1:Object):void{ var methodName:String; var pkg = _arg1; var cb:String = pkg.callbackID; var cblst:Object = this.client._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){ try { method.apply(obj, pkg.args); } catch(error:Error) { trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString())); }; } else { if (obj != null){ try { obj(pkg.args); } catch(error:Error) { trace(("Error invoking method on object: " + error.toString())); }; }; }; delete this.client._callbacks[cb]; }; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; trace("connected!"); _connecting = false; _connected = true; while (_clip._queue.length > 0) { _sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift()); }; }; } private static function listen():void{ _listenChannel = new LocalConnection(); _listenChannel.client = _clip; _clip.handshake = function (_arg1:Object):void{ MochiServices.comChannelName = _arg1.newChannel; }; _listenChannel.allowDomain("*", "localhost"); _listenChannel.allowInsecureDomain("*", "localhost"); _listenChannel.connect(_listenChannelName); trace("Waiting for MochiAds services to connect..."); } public static function set comChannelName(_arg1:String):void{ if (_arg1 != null){ if (_arg1.length > 3){ _sendChannelName = (_arg1 + "_fromgame"); initComChannels(); }; }; } private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{ var id = _arg1; var clip = _arg2; var clipname:String = ("_mochiservices_com_" + id); if (_clip != null){ return (_clip); }; if (!MochiServices.isNetworkAvailable()){ return (null); }; if (urlOptions(clip).servicesURL != undefined){ _servicesURL = urlOptions(clip).servicesURL; }; MochiServices.allowDomains(_servicesURL); _clip = createEmptyMovieClip(clip, clipname, 10336, false); _loader = new Loader(); var f:Function = function (_arg1:Object):void{ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); }; _listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999)))); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); var req:URLRequest = new URLRequest(_servicesURL); var vars:URLVariables = new URLVariables(); vars.listenLC = _listenChannelName; vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options; if (widget){ vars.widget = true; }; req.data = vars; listen(); _loader.load(req); _clip.addChild(_loader); _clip._mochiservices_com = _loader; _sendChannel = new LocalConnection(); _clip._queue = []; _clip._nextcallbackID = 0; _clip._callbacks = {}; _timer = new Timer(10000, 1); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); return (_clip); } public static function get clip():Object{ return (_container); } public static function bringToTop(_arg1:Event):void{ var e = _arg1; if (MochiServices.clip != null){ if (MochiServices.childClip != null){ try { if (MochiServices.clip.numChildren > 1){ MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1)); }; } catch(errorObject:Error) { trace("Warning: Depth sort error."); _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); }; }; }; } public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{ var id = _arg1; var clip = _arg2; var onError = _arg3; if ((clip is DisplayObject)){ if (((!(_connected)) && ((_clip == null)))){ trace("MochiServices Connecting..."); _connecting = true; init(id, clip); }; } else { trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage."); }; if (onError != null){ MochiServices.onError = onError; } else { if (MochiServices.onError == null){ MochiServices.onError = function (_arg1:String):void{ trace(_arg1); }; }; }; } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{ var parent = _arg1; var name = _arg2; var depth = _arg3; var doAdd = _arg4; var mc:MovieClip = new MovieClip(); if (doAdd){ if (((false) && (depth))){ parent.addChildAt(mc, depth); } else { parent.addChild(mc); }; }; try { parent[name] = mc; } catch(e:Error) { throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; mc["_name"] = name; return (mc); } public static function connectWait(_arg1:TimerEvent):void{ if (!_connected){ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load. (timeout)"); MochiServices.disconnect(); MochiServices.onError("IOError"); }; } } }//package mochi.as3
Section 51
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 52
//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 53
//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"; } }//package mx.core
Section 54
//Stats (net.hires.debug.Stats) package net.hires.debug { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.utils.*; import flash.text.*; import flash.system.*; public class Stats extends Sprite { private var _fps_graph:uint; private var _ms:uint; private var _timer:uint; private var _graph:BitmapData; private var _text:TextField; private var _mem:Number; private var _xml:XML; private var _mem_max_graph:uint; private var _theme:Object; private var _mem_graph:uint; private var _fps:uint; private var _ms_prev:uint; private var _rectangle:Rectangle; private var _style:StyleSheet; private var _mem_max:Number; public function Stats(_arg1:Object=null):void{ _theme = {bg:51, fps:0xFFFF00, ms:0xFF00, mem:0xFFFF, memmax:0xFF0070}; super(); if (_arg1){ if (_arg1.bg != null){ _theme.bg = _arg1.bg; }; if (_arg1.fps != null){ _theme.fps = _arg1.fps; }; if (_arg1.ms != null){ _theme.ms = _arg1.ms; }; if (_arg1.mem != null){ _theme.mem = _arg1.mem; }; if (_arg1.memmax != null){ _theme.memmax = _arg1.memmax; }; }; addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true); } private function hex2css(_arg1:int):String{ return (("#" + _arg1.toString(16))); } private function update(_arg1: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(50, ((_fps / stage.frameRate) * 50)); _mem_graph = (Math.min(50, Math.sqrt(Math.sqrt((_mem * 5000)))) - 2); _mem_max_graph = (Math.min(50, Math.sqrt(Math.sqrt((_mem_max * 5000)))) - 2); _graph.scroll(1, 0); _graph.fillRect(_rectangle, _theme.bg); _graph.setPixel(0, (_graph.height - _fps_graph), _theme.fps); _graph.setPixel(0, (_graph.height - ((_timer - _ms) >> 1)), _theme.ms); _graph.setPixel(0, (_graph.height - _mem_graph), _theme.mem); _graph.setPixel(0, (_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 init(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, init); graphics.beginFill(_theme.bg); graphics.drawRect(0, 0, 70, 50); graphics.endFill(); _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 = 70; _text.height = 50; _text.styleSheet = _style; _text.condenseWhite = true; _text.selectable = false; _text.mouseEnabled = false; addChild(_text); var _local2:Bitmap = new Bitmap((_graph = new BitmapData(70, 50, false, _theme.bg))); _local2.y = 50; addChild(_local2); _rectangle = new Rectangle(0, 0, 1, _graph.height); addEventListener(MouseEvent.CLICK, onClick); addEventListener(Event.ENTER_FRAME, update); addEventListener(Event.REMOVED_FROM_STAGE, destroy); } private function onClick(_arg1:MouseEvent):void{ if (((mouseY / height) > 0.5)){ stage.frameRate--; } else { stage.frameRate++; }; _xml.fps = ((("FPS: " + _fps) + " / ") + stage.frameRate); _text.htmlText = _xml; } private function destroy(_arg1:Event):void{ removeEventListener(MouseEvent.CLICK, onClick); removeEventListener(Event.ENTER_FRAME, update); removeEventListener(Event.REMOVED_FROM_STAGE, destroy); _graph.dispose(); } } }//package net.hires.debug
Section 55
//IInvalidatingDisplayObject (org.josht.display.IInvalidatingDisplayObject) package org.josht.display { public interface IInvalidatingDisplayObject { function invalidate():void; function validate():void; } }//package org.josht.display
Section 56
//InvalidatingSprite (org.josht.display.InvalidatingSprite) package org.josht.display { import flash.display.*; import flash.events.*; public class InvalidatingSprite extends Sprite implements IInvalidatingDisplayObject { protected var isInvalid:Boolean;// = false public function InvalidatingSprite(){ this.invalidate(); } protected function draw():void{ } public function validate():void{ while (this.isInvalid) { this.removeEventListener(Event.ENTER_FRAME, renderHandler); this.removeEventListener(Event.ADDED_TO_STAGE, renderHandler); this.isInvalid = false; this.draw(); }; } public function invalidate():void{ if (this.isInvalid){ return; }; this.isInvalid = true; if (this.stage){ try { this.addEventListener(Event["exitFrame"], renderHandler); } catch(error:Error) { }; this.addEventListener(Event.ENTER_FRAME, renderHandler); } else { this.addEventListener(Event.ADDED_TO_STAGE, renderHandler); }; } private function renderHandler(_arg1:Event):void{ this.validate(); } } }//package org.josht.display
Section 57
//ColorUtil (org.josht.utils.ColorUtil) package org.josht.utils { public class ColorUtil { public static function brightness(_arg1:uint):Number{ var _local2:Number = (red(_arg1) / 0xFF); var _local3:Number = (green(_arg1) / 0xFF); var _local4:Number = (blue(_arg1) / 0xFF); var _local5:Number = Math.max(_local2, _local3, _local4); return (_local5); } public static function red(_arg1:uint):uint{ return (((_arg1 >> 16) & 0xFF)); } public static function green(_arg1:uint):uint{ return (((_arg1 >> 8) & 0xFF)); } public static function fromARGB(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint):uint{ return (((_arg1 << 24) + fromRGB(_arg2, _arg3, _arg4))); } public static function blendColors(_arg1:Number, _arg2:Number, _arg3:Number=0.5):Number{ var _local4:Number = (1 - _arg3); var _local5:uint = ColorUtil.red(_arg1); var _local6:uint = ColorUtil.green(_arg1); var _local7:uint = ColorUtil.blue(_arg1); _arg1 = ColorUtil.fromRGB((_local5 * _arg3), (_local6 * _arg3), (_local7 * _arg3)); _local5 = ColorUtil.red(_arg2); _local6 = ColorUtil.green(_arg2); _local7 = ColorUtil.blue(_arg2); _arg2 = ColorUtil.fromRGB((_local5 * _local4), (_local6 * _local4), (_local7 * _local4)); return ((_arg1 + _arg2)); } public static function saturation(_arg1:uint):Number{ var _local2:Number = (red(_arg1) / 0xFF); var _local3:Number = (green(_arg1) / 0xFF); var _local4:Number = (blue(_arg1) / 0xFF); var _local5:Number = Math.max(_local2, _local3, _local4); var _local6:Number = Math.min(_local2, _local3, _local4); var _local7:Number = (_local5 - _local6); var _local8:Number = 0; var _local9:Number = _local5; if (((!((_local7 == 0))) && (!((_local9 == 0))))){ _local8 = (_local7 / _local5); }; return (_local8); } public static function blue(_arg1:uint):uint{ return ((_arg1 & 0xFF)); } public static function fromRGB(_arg1:uint, _arg2:uint, _arg3:uint):uint{ return ((((_arg1 << 16) + (_arg2 << 8)) + _arg3)); } public static function fromHSB(_arg1:Number, _arg2:Number, _arg3:Number):uint{ if (_arg2 == 0){ return (fromRGB((_arg3 * 0xFF), (_arg3 * 0xFF), (_arg3 * 0xFF))); }; var _local4:Number = 0; var _local5:Number = 0; var _local6:Number = 0; var _local7:Number = (_arg1 * 6); var _local8:Number = Math.floor(_local7); var _local9:Number = (_local7 - _local8); var _local10:Number = (_arg3 * (1 - _arg2)); var _local11:Number = (_arg3 * (1 - (_local9 * _arg2))); var _local12:Number = (_arg3 * (1 - ((1 - _local9) * _arg2))); switch (_local8){ case 0: _local4 = _arg3; _local5 = _local12; _local6 = _local10; break; case 1: _local4 = _local11; _local5 = _arg3; _local6 = _local10; break; case 2: _local4 = _local10; _local5 = _arg3; _local6 = _local12; break; case 3: _local4 = _local10; _local5 = _local11; _local6 = _arg3; break; case 4: _local4 = _local12; _local5 = _local10; _local6 = _arg3; break; case 5: _local4 = _arg3; _local5 = _local10; _local6 = _local11; break; }; _local4 = Math.round((_local4 * 0xFF)); _local5 = Math.round((_local5 * 0xFF)); _local6 = Math.round((_local6 * 0xFF)); return (fromRGB(_local4, _local5, _local6)); } public static function alpha(_arg1:uint):uint{ return (((_arg1 >> 24) & 0xFF)); } public static function hue(_arg1:uint):Number{ var _local9:Number; var _local10:Number; var _local11:Number; var _local2:Number = (red(_arg1) / 0xFF); var _local3:Number = (green(_arg1) / 0xFF); var _local4:Number = (blue(_arg1) / 0xFF); var _local5:Number = Math.max(_local2, _local3, _local4); var _local6:Number = Math.min(_local2, _local3, _local4); var _local7:Number = (_local5 - _local6); var _local8:Number = 0; if (_local7 != 0){ _local9 = ((_local5 - _local2) / _local7); _local10 = ((_local5 - _local3) / _local7); _local11 = ((_local5 - _local4) / _local7); switch (_local5){ case _local2: _local8 = (_local11 - _local10); break; case _local3: _local8 = ((2 + _local9) - _local11); break; case _local4: _local8 = ((4 + _local10) - _local9); break; }; _local8 = (_local8 / 6); }; if (_local8 < 0){ _local8++; }; if (_local8 > 1){ _local8--; }; return (_local8); } } }//package org.josht.utils
Section 58
//CreatedByBowlerHat (CreatedByBowlerHat) package { import flash.display.*; public dynamic class CreatedByBowlerHat extends Sprite { } }//package
Section 59
//FrosmoSponsorButton (FrosmoSponsorButton) package { import flash.display.*; public dynamic class FrosmoSponsorButton extends Sprite { } }//package
Section 60
//GridLight (GridLight) package { import com.bowlerhatgames.gridshock.*; public dynamic class GridLight extends LightBase { } }//package
Section 61
//Gridshock (Gridshock) package { import flash.display.*; import flash.events.*; import com.bowlerhatgames.gridshock.*; import mochi.as3.*; import com.bowlerhatgames.display.*; import flash.net.*; public class Gridshock extends GameRoot { public var gameBoard:GameBoard; private var _mochiContainer:MovieClip; public static const GAME_ID:String = "Gridshock"; public function Gridshock(){ this.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler); } override protected function playMoreItemSelectHandler(_arg1:ContextMenuEvent):void{ navigateToURL(new URLRequest(GlobalSettings.MORE_GAMES_URL), "_blank"); } private function addedToStageHandler(_arg1:Event):void{ _arg1.currentTarget.removeEventListener(_arg1.type, arguments.callee); this._mochiContainer = new MovieClip(); this.addChild(this._mochiContainer); MochiServices.connect("38ef553de9d1dbe6", this._mochiContainer); } } }//package
Section 62
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ if (Security.sandboxType == "localWithFile"){ return (null); }; var _local3:MochiBot = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); var _local4 = "http://core.mochibot.com/my/core.swf"; var _local5:URLVariables = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; var _local6:String = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; var _local7:URLRequest = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; var _local8:Loader = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 63
//NewRowProgressBar (NewRowProgressBar) package { import flash.display.*; public dynamic class NewRowProgressBar extends Sprite { } }//package
Section 64
//ProgressLight (ProgressLight) package { import com.bowlerhatgames.gridshock.*; public dynamic class ProgressLight extends ProgressLight { } }//package
Section 65
//RoundLight (RoundLight) package { import com.bowlerhatgames.gridshock.*; public dynamic class RoundLight extends LightBase { } }//package
Section 66
//VLightButton (VLightButton) package { import com.bowlerhatgames.gridshock.*; public dynamic class VLightButton extends LightBase { } }//package

Library Items

Symbol 1 FontUsed by:2 29 30 75
Symbol 2 TextUses:1Used by:124  Timeline
Symbol 3 BitmapUsed by:4
Symbol 4 GraphicUses:3Used by:5
Symbol 5 MovieClipUses:4Used by:Timeline
Symbol 6 FontUsed by:7 27 70 71 72 73 74 121
Symbol 7 TextUses:6Used by:Timeline
Symbol 8 GraphicUsed by:12
Symbol 9 GraphicUsed by:12
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClipUses:10Used by:12 67 117
Symbol 12 MovieClipUses:8 9 11Used by:25 68 79
Symbol 13 GraphicUsed by:24
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClipUses:14Used by:24
Symbol 16 GraphicUsed by:18
Symbol 17 GraphicUsed by:18
Symbol 18 MovieClipUses:16 17Used by:24
Symbol 19 GraphicUsed by:21
Symbol 20 GraphicUsed by:21
Symbol 21 MovieClipUses:19 20Used by:24
Symbol 22 GraphicUsed by:23  Timeline
Symbol 23 MovieClipUses:22Used by:24
Symbol 24 MovieClip {ProgressLight}Uses:13 15 18 21 23Used by:25 79
Symbol 25 MovieClip {NewRowProgressBar}Uses:12 24
Symbol 26 GraphicUsed by:28
Symbol 27 EditableTextUses:6Used by:28
Symbol 28 MovieClip {com.bowlerhatgames.gridshock.LightDebugger}Uses:26 27Used by:79
Symbol 29 EditableTextUses:1Used by:31
Symbol 30 EditableTextUses:1Used by:31
Symbol 31 MovieClip {com.bowlerhatgames.gridshock.Notification}Uses:29 30Used by:79
Symbol 32 GraphicUsed by:40
Symbol 33 GraphicUsed by:34
Symbol 34 MovieClipUses:33Used by:40
Symbol 35 GraphicUsed by:36
Symbol 36 MovieClipUses:35Used by:40
Symbol 37 GraphicUsed by:39
Symbol 38 GraphicUsed by:39
Symbol 39 MovieClipUses:37 38Used by:40
Symbol 40 MovieClip {RoundLight}Uses:32 34 36 39Used by:79
Symbol 41 GraphicUsed by:50
Symbol 42 GraphicUsed by:43
Symbol 43 MovieClipUses:42Used by:50
Symbol 44 GraphicUsed by:45
Symbol 45 MovieClipUses:44Used by:50
Symbol 46 GraphicUsed by:48
Symbol 47 GraphicUsed by:48
Symbol 48 MovieClipUses:46 47Used by:50
Symbol 49 GraphicUsed by:50
Symbol 50 MovieClip {VLightButton}Uses:41 43 45 48 49Used by:68
Symbol 51 GraphicUsed by:59
Symbol 52 GraphicUsed by:53
Symbol 53 MovieClipUses:52Used by:59
Symbol 54 GraphicUsed by:55
Symbol 55 MovieClipUses:54Used by:59 104 108 112 116
Symbol 56 GraphicUsed by:58
Symbol 57 GraphicUsed by:58
Symbol 58 MovieClipUses:56 57Used by:59 104 108 112 116
Symbol 59 MovieClip {GridLight}Uses:51 53 55 58Used by:67
Symbol 60 GraphicUsed by:67 117
Symbol 61 GraphicUsed by:62
Symbol 62 MovieClipUses:61Used by:65
Symbol 63 GraphicUsed by:64
Symbol 64 MovieClipUses:63Used by:65
Symbol 65 MovieClipUses:62 64Used by:66
Symbol 66 MovieClipUses:65Used by:67 117
Symbol 67 MovieClipUses:60 11 66 59Used by:79
Symbol 68 MovieClipUses:12 50Used by:79
Symbol 69 GraphicUsed by:79
Symbol 70 EditableTextUses:6Used by:79
Symbol 71 TextUses:6Used by:79
Symbol 72 EditableTextUses:6Used by:79
Symbol 73 TextUses:6Used by:79
Symbol 74 TextUses:6Used by:79
Symbol 75 TextUses:1Used by:79
Symbol 76 BitmapUsed by:77
Symbol 77 GraphicUses:76Used by:78
Symbol 78 MovieClip {FrosmoSponsorButton}Uses:77Used by:79 124
Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard}Uses:12 67 68 69 24 40 70 71 72 73 31 74 75 78 28Used by:80
Symbol 80 MovieClip {Gridshock}Uses:79Used by:Timeline
Symbol 81 GraphicUsed by:82
Symbol 82 MovieClipUses:81Used by:85
Symbol 83 FontUsed by:84 87
Symbol 84 TextUses:83Used by:85
Symbol 85 MovieClip {CreatedByBowlerHat}Uses:82 84Used by:88
Symbol 86 GraphicUsed by:88
Symbol 87 TextUses:83Used by:88
Symbol 88 MovieClipUses:86 85 87Used by:Timeline
Symbol 89 Sound {com.bowlerhatgames.gridshock.assets.soundfx.FinalRowWarningSound}
Symbol 90 Sound {com.bowlerhatgames.gridshock.assets.soundfx.NewLevelSound}
Symbol 91 Sound {com.bowlerhatgames.gridshock.assets.soundfx.NewRowSound}
Symbol 92 Sound {com.bowlerhatgames.gridshock.assets.soundfx.MatchSound}
Symbol 93 Sound {com.bowlerhatgames.gridshock.assets.soundfx.ActionSound}
Symbol 94 BitmapUsed by:95
Symbol 95 GraphicUses:94Used by:Timeline
Symbol 96 GraphicUsed by:124
Symbol 97 FontUsed by:98 100 122 123
Symbol 98 TextUses:97Used by:124
Symbol 99 GraphicUsed by:124
Symbol 100 TextUses:97Used by:124
Symbol 101 GraphicUsed by:104
Symbol 102 GraphicUsed by:103
Symbol 103 MovieClipUses:102Used by:104
Symbol 104 MovieClipUses:101 103 55 58Used by:117
Symbol 105 GraphicUsed by:108
Symbol 106 GraphicUsed by:107
Symbol 107 MovieClipUses:106Used by:108
Symbol 108 MovieClipUses:105 107 55 58Used by:117
Symbol 109 GraphicUsed by:112
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClipUses:110Used by:112
Symbol 112 MovieClipUses:109 111 55 58Used by:117
Symbol 113 GraphicUsed by:116
Symbol 114 GraphicUsed by:115
Symbol 115 MovieClipUses:114Used by:116
Symbol 116 MovieClipUses:113 115 55 58Used by:117
Symbol 117 MovieClipUses:60 11 66 104 108 112 116Used by:124
Symbol 118 BitmapUsed by:120
Symbol 119 BitmapUsed by:120
Symbol 120 GraphicUses:118 119Used by:124
Symbol 121 TextUses:6Used by:124
Symbol 122 TextUses:97Used by:124
Symbol 123 TextUses:97Used by:124
Symbol 124 MovieClipUses:96 98 99 100 117 120 2 121 122 123 78Used by:Timeline

Instance Names

"sponsorAd"Frame 1Symbol 5 MovieClip
"splashScreen"Frame 2Symbol 88 MovieClip
"base"Symbol 24 MovieClip {ProgressLight} Frame 1Symbol 15 MovieClip
"progressMask"Symbol 24 MovieClip {ProgressLight} Frame 1Symbol 23 MovieClip
"textField"Symbol 28 MovieClip {com.bowlerhatgames.gridshock.LightDebugger} Frame 1Symbol 27 EditableText
"primaryField"Symbol 31 MovieClip {com.bowlerhatgames.gridshock.Notification} Frame 1Symbol 29 EditableText
"secondaryField"Symbol 31 MovieClip {com.bowlerhatgames.gridshock.Notification} Frame 1Symbol 30 EditableText
"base"Symbol 40 MovieClip {RoundLight} Frame 1Symbol 34 MovieClip
"base"Symbol 50 MovieClip {VLightButton} Frame 1Symbol 43 MovieClip
"base"Symbol 59 MovieClip {GridLight} Frame 1Symbol 53 MovieClip
"grid"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 67 MovieClip
"buttonBarLeft"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 68 MovieClip
"progressBar"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 24 MovieClip {ProgressLight}
"nextColorLight"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 40 MovieClip {RoundLight}
"scoreField"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 70 EditableText
"levelField"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 72 EditableText
"notification"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 31 MovieClip {com.bowlerhatgames.gridshock.Notification}
"moreGamesButton"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 78 MovieClip {FrosmoSponsorButton}
"lightDebugger"Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard} Frame 1Symbol 28 MovieClip {com.bowlerhatgames.gridshock.LightDebugger}
"gameBoard"Symbol 80 MovieClip {Gridshock} Frame 1Symbol 79 MovieClip {com.bowlerhatgames.gridshock.GameBoard}
"base"Symbol 104 MovieClip Frame 1Symbol 103 MovieClip
"base"Symbol 108 MovieClip Frame 1Symbol 107 MovieClip
"base"Symbol 112 MovieClip Frame 1Symbol 111 MovieClip
"base"Symbol 116 MovieClip Frame 1Symbol 115 MovieClip
"sponsorButton"Symbol 124 MovieClip Frame 1Symbol 78 MovieClip {FrosmoSponsorButton}

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 11284 bytes "<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmln ..."




http://swfchan.com/14/67653/info.shtml
Created: 11/4 -2019 10:47:45 Last modified: 11/4 -2019 10:47:45 Server time: 22/12 -2024 17:06:11