Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 2
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 3
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 4
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 5
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import flash.events.*;
import fl.core.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 6
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 7
//UIScrollBar (fl.controls.UIScrollBar)
package fl.controls {
import flash.events.*;
import fl.core.*;
import fl.events.*;
import flash.text.*;
public class UIScrollBar extends ScrollBar {
protected var inScroll:Boolean;// = false
protected var _scrollTarget:TextField;
protected var inEdit:Boolean;// = false
private static var defaultStyles:Object = {};
public function UIScrollBar(){
inEdit = false;
inScroll = false;
super();
}
protected function handleTargetScroll(_arg1:Event):void{
if (inDrag){
return;
};
if (!enabled){
return;
};
inEdit = true;
updateScrollTargetProperties();
scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
inEdit = false;
}
override public function set minScrollPosition(_arg1:Number):void{
super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1;
}
override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
super.setScrollPosition(_arg1, _arg2);
if (!_scrollTarget){
inScroll = false;
return;
};
updateTargetScroll();
}
override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
var _local5:Number;
var _local6:Number;
_local5 = _arg3;
_local6 = ((_arg2)<0) ? 0 : _arg2;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5;
} else {
_local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5;
};
};
super.setScrollProperties(_arg1, _local6, _local5, _arg4);
}
public function get scrollTargetName():String{
return (_scrollTarget.name);
}
public function get scrollTarget():TextField{
return (_scrollTarget);
}
protected function updateScrollTargetProperties():void{
var _local1:Boolean;
var _local2:Number;
if (_scrollTarget == null){
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize);
scrollPosition = 0;
} else {
_local1 = (direction == ScrollBarDirection.HORIZONTAL);
_local2 = (_local1) ? _scrollTarget.width : 10;
setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize);
scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
};
}
public function update():void{
inEdit = true;
updateScrollTargetProperties();
inEdit = false;
}
public function set scrollTargetName(_arg1:String):void{
var target = _arg1;
try {
scrollTarget = (parent.getChildByName(target) as TextField);
} catch(error:Error) {
throw (new Error("ScrollTarget not found, or is not a TextField"));
};
}
override public function set direction(_arg1:String):void{
if (isLivePreview){
return;
};
super.direction = _arg1;
updateScrollTargetProperties();
}
protected function handleTargetChange(_arg1:Event):void{
inEdit = true;
setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true);
updateScrollTargetProperties();
inEdit = false;
}
override public function set maxScrollPosition(_arg1:Number):void{
var _local2:Number;
_local2 = _arg1;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2;
} else {
_local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2;
};
};
super.maxScrollPosition = _local2;
}
protected function updateTargetScroll(_arg1:ScrollEvent=null):void{
if (inEdit){
return;
};
if (direction == ScrollBarDirection.HORIZONTAL){
_scrollTarget.scrollH = scrollPosition;
} else {
_scrollTarget.scrollV = scrollPosition;
};
}
override protected function draw():void{
if (isInvalid(InvalidationType.DATA)){
updateScrollTargetProperties();
};
super.draw();
}
public function set scrollTarget(_arg1:TextField):void{
if (_scrollTarget != null){
_scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false);
_scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false);
_scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false);
removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false);
};
_scrollTarget = _arg1;
if (_scrollTarget != null){
_scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true);
addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true);
};
invalidate(InvalidationType.DATA);
}
override public function get direction():String{
return (super.direction);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 8
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 9
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 10
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 11
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 12
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 13
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 14
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 15
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 16
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 17
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 18
//showHelpButton_27 (FruitiBlox_fla.showHelpButton_27)
package FruitiBlox_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class showHelpButton_27 extends MovieClip {
public function showHelpButton_27(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package FruitiBlox_fla
Section 19
//skipHelpButton_29 (FruitiBlox_fla.skipHelpButton_29)
package FruitiBlox_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class skipHelpButton_29 extends MovieClip {
public function skipHelpButton_29(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package FruitiBlox_fla
Section 20
//theNextButton_31 (FruitiBlox_fla.theNextButton_31)
package FruitiBlox_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class theNextButton_31 extends MovieClip {
public function theNextButton_31(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package FruitiBlox_fla
Section 21
//Tori1_73 (FruitiBlox_fla.Tori1_73)
package FruitiBlox_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class Tori1_73 extends MovieClip {
public function Tori1_73(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package FruitiBlox_fla
Section 22
//Bounce (gs.easing.Bounce)
package gs.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package gs.easing
Section 23
//Elastic (gs.easing.Elastic)
package gs.easing {
public class Elastic {
private static const _2PI:Number = 6.28318530717959;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package gs.easing
Section 24
//Linear (gs.easing.Linear)
package gs.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package gs.easing
Section 25
//Sine (gs.easing.Sine)
package gs.easing {
public class Sine {
private static const _HALF_PI:Number = 1.5707963267949;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * _HALF_PI))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * _HALF_PI))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package gs.easing
Section 26
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 27
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 1;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array, _arg4:Array, _arg5:Array):void{
var _local6:int;
var _local7:String;
_local6 = (_arg4.length - 1);
while (_local6 > -1) {
if (_arg1[_arg4[_local6].name] != undefined){
_arg4.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg3.length - 1);
while (_local6 > -1) {
if (_arg1[_arg3[_local6][4]] != undefined){
_arg3.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg5.length - 1);
while (_local6 > -1) {
if (_arg1[_arg5[_local6].name] != undefined){
_arg5.splice(_local6, 1);
};
_local6--;
};
for (_local7 in _arg1) {
delete _arg2[_local7];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local9:Object;
var _local10:String;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (((((!((_local8 == _arg1))) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
_local7--;
};
if (_local6.length == 0){
return;
};
if (_local4 == AUTO){
if (_local3.isTV == true){
_local3 = _local3.exposedProps;
};
_local9 = {};
for (_local10 in _local3) {
if ((((((((((((((((((((((((((((((((((((((((((((_local10 == "ease")) || ((_local10 == "delay")))) || ((_local10 == "overwrite")))) || ((_local10 == "onComplete")))) || ((_local10 == "onCompleteParams")))) || ((_local10 == "runBackwards")))) || ((_local10 == "persist")))) || ((_local10 == "onUpdate")))) || ((_local10 == "onUpdateParams")))) || ((_local10 == "timeScale")))) || ((_local10 == "onStart")))) || ((_local10 == "onStartParams")))) || ((_local10 == "renderOnStart")))) || ((_local10 == "proxiedEase")))) || ((_local10 == "easeParams")))) || ((_local10 == "onCompleteAll")))) || ((_local10 == "onCompleteAllParams")))) || ((_local10 == "yoyo")))) || ((_local10 == "loop")))) || ((_local10 == "onCompleteListener")))) || ((_local10 == "onStartListener")))) || ((_local10 == "onUpdateListener")))){
} else {
_local9[_local10] = 1;
if (_local10 == "shortRotate"){
_local9.rotation = 1;
} else {
if (_local10 == "removeTint"){
_local9.tint = 1;
} else {
if (_local10 == "autoAlpha"){
_local9.alpha = 1;
_local9.visible = 1;
};
};
};
};
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].killVars(_local9);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 9.29){
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 28
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.filters.*;
import flash.utils.*;
public class TweenFilterLite extends TweenLite {
protected var _matrix:Array;
protected var _hf:Boolean;// = false
protected var _roundProps:Boolean;
protected var _cmf:ColorMatrixFilter;
protected var _filters:Array;
protected var _endMatrix:Array;
protected var _timeScale:Number;
protected var _clrsa:Array;
public static var removeTween:Function = TweenLite.removeTween;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 9.29;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
protected static var _globalTimeScale:Number = 1;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_filters = [];
super(_arg1, _arg2, _arg3);
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenFilterLite)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (TweenLite.version < 9.29){
};
}
override public function killVars(_arg1:Object):void{
if (TweenLite.overwriteManager.enabled){
TweenLite.overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, ((_filters) || ([])));
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:int;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:int;
var _local8:String;
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter roundProps ");
_roundProps = Boolean((this.vars.roundProps is Array));
if (_isDisplayObject){
if (this.vars.blurFilter != null){
_local4 = this.vars.blurFilter;
addFilter("blurFilter", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != null){
_local4 = this.vars.glowFilter;
addFilter("glowFilter", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != null){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrixFilter", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[this.tweens.length] = [_matrix, _local3.toString(), _matrix[_local3], (_endMatrix[_local3] - _matrix[_local3]), "colorMatrixFilter"];
};
_local3++;
};
};
if (this.vars.dropShadowFilter != null){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadowFilter", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != null){
_local4 = this.vars.bevelFilter;
addFilter("bevelFilter", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = (_clrsa.length - 1);
while (_local3 > -1) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3--;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
if (_roundProps){
_local3 = (this.vars.roundProps.length - 1);
while (_local3 > -1) {
_local8 = this.vars.roundProps[_local3];
_local7 = (this.tweens.length - 1);
while (_local7 > -1) {
if ((((this.tweens[_local7][1] == _local8)) && ((this.tweens[_local7][0] == this.target)))){
this.tweens[_local7][5] = true;
break;
};
_local7--;
};
_local3--;
};
};
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function get timeScale():Number{
return (_timeScale);
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:int;
var _local8:Array;
var _local9:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
if (!_roundProps){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
} else {
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
if (_local4[5]){
_local6 = (_local4[2] + (_local3 * _local4[3]));
_local7 = ((_local6)<0) ? -1 : 1;
_local4[0][_local4[1]] = ((((_local6 % 1) * _local7))>0.5) ? (int(_local6) + _local7) : int(_local6);
} else {
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
};
_local5--;
};
};
if (_hf){
_local5 = (_clrsa.length - 1);
while (_local5 > -1) {
_local4 = _clrsa[_local5];
_local4.f[_local4.p] = ((((_local4.sr + (_local3 * _local4.cr)) << 16) | ((_local4.sg + (_local3 * _local4.cg)) << 8)) | (_local4.sb + (_local3 * _local4.cb)));
_local5--;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local8 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local9 = (_local8.length - 1);
while (_local9 > -1) {
if ((_local8[_local9] is _filters[_local5].type)){
_local8.splice(_local9, 1, _filters[_local5].filter);
break;
};
_local9--;
};
_local5++;
};
this.target.filters = _local8;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
var _local6:Object = {type:_arg3, name:_arg1};
var _local7:Array = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7[_local7.length] = _local6.filter;
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa[_clrsa.length] = {f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)};
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[this.tweens.length] = [_local6.filter, _local9, _local6.filter[_local9], _local10, _arg1];
};
};
};
_local8++;
};
_filters[_filters.length] = _local6;
_hf = true;
return (_local6);
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenFilterLite)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 29
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
public var gc:Boolean;
protected var _isDisplayObject:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
protected var _specialVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.29;
public static var masterList:Dictionary = new Dictionary(false);
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((_arg1 is DisplayObject));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((((_local3 == "timeScale")) && (!((this.target is TweenLite))))))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number = _arg1.target.progress;
var _local4:Number = (1 - _local3);
var _local5:Object = _arg1.info.color;
var _local6:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local4:Array;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 30
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.events.*;
public class TweenMax extends TweenFilterLite implements IEventDispatcher {
protected var _callbacks:Object;
protected var _dispatcher:EventDispatcher;
public var pauseTime:Number;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
public static var setGlobalTimeScale:Function = TweenFilterLite.setGlobalTimeScale;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 3.4;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
this.vars.persist = true;
};
if (TweenFilterLite.version < 9.29){
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:Object;
var _local6:int;
var _local7:Object;
var _local8:Array;
var _local9:Array;
var _local4:Number = this.progress;
if (((!((this.vars[_arg1] == undefined))) && (this.initted))){
if (((!(_arg3)) && (!((_local4 == 0))))){
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
if (this.tweens[_local6][4] == _arg1){
this.tweens[_local6][0][this.tweens[_local6][1]] = this.tweens[_local6][2];
};
_local6--;
};
};
_local5 = {};
_local5[_arg1] = 1;
killVars(_local5);
};
this.vars[_arg1] = _arg2;
if (this.initted){
_local7 = this.vars;
_local8 = this.tweens;
_local9 = _subTweens;
this.vars = {};
this.tweens = [];
_subTweens = [];
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
this.vars = _local7;
this.tweens = _local8.concat(this.tweens);
_subTweens = _local9.concat(_subTweens);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Array;
var _local9:Number;
_arg2 = (_arg2 + " hexColors bezier bezierThrough shortRotation orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop onCompleteListener onUpdateListener onStartListener ");
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
var _local8:Function = bezierProxy;
if (this.vars.orientToBezier == true){
this.vars.orientToBezier = [["x", "y", "rotation", 0]];
_local8 = bezierProxy2;
} else {
if ((this.vars.orientToBezier is Array)){
_local8 = bezierProxy2;
};
};
if (((!((this.vars.bezier == undefined))) && ((this.vars.bezier is Array)))){
_local6 = {};
_local7 = this.vars.bezier;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezier", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, false), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (((!((this.vars.bezierThrough == undefined))) && ((this.vars.bezierThrough is Array)))){
_local6 = {};
_local7 = this.vars.bezierThrough;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezierThrough", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, true), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (this.vars.shortRotation != undefined){
_local9 = ((this.vars.shortRotation - this.target.rotation) % 360);
if (((this.vars.shortRotation - this.target.rotation) % 360) != (_local9 % 180)){
_local9 = ((_local9)<0) ? (_local9 + 360) : (_local9 - 360);
};
this.tweens[this.tweens.length] = [this.target, "rotation", this.target.rotation, _local9, "rotation"];
};
if (((!((this.vars.hexColors == undefined))) && ((typeof(this.vars.hexColors) == "object")))){
for (_local3 in this.vars.hexColors) {
addSubTween("hexColors", hexColorsProxy, {r:(this.target[_local3] >> 16), g:((this.target[_local3] >> 8) & 0xFF), b:(this.target[_local3] & 0xFF)}, {r:(this.vars.hexColors[_local3] >> 16), g:((this.vars.hexColors[_local3] >> 8) & 0xFF), b:(this.vars.hexColors[_local3] & 0xFF)}, {prop:_local3, target:this.target});
};
};
super.initTweenVals(true, _arg2);
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
this.enabled = true;
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = (1 / (1 - this.ease((_local1 * this.duration), 0, 1, this.duration)));
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local3 = (_local4[2] + _local4[3]);
_local4[3] = ((_local3 - _local4[0][_local4[1]]) * _local2);
_local4[2] = (_local3 - _local4[3]);
_local5--;
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
var _local1:Number;
this.enabled = true;
if (!isNaN(this.pauseTime)){
_local1 = (this.delay * (1000 / this.combinedTimeScale));
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + _local1);
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return ((this.startTime == 999999999999999));
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
if (this.vars[_arg1[_local3]] != null){
_local2[_arg1[_local3]] = 1;
};
_local3--;
};
killVars(_local2);
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
if (this.vars.yoyo == true){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_subTweens = [];
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function sequence(_arg1:Object, _arg2:Array):Array{
var _local3:uint;
while (_local3 < _arg2.length) {
_arg2[_local3].target = _arg1;
_local3++;
};
return (multiSequence(_arg2));
}
public static function bezierProxy(_arg1:Object, _arg2:Number=0):void{
var _local6:int;
var _local7:String;
var _local8:Object;
var _local9:Number;
var _local10:uint;
var _local3:Number = _arg1.target.t;
var _local4:Object = _arg1.info.props;
var _local5:Object = _arg1.info.target;
if (_local3 == 1){
for (_local7 in _local4) {
_local6 = (_local4[_local7].length - 1);
_local5[_local7] = _local4[_local7][_local6].e;
};
} else {
for (_local7 in _local4) {
_local10 = _local4[_local7].length;
if (_local3 < 0){
_local6 = 0;
} else {
if (_local3 >= 1){
_local6 = (_local10 - 1);
} else {
_local6 = int((_local10 * _local3));
};
};
_local9 = ((_local3 - (_local6 * (1 / _local10))) * _local10);
_local8 = _local4[_local7][_local6];
_local5[_local7] = (_local8.s + (_local9 * (((2 * (1 - _local9)) * (_local8.cp - _local8.s)) + (_local9 * (_local8.e - _local8.s)))));
};
};
}
public static function hexColorsProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target[_arg1.info.prop] = uint((((_arg1.target.r << 16) | (_arg1.target.g << 8)) | _arg1.target.b));
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = {s:_local4[0], cp:(_local4[1] - ((_local4[2] - _local4[0]) / 4)), e:_local4[1]};
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = {s:_local4[_local3], cp:(_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)].cp)), e:_local4[(_local3 + 1)]};
_local3++;
};
} else {
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:((_local4[1] + _local4[2]) / 2)};
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = {s:_local5[(_local3 - 2)].e, cp:_local4[_local3], e:((_local4[_local3] + _local4[(_local3 + 1)]) / 2)};
_local3++;
};
_local5[_local5.length] = {s:_local5[(_local5.length - 1)].e, cp:_local4[(_local4.length - 2)], e:_local4[(_local4.length - 1)]};
} else {
if (_local4.length == 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:_local4[2]};
} else {
if (_local4.length == 2){
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
};
};
};
return (_local7);
}
public static function bezierProxy2(_arg1:Object, _arg2:Number=0):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Number;
bezierProxy(_arg1, _arg2);
var _local3:Object = {};
var _local4:Object = _arg1.info.target;
_arg1.info.target = _local3;
_arg1.target.t = (_arg1.target.t + 0.01);
bezierProxy(_arg1);
var _local5:Array = _arg1.info.orientToBezier;
var _local11:uint;
while (_local11 < _local5.length) {
_local9 = _local5[_local11];
_local10 = ((_local9[3]) || (0));
_local7 = (_local3[_local9[0]] - _local4[_local9[0]]);
_local8 = (_local3[_local9[1]] - _local4[_local9[1]]);
_local4[_local9[2]] = ((Math.atan2(_local8, _local7) * _RAD2DEG) + _local10);
_local11++;
};
_arg1.info.target = _local4;
_arg1.target.t = (_arg1.target.t - 0.01);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function multiSequence(_arg1:Array):Array{
var _local6:Object;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:Object;
var _local12:String;
var _local2:Dictionary = new Dictionary();
var _local3:Array = [];
var _local4:int = TweenLite.overwriteManager.mode;
var _local5:Number = 0;
_local10 = 0;
while (_local10 < _arg1.length) {
_local6 = _arg1[_local10];
_local9 = ((_local6.time) || (0));
_local11 = {};
for (_local12 in _local6) {
_local11[_local12] = _local6[_local12];
};
delete _local11.time;
_local8 = ((_local11.delay) || (0));
_local11.delay = (_local5 + _local8);
_local7 = _local11.target;
delete _local11.target;
if (_local4 == 1){
if (_local2[_local7] == undefined){
_local2[_local7] = _local11;
} else {
_local11.overwrite = 2;
};
};
_local3[_local3.length] = new TweenMax(_local7, _local9, _local11);
_local5 = (_local5 + (_local9 + _local8));
_local10++;
};
return (_local3);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (!_local2[_local4].gc){
_local3[_local3.length] = _local2[_local4];
};
_local4--;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((_local2[_local3].active) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function callbackProxy(_arg1:Array, _arg2:Array=null):void{
var _local3:uint;
while (_local3 < _arg1.length) {
if (_arg1[_local3] != undefined){
_arg1[_local3].apply(null, _arg2[_local3]);
};
_local3++;
};
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object):Array{
_arg3.runBackwards = true;
return (allTo(_arg1, _arg2, _arg3));
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object):Array{
var _local4:int;
var _local5:Object;
var _local6:String;
var _local7:Number;
var _local8:Object;
if (_arg1.length == 0){
return ([]);
};
var _local9:Array = [];
var _local10:Number = ((_arg3.delayIncrement) || (0));
delete _arg3.delayIncrement;
if (_arg3.onCompleteAll == undefined){
_local8 = _arg3;
} else {
_local8 = {};
for (_local6 in _arg3) {
_local8[_local6] = _arg3[_local6];
};
_local8.onCompleteParams = [[_arg3.onComplete, _arg3.onCompleteAll], [_arg3.onCompleteParams, _arg3.onCompleteAllParams]];
_local8.onComplete = TweenMax.callbackProxy;
delete _arg3.onCompleteAll;
};
delete _arg3.onCompleteAllParams;
if (_local10 == 0){
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
} else {
_local7 = ((_arg3.delay) || (0));
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local5.delay = (_local7 + (_local4 * _local10));
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
_local8.delay = (_local7 + ((_arg1.length - 1) * _local10));
};
_local9[_local9.length] = new TweenMax(_arg1[(_arg1.length - 1)], _arg2, _local8);
if ((_arg3.onCompleteAllListener is Function)){
_local9[(_local9.length - 1)].addEventListener(TweenEvent.COMPLETE, _arg3.onCompleteAllListener);
};
return (_local9);
}
}
}//package gs
Section 31
//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{
}, 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{
}, 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"){
};
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;
//unresolved jump
};
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{
});
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;
};
}
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{
}, 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{
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{
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
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 32
//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 33
//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)){
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(n) != n){
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
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)){
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(_arg1) != _arg1){
};
_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 34
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
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 pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
var methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
//unresolved jump
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_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);
}
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;
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) {
_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)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
};
};
};
}
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;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 35
//achievementsManager (photonstorm.fruitiblox.achievementsManager)
package photonstorm.fruitiblox {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.text.*;
public class achievementsManager extends Sprite {
private var yellowCount:int;
private var panel:MovieClip;
private var gridHeight:int;
private var gridWidth:int;
private var greenFruitCornerCount:int;
private var achievementTitles:Array;
private var bottomLeftColour:int;
private var bonusHint:TextField;
private var collected:Array;
private var savedPoints:int;
private var blueFruitCount:int;
private var bonusList:Sprite;
private var savedType:int;
private var bottomLeftFruit:Boolean;
private var panelNumber:TextField;
private var topRightColour:int;
private var topLeftFruit:Boolean;
private var achievementsTotal:int;// = 30
private var blocks:Array;
private var blueFruitCornerCount:int;
private var topRightFruit:Boolean;
private var yellowFruitCornerCount:int;
private var bonusScrollBar:UIScrollBar;
private var bonusTextList:TextField;
private var panelTitle:TextField;
private var redFruitCornerCount:int;
private var greenFruitCount:int;
private var colour:int;
private var gotAchievementThisRound:Boolean;
private var greenCount:int;
private var blueCount:int;
private var redFruitCount:int;
private var achievementHints:Array;
private var bottomRightFruit:Boolean;
private var bottomRightColour:int;
private var yellowFruitCount:int;
private var topLeftColour:int;
private var redCount:int;
public function achievementsManager():void{
panel = new achievementPanelMC();
super();
}
public function check(_arg1:fruitiblock, _arg2:fruitiblock, _arg3:fruitiblock, _arg4:fruitiblock, _arg5:Array):int{
resetCounts();
colour = _arg5[0];
gridWidth = _arg5[1];
gridHeight = _arg5[2];
blocks = _arg5[3];
topLeftColour = _arg1.value;
topRightColour = _arg2.value;
bottomLeftColour = _arg3.value;
bottomRightColour = _arg4.value;
topLeftFruit = _arg1.isFruit;
topRightFruit = _arg2.isFruit;
bottomLeftFruit = _arg3.isFruit;
bottomRightFruit = _arg4.isFruit;
getBlockCounts();
checkAchievement01();
checkAchievement02();
checkAchievement03();
checkAchievement04();
checkAchievement05();
checkAchievement06();
checkAchievement07();
checkAchievement08();
checkAchievement09();
checkAchievement11();
checkAchievement12();
checkAchievement13();
checkAchievement14();
checkAchievement15();
checkAchievement16();
checkAchievement17();
checkAchievement18();
checkAchievement19();
checkAchievement20();
checkAchievement21();
checkAchievement22();
checkAchievement23();
checkAchievement24();
checkAchievement25();
checkAchievement26();
checkAchievement27();
checkAchievement28();
checkAchievement29();
checkAchievement30();
saveAchievement();
return (savedPoints);
}
public function init():void{
panel.mouseEnabled = false;
panelTitle = TextField(panel.getChildByName("achievementTitle"));
panelNumber = TextField(panel.getChildByName("achievementNumber"));
panel.visible = false;
bonusList = new Sprite();
bonusTextList = new TextField();
bonusTextList.x = 28;
bonusTextList.y = 28;
bonusTextList.width = 486;
bonusTextList.height = 285;
bonusTextList.defaultTextFormat = new TextFormat("Imago Extra Bold", 16, 0x666666);
bonusTextList.embedFonts = true;
bonusTextList.antiAliasType = AntiAliasType.ADVANCED;
bonusTextList.sharpness = 200;
bonusTextList.multiline = true;
bonusTextList.selectable = false;
bonusTextList.mouseEnabled = true;
bonusTextList.addEventListener(MouseEvent.MOUSE_OUT, hideBonusHint, false, 0, true);
bonusTextList.addEventListener(MouseEvent.MOUSE_MOVE, showBonusHint, false, 0, true);
bonusHint = new TextField();
bonusHint.x = bonusTextList.x;
bonusHint.y = ((bonusTextList.y + bonusTextList.height) + 16);
bonusHint.width = 400;
bonusHint.defaultTextFormat = new TextFormat("Imago Extra Bold", 20, 0xEFEFEF);
bonusHint.embedFonts = true;
bonusHint.antiAliasType = AntiAliasType.ADVANCED;
bonusHint.sharpness = 200;
bonusHint.multiline = true;
bonusHint.wordWrap = true;
bonusHint.selectable = false;
bonusHint.mouseEnabled = false;
bonusScrollBar = new UIScrollBar();
bonusScrollBar.x = 517;
bonusScrollBar.y = 23;
bonusScrollBar.height = 280;
bonusScrollBar.scrollTarget = bonusTextList;
bonusScrollBar.minScrollPosition = 0;
bonusScrollBar.maxScrollPosition = 40;
bonusList.addChild(bonusTextList);
bonusList.addChild(bonusScrollBar);
bonusList.addChild(bonusHint);
addChild(panel);
buildAchievementTitleList();
}
private function hideBonusHint(_arg1:MouseEvent):void{
updateBonusList();
TweenMax.to(bonusHint, 1, {autoAlpha:0, overwrite:true});
}
public function get bonusPanel():Sprite{
updateBonusList();
return (bonusList);
}
private function buildAchievementTitleList():void{
achievementTitles = new Array();
achievementHints = new Array();
achievementTitles[1] = "A nice Pear";
achievementHints[1] = "Capture 1 x Pear";
achievementTitles[2] = "Starting Bunch";
achievementHints[2] = "Capture 1 x Grapes";
achievementTitles[3] = "Easy Peasy Lemon Squeezy";
achievementHints[3] = "Capture 1 x Lemon";
achievementTitles[4] = "Strawberry Fool";
achievementHints[4] = "Capture 1 x Strawberry";
achievementTitles[5] = "A Pair of Pears";
achievementHints[5] = "Capture 2 x Pear";
achievementTitles[6] = "Double Bunch";
achievementHints[6] = "Capture 2 x Grapes";
achievementTitles[7] = "Zesty";
achievementHints[7] = "Capture 2 x Lemon";
achievementTitles[8] = "Strawberry Surprise";
achievementHints[8] = "Capture 2 x Strawberry";
achievementTitles[9] = "Harvest Time";
achievementHints[9] = "Capture 4 x Pear";
achievementTitles[10] = "Gloria Grape";
achievementHints[10] = "Capture 4 x Grape";
achievementTitles[11] = "Citrus Fresh";
achievementHints[11] = "Capture 4 x Lemon";
achievementTitles[12] = "The Munch Bunch";
achievementHints[12] = "Capture 4 x Grape";
achievementTitles[13] = "Pear Fruit Corner";
achievementHints[13] = "2 of the 4 corners must be Pears";
achievementTitles[14] = "Grape Fruit Corner";
achievementHints[14] = "2 of the 4 corners must be Grapes";
achievementTitles[15] = "Lemon Fruit Corner";
achievementHints[15] = "2 of the 4 corners must be Lemons";
achievementTitles[16] = "Strawberry Fruit Corner";
achievementHints[16] = "2 of the 4 corners must be Strawberries";
achievementTitles[17] = "Lost in the Orchard";
achievementHints[17] = "All 4 corner pieces must be Pears";
achievementTitles[18] = "Lost in the Vineyard";
achievementHints[18] = "All 4 corner pieces must be Grapes";
achievementTitles[19] = "Surrounded by Lemons!";
achievementHints[19] = "All 4 corner pieces must be Lemons";
achievementTitles[20] = "Surrounded by Reds!";
achievementHints[20] = "All 4 corner pieces must be Strawberries";
achievementTitles[21] = "Fruit Cocktail";
achievementHints[21] = "Capture 1 x Pear, 1 x Grape, 1 x Lemon and 1 x Strawberry at the same time";
achievementTitles[22] = "Fruit Salad";
achievementHints[22] = "Capture 2 x Pear, 2 x Grape, 2 x Lemon and 2 x Strawberry at the same time";
achievementTitles[23] = "What a nice Pear";
achievementHints[23] = "Capture a 5 x 5 (minimum) sized group, where all 4 corners are Pears";
achievementTitles[24] = "Ohhh Crush a Grape!";
achievementHints[24] = "Capture a 5 x 5 (minimum) sized group, where all 4 corners are Grapes";
achievementTitles[25] = "And a Squeeze of Lemon";
achievementHints[25] = "Capture a 5 x 5 (minimum) sized group, where all 4 corners are Lemons";
achievementTitles[26] = "The Wimbledon Special";
achievementHints[26] = "Capture a 5 x 5 (minimum) sized group, where all 4 corners are Strawberries";
achievementTitles[27] = "Break out the Perry press";
achievementHints[27] = "Capture the whole set with all 4 corners as Pears";
achievementTitles[28] = "The Grapes of Wrath";
achievementHints[28] = "Capture the whole set with all 4 corners as Grapes";
achievementTitles[29] = "Let's make Lemonade";
achievementHints[29] = "Capture the whole set with all 4 corners as Lemons";
achievementTitles[30] = "We've run out of Cream";
achievementHints[30] = "Capture the whole set with all 4 corners as Strawberries";
}
private function checkAchievement01():void{
if ((((greenFruitCount == 1)) && ((colour == 1)))){
addAchievement(1, 500);
};
}
private function checkAchievement04():void{
if ((((redFruitCount == 1)) && ((colour == 4)))){
addAchievement(4, 500);
};
}
private function checkAchievement05():void{
if ((((greenFruitCount == 2)) && ((colour == 1)))){
addAchievement(5, 1000);
};
}
private function checkAchievement06():void{
if ((((blueFruitCount == 2)) && ((colour == 2)))){
addAchievement(6, 1000);
};
}
private function checkAchievement08():void{
if ((((redFruitCount == 2)) && ((colour == 4)))){
addAchievement(8, 1000);
};
}
private function checkAchievement09():void{
if ((((greenFruitCount >= 4)) && ((colour == 1)))){
addAchievement(9, 4000);
};
}
private function checkAchievement03():void{
if ((((yellowFruitCount == 1)) && ((colour == 3)))){
addAchievement(3, 500);
};
}
private function checkAchievement07():void{
if ((((yellowFruitCount == 2)) && ((colour == 3)))){
addAchievement(7, 1000);
};
}
private function checkAchievement02():void{
if ((((blueFruitCount == 1)) && ((colour == 2)))){
addAchievement(2, 500);
};
}
private function checkAchievement10():void{
if ((((blueFruitCount >= 4)) && ((colour == 2)))){
addAchievement(10, 4000);
};
}
private function checkAchievement11():void{
if ((((yellowFruitCount >= 4)) && ((colour == 3)))){
addAchievement(11, 4000);
};
}
private function checkAchievement12():void{
if ((((redFruitCount >= 4)) && ((colour == 4)))){
addAchievement(12, 4000);
};
}
private function checkAchievement13():void{
if ((((greenFruitCornerCount == 2)) || ((greenFruitCornerCount == 3)))){
addAchievement(13, 2000);
};
}
private function checkAchievement14():void{
if ((((blueFruitCornerCount == 2)) || ((blueFruitCornerCount == 3)))){
addAchievement(14, 2000);
};
}
private function checkAchievement15():void{
if ((((yellowFruitCornerCount == 2)) || ((yellowFruitCornerCount == 3)))){
addAchievement(15, 2000);
};
}
private function checkAchievement16():void{
if ((((redFruitCornerCount == 2)) || ((redFruitCornerCount == 3)))){
addAchievement(16, 2000);
};
}
private function saveAchievement():void{
if (savedType > 0){
collected[savedType] = (collected[savedType] + 1);
panel.y = 0;
panelTitle.text = (("\"" + achievementTitles[savedType]) + "\"");
panelNumber.text = ((("Bonus " + savedType.toString()) + " of ") + achievementsTotal.toString());
panel.visible = true;
TweenMax.to(panel, 1, {y:-200, delay:2});
};
}
private function checkAchievement17():void{
if (greenFruitCornerCount == 4){
addAchievement(17, 8000);
};
}
private function checkAchievement18():void{
if (blueFruitCornerCount == 4){
addAchievement(18, 8000);
};
}
private function checkAchievement19():void{
if (yellowFruitCornerCount == 4){
addAchievement(19, 8000);
};
}
private function resetCounts():void{
greenCount = 0;
blueCount = 0;
yellowCount = 0;
redCount = 0;
greenFruitCount = 0;
blueFruitCount = 0;
yellowFruitCount = 0;
redFruitCount = 0;
topLeftColour = 0;
topRightColour = 0;
bottomLeftColour = 0;
bottomRightColour = 0;
topLeftFruit = false;
topRightFruit = false;
bottomLeftFruit = false;
bottomRightFruit = false;
greenFruitCornerCount = 0;
blueFruitCornerCount = 0;
yellowFruitCornerCount = 0;
redFruitCornerCount = 0;
gotAchievementThisRound = false;
savedType = 0;
savedPoints = 0;
}
private function checkAchievement20():void{
if (redFruitCornerCount == 4){
addAchievement(20, 8000);
};
}
private function checkAchievement23():void{
if ((((((((gridWidth >= 5)) && ((gridWidth < 10)))) && ((((gridHeight >= 5)) && ((gridHeight < 10)))))) && ((greenFruitCornerCount == 4)))){
addAchievement(23, 10000);
};
}
private function checkAchievement24():void{
if ((((((((gridWidth >= 5)) && ((gridWidth < 10)))) && ((((gridHeight >= 5)) && ((gridHeight < 10)))))) && ((blueFruitCornerCount == 4)))){
addAchievement(24, 10000);
};
}
private function checkAchievement25():void{
if ((((((((gridWidth >= 5)) && ((gridWidth < 10)))) && ((((gridHeight >= 5)) && ((gridHeight < 10)))))) && ((yellowFruitCornerCount == 4)))){
addAchievement(25, 10000);
};
}
private function checkAchievement26():void{
if ((((((((gridWidth >= 5)) && ((gridWidth < 10)))) && ((((gridHeight >= 5)) && ((gridHeight < 10)))))) && ((redFruitCornerCount == 4)))){
addAchievement(26, 10000);
};
}
private function checkAchievement22():void{
if ((((((((greenFruitCount >= 2)) && ((blueFruitCount >= 2)))) && ((yellowFruitCount >= 2)))) && ((redFruitCount >= 2)))){
addAchievement(22, 10000);
};
}
private function checkAchievement27():void{
if ((((((gridWidth == 10)) && ((gridHeight == 10)))) && ((greenFruitCornerCount == 4)))){
addAchievement(27, 20000);
};
}
private function checkAchievement21():void{
if ((((((((greenFruitCount >= 1)) && ((blueFruitCount >= 1)))) && ((yellowFruitCount >= 1)))) && ((redFruitCount >= 1)))){
addAchievement(21, 2500);
};
}
private function updateBonusList(_arg1:int=0):void{
var _local2 = "";
var _local3 = 1;
while (_local3 <= achievementsTotal) {
if (_arg1 == _local3){
_local2 = _local2.concat((((("<font color=\"#ff2222\">" + _local3) + ") ") + achievementTitles[_local3]) + "</font><br>"));
} else {
if (collected[_local3] > 0){
_local2 = _local2.concat((((_local3 + ") <font color=\"#00AA00\">") + achievementTitles[_local3]) + "</font><br>"));
} else {
_local2 = _local2.concat((((_local3 + ") ") + achievementTitles[_local3]) + "<br>"));
};
};
_local3++;
};
bonusTextList.htmlText = _local2;
}
private function checkAchievement28():void{
if ((((((gridWidth == 10)) && ((gridHeight == 10)))) && ((blueFruitCornerCount == 4)))){
addAchievement(28, 20000);
};
}
private function checkAchievement29():void{
if ((((((gridWidth == 10)) && ((gridHeight == 10)))) && ((yellowFruitCornerCount == 4)))){
addAchievement(29, 20000);
};
}
private function checkAchievement30():void{
if ((((((gridWidth == 10)) && ((gridHeight == 10)))) && ((redFruitCornerCount == 4)))){
addAchievement(30, 20000);
};
}
private function addAchievement(_arg1:int, _arg2:int):void{
if (collected[_arg1] == 0){
savedType = _arg1;
savedPoints = _arg2;
};
}
private function showBonusHint(_arg1:MouseEvent):void{
var _local2:int = bonusTextList.getLineIndexAtPoint(_arg1.localX, _arg1.localY);
if (_local2 > -1){
_local2++;
updateBonusList(_local2);
bonusHint.htmlText = achievementHints[_local2];
if (bonusHint.alpha < 1){
TweenMax.to(bonusHint, 0.5, {autoAlpha:1, overwrite:true});
};
};
}
public function go():void{
collected = new Array();
var _local1 = 1;
while (_local1 <= achievementsTotal) {
collected[_local1] = 0;
_local1++;
};
}
private function countCollected():int{
var _local1:int;
var _local2 = 1;
while (_local2 <= 40) {
_local1 = (_local1 + collected[_local2]);
_local2++;
};
return (_local1);
}
private function getBlockCounts():void{
var _local1:fruitiblock;
for each (_local1 in blocks) {
switch (_local1.value){
case 1:
greenCount++;
if (_local1.isFruit){
greenFruitCount++;
};
break;
case 2:
blueCount++;
if (_local1.isFruit){
blueFruitCount++;
};
break;
case 3:
yellowCount++;
if (_local1.isFruit){
yellowFruitCount++;
};
break;
case 4:
redCount++;
if (_local1.isFruit){
redFruitCount++;
};
break;
};
};
switch (colour){
case 1:
if (topLeftFruit){
greenFruitCornerCount++;
};
if (topRightFruit){
greenFruitCornerCount++;
};
if (bottomLeftFruit){
greenFruitCornerCount++;
};
if (bottomRightFruit){
greenFruitCornerCount++;
};
break;
case 2:
if (topLeftFruit){
blueFruitCornerCount++;
};
if (topRightFruit){
blueFruitCornerCount++;
};
if (bottomLeftFruit){
blueFruitCornerCount++;
};
if (bottomRightFruit){
blueFruitCornerCount++;
};
break;
case 3:
if (topLeftFruit){
yellowFruitCornerCount++;
};
if (topRightFruit){
yellowFruitCornerCount++;
};
if (bottomLeftFruit){
yellowFruitCornerCount++;
};
if (bottomRightFruit){
yellowFruitCornerCount++;
};
break;
case 4:
if (topLeftFruit){
redFruitCornerCount++;
};
if (topRightFruit){
redFruitCornerCount++;
};
if (bottomLeftFruit){
redFruitCornerCount++;
};
if (bottomRightFruit){
redFruitCornerCount++;
};
break;
};
}
}
}//package photonstorm.fruitiblox
Section 36
//colourMeter (photonstorm.fruitiblox.colourMeter)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import gs.*;
import pixelblitz.utils.*;
import gs.easing.*;
public class colourMeter extends Sprite {
private var yellowColourMeter:MovieClip;
private var bMath:BlitzMath;
private var gameType:int;
private var redColourMeter:MovieClip;
private var greenColourMeter:MovieClip;
private var blueColourMeter:MovieClip;
private var colourCount1:uint;
private var colourCount2:uint;
private var colourCount3:uint;
private var colourCount4:uint;
private var colourMeter2:uint;
private var colourMeter3:uint;
private var colourMeter4:uint;
private var colourMeter1:uint;
public function colourMeter():void{
bMath = new BlitzMath();
super();
}
public function go(_arg1:int):void{
gameType = _arg1;
greenColourMeter.gotoAndStop(1);
blueColourMeter.gotoAndStop(1);
yellowColourMeter.gotoAndStop(1);
redColourMeter.gotoAndStop(1);
colourMeter1 = 1;
colourMeter2 = 1;
colourMeter3 = 1;
colourMeter4 = 1;
colourCount1 = 0;
colourCount2 = 0;
colourCount3 = 0;
colourCount4 = 0;
addEventListener(Event.ENTER_FRAME, mainLoop, false, 0, true);
}
public function addToColourMeter(_arg1:uint):Boolean{
switch (_arg1){
case 1:
if (gameType == 3){
colourMeter1 = bMath.maxAdd(colourMeter1, 1, 100);
} else {
colourMeter1 = bMath.maxAdd(colourMeter1, 2, 100);
};
if (colourMeter1 < 100){
greenColourMeter.play();
};
colourCount1++;
break;
case 2:
if (gameType == 3){
colourMeter2 = bMath.maxAdd(colourMeter2, 1, 100);
} else {
colourMeter2 = bMath.maxAdd(colourMeter2, 2, 100);
};
if (colourMeter2 < 100){
blueColourMeter.play();
};
colourCount2++;
break;
case 3:
if (gameType == 3){
colourMeter3 = bMath.maxAdd(colourMeter3, 1, 100);
} else {
colourMeter3 = bMath.maxAdd(colourMeter3, 2, 100);
};
if (colourMeter3 < 100){
yellowColourMeter.play();
};
colourCount3++;
break;
case 4:
if (gameType == 3){
colourMeter4 = bMath.maxAdd(colourMeter4, 1, 100);
} else {
colourMeter4 = bMath.maxAdd(colourMeter4, 2, 100);
};
if (colourMeter4 < 100){
redColourMeter.play();
};
colourCount4++;
break;
};
if ((((((((colourMeter1 >= 100)) && ((colourMeter2 >= 100)))) && ((colourMeter3 >= 100)))) && ((colourMeter4 >= 100)))){
colourMeter1 = 1;
colourMeter2 = 1;
colourMeter3 = 1;
colourMeter4 = 1;
greenColourMeter.gotoAndStop(1);
blueColourMeter.gotoAndStop(1);
yellowColourMeter.gotoAndStop(1);
redColourMeter.gotoAndStop(1);
updateTweens();
return (true);
};
updateTweens();
return (false);
}
public function stop():void{
removeEventListener(Event.ENTER_FRAME, mainLoop);
}
private function mainLoop(_arg1:Event):void{
if (greenColourMeter.currentFrame >= colourMeter1){
greenColourMeter.stop();
};
if (blueColourMeter.currentFrame >= colourMeter2){
blueColourMeter.stop();
};
if (yellowColourMeter.currentFrame >= colourMeter3){
yellowColourMeter.stop();
};
if (redColourMeter.currentFrame >= colourMeter4){
redColourMeter.stop();
};
}
public function reset():void{
greenColourMeter.gotoAndStop(1);
blueColourMeter.gotoAndStop(1);
yellowColourMeter.gotoAndStop(1);
redColourMeter.gotoAndStop(1);
colourMeter1 = 1;
colourMeter2 = 1;
colourMeter3 = 1;
colourMeter4 = 1;
}
public function init():void{
greenColourMeter = new greenColourBar();
blueColourMeter = new blueColourBar();
yellowColourMeter = new yellowColourBar();
redColourMeter = new redColourBar();
greenColourMeter.gotoAndStop(1);
blueColourMeter.gotoAndStop(1);
yellowColourMeter.gotoAndStop(1);
redColourMeter.gotoAndStop(1);
greenColourMeter.x = 450;
greenColourMeter.y = 347;
blueColourMeter.x = 475;
blueColourMeter.y = 347;
yellowColourMeter.x = 500;
yellowColourMeter.y = 347;
redColourMeter.x = 525;
redColourMeter.y = 347;
addChild(greenColourMeter);
addChild(blueColourMeter);
addChild(yellowColourMeter);
addChild(redColourMeter);
}
private function updateTweens():void{
TweenMax.killTweensOf(greenColourMeter);
TweenMax.killTweensOf(blueColourMeter);
TweenMax.killTweensOf(yellowColourMeter);
TweenMax.killTweensOf(redColourMeter);
TweenMax.to(greenColourMeter, 0, {tint:null});
TweenMax.to(blueColourMeter, 0, {tint:null});
TweenMax.to(yellowColourMeter, 0, {tint:null});
TweenMax.to(redColourMeter, 0, {tint:null});
if ((((colourMeter1 >= 95)) && ((TweenMax.isTweening(greenColourMeter) == false)))){
TweenMax.to(greenColourMeter, 0.75, {tint:0xFFFFFF, ease:Sine.easeOut, yoyo:true});
};
if ((((colourMeter2 >= 95)) && ((TweenMax.isTweening(blueColourMeter) == false)))){
TweenMax.to(blueColourMeter, 0.75, {tint:0xFFFFFF, ease:Sine.easeOut, yoyo:true});
};
if ((((colourMeter3 >= 95)) && ((TweenMax.isTweening(yellowColourMeter) == false)))){
TweenMax.to(yellowColourMeter, 0.75, {tint:0xFFFFFF, ease:Sine.easeOut, yoyo:true});
};
if ((((colourMeter4 >= 95)) && ((TweenMax.isTweening(redColourMeter) == false)))){
TweenMax.to(redColourMeter, 0.75, {tint:0xFFFFFF, ease:Sine.easeOut, yoyo:true});
};
}
public function get favouriteColour():uint{
var _local1 = 1;
var _local2:int = Math.max(colourCount1, colourCount2, colourCount3, colourCount4);
if (_local2 == 0){
_local1 = 0;
} else {
if (colourCount1 == _local2){
_local1 = 1;
} else {
if (colourCount2 == _local2){
_local1 = 2;
} else {
if (colourCount3 == _local2){
_local1 = 3;
} else {
_local1 = 4;
};
};
};
};
return (_local1);
}
public function get colourCounts():Array{
var _local1:Array = [colourMeter1, colourMeter2, colourMeter3, colourMeter4];
if (colourMeter1 == 1){
_local1[0] = 0;
};
if (colourMeter2 == 1){
_local1[1] = 0;
};
if (colourMeter3 == 1){
_local1[2] = 0;
};
if (colourMeter4 == 1){
_local1[3] = 0;
};
return (_local1);
}
}
}//package photonstorm.fruitiblox
Section 37
//fruitiblock (photonstorm.fruitiblox.fruitiblock)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.filters.*;
import pixelblitz.utils.*;
import gs.easing.*;
public class fruitiblock extends Sprite {
private var bMath:BlitzMath;
private var block:MovieClip;
public var isFruit:Boolean;
public var id:int;
private var baseX:int;
private var baseY:int;
public var selected:Boolean;
public var location:int;
private var squish:MovieClip;
private var selectedGlow:GlowFilter;
private var dropY:int;
private var gameType:int;
public var column:int;
public var row:int;
private var isFaded:Boolean;
public var value:uint;
public var isSquished:Boolean;
public var isBonusBlock:Boolean;
public var bonusType:int;
public static const BONUS_GOLDEN:int = 1;
public static const SQUISH_FINISHED:String = "squishFinished";
public static const REVEAL_FINISHED:String = "revealFinished";
public static const DROP_FINISHED:String = "dropFinished";
public static const BONUS_FRUIT:int = 3;
public static const BONUS_EXTRA_TIME:int = 2;
public static const FINISH_FINISHED:String = "finishFinished";
public function fruitiblock(_arg1:int, _arg2:uint, _arg3:uint, _arg4:int):void{
bMath = new BlitzMath();
selectedGlow = new GlowFilter(13382655, 1, 10, 10, 1.9, 3);
super();
this.name = ("block" + _arg1);
id = _arg1;
location = _arg1;
gameType = _arg4;
this.mouseEnabled = true;
this.useHandCursor = true;
this.buttonMode = true;
baseX = (_arg2 * 40);
baseY = (_arg3 * 40);
this.x = (_arg2 * 40);
this.y = (_arg3 * 40);
column = (_arg2 + 1);
row = (_arg3 + 1);
makeNewBlock();
setBlockGraphics();
addChild(block);
}
private function squishLoop(_arg1:Event):void{
if (((isSquished) && ((squish.currentFrame >= 19)))){
squishComplete();
};
}
public function finish(_arg1:int, _arg2:int):void{
unselect();
resetFade();
TweenMax.to(this, 1.5, {x:_arg1, y:_arg2, scaleX:0, scaleY:0, delay:(id / 80), onComplete:finishFinished, overwrite:false});
}
public function forceColour(_arg1:int):void{
removeChild(block);
makeNewBlock(_arg1);
setBlockGraphics();
addChild(block);
}
public function mouseOver(_arg1:MouseEvent):void{
}
public function rapidFill():void{
makeNewBlock();
setBlockGraphics();
addChild(block);
block.alpha = 0;
TweenMax.to(block, (1 + Math.random()), {alpha:1, onComplete:dropComplete});
}
private function squishComplete():void{
removeEventListener(Event.ENTER_FRAME, squishLoop);
removeChild(squish);
dispatchEvent(new Event(fruitiblock.SQUISH_FINISHED));
}
private function finishFinished():void{
dispatchEvent(new Event(fruitiblock.FINISH_FINISHED));
}
public function fadeOut():void{
isFaded = true;
this.useHandCursor = false;
this.buttonMode = false;
if (isBonusBlock == false){
TweenMax.to(this, 0.2, {colorMatrixFilter:{brightness:2.3}});
};
}
public function dropSquished(_arg1:int):void{
makeNewBlock();
setBlockGraphics();
addChild(block);
dropY = (row - _arg1);
var _local2:int = location;
location = (location - (_arg1 * 10));
row = dropY;
this.y = -36;
TweenMax.to(this, 0.7, {y:((dropY * 40) - 40), onComplete:dropComplete, ease:Bounce.easeOut, delay:(column * 0.02)});
}
private function makeBonusGolden():void{
bonusType = BONUS_GOLDEN;
isBonusBlock = true;
block.gotoAndStop(3);
}
private function makeBonusExtraTime():void{
bonusType = BONUS_EXTRA_TIME;
isBonusBlock = true;
block.gotoAndStop(4);
}
public function makeFruit(_arg1:int=0):void{
if (_arg1 > 0){
forceColour(_arg1);
};
isFruit = true;
block.gotoAndStop((4 + value));
}
public function reveal(_arg1:int, _arg2:int):void{
this.x = _arg1;
this.y = _arg2;
TweenMax.to(this, 0.5, {x:baseX, y:baseY, delay:(id / 80), onComplete:revealFinished});
}
private function dropComplete():void{
dispatchEvent(new Event(fruitiblock.DROP_FINISHED));
}
public function makeBonus(_arg1:int){
switch (_arg1){
case BONUS_GOLDEN:
makeBonusGolden();
break;
case BONUS_EXTRA_TIME:
makeBonusExtraTime();
break;
};
TweenMax.to(this, 0.2, {colorMatrixFilter:{brightness:1}});
}
public function squishIt():void{
unselect();
isSquished = true;
addEventListener(Event.ENTER_FRAME, squishLoop, false, 0, true);
removeChild(block);
addChild(squish);
squish.gotoAndPlay(1);
}
public function unselect():void{
if (isFruit == false){
block.gotoAndStop(1);
};
block.filters = null;
selected = false;
}
public function randomise():void{
removeChild(block);
makeNewBlock();
setBlockGraphics();
addChild(block);
}
public function resetAfterBonus():void{
isBonusBlock = false;
if (isFruit){
block.gotoAndStop((4 + value));
} else {
block.gotoAndStop(1);
};
if (isFaded){
fadeOut();
} else {
resetFade();
};
}
private function makeNewBlock(_arg1:int=0):void{
if (_arg1 == 0){
value = bMath.rand(1, 4);
} else {
value = _arg1;
};
isFruit = false;
isBonusBlock = false;
bonusType = 0;
isFaded = false;
isSquished = false;
}
private function revealFinished():void{
dispatchEvent(new Event(fruitiblock.REVEAL_FINISHED));
}
public function resetFade():void{
isFaded = false;
this.useHandCursor = true;
this.buttonMode = true;
if (isBonusBlock == false){
TweenMax.to(this, 0.2, {colorMatrixFilter:{brightness:1}});
};
}
public function drop(_arg1:int):void{
dropY = (row + _arg1);
location = (location + (_arg1 * 10));
row = dropY;
TweenMax.to(this, 0.7, {y:((dropY * 40) - 40), onComplete:dropComplete, ease:Bounce.easeOut, delay:(column * 0.02)});
}
private function setBlockGraphics():void{
TweenMax.to(this, 0, {colorMatrixFilter:{brightness:1}});
block = null;
squish = null;
switch (value){
case 1:
block = new greenBlock();
squish = new greenSquish();
break;
case 2:
block = new blueBlock();
squish = new blueSquish();
break;
case 3:
block = new yellowBlock();
squish = new yellowSquish();
break;
case 4:
block = new redBlock();
squish = new redSquish();
break;
};
block.cacheAsBitmap = true;
block.gotoAndStop(1);
}
public function select():void{
if (isFruit == false){
block.gotoAndStop(2);
};
block.filters = [selectedGlow];
selected = true;
}
}
}//package photonstorm.fruitiblox
Section 38
//gameEngine (photonstorm.fruitiblox.gameEngine)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
public class gameEngine extends Sprite {
private var sfx:soundFX;
private var gameover:gameOver;
private var alreadyPlayed:Boolean;// = false
private var score:gameScore;
private var mochiMC:MovieClip;
private var game:gameLoop;
private var menu:mainMenu;
public function gameEngine():void{
sfx = new soundFX();
score = new gameScore();
menu = new mainMenu();
gameover = new gameOver();
game = new gameLoop();
mochiMC = new MovieClip();
super();
addEventListener(Event.ADDED_TO_STAGE, initMochi, false, 0, true);
}
private function initMochi(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, initMochi);
addChild(mochiMC);
MochiBot.track(mochiMC, "606026fa");
MochiServices.connect("4b0e13612dc82ee5", mochiMC);
playMainMenu();
}
private function showGameOver(_arg1:Event):void{
if (alreadyPlayed == false){
gameover.init(score, sfx);
alreadyPlayed = true;
};
game.removeEventListener(gameLoop.GAME_OVER, showGameOver);
removeChild(game);
addChild(gameover);
swapChildren(gameover, mochiMC);
gameover.addEventListener(gameOver.GAMEOVER_COMPLETE, gameOverComplete, false, 0, true);
gameover.addEventListener(gameOver.GAMEOVER_PLAYAGAIN, gameOverPlayAgain, false, 0, true);
gameover.go(game.gameType);
}
private function quickStartGame():void{
addChild(game);
game.go(alreadyPlayed, game.gameType);
game.addEventListener(gameLoop.GAME_OVER, showGameOver, false, 0, true);
}
private function gameOverPlayAgain(_arg1:Event):void{
gameover.removeEventListener(gameOver.GAMEOVER_COMPLETE, gameOverComplete);
gameover.removeEventListener(gameOver.GAMEOVER_PLAYAGAIN, gameOverPlayAgain);
removeChild(gameover);
quickStartGame();
}
private function gameOverComplete(_arg1:Event):void{
gameover.removeEventListener(gameOver.GAMEOVER_COMPLETE, gameOverComplete);
gameover.removeEventListener(gameOver.GAMEOVER_PLAYAGAIN, gameOverPlayAgain);
removeChild(gameover);
playMainMenu();
}
private function startGame(_arg1:Event):void{
menu.removeEventListener(mainMenu.MAINMENU_STARTGAME, startGame);
removeChild(menu);
addChild(game);
if (alreadyPlayed == false){
game.init(score, sfx);
};
if (menu.showTutorial == true){
game.go(false, menu.gameType);
} else {
game.go(alreadyPlayed, menu.gameType);
};
game.addEventListener(gameLoop.GAME_OVER, showGameOver, false, 0, true);
}
private function playMainMenu():void{
addChild(menu);
if (alreadyPlayed == false){
menu.init(sfx);
};
swapChildren(menu, mochiMC);
menu.addEventListener(mainMenu.MAINMENU_STARTGAME, startGame, false, 0, true);
menu.go();
}
}
}//package photonstorm.fruitiblox
Section 39
//gameLoop (photonstorm.fruitiblox.gameLoop)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.text.*;
import flash.utils.*;
import pixelblitz.utils.*;
import pixelblitz.core.*;
public class gameLoop extends Sprite {
private var timerText:TextField;
private var gameBoard:Sprite;
private var cheatMode:Boolean;// = false
private var bonusPanel:Sprite;
private var colourMeterHolder:MovieClip;
private var randomiseButton:MovieClip;
private var bonusButton:MovieClip;
private var colourStats:colourMeter;
private var bonusExpiryTimer:uint;
private var grid:gridManager;
private var endTime:uint;
public var gameType:int;
private var startTime:uint;
private var quitButton:MovieClip;
private var rndClickTotal:int;// = 1000
private var menuButton:MovieClip;
private var pauseMenu:MovieClip;
private var colourToolTip:MovieClip;
private var bonusBackButton:MovieClip;
private var sfx:soundFX;
private var bMath:BlitzMath;
private var helpWindow:MovieClip;
private var score:gameScore;
private var duration:uint;
private var gameDuration:int;// = 300
private var muteButton:MovieClip;
private var resumeButton:MovieClip;
private var gameBackground:MovieClip;
private var oldTutorialFrame:int;
private var randomiseAvailable:Boolean;
private var scoreText:TextField;
private var pauseTime:int;
private var keyboard:BlitzKeyboard;
private var currentScoreDisplay:uint;// = 0
private var randomiseToolTip:MovieClip;
public static const GAME_WON:String = "gameWon";
public static const GAME_OVER:String = "gameOver";
public function gameLoop():void{
bMath = new BlitzMath();
keyboard = new BlitzKeyboard();
grid = new gridManager();
colourStats = new colourMeter();
super();
}
private function stopPauseListening():void{
resumeButton.removeEventListener(MouseEvent.MOUSE_OVER, resumeButtonOver);
resumeButton.removeEventListener(MouseEvent.MOUSE_OUT, resumeButtonOut);
resumeButton.removeEventListener(MouseEvent.CLICK, resumeButtonClick);
bonusButton.removeEventListener(MouseEvent.MOUSE_OVER, bonusButtonOver);
bonusButton.removeEventListener(MouseEvent.MOUSE_OUT, bonusButtonOut);
bonusButton.removeEventListener(MouseEvent.CLICK, bonusButtonClick);
quitButton.removeEventListener(MouseEvent.MOUSE_OVER, quitButtonOver);
quitButton.removeEventListener(MouseEvent.MOUSE_OUT, quitButtonOut);
quitButton.removeEventListener(MouseEvent.CLICK, quitButtonClick);
bonusBackButton.removeEventListener(MouseEvent.MOUSE_OVER, bonusBackButtonOver);
bonusBackButton.removeEventListener(MouseEvent.MOUSE_OUT, bonusBackButtonOut);
bonusBackButton.removeEventListener(MouseEvent.CLICK, bonusBackButtonClick);
}
private function resumeButtonClick(_arg1:MouseEvent):void{
stopPauseListening();
endTime = (endTime + (getTimer() - pauseTime));
score.addToPausedTime((getTimer() - pauseTime));
removeChild(pauseMenu);
removeChild(resumeButton);
removeChild(bonusButton);
removeChild(quitButton);
sfx.playEffectButtonClick();
addEventListener(Event.ENTER_FRAME, mainloop, false, 0, true);
}
private function resumeButtonOut(_arg1:MouseEvent):void{
resumeButton.gotoAndPlay(2);
}
public function init(_arg1:gameScore, _arg2:soundFX):void{
score = _arg1;
sfx = _arg2;
grid.init(score, sfx, colourStats);
makeGameBoard();
gameBackground = new gameBackgroundMC();
timerText = TextField(gameBackground.getChildByName("timeText"));
scoreText = TextField(gameBackground.getChildByName("scoreText"));
helpWindow = new helpWindowMC();
randomiseButton = new randomizeButton();
randomiseButton.useHandCursor = true;
randomiseButton.buttonMode = true;
randomiseButton.mouseEnabled = true;
randomiseButton.x = 486;
randomiseButton.y = 376;
randomiseToolTip = new randomiseToolTipMC();
randomiseToolTip.x = 486;
randomiseToolTip.y = 324;
randomiseToolTip.alpha = 0;
randomiseToolTip.mouseEnabled = false;
muteButton = new muteBoardButtonMC();
muteButton.name = "mute";
muteButton.buttonMode = true;
muteButton.useHandCursor = true;
muteButton.x = 454;
muteButton.y = 409;
menuButton = new quitBoardButtonMC();
menuButton.name = "quit";
menuButton.buttonMode = true;
menuButton.useHandCursor = true;
menuButton.x = 519;
menuButton.y = 409;
colourMeterHolder = MovieClip(gameBackground.getChildByName("colourMeterHolder"));
colourToolTip = new colourToolTipMC();
colourToolTip.x = 486;
colourToolTip.y = 214;
colourToolTip.alpha = 0;
colourToolTip.mouseEnabled = false;
colourStats.init();
pauseMenu = new pauseMenuMC();
resumeButton = new resumeButtonMC();
resumeButton.mouseEnabled = true;
resumeButton.useHandCursor = true;
resumeButton.buttonMode = true;
resumeButton.x = 280;
resumeButton.y = 120;
bonusButton = new bonusButtonMC();
bonusButton.mouseEnabled = true;
bonusButton.useHandCursor = true;
bonusButton.buttonMode = true;
bonusButton.x = 280;
bonusButton.y = 220;
quitButton = new quitButtonMC();
quitButton.mouseEnabled = true;
quitButton.useHandCursor = true;
quitButton.buttonMode = true;
quitButton.x = 280;
quitButton.y = 320;
bonusBackButton = new bonusBackButtonMC();
bonusBackButton.mouseEnabled = true;
bonusBackButton.useHandCursor = true;
bonusBackButton.buttonMode = true;
bonusBackButton.x = 486;
bonusBackButton.y = 387;
keyboard.init(stage, true);
addChild(gameBackground);
addChild(gameBoard);
addChild(grid.achievements);
addChild(randomiseButton);
addChild(colourStats);
addChild(muteButton);
addChild(menuButton);
addChild(colourToolTip);
addChild(randomiseToolTip);
}
private function randomiseButtonOver(_arg1:MouseEvent):void{
TweenMax.to(randomiseToolTip, 0.2, {autoAlpha:1, overwrite:true});
if (randomiseAvailable){
randomiseButton.gotoAndStop(3);
};
}
private function quitButtonOut(_arg1:MouseEvent):void{
quitButton.gotoAndPlay(2);
}
private function updateScoreDisplay():void{
if ((((randomiseAvailable == false)) && ((score.currentTotalScore >= rndClickTotal)))){
randomiseAvailable = true;
randomiseButton.gotoAndStop(1);
};
if (score.currentTotalScore > (currentScoreDisplay + 5000)){
currentScoreDisplay = (currentScoreDisplay + 500);
} else {
currentScoreDisplay = (currentScoreDisplay + 100);
};
if (currentScoreDisplay > score.currentTotalScore){
currentScoreDisplay = score.currentTotalScore;
};
scoreText.text = currentScoreDisplay.toString();
}
private function startPauseMenu():void{
pauseTime = getTimer();
removeEventListener(Event.ENTER_FRAME, mainloop);
resumeButton.gotoAndStop(1);
bonusButton.gotoAndStop(1);
quitButton.gotoAndStop(1);
addChild(pauseMenu);
addChild(resumeButton);
addChild(bonusButton);
addChild(quitButton);
startPauseListening();
}
private function timeFormat():String{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:String;
if (duration > 6000){
_local2 = Math.floor((duration / 60));
_local3 = (duration - (_local2 * 60));
_local4 = (_local2.toString() + ":");
} else {
if (duration > 600){
_local2 = Math.floor((duration / 60));
_local3 = (duration - (_local2 * 60));
_local4 = (_local2.toString() + ":");
} else {
if ((((duration >= 60)) && ((duration < 600)))){
_local2 = Math.floor((duration / 60));
_local3 = (duration - (_local2 * 60));
_local4 = (("0" + _local2.toString()) + ":");
} else {
_local3 = duration;
_local4 = "00:";
};
};
};
if (_local3 < 10){
_local4 = _local4.concat("0");
};
_local4 = _local4.concat(_local3.toString());
return (_local4);
}
private function showInstructions():void{
addEventListener(Event.ENTER_FRAME, tutorialMonitorLoop, false, 0, true);
oldTutorialFrame = 1;
colourStats.go(1);
helpWindow.gotoAndStop(1);
addChild(helpWindow);
}
private function resumeButtonOver(_arg1:MouseEvent):void{
sfx.playEffectButtonOver();
resumeButton.gotoAndStop(2);
}
private function gameoverFinished(_arg1:Event):void{
grid.finalBlock.removeEventListener(fruitiblock.FINISH_FINISHED, gameoverFinished);
sendGameOverEvent();
}
private function resetAfterTutorial():void{
removeEventListener(Event.ENTER_FRAME, tutorialMonitorLoop);
removeChild(helpWindow);
colourStats.stop();
score.resetValues();
currentScoreDisplay = 0;
timerText.text = "00:00";
scoreText.text = "0";
gameBoard.alpha = 1;
gameBoard.visible = true;
startNewGame();
}
private function hideColourToolTip(_arg1:MouseEvent):void{
TweenMax.to(colourToolTip, 0.5, {autoAlpha:0, overwrite:true});
}
private function bonusButtonOut(_arg1:MouseEvent):void{
bonusButton.gotoAndPlay(2);
}
private function revealFinished(_arg1:Event):void{
grid.finalBlock.removeEventListener(fruitiblock.REVEAL_FINISHED, revealFinished);
grid.listenForClicks = true;
startListening();
}
private function startPauseListening():void{
resumeButton.addEventListener(MouseEvent.MOUSE_OVER, resumeButtonOver, false, 0, true);
resumeButton.addEventListener(MouseEvent.MOUSE_OUT, resumeButtonOut, false, 0, true);
resumeButton.addEventListener(MouseEvent.CLICK, resumeButtonClick, false, 0, true);
bonusButton.addEventListener(MouseEvent.MOUSE_OVER, bonusButtonOver, false, 0, true);
bonusButton.addEventListener(MouseEvent.MOUSE_OUT, bonusButtonOut, false, 0, true);
bonusButton.addEventListener(MouseEvent.CLICK, bonusButtonClick, false, 0, true);
quitButton.addEventListener(MouseEvent.MOUSE_OVER, quitButtonOver, false, 0, true);
quitButton.addEventListener(MouseEvent.MOUSE_OUT, quitButtonOut, false, 0, true);
quitButton.addEventListener(MouseEvent.CLICK, quitButtonClick, false, 0, true);
bonusBackButton.addEventListener(MouseEvent.MOUSE_OVER, bonusBackButtonOver, false, 0, true);
bonusBackButton.addEventListener(MouseEvent.MOUSE_OUT, bonusBackButtonOut, false, 0, true);
bonusBackButton.addEventListener(MouseEvent.CLICK, bonusBackButtonClick, false, 0, true);
}
private function menuClick(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
startPauseMenu();
}
private function bonusBackButtonOver(_arg1:MouseEvent):void{
sfx.playEffectButtonOver();
bonusBackButton.gotoAndStop(2);
}
private function menuOut(_arg1:MouseEvent):void{
menuButton.play();
}
private function startListening():void{
grid.startListening();
grid.addEventListener(gridManager.EXTRA_TIME, extraTime, false, 0, true);
grid.addEventListener(gridManager.GAME_OVER, gameover, false, 0, true);
randomiseButton.addEventListener(MouseEvent.MOUSE_OVER, randomiseButtonOver, false, 0, true);
randomiseButton.addEventListener(MouseEvent.MOUSE_OUT, randomiseButtonOut, false, 0, true);
randomiseButton.addEventListener(MouseEvent.CLICK, randomiseButtonClick, false, 0, true);
muteButton.addEventListener(MouseEvent.MOUSE_OVER, muteOver, false, 0, true);
muteButton.addEventListener(MouseEvent.MOUSE_OUT, muteOut, false, 0, true);
muteButton.addEventListener(MouseEvent.CLICK, muteClick, false, 0, true);
menuButton.addEventListener(MouseEvent.MOUSE_OVER, menuOver, false, 0, true);
menuButton.addEventListener(MouseEvent.MOUSE_OUT, menuOut, false, 0, true);
menuButton.addEventListener(MouseEvent.CLICK, menuClick, false, 0, true);
colourStats.addEventListener(MouseEvent.MOUSE_OVER, showColourToolTip, false, 0, true);
colourStats.addEventListener(MouseEvent.MOUSE_OUT, hideColourToolTip, false, 0, true);
colourMeterHolder.addEventListener(MouseEvent.MOUSE_OVER, showColourToolTip, false, 0, true);
colourMeterHolder.addEventListener(MouseEvent.MOUSE_OUT, hideColourToolTip, false, 0, true);
addEventListener(Event.ENTER_FRAME, mainloop, false, 0, true);
}
private function showColourToolTip(_arg1:MouseEvent):void{
var _local2:Array = colourStats.colourCounts;
TextField(colourToolTip.getChildByName("tipText")).text = (((((((_local2[0] + "%\n") + _local2[1]) + "%\n") + _local2[2]) + "%\n") + _local2[3]) + "%");
TweenMax.to(colourToolTip, 0.2, {autoAlpha:1, overwrite:true});
}
private function muteOut(_arg1:MouseEvent):void{
muteButton.play();
}
private function randomiseButtonClick(_arg1:MouseEvent):void{
if ((((score.currentTotalScore > 0)) && (randomiseAvailable))){
score.halfScore();
currentScoreDisplay = score.currentTotalScore;
scoreText.text = currentScoreDisplay.toString();
grid.randomiseAllColours();
colourStats.reset();
if (score.currentTotalScore < rndClickTotal){
randomiseAvailable = false;
randomiseButton.gotoAndStop(2);
};
};
}
private function muteOver(_arg1:MouseEvent):void{
if (sfx.isMuted){
muteButton.gotoAndStop("muteOver");
} else {
if (muteButton.currentFrame == 1){
sfx.playEffectButtonOver();
};
muteButton.gotoAndStop("unmuteOver");
};
}
private function bonusButtonOver(_arg1:MouseEvent):void{
sfx.playEffectButtonOver();
bonusButton.gotoAndStop(2);
}
private function quitButtonClick(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
stopPauseListening();
removeChild(pauseMenu);
removeChild(resumeButton);
removeChild(bonusButton);
removeChild(quitButton);
gameover();
}
private function sendGameOverEvent():void{
dispatchEvent(new Event(gameLoop.GAME_OVER));
}
private function bonusBackButtonOut(_arg1:MouseEvent):void{
bonusBackButton.gotoAndPlay(2);
}
private function randomiseButtonOut(_arg1:MouseEvent):void{
TweenMax.to(randomiseToolTip, 0.8, {autoAlpha:0, overwrite:true});
if (randomiseAvailable){
randomiseButton.gotoAndPlay(3);
};
}
private function makeGameBoard():void{
gameBoard = new Sprite();
gameBoard.x = (13 + 18);
gameBoard.y = (13 + 18);
gameBoard.mouseEnabled = false;
gameBoard = grid.makeGameBoard(gameBoard);
}
private function menuOver(_arg1:MouseEvent):void{
if (menuButton.currentFrame == 1){
sfx.playEffectButtonOver();
};
menuButton.gotoAndStop(2);
}
private function quitButtonOver(_arg1:MouseEvent):void{
sfx.playEffectButtonOver();
quitButton.gotoAndStop(2);
}
private function bonusButtonClick(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
removeChild(resumeButton);
removeChild(bonusButton);
removeChild(quitButton);
pauseMenu.gotoAndStop(101);
bonusPanel = grid.getBonusPanel();
addChild(bonusPanel);
addChild(bonusBackButton);
}
private function stopListening():void{
removeEventListener(Event.ENTER_FRAME, mainloop);
grid.stopListening();
grid.removeEventListener(gridManager.EXTRA_TIME, extraTime);
grid.removeEventListener(gridManager.GAME_OVER, gameover);
randomiseButton.removeEventListener(MouseEvent.CLICK, randomiseButtonClick);
randomiseButton.removeEventListener(MouseEvent.MOUSE_OVER, randomiseButtonOver);
randomiseButton.removeEventListener(MouseEvent.MOUSE_OUT, randomiseButtonOut);
muteButton.removeEventListener(MouseEvent.MOUSE_OVER, muteOver);
muteButton.removeEventListener(MouseEvent.MOUSE_OUT, muteOut);
muteButton.removeEventListener(MouseEvent.CLICK, muteClick);
menuButton.removeEventListener(MouseEvent.MOUSE_OVER, menuOver);
menuButton.removeEventListener(MouseEvent.MOUSE_OUT, menuOut);
menuButton.removeEventListener(MouseEvent.CLICK, menuClick);
colourStats.removeEventListener(MouseEvent.MOUSE_OVER, showColourToolTip);
colourStats.removeEventListener(MouseEvent.MOUSE_OUT, hideColourToolTip);
colourMeterHolder.removeEventListener(MouseEvent.MOUSE_OVER, showColourToolTip);
colourMeterHolder.removeEventListener(MouseEvent.MOUSE_OUT, hideColourToolTip);
}
private function mainloop(_arg1:Event):void{
if (gameType < 3){
duration = ((endTime - getTimer()) / 1000);
if (getTimer() > endTime){
gameover();
return;
};
} else {
duration = ((getTimer() - startTime) / 1000);
};
timerText.text = timeFormat();
if ((((((getTimer() > (endTime - 10000))) && ((sfx.clockTicking == false)))) && (!((gameType == 3))))){
sfx.playEffectCountDown();
};
if ((((((getTimer() > bonusExpiryTimer)) && ((getTimer() > (startTime + 4000))))) && ((grid.highlighted == false)))){
if (getTimer() < (endTime - 5000)){
grid.makeBonusBlock(endTime);
bonusExpiryTimer = (getTimer() + bMath.rand(10000, 20000));
};
};
if (keyboard.keyHit(BlitzKeyboard.SPACE) > 0){
grid.resetSelection();
};
if (keyboard.keyHit(BlitzKeyboard.M) > 0){
sfx.muteToggle();
};
if ((((keyboard.keyHit(BlitzKeyboard.Q) > 0)) || ((keyboard.keyHit(BlitzKeyboard.P) > 0)))){
startPauseMenu();
return;
};
if (currentScoreDisplay < score.currentTotalScore){
updateScoreDisplay();
};
if (cheatMode){
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_0)){
grid.cheatColour = 0;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_1)){
grid.cheatColour = 1;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_2)){
grid.cheatColour = 2;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_3)){
grid.cheatColour = 3;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_4)){
grid.cheatColour = 4;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_5)){
grid.cheatColour = 5;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_6)){
grid.cheatColour = 6;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_7)){
grid.cheatColour = 7;
};
if (keyboard.keyHit(BlitzKeyboard.NUMPAD_8)){
grid.cheatColour = 8;
};
};
}
private function gameover(_arg1=null):void{
stopListening();
if (gameType == 3){
score.stopTimer();
};
keyboard.stop();
sfx.stopEffectCountDown();
sfx.playEffectGameOver();
scoreText.text = score.currentTotalScore.toString();
grid.finalBlock.addEventListener(fruitiblock.FINISH_FINISHED, gameoverFinished, false, 0, true);
grid.finishSequence();
score.favouriteColour = colourStats.favouriteColour;
}
private function tutorialMonitorLoop(_arg1:Event):void{
if (currentScoreDisplay < score.currentTotalScore){
updateScoreDisplay();
};
if (helpWindow.currentFrame == 10){
removeEventListener(Event.ENTER_FRAME, tutorialMonitorLoop);
removeChild(helpWindow);
gameBoard.visible = true;
startNewGame();
};
if ((((helpWindow.currentFrame == 20)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
};
if ((((helpWindow.currentFrame == 21)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
gameBoard.visible = true;
grid.go(1);
grid.setTutorialBlocks1();
grid.revealSequence(95);
sfx.playEffectReveal();
};
if ((((helpWindow.currentFrame == 22)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
grid.setTutorialBlocks2();
};
if ((((helpWindow.currentFrame == 23)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
grid.setTutorialBlocks3();
};
if ((((helpWindow.currentFrame == 24)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
grid.setTutorialBlocks4();
};
if ((((helpWindow.currentFrame == 25)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
grid.setTutorialBlocks5();
};
if ((((helpWindow.currentFrame == 26)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
grid.setTutorialBlocks6();
};
if ((((helpWindow.currentFrame == 27)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
};
if ((((helpWindow.currentFrame == 28)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
};
if ((((helpWindow.currentFrame == 29)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
TweenMax.to(gameBoard, 1, {autoAlpha:0});
};
if ((((helpWindow.currentFrame == 30)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
};
if ((((helpWindow.currentFrame == 31)) && (!((oldTutorialFrame == helpWindow.currentFrame))))){
oldTutorialFrame = helpWindow.currentFrame;
};
if (helpWindow.currentFrame == 32){
resetAfterTutorial();
};
}
public function go(_arg1:Boolean, _arg2:int):void{
gameType = _arg2;
currentScoreDisplay = 0;
randomiseAvailable = false;
randomiseButton.gotoAndStop(2);
score.resetValues();
timerText.text = "00:00";
scoreText.text = "0";
if (sfx.isMuted){
muteButton.gotoAndStop(11);
} else {
muteButton.gotoAndStop(1);
};
menuButton.gotoAndStop(1);
if (_arg1 == true){
startNewGame();
} else {
gameBoard.visible = false;
showInstructions();
};
}
private function muteClick(_arg1:MouseEvent):void{
if (sfx.isMuted){
sfx.muteToggle();
muteButton.gotoAndStop(1);
sfx.playEffectButtonClick();
} else {
sfx.muteToggle();
muteButton.gotoAndStop(11);
};
}
private function startNewGame():void{
startTime = getTimer();
switch (gameType){
case 1:
endTime = (startTime + (1000 * gameDuration));
break;
case 2:
endTime = (startTime + (1000 * gameDuration));
break;
case 3:
score.startTimer();
break;
};
bonusExpiryTimer = (startTime + bMath.rand(2000, 2000));
colourStats.go(gameType);
keyboard.go();
grid.makeGrid();
grid.makeInitialFruitBlocks();
removeChild(gameBoard);
gameBoard = null;
makeGameBoard();
addChildAt(gameBoard, 1);
grid.go(gameType);
sfx.playEffectReveal();
grid.finalBlock.addEventListener(fruitiblock.REVEAL_FINISHED, revealFinished, false, 0, true);
grid.revealSequence();
}
private function extraTime(_arg1:Event):void{
if (gameType != 2){
sfx.playEffectGetExtraTime();
endTime = (endTime + 30000);
sfx.stopEffectCountDown();
};
}
private function bonusBackButtonClick(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
removeChild(bonusPanel);
removeChild(bonusBackButton);
addChild(resumeButton);
addChild(bonusButton);
addChild(quitButton);
resumeButton.gotoAndStop(1);
bonusButton.gotoAndStop(1);
quitButton.gotoAndStop(1);
pauseMenu.gotoAndPlay(1);
}
}
}//package photonstorm.fruitiblox
Section 40
//gameOver (photonstorm.fruitiblox.gameOver)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.text.*;
import mochi.as3.*;
public class gameOver extends Sprite {
private var container:Sprite;
private var sfx:soundFX;
private var stageCenterY:int;// = 210
private var gameType:int;
private var score:gameScore;
private var favColourText:TextField;
private var stageCenterX:int;// = 280
private var playAgainButton:MovieClip;
private var scoreText:TextField;
private var submitScoreButton:MovieClip;
private var background:MovieClip;
private var menuButton:MovieClip;
public static const GAMEOVER_COMPLETE:String = "gameOverComplete";
public static const GAMEOVER_PLAYAGAIN:String = "gameOverPlayAgain";
public function gameOver():void{
}
private function afterScoreSubmit():void{
submitScoreButton.removeEventListener(MouseEvent.CLICK, submitScore);
submitScoreButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
submitScoreButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
setObjectLocations();
runTweens();
}
public function init(_arg1:gameScore, _arg2:soundFX):void{
score = _arg1;
sfx = _arg2;
container = new Sprite();
background = new gameOverMC();
background.gotoAndStop(1);
submitScoreButton = new gameOverSubmitScoreMC();
submitScoreButton.mouseEnabled = true;
submitScoreButton.useHandCursor = true;
submitScoreButton.buttonMode = true;
playAgainButton = new gameOverPlayAgainMC();
playAgainButton.mouseEnabled = true;
playAgainButton.useHandCursor = true;
playAgainButton.buttonMode = true;
menuButton = new gameOverMenuMC();
menuButton.mouseEnabled = true;
menuButton.useHandCursor = true;
menuButton.buttonMode = true;
scoreText = TextField(background.getChildByName("scoreText"));
favColourText = TextField(background.getChildByName("favColourText"));
container.addChild(background);
container.addChild(scoreText);
container.addChild(favColourText);
container.addChild(submitScoreButton);
container.addChild(playAgainButton);
container.addChild(menuButton);
container.x = stageCenterX;
container.y = stageCenterY;
background.x = 0;
background.y = 0;
setObjectLocations();
addChild(container);
}
private function mouseOver(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
_local2.gotoAndStop(2);
sfx.playEffectButtonOver();
}
private function runTweens():void{
TweenMax.to(submitScoreButton, 0.75, {x:0});
TweenMax.to(playAgainButton, 0.75, {x:0, delay:0.15});
TweenMax.to(menuButton, 0.75, {x:0, delay:0.3});
TweenMax.to(scoreText, 0.75, {y:-112});
TweenMax.to(favColourText, 0.75, {y:-62, delay:0.15});
}
private function startEvents():void{
submitScoreButton.addEventListener(MouseEvent.CLICK, submitScore, false, 0, true);
submitScoreButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
submitScoreButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
playAgainButton.addEventListener(MouseEvent.CLICK, playAgain, false, 0, true);
playAgainButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
playAgainButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
menuButton.addEventListener(MouseEvent.CLICK, returnToMenu, false, 0, true);
menuButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
menuButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
}
private function submitScore(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
runVanish();
switch (gameType){
case 1:
MochiScores.showLeaderboard({boardID:"02406281b30c1bf9", score:score.currentTotalScore, onClose:afterScoreSubmit, onError:afterScoreSubmit});
break;
case 2:
MochiScores.showLeaderboard({boardID:"17e60720b9778bd5", score:score.currentTotalScore, onClose:afterScoreSubmit, onError:afterScoreSubmit});
break;
case 3:
MochiScores.showLeaderboard({boardID:"60ceb6c242b456c1", score:score.currentTotalDuration, onClose:afterScoreSubmit, onError:afterScoreSubmit});
break;
};
}
private function mouseOut(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
_local2.play();
}
private function runVanish():void{
TweenMax.to(submitScoreButton, 0.75, {x:600, onComplete:hideSubmitScore});
TweenMax.to(playAgainButton, 0.75, {x:600, delay:0.15});
TweenMax.to(menuButton, 0.75, {x:600, delay:0.3});
TweenMax.to(scoreText, 0.75, {y:302});
TweenMax.to(favColourText, 0.75, {y:302, delay:0.15});
}
public function go(_arg1:int):void{
gameType = _arg1;
submitScoreButton.alpha = 1;
setObjectLocations();
runTweens();
background.gotoAndPlay(1);
scoreText.text = ("SCORE: " + score.currentTotalScoreFormatted);
switch (score.favouriteColour){
case 0:
favColourText.text = "You should check the tutorial!";
break;
case 1:
favColourText.text = "Your favourite color was Green!";
break;
case 2:
favColourText.text = "Your favourite color was Blue!";
break;
case 3:
favColourText.text = "Your favourite color was Yellow!";
break;
case 4:
favColourText.text = "Your favourite color was Red!";
break;
};
startEvents();
}
private function setObjectLocations():void{
submitScoreButton.x = 300;
submitScoreButton.y = 23;
playAgainButton.x = 300;
playAgainButton.y = 92;
menuButton.x = 300;
menuButton.y = 161;
scoreText.x = -280;
scoreText.y = -300;
favColourText.x = -280;
favColourText.y = -300;
submitScoreButton.gotoAndStop(1);
playAgainButton.gotoAndStop(1);
menuButton.gotoAndStop(1);
}
private function returnToMenu(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
stopEvents();
dispatchEvent(new Event(gameOver.GAMEOVER_COMPLETE));
}
private function hideSubmitScore():void{
submitScoreButton.alpha = 0.2;
submitScoreButton.useHandCursor = false;
submitScoreButton.buttonMode = false;
}
private function playAgain(_arg1:MouseEvent):void{
sfx.playEffectButtonClick();
stopEvents();
dispatchEvent(new Event(gameOver.GAMEOVER_PLAYAGAIN));
}
private function stopEvents():void{
submitScoreButton.removeEventListener(MouseEvent.CLICK, submitScore);
submitScoreButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
submitScoreButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
playAgainButton.removeEventListener(MouseEvent.CLICK, playAgain);
playAgainButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
playAgainButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
menuButton.removeEventListener(MouseEvent.CLICK, returnToMenu);
menuButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
menuButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
}
}
}//package photonstorm.fruitiblox
Section 41
//gameScore (photonstorm.fruitiblox.gameScore)
package photonstorm.fruitiblox {
import flash.utils.*;
public final class gameScore {
public var favouriteColour:uint;
public static const ADD_SCORE:String = "addScore";
private static var pauseTime:int;
private static var startOfLevelScore:uint;
private static var timeStart:uint;
private static var highScore:uint;
private static var totalDuration:uint;
private static var totalScore:uint;
private static var newHighScore:Boolean;
public function gameScore():void{
}
public function doubleScore():void{
totalScore = (totalScore * 2);
}
public function startTimer():void{
timeStart = getTimer();
pauseTime = 0;
}
public function addPoints(_arg1:int):void{
totalScore = (totalScore + _arg1);
if (totalScore > highScore){
highScore = totalScore;
newHighScore = true;
};
}
public function halfScore():void{
totalScore = (totalScore / 2);
}
public function get currentTotalScore():uint{
return (totalScore);
}
public function init():void{
resetValues();
}
public function resetValues():void{
totalScore = 0;
totalDuration = 0;
newHighScore = false;
}
public function stopTimer():void{
totalDuration = ((getTimer() - pauseTime) - timeStart);
}
public function get currentHighScore():uint{
return (highScore);
}
public function get isNewHighScore():Boolean{
return (newHighScore);
}
public function get currentTotalScoreFormatted():String{
var _local1:String = totalScore.toString();
var _local2:String = new String();
var _local3:int;
var _local4:int = _local1.length;
while (_local4 >= 0) {
_local2 = _local2.concat(_local1.charAt(_local4));
if (((((_local3 % 3) == 0)) && ((_local3 > 0)))){
_local2 = _local2.concat(",");
};
_local3++;
_local4--;
};
_local2 = _local2.split("").reverse().join("");
if (_local2.charAt(0) == ","){
_local2 = _local2.slice(1);
};
return (_local2);
}
public function addToPausedTime(_arg1:int):void{
pauseTime = (pauseTime + _arg1);
}
public function get currentTotalDuration():uint{
return (totalDuration);
}
}
}//package photonstorm.fruitiblox
Section 42
//gridManager (photonstorm.fruitiblox.gridManager)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import pixelblitz.utils.*;
import pixelblitz.core.*;
public class gridManager extends EventDispatcher {
private var lastColour:uint;// = 0
private var sfx:soundFX;
private var bMath:BlitzMath;
public var listenForClicks:Boolean;
private var score:gameScore;
private var tempData:Array;
public var achievements:achievementsManager;
private var combos:uint;// = 1
private var tempFinalBlock:fruitiblock;// = null
private var currentColour:uint;// = 0
private var bonusBlock:fruitiblock;// = null
private var tempBlock1:fruitiblock;// = null
private var tempBlock2:fruitiblock;// = null
private var colourStats:colourMeter;
private var tempBlock4:fruitiblock;// = null
private var tempBlock3:fruitiblock;// = null
private var gameWon:Boolean;
private var grid:Array;
private var gameType:int;
public var highlighted:Boolean;
private var keyboard:BlitzKeyboard;
public var finishCompleted:Boolean;
public var cheatColour:int;// = 0
public static const REVEAL_SEQUENCE_COMPLETE:String = "revealSequenceComplete";
public static const GAME_OVER:String = "gameOver";
public static const PROCESS_COMPLETE:String = "processComplete";
public static const FINISH_SEQUENCE_COMPLETE:String = "finishSequenceComplete";
public static const EXTRA_TIME:String = "extraTime";
public function gridManager():void{
bMath = new BlitzMath();
super();
}
private function gridClicked(_arg1:MouseEvent):void{
var _local2:fruitiblock;
if (listenForClicks){
_local2 = fruitiblock(_arg1.currentTarget);
if (cheatColour > 0){
switch (cheatColour){
case 1:
_local2.forceColour(1);
return;
case 2:
_local2.forceColour(2);
return;
case 3:
_local2.forceColour(3);
return;
case 4:
_local2.forceColour(4);
return;
case 5:
_local2.makeFruit(1);
return;
case 6:
_local2.makeFruit(2);
return;
case 7:
_local2.makeFruit(3);
return;
case 8:
_local2.makeFruit(4);
return;
};
};
if (_local2.isBonusBlock){
sfx.playEffectCancelBlock();
return;
};
if (_local2.selected){
_local2.unselect();
if (selectedBlockCount() == 0){
currentColour = 0;
showAllColours();
sfx.playEffectCancelBlock();
};
} else {
if (selectedBlockCount() > 0){
if ((((_local2.value == currentColour)) && ((selectedBlockCount() < 4)))){
_local2.select();
sfx.playEffectClick();
//unresolved jump
};
} else {
currentColour = _local2.value;
_local2.select();
highlightSelectedColour();
sfx.playEffectClick();
};
if (selectedBlockCount() == 4){
checkSelection();
};
};
//unresolved jump
};
}
private function processCombos(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:uint = ((_arg1 * _arg2) * 100);
if (_arg3 == lastColour){
combos++;
_local4 = (_local4 * combos);
} else {
combos = 1;
};
lastColour = _arg3;
score.addPoints(_local4);
if ((((_arg1 == 10)) && ((_arg2 == 10)))){
score.addPoints(5000);
sfx.playEffectGetFullRect();
} else {
sfx.playEffectGetRect();
};
}
private function getSelectedBlocks():Array{
var _local4:fruitiblock;
var _local1:Array = new Array();
var _local2:Boolean;
var _local3:int;
for each (_local4 in grid) {
if (_local4.selected){
_local1.push(_local4);
if (_local3 == 0){
_local3 = _local4.value;
} else {
if (_local4.value !== _local3){
_local2 = false;
};
};
};
};
_local1.sort(compareBlocks);
return ([_local2, _local1]);
}
public function setTutorialBlocks5():void{
var _local1:fruitiblock = grid[97];
_local1.select();
sfx.playEffectClick();
}
public function init(_arg1:gameScore, _arg2:soundFX, _arg3:colourMeter):void{
score = _arg1;
sfx = _arg2;
colourStats = _arg3;
achievements = new achievementsManager();
achievements.init();
makeGrid();
}
private function selectedBlockCount():int{
var _local2:fruitiblock;
var _local1:int;
for each (_local2 in grid) {
if (_local2.selected){
_local1++;
};
};
return (_local1);
}
private function highlightSelectedColour():void{
var _local1:fruitiblock;
highlighted = true;
for each (_local1 in grid) {
if (_local1.value != currentColour){
_local1.fadeOut();
};
};
}
public function setTutorialBlocks6():void{
checkSelection();
}
public function resetSelection():void{
var _local1:fruitiblock;
for each (_local1 in grid) {
if (_local1.selected){
_local1.unselect();
};
};
showAllColours();
}
public function getBonusPanel():Sprite{
return (achievements.bonusPanel);
}
private function showAllColours():void{
var _local1:fruitiblock;
highlighted = false;
for each (_local1 in grid) {
_local1.resetFade();
};
}
private function getFinalBlock():void{
var _local1:fruitiblock;
for each (_local1 in grid) {
if (_local1.location == 99){
tempFinalBlock = _local1;
break;
};
};
}
public function revealSequence(_arg1:int=1000):void{
var _local2:int;
var _local5:fruitiblock;
if (_arg1 == 1000){
_local2 = bMath.rand(0, 99);
} else {
_local2 = _arg1;
};
var _local3:int = grid[_local2].x;
var _local4:int = grid[_local2].y;
for each (_local5 in grid) {
_local5.reveal(_local3, _local4);
};
}
public function get finalBlock():fruitiblock{
return (grid[99]);
}
public function randomiseAllColours():void{
var _local1:fruitiblock;
combos = 1;
resetSelection();
sfx.playEffectRandomise();
for each (_local1 in grid) {
_local1.randomise();
};
}
private function processAchievements():void{
var _local1:int = achievements.check(tempBlock1, tempBlock2, tempBlock3, tempBlock4, tempData);
if (_local1 > 0){
score.addPoints(_local1);
sfx.playEffectGetGold();
};
}
private function compareBlocks(_arg1:fruitiblock, _arg2:fruitiblock):Number{
if (_arg1.location > _arg2.location){
return (1);
};
if (_arg1.location < _arg2.location){
return (-1);
};
return (0);
}
public function makeGameBoard(_arg1:Sprite):Sprite{
var _local2:fruitiblock;
for each (_local2 in grid) {
_arg1.addChild(_local2);
};
return (_arg1);
}
public function makeGrid():void{
var _local3:uint;
grid = new Array();
var _local1 = 1;
var _local2:uint;
while (_local2 < 10) {
_local3 = 0;
while (_local3 < 10) {
grid.push(new fruitiblock(_local1, _local3, _local2, gameType));
_local1++;
_local3++;
};
_local2++;
};
}
public function stopListening():void{
var _local1:fruitiblock;
for each (_local1 in grid) {
_local1.removeEventListener(MouseEvent.CLICK, gridClicked);
};
}
private function completeSelection():void{
var _local15:fruitiblock;
var _local16:int;
var _local17:int;
var _local18:int;
var _local1:fruitiblock = tempBlock1;
var _local2:fruitiblock = tempBlock2;
var _local3:fruitiblock = tempBlock3;
var _local4:fruitiblock = tempBlock4;
var _local5:Array = tempData;
var _local6:int = _local5[1];
var _local7:int = _local5[2];
var _local8:int = (_local1.row - 1);
var _local9:int = _local1.row;
var _local10:int = _local3.row;
var _local11:int = _local1.column;
var _local12:int = _local2.column;
var _local13:int = (_local6 * _local7);
var _local14:Array = new Array();
tempBlock4.addEventListener(fruitiblock.DROP_FINISHED, completeSelectionFinished, false, 0, true);
for each (_local15 in grid) {
if ((((((_local15.value == lastColour)) && (_local15.isSquished))) && ((_local15.isBonusBlock == false)))){
_local14.push(_local15);
};
if (gameType == 2){
if (_local15.isSquished){
_local15.rapidFill();
};
} else {
if ((((((_local15.column >= _local11)) && ((_local15.column <= _local12)))) && ((_local15.row <= _local10)))){
if (_local15.isSquished){
_local15.dropSquished(_local8);
} else {
_local15.drop(_local7);
};
};
};
};
_local16 = ((Math.random() * _local14.length) - 1);
_local14[_local16].makeFruit(lastColour);
_local17 = int(Math.floor((_local13 / 10)));
if (_local13 >= 10){
_local18 = 1;
while (_local18 <= _local17) {
makeFruitBlock(_local14);
_local18++;
};
};
}
private function processSelection(_arg1:fruitiblock, _arg2:fruitiblock, _arg3:fruitiblock, _arg4:fruitiblock, _arg5:Array):void{
var _local9:fruitiblock;
var _local10:Boolean;
var _local6:int = _arg5[0];
var _local7:int = _arg5[1];
var _local8:int = _arg5[2];
tempBlock1 = _arg1;
tempBlock2 = _arg2;
tempBlock3 = _arg3;
tempBlock4 = _arg4;
tempData = _arg5;
tempBlock4.addEventListener(fruitiblock.SQUISH_FINISHED, processSelectionFinished, false, 0, true);
showAllColours();
for each (_local9 in _arg5[3]) {
if (_local9.isBonusBlock){
processBonusBlock(_local9);
};
_local10 = colourStats.addToColourMeter(_local9.value);
if (_local10){
if (gameType == 3){
gameWon = true;
} else {
sfx.playEffectGetFullRect();
score.doubleScore();
};
};
_local9.squishIt();
};
processAchievements();
processCombos(_local7, _local8, _local6);
}
public function makeBonusBlock(_arg1:int):void{
var _local3:fruitiblock;
var _local2:Array = new Array();
for each (_local3 in grid) {
if (((((((((((((_local3.isSquished) || (_local3.isBonusBlock))) || (_local3.selected))) || ((_local3.location == 1)))) || ((_local3.location == 10)))) || ((_local3.location == 91)))) || ((_local3.location == 100)))){
_local2.push((_local3.id - 1));
};
};
if (((!((bonusBlock == null))) && (bonusBlock.isBonusBlock))){
bonusBlock.resetAfterBonus();
};
var _local4:fruitiblock = grid[bMath.rand(0, grid.length, _local2)];
bonusBlock = _local4;
sfx.playEffectBonusAppears();
if (((bMath.chanceRoll(70)) && ((gameType == 1)))){
_local4.makeBonus(fruitiblock.BONUS_EXTRA_TIME);
} else {
_local4.makeBonus(fruitiblock.BONUS_GOLDEN);
};
}
public function makeInitialFruitBlocks():void{
var _local1:int;
while (_local1 < 6) {
makeFruitBlock();
_local1++;
};
}
private function completeSelectionFinished(_arg1:Event):void{
tempBlock4.removeEventListener(fruitiblock.DROP_FINISHED, completeSelectionFinished);
listenForClicks = true;
}
public function go(_arg1:int):void{
listenForClicks = false;
finishCompleted = false;
highlighted = false;
gameType = _arg1;
gameWon = false;
combos = 1;
lastColour = 0;
achievements.go();
}
private function getFullRectangle(_arg1:fruitiblock, _arg2:fruitiblock, _arg3:fruitiblock, _arg4:fruitiblock):Array{
var _local9:fruitiblock;
var _local5:Array = new Array();
var _local6:int = ((_arg2.column - _arg1.column) + 1);
var _local7:int = ((_arg3.row - _arg1.row) + 1);
var _local8:int = _arg1.value;
for each (_local9 in grid) {
if ((((_local9.column >= _arg1.column)) && ((_local9.column <= _arg2.column)))){
if ((((_local9.row >= _arg1.row)) && ((_local9.row <= _arg3.row)))){
_local5.push(_local9);
};
};
};
return ([_local8, _local6, _local7, _local5]);
}
private function checkSelection():void{
var _local2:Array;
var _local3:fruitiblock;
var _local4:fruitiblock;
var _local5:fruitiblock;
var _local6:fruitiblock;
var _local7:Array;
var _local1:Array = getSelectedBlocks();
if (_local1[0] == true){
_local2 = _local1[1];
_local3 = _local2[0];
_local4 = _local2[1];
_local5 = _local2[2];
_local6 = _local2[3];
if (_local3.row == _local4.row){
if (_local3.column == _local5.column){
if (_local4.column == _local6.column){
if (_local5.row == _local6.row){
_local7 = getFullRectangle(_local3, _local4, _local5, _local6);
listenForClicks = false;
processSelection(_local3, _local4, _local5, _local6, _local7);
};
};
};
//unresolved jump
};
//unresolved jump
};
}
public function setTutorialBlocks2():void{
var _local1:fruitiblock = grid[53];
currentColour = _local1.value;
_local1.select();
sfx.playEffectClick();
highlightSelectedColour();
}
public function setTutorialBlocks3():void{
var _local1:fruitiblock = grid[57];
_local1.select();
sfx.playEffectClick();
}
public function makeFruitBlock(_arg1:Array=null):void{
var _local3:fruitiblock;
var _local4:fruitiblock;
var _local5:fruitiblock;
var _local2:Array = new Array();
if (_arg1 != null){
for each (_local4 in _arg1) {
if (((((_local4.isBonusBlock) || (_local4.selected))) || (_local4.isFruit))){
_local2.push((_local4.id - 1));
};
};
} else {
for each (_local5 in grid) {
if (((((_local5.isBonusBlock) || (_local5.selected))) || (_local5.isFruit))){
_local2.push((_local5.id - 1));
};
};
};
_local3 = grid[bMath.rand(0, grid.length, _local2)];
_local3.makeFruit();
}
private function processSelectionFinished(_arg1:Event):void{
tempBlock4.removeEventListener(fruitiblock.SQUISH_FINISHED, processSelectionFinished);
if ((((gameType == 2)) && (gameWon))){
dispatchEvent(new Event(gridManager.GAME_OVER));
} else {
completeSelection();
};
}
public function setTutorialBlocks4():void{
var _local1:fruitiblock = grid[93];
_local1.select();
sfx.playEffectClick();
}
public function startListening():void{
var _local1:fruitiblock;
for each (_local1 in grid) {
_local1.addEventListener(MouseEvent.CLICK, gridClicked, false, 0, true);
};
}
public function setTutorialBlocks1():void{
grid[53].forceColour(2);
grid[57].forceColour(2);
grid[93].forceColour(2);
grid[97].forceColour(2);
}
public function finishSequence():void{
var _local4:fruitiblock;
var _local1:int = bMath.rand(0, 99);
var _local2:int = grid[_local1].x;
var _local3:int = grid[_local1].y;
for each (_local4 in grid) {
_local4.finish(_local2, _local3);
};
}
private function processBonusBlock(_arg1:fruitiblock):void{
switch (_arg1.bonusType){
case fruitiblock.BONUS_GOLDEN:
score.addPoints(2500);
sfx.playEffectGetGold();
break;
case fruitiblock.BONUS_EXTRA_TIME:
score.addPoints(1000);
sfx.playEffectGetExtraTime();
dispatchEvent(new Event(gridManager.EXTRA_TIME));
break;
};
}
}
}//package photonstorm.fruitiblox
Section 43
//mainMenu (photonstorm.fruitiblox.mainMenu)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.events.*;
import gs.*;
import mochi.as3.*;
import gs.easing.*;
import flash.net.*;
public class mainMenu extends Sprite {
private var sfx:soundFX;
private var finalPart:Boolean;
private var logo:MovieClip;
private var muteButton:MovieClip;
private var background:MovieClip;
private var gameType2Button:MovieClip;
private var stageCenterX:int;// = 280
private var startGameButton:MovieClip;
public var gameType:int;
private var stageCenterY:int;// = 210
private var howToPlayButton:MovieClip;
private var highscoresButton:MovieClip;
private var menu:Sprite;
private var moreGamesButton:MovieClip;
private var creditsButton:MovieClip;
private var gameType3Button:MovieClip;
public var showTutorial:Boolean;
private var gameType1Button:MovieClip;
public static const MAINMENU_STARTGAME:String = "mainMenuStartGame";
public function mainMenu():void{
}
private function runAppearTweens():void{
TweenMax.to(logo, 1, {y:90, ease:Bounce.easeOut});
TweenMax.to(muteButton, 1, {y:370, ease:Bounce.easeOut, delay:0.1});
TweenMax.to(startGameButton, 1, {x:160, ease:Elastic.easeOut});
TweenMax.to(howToPlayButton, 1, {x:160, ease:Elastic.easeOut, delay:0.1});
TweenMax.to(creditsButton, 1, {x:160, ease:Elastic.easeOut, delay:0.2});
TweenMax.to(moreGamesButton, 1, {x:160, ease:Elastic.easeOut, delay:0.3});
TweenMax.to(highscoresButton, 1, {x:160, ease:Elastic.easeOut, delay:0.4});
}
private function endHighscores():void{
background.gotoAndPlay("scores_off");
showMenu();
}
public function init(_arg1:soundFX):void{
sfx = _arg1;
menu = new Sprite();
background = new menuBackground();
background.x = stageCenterX;
background.y = stageCenterY;
logo = new logoMC();
logo.scaleX = 0.8;
logo.scaleY = 0.8;
startGameButton = new startGameButtonMC();
startGameButton.name = "start";
startGameButton.buttonMode = true;
startGameButton.useHandCursor = true;
howToPlayButton = new howToPlayButtonMC();
howToPlayButton.name = "how";
howToPlayButton.buttonMode = true;
howToPlayButton.useHandCursor = true;
creditsButton = new creditsButtonMC();
creditsButton.name = "credits";
creditsButton.buttonMode = true;
creditsButton.useHandCursor = true;
moreGamesButton = new moreGamesButtonMC();
moreGamesButton.name = "moregames";
moreGamesButton.buttonMode = true;
moreGamesButton.useHandCursor = true;
highscoresButton = new highscoresButtonMC();
highscoresButton.name = "highscores";
highscoresButton.buttonMode = true;
highscoresButton.useHandCursor = true;
gameType1Button = new gameTypeClassicButtonMC();
gameType1Button.name = "gametype1";
gameType1Button.buttonMode = true;
gameType1Button.useHandCursor = true;
gameType2Button = new gameType60SecondsButtonMC();
gameType2Button.name = "gametype2";
gameType2Button.buttonMode = true;
gameType2Button.useHandCursor = true;
gameType3Button = new gameTypeEndlessButtonMC();
gameType3Button.name = "gametype3";
gameType3Button.buttonMode = true;
gameType3Button.useHandCursor = true;
muteButton = new muteButtonMC();
muteButton.name = "mute";
muteButton.buttonMode = true;
muteButton.useHandCursor = true;
muteButton.scaleX = 0.75;
muteButton.scaleY = 0.75;
menu.addChild(background);
menu.addChild(logo);
menu.addChild(startGameButton);
menu.addChild(howToPlayButton);
menu.addChild(creditsButton);
menu.addChild(moreGamesButton);
menu.addChild(highscoresButton);
menu.addChild(muteButton);
menu.addChild(gameType1Button);
menu.addChild(gameType2Button);
menu.addChild(gameType3Button);
}
private function runGameTypeAppearTweens():void{
TweenMax.to(gameType1Button, 0.75, {x:(stageCenterX - 86), ease:Elastic.easeOut});
TweenMax.to(gameType2Button, 0.75, {x:(stageCenterX - 86), ease:Elastic.easeOut, delay:0.1});
TweenMax.to(gameType3Button, 0.75, {x:(stageCenterX - 86), ease:Elastic.easeOut, delay:0.2});
}
private function mouseOver(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
if (_arg1.currentTarget.name == "mute"){
if (sfx.isMuted){
_local2.gotoAndStop(11);
} else {
_local2.gotoAndStop(2);
};
} else {
_local2.gotoAndStop(2);
};
sfx.playEffectButtonOver();
}
private function startEvents():void{
startGameButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
startGameButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
startGameButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
howToPlayButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
howToPlayButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
howToPlayButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
creditsButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
creditsButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
creditsButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
moreGamesButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
moreGamesButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
moreGamesButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
highscoresButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
highscoresButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
highscoresButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
muteButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
muteButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
muteButton.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
gameType1Button.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
gameType1Button.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
gameType1Button.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
gameType2Button.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
gameType2Button.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
gameType2Button.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
gameType3Button.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
gameType3Button.addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
gameType3Button.addEventListener(MouseEvent.CLICK, mouseClick, false, 0, true);
}
private function sequenceEndLoop(_arg1:Event):void{
if ((((background.currentFrame == 120)) && ((finalPart == false)))){
background.stop();
finalPart = true;
sendStartGameEvent();
};
}
private function showHighscores():void{
background.gotoAndPlay("scores_on");
MochiScores.showLeaderboard({boardID:"02406281b30c1bf9", onClose:endHighscores, onError:endHighscores});
}
private function sendStartGameEvent():void{
removeChild(menu);
removeEventListener(Event.ENTER_FRAME, sequenceEndLoop);
dispatchEvent(new Event(mainMenu.MAINMENU_STARTGAME));
}
private function stopEvents():void{
startGameButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
startGameButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
startGameButton.removeEventListener(MouseEvent.CLICK, mouseClick);
howToPlayButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
howToPlayButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
howToPlayButton.removeEventListener(MouseEvent.CLICK, mouseClick);
creditsButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
creditsButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
creditsButton.removeEventListener(MouseEvent.CLICK, mouseClick);
moreGamesButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
moreGamesButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
moreGamesButton.removeEventListener(MouseEvent.CLICK, mouseClick);
highscoresButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
highscoresButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
highscoresButton.removeEventListener(MouseEvent.CLICK, mouseClick);
muteButton.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
muteButton.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
muteButton.removeEventListener(MouseEvent.CLICK, mouseClick);
gameType1Button.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
gameType1Button.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
gameType1Button.removeEventListener(MouseEvent.CLICK, mouseClick);
gameType2Button.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
gameType2Button.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
gameType2Button.removeEventListener(MouseEvent.CLICK, mouseClick);
gameType3Button.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
gameType3Button.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
gameType3Button.removeEventListener(MouseEvent.CLICK, mouseClick);
}
private function endCredits(_arg1):void{
TweenMax.killDelayedCallsTo(endCredits);
stage.removeEventListener(MouseEvent.CLICK, endCredits);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, endCredits);
background.gotoAndPlay("credits_off");
showMenu();
}
private function placeOffscreen():void{
logo.x = 160;
logo.y = -400;
muteButton.x = 536;
muteButton.y = -60;
var _local1 = 46;
startGameButton.x = 700;
startGameButton.y = 200;
howToPlayButton.x = 700;
howToPlayButton.y = (startGameButton.y + _local1);
creditsButton.x = 700;
creditsButton.y = (howToPlayButton.y + _local1);
moreGamesButton.x = 700;
moreGamesButton.y = (creditsButton.y + _local1);
highscoresButton.x = 700;
highscoresButton.y = (moreGamesButton.y + _local1);
gameType1Button.x = 700;
gameType1Button.y = 124;
gameType2Button.x = 700;
gameType2Button.y = 233;
gameType3Button.x = 700;
gameType3Button.y = 343;
startGameButton.gotoAndStop(1);
howToPlayButton.gotoAndStop(1);
creditsButton.gotoAndStop(1);
moreGamesButton.gotoAndStop(1);
highscoresButton.gotoAndStop(1);
gameType1Button.gotoAndStop(1);
gameType2Button.gotoAndStop(1);
gameType3Button.gotoAndStop(1);
}
private function runGameTypeVanishTweens():void{
TweenMax.to(gameType1Button, 0.25, {x:-200, ease:Linear.easeOut});
TweenMax.to(gameType2Button, 0.25, {x:-200, ease:Linear.easeOut, delay:0.05});
TweenMax.to(gameType3Button, 0.25, {x:-200, ease:Linear.easeOut, delay:0.1});
}
private function mouseClick(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.name){
case "start":
sfx.playEffectButtonClick();
runVanishTweens(showGameType);
break;
case "how":
sfx.playEffectButtonClick();
showTutorial = true;
runVanishTweens(showGameType);
break;
case "credits":
sfx.playEffectButtonClick();
runVanishTweens(showCredits);
break;
case "moregames":
showMoreGames();
break;
case "highscores":
sfx.playEffectButtonClick();
runVanishTweens(showHighscores);
break;
case "mute":
if (sfx.isMuted){
sfx.muteToggle();
muteButton.gotoAndStop(2);
sfx.playEffectButtonClick();
} else {
sfx.muteToggle();
muteButton.gotoAndStop(11);
};
break;
case "gametype1":
sfx.playEffectButtonClick();
gameType = 1;
startGame();
break;
case "gametype2":
sfx.playEffectButtonClick();
gameType = 2;
startGame();
break;
case "gametype3":
sfx.playEffectButtonClick();
gameType = 3;
startGame();
break;
};
}
private function showCredits():void{
background.gotoAndPlay("credits_on");
stage.addEventListener(MouseEvent.CLICK, endCredits, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, endCredits, false, 0, true);
TweenMax.delayedCall(10, endCredits, [false]);
}
public function go():void{
showTutorial = false;
startEvents();
if (sfx.isMuted){
muteButton.gotoAndStop(20);
} else {
muteButton.gotoAndStop(1);
};
background.gotoAndPlay(1);
finalPart = false;
placeOffscreen();
addChild(menu);
sfx.playMusicIntro();
runAppearTweens();
}
private function showGameType():void{
background.gotoAndPlay("gametype_on");
runGameTypeAppearTweens();
}
private function showMoreGames():void{
navigateToURL(new URLRequest("http://www.candystand.com"), "_blank");
}
private function mouseOut(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
_local2.play();
}
private function startGame():void{
stopEvents();
addEventListener(Event.ENTER_FRAME, sequenceEndLoop, false, 0, true);
background.gotoAndPlay("start_game");
runGameTypeVanishTweens();
}
private function runVanishTweens(_arg1:Function):void{
TweenMax.to(logo, 0.5, {y:-400, ease:Linear.easeOut, overwrite:true});
TweenMax.to(muteButton, 0.25, {y:-60, ease:Linear.easeOut, overwrite:true, delay:0.1});
TweenMax.to(startGameButton, 0.25, {x:700, ease:Linear.easeOut, overwrite:true});
TweenMax.to(howToPlayButton, 0.25, {x:700, ease:Linear.easeOut, overwrite:true, delay:0.05});
TweenMax.to(creditsButton, 0.25, {x:700, ease:Linear.easeOut, overwrite:true, delay:0.1});
TweenMax.to(moreGamesButton, 0.25, {x:700, ease:Linear.easeOut, overwrite:true, delay:0.15});
TweenMax.to(highscoresButton, 0.25, {x:700, ease:Linear.easeOut, overwrite:true, delay:0.2, onComplete:_arg1});
}
private function showMenu():void{
placeOffscreen();
runAppearTweens();
}
}
}//package photonstorm.fruitiblox
Section 44
//soundFX (photonstorm.fruitiblox.soundFX)
package photonstorm.fruitiblox {
import flash.display.*;
import flash.media.*;
public class soundFX extends Sprite {
private var effectGetGold:Sound;
private var effectGetRect:Sound;
private var globalTransform:SoundTransform;
private var clockChannel:SoundChannel;
private var effectButtonOver:Sound;
private var effectGameOver:Sound;
private var effectButtonClick:Sound;
private var musicChannel:SoundChannel;
public var clockTicking:Boolean;// = false
private var effectGetFullRect:Sound;
private var effectReveal:Sound;
private var effectCountDown:Sound;
private var musicIntro:Sound;
public var musicPlaying:Boolean;// = false
private var effectMakeBonus:Sound;
private var fxChannel:SoundChannel;
private var effectRandomiseButton:Sound;
private var bonusChannel:SoundChannel;
private var effectCancelRect:Sound;
private var effectClick:Sound;
private var effectGetExtraTime:Sound;
private static var soundMuted:Boolean = false;
private static var musicMuted:Boolean = false;
public function soundFX(){
musicIntro = new titleMusicMP3();
effectGameOver = new gameOverWAV();
effectReveal = new revealWAV();
effectRandomiseButton = new randButtonWAV();
effectButtonOver = new buttonOverWAV();
effectButtonClick = new buttonClickWAV();
effectGetFullRect = new getFullRectWAV();
effectGetRect = new getRectWAV();
effectGetGold = new getGoldWAV();
effectGetExtraTime = new getExtraTimeWAV();
effectCountDown = new countDownWAV();
effectClick = new clickWAV();
effectCancelRect = new cancelRectWAV();
effectMakeBonus = new makeBonusWAV();
musicChannel = new SoundChannel();
clockChannel = new SoundChannel();
fxChannel = new SoundChannel();
bonusChannel = new SoundChannel();
globalTransform = new SoundTransform();
super();
}
public function playEffectGetFullRect():void{
if (soundMuted == false){
bonusChannel = effectGetFullRect.play(0, 0, globalTransform);
};
}
public function playMusicIntro():void{
if ((((soundMuted == false)) && ((musicPlaying == false)))){
musicChannel = musicIntro.play(0, int.MAX_VALUE, globalTransform);
musicPlaying = true;
};
}
public function playEffectCancelBlock():void{
if (soundMuted == false){
fxChannel = effectCancelRect.play(0, 0, globalTransform);
};
}
public function mute():void{
soundMuted = true;
SoundMixer.stopAll();
}
public function playEffectClick():void{
if (soundMuted == false){
fxChannel = effectClick.play(0, 0, globalTransform);
};
}
public function playEffectGetGold():void{
if (soundMuted == false){
bonusChannel = effectGetGold.play(0, 0, globalTransform);
};
}
public function playEffectReveal():void{
if (soundMuted == false){
bonusChannel = effectReveal.play(0, 0, globalTransform);
};
}
public function playEffectGetRect():void{
if (soundMuted == false){
fxChannel = effectGetRect.play(0, 0, globalTransform);
};
}
public function playEffectGetExtraTime():void{
if (soundMuted == false){
bonusChannel = effectGetExtraTime.play(0, 0, globalTransform);
};
}
public function muteToggle():void{
if (soundMuted){
unMute();
} else {
mute();
};
}
public function playEffectButtonClick():void{
if (soundMuted == false){
fxChannel = effectButtonClick.play(0, 0, globalTransform);
};
}
public function unMute():void{
soundMuted = false;
playMusicIntro();
}
public function stopEffectCountDown():void{
if ((((soundMuted == false)) && (clockTicking))){
clockChannel.stop();
clockTicking = false;
};
}
public function get isMuted():Boolean{
return (soundMuted);
}
public function stopMusicIntro():void{
musicChannel.stop();
musicPlaying = false;
}
public function playEffectButtonOver():void{
if (soundMuted == false){
fxChannel = effectButtonOver.play(0, 0, globalTransform);
};
}
public function playEffectCountDown():void{
if ((((soundMuted == false)) && ((clockTicking == false)))){
clockTicking = true;
clockChannel = effectCountDown.play(0, 10, globalTransform);
};
}
public function playEffectGameOver():void{
if (soundMuted == false){
bonusChannel = effectGameOver.play(0, 0, globalTransform);
};
}
public function playEffectBonusAppears():void{
if (soundMuted == false){
bonusChannel = effectMakeBonus.play(0, 0, globalTransform);
};
}
public function playEffectRandomise():void{
if (soundMuted == false){
fxChannel = effectRandomiseButton.play(0, 0, globalTransform);
};
}
}
}//package photonstorm.fruitiblox
Section 45
//BlitzKeyboard (pixelblitz.core.BlitzKeyboard)
package pixelblitz.core {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class BlitzKeyboard extends EventDispatcher {
private var keyboardDispatchEvents:Array;
private var waitingForKey:Boolean;
private var waitKeyType:uint;
private var checkKeyboardCalls:Boolean;
private var keysHeldDown:uint;
private var waitKeyEvent:Event;
private var isKeyDown:Boolean;
private var keyboardPollTimer:uint;
private var checkKeyboardDispatchEvents:Boolean;
private var keyboardCalls:Array;
private var timeOfPreviousKeyEvent:uint;
public var recordKeyHits:Boolean;
private var keyboardHits:Array;
private var lastKeyLocation:uint;
private var timeOfLastKeyEvent:uint;
private var keyboardPollDelay:uint;
private var keyboardEvents:Array;
private var lastKeyCode:uint;
private var keyboardDisplayObject:DisplayObject;
public static const ENHANCED_VOLUME:uint = 224;
public static const LEFT:uint = 37;
public static const ENHANCED_BASS:uint = 227;
public static const LEFT_SHIFT:uint = 1000;
public static const LEFT_WINDOWS_KEY:uint = 91;
public static const NUMPAD_DECIMAL:uint = 110;
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const MINUS:uint = 189;
public static const Q:uint = 81;
public static const PAGE_DOWN:uint = 34;
public static const S:uint = 83;
public static const T:uint = 84;
public static const U:uint = 85;
public static const P:uint = 80;
public static const X:uint = 88;
public static const R:uint = 82;
public static const ALTERNATE:uint = 18;
public static const QUOTE:uint = 222;
public static const V:uint = 86;
public static const PRINT_SCREEN:uint = 124;
public static const BACKSPACE:uint = 8;
public static const Y:uint = 89;
public static const Z:uint = 90;
public static const SHIFT:uint = 16;
public static const PAGE_UP:uint = 33;
public static const NUM_LOCK:uint = 144;
public static const W:uint = 87;
public static const RIGHT_SHIFT:uint = 1001;
public static const ENHANCED_VOLUME_UP:uint = 233;
public static const ESCAPE:uint = 27;
public static const NUMPAD_ADD:uint = 107;
public static const SEMICOLON:uint = 186;
public static const ENHANCED_BASS_INCREASE:uint = 338;
public static const UP:uint = 38;
public static const LEFTBRACKET:uint = 219;
public static const DOWN:uint = 40;
public static const F2:uint = 113;
public static const F3:uint = 114;
public static const F4:uint = 115;
public static const F5:uint = 116;
public static const APPLICATION_KEY:uint = 93;
public static const F7:uint = 118;
public static const F1:uint = 112;
public static const COMMA:uint = 188;
public static const F6:uint = 117;
public static const ENTER:uint = 13;
public static const F8:uint = 119;
public static const END:uint = 35;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_5:uint = 53;
public static const INSERT:uint = 45;
public static const F9:uint = 120;
public static const NUMBER_9:uint = 57;
public static const NUMBER_4:uint = 52;
public static const NUMBER_6:uint = 54;
public static const NUMBER_7:uint = 55;
public static const NUMBER_0:uint = 48;
public static const NUMBER_1:uint = 49;
public static const NUMBER_8:uint = 56;
public static const RIGHT_CTRL:uint = 1003;
public static const BACKSLASH:uint = 220;
public static const RIGHT_WINDOWS_KEY:uint = 92;
public static const ENHANCED_PREV_TRACK:uint = 182;
public static const NUMPAD_MULTIPLY:uint = 106;
public static const RIGHT_ALT:uint = 1005;
public static const BREAK:uint = 19;
public static const ENHANCED_BASS_BOOST:uint = 229;
public static const F10:uint = 121;
public static const F11:uint = 122;
public static const F12:uint = 123;
public static const F13:uint = 124;
public static const F14:uint = 125;
public static const SPACE:uint = 32;
public static const HOME:uint = 36;
public static const F15:uint = 126;
public static const ENHANCED_BASS_DECREASE:uint = 339;
public static const ENHANCED_TREBLE_INCREASE:uint = 340;
public static const RIGHTBRACKET:uint = 221;
public static const EQUAL:uint = 187;
public static const WAITKEY_DOWN:uint = 1;
public static const COMMAND:uint = 19;
public static const ENHANCED_STOP:uint = 183;
public static const CONTROL:uint = 17;
public static const NUMPAD_ENTER:uint = 108;
public static const ENHANCED_NEXT_TRACK:uint = 181;
public static const ENHANCED_MUTE:uint = 226;
public static const ENHANCED_TREBLE:uint = 228;
public static const NUMPAD:uint = 21;
public static const LEFT_ALT:uint = 1004;
public static const WAITKEY_RELEASE:uint = 2;
public static const SCROLL_LOCK:uint = 145;
public static const ENHANCED_VOLUME_DOWN:uint = 234;
public static const ENHANCED_TREBLE_DECREASE:uint = 341;
public static const SLASH:uint = 191;
public static const ENHANCED_PLAY_PAUSE:uint = 205;
public static const TAB:uint = 9;
public static const LEFT_CTRL:uint = 1002;
public static const DELETE:uint = 46;
public static const NUMPAD_DIVIDE:uint = 111;
public static const NUMPAD_1:uint = 97;
public static const NUMPAD_2:uint = 98;
public static const NUMPAD_3:uint = 99;
public static const NUMPAD_4:uint = 100;
public static const NUMPAD_5:uint = 101;
public static const NUMPAD_6:uint = 102;
public static const NUMPAD_8:uint = 104;
public static const NUMPAD_9:uint = 105;
public static const PERIOD:uint = 190;
public static const CAPS_LOCK:uint = 20;
public static const NUMPAD_0:uint = 96;
public static const BACKQUOTE:uint = 192;
public static const NUMPAD_7:uint = 103;
public static const NUMPAD_SUBTRACT:uint = 109;
public static const RIGHT:uint = 39;
public function BlitzKeyboard():void{
}
private function startListeningKeyboard(_arg1:Event):void{
keyboardDisplayObject.addEventListener(Event.ENTER_FRAME, mainLoop, false, 0, true);
keyboardDisplayObject.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent, false, 0, true);
keyboardDisplayObject.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent, false, 0, true);
}
public function stop():void{
stopListeningKeyboard(new Event(Event.REMOVED_FROM_STAGE));
}
public function addKeyCall(_arg1:Function, _arg2:Boolean, _arg3:uint, _arg4:uint=0, _arg5:uint=0):void{
var _local6:uint = uint(((_arg3.toString() + _arg4.toString()) + _arg5.toString()));
keyboardCalls[_local6] = [_arg1, _arg2, false, _arg3, _arg4, _arg5];
if (checkKeyboardCalls == false){
checkKeyboardCalls = true;
};
}
public function get anyKeyDown():Boolean{
return (isKeyDown);
}
public function flushKeys():void{
keyboardEvents = new Array();
keyboardHits = new Array();
lastKeyCode = 0;
lastKeyLocation = 0;
waitingForKey = false;
isKeyDown = false;
keysHeldDown = 0;
timeOfLastKeyEvent = 0;
timeOfPreviousKeyEvent = 0;
}
public function isDown(_arg1:uint, _arg2:uint=0, _arg3:uint=0):Boolean{
var _local4:Boolean = Boolean(keyboardEvents[_arg1]);
if ((((_arg2 > 0)) && (_local4))){
_local4 = Boolean(keyboardEvents[_arg2]);
};
if ((((_arg3 > 0)) && (_local4))){
_local4 = Boolean(keyboardEvents[_arg3]);
};
return (_local4);
}
public function get keyCode():uint{
return (lastKeyCode);
}
public function removeKeyEvent(_arg1:Event, _arg2:uint, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint = uint(((_arg2.toString() + _arg3.toString()) + _arg4.toString()));
keyboardDispatchEvents.splice(_local5, 1);
if (keyboardDispatchEvents.length == 0){
checkKeyboardDispatchEvents = false;
};
}
public function init(_arg1:DisplayObject, _arg2:Boolean=false):void{
keyboardDisplayObject = _arg1;
recordKeyHits = _arg2;
flushKeys();
reset(false);
}
public function waitKey(_arg1:Event, _arg2:uint):Boolean{
if ((((_arg2 == 1)) || ((_arg2 == 2)))){
waitingForKey = true;
waitKeyType = _arg2;
return (true);
};
waitingForKey = false;
return (false);
}
public function keyHit(_arg1:uint):uint{
var _local2:uint = uint(keyboardHits[_arg1]);
keyboardHits[_arg1] = 0;
return (_local2);
}
private function sendWaitKeyEvent():void{
waitingForKey = false;
dispatchEvent(waitKeyEvent);
}
public function removeKeyCall(_arg1:Function, _arg2:uint, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint = uint(((_arg2.toString() + _arg3.toString()) + _arg4.toString()));
keyboardCalls.splice(_local5, 1);
if (keyboardCalls.length == 0){
checkKeyboardCalls = false;
};
}
public function get keyLocation():uint{
return (lastKeyLocation);
}
public function addKeyEvent(_arg1:Event, _arg2:Boolean, _arg3:uint, _arg4:uint=0, _arg5:uint=0):void{
var _local6:uint = uint(((_arg3.toString() + _arg4.toString()) + _arg5.toString()));
keyboardDispatchEvents[_local6] = [_arg1, _arg2, false, _arg3, _arg4, _arg5, _local6];
if (checkKeyboardDispatchEvents == false){
checkKeyboardDispatchEvents = true;
};
}
public function set keyRate(_arg1:uint):void{
keyboardPollDelay = _arg1;
keyboardPollTimer = 0;
}
public function get keysDown():uint{
return (keysHeldDown);
}
public function reset(_arg1:Boolean=true):void{
if (_arg1){
flushKeys();
};
checkKeyboardDispatchEvents = false;
keyboardDispatchEvents = new Array();
checkKeyboardCalls = false;
keyboardCalls = new Array();
}
public function get keyRate():uint{
return (keyboardPollDelay);
}
private function keyUpEvent(_arg1:KeyboardEvent):void{
keyboardEvents[_arg1.keyCode] = false;
isKeyDown = false;
lastKeyCode = 0;
lastKeyLocation = _arg1.keyLocation;
keysHeldDown--;
timeOfLastKeyEvent = getTimer();
if (recordKeyHits){
var _local2 = keyboardHits;
var _local3 = _arg1.keyCode;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
};
if (((waitingForKey) && ((waitKeyType == 2)))){
sendWaitKeyEvent();
};
}
public function isUp(_arg1:uint, _arg2:uint=0, _arg3:uint=0):Boolean{
var _local4:Boolean = Boolean(keyboardEvents[_arg1]);
if ((((_arg2 > 0)) && ((_local4 == false)))){
_local4 = Boolean(keyboardEvents[_arg2]);
};
if ((((_arg3 > 0)) && ((_local4 == false)))){
_local4 = Boolean(keyboardEvents[_arg3]);
};
if (_local4){
return (false);
};
return (true);
}
public function go():void{
if (keyboardDisplayObject.stage !== null){
startListeningKeyboard(new Event(Event.ADDED_TO_STAGE));
} else {
keyboardDisplayObject.addEventListener(Event.ADDED_TO_STAGE, startListeningKeyboard, false, 0, true);
keyboardDisplayObject.addEventListener(Event.REMOVED_FROM_STAGE, stopListeningKeyboard, false, 0, true);
};
}
private function stopListeningKeyboard(_arg1:Event):void{
keyboardDisplayObject.removeEventListener(Event.ENTER_FRAME, mainLoop);
keyboardDisplayObject.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
keyboardDisplayObject.removeEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
}
private function keyDownEvent(_arg1:KeyboardEvent):void{
keyboardEvents[_arg1.keyCode] = true;
isKeyDown = true;
lastKeyCode = _arg1.keyCode;
lastKeyLocation = _arg1.keyLocation;
keysHeldDown++;
timeOfLastKeyEvent = getTimer();
if (((waitingForKey) && ((waitKeyType == 1)))){
sendWaitKeyEvent();
};
}
private function mainLoop(_arg1:Event):void{
var _local2:Array;
var _local3:Array;
if (timeOfLastKeyEvent == timeOfPreviousKeyEvent){
return;
};
timeOfPreviousKeyEvent = timeOfLastKeyEvent;
if (keyboardPollDelay > 0){
if (getTimer() < keyboardPollTimer){
return;
};
keyboardPollTimer = (getTimer() + keyboardPollDelay);
};
if (checkKeyboardDispatchEvents){
for each (_local2 in keyboardDispatchEvents) {
if (_local2[1]){
if (_local2[2]){
if (isUp(_local2[3], _local2[4], _local2[5])){
dispatchEvent(_local2[0]);
keyboardDispatchEvents[_local2[6]][2] = false;
};
} else {
if (isDown(_local2[3], _local2[4], _local2[5])){
keyboardDispatchEvents[_local2[6]][2] = true;
};
};
} else {
if (isDown(_local2[3], _local2[4], _local2[5])){
dispatchEvent(_local2[0]);
};
};
};
};
if (checkKeyboardCalls){
for each (_local3 in keyboardCalls) {
if (_local3[1]){
if (_local3[2]){
if (isUp(_local3[3], _local3[4], _local3[5])){
_local3[0].call();
keyboardCalls[_local3[6]][2] = false;
};
} else {
if (isDown(_local3[3], _local3[4], _local3[5])){
keyboardCalls[_local3[6]][2] = true;
};
};
} else {
if (isDown(_local3[3], _local3[4], _local3[5])){
_local3[0].call();
};
};
};
};
}
}
}//package pixelblitz.core
Section 46
//BlitzMath (pixelblitz.utils.BlitzMath)
package pixelblitz.utils {
public class BlitzMath {
private var mr:uint;// = 0
private var cosTable:Array;
public var getrandmax:int;// = 2147483647
private var sinTable:Array;
private static const DEGTORAD:Number = 0.0174532925199433;
private static const RADTODEG:Number = 57.2957795130823;
private static var coefficient1:Number = 0.785398163397448;
public function getSinTable():Array{
return (sinTable);
}
public function abs(_arg1:int):int{
return (((_arg1 ^ (_arg1 >> 31)) - (_arg1 >> 31)));
}
public function isEven(_arg1:Number):Boolean{
return (((_arg1 & 1) == 0));
}
public function sinCosGenerator(_arg1:uint, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1):void{
var _local5:Number = _arg2;
var _local6:Number = _arg3;
var _local7:Number = ((_arg4 * Math.PI) / _arg1);
cosTable = new Array();
sinTable = new Array();
var _local8:uint;
while (_local8 < _arg1) {
_local6 = (_local6 - (_local5 * _local7));
_local5 = (_local5 + (_local6 * _local7));
cosTable.push(_local6);
sinTable.push(_local5);
_local8++;
};
}
public function powerOf2mod(_arg1:uint, _arg2:uint):uint{
return ((_arg1 & (_arg2 - 1)));
}
public function asDegrees(_arg1:Number):Number{
return ((_arg1 * RADTODEG));
}
public function sqrt(_arg1:Number):Number{
var _local4:Number;
var _local5:Number;
if (isNaN(_arg1)){
return (NaN);
};
var _local2:Number = 0.002;
var _local3:Number = (_arg1 * 0.25);
if (_arg1 == 0){
return (0);
};
do {
_local5 = (_arg1 / _local3);
_local3 = ((_local3 + _local5) * 0.5);
_local4 = (_local3 - _local5);
if (_local4 < 0){
_local4 = -(_local4);
};
} while (_local4 > _local2);
return (_local3);
}
public function chanceRoll(_arg1:uint=50):Boolean{
if (_arg1 <= 0){
return (false);
};
if (_arg1 >= 100){
return (true);
};
if ((Math.random() * 100) >= _arg1){
return (true);
};
return (false);
}
public function atan2(_arg1:Number, _arg2:Number):Number{
var _local5:Number;
var _local6:Number;
var _local3:Number = _arg1;
var _local4:Number = (3 * coefficient1);
if (_local3 < 0){
_local3 = -(_local3);
};
if (_arg2 >= 0){
_local5 = ((_arg2 - _local3) / (_arg2 + _local3));
_local6 = (coefficient1 - (coefficient1 * _local5));
} else {
_local5 = ((_arg2 + _local3) / (_local3 - _arg2));
_local6 = (_local4 - (coefficient1 * _local5));
};
return (((_arg1 < 0)) ? -(_local6) : _local6);
}
public function rand(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Array=null):int{
var _local4:int;
if (isNaN(_arg1)){
_arg1 = 0;
};
if (isNaN(_arg2)){
_arg2 = getrandmax;
};
if (_arg1 === _arg2){
return (_arg1);
};
if (_arg3 != null){
_arg3.sort(Array.NUMERIC);
do {
if (_arg1 < _arg2){
_local4 = (_arg1 + (Math.random() * _arg2));
} else {
_local4 = (_arg2 + (Math.random() * _arg1));
};
} while (_arg3.indexOf(_local4) >= 0);
return (_local4);
//unresolved jump
};
if (_arg1 < _arg2){
return ((_arg1 + (Math.random() * _arg2)));
};
return ((_arg2 + (Math.random() * _arg1)));
}
public function maxAdd(_arg1:int, _arg2:int, _arg3:int):int{
_arg1 = (_arg1 + _arg2);
if (_arg1 > _arg3){
_arg1 = _arg3;
};
return (_arg1);
}
public function randFloat(_arg1:Number=NaN, _arg2:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = 0;
};
if (isNaN(_arg2)){
_arg2 = getrandmax;
};
if (_arg1 === _arg2){
return (_arg1);
};
if (_arg1 < _arg2){
return ((_arg1 + (Math.random() * _arg2)));
};
return ((_arg2 + (Math.random() * _arg1)));
}
public function asRadians(_arg1:Number):Number{
return ((_arg1 * DEGTORAD));
}
public function miniRand():int{
var _local1:uint = mr;
_local1++;
_local1 = (_local1 * 75);
_local1 = (_local1 % 65537);
_local1--;
mr++;
if (mr == 65536){
mr = 0;
};
return (_local1);
}
public function getCosTable():Array{
return (cosTable);
}
public function wrapValue(_arg1:int, _arg2:int, _arg3:int):int{
var _local4:int;
if ((_arg1 + _arg2) > _arg3){
_local4 = ((_arg1 + _arg2) - _arg3);
} else {
_local4 = (_arg1 + _arg2);
};
return (_local4);
}
}
}//package pixelblitz.utils
Section 47
//achievementPanelMC (achievementPanelMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class achievementPanelMC extends MovieClip {
public var achievementNumber:TextField;
public var achievementTitle:TextField;
}
}//package
Section 48
//aquaButton (aquaButton)
package {
import flash.display.*;
public dynamic class aquaButton extends MovieClip {
}
}//package
Section 49
//blueBlock (blueBlock)
package {
import flash.display.*;
public dynamic class blueBlock extends MovieClip {
}
}//package
Section 50
//blueButton (blueButton)
package {
import flash.display.*;
public dynamic class blueButton extends MovieClip {
}
}//package
Section 51
//blueColourBar (blueColourBar)
package {
import flash.display.*;
public dynamic class blueColourBar extends MovieClip {
}
}//package
Section 52
//blueSplat (blueSplat)
package {
import flash.display.*;
public dynamic class blueSplat extends MovieClip {
}
}//package
Section 53
//blueSquish (blueSquish)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class blueSquish extends MovieClip {
public function blueSquish(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package
Section 54
//bonusBackButtonMC (bonusBackButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class bonusBackButtonMC extends MovieClip {
public function bonusBackButtonMC(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 55
//bonusButtonMC (bonusButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class bonusButtonMC extends MovieClip {
public function bonusButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 56
//bonusListingMC (bonusListingMC)
package {
import flash.display.*;
public dynamic class bonusListingMC extends MovieClip {
}
}//package
Section 57
//buttonClickWAV (buttonClickWAV)
package {
import flash.media.*;
public dynamic class buttonClickWAV extends Sound {
}
}//package
Section 58
//buttonOverWAV (buttonOverWAV)
package {
import flash.media.*;
public dynamic class buttonOverWAV extends Sound {
}
}//package
Section 59
//cancelRectWAV (cancelRectWAV)
package {
import flash.media.*;
public dynamic class cancelRectWAV extends Sound {
}
}//package
Section 60
//clickWAV (clickWAV)
package {
import flash.media.*;
public dynamic class clickWAV extends Sound {
}
}//package
Section 61
//colourToolTipMC (colourToolTipMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class colourToolTipMC extends MovieClip {
public var tipText:TextField;
}
}//package
Section 62
//countDownWAV (countDownWAV)
package {
import flash.media.*;
public dynamic class countDownWAV extends Sound {
}
}//package
Section 63
//creditsButtonMC (creditsButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class creditsButtonMC extends MovieClip {
public function creditsButtonMC(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 64
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 65
//fruitiblox (fruitiblox)
package {
import flash.display.*;
import flash.events.*;
import photonstorm.fruitiblox.*;
import mochi.as3.*;
public class fruitiblox extends Sprite {
private var mochiMC:MovieClip;
private var startup:MovieClip;
public function fruitiblox():void{
mochiMC = new MovieClip();
startup = new sponsorStartup();
super();
var _local1 = "4b0e13612dc82ee5";
stage.scaleMode = StageScaleMode.NO_BORDER;
stage.align = StageAlign.TOP_LEFT;
stage.focus = null;
startup.scaleX = 0.85;
startup.scaleY = 0.85;
startup.gotoAndStop(1);
addChild(mochiMC);
MochiAd.showPreGameAd({clip:mochiMC, id:"4b0e13612dc82ee5", res:"560x420", ad_finished:showCandyStandSplash});
}
private function startupLoop(_arg1:Event):void{
var _local2:gameEngine;
if (startup.currentFrame >= 214){
removeEventListener(Event.ENTER_FRAME, startupLoop);
removeChild(startup);
_local2 = new gameEngine();
addChild(_local2);
};
}
public function showCandyStandSplash():void{
startup.x = (560 / 2);
startup.y = (420 / 2);
addChild(startup);
addEventListener(Event.ENTER_FRAME, startupLoop, false, 0, true);
startup.gotoAndPlay(1);
}
}
}//package
Section 66
//gameBackgroundMC (gameBackgroundMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameBackgroundMC extends MovieClip {
public var scoreLabel:TextField;
public var timeLabel:TextField;
public var colourMeterHolder:MovieClip;
public var bonusLabel:TextField;
public var timeText:TextField;
public var scoreText:TextField;
}
}//package
Section 67
//gameBoardBackgroundMC (gameBoardBackgroundMC)
package {
import flash.display.*;
public dynamic class gameBoardBackgroundMC extends MovieClip {
}
}//package
Section 68
//gameOverMC (gameOverMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameOverMC extends MovieClip {
public var favColourText:TextField;
public var scoreText:TextField;
public function gameOverMC(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package
Section 69
//gameOverMenuMC (gameOverMenuMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameOverMenuMC extends MovieClip {
public function gameOverMenuMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 70
//gameOverPlayAgainMC (gameOverPlayAgainMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameOverPlayAgainMC extends MovieClip {
public function gameOverPlayAgainMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 71
//gameOverSubmitScoreMC (gameOverSubmitScoreMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameOverSubmitScoreMC extends MovieClip {
public function gameOverSubmitScoreMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 72
//gameOverWAV (gameOverWAV)
package {
import flash.media.*;
public dynamic class gameOverWAV extends Sound {
}
}//package
Section 73
//gameType60SecondsButtonMC (gameType60SecondsButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameType60SecondsButtonMC extends MovieClip {
public function gameType60SecondsButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 74
//gameTypeClassicButtonMC (gameTypeClassicButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameTypeClassicButtonMC extends MovieClip {
public function gameTypeClassicButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 75
//gameTypeEndlessButtonMC (gameTypeEndlessButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class gameTypeEndlessButtonMC extends MovieClip {
public function gameTypeEndlessButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 76
//getExtraTimeWAV (getExtraTimeWAV)
package {
import flash.media.*;
public dynamic class getExtraTimeWAV extends Sound {
}
}//package
Section 77
//getFullRectWAV (getFullRectWAV)
package {
import flash.media.*;
public dynamic class getFullRectWAV extends Sound {
}
}//package
Section 78
//getGoldWAV (getGoldWAV)
package {
import flash.media.*;
public dynamic class getGoldWAV extends Sound {
}
}//package
Section 79
//getRectWAV (getRectWAV)
package {
import flash.media.*;
public dynamic class getRectWAV extends Sound {
}
}//package
Section 80
//greenBlock (greenBlock)
package {
import flash.display.*;
public dynamic class greenBlock extends MovieClip {
}
}//package
Section 81
//greenButton (greenButton)
package {
import flash.display.*;
public dynamic class greenButton extends MovieClip {
}
}//package
Section 82
//greenColourBar (greenColourBar)
package {
import flash.display.*;
public dynamic class greenColourBar extends MovieClip {
}
}//package
Section 83
//greenSplat (greenSplat)
package {
import flash.display.*;
public dynamic class greenSplat extends MovieClip {
}
}//package
Section 84
//greenSquish (greenSquish)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class greenSquish extends MovieClip {
public function greenSquish(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package
Section 85
//helpWindowMC (helpWindowMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class helpWindowMC extends MovieClip {
public var nextButton:MovieClip;
public var noButton:MovieClip;
public var yesButton:MovieClip;
public function helpWindowMC(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 31, frame32);
}
function frame32(){
stop();
}
public function yesClick(_arg1:MouseEvent):void{
removeEvents();
gotoAndPlay(11);
}
function frame1(){
noButton.gotoAndStop(1);
noButton.buttonMode = true;
noButton.useHandCursor = true;
noButton.addEventListener(MouseEvent.CLICK, noClick, false, 0, true);
noButton.addEventListener(MouseEvent.MOUSE_OVER, doMouseOver, false, 0, true);
noButton.addEventListener(MouseEvent.MOUSE_OUT, doMouseOut, false, 0, true);
yesButton.gotoAndStop(1);
yesButton.buttonMode = true;
yesButton.useHandCursor = true;
yesButton.addEventListener(MouseEvent.CLICK, yesClick, false, 0, true);
yesButton.addEventListener(MouseEvent.MOUSE_OVER, doMouseOver, false, 0, true);
yesButton.addEventListener(MouseEvent.MOUSE_OUT, doMouseOut, false, 0, true);
stop();
}
public function noClick(_arg1:MouseEvent):void{
removeEvents();
gotoAndPlay(2);
}
function frame20(){
nextButton.gotoAndStop(1);
nextButton.buttonMode = true;
nextButton.useHandCursor = true;
nextButton.addEventListener(MouseEvent.CLICK, doNextClick, false, 0, true);
nextButton.addEventListener(MouseEvent.MOUSE_OVER, doNextMouseOver, false, 0, true);
nextButton.addEventListener(MouseEvent.MOUSE_OUT, doNextMouseOut, false, 0, true);
stop();
}
function frame10(){
stop();
}
public function doMouseOver(_arg1:MouseEvent):void{
if (_arg1.currentTarget.name == "noButton"){
noButton.gotoAndStop(2);
};
if (_arg1.currentTarget.name == "yesButton"){
yesButton.gotoAndStop(2);
};
}
public function doNextClick(_arg1:MouseEvent):void{
gotoAndStop((this.currentFrame + 1));
}
public function doMouseOut(_arg1:MouseEvent):void{
if (_arg1.currentTarget.name == "noButton"){
noButton.play();
};
if (_arg1.currentTarget.name == "yesButton"){
yesButton.play();
};
}
public function doNextMouseOut(_arg1:MouseEvent):void{
nextButton.play();
}
public function doNextMouseOver(_arg1:MouseEvent):void{
nextButton.gotoAndStop(2);
}
public function removeEvents():void{
yesButton.removeEventListener(MouseEvent.CLICK, yesClick);
yesButton.removeEventListener(MouseEvent.MOUSE_OVER, doMouseOver);
yesButton.removeEventListener(MouseEvent.MOUSE_OUT, doMouseOut);
noButton.removeEventListener(MouseEvent.CLICK, noClick);
noButton.removeEventListener(MouseEvent.MOUSE_OVER, doMouseOver);
noButton.removeEventListener(MouseEvent.MOUSE_OUT, doMouseOut);
}
}
}//package
Section 86
//highscoresButtonMC (highscoresButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class highscoresButtonMC extends MovieClip {
public function highscoresButtonMC(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 87
//howToPlayButtonMC (howToPlayButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class howToPlayButtonMC extends MovieClip {
public function howToPlayButtonMC(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 88
//logoMC (logoMC)
package {
import flash.display.*;
public dynamic class logoMC extends MovieClip {
}
}//package
Section 89
//makeBonusWAV (makeBonusWAV)
package {
import flash.media.*;
public dynamic class makeBonusWAV extends Sound {
}
}//package
Section 90
//menuBackground (menuBackground)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class menuBackground extends MovieClip {
public function menuBackground(){
addFrameScript(0, frame1, 27, frame28, 43, frame44, 59, frame60, 69, frame70, 79, frame80, 119, frame120);
}
function frame120(){
stop();
}
function frame28(){
stop();
}
function frame1(){
stop();
}
function frame80(){
stop();
}
function frame70(){
stop();
}
function frame60(){
stop();
}
function frame44(){
stop();
}
}
}//package
Section 91
//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 92
//moreGamesButtonMC (moreGamesButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class moreGamesButtonMC extends MovieClip {
public function moreGamesButtonMC(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 93
//muteBoardButtonMC (muteBoardButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class muteBoardButtonMC extends MovieClip {
public function muteBoardButtonMC(){
addFrameScript(0, frame1, 1, frame2, 9, frame10, 10, frame11, 11, frame12, 20, frame21);
}
function frame10(){
gotoAndPlay(1);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame21(){
gotoAndPlay(11);
}
function frame11(){
stop();
}
function frame12(){
stop();
}
}
}//package
Section 94
//muteButtonMC (muteButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class muteButtonMC extends MovieClip {
public function muteButtonMC(){
addFrameScript(0, frame1, 1, frame2, 9, frame10, 10, frame11, 19, frame20);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame20(){
stop();
}
function frame10(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 95
//pauseMenuMC (pauseMenuMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class pauseMenuMC extends MovieClip {
public function pauseMenuMC(){
addFrameScript(99, frame100);
}
function frame100(){
gotoAndPlay(1);
}
}
}//package
Section 96
//purpleButton (purpleButton)
package {
import flash.display.*;
public dynamic class purpleButton extends MovieClip {
}
}//package
Section 97
//quitBoardButtonMC (quitBoardButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class quitBoardButtonMC extends MovieClip {
public function quitBoardButtonMC(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 98
//quitButtonMC (quitButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class quitButtonMC extends MovieClip {
public function quitButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 99
//randButtonWAV (randButtonWAV)
package {
import flash.media.*;
public dynamic class randButtonWAV extends Sound {
}
}//package
Section 100
//randomiseToolTipMC (randomiseToolTipMC)
package {
import flash.display.*;
public dynamic class randomiseToolTipMC extends MovieClip {
}
}//package
Section 101
//randomizeButton (randomizeButton)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class randomizeButton extends MovieClip {
public function randomizeButton(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 102
//redBlock (redBlock)
package {
import flash.display.*;
public dynamic class redBlock extends MovieClip {
}
}//package
Section 103
//redColourBar (redColourBar)
package {
import flash.display.*;
public dynamic class redColourBar extends MovieClip {
}
}//package
Section 104
//redSplat (redSplat)
package {
import flash.display.*;
public dynamic class redSplat extends MovieClip {
}
}//package
Section 105
//redSquish (redSquish)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class redSquish extends MovieClip {
public function redSquish(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package
Section 106
//resumeButtonMC (resumeButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class resumeButtonMC extends MovieClip {
public function resumeButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 107
//revealWAV (revealWAV)
package {
import flash.media.*;
public dynamic class revealWAV extends Sound {
}
}//package
Section 108
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 109
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 110
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 111
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 112
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 113
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 114
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 115
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 116
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 117
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 118
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 119
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 120
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 121
//sponsorStartup (sponsorStartup)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class sponsorStartup extends MovieClip {
public function sponsorStartup(){
addFrameScript(0, frame1, 214, frame215);
}
function frame215(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 122
//startGameButtonMC (startGameButtonMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class startGameButtonMC extends MovieClip {
public function startGameButtonMC(){
addFrameScript(0, frame1, 19, frame20);
}
function frame20(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 123
//titleMusicMP3 (titleMusicMP3)
package {
import flash.media.*;
public dynamic class titleMusicMP3 extends Sound {
}
}//package
Section 124
//yellowBlock (yellowBlock)
package {
import flash.display.*;
public dynamic class yellowBlock extends MovieClip {
}
}//package
Section 125
//yellowButton (yellowButton)
package {
import flash.display.*;
public dynamic class yellowButton extends MovieClip {
}
}//package
Section 126
//yellowColourBar (yellowColourBar)
package {
import flash.display.*;
public dynamic class yellowColourBar extends MovieClip {
}
}//package
Section 127
//yellowSplat (yellowSplat)
package {
import flash.display.*;
public dynamic class yellowSplat extends MovieClip {
}
}//package
Section 128
//yellowSquish (yellowSquish)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class yellowSquish extends MovieClip {
public function yellowSquish(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package