Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
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
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get toggle():Boolean{
return (true);
}
override protected function configUI():void{
var _local1:Shape;
var _local2:Graphics;
super.configUI();
super.toggle = true;
_local1 = new Shape();
_local2 = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
var _local1:Number;
super.drawLayout();
_local1 = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
override protected function drawBackground():void{
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 5
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
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 6
//Slider (fl.controls.Slider)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 7
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//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 flash.utils.*;
import fl.events.*;
import flash.text.*;
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
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 13
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 14
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 15
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
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 16
//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 17
//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 18
//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 19
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
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 20
//Action_6 (iceblast_LC_fla.Action_6)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.xml.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
public dynamic class Action_6 extends MovieClip {
public function Action_6(){
addFrameScript(0, frame1);
}
public function onComplete(_arg1:Event):void{
MovieClip(parent).gotoAndPlay("loaded");
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:int;
_local2 = Math.round(((_arg1.target.bytesLoaded / _arg1.target.bytesTotal) * 100));
MovieClip(parent).gotoAndStop(_local2);
}
function frame1(){
MovieClip(root).stop();
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
MovieClip(parent).gotoAndPlay("loaded");
};
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
}
}//package iceblast_LC_fla
Section 21
//AssetHolder_17 (iceblast_LC_fla.AssetHolder_17)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class AssetHolder_17 extends MovieClip {
public function AssetHolder_17(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 22
//BigRedButton_67 (iceblast_LC_fla.BigRedButton_67)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class BigRedButton_67 extends MovieClip {
public function BigRedButton_67(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package iceblast_LC_fla
Section 23
//BlackScreen_52 (iceblast_LC_fla.BlackScreen_52)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class BlackScreen_52 extends MovieClip {
public function BlackScreen_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 24
//chain_mc_71 (iceblast_LC_fla.chain_mc_71)
package iceblast_LC_fla {
import flash.display.*;
import flash.text.*;
public dynamic class chain_mc_71 extends MovieClip {
public var chaintext:TextField;
public function chain_mc_71(){
addFrameScript(0, frame1);
}
function frame1(){
chaintext.selectable = false;
}
}
}//package iceblast_LC_fla
Section 25
//clickContinue_87 (iceblast_LC_fla.clickContinue_87)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class clickContinue_87 extends MovieClip {
public function clickContinue_87(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 26
//comboLevel_65 (iceblast_LC_fla.comboLevel_65)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class comboLevel_65 extends MovieClip {
public var podd10:MovieClip;
public var podd6:MovieClip;
public var podd7:MovieClip;
public var podd9:MovieClip;
public var podd8:MovieClip;
public var pod5:MovieClip;
public var pod3:MovieClip;
public var pod4:MovieClip;
public var pod2:MovieClip;
public var pod1:MovieClip;
public function comboLevel_65(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame10(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(2);
podd7.gotoAndStop(2);
podd8.gotoAndStop(2);
podd9.gotoAndStop(2);
podd10.gotoAndStop(2);
}
function frame3(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(1);
pod5.gotoAndStop(1);
podd6.gotoAndStop(1);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame7(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(2);
podd7.gotoAndStop(2);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame1(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(1);
pod3.gotoAndStop(1);
pod4.gotoAndStop(1);
pod5.gotoAndStop(1);
podd6.gotoAndStop(1);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame6(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(2);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame4(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(1);
podd6.gotoAndStop(1);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame5(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(1);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame9(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(2);
podd7.gotoAndStop(2);
podd8.gotoAndStop(2);
podd9.gotoAndStop(2);
podd10.gotoAndStop(1);
}
function frame8(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(2);
pod4.gotoAndStop(2);
pod5.gotoAndStop(2);
podd6.gotoAndStop(2);
podd7.gotoAndStop(2);
podd8.gotoAndStop(2);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
function frame2(){
pod1.gotoAndStop(2);
pod2.gotoAndStop(2);
pod3.gotoAndStop(1);
pod4.gotoAndStop(1);
pod5.gotoAndStop(1);
podd6.gotoAndStop(1);
podd7.gotoAndStop(1);
podd8.gotoAndStop(1);
podd9.gotoAndStop(1);
podd10.gotoAndStop(1);
}
}
}//package iceblast_LC_fla
Section 27
//comboLevel_MC_66 (iceblast_LC_fla.comboLevel_MC_66)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class comboLevel_MC_66 extends MovieClip {
public function comboLevel_MC_66(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 28
//crystalComing_94 (iceblast_LC_fla.crystalComing_94)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class crystalComing_94 extends MovieClip {
public function crystalComing_94(){
addFrameScript(52, frame53);
}
function frame53(){
stop();
}
}
}//package iceblast_LC_fla
Section 29
//crystalMC_24 (iceblast_LC_fla.crystalMC_24)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class crystalMC_24 extends MovieClip {
public function crystalMC_24(){
addFrameScript(19, frame20, 29, frame30, 40, frame41, 50, frame51, 61, frame62, 73, frame74, 85, frame86, 97, frame98, 109, frame110, 121, frame122, 133, frame134, 144, frame145, 155, frame156, 167, frame168, 179, frame180, 190, frame191, 202, frame203, 214, frame215, 226, frame227, 238, frame239, 250, frame251, 251, frame252, 276, frame277);
}
function frame156(){
gotoAndStop(2);
}
function frame74(){
gotoAndStop("Dead");
}
function frame86(){
gotoAndStop(4);
}
function frame168(){
gotoAndStop(1);
}
function frame277(){
gotoAndStop("Dead");
}
function frame98(){
gotoAndStop(3);
}
function frame215(){
gotoAndStop("Dead");
}
function frame180(){
gotoAndStop("Dead");
}
function frame227(){
gotoAndStop(1);
}
function frame20(){
gotoAndStop(5);
}
function frame191(){
gotoAndStop(2);
}
function frame110(){
gotoAndStop(2);
}
function frame30(){
gotoAndStop(4);
}
function frame239(){
gotoAndStop("Dead");
}
function frame203(){
gotoAndStop(1);
}
function frame41(){
gotoAndStop(3);
}
function frame122(){
gotoAndStop(1);
}
function frame251(){
gotoAndStop("Dead");
}
function frame252(){
gotoAndPlay("1Die");
}
function frame134(){
gotoAndStop("Dead");
}
function frame51(){
gotoAndStop(2);
}
function frame145(){
gotoAndStop(3);
}
function frame62(){
gotoAndStop(1);
}
}
}//package iceblast_LC_fla
Section 30
//emptyButton_53 (iceblast_LC_fla.emptyButton_53)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class emptyButton_53 extends MovieClip {
public function emptyButton_53(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 31
//GrowingMC_27 (iceblast_LC_fla.GrowingMC_27)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class GrowingMC_27 extends MovieClip {
public function GrowingMC_27(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package iceblast_LC_fla
Section 32
//Help_81 (iceblast_LC_fla.Help_81)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class Help_81 extends MovieClip {
public function Help_81(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 33
//Hiscore_82 (iceblast_LC_fla.Hiscore_82)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class Hiscore_82 extends MovieClip {
public function Hiscore_82(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 34
//LevelLoseMC_100 (iceblast_LC_fla.LevelLoseMC_100)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.xml.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
public dynamic class LevelLoseMC_100 extends MovieClip {
public var restartButton:MovieClip;
public var quitButton:MovieClip;
public function LevelLoseMC_100(){
addFrameScript(0, frame1);
}
public function handleLose(_arg1:Event){
if (_arg1.type == MouseEvent.MOUSE_DOWN){
_arg1.target.scaleX = 0.9;
_arg1.target.scaleY = 0.9;
} else {
_arg1.target.scaleX = 1;
_arg1.target.scaleY = 1;
};
}
function frame1(){
quitButton.addEventListener(MouseEvent.MOUSE_DOWN, handleLose, false, 0, true);
restartButton.addEventListener(MouseEvent.MOUSE_DOWN, handleLose, false, 0, true);
quitButton.addEventListener(MouseEvent.MOUSE_UP, handleLose, false, 0, true);
restartButton.addEventListener(MouseEvent.MOUSE_UP, handleLose, false, 0, true);
}
}
}//package iceblast_LC_fla
Section 35
//LevelWinMC_51 (iceblast_LC_fla.LevelWinMC_51)
package iceblast_LC_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelWinMC_51 extends MovieClip {
public var okButton:MovieClip;
public var ranking:MovieClip;
public var submitButton:MovieClip;
public var score:TextField;
public function LevelWinMC_51(){
addFrameScript(0, frame1);
}
function frame1(){
score.selectable = false;
okButton.buttonMode = true;
}
}
}//package iceblast_LC_fla
Section 36
//loadED_7 (iceblast_LC_fla.loadED_7)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class loadED_7 extends MovieClip {
public function loadED_7(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package iceblast_LC_fla
Section 37
//LunaUI_58 (iceblast_LC_fla.LunaUI_58)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class LunaUI_58 extends MovieClip {
public var mc:MovieClip;
}
}//package iceblast_LC_fla
Section 38
//MissionFailMC_96 (iceblast_LC_fla.MissionFailMC_96)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.xml.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
public dynamic class MissionFailMC_96 extends MovieClip {
public var condition:TextField;
public var restartButton:MovieClip;
public var quitButton:MovieClip;
public function MissionFailMC_96(){
addFrameScript(0, frame1);
}
function frame1(){
restartButton.addEventListener(MouseEvent.MOUSE_DOWN, handleWin, false, 0, true);
restartButton.addEventListener(MouseEvent.MOUSE_UP, handleWin, false, 0, true);
quitButton.addEventListener(MouseEvent.MOUSE_DOWN, handleWin, false, 0, true);
quitButton.addEventListener(MouseEvent.MOUSE_UP, handleWin, false, 0, true);
condition.selectable = false;
}
public function handleWin(_arg1:Event){
if (_arg1.type == MouseEvent.MOUSE_DOWN){
_arg1.target.scaleX = 0.9;
_arg1.target.scaleY = 0.9;
} else {
_arg1.target.scaleX = 1;
_arg1.target.scaleY = 1;
};
}
}
}//package iceblast_LC_fla
Section 39
//muteBtn_64 (iceblast_LC_fla.muteBtn_64)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class muteBtn_64 extends MovieClip {
public function muteBtn_64(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 40
//NewGame_80 (iceblast_LC_fla.NewGame_80)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class NewGame_80 extends MovieClip {
public function NewGame_80(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 41
//NG_AD_OBJECT_WITH_PRELOADER_3 (iceblast_LC_fla.NG_AD_OBJECT_WITH_PRELOADER_3)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import ngapi_as3.*;
import flash.text.*;
import flash.xml.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
public dynamic class NG_AD_OBJECT_WITH_PRELOADER_3 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_WITH_PRELOADER_3(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(_arg1){
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
ng_ad.addChild(_local3);
}
}
}//package iceblast_LC_fla
Section 42
//NG_TANK_11 (iceblast_LC_fla.NG_TANK_11)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
import ngapi_as3.*;
public dynamic class NG_TANK_11 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_11(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package iceblast_LC_fla
Section 43
//okButton_15 (iceblast_LC_fla.okButton_15)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class okButton_15 extends MovieClip {
public function okButton_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 44
//preloaderClip_1 (iceblast_LC_fla.preloaderClip_1)
package iceblast_LC_fla {
import flash.display.*;
import flash.text.*;
public dynamic class preloaderClip_1 extends MovieClip {
public var bar:MovieClip;
public var textBox:TextField;
}
}//package iceblast_LC_fla
Section 45
//PunchFX_41 (iceblast_LC_fla.PunchFX_41)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class PunchFX_41 extends MovieClip {
public function PunchFX_41(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package iceblast_LC_fla
Section 46
//quit_btn_84 (iceblast_LC_fla.quit_btn_84)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class quit_btn_84 extends MovieClip {
public function quit_btn_84(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 47
//RegenerateMC_29 (iceblast_LC_fla.RegenerateMC_29)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class RegenerateMC_29 extends MovieClip {
public function RegenerateMC_29(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package iceblast_LC_fla
Section 48
//selector_54 (iceblast_LC_fla.selector_54)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class selector_54 extends MovieClip {
public function selector_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package iceblast_LC_fla
Section 49
//skipButton_88 (iceblast_LC_fla.skipButton_88)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class skipButton_88 extends MovieClip {
public function skipButton_88(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 50
//SkyeUI_56 (iceblast_LC_fla.SkyeUI_56)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class SkyeUI_56 extends MovieClip {
public var mc:MovieClip;
}
}//package iceblast_LC_fla
Section 51
//SunUI_60 (iceblast_LC_fla.SunUI_60)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class SunUI_60 extends MovieClip {
public var mc:MovieClip;
}
}//package iceblast_LC_fla
Section 52
//Thermometer_62 (iceblast_LC_fla.Thermometer_62)
package iceblast_LC_fla {
import flash.display.*;
import src.iceblast.userinterface.*;
public dynamic class Thermometer_62 extends MovieClip {
public var thermotimer:Thermobar;
}
}//package iceblast_LC_fla
Section 53
//UIContainer_104 (iceblast_LC_fla.UIContainer_104)
package iceblast_LC_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UIContainer_104 extends MovieClip {
public var chainText:TextField;
public var comboText:TextField;
public var scoreText:TextField;
}
}//package iceblast_LC_fla
Section 54
//WindowBG_14 (iceblast_LC_fla.WindowBG_14)
package iceblast_LC_fla {
import flash.display.*;
public dynamic class WindowBG_14 extends MovieClip {
public function WindowBG_14(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package iceblast_LC_fla
Section 55
//X_LOAD_4 (iceblast_LC_fla.X_LOAD_4)
package iceblast_LC_fla {
import flash.display.*;
import flash.events.*;
public dynamic class X_LOAD_4 extends MovieClip {
public var NGButton:SimpleButton;
public function X_LOAD_4(){
addFrameScript(100, frame101, 150, frame151, 164, frame165);
}
function frame151(){
NGButton.addEventListener(MouseEvent.CLICK, PlayMovie);
}
function frame165(){
stop();
}
public function PlayMovie(_arg1:Event){
gotoAndStop("end");
MovieClip(root).play();
}
function frame101(){
play();
}
}
}//package iceblast_LC_fla
Section 56
//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 set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _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 addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 57
//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 _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
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 58
//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 _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [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];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_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);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_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 vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
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;
vars = 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);
s = "?";
i = 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{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = 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 _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
_local3 = _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 cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = 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 clipname:String;
var f:Function;
var req:URLRequest;
var vars:URLVariables;
var id = _arg1;
var clip = _arg2;
clipname = ("_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();
f = 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);
req = new URLRequest(_servicesURL);
vars = 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 mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = 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 59
//NewgroundsAPI (ngapi_as3.NewgroundsAPI)
package ngapi_as3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object){
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1){
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String){
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String){
}
public static function loadMySite(_arg1:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String){
}
public static function linkAPI(_arg1){
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null){
var _local3:URLRequest;
var _local4:*;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1, _arg2=null){
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String){
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String){
}
public static function addCustomEvent(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function){
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1){
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:MovieClip;
var _local10:TextField;
var _local11:TextField;
var _local12:TextFormat;
var _local13:TextField;
var _local14:TextFormat;
var _local15:TextFormat;
_local4 = bridge.stage.stageWidth;
_local5 = bridge.stage.stageHeight;
_local6 = 350;
_local7 = 160;
_local8 = bridge.root;
_local9 = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
_local10 = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
_local11 = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
_local12 = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
_local13 = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
_local14 = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
_local15 = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number){
var _local2:String;
var _local3:*;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package ngapi_as3
Section 60
//LunaChar (src.iceblast.char.LunaChar)
package src.iceblast.char {
import flash.display.*;
import flash.events.*;
import src.iceblast.objects.*;
import src.iceblast.controllers.*;
import flash.utils.*;
import flash.filters.*;
public class LunaChar extends MovieClip {
public var charName:String;
var coordY:int;
public var active:Boolean;
var coordX;
public var rechargeTime:int;
var gameStage:MovieClip;
var lunaWork:MovieClip;
private var rechargeTimeLeft:int;
private var pauseStart:int;
private var timer:int;
private var timerState:String;
public var killTime:int;
var lunaPower:int;
private var startTime:int;
public var crystalMap:Array2D;
private var killTimer:Timer;
private var killStartTime:int;
var timerBar:MovieClip;
private var removeLunaTimer:Timer;
var target:Crystal;
var isKilled:Boolean;
var type:String;// = "none"
var LunaPosY:int;
private var chargeStartTime:int;
var LunaPosX:int;
var uiBar:MovieClip;
private var timeElapsed:int;
private var chargeTimer:Timer;
private var killTimeLeft:int;
public static var PUNCH:String = "Punch";
public static var PAUSE:String = "pause";
static var TIMER_PAUSE:String = "pause";
static var TIMER_PLAY:String = "play";
public function LunaChar(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:MovieClip, _arg6:MovieClip){
var _local7:Array;
timerState = TIMER_PAUSE;
type = "none";
super();
charName = _arg1;
rechargeTime = _arg2;
killTime = _arg3;
rechargeTimeLeft = rechargeTime;
killTimeLeft = killTime;
active = true;
gameStage = _arg5;
lunaPower = _arg4;
uiBar = _arg6;
timerBar = new TimerMC();
addEventListener(PAUSE, pauseLuna);
lunaWork = new lunaWorkMC();
lunaWork.mouseEnabled = false;
_local7 = new Array();
if (lunaWork.chargeFX != null){
_local7 = lunaWork.chargeFX.filters;
if (lunaPower == 4){
_local7[0] = new GlowFilter(26367, 1, 5, 5, 2, 3);
};
if (lunaPower == 5){
_local7[0] = new GlowFilter(0xFF00FF, 1, 5, 5, 2, 3);
};
lunaWork.chargeFX.filters = _local7;
};
if (lunaWork.punchFX != null){
_local7 = lunaWork.punchFX.filters;
if (lunaPower == 4){
_local7[0] = new GlowFilter(26367, 1, 5, 5, 2, 3);
};
if (lunaPower == 5){
_local7[0] = new GlowFilter(65382, 1, 5, 5, 2, 3);
};
if (lunaPower == 6){
_local7[0] = new GlowFilter(0xFF00FF, 1, 5, 5, 2, 3);
};
lunaWork.punchFX.filters = _local7;
};
}
function updateTimer(_arg1:Object){
if (type == "charge"){
};
switch (timerState){
case TIMER_PLAY:
if (type == "charge"){
if (lunaWork.currentLabel == "Punch"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.PUNCH, "sound_fx"));
};
if (lunaWork.currentLabel == "Hit"){
isKilled = target.kill(lunaPower);
};
timerBar.scaleX = (4 - ((4 * (getTimer() - timer)) / rechargeTime));
};
break;
case TIMER_PAUSE:
break;
};
}
public function init(){
lunaWork.gotoAndStop("Start");
dispatchEvent(new SoundfxEvent(SoundfxEvent.WHIP, "sound_fx"));
killTimer = new Timer(33, (killTime / 33));
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.addEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.start();
gameStage.addChild(lunaWork);
LunaPosX = target.getCoords()[0];
LunaPosY = target.getCoords()[1];
lunaWork.x = (LunaPosX - 30);
lunaWork.y = (LunaPosY + 1);
Level(parent).sortDepth(gameStage);
startTime = getTimer();
killStartTime = startTime;
killTimeLeft = killTime;
type = "kill";
}
public function pauseLuna(_arg1:PauseEvent):void{
if (type != "none"){
if (_arg1.pauseMode == "on"){
timerState = TIMER_PAUSE;
lunaWork.stop();
if (lunaWork.punchFX != null){
lunaWork.punchFX.stop();
};
if (lunaWork.chargeFX != null){
lunaWork.chargeFX.stop();
};
pauseStart = getTimer();
if (type == "kill"){
killTimer.stop();
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, kill);
};
if (type == "charge"){
chargeTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, kill);
};
gameStage.removeEventListener("enterFrame", updateTimer);
} else {
timerState = TIMER_PLAY;
if (type == "kill"){
timeElapsed = (pauseStart - killStartTime);
killStartTime = getTimer();
killTimeLeft = (killTimeLeft - timeElapsed);
killTimer = new Timer(33, (killTimeLeft / 33));
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.addEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.start();
};
if (type == "charge"){
timer = (timer + (getTimer() - pauseStart));
timeElapsed = (pauseStart - chargeStartTime);
chargeStartTime = getTimer();
rechargeTimeLeft = (rechargeTimeLeft - timeElapsed);
chargeTimer = new Timer(rechargeTimeLeft, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
};
if (lunaWork.currentLabel != "Finished"){
lunaWork.play();
if (lunaWork.punchFX != null){
lunaWork.punchFX.play();
};
if (lunaWork.chargeFX != null){
lunaWork.chargeFX.play();
};
};
gameStage.addEventListener("enterFrame", updateTimer);
};
};
}
function kill(){
gameStage.addEventListener("enterFrame", updateTimer);
type = "charge";
startTime = getTimer();
lunaWork.gotoAndPlay("Punch");
dispatchEvent(new SoundfxEvent(SoundfxEvent.HAH, "sound_fx"));
removeLunaTimer = new Timer(500, 1);
removeLunaTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeLuna);
removeLunaTimer.start();
uiBar.addChild(timerBar);
timerBar.x = -250;
timerBar.y = 240;
timerBar.width = 100;
timerBar.scaleY = 5;
chargeTimer = new Timer(rechargeTime, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
chargeStartTime = getTimer();
timer = getTimer();
timerState = TIMER_PLAY;
}
function killStop(_arg1:Event):void{
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.stop();
killTimer = null;
kill();
}
function removeLuna(_arg1:Event){
gameStage.removeChild(lunaWork);
}
public function clearMemory(){
try {
killTimer.stop();
chargeTimer.stop();
removeLunaTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, recharge);
killTimer = null;
chargeTimer = null;
removeLunaTimer = null;
lunaWork.stop();
lunaWork = null;
gameStage.removeEventListener("enterFrame", updateTimer);
} catch(error:Error) {
};
}
function recharge(_arg1:TimerEvent){
type = "none";
rechargeTimeLeft = rechargeTime;
active = true;
uiBar.removeChild(timerBar);
chargeTimer.stop();
timerState = TIMER_PAUSE;
gameStage.removeEventListener("enterFrame", updateTimer);
}
function killPlay(_arg1:Event):void{
if (target.life < 1){
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.stop();
killTimer = null;
lunaWork.gotoAndPlay("Teleport");
type = "charge";
startTime = getTimer();
removeLunaTimer = new Timer(500, 1);
removeLunaTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeLuna);
removeLunaTimer.start();
uiBar.addChild(timerBar);
timerBar.x = -250;
timerBar.y = 240;
timerBar.width = 100;
timerBar.scaleY = 5;
chargeTimer = new Timer(800, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
chargeStartTime = getTimer();
timer = getTimer();
timerState = TIMER_PLAY;
};
lunaWork.play();
if (lunaWork.currentLabel == "Land"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.LAND, "sound_fx"));
};
if (lunaWork.currentLabel == "Wait"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CHARGE, "sound_fx"));
};
}
public function killCrystal(_arg1:int, _arg2:int, _arg3:Array2D){
active = false;
coordX = _arg1;
coordY = _arg2;
crystalMap = _arg3;
target = crystalMap.get(coordX, coordY);
init();
return (isKilled);
}
}
}//package src.iceblast.char
Section 61
//SkyeChar (src.iceblast.char.SkyeChar)
package src.iceblast.char {
import flash.display.*;
import flash.events.*;
import src.iceblast.objects.*;
import src.iceblast.controllers.*;
import flash.utils.*;
public class SkyeChar extends MovieClip {
public var charName:String;
var coordY:int;
public var active:Boolean;
var coordX;
var skyePosX:int;
public var rechargeTime:int;
var timeBar:MovieClip;
public var skyePower:int;
var skyePosY:int;
var gameStage:MovieClip;
public var PICKAXE:String;// = "Pickaxe"
private var rechargeTimeLeft:int;
private var pauseStart:int;
private var timer:int;
private var timerState:String;
public var killTime:int;
private var startTime:int;
public var crystalMap:Array2D;
private var killTimer:Timer;
private var killStartTime:int;
var skyeWork:MovieClip;
var target:Crystal;
var isKilled:Boolean;
private var workTimer:Timer;
var type:String;// = "none"
private var chargeStartTime:int;
var uiBar:MovieClip;
private var timeElapsed:int;
private var chargeTimer:Timer;
private var killTimeLeft:int;
public static var PAUSE:String = "pause";
static var TIMER_PAUSE:String = "pause";
static var TIMER_PLAY:String = "play";
public function SkyeChar(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:MovieClip, _arg6:MovieClip){
PICKAXE = "Pickaxe";
timerState = TIMER_PAUSE;
type = "none";
super();
charName = _arg1;
rechargeTime = _arg2;
rechargeTimeLeft = rechargeTime;
killTime = _arg3;
killTimeLeft = killTime;
active = true;
gameStage = _arg5;
skyePower = _arg4;
uiBar = _arg6;
timeBar = new TimerMC();
addEventListener(PAUSE, pauseSkye);
skyeWork = new skyeWorkMC();
skyeWork.mouseEnabled = false;
skyeWork.gotoAndStop("End");
gameStage.addChild(skyeWork);
skyeWork.visible = false;
skyeWork.stop();
}
function updateTimer(_arg1:Event){
switch (timerState){
case TIMER_PLAY:
if (type == "charge"){
timeBar.scaleX = (4 - ((4 * (getTimer() - timer)) / rechargeTime));
};
break;
case TIMER_PAUSE:
break;
};
}
public function init(){
type = "kill";
skyeWork.visible = true;
skyeWork.gotoAndPlay("Start");
killTimer = new Timer(33, (killTime / 33));
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.addEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.start();
dispatchEvent(new SoundfxEvent(SoundfxEvent.TELEPORT2, "sound_fx"));
skyePosX = target.getCoords()[0];
skyePosY = target.getCoords()[1];
skyeWork.x = (skyePosX - 25);
skyeWork.y = (skyePosY + 1);
Level(parent).sortDepth(gameStage);
startTime = getTimer();
killStartTime = startTime;
}
function kill(){
isKilled = target.kill(skyePower);
skyeWork.gotoAndPlay("End");
killTimeLeft = killTime;
startTime = getTimer();
type = "charge";
timeBar.x = -370;
timeBar.y = 240;
timeBar.width = 100;
timeBar.scaleY = 5;
uiBar.addChild(timeBar);
gameStage.addEventListener("enterFrame", updateTimer);
chargeTimer = new Timer(rechargeTime, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
chargeStartTime = getTimer();
timer = getTimer();
timerState = TIMER_PLAY;
}
public function pauseSkye(_arg1:PauseEvent):void{
if (type != "none"){
if (_arg1.pauseMode == "on"){
timerState = TIMER_PAUSE;
skyeWork.stop();
if (skyeWork.teleport != null){
skyeWork.teleport.stop();
};
pauseStart = getTimer();
if (killTimer != null){
killTimer.stop();
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, kill);
};
if (type == "charge"){
chargeTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, kill);
};
gameStage.removeEventListener("enterFrame", updateTimer);
} else {
timerState = TIMER_PLAY;
if (killTimer != null){
timeElapsed = (pauseStart - killStartTime);
killStartTime = getTimer();
killTimeLeft = (killTimeLeft - timeElapsed);
killTimer = new Timer(33, (killTimeLeft / 33));
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.addEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.start();
};
if (type == "charge"){
timer = (timer + (getTimer() - pauseStart));
timeElapsed = (pauseStart - chargeStartTime);
chargeStartTime = getTimer();
rechargeTimeLeft = (rechargeTimeLeft - timeElapsed);
chargeTimer = new Timer(rechargeTimeLeft, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
};
if (skyeWork.currentLabel != "Finished"){
skyeWork.play();
};
gameStage.addEventListener("enterFrame", updateTimer);
};
};
}
public function clearMemory(){
try {
skyeWork.stop();
killTimer.stop();
workTimer.stop();
chargeTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, recharge);
killTimer = null;
workTimer = null;
chargeTimer = null;
skyeWork = null;
gameStage.removeEventListener("enterFrame", updateTimer);
} catch(error:Error) {
};
}
function killPlay(_arg1:Event):void{
if (target.life < 1){
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.stop();
skyeWork.gotoAndPlay("End");
killTimeLeft = killTime;
startTime = getTimer();
type = "charge";
timeBar.x = -370;
timeBar.y = 240;
timeBar.width = 100;
timeBar.scaleY = 5;
uiBar.addChild(timeBar);
chargeTimer = new Timer(800, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
chargeStartTime = getTimer();
timer = getTimer();
timerState = TIMER_PLAY;
};
if (skyeWork.currentLabel == "Swing"){
dispatchEvent(new SoundfxEvent(PICKAXE, "sound_fx"));
dispatchEvent(new SoundfxEvent(SoundfxEvent.HAAH, "sound_fx"));
};
if (skyeWork.currentLabel == "Hit"){
target.gotoAndPlay("Hit");
};
if (skyeWork.currentLabel == "Teleport"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.TELEPORT2, "sound_fx"));
};
}
function recharge(_arg1:TimerEvent){
rechargeTimeLeft = rechargeTime;
active = true;
uiBar.removeChild(timeBar);
chargeTimer.stop();
type = "none";
timerState = TIMER_PAUSE;
gameStage.removeEventListener("enterFrame", updateTimer);
skyeWork.visible = false;
}
function killStop(_arg1:Event):void{
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
killTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, killStop);
killTimer.stop();
killTimer = null;
kill();
}
public function killCrystal(_arg1:int, _arg2:int, _arg3:Array2D):Boolean{
active = false;
coordX = _arg1;
coordY = _arg2;
crystalMap = _arg3;
target = crystalMap.get(coordX, coordY);
init();
return (isKilled);
}
}
}//package src.iceblast.char
Section 62
//SunChar (src.iceblast.char.SunChar)
package src.iceblast.char {
import flash.display.*;
import flash.events.*;
import src.iceblast.objects.*;
import src.iceblast.controllers.*;
import flash.utils.*;
import flash.filters.*;
public class SunChar extends MovieClip {
var coordX;
var coordY:int;
private var pauseStart:int;
public var rechargeTime:int;
private var chargeStartTime:int;
var gameStage:MovieClip;
private var rechargeTimeLeft:int;
var marker:MovieClip;
private var timerState:String;
var isKilled:Boolean;
private var startTime:int;
private var killTimer:Timer;
private var killStartTime:int;
var timerIndex:Array;
var timerBar:MovieClip;
var markerIndex:Array;
var killTimerCount:int;// = 0
var SunPosX:int;
var SunPosY:int;
var uiBar:MovieClip;
var firstHitDone;// = false
private var chargeTimer:Timer;
public var crystalList:Array;
public var charName:String;
var sunworkArray:Array;
var power:int;
public var active:Boolean;
var type:String;// = "none"
var markerLayer:MovieClip;
private var timer:int;
public var killTime:int;// = 1830
var SunWork:MovieClip;
var listCounter:int;
var target:Crystal;
var colorChanged:int;// = 0
public var killLength:int;// = 3
var sunIndex:Array;
private var timeElapsed:int;
private var killTimeLeft:int;
var markerList:Array;
public static var PAUSE:String = "pause";
static var TIMER_PAUSE:String = "pause";
static var TIMER_PLAY:String = "play";
public function SunChar(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:MovieClip, _arg6:MovieClip, _arg7:MovieClip){
var _local8:Array;
var _local9:int;
var _local10:*;
killTime = 1830;
killTimerCount = 0;
killLength = 3;
timerState = TIMER_PAUSE;
type = "none";
crystalList = new Array();
markerIndex = new Array();
markerList = new Array();
sunIndex = new Array();
timerIndex = new Array();
sunworkArray = new Array();
colorChanged = 0;
firstHitDone = false;
super();
charName = _arg1;
rechargeTime = _arg2;
rechargeTimeLeft = rechargeTime;
killTimeLeft = killTime;
power = _arg3;
killLength = _arg4;
active = true;
gameStage = _arg5;
timerBar = new TimerMC();
uiBar = _arg6;
markerLayer = _arg7;
_local8 = new Array();
_local9 = 0;
while (_local9 < _arg4) {
_local10 = new sunWorkMC();
sunworkArray.push(_local10);
if (_local10.swordfx != null){
_local8 = _local10.swordfx.filters;
if (power == 2){
_local8[0] = new GlowFilter(26367, 1, 5, 5, 2, 3);
};
if (power == 3){
_local8[0] = new GlowFilter(0xFF00FF, 1, 5, 5, 2, 3);
};
_local10.swordfx.filters = _local8;
};
_local9++;
};
_local8 = null;
addEventListener(PAUSE, pauseSun);
}
function showSun(_arg1:Crystal, _arg2:int){
var _local3:sunWorkMC;
_local3 = sunworkArray[_arg2];
_local3.name = _arg1.name;
_local3.mouseEnabled = false;
_local3.gotoAndPlay(1);
_local3.alpha = 1;
if (sunIndex.length > 0){
_local3.alpha = 0.6;
};
gameStage.addChild(_local3);
sunIndex.push(_local3);
SunPosX = _arg1.getCoords()[0];
SunPosY = _arg1.getCoords()[1];
_local3.x = (SunPosX - 30);
_local3.y = (SunPosY + 10);
Level(parent).sortDepth(gameStage);
}
public function pauseSun(_arg1:PauseEvent):void{
var _local2:int;
if (type != "none"){
if (_arg1.pauseMode == "on"){
if (sunIndex.length > 0){
_local2 = 0;
while (_local2 < sunIndex.length) {
sunIndex[_local2].stop();
if (sunIndex[_local2].swordfx != null){
sunIndex[_local2].swordfx.stop();
};
_local2++;
};
};
timerState = TIMER_PAUSE;
pauseStart = getTimer();
if (killTimer != null){
killTimer.stop();
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
};
if (type == "charge"){
chargeTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER, kill);
};
gameStage.removeEventListener("enterFrame", updateTimer);
} else {
timerState = TIMER_PLAY;
if (killTimer != null){
killTimer = new Timer(33, 0);
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.start();
killStartTime = getTimer();
if (sunIndex.length > 0){
_local2 = 0;
while (_local2 < sunIndex.length) {
sunIndex[_local2].play();
if (sunIndex[_local2].swordfx != null){
sunIndex[_local2].swordfx.play();
};
_local2++;
};
};
};
if (type == "charge"){
timer = (timer + (getTimer() - pauseStart));
timeElapsed = (pauseStart - chargeStartTime);
chargeStartTime = getTimer();
rechargeTimeLeft = (rechargeTimeLeft - timeElapsed);
chargeTimer = new Timer(rechargeTimeLeft, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge);
chargeTimer.start();
};
gameStage.addEventListener("enterFrame", updateTimer, false, 0, true);
};
};
}
function recharge(_arg1:TimerEvent){
colorChanged = 0;
type = "none";
rechargeTimeLeft = rechargeTime;
active = true;
if (uiBar != null){
uiBar.removeChild(timerBar);
};
chargeTimer.stop();
gameStage.removeEventListener("enterFrame", updateTimer);
timerState = TIMER_PAUSE;
}
public function mark(_arg1:Crystal):Boolean{
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
while (_local3 < markerList.length) {
if (markerList[_local3] == _arg1){
_local2 = true;
};
_local3++;
};
if (!_local2){
marker = new sunCharMC();
marker.name = ((_arg1.coordX + " ") + _arg1.coordY);
marker.mouseEnabled = false;
if (firstHitDone){
markerList.push(_arg1);
markerIndex.push(marker);
} else {
marker.gotoAndStop(2);
markerList.push(_arg1);
markerList.reverse();
markerIndex.push(marker);
markerIndex.reverse();
firstHitDone = true;
};
markerLayer.addChild(marker);
marker.x = (_arg1.getCoords()[0] - 30);
marker.y = (_arg1.getCoords()[1] - 20);
return (true);
//unresolved jump
};
return (false);
}
public function unmark(){
var _local1:*;
if (markerIndex.length > 0){
_local1 = 0;
while (_local1 < markerIndex.length) {
markerLayer.removeChild(markerIndex[_local1]);
_local1++;
};
markerIndex = new Array();
markerList = new Array();
};
firstHitDone = false;
}
public function willCombo():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < markerList.length) {
if (_local2 == 0){
if (markerList[_local2].willDie(power)){
_local1++;
};
} else {
if (markerList[_local2].willDie(1)){
_local1++;
};
};
_local2++;
};
return (_local1);
}
public function init(){
var _local1:*;
_local1 = 0;
while (_local1 < markerIndex.length) {
markerLayer.removeChild(markerIndex[_local1]);
_local1++;
};
markerIndex = new Array();
listCounter = killLength;
startTime = getTimer();
type = "kill";
killTimeLeft = killTime;
sunKill();
}
function kill(){
startTime = getTimer();
type = "charge";
chargeStartTime = getTimer();
timer = getTimer();
timerState = TIMER_PLAY;
uiBar.addChild(timerBar);
timerBar.x = -120;
timerBar.y = 240;
timerBar.width = 100;
timerBar.scaleY = 5;
chargeTimer = new Timer(rechargeTime, 1);
chargeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, recharge, false, 0, true);
chargeTimer.start();
gameStage.addEventListener("enterFrame", updateTimer, false, 0, true);
}
public function unmarkCrystal(_arg1:Crystal){
var _local2:*;
var _local3:*;
var _local4:int;
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < markerIndex.length) {
if (markerIndex[_local4].name != _arg1.name){
_local2.push(markerIndex[_local4]);
_local3.push(markerList[_local4]);
} else {
markerLayer.removeChild(markerIndex[_local4]);
if (_local4 == 0){
firstHitDone = false;
};
};
_local4++;
};
if (_local2.length < markerIndex.length){
markerIndex = _local2;
markerList = _local3;
};
}
public function killCrystals(){
active = false;
crystalList = markerList;
sunIndex = new Array();
timerIndex = new Array();
init();
return (isKilled);
}
function killPlay(_arg1:Event):void{
var _local2:int;
var _local3:sunWorkMC;
killTimerCount++;
_local2 = 0;
while (_local2 < sunIndex.length) {
_local3 = sunIndex[_local2];
if (killTimerCount == 21){
kill();
_local2 = 0;
while (_local2 < crystalList.length) {
if (Crystal(crystalList[_local2]).life < 1){
_local3.gotoAndPlay("Teleport");
} else {
if (_local2 == 0){
if (Crystal(crystalList[_local2]).kill(power)){
isKilled = true;
};
} else {
if (Crystal(crystalList[_local2]).kill(1)){
isKilled = true;
};
};
};
_local2++;
};
};
if (_local3.currentFrame != 55){
_local3.play();
} else {
_local3.stop();
};
if (killTimerCount == 55){
killTimer.stop();
killTimer.removeEventListener(TimerEvent.TIMER, killPlay);
killTimer = null;
killTimerCount = 0;
killTimeLeft = killTime;
gameStage.removeChild(_local3);
_local3.stop();
};
if (_local3.currentLabel == "Swing"){
if (killTimerCount == 16){
dispatchEvent(new SoundfxEvent(SoundfxEvent.HMPH, "sound_fx"));
};
};
if (_local3.currentLabel == "Teleport"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.TELEPORT, "sound_fx"));
};
_local2++;
};
}
public function clearMemory(){
var obj:*;
try {
for (obj in sunworkArray) {
obj.stop();
obj = null;
};
killTimer.stop();
chargeTimer.stop();
chargeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, recharge);
removeEventListener(PAUSE, pauseSun);
gameStage.removeEventListener("enterFrame", updateTimer);
} catch(error:Error) {
};
}
function sunKill(){
var _local1:int;
_local1 = 0;
while (_local1 < crystalList.length) {
showSun(crystalList[_local1], _local1);
_local1++;
};
dispatchEvent(new SoundfxEvent(SoundfxEvent.TELEPORT, "sound_fx"));
killTimer = new Timer(33, 0);
killTimer.addEventListener(TimerEvent.TIMER, killPlay);
killTimer.start();
killStartTime = getTimer();
markerList = new Array();
firstHitDone = false;
}
function updateTimer(_arg1:Object){
switch (timerState){
case TIMER_PLAY:
if (type == "charge"){
timerBar.scaleX = (4 - ((4 * (getTimer() - timer)) / rechargeTime));
};
break;
case TIMER_PAUSE:
break;
};
}
}
}//package src.iceblast.char
Section 63
//Array2D (src.iceblast.controllers.Array2D)
package src.iceblast.controllers {
public class Array2D {
private var arrayHeight:int;
private var arrayWidth:int;
public var array:Array;
public function Array2D(_arg1:int, _arg2:int){
arrayWidth = _arg1;
arrayHeight = _arg2;
array = new Array((arrayWidth * arrayHeight));
fill(null);
}
public function set(_arg1:int, _arg2:int, _arg3):void{
array[int(((_arg2 * arrayWidth) + _arg1))] = _arg3;
}
public function fill(_arg1):void{
var _local2:int;
var _local3:int;
_local2 = (arrayWidth * arrayHeight);
_local3 = 0;
while (_local3 < _local2) {
array[_local3] = _arg1;
_local3++;
};
}
public function get width():int{
return (arrayWidth);
}
public function get size():int{
return ((arrayWidth * arrayHeight));
}
public function set width(_arg1:int):void{
resize(_arg1, arrayHeight);
}
public function get height():int{
return (arrayHeight);
}
public function resize(_arg1:int, _arg2:int):void{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg2 <= 0){
_arg2 = 1;
};
_local3 = array.concat();
array.length = 0;
array.length = (_arg1 * _arg2);
_local4 = ((_arg1 < arrayWidth)) ? _arg1 : arrayWidth;
_local5 = ((_arg2 < arrayHeight)) ? _arg2 : arrayHeight;
_local7 = 0;
while (_local7 < _local5) {
_local8 = (_local7 * _arg1);
_local9 = (_local7 * arrayWidth);
_local6 = 0;
while (_local6 < _local4) {
array[int((_local8 + _local6))] = _local3[int((_local9 + _local6))];
_local6++;
};
_local7++;
};
arrayWidth = _arg1;
arrayHeight = _arg2;
}
public function set height(_arg1:int):void{
resize(arrayWidth, _arg1);
}
public function clear():void{
var _local1:int;
var _local2:int;
_local1 = (arrayWidth * arrayHeight);
_local2 = 0;
while (_local2 < _local1) {
array[_local2] = null;
_local2++;
};
array = null;
}
public function get(_arg1:int, _arg2:int){
return (array[int(((_arg2 * arrayWidth) + _arg1))]);
}
public function contains(_arg1):Boolean{
var _local2:int;
var _local3:int;
_local2 = size;
_local3 = 0;
while (_local3 < _local2) {
if (array[_local3] === _arg1){
return (true);
};
_local3++;
};
return (false);
}
}
}//package src.iceblast.controllers
Section 64
//ChainEvent (src.iceblast.controllers.ChainEvent)
package src.iceblast.controllers {
import flash.events.*;
public class ChainEvent extends Event {
public var coordY:int;
public var coordX:int;
public var chainMult:int;
public function ChainEvent(_arg1:int, _arg2:int, _arg3:int, _arg4:String, _arg5:Boolean=false, _arg6:Boolean=false){
super(_arg4, _arg5, _arg6);
coordX = _arg1;
coordY = _arg2;
this.chainMult = _arg3;
}
}
}//package src.iceblast.controllers
Section 65
//ConfirmWindow (src.iceblast.controllers.ConfirmWindow)
package src.iceblast.controllers {
import flash.display.*;
import flash.text.*;
public class ConfirmWindow extends MovieClip {
public var confirmCancel:MovieClip;
public var messageTextfield:TextField;
public var messageBG:MovieClip;
public var confirmOK:MovieClip;
public function ConfirmWindow(_arg1:String, _arg2:int, _arg3:int){
messageTextfield.selectable = false;
messageTextfield.text = _arg1;
messageTextfield.autoSize = "center";
}
}
}//package src.iceblast.controllers
Section 66
//Game (src.iceblast.controllers.Game)
package src.iceblast.controllers {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import ngapi_as3.*;
import mochi.as3.*;
import flash.text.*;
import flash.xml.*;
import flash.net.*;
public dynamic class Game extends MovieClip {
public var nextButton:MovieClip;
public var menuMusic;
public var error:Error1;
public var hiscoreXML:XMLDocument;
public var domainurl:TextField;
public var okBeep:Beep2;
public var targeted3:Boolean;
public var targeted1:Boolean;
public var targeted2:Boolean;
public var hiscores:MovieClip;
public var isMute:Boolean;
public var clickContinue:MovieClip;
private var levelOne:Level;
public var quit_btn:MovieClip;
private var gameTimeline:MovieClip;
public var url2:URLRequest;
public var muteButton:MovieClip;
public var targeting:int;
public var geckoLogo:MovieClip;
public var target2:MovieClip;
public var target3:MovieClip;
public var target1:MovieClip;
public var tryButton:MovieClip;
public var emptyVolume:SoundTransform;
public var preloaderClip:MovieClip;
public var ding:Ding;
public var soundVolume:SoundTransform;
public var openscreen:MovieClip;
public var help:MovieClip;
public var blackScreen:MovieClip;
public var domainurl2:TextField;
public var sysResolution:Object;
public var musicControl:SoundChannel;
public var menuButton:MovieClip;
public var level:Level;
public var changedFullscreen:Boolean;
public var target:MovieClip;
public var skipButton:MovieClip;
public var musicVolume:SoundTransform;
public var newGame:MovieClip;
public var highlightOn:int;
public var gridOn:int;
public var cancelBeep:Click;
public var hiscoreNode:XMLNode;
public var targeted;
public var blocker:MovieClip;
public function Game(){
addFrameScript(0, frame1, 2, frame3, 19, frame20, 63, frame64, 67, frame68, 68, frame69, 76, frame77, 77, frame78, 84, frame85, 85, frame86, 88, frame89, 90, frame91, 97, frame98, 104, frame105, 109, frame110, 110, frame111, 111, frame112, 112, frame113, 113, frame114, 114, frame115, 115, frame116, 116, frame117, 117, frame118, 118, frame119, 119, frame120, 120, frame121, 121, frame122, 135, frame136, 140, frame141, 146, frame147);
gameTimeline = this;
}
function frame3(){
changedFullscreen = false;
menuMusic = new MenuMusic();
musicVolume = new SoundTransform();
soundVolume = new SoundTransform();
musicVolume.volume = 0.5;
soundVolume.volume = 0.5;
gridOn = 1;
highlightOn = 1;
}
public function clickListener(_arg1:MouseEvent):void{
if (_arg1.target.name == "newGame"){
ding.play(0, 0, soundVolume);
gotoAndStop("Intro");
};
if (_arg1.target.name == "help"){
ding.play(0, 0, soundVolume);
gotoAndStop("Help");
};
if (_arg1.target.name == "hiscores"){
ding.play(0, 0, soundVolume);
gotoAndStop("Hiscores");
};
}
public function mouseoutListener(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
MochiServices.connect("fbfa8c9a1086bb9d", root);
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(7813);
}
function frame20(){
openscreen.addEventListener(MouseEvent.CLICK, function (){
url2 = new URLRequest("http://www.zombiegecko.com");
navigateToURL(url2, "_blank");
});
openscreen.buttonMode = true;
}
public function tutorial2(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(4500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial5");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial2);
};
}
public function tutorial3(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (!blocker.hitTestPoint(e.stageX, e.stageY, true)){
if (((target1.hitTestPoint(e.stageX, e.stageY)) && (!(targeted1)))){
targeting++;
targeted1 = true;
};
if (((target2.hitTestPoint(e.stageX, e.stageY)) && (!(targeted2)))){
targeting++;
targeted2 = true;
};
if (((target3.hitTestPoint(e.stageX, e.stageY)) && (!(targeted3)))){
targeting++;
targeted3 = true;
};
if (targeting == 2){
level.togglePause();
};
if (targeting == 3){
gotoAndStop("Wait");
timer = new Timer(2500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial6");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial3);
};
};
}
public function tutorial5(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(4500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial9");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial5);
};
}
public function tutorial6(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(3500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial10");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial6);
};
}
public function tutorial7(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(4500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial11");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial7);
};
}
public function tutorial1(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(3500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial4");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial1);
};
}
public function tutorial4(_arg1:MouseEvent){
var timer:Timer;
var e = _arg1;
if (((target.hitTestPoint(e.stageX, e.stageY)) && (!(blocker.hitTestPoint(e.stageX, e.stageY, true))))){
level.togglePause();
gotoAndStop("Wait");
timer = new Timer(6000, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
gotoAndStop("Tutorial7");
});
timer.start();
level.mouseChildren = false;
removeEventListener(MouseEvent.CLICK, tutorial4);
};
}
public function mouseoverListener(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
function frame64(){
stop();
MochiBot.track(this, "9ff7479c");
level = null;
ding = new Ding();
cancelBeep = new Click();
okBeep = new Beep2();
error = new Error1();
isMute = false;
muteButton.addEventListener(MouseEvent.CLICK, function (){
toggleMute();
});
muteButton.buttonMode = true;
emptyVolume = new SoundTransform(0, 0);
geckoLogo.addEventListener(MouseEvent.CLICK, function (){
NewgroundsAPI.loadMySite();
});
geckoLogo.buttonMode = true;
if (musicControl == null){
musicControl = menuMusic.play(0, 999, musicVolume);
};
newGame.addEventListener(MouseEvent.CLICK, clickListener, false, 0, true);
help.addEventListener(MouseEvent.CLICK, clickListener, false, 0, true);
hiscores.addEventListener(MouseEvent.CLICK, clickListener, false, 0, true);
newGame.addEventListener(MouseEvent.MOUSE_OVER, mouseoverListener, false, 0, true);
help.addEventListener(MouseEvent.MOUSE_OVER, mouseoverListener, false, 0, true);
hiscores.addEventListener(MouseEvent.MOUSE_OVER, mouseoverListener, false, 0, true);
newGame.addEventListener(MouseEvent.MOUSE_OUT, mouseoutListener, false, 0, true);
help.addEventListener(MouseEvent.MOUSE_OUT, mouseoutListener, false, 0, true);
hiscores.addEventListener(MouseEvent.MOUSE_OUT, mouseoutListener, false, 0, true);
}
function frame68(){
stop();
MochiScores.showLeaderboard({boardID:"a5f89edd791e4e9d", res:"800x600"});
}
function frame69(){
gotoAndStop("Title");
}
function frame77(){
nextButton.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Help2");
});
nextButton.buttonMode = true;
}
function frame78(){
nextButton.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Title");
});
nextButton.buttonMode = true;
}
function frame85(){
while (this.numChildren > 0) {
this.removeChildAt(0);
};
if (musicControl != null){
musicControl.stop();
};
musicControl = null;
targeted = 0;
level = new Level(1, this, musicVolume.volume);
addChild(level);
level.visible = false;
}
function frame86(){
level.visible = true;
}
function frame89(){
stop();
quit_btn.buttonMode = true;
quit_btn.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Title");
});
quit_btn.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
quit_btn.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame91(){
stop();
}
function frame98(){
removeChild(level);
level = null;
gotoAndStop("Title");
}
function frame105(){
while (this.numChildren > 0) {
this.removeChildAt(0);
};
if (musicControl != null){
musicControl.stop();
};
musicControl = null;
level = new Level(0, this, musicVolume.volume);
addChild(level);
level.visible = false;
}
function frame110(){
level.visible = true;
}
function frame112(){
stop();
blocker.gotoAndStop(2);
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial1);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame118(){
stop();
blocker.gotoAndStop(7);
level.forceSelectChar("Skye");
level.togglePause();
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial6);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame113(){
stop();
blocker.gotoAndStop(3);
level.forceSelectChar("Luna");
level.togglePause();
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial2);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame115(){
stop();
blocker.gotoAndStop(5);
level.forceSelectChar("Skye");
level.togglePause();
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial4);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame117(){
stop();
blocker.gotoAndStop(6);
level.forceSelectChar("Luna");
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial5);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame119(){
stop();
blocker.gotoAndStop(8);
level.forceSelectChar("Luna");
level.togglePause();
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial7);
target.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
public function toggleMute(){
if (isMute){
isMute = false;
musicVolume.volume = 0.5;
soundVolume.volume = 0.5;
musicControl.soundTransform = musicVolume;
muteButton.gotoAndStop(1);
} else {
isMute = true;
musicVolume.volume = 0;
soundVolume.volume = 0;
musicControl.soundTransform = emptyVolume;
muteButton.gotoAndStop(2);
};
}
function frame116(){
level.togglePause();
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Tutorial8");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame120(){
stop();
level.togglePause();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Tutorial12");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame122(){
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
}
function frame114(){
stop();
blocker.gotoAndStop(4);
level.forceSelectChar("Sun");
level.togglePause();
level.mouseChildren = true;
addEventListener(MouseEvent.CLICK, tutorial3);
target1.mouseEnabled = false;
target2.mouseEnabled = false;
target3.mouseEnabled = false;
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
targeting = 0;
targeted1 = false;
targeted2 = false;
targeted3 = false;
}
function frame121(){
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Tutorial13");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame111(){
stop();
level.togglePause();
blocker.gotoAndStop(1);
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Tutorial3");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.CLICK, function (){
level.clearMemory();
removeChild(level);
level = null;
gotoAndPlay("Level1");
});
skipButton.addEventListener(MouseEvent.MOUSE_OVER, function (){
skipButton.gotoAndStop(2);
});
skipButton.addEventListener(MouseEvent.MOUSE_OUT, function (){
skipButton.gotoAndStop(1);
});
}
function frame136(){
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Intro2");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
}
function frame141(){
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndStop("Intro3");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
}
function frame147(){
stop();
clickContinue.buttonMode = true;
clickContinue.addEventListener(MouseEvent.CLICK, function (){
gotoAndPlay("Tutorial");
});
clickContinue.addEventListener(MouseEvent.MOUSE_OVER, function (){
clickContinue.gotoAndStop(2);
});
clickContinue.addEventListener(MouseEvent.MOUSE_OUT, function (){
clickContinue.gotoAndStop(1);
});
}
}
}//package src.iceblast.controllers
Section 67
//GeneratorTimer (src.iceblast.controllers.GeneratorTimer)
package src.iceblast.controllers {
import src.iceblast.objects.*;
import flash.utils.*;
public class GeneratorTimer extends Timer {
public var generator:Crystal;
public function GeneratorTimer(_arg1:Crystal, _arg2:Number, _arg3:int=0){
super(_arg2, _arg3);
generator = _arg1;
}
}
}//package src.iceblast.controllers
Section 68
//Level (src.iceblast.controllers.Level)
package src.iceblast.controllers {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import src.iceblast.objects.*;
import flash.utils.*;
import mochi.as3.*;
import uk.co.bigroom.utils.*;
import src.iceblast.userinterface.*;
import flash.xml.*;
import flash.net.*;
import flash.filters.*;
import src.iceblast.char.*;
import flash.geom.*;
public class Level extends MovieClip {
var skyePower:int;
var pauseStart:int;
private var gridHeight:int;// = 600
var gridHighlight:GridHighlight;
var skyeName:String;// = "Skye"
var levelTimeLeft:int;
private var hexHeight:Number;
private var gameField:MovieClip;
var sunUsed:Boolean;// = false
var bg:LevelBG;
var sunMirage:int;
var blur:BlurFilter;
var lunaKillTime:int;// = 3000
var levelTime:int;
var actualFPS;
var totalElapsedTime:int;// = 0
var newStartTime:int;
var sunActive:Boolean;// = true
var superCrystals:Boolean;
var levellose:LevelLose;
var currCrystal:Crystal;
var currChar:String;
var scoreUI:Array;
private var screenHeight:int;// = 600
var regenTime:int;
private var screenWidth:int;// = 800
public var crystalArray:Array2D;
var luna:LunaChar;
var bg_reveal:LevelBG_Reveal;
var regenTimer:Timer;// = null
var sunRecharge:Number;// = 6000
var chainUI:Array;
var collisionLayer:MovieClip;
var skyeUsed:Boolean;// = false
private var scale:int;// = 79
var soundControl:SoundChannel;
var levelData:LevelData;
var elapsedSeconds;
var lunaPower:int;
var chainExclaim:ChainExclaim;
var props:LevelProps;
var growTime:int;
var currentLevel:int;
var lunaName:String;// = "Luna"
var profile:XMLNode;
var highlightOn:int;
var growTimeLeft:int;
var sunKillTime:int;// = 1000
var scoreLayer:MovieClip;
var randomCrystals:int;
var pauseTime:int;
var levelwin:LevelWin;
var timeElapsed:int;// = 0
var sunKiller:int;// = 0
var pauseScreen:PauseScreen;
var highlightArray:Array;
private var gridWidth:int;// = 800
var longestCombo:int;// = 0
var music:Sound;
var sunPower:int;
var fadeTimer:Timer;
var skyeRecharge:Number;// = 2000
var gameStage:MovieClip;
public var soundFXTransform:SoundTransform;
var sun:SunChar;
var startTime:int;
var icecrystal:Crystal;
var gameTimeline:MovieClip;
var isMute:Boolean;// = false
var numberCrystals:int;// = 0
var gameTimer:Timer;
var pauseOn:PauseEvent;
var crystalsRemaining:int;// = 0
public var fxManager:SoundManager;
var neighborArray:Array;
var neighborHighlight1:GridHighlight;
var neighborHighlight2:GridHighlight;
var neighborHighlight3:GridHighlight;
private var score:ScoreManager;
var neighborHighlight5:GridHighlight;
var ui:UI;
var regenStartTime:int;
var medalsWon:Array;
var neighborHighlight4:GridHighlight;
var neighborHighlight6:GridHighlight;
var missionfail:MissionFail;
var fxVolume:Number;
var soundPos:Number;
public var musicTransform:SoundTransform;
var emptyVolume:SoundTransform;
var confirmWindow:ConfirmWindow;
var messageWindow:MessageWindow;
var lunaUsed:Boolean;// = false
var skyeKillTime:int;// = 1800
var growTimer:Timer;// = null
var sunName:String;// = "Sun"
var recentFPSoutput;
public var comboStatus:Boolean;// = false
var lunaActive:Boolean;// = true
var levelMap:Array;
var timer:Number;
var grid:HexGrid;
var longestChain:int;// = 0
var skye:SkyeChar;
var totalCrystals:int;// = 100
private var hexWidth:Number;
var musicControl:SoundChannel;
var growStartTime:int;
var chainMult:int;
var pauseOff:PauseEvent;
private var fxLayer:MovieClip;
var charChargeTimer:Timer;
var gameState:int;// = 0
var gamePaused:Boolean;// = false
var lunaRecharge:Number;// = 4000
var gridOn:int;
var numFrames;// = 0
var charKillTimer:Timer;
var crystalSelect:Array;
var regenTimeLeft:int;
public var comboMult:int;// = 0
var collider:CrystalCollider;
public static var SOUND_FX:String = "sound_fx";
static var STATE_PLAY:int = 10;
public static var OK_BEEP:String = "OkBeep";
static var STATE_GAMEOVER:int = 20;
public static var PAUSE:String = "pause";
static var STATE_GAMEWIN:int = 30;
public function Level(_arg1:int, _arg2:MovieClip, _arg3:Number){
gameState = 0;
gamePaused = false;
regenTimer = null;
growTimer = null;
totalElapsedTime = 0;
timeElapsed = 0;
screenWidth = 800;
screenHeight = 600;
gridWidth = 800;
gridHeight = 600;
scale = 79;
hexWidth = ((Math.sqrt(3) / 2) * scale);
hexHeight = (Math.tan((Math.PI / 6)) * hexWidth);
totalCrystals = 100;
blur = new BlurFilter();
skyeName = "Skye";
lunaName = "Luna";
sunName = "Sun";
currChar = skyeName;
skyeRecharge = 2000;
lunaRecharge = 4000;
sunRecharge = 6000;
skyeKillTime = 1800;
lunaKillTime = 3000;
sunKillTime = 1000;
lunaActive = true;
sunActive = true;
numberCrystals = 0;
crystalsRemaining = 0;
crystalSelect = new Array();
comboMult = 0;
comboStatus = false;
longestChain = 0;
longestCombo = 0;
scoreUI = new Array();
chainUI = new Array();
gridHighlight = new GridHighlight();
neighborHighlight1 = new GridHighlight();
neighborHighlight2 = new GridHighlight();
neighborHighlight3 = new GridHighlight();
neighborHighlight4 = new GridHighlight();
neighborHighlight5 = new GridHighlight();
neighborHighlight6 = new GridHighlight();
highlightArray = new Array(neighborHighlight1, neighborHighlight2, neighborHighlight3, neighborHighlight4, neighborHighlight5, neighborHighlight6);
numFrames = 0;
isMute = false;
sunKiller = 0;
sunUsed = false;
skyeUsed = false;
lunaUsed = false;
emptyVolume = new SoundTransform(0, 0);
super();
this.currentLevel = _arg1;
this.profile = profile;
skyeRecharge = 2000;
skyeKillTime = 2000;
lunaRecharge = 4000;
lunaPower = 3;
sunRecharge = 6000;
sunMirage = 3;
sunPower = 1;
lunaKillTime = 3000;
skyePower = 1;
if (_arg3 == 0){
isMute = true;
};
musicTransform = new SoundTransform();
soundFXTransform = new SoundTransform();
musicTransform.volume = _arg3;
soundFXTransform.volume = _arg3;
fxVolume = _arg3;
gridOn = 1;
highlightOn = 1;
this.gameTimeline = _arg2;
gameStage = this;
this.addEventListener(Event.ADDED_TO_STAGE, addKeyListener);
loadLevel();
}
function fadeDone(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
if (soundFXTransform != null){
soundFXTransform.volume = fxVolume;
};
if (musicControl != null){
musicControl.stop();
};
fadeTimer.removeEventListener(TimerEvent.TIMER, fadeOut);
fadeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, fadeDone);
if (gameState == STATE_GAMEWIN){
totalElapsedTime = (totalElapsedTime + (getTimer() - newStartTime));
_local2 = (((levelTime - totalElapsedTime) / levelTime) * 100);
_local3 = score.totalScore;
_local4 = (longestChain * 100);
_local5 = (longestCombo * 100);
_local6 = (_local2 * 10);
_local7 = (((_local3 + _local4) + _local5) + _local6);
_local3 = ((_local3 + _local4) + _local5);
levelwin = new LevelWin();
levelwin.x = (levelwin.x + 400);
levelwin.y = (levelwin.y + 300);
levelwin.mc.bodyHeat.text = _local6;
levelwin.mc.performance.text = score.totalScore;
levelwin.mc.credits.text = _local7;
levelwin.mc.chain.text = _local4;
levelwin.mc.combo.text = _local5;
profile.attributes.level++;
_local8 = parseInt(profile.attributes.hiscore);
_local8 = (_local8 + _local7);
profile.attributes.hiscore = _local8;
_local8 = parseInt(profile.attributes.money);
_local8 = (_local8 + _local7);
profile.attributes.money = _local8;
_local8 = parseInt(profile.attributes.total_time);
_local8 = (_local8 + totalElapsedTime);
profile.attributes.total_time = _local8;
medalsWon = new Array();
checkMedals(_local2, score.totalScore, _local3, longestChain, longestCombo);
if (medalsWon.length > 0){
levelwin.mc.okButton.addEventListener(MouseEvent.CLICK, showMedals, false, 0, true);
} else {
levelwin.mc.okButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
};
addChild(levelwin);
};
}
function resetRegen(){
regenTimeLeft = regenTime;
regenStartTime = getTimer();
regenTimer = new Timer(regenTime, 1);
regenTimer.start();
regenTimer.addEventListener(TimerEvent.TIMER_COMPLETE, regenCrystal, false, 0, true);
}
function placeCrystal(_arg1:int, _arg2:int, _arg3:int):Crystal{
var _local4:ColorTransform;
collider = ObjectPool.getObject(CrystalCollider);
icecrystal = ObjectPool.getObject(Crystal, _arg1, _arg2, _arg3, collider);
icecrystal.name = ((_arg1 + " ") + _arg2);
icecrystal.resetCrystal(_arg1, _arg2, _arg3, collider);
if (gameState == STATE_GAMEWIN){
icecrystal.gotoAndPlay("Grow");
};
collider.crystalTarget = icecrystal;
collider.gotoAndStop(_arg3);
_local4 = icecrystal.transform.colorTransform;
_local4.redMultiplier = 1.05;
_local4.greenMultiplier = 1.05;
_local4.blueMultiplier = 1.05;
icecrystal.transform.colorTransform = _local4;
addEventListener(PAUSE, icecrystal.pauseCrystal);
gameField.addChild(icecrystal);
collisionLayer.addChild(collider);
collider.addEventListener(MouseEvent.MOUSE_OVER, crystalOver);
collider.addEventListener(MouseEvent.MOUSE_OUT, crystalOut);
collider.addEventListener(MouseEvent.CLICK, handleInput);
icecrystal.addEventListener(Crystal.SCORE, updateScore);
icecrystal.addEventListener(Crystal.CHAIN, handleChain);
icecrystal.addEventListener("crystaldied", handleDeath);
icecrystal.addEventListener("resetcombo", resetCombo);
icecrystal.addEventListener("addcombo", addCombo);
icecrystal.addEventListener(SOUND_FX, handleSounds);
if ((_arg1 % 2) == 0){
icecrystal.x = ((_arg1 * hexWidth) + 100);
icecrystal.y = ((_arg2 * hexHeight) + 80);
collider.x = ((_arg1 * hexWidth) + 100);
collider.y = ((_arg2 * hexHeight) + 80);
} else {
icecrystal.x = ((_arg1 * hexWidth) + 100);
icecrystal.y = (((_arg2 * hexHeight) + (hexHeight / 2)) + 80);
collider.x = ((_arg1 * hexWidth) + 100);
collider.y = (((_arg2 * hexHeight) + (hexHeight / 2)) + 80);
};
sortDepth(gameField);
sortDepth(collisionLayer);
return (icecrystal);
}
function crystalOut(_arg1:Event){
var _local2:Crystal;
var _local3:int;
if (gameState == STATE_PLAY){
gridHighlight.visible = false;
_local2 = _arg1.target.crystalTarget;
neighborArray = getNeighbours(_local2.coordX, _local2.coordY);
_local3 = 0;
while (_local3 < neighborArray.length) {
if (neighborArray[_local3] != "X"){
highlightArray[_local3].visible = false;
};
_local3++;
};
};
}
function regenCrystal(_arg1:Object){
var _local2:int;
var _local3:*;
var _local4:*;
var _local5:int;
_local2 = 1;
if (profile.attributes.hardmode == 0){
if ((((currentLevel >= 13)) && ((currentLevel < 17)))){
_local2 = Math.ceil((Math.random() * 2));
};
if ((((currentLevel >= 17)) && ((currentLevel < 21)))){
_local2 = Math.ceil((Math.random() * 3));
};
if ((((currentLevel >= 25)) && ((currentLevel < 27)))){
_local2 = Math.ceil((Math.random() * 2));
};
if (currentLevel >= 27){
_local2 = Math.ceil((Math.random() * 3));
};
} else {
_local2 = Math.ceil((Math.random() * 4));
};
if (_local2 > crystalsRemaining){
_local2 = crystalsRemaining;
};
_local3 = 0;
while (_local3 < _local2) {
_local4 = getRandomCrystal();
if (_local4 != null){
_local5 = 0;
if (_local4.life == 6){
while (_local5 < 5) {
_local5++;
_local4 = getRandomCrystal();
if (_local4.life < 6){
_local5 = 6;
};
};
};
if (_local4.life < 6){
_local4.gotoAndPlay("Regen");
_local4.regen();
};
};
_local3++;
};
resetRegen();
}
function removeScore(_arg1:Event){
scoreLayer.removeChild(scoreLayer.getChildByName(scoreUI.shift()));
_arg1.target.removeEventListener("scoredone", removeScore);
removeEventListener(PAUSE, _arg1.target.pauseScore);
}
function generateCrystals(_arg1:Crystal){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Crystal;
_local2 = getNeighbours(_arg1.coordX, _arg1.coordY);
if (_local2.length > 0){
dispatchEvent(new SoundfxEvent("Shield", "sound_fx"));
_local3 = _arg1.coordX;
_local4 = _arg1.coordY;
if ((_local3 % 2) == 0){
if (crystalArray.get(_local3, (_local4 - 1)) == null){
_local5 = placeCrystal(_local3, (_local4 - 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 + 1), (_local4 + 1)) == null){
_local5 = placeCrystal((_local3 + 1), (_local4 + 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 + 1), _local4) == null){
_local5 = placeCrystal((_local3 + 1), _local4, 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get(_local3, (_local4 + 1)) == null){
_local5 = placeCrystal(_local3, (_local4 + 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 - 1), _local4) == null){
_local5 = placeCrystal((_local3 - 1), _local4, 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 - 1), (_local4 - 1)) == null){
_local5 = placeCrystal((_local3 - 1), (_local4 - 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
} else {
if (crystalArray.get(_local3, (_local4 - 1)) == null){
_local5 = placeCrystal(_local3, (_local4 - 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 + 1), _local4) == null){
_local5 = placeCrystal((_local3 + 1), _local4, 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 + 1), (_local4 + 1)) == null){
_local5 = placeCrystal((_local3 + 1), (_local4 + 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get(_local3, (_local4 + 1)) == null){
_local5 = placeCrystal(_local3, (_local4 + 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 - 1), (_local4 + 1)) == null){
_local5 = placeCrystal((_local3 - 1), (_local4 + 1), 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
if (crystalArray.get((_local3 - 1), _local4) == null){
_local5 = placeCrystal((_local3 - 1), _local4, 0);
_local5.gotoAndPlay("Glow");
crystalArray.set(_local5.coordX, _local5.coordY, _local5);
crystalsRemaining++;
};
};
sortDepth(gameField);
};
}
function enableHotkeys(){
stage.addEventListener(KeyboardEvent.KEY_DOWN, selectChar);
}
function addKeyListener(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, addKeyListener);
stage.addEventListener(KeyboardEvent.KEY_DOWN, selectChar);
}
function explode(){
var _local1:Array;
var _local2:int;
dispatchEvent(new SoundfxEvent(SoundfxEvent.ICE_EXPLODE, "sound_fx"));
dispatchEvent(new SoundfxEvent(SoundfxEvent.ICE_BREAK, "sound_fx"));
_local1 = crystalArray.array;
_local2 = 0;
while (_local2 < _local1.length) {
if (((!((_local1[_local2] == null))) && (!((_local1[_local2] == 8))))){
Crystal(_local1[_local2]).suicide(1);
Crystal(_local1[_local2]).gotoAndPlay("GenerateIce");
};
_local2++;
};
ui.comboGauge.gotoAndStop(1);
comboMult = 0;
}
function checkHex(_arg1:Event){
var _local2:Array;
var _local3:Object;
var _local4:int;
_local2 = hexCoords(this.mouseX, this.mouseY);
if ((((_local2[0] < 1)) || ((_local2[0] > 10)))){
_local3 = null;
} else {
_local3 = crystalArray.get((_local2[0] - 1), (_local2[1] - 1));
};
if (((!((_local3 == 8))) && (!((_local3 == null))))){
currCrystal = Crystal(_local3);
gridHighlight.visible = true;
if ((((((((_local2[0] > 0)) && ((_local2[0] < 11)))) && ((_local2[1] > 0)))) && ((_local2[1] < 12)))){
if (((_local2[0] - 1) % 2) == 0){
gridHighlight.x = (((_local2[0] - 1) * hexWidth) + 100);
gridHighlight.y = (((_local2[1] - 1) * hexHeight) + 80);
} else {
gridHighlight.x = (((_local2[0] - 1) * hexWidth) + 100);
gridHighlight.y = ((((_local2[1] - 1) * hexHeight) + (hexHeight / 2)) + 80);
};
};
_local4 = 0;
while (_local4 < 6) {
highlightArray[_local4].visible = false;
_local4++;
};
neighborArray = getNeighbours((_local2[0] - 1), (_local2[1] - 1));
_local4 = 0;
while (_local4 < neighborArray.length) {
if (neighborArray[_local4] != 8){
highlightArray[_local4].visible = true;
highlightArray[_local4].x = neighborArray[_local4].x;
highlightArray[_local4].y = neighborArray[_local4].y;
};
_local4++;
};
} else {
currCrystal = null;
gridHighlight.visible = false;
_local4 = 0;
while (_local4 < 6) {
highlightArray[_local4].visible = false;
_local4++;
};
};
}
function crystalOver(_arg1:MouseEvent){
var _local2:Crystal;
var _local3:int;
_local2 = _arg1.target.crystalTarget;
gridHighlight.visible = true;
gridHighlight.x = _local2.getCoords()[0];
gridHighlight.y = _local2.getCoords()[1];
_local3 = 0;
while (_local3 < 6) {
highlightArray[_local3].visible = false;
_local3++;
};
neighborArray = getNeighbours(_local2.coordX, _local2.coordY);
_local3 = 0;
while (_local3 < neighborArray.length) {
if (((!((neighborArray[_local3] == "X"))) && (!((neighborArray[_local3] == 8))))){
highlightArray[_local3].visible = true;
highlightArray[_local3].x = neighborArray[_local3].x;
highlightArray[_local3].y = neighborArray[_local3].y;
};
_local3++;
};
}
function updateUI(){
ui.thermometer.thermotimer.scaleX = (1 - ((getTimer() - timer) / levelTime));
if (currChar == skyeName){
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
if (skye.active){
ui.skyeButton.gotoAndStop(2);
} else {
ui.skyeButton.gotoAndStop(3);
};
};
if (currChar == lunaName){
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
if (luna.active){
ui.lunaButton.gotoAndStop(2);
} else {
ui.lunaButton.gotoAndStop(3);
};
};
if (currChar == sunName){
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(2);
} else {
ui.sunButton.gotoAndStop(3);
};
};
}
function confirmQuit(_arg1:Event):void{
if (_arg1.target.name == "confirmOK"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
confirmWindow.confirmOK.removeEventListener(MouseEvent.CLICK, confirmQuit);
confirmWindow.confirmCancel.removeEventListener(MouseEvent.CLICK, confirmQuit);
gameStage.removeChild(confirmWindow);
gameStage.removeChild(pauseScreen);
gameStage.removeEventListener("enterFrame", mainLoop);
confirmWindow = null;
clearMemory();
gameTimeline.gotoAndStop("Title");
} else {
if (_arg1.target.name == "confirmCancel"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CANCEL_BEEP, "sound_fx"));
gameStage.removeChild(confirmWindow);
} else {
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
confirmWindow = new ConfirmWindow("Quit to main menu?", 400, 100);
confirmWindow.x = 400;
confirmWindow.y = 300;
confirmWindow.confirmOK.x = (confirmWindow.confirmOK.x - 50);
confirmWindow.confirmCancel.x = (confirmWindow.confirmCancel.x - 50);
confirmWindow.confirmOK.addEventListener(MouseEvent.CLICK, confirmQuit, false, 0, true);
confirmWindow.confirmCancel.addEventListener(MouseEvent.CLICK, confirmQuit, false, 0, true);
gameStage.addChild(confirmWindow);
};
};
}
function handleDeath(_arg1:Event){
var tempCrystal:Crystal;
var tempArray:Array;
var i:int;
var e = _arg1;
try {
tempCrystal = Crystal(e.target);
tempArray = new Array();
if (crystalSelect.length > 0){
i = 0;
while (i < crystalSelect.length) {
if (tempCrystal != crystalSelect[i]){
tempArray.push(crystalSelect[i]);
} else {
sun.unmarkCrystal(tempCrystal);
};
i = (i + 1);
};
if (tempArray.length < crystalSelect.length){
crystalSelect = tempArray;
};
};
if (checkGen(tempCrystal)){
tempCrystal.fullRegen();
tempCrystal.collider.gotoAndStop(6);
} else {
if (tempCrystal.life != 7){
crystalArray.set(tempCrystal.coordX, tempCrystal.coordY, null);
removeEventListener(PAUSE, tempCrystal.pauseCrystal);
gameField.removeChild(tempCrystal);
collisionLayer.removeChild(tempCrystal.collider);
ObjectPool.disposeObject(tempCrystal, Crystal);
ObjectPool.disposeObject(tempCrystal.collider, CrystalCollider);
crystalsRemaining--;
tempCrystal.removeEventListener(Crystal.SCORE, updateScore);
tempCrystal.removeEventListener(Crystal.CHAIN, handleChain);
tempCrystal.removeEventListener("crystaldied", handleDeath);
tempCrystal.removeEventListener("resetcombo", resetCombo);
tempCrystal.removeEventListener("addcombo", addCombo);
tempCrystal.removeEventListener(SOUND_FX, handleSounds);
tempCrystal.collider.removeEventListener(MouseEvent.MOUSE_OVER, crystalOver);
tempCrystal.collider.removeEventListener(MouseEvent.MOUSE_OUT, crystalOut);
tempCrystal.collider.removeEventListener(MouseEvent.CLICK, handleInput);
tempCrystal.clearMemory();
tempCrystal = null;
if (crystalsRemaining == crystalSelect.length){
if (crystalSelect.length > 0){
ui.sunButton.gotoAndStop(3);
sun.killCrystals();
crystalSelect = new Array();
};
};
};
};
} catch(e:Error) {
};
}
function getRandomCrystal():Crystal{
var _local1:Boolean;
var _local2:Object;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:int;
_local1 = false;
_local3 = 0;
_local5 = new Array();
_local6 = 0;
while (_local6 < 100) {
if (((!((crystalArray.array[_local6] == null))) && (!((crystalArray.array[_local6] == 8))))){
_local5.push(crystalArray.array[_local6]);
};
_local6++;
};
if (_local5.length == 1){
return (Crystal(_local5[0]));
};
while (_local1 == false) {
_local4 = Math.floor((Math.random() * _local5.length));
_local2 = _local5[_local4];
if (((!((_local2 == null))) && (!((_local2 == 8))))){
_local1 = true;
};
};
return (Crystal(_local2));
}
function addCombo(_arg1:Event){
var e = _arg1;
if (comboMult < 10){
comboMult++;
};
if (longestCombo < comboMult){
longestCombo = comboMult;
};
if ((((comboMult > 1)) && ((comboMult <= 10)))){
ui.comboGauge.gotoAndStop(comboMult);
};
if (comboMult == 10){
if (ui.powButton.visible == false){
dispatchEvent(new SoundfxEvent(SoundfxEvent.COMBO, "sound_fx"));
ui.powButton.visible = true;
ui.powButton.gotoAndPlay(1);
ui.powButton.addEventListener(MouseEvent.CLICK, function (){
ui.powButton.visible = false;
ui.powButton.gotoAndStop(1);
});
};
};
}
function checkGen(_arg1:Crystal):Boolean{
var _local2:Array;
var _local3:Crystal;
var _local4:int;
var _local5:*;
var _local6:*;
_local2 = getNeighbours(_arg1.coordX, _arg1.coordY);
_local3 = null;
_local4 = 0;
if (_arg1.life != 7){
_local5 = 0;
while (_local5 < _local2.length) {
if (_local2[_local5] != 8){
if (Crystal(_local2[_local5]).life == 7){
_local3 = Crystal(_local2[_local5]);
};
};
_local5++;
};
if (_local3 != null){
_local2 = getNeighbours(_local3.coordX, _local3.coordY);
_local5 = 0;
while (_local5 < _local2.length) {
if (_local2[_local5] != 8){
if (Crystal(_local2[_local5]).life > 1){
_local4++;
};
};
_local5++;
};
if (_local4 > 0){
return (true);
};
_local3.life = 8;
_local3.crystalMC.gotoAndStop(8);
crystalArray.set(_arg1.coordX, _arg1.coordY, null);
_local6 = new GeneratorTimer(_local3, 2500, 1);
_local6.addEventListener(TimerEvent.TIMER_COMPLETE, callGenerator, false, 0, true);
_local6.start();
return (false);
} else {
return (false);
};
//unresolved jump
};
return (false);
}
function handleChain(_arg1:ChainEvent):void{
var _local2:Array;
var _local3:*;
_local2 = getNeighbours(_arg1.coordX, _arg1.coordY);
if (longestChain < _arg1.chainMult){
longestChain = _arg1.chainMult;
};
_local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3] != 8){
if (_local2[_local3].life > 0){
_local2[_local3].killChain(_arg1.chainMult);
};
};
_local3++;
};
if (_arg1.chainMult == 4){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CHAIN, "sound_fx"));
chainExclaim.chainmc.chaintext.text = "Nice Chain!";
chainExclaim.gotoAndPlay(1);
};
if (_arg1.chainMult == 6){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CHAIN, "sound_fx"));
chainExclaim.chainmc.chaintext.text = "Cool Chain!";
chainExclaim.gotoAndPlay(1);
};
if (_arg1.chainMult == 8){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CHAIN, "sound_fx"));
chainExclaim.chainmc.chaintext.text = "Great Chain!";
chainExclaim.gotoAndPlay(1);
};
if (_arg1.chainMult == 10){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CHAIN, "sound_fx"));
chainExclaim.chainmc.chaintext.text = "Awesome Chain!";
chainExclaim.gotoAndPlay(1);
};
}
function resetCombo(_arg1:Event){
comboMult = 0;
ui.comboGauge.gotoAndStop(1);
}
function soundReset(_arg1:Event){
musicControl = music.play(0, 0, musicTransform);
musicControl.addEventListener(Event.SOUND_COMPLETE, soundReset, false, 0, true);
}
public function handleSounds(_arg1:SoundfxEvent){
fxManager.playFX(_arg1.fxType);
}
function levelStop():void{
removeEventListener("enterFrame", mainLoop);
}
function clearMemory():void{
var temp:CrystalCollider;
removeListeners();
if (musicControl != null){
musicControl.stop();
};
neighborArray = null;
icecrystal = null;
collider = null;
crystalArray.clear();
crystalArray = null;
fxManager.clear();
try {
while (gameField.numChildren > 0) {
gameField.removeChildAt(0);
};
while (props.numChildren > 0) {
props.removeChildAt(0);
};
while (bg.numChildren > 0) {
bg.removeChildAt(0);
};
while (ui.numChildren > 0) {
ui.removeChildAt(0);
};
while (fxLayer.numChildren > 0) {
fxLayer.removeChildAt(0);
};
while (collisionLayer.numChildren > 0) {
temp = CrystalCollider(collisionLayer.getChildAt(0));
temp.removeEventListener(MouseEvent.MOUSE_OVER, crystalOver);
temp.removeEventListener(MouseEvent.MOUSE_OUT, crystalOut);
temp.removeEventListener(MouseEvent.CLICK, handleInput);
collisionLayer.removeChildAt(0);
temp = null;
};
while (gameStage.numChildren > 0) {
gameStage.removeChildAt(0);
};
} catch(e:Error) {
};
if (highlightOn == 1){
gameStage.removeEventListener(MouseEvent.MOUSE_MOVE, checkHex);
};
skye.clearMemory();
luna.clearMemory();
sun.clearMemory();
skye = null;
sun = null;
luna = null;
musicControl.stop();
musicControl = null;
music = null;
gameField = null;
ui = null;
bg = null;
props = null;
gameTimer.stop();
regenTimer = null;
growTimer = null;
gameTimer = null;
fxManager = null;
soundFXTransform = null;
musicTransform = null;
removeEventListener(SOUND_FX, handleSounds);
}
function showMedals(_arg1:Event){
var _local2:String;
var _local3:int;
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
removeChild(levelwin);
_local2 = "You won a Medal!\n";
if (medalsWon.length > 1){
_local2 = "You won these Medals!\n";
};
_local3 = 0;
while (_local3 < medalsWon.length) {
_local2 = (_local2 + medalsWon[_local3]);
_local3++;
};
messageWindow = new MessageWindow(_local2, 300, 100);
messageWindow.x = 400;
messageWindow.y = 300;
messageWindow.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
messageWindow.name = "medalswon";
addChild(messageWindow);
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
}
public function buildLevel(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Crystal;
var _local5:int;
var _local6:int;
var _local7:int;
_local1 = 0;
while (_local1 < 10) {
_local2 = 0;
while (_local2 < 10) {
if (_local1 > 0){
_local3 = (_local1.toString() + _local2.toString());
} else {
_local3 = _local2;
};
if ((((levelMap[_local3] > 0)) && ((levelMap[_local3] < 8)))){
_local4 = placeCrystal(_local1, _local2, levelMap[_local3]);
crystalArray.set(_local1, _local2, _local4);
crystalsRemaining++;
};
if (levelMap[_local3] == 8){
crystalArray.set(_local1, _local2, 8);
totalCrystals--;
};
_local2++;
};
_local1++;
};
while (randomCrystals-- != 0) {
_local5 = Math.floor((Math.random() * 10));
_local6 = Math.floor((Math.random() * 10));
while (crystalArray.get(_local5, _local6) != null) {
_local5 = Math.floor((Math.random() * 10));
_local6 = Math.floor((Math.random() * 10));
};
if (crystalArray.get(_local5, _local6) == null){
if (superCrystals){
_local7 = Math.ceil((Math.random() * 100));
if ((((_local7 > 0)) && ((_local7 <= 5)))){
_local7 = 1;
};
if ((((_local7 > 5)) && ((_local7 <= 15)))){
_local7 = 2;
};
if ((((_local7 > 15)) && ((_local7 <= 60)))){
_local7 = 3;
};
if ((((_local7 > 60)) && ((_local7 <= 95)))){
_local7 = 4;
};
if ((((_local7 > 95)) && ((_local7 <= 100)))){
_local7 = 5;
};
crystalArray.set(_local5, _local6, placeCrystal(_local5, _local6, _local7));
crystalsRemaining++;
} else {
crystalArray.set(_local5, _local6, placeCrystal(_local5, _local6, Math.ceil((Math.random() * 3))));
crystalsRemaining++;
};
};
};
sortDepth(gameField);
}
function resetGrow(){
sortDepth(gameField);
growTimeLeft = growTime;
growStartTime = getTimer();
growTimer = new Timer(growTime, 1);
growTimer.start();
growTimer.addEventListener(TimerEvent.TIMER_COMPLETE, growCrystal, false, 0, true);
}
function callGenerator(_arg1:Event){
var _local2:*;
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, callGenerator);
if (crystalArray.get(_arg1.currentTarget.generator.coordX, _arg1.currentTarget.generator.coordY) != null){
_local2 = getNeighbours(_arg1.currentTarget.generator.coordX, _arg1.currentTarget.generator.coordY);
if (_local2.length > 0){
_arg1.currentTarget.generator.life = 7;
_arg1.currentTarget.generator.crystalMC.gotoAndStop(7);
_arg1.currentTarget.generator.gotoAndPlay("GenerateIce");
generateCrystals(Crystal(_arg1.currentTarget.generator));
};
};
}
function removeListeners(){
var _local1:int;
_local1 = 0;
while (_local1 < collisionLayer.numChildren) {
collisionLayer.getChildAt(_local1).removeEventListener(MouseEvent.MOUSE_OVER, crystalOver);
collisionLayer.getChildAt(_local1).removeEventListener(MouseEvent.MOUSE_OUT, crystalOut);
_local1++;
};
stage.removeEventListener(KeyboardEvent.KEY_DOWN, selectChar);
ui.skyeButton.removeEventListener(MouseEvent.CLICK, selectChar);
ui.lunaButton.removeEventListener(MouseEvent.CLICK, selectChar);
ui.sunButton.removeEventListener(MouseEvent.CLICK, selectChar);
ui.muteButton.removeEventListener(MouseEvent.CLICK, muteToggle);
ui.muteButton.buttonMode = true;
removeEventListener(PAUSE, skye.pauseSkye);
removeEventListener(PAUSE, luna.pauseLuna);
removeEventListener(PAUSE, sun.pauseSun);
if (regenTimer != null){
regenTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, regenCrystal);
};
if (growTimer != null){
growTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, growCrystal);
};
removeEventListener(SOUND_FX, handleSounds);
skye.removeEventListener(SOUND_FX, handleSounds);
luna.removeEventListener(SOUND_FX, handleSounds);
sun.removeEventListener(SOUND_FX, handleSounds);
musicControl.removeEventListener(Event.SOUND_COMPLETE, soundReset);
gameTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
gameStage.removeEventListener("enterFrame", mainLoop);
ui.skyeButton.removeEventListener(MouseEvent.CLICK, selectChar);
ui.lunaButton.removeEventListener(MouseEvent.CLICK, selectChar);
ui.sunButton.removeEventListener(MouseEvent.CLICK, selectChar);
}
function gameplay(){
updateUI();
if (crystalsRemaining == 0){
gameState = STATE_GAMEWIN;
};
}
function loadLevel(){
var i:int;
if (currentLevel > 0){
levelData = new LevelData(currentLevel, 0);
if (currentLevel == 1){
levelTime = 90000;
} else {
levelTime = (90000 - (currentLevel * 4));
};
regenTime = 0;
growTime = 0;
randomCrystals = (numberCrystals + (currentLevel * 5));
if (randomCrystals > 45){
randomCrystals = 45;
};
superCrystals = Boolean(levelData.superCrystals);
regenTimeLeft = 0;
growTimeLeft = 0;
};
if (currentLevel == 0){
levelData = new LevelData(currentLevel, 0);
levelTime = 360000;
regenTime = 0;
growTime = 0;
randomCrystals = 0;
superCrystals = false;
regenTimeLeft = 0;
growTimeLeft = 0;
};
levelMap = levelData.levelMap;
gameField = new MovieClip();
fxLayer = new MovieClip();
collisionLayer = new MovieClip();
scoreLayer = new MovieClip();
score = new ScoreManager();
crystalArray = new Array2D(10, 10);
crystalArray.fill(null);
bg = new LevelBG();
bg.gotoAndStop(("Level" + currentLevel));
bg.cacheAsBitmap = true;
props = new LevelProps();
props.gotoAndStop(("Level" + currentLevel));
props.cacheAsBitmap = true;
gameStage.addChild(bg);
bg.x = 400;
bg.y = 300;
if (gridOn == 1){
grid = new HexGrid();
gameStage.addChild(grid);
grid.x = 398;
grid.y = 265;
grid.alpha = 0.1;
};
if (highlightOn == 1){
gridHighlight.alpha = 0.4;
gridHighlight.x = (gridHighlight.x - 50);
gameStage.addChild(gridHighlight);
i = 0;
while (i < 6) {
gameStage.addChild(highlightArray[i]);
highlightArray[i].alpha = 0.2;
highlightArray[i].x = (highlightArray[i].x - 50);
i = (i + 1);
};
};
gameStage.addChild(props);
props.mouseEnabled = false;
props.x = 400;
props.y = 300;
ui = new UI();
ui.x = 400;
ui.y = 300;
ui.thermometer.thermotimer.width = 369.9;
ui.powButton.visible = false;
ui.comboGauge.gotoAndStop(1);
ui.powButton.addEventListener(MouseEvent.CLICK, function (){
explode();
});
if (isMute){
ui.muteButton.gotoAndStop(2);
} else {
ui.muteButton.gotoAndStop(1);
};
ui.skyeButton.mc.mouseEnabled = false;
ui.lunaButton.mc.mouseEnabled = false;
ui.sunButton.mc.mouseEnabled = false;
ui.skyeButton.addEventListener(MouseEvent.CLICK, selectChar);
ui.lunaButton.addEventListener(MouseEvent.CLICK, selectChar);
ui.sunButton.addEventListener(MouseEvent.CLICK, selectChar);
ui.muteButton.addEventListener(MouseEvent.CLICK, muteToggle);
ui.skyeButton.gotoAndStop(2);
skye = new SkyeChar("skye", skyeRecharge, skyeKillTime, skyePower, gameField, ui);
luna = new LunaChar("luna", lunaRecharge, lunaKillTime, lunaPower, gameField, ui);
sun = new SunChar("sun", sunRecharge, sunPower, sunMirage, gameField, ui, fxLayer);
skye.mouseEnabled = false;
luna.mouseEnabled = false;
sun.mouseEnabled = false;
gameStage.addChild(skye);
gameStage.addChild(luna);
gameStage.addChild(sun);
addEventListener(PAUSE, skye.pauseSkye);
addEventListener(PAUSE, luna.pauseLuna);
addEventListener(PAUSE, sun.pauseSun);
if (regenTime > 0){
regenTimer = new Timer(regenTime, 1);
regenTimer.addEventListener(TimerEvent.TIMER_COMPLETE, regenCrystal, false, 0, true);
regenTimer.start();
regenStartTime = getTimer();
};
if (growTime > 0){
growTimer = new Timer(growTime, 1);
growTimer.addEventListener(TimerEvent.TIMER_COMPLETE, growCrystal, false, 0, true);
growTimer.start();
growStartTime = getTimer();
};
buildLevel();
gameStage.addChild(gameField);
gameStage.addChild(fxLayer);
gameStage.addChild(scoreLayer);
gameStage.addChild(collisionLayer);
collisionLayer.alpha = 0.01;
collisionLayer.cacheAsBitmap = true;
chainExclaim = new ChainExclaim();
chainExclaim.gotoAndStop(1);
chainExclaim.x = 400;
chainExclaim.y = 450;
gameStage.addChild(chainExclaim);
gameStage.addChild(ui);
levelTimeLeft = levelTime;
gameTimer = new Timer(levelTime, 1);
startTime = getTimer();
timer = startTime;
pauseStart = startTime;
pauseTime = startTime;
newStartTime = startTime;
regenStartTime = startTime;
growStartTime = startTime;
fxManager = new SoundManager(soundFXTransform);
addEventListener(SOUND_FX, handleSounds);
skye.addEventListener(SOUND_FX, handleSounds);
luna.addEventListener(SOUND_FX, handleSounds);
sun.addEventListener(SOUND_FX, handleSounds);
music = new TropicalMusic();
musicControl = music.play(0, 0, musicTransform);
musicControl.addEventListener(Event.SOUND_COMPLETE, soundReset, false, 0, true);
gameTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
gameTimer.start();
gameState = STATE_PLAY;
gameStage.addEventListener("enterFrame", mainLoop);
}
function timeUp(_arg1:TimerEvent):void{
gameState = STATE_GAMEOVER;
}
function selectChar(_arg1:Event):void{
if (_arg1.type == MouseEvent.CLICK){
dispatchEvent(new SoundfxEvent(SoundfxEvent.SELECTION, "sound_fx"));
if (_arg1.target.name == "skyeButton"){
sun.unmark();
crystalSelect = new Array();
currChar = skyeName;
ui.skyeButton.gotoAndStop(2);
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (_arg1.target.name == "lunaButton"){
sun.unmark();
crystalSelect = new Array();
currChar = lunaName;
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
ui.lunaButton.gotoAndStop(2);
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (_arg1.target.name == "sunButton"){
currChar = sunName;
if (crystalSelect.length > 0){
crystalSelect = new Array();
sun.unmark();
};
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
ui.sunButton.gotoAndStop(2);
};
} else {
if (_arg1.type == KeyboardEvent.KEY_DOWN){
if (KeyboardEvent(_arg1).keyCode == 65){
dispatchEvent(new SoundfxEvent(SoundfxEvent.SELECTION, "sound_fx"));
sun.unmark();
crystalSelect = new Array();
currChar = skyeName;
ui.skyeButton.gotoAndStop(2);
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (KeyboardEvent(_arg1).keyCode == 83){
dispatchEvent(new SoundfxEvent(SoundfxEvent.SELECTION, "sound_fx"));
sun.unmark();
crystalSelect = new Array();
currChar = lunaName;
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
ui.lunaButton.gotoAndStop(2);
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (KeyboardEvent(_arg1).keyCode == 68){
dispatchEvent(new SoundfxEvent(SoundfxEvent.SELECTION, "sound_fx"));
currChar = sunName;
if (crystalSelect.length > 0){
crystalSelect = new Array();
sun.unmark();
};
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
ui.sunButton.gotoAndStop(2);
};
};
};
}
public function handleInput(_arg1:MouseEvent):void{
var _local2:Boolean;
var _local3:int;
currCrystal = Crystal(_arg1.target.crystalTarget);
_local2 = true;
if (currCrystal != null){
if ((((currChar == skyeName)) && (skye.active))){
ui.skyeButton.gotoAndStop(3);
currCrystal.chainMult = 0;
if (!currCrystal.willDie(skyePower)){
if (comboMult <= 10){
comboMult = 0;
ui.comboGauge.gotoAndStop(1);
ui.powButton.visible = false;
ui.powButton.gotoAndPlay(1);
};
};
if (longestCombo < comboMult){
longestCombo = comboMult;
};
if (comboMult > 1){
ui.comboGauge.gotoAndStop(comboMult);
};
skye.killCrystal(currCrystal.coordX, currCrystal.coordY, crystalArray);
if (skyeUsed == false){
skyeUsed = true;
};
} else {
if ((((currChar == lunaName)) && (luna.active))){
ui.lunaButton.gotoAndStop(3);
currCrystal.chainMult = 0;
if (!currCrystal.willDie(lunaPower)){
if (comboMult <= 10){
comboMult = 0;
ui.comboGauge.gotoAndStop(1);
ui.powButton.visible = false;
ui.powButton.gotoAndPlay(1);
};
};
if (longestCombo < comboMult){
longestCombo = comboMult;
};
if (comboMult > 1){
ui.comboGauge.gotoAndStop(comboMult);
};
luna.killCrystal(currCrystal.coordX, currCrystal.coordY, crystalArray);
if (lunaUsed == false){
lunaUsed = true;
};
} else {
if ((((currChar == sunName)) && (sun.active))){
sunKiller = 0;
if (sun.mark(currCrystal)){
crystalSelect.push(currCrystal);
if (crystalSelect.length == sun.killLength){
ui.sunButton.gotoAndStop(3);
currCrystal.chainMult = 0;
_local3 = sun.willCombo();
if (_local3 == 0){
if (comboMult <= 10){
comboMult = 0;
ui.comboGauge.gotoAndStop(1);
ui.powButton.visible = false;
ui.powButton.gotoAndPlay(1);
};
};
sun.killCrystals();
crystalSelect = new Array();
if (sunUsed == false){
sunUsed = true;
};
};
if (crystalsRemaining == crystalSelect.length){
ui.sunButton.gotoAndStop(3);
currCrystal.chainMult = 0;
_local2 = true;
sun.killCrystals();
crystalSelect = new Array();
if (sunUsed == false){
sunUsed = true;
};
};
};
} else {
dispatchEvent(new SoundfxEvent("ErrorSound", "sound_fx"));
};
};
};
};
}
function setPause(_arg1:Event){
if (gamePaused){
if (_arg1.type != PAUSE){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
musicControl = music.play(soundPos, 0, musicTransform);
musicControl.addEventListener(Event.SOUND_COMPLETE, soundReset, false, 0, true);
gameField.filters = null;
ui.filters = null;
bg.filters = null;
props.filters = null;
if (gridOn == 1){
grid.filters = null;
};
if (highlightOn == 1){
gridHighlight.filters = null;
neighborHighlight1.filters = null;
neighborHighlight2.filters = null;
neighborHighlight3.filters = null;
neighborHighlight4.filters = null;
neighborHighlight5.filters = null;
neighborHighlight6.filters = null;
};
if (pauseScreen != null){
gameStage.removeChild(pauseScreen);
};
};
gamePaused = false;
timeElapsed = (pauseStart - newStartTime);
totalElapsedTime = (totalElapsedTime + timeElapsed);
newStartTime = getTimer();
levelTimeLeft = (levelTimeLeft - timeElapsed);
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
gameTimer = new Timer(levelTimeLeft, 1);
gameTimer.start();
gameTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeUp, false, 0, true);
if (regenTimer != null){
regenTimeLeft = (regenTimeLeft - (pauseStart - regenStartTime));
regenTimer = new Timer(regenTimeLeft, 1);
regenStartTime = getTimer();
regenTimer.start();
regenTimer.addEventListener(TimerEvent.TIMER_COMPLETE, regenCrystal, false, 0, true);
};
if (growTimer != null){
growTimeLeft = (growTimeLeft - (pauseStart - growStartTime));
growTimer = new Timer(growTimeLeft, 1);
growStartTime = getTimer();
growTimer.start();
growTimer.addEventListener(TimerEvent.TIMER_COMPLETE, growCrystal, false, 0, true);
};
timer = (timer + (getTimer() - pauseStart));
dispatchEvent(new PauseEvent("off", PAUSE));
} else {
if (_arg1.type != PAUSE){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
soundPos = musicControl.position;
musicControl.stop();
pauseScreen = new PauseScreen();
pauseScreen.resumeButton.addEventListener(MouseEvent.CLICK, setPause, false, 0, true);
pauseScreen.mainmenuButton.addEventListener(MouseEvent.CLICK, confirmQuit, false, 0, true);
pauseScreen.restartButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
pauseScreen.x = 400;
pauseScreen.y = 300;
gameStage.addChild(pauseScreen);
blur.blurX = 10;
blur.blurY = 10;
blur.quality = BitmapFilterQuality.MEDIUM;
gameField.filters = [blur];
ui.filters = [blur];
bg.filters = [blur];
props.filters = [blur];
if (gridOn == 1){
grid.filters = [blur];
};
if (highlightOn == 1){
gridHighlight.filters = [blur];
neighborHighlight1.filters = [blur];
neighborHighlight2.filters = [blur];
neighborHighlight3.filters = [blur];
neighborHighlight4.filters = [blur];
neighborHighlight5.filters = [blur];
neighborHighlight6.filters = [blur];
};
};
gamePaused = true;
pauseStart = getTimer();
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
if (regenTimer != null){
regenTimer.stop();
regenTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, regenCrystal);
};
if (growTimer != null){
growTimer.stop();
growTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, growCrystal);
};
gameStage.removeEventListener(MouseEvent.CLICK, handleInput);
gameStage.removeEventListener(MouseEvent.MOUSE_MOVE, checkHex);
dispatchEvent(new PauseEvent("on", PAUSE));
};
}
function gamewin(){
currentLevel++;
randomCrystals = (numberCrystals + (currentLevel * 5));
if (randomCrystals > 45){
randomCrystals = 45;
};
if (currentLevel == 1){
levelTime = 90000;
} else {
levelTime = (90000 - (currentLevel * 3000));
};
startTime = getTimer();
timer = startTime;
pauseStart = startTime;
pauseTime = startTime;
newStartTime = startTime;
crystalArray = new Array2D(10, 10);
crystalArray.fill(null);
dispatchEvent(new SoundfxEvent(SoundfxEvent.CRYSTAL_GROW, "sound_fx"));
buildLevel();
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
gameTimer = new Timer(levelTime, 1);
gameTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeUp);
gameTimer.start();
gameState = STATE_PLAY;
}
function muteToggle(_arg1:Event){
if (isMute){
ui.muteButton.gotoAndStop(1);
musicTransform.volume = 0.5;
soundFXTransform.volume = 0.5;
musicControl.soundTransform = musicTransform;
fxManager.unmute();
isMute = false;
} else {
ui.muteButton.gotoAndStop(2);
musicTransform.volume = 0;
soundFXTransform.volume = 0;
musicControl.soundTransform = emptyVolume;
fxManager.mute();
isMute = true;
};
}
function buttonEvents(_arg1:Event):void{
var _local2:*;
if (_arg1.target.name == "okButton"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
removeChild(levelwin);
clearMemory();
gameTimeline.gotoAndPlay((("Level" + currentLevel) + "End"));
};
if (_arg1.target.name == "quitButton"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
confirmWindow = new ConfirmWindow("Quit to main menu?", 400, 100);
confirmWindow.x = 400;
confirmWindow.y = 300;
confirmWindow.confirmOK.x = (confirmWindow.confirmOK.x - 10);
confirmWindow.confirmCancel.x = (confirmWindow.confirmCancel.x - 10);
confirmWindow.confirmOK.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
confirmWindow.confirmCancel.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
addChild(confirmWindow);
};
if (_arg1.target.name == "restartButton"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
_local2 = parseInt(profile.attributes.total_time);
_local2 = (_local2 + totalElapsedTime);
profile.attributes.total_time = _local2;
if (levellose != null){
removeChild(levellose);
};
if (missionfail != null){
removeChild(missionfail);
missionfail.mc.restartButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
missionfail.mc.quitButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
missionfail = null;
};
clearMemory();
gameTimeline.gotoAndPlay(("Level" + currentLevel));
};
if (_arg1.target.name == "confirmOK"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
if (levellose != null){
removeChild(levellose);
};
if (missionfail != null){
removeChild(missionfail);
missionfail.mc.restartButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
missionfail.mc.quitButton.addEventListener(MouseEvent.CLICK, buttonEvents, false, 0, true);
missionfail = null;
};
removeChild(confirmWindow);
clearMemory();
gameTimeline.gotoAndStop("Title");
};
if (_arg1.target.name == "confirmCancel"){
dispatchEvent(new SoundfxEvent(SoundfxEvent.CANCEL_BEEP, "sound_fx"));
removeChild(confirmWindow);
};
if (_arg1.target.name == "medalswon"){
removeChild(messageWindow);
clearMemory();
gameTimeline.gotoAndPlay((("Level" + currentLevel) + "End"));
};
}
function togglePause(){
setPause(new Event(PAUSE));
}
public function getCoords(_arg1:int, _arg2:int):Array{
var _local3:Array;
_local3 = new Array(2);
if ((_arg1 % 2) == 0){
_local3[0] = ((_arg1 * hexWidth) + 100);
_local3[1] = ((_arg2 * hexHeight) + 80);
} else {
_local3[0] = ((_arg1 * hexWidth) + 100);
_local3[1] = (((_arg2 * hexHeight) + (hexHeight / 2)) + 80);
};
return (_local3);
}
function hexCoords(_arg1:int, _arg2:int):Array{
var _local3:Number;
var _local4:Number;
_arg1 = (_arg1 + (hexWidth / 3));
_arg2 = (_arg2 + (hexHeight / 3));
_local3 = (Math.round((_arg1 / hexWidth)) - 1);
_local4 = 0;
if ((_local3 % 2) == 0){
_local4 = (Math.round((_arg2 / hexHeight)) - 2);
} else {
_local4 = (Math.round(((_arg2 + (hexHeight / 2)) / hexHeight)) - 2);
};
return (new Array(_local3, _local4));
}
function fadeOut(_arg1:TimerEvent){
if (musicTransform != null){
if (musicTransform.volume > 0){
musicTransform.volume = (musicTransform.volume - 0.05);
};
};
if (soundFXTransform != null){
if (soundFXTransform.volume > 0){
soundFXTransform.volume = (soundFXTransform.volume - 0.5);
};
};
if (musicControl != null){
musicControl.soundTransform = musicTransform;
};
}
public function updateScore(_arg1:ScoreEvent):void{
var _local2:int;
var _local3:*;
var _local4:ScoreMC;
_local3 = _arg1.currCrystal.chainMult;
_local2 = _arg1.score;
if ((((comboMult > 0)) && ((_local3 > 0)))){
_local2 = ((_arg1.score * _local3) * comboMult);
} else {
if (_local3 > 0){
_local2 = (_arg1.score * _local3);
} else {
if (comboMult > 0){
_local2 = (_arg1.score * comboMult);
};
};
};
_local4 = new ScoreMC();
_local4.mouseEnabled = false;
_local4.addEventListener("scoredone", removeScore, false, 0, true);
addEventListener(PAUSE, _local4.pauseScore);
_local4.uicontainer.chainText.selectable = false;
_local4.uicontainer.comboText.selectable = false;
_local4.uicontainer.scoreText.selectable = false;
_local4.uicontainer.chainText.text = "";
_local4.uicontainer.comboText.text = "";
_local4.uicontainer.scoreText.text = "";
if ((((comboMult > 1)) && ((_local3 > 1)))){
_local4.uicontainer.scoreText.text = _local2.toString();
_local4.uicontainer.chainText.text = (("Chain " + _local3) + "x");
_local4.uicontainer.comboText.text = (("Combo " + comboMult) + "x");
} else {
if ((((comboMult < 2)) && ((_local3 > 1)))){
_local4.uicontainer.scoreText.text = _local2.toString();
_local4.uicontainer.chainText.text = (("Chain " + _local3) + "x");
} else {
if ((((comboMult > 1)) && ((_local3 < 2)))){
_local4.uicontainer.scoreText.text = _local2.toString();
_local4.uicontainer.chainText.text = (("Combo " + comboMult) + "x");
} else {
_local4.uicontainer.scoreText.text = _local2.toString();
_local4.uicontainer.comboText.text = " ";
_local4.uicontainer.chainText.text = " ";
};
};
};
_local4.x = (_arg1.currCrystal.getCoords()[0] - 20);
_local4.y = (_arg1.currCrystal.getCoords()[1] - 50);
scoreLayer.addChild(_local4);
scoreUI.push(_local4.name);
score.totalScore = (score.totalScore + _local2);
ui.scoreField.text = score.totalScore;
}
function checkMedals(_arg1, _arg2, _arg3, _arg4, _arg5){
var _local6:int;
if (_arg3 >= 10000){
if (profile.attributes.medal1 == 0){
profile.attributes.medal1 = 1;
medalsWon.push("Businessman ");
_local6 = parseInt(profile.attributes.hiscore);
_local6 = (_local6 + 2000);
profile.attributes.hiscore = _local6;
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg3 >= 15000){
if (profile.attributes.medal2 == 0){
profile.attributes.medal2 = 1;
medalsWon.push("Entrepreneur ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg2 >= 15000){
if (profile.attributes.medal3 == 0){
profile.attributes.medal3 = 1;
medalsWon.push("Expert Player ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (((!(lunaUsed)) && (!(sunUsed)))){
if (profile.attributes.medal4 == 0){
profile.attributes.medal4 = 1;
medalsWon.push("Solitary Soldier ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (((!(skyeUsed)) && (!(sunUsed)))){
if (profile.attributes.medal5 == 0){
profile.attributes.medal5 = 1;
medalsWon.push("Lone Ranger ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (((!(skyeUsed)) && (!(lunaUsed)))){
if (profile.attributes.medal6 == 0){
profile.attributes.medal6 = 1;
medalsWon.push("Wandering Warrior ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg4 >= 15){
if (profile.attributes.medal7 == 0){
profile.attributes.medal7 = 1;
medalsWon.push("Chain Expert ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg4 >= 20){
if (profile.attributes.medal8 == 0){
profile.attributes.medal8 = 1;
medalsWon.push("Chain Master ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg5 >= 15){
if (profile.attributes.medal9 == 0){
profile.attributes.medal9 = 1;
medalsWon.push("Combo Whiz ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg5 >= 20){
if (profile.attributes.medal10 == 0){
profile.attributes.medal10 = 1;
medalsWon.push("Combo Ace ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if ((((_arg4 >= 5)) && ((_arg5 >= 5)))){
if (profile.attributes.medal11 == 0){
profile.attributes.medal11 = 1;
medalsWon.push("Awakening ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if ((((_arg4 >= 10)) && ((_arg5 >= 10)))){
if (profile.attributes.medal12 == 0){
profile.attributes.medal12 = 1;
medalsWon.push("Enlightenment ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg1 <= 5){
if (profile.attributes.medal13 == 0){
profile.attributes.medal13 = 1;
medalsWon.push("Escape Artist ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (_arg1 >= 80){
if (profile.attributes.medal14 == 0){
profile.attributes.medal14 = 1;
medalsWon.push("Sprint King ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if (profile.attributes.money >= 100000){
if (profile.attributes.medal18 == 0){
profile.attributes.medal18 = 1;
medalsWon.push("Scrooge ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if ((((_arg4 >= 10)) && ((_arg5 == 0)))){
if (profile.attributes.medal19 == 0){
profile.attributes.medal19 = 1;
medalsWon.push("Chain Connoisser ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
if ((((_arg4 == 0)) && ((_arg5 >= 10)))){
if (profile.attributes.medal20 == 0){
profile.attributes.medal20 = 1;
medalsWon.push("Combo Maestro ");
profile.attributes.hiscore = (parseInt(profile.attributes.hiscore) + 2000);
profile.attributes.money = (parseInt(profile.attributes.money) + 2000);
};
};
}
function growCrystal(_arg1:Object){
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:*;
var _local8:Crystal;
_local2 = false;
_local5 = 1;
if (profile.attributes.hardmode == 0){
if ((((currentLevel >= 23)) && ((currentLevel < 27)))){
_local5 = Math.ceil((Math.random() * 2));
};
if ((((currentLevel >= 27)) && ((currentLevel < 31)))){
_local5 = Math.ceil((Math.random() * 3));
};
if ((((currentLevel >= 35)) && ((currentLevel < 37)))){
_local5 = Math.ceil((Math.random() * 2));
};
if (currentLevel >= 37){
_local5 = Math.ceil((Math.random() * 3));
};
} else {
_local5 = Math.ceil((Math.random() * 4));
};
_local6 = 5;
if (crystalsRemaining < totalCrystals){
_local7 = 0;
while (_local7 < _local5) {
while (_local2 == false) {
_local3 = Math.floor((Math.random() * 10));
_local4 = Math.floor((Math.random() * 10));
if (crystalArray.get(_local3, _local4) != 8){
_local8 = crystalArray.get(_local3, _local4);
if (_local8 == null){
if (superCrystals == true){
_local8 = placeCrystal(_local3, _local4, 0);
_local8.gotoAndPlay("Grow");
} else {
_local8 = placeCrystal(_local3, _local4, Math.ceil((Math.random() * 3)));
_local8.gotoAndPlay("Grow");
};
crystalArray.set(_local3, _local4, _local8);
dispatchEvent(new SoundfxEvent(SoundfxEvent.CRYSTAL_GROW, "sound_fx"));
crystalsRemaining++;
_local2 = true;
} else {
--_local6;
if (_local6 == 0){
_local2 = true;
};
};
} else {
--_local6;
if (_local6 == 0){
_local2 = true;
};
};
};
_local2 = false;
_local7++;
};
//unresolved jump
};
resetGrow();
}
function disableHotkeys(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, selectChar);
}
public function forceSelectChar(_arg1:String):void{
if (_arg1 == "Skye"){
sun.unmark();
crystalSelect = new Array();
currChar = skyeName;
ui.skyeButton.gotoAndStop(2);
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (_arg1 == "Luna"){
sun.unmark();
crystalSelect = new Array();
currChar = lunaName;
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
ui.lunaButton.gotoAndStop(2);
if (sun.active){
ui.sunButton.gotoAndStop(1);
};
};
if (_arg1 == "Sun"){
currChar = sunName;
if (crystalSelect.length > 0){
crystalSelect = new Array();
sun.unmark();
};
if (skye.active){
ui.skyeButton.gotoAndStop(1);
};
if (luna.active){
ui.lunaButton.gotoAndStop(1);
};
ui.sunButton.gotoAndStop(2);
};
}
public function sortDepth(_arg1:MovieClip):void{
var _local2:int;
var _local3:Array;
_local3 = new Array();
_local2 = _arg1.numChildren;
while (_local2--) {
_local3[_local2] = _arg1.getChildAt(_local2);
};
_local3.sortOn("y", Array.NUMERIC);
_local2 = _arg1.numChildren;
while (_local2--) {
if (_local3[_local2] != _arg1.getChildAt(_local2)){
_arg1.setChildIndex(_local3[_local2], _local2);
};
};
}
function gameOver(){
var credits:int;
var gameover:Gameover;
gameStage.removeEventListener("enterFrame", mainLoop);
dispatchEvent(new PauseEvent("on", PAUSE));
fadeTimer = new Timer(33, 30);
fadeTimer.addEventListener(TimerEvent.TIMER, fadeOut, false, 0, true);
fadeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, fadeDone, false, 0, true);
fadeTimer.start();
levelwin = new LevelWin();
levelwin.x = 400;
levelwin.y = 300;
credits = score.totalScore;
if (credits < 7000){
levelwin.mc.ranking.gotoAndStop(1);
};
if ((((credits >= 7000)) && ((credits <= 10000)))){
levelwin.mc.ranking.gotoAndStop(2);
};
if ((((credits > 10000)) && ((credits <= 15000)))){
levelwin.mc.ranking.gotoAndStop(3);
};
if ((((credits > 15000)) && ((credits <= 20000)))){
levelwin.mc.ranking.gotoAndStop(4);
};
if ((((credits > 20000)) && ((credits <= 25000)))){
levelwin.mc.ranking.gotoAndStop(5);
};
if ((((credits > 25000)) && ((credits <= 50000)))){
levelwin.mc.ranking.gotoAndStop(6);
};
if (credits > 50000){
levelwin.mc.ranking.gotoAndStop(7);
};
levelwin.mc.score.text = String(credits);
levelwin.mc.okButton.addEventListener(MouseEvent.CLICK, function (){
dispatchEvent(new SoundfxEvent(SoundfxEvent.OK_BEEP, "sound_fx"));
removeChild(levelwin);
clearMemory();
gameTimeline.gotoAndPlay("LevelEnd");
});
levelwin.mc.submitButton.addEventListener(MouseEvent.CLICK, function (){
gameTimeline.gotoAndStop("Submit");
MochiScores.showLeaderboard({boardID:"a5f89edd791e4e9d", score:credits, res:"800x600"});
});
levelwin.mc.submitButton.buttonMode = true;
gameStage.addChild(levelwin);
levelwin.play();
gameover = new Gameover();
gameover.play(0, 0, soundFXTransform);
}
function getNeighbours(_arg1:int, _arg2:int):Array{
var _local3:Array;
_local3 = new Array();
if ((((((((_arg1 > 0)) && ((_arg1 < 9)))) && ((_arg2 > 0)))) && ((_arg2 < 9)))){
if ((_arg1 % 2) == 0){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local3);
} else {
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get((_arg1 + 1), (_arg2 + 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 + 1)));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), (_arg2 + 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
return (_local3);
};
} else {
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
return (_local3);
} else {
if ((((_arg1 == 14)) && ((_arg2 == 0)))){
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
return (_local3);
} else {
if ((((_arg1 == 14)) && ((_arg2 == 14)))){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local3);
} else {
if ((((_arg1 == 0)) && ((_arg2 == 14)))){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
return (_local3);
} else {
if (_arg1 == 0){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
return (_local3);
} else {
if (_arg2 == 0){
if ((_arg1 % 2) == 0){
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
return (_local3);
} else {
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get((_arg1 + 1), (_arg2 + 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 + 1)));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), (_arg2 + 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
return (_local3);
};
} else {
if (_arg1 == 9){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get(_arg1, (_arg2 + 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 + 1)));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), (_arg2 + 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 + 1)));
};
return (_local3);
} else {
if (_arg2 == 9){
if ((_arg1 % 2) == 0){
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 + 1), (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), (_arg2 - 1)) != null){
_local3.push(crystalArray.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local3);
} else {
if (crystalArray.get(_arg1, (_arg2 - 1)) != null){
_local3.push(crystalArray.get(_arg1, (_arg2 - 1)));
};
if (crystalArray.get((_arg1 + 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 + 1), _arg2));
};
if (crystalArray.get((_arg1 - 1), _arg2) != null){
_local3.push(crystalArray.get((_arg1 - 1), _arg2));
};
return (_local3);
};
};
};
};
};
};
};
};
};
};
return (_local3);
}
public function mainLoop(_arg1:Event):void{
switch (gameState){
case STATE_PLAY:
if (!gamePaused){
gameplay();
};
break;
case STATE_GAMEWIN:
gamewin();
break;
case STATE_GAMEOVER:
gameOver();
break;
};
}
}
}//package src.iceblast.controllers
Section 69
//LevelData (src.iceblast.controllers.LevelData)
package src.iceblast.controllers {
public class LevelData {
var randomCrystals:int;
var crystalRegen:int;
var levelTime:int;
var blizzard:int;
var superCrystals:Boolean;
var crystalGrowth:int;
var levelMap:Array;
public function LevelData(_arg1:int, _arg2:int){
levelTime = 200000;
crystalRegen = 0;
crystalGrowth = 0;
superCrystals = true;
blizzard = 0;
randomCrystals = 0;
if (_arg1 > 0){
levelMap = [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 8, 8, 0, 0, 8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8];
} else {
levelMap = [8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 8, 0, 0, 0, 0, 0, 0, 1, 0, 8, 8, 0, 0, 0, 3, 0, 0, 0, 1, 8, 8, 0, 0, 0, 0, 0, 2, 0, 1, 8, 8, 0, 0, 0, 0, 8, 8, 0, 1, 8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 8, 8, 0, 0, 0, 2, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 3, 0, 0, 8, 8, 0, 0, 0, 3, 0, 0, 0, 2, 8, 8, 8, 8, 8, 8, 2, 8, 8, 8, 8];
};
}
}
}//package src.iceblast.controllers
Section 70
//MessageWindow (src.iceblast.controllers.MessageWindow)
package src.iceblast.controllers {
import flash.display.*;
public class MessageWindow extends MovieClip {
public function MessageWindow(_arg1:String, _arg2:int, _arg3:int){
}
}
}//package src.iceblast.controllers
Section 71
//PauseEvent (src.iceblast.controllers.PauseEvent)
package src.iceblast.controllers {
import flash.events.*;
public class PauseEvent extends Event {
public var pauseMode:String;
public function PauseEvent(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg2, _arg3, _arg4);
this.pauseMode = _arg1;
}
}
}//package src.iceblast.controllers
Section 72
//ScoreEvent (src.iceblast.controllers.ScoreEvent)
package src.iceblast.controllers {
import flash.events.*;
import src.iceblast.objects.*;
public class ScoreEvent extends Event {
public var score:int;
public var currCrystal:Crystal;
public function ScoreEvent(_arg1:int, _arg2:Crystal, _arg3:String, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg3, _arg4, _arg5);
score = _arg1;
this.currCrystal = _arg2;
}
}
}//package src.iceblast.controllers
Section 73
//ScoreManager (src.iceblast.controllers.ScoreManager)
package src.iceblast.controllers {
public class ScoreManager {
public var totalScore;
public function ScoreManager(){
totalScore = 0;
}
public function addScore(_arg1:Number){
totalScore = (totalScore + _arg1);
}
public function resetScore(){
totalScore = 0;
}
public function getScore():int{
return (totalScore);
}
}
}//package src.iceblast.controllers
Section 74
//ScoreMC (src.iceblast.controllers.ScoreMC)
package src.iceblast.controllers {
import flash.display.*;
import flash.events.*;
public class ScoreMC extends MovieClip {
public var uicontainer:MovieClip;
public static var PAUSE:String = "pause";
public function ScoreMC(){
addFrameScript(24, frame25);
addEventListener(PAUSE, pauseScore);
addEventListener("enterFrame", checkScore);
}
public function pauseScore(_arg1:PauseEvent){
if (_arg1.pauseMode == "on"){
this.stop();
} else {
this.play();
};
}
function checkScore(_arg1:Event){
if (this.currentFrame == 26){
removeEventListener("enterFrame", checkScore);
dispatchEvent(new Event("scoredone"));
removeEventListener("enterFrame", checkScore);
removeEventListener(PAUSE, pauseScore);
};
}
function frame25(){
gotoAndStop(26);
}
}
}//package src.iceblast.controllers
Section 75
//SoundfxEvent (src.iceblast.controllers.SoundfxEvent)
package src.iceblast.controllers {
import flash.events.*;
public class SoundfxEvent extends Event {
var fxType:String;
public static var DONE:String = "Done";
public static var ICE_BREAK:String = "IceBreak";
public static var PUNCH:String = "Punch";
public static var LEVEL_LOSE:String = "LevelLose";
public static var BLIZZARD:String = "Blizzard";
public static var CHAIN:String = "Chain";
public static var CRYSTAL_GROW:String = "CrystalGrow";
public static var TELEPORT:String = "Teleport";
public static var fxType:String;
public static var PICKAXE:String = "Pickaxe";
public static var OK_BEEP:String = "OkBeep";
public static var CHARGE:String = "Charge";
public static var WHIP:String = "Whip";
public static var HMPH:String = "Hmph";
public static var CANCEL_BEEP:String = "CancelBeep";
public static var ROGER:String = "Roger";
public static var SWORD:String = "Sword";
public static var ERROR_SOUND:String = "ErrorSound";
public static var HAAH:String = "Haah";
public static var LEVEL_WIN:String = "LevelWin";
public static var LAND:String = "Land";
public static var SELECTION:String = "Select";
public static var ICE_EXPLODE:String = "IceExplode";
public static var TELEPORT2:String = "Teleport2";
public static var HAH:String = "Hah";
public static var CRYSTAL_HEAL:String = "CrystalHeal";
public static var COMBO:String = "Combo";
public static var SHIELD:String = "Shield";
public function SoundfxEvent(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg2, _arg3, _arg4);
this.fxType = _arg1;
}
}
}//package src.iceblast.controllers
Section 76
//SoundManager (src.iceblast.controllers.SoundManager)
package src.iceblast.controllers {
import flash.media.*;
public class SoundManager {
public var ICE_BREAK:String;// = "IceBreak"
public var PUNCH:String;// = "Punch"
public var LEVEL_LOSE:String;// = "LevelLose"
public var BLIZZARD:String;// = "Blizzard"
private var blizzard:Blizzard;
var fxPos:Number;// = 0
public var TELEPORT:String;// = "Teleport"
public var fxType:String;
public var PICKAXE:String;// = "Pickaxe"
private var teleport:Teleport;
var type:String;
private var pickaxe:FX_Pickaxe;
var blizzardChannel:SoundChannel;
private var crystal_heal:FX_Heal;
public var LEVEL_WIN:String;// = "LevelWin"
public var TELEPORT2:String;// = "Teleport2"
public var SELECTION:String;// = "Select"
public var COMBO:String;// = "Combo"
public var CRYSTAL_HEAL:String;// = "CrystalHeal"
public var HAH:String;// = "Hah"
private var shield:Shield;
private var ice_punch:FX_Punch;
private var crystal_grow:FX_Grow;
private var teleport2:Teleport2;
public var DONE:String;// = "Done"
private var done:Done;
public var SHIELD:String;// = "Shield"
var fxVolume:Number;
private var combo:Combo;
private var hah:Hah;
public var CRYSTAL_GROW:String;// = "CrystalGrow"
public var CHAIN:String;// = "Chain"
public var OK_BEEP:String;// = "OkBeep"
public var CHARGE:String;// = "Charge"
private var crystal_break:FX_Break;
public var WHIP:String;// = "Whip"
private var charge:Charge;
public var HMPH:String;// = "Hmph"
private var whip:Whip;
private var chain:Chain;
private var hmph:Hmph;
private var ok_beep:Beep2;
var fxChannel;
private var cancel_beep:Click;
public var ROGER:String;// = "Roger"
private var crystal_explode:FX_Explode;
public var CANCEL_BEEP:String;// = "CancelBeep"
private var haah:Haah;
public var SWORD:String;// = "Sword"
public var ERROR_SOUND:String;// = "ErrorSound"
public var LAND:String;// = "Land"
public var ICE_EXPLODE:String;// = "IceExplode"
public var HAAH:String;// = "Haah"
private var land:Land;
var fxTransform:SoundTransform;
private var roger:Roger;
private var select:Select;
private var sword:Sword;
public function SoundManager(_arg1:SoundTransform){
PICKAXE = "Pickaxe";
ICE_BREAK = "IceBreak";
ICE_EXPLODE = "IceExplode";
CRYSTAL_HEAL = "CrystalHeal";
CRYSTAL_GROW = "CrystalGrow";
LEVEL_WIN = "LevelWin";
LEVEL_LOSE = "LevelLose";
ERROR_SOUND = "ErrorSound";
PUNCH = "Punch";
OK_BEEP = "OkBeep";
CANCEL_BEEP = "CancelBeep";
HMPH = "Hmph";
HAH = "Hah";
LAND = "Land";
ROGER = "Roger";
SWORD = "Sword";
TELEPORT = "Teleport";
DONE = "Done";
WHIP = "Whip";
HAAH = "Haah";
TELEPORT2 = "Teleport2";
SELECTION = "Select";
CHARGE = "Charge";
BLIZZARD = "Blizzard";
SHIELD = "Shield";
COMBO = "Combo";
CHAIN = "Chain";
blizzardChannel = new SoundChannel();
fxPos = 0;
super();
fxTransform = _arg1;
fxVolume = _arg1.volume;
ice_punch = new FX_Punch();
pickaxe = new FX_Pickaxe();
crystal_grow = new FX_Grow();
crystal_heal = new FX_Heal();
crystal_break = new FX_Break();
crystal_explode = new FX_Explode();
ok_beep = new Beep2();
cancel_beep = new Click();
hmph = new Hmph();
hah = new Hah();
land = new Land();
roger = new Roger();
sword = new Sword();
teleport = new Teleport();
done = new Done();
whip = new Whip();
haah = new Haah();
teleport2 = new Teleport2();
select = new Select();
charge = new Charge();
blizzard = new Blizzard();
shield = new Shield();
combo = new Combo();
chain = new Chain();
}
public function stop(){
if (blizzardChannel.position != blizzard.length){
blizzardChannel.stop();
};
}
public function playFX(_arg1:String){
this.type = _arg1;
if (_arg1 == PUNCH){
fxChannel = ice_punch.play(0, 0, fxTransform);
};
if (_arg1 == PICKAXE){
fxChannel = pickaxe.play(0, 0, fxTransform);
};
if (_arg1 == ICE_BREAK){
fxChannel = crystal_break.play(0, 0, fxTransform);
};
if (_arg1 == ICE_EXPLODE){
fxChannel = crystal_explode.play(0, 0, fxTransform);
};
if (_arg1 == CRYSTAL_HEAL){
fxChannel = crystal_heal.play(0, 0, fxTransform);
};
if (_arg1 == CRYSTAL_GROW){
fxChannel = crystal_grow.play(0, 0, fxTransform);
};
if (_arg1 == OK_BEEP){
fxChannel = ok_beep.play(0, 0, fxTransform);
};
if (_arg1 == CANCEL_BEEP){
fxChannel = cancel_beep.play(0, 0, fxTransform);
};
if (_arg1 == HMPH){
fxChannel = hmph.play(0, 0, fxTransform);
};
if (_arg1 == HAH){
fxChannel = hah.play(0, 0, fxTransform);
};
if (_arg1 == LAND){
fxChannel = land.play(0, 0, fxTransform);
};
if (_arg1 == ROGER){
fxChannel = roger.play(0, 0, fxTransform);
};
if (_arg1 == SWORD){
fxChannel = sword.play(0, 0, fxTransform);
};
if (_arg1 == TELEPORT){
fxChannel = teleport.play(0, 0, fxTransform);
};
if (_arg1 == DONE){
fxChannel = done.play(0, 0, fxTransform);
};
if (_arg1 == WHIP){
fxChannel = whip.play(0, 0, fxTransform);
};
if (_arg1 == HAAH){
fxChannel = haah.play(0, 0, fxTransform);
};
if (_arg1 == TELEPORT2){
fxChannel = teleport2.play(0, 0, fxTransform);
};
if (_arg1 == CHARGE){
fxChannel = charge.play(0, 0, fxTransform);
};
if (_arg1 == SELECTION){
fxChannel = select.play(0, 0, fxTransform);
};
if (_arg1 == BLIZZARD){
blizzardChannel = blizzard.play(0, 0, fxTransform);
};
if (_arg1 == SHIELD){
fxChannel = shield.play(0, 0, fxTransform);
};
if (_arg1 == COMBO){
fxChannel = combo.play(0, 0, fxTransform);
};
if (_arg1 == CHAIN){
fxChannel = chain.play(0, 0, fxTransform);
};
}
public function unpause(){
if (blizzardChannel.position != blizzard.length){
blizzardChannel = blizzard.play(fxPos, 0, fxTransform);
};
}
public function mute(){
if (fxChannel != null){
fxChannel.soundTransform = new SoundTransform(0, 0);
fxTransform.volume = 0;
};
}
public function unmute(){
if (fxChannel != null){
fxChannel.soundTransform = fxTransform;
fxTransform.volume = fxVolume;
};
}
public function clear(){
if (fxChannel != null){
fxChannel.stop();
};
if (blizzardChannel != null){
blizzardChannel.stop();
};
fxTransform = null;
fxChannel = null;
blizzardChannel = null;
ice_punch = null;
pickaxe = null;
crystal_grow = null;
crystal_heal = null;
crystal_break = null;
crystal_explode = null;
ok_beep = null;
cancel_beep = null;
hmph = null;
hah = null;
land = null;
roger = null;
sword = null;
teleport = null;
done = null;
whip = null;
haah = null;
teleport2 = null;
select = null;
charge = null;
blizzard = null;
shield = null;
combo = null;
}
public function pause(){
if (blizzardChannel.position != blizzard.length){
fxPos = blizzardChannel.position;
blizzardChannel.stop();
};
}
}
}//package src.iceblast.controllers
Section 77
//Crystal (src.iceblast.objects.Crystal)
package src.iceblast.objects {
import flash.display.*;
import flash.events.*;
import src.iceblast.controllers.*;
import flash.utils.*;
public class Crystal extends MovieClip {
public var coordX:int;// = 0
public var coordY:int;// = 0
public var ICE_BREAK:String;// = "IceBreak"
var chainStart:int;// = 0
private var hexHeight:Number;
public var isCombo:Boolean;
var crystalRegen:CrystalRegen;
public var ICE_EXPLODE:String;// = "IceExplode"
public var life;
private var chainTimer:Timer;
public var shadow:MovieClip;
public var type:String;// = "Crystal"
public var crystalMC:MovieClip;
private var scale:int;// = 79
public var SHIELD:String;// = "Shield"
var crystalDie:CrystalDie;
private var hexWidth:Number;
public var CRYSTAL_HEAL:String;// = "CrystalHeal"
public var chainMult:int;// = 0
public var CRYSTAL_GROW:String;// = "CrystalGrow"
public var isChain:Boolean;
var gameState:String;
var timeElapsed:int;// = 0
var crystalClick:CrystalClick;
public var collider:CrystalCollider;
public static var CHAIN:String = "chain";
public static var CLICKED:String = "clicked";
public static var DIED:String = "died";
static var CRYSTAL_PAUSE:String = "pause";
public static var SCORE:String = "score";
static var CRYSTAL_CHAIN:String = "chain";
static var CRYSTAL_PLAY:String = "play";
public function Crystal(_arg1:int, _arg2:int, _arg3:int, _arg4:CrystalCollider){
var _local5:*;
ICE_BREAK = "IceBreak";
ICE_EXPLODE = "IceExplode";
CRYSTAL_HEAL = "CrystalHeal";
CRYSTAL_GROW = "CrystalGrow";
SHIELD = "Shield";
chainStart = 0;
timeElapsed = 0;
hexWidth = ((Math.sqrt(3) / 2) * scale);
hexHeight = (Math.tan((Math.PI / 6)) * hexWidth);
scale = 79;
coordX = 0;
coordY = 0;
type = "Crystal";
chainMult = 0;
gameState = CRYSTAL_PLAY;
super();
addFrameScript(0, frame1, 8, frame9, 26, frame27, 32, frame33, 44, frame45, 59, frame60, 70, frame71, 102, frame103);
crystalClick = new CrystalClick();
crystalDie = new CrystalDie();
crystalRegen = new CrystalRegen();
collider = _arg4;
coordX = _arg1;
coordY = _arg2;
if (_arg3 > 0){
this.life = _arg3;
this.crystalMC.gotoAndStop(this.life);
} else {
_local5 = (Math.random() * 30);
if ((((_local5 >= 0)) && ((_local5 < 2)))){
this.life = 1;
} else {
if ((((_local5 >= 2)) && ((_local5 < 11)))){
this.life = 2;
} else {
if ((((_local5 >= 11)) && ((_local5 < 21)))){
this.life = 3;
} else {
if ((((_local5 >= 21)) && ((_local5 < 23)))){
this.life = 4;
} else {
if ((((_local5 >= 23)) && ((_local5 < 26)))){
this.life = 5;
} else {
if ((((_local5 >= 26)) && ((_local5 < 30)))){
this.life = 6;
};
};
};
};
};
};
this.crystalMC.gotoAndStop(this.life);
};
addEventListener("enterFrame", checkPause);
}
public function killChain(_arg1:int):Boolean{
var _local2:String;
var _local3:int;
chainMult = _arg1;
_local3 = life;
if (life < 7){
life = (life - 1);
collider.gotoAndStop(life);
_local2 = (_local3 + "Die");
this.gotoAndPlay("Attacked");
this.crystalMC.gotoAndPlay(_local2);
if (life <= 0){
chainMult++;
gotoAndPlay("Die");
dispatchEvent(new SoundfxEvent(ICE_EXPLODE, "sound_fx"));
dispatchEvent(new ScoreEvent(50, this, SCORE));
chainTimer = new Timer(350, 1);
chainTimer.addEventListener(TimerEvent.TIMER, chainKill);
chainTimer.start();
chainStart = getTimer();
isCombo = true;
isChain = true;
return (true);
};
chainMult = 0;
dispatchEvent(new SoundfxEvent(ICE_BREAK, "sound_fx"));
dispatchEvent(new ScoreEvent(10, this, SCORE));
isChain = false;
isCombo = false;
return (false);
} else {
if (life == 8){
this.gotoAndPlay("Glow");
return (false);
};
dispatchEvent(new SoundfxEvent(SHIELD, "sound_fx"));
this.gotoAndPlay("GenerateIce");
};
return (false);
}
public function suicide(_arg1:int){
var _local2:String;
var _local3:int;
var _local4:int;
_local3 = life;
if (life > _arg1){
life--;
_local4 = _arg1;
collider.gotoAndStop(life);
} else {
_local4 = life;
life = 0;
collider.gotoAndStop(9);
};
if (_arg1 > 1){
_local2 = ((_local3 + "Hit") + _local4);
this.gotoAndPlay("Hit");
this.crystalMC.gotoAndPlay(_local2);
} else {
_local2 = (_local3 + "Die");
this.gotoAndPlay("Hit");
this.crystalMC.gotoAndPlay(_local2);
};
if (life <= 0){
chainMult++;
chainTimer = new Timer(350, 1);
chainTimer.addEventListener(TimerEvent.TIMER, chainKill);
chainTimer.start();
chainStart = getTimer();
isChain = true;
return (true);
};
chainMult = 0;
isChain = false;
isCombo = false;
return (false);
}
public function regen(){
var _local1:*;
if (life < 6){
dispatchEvent(new SoundfxEvent(CRYSTAL_HEAL, "sound_fx"));
_local1 = Math.ceil((Math.random() * 3));
if ((life + _local1) < 6){
life = (life + _local1);
} else {
life = 6;
};
this.crystalMC.gotoAndStop(life);
collider.gotoAndStop(life);
};
}
public function pauseCrystal(_arg1:PauseEvent){
if (_arg1.pauseMode == "on"){
if (chainTimer != null){
chainTimer.stop();
};
if (((!((currentLabel == "Lives"))) && (!((currentLabel == "Dead"))))){
stop();
};
gameState = CRYSTAL_PAUSE;
} else {
if (chainTimer != null){
chainTimer.start();
};
if (((!((crystalMC.currentLabel == "Lives"))) && (!((crystalMC.currentLabel == "Dead"))))){
if (this.currentLabel != "Static"){
play();
};
};
if (currentLabel != "Static"){
play();
};
gameState = CRYSTAL_PLAY;
};
}
function dispatchChain(){
dispatchEvent(new ChainEvent(coordX, coordY, chainMult, CHAIN));
gameState = CRYSTAL_PLAY;
dispatchEvent(new Event("crystaldied"));
}
function frame1(){
stop();
shadow.mouseEnabled = false;
}
function frame9(){
gotoAndStop(1);
}
function frame27(){
gotoAndStop(1);
}
function frame33(){
gotoAndStop(1);
}
function generatorDie(_arg1:Event){
dispatchEvent(new Event("crystaldied"));
dispatchEvent(new Event("addcombo"));
}
function frame45(){
gotoAndStop(1);
}
function frame60(){
gotoAndStop(1);
}
public function resetCrystal(_arg1:int, _arg2:int, _arg3:int, _arg4:CrystalCollider){
var _local5:*;
collider = _arg4;
coordX = _arg1;
coordY = _arg2;
if (_arg3 > 0){
this.life = _arg3;
this.crystalMC.gotoAndStop(this.life);
} else {
_local5 = (Math.random() * 30);
if ((((_local5 >= 0)) && ((_local5 < 2)))){
this.life = 1;
} else {
if ((((_local5 >= 2)) && ((_local5 < 11)))){
this.life = 2;
} else {
if ((((_local5 >= 11)) && ((_local5 < 21)))){
this.life = 3;
} else {
if ((((_local5 >= 21)) && ((_local5 < 23)))){
this.life = 4;
} else {
if ((((_local5 >= 23)) && ((_local5 < 26)))){
this.life = 5;
} else {
if ((((_local5 >= 26)) && ((_local5 < 30)))){
this.life = 6;
};
};
};
};
};
};
this.crystalMC.gotoAndStop(this.life);
};
collider.gotoAndStop(_arg3);
}
public function fullRegen(){
life = 6;
this.crystalMC.gotoAndStop(life);
}
function frame71(){
gotoAndStop(1);
}
public function getCoords():Array{
var _local1:Array;
_local1 = new Array(2);
if ((coordX % 2) == 0){
_local1[0] = ((coordX * hexWidth) + 100);
_local1[1] = ((coordY * hexHeight) + 80);
} else {
_local1[0] = ((coordX * hexWidth) + 100);
_local1[1] = (((coordY * hexHeight) + (hexHeight / 2)) + 80);
};
return (_local1);
}
public function willDie(_arg1:int):Boolean{
var _local2:*;
_local2 = life;
_local2 = (_local2 - _arg1);
if (_local2 < 1){
return (true);
};
return (false);
}
public function kill(_arg1:int):Boolean{
var _local2:String;
var _local3:int;
var _local4:int;
_local3 = life;
if (life < 7){
if (life > _arg1){
life = (life - _arg1);
_local4 = _arg1;
collider.gotoAndStop(life);
} else {
_local4 = life;
life = 0;
collider.gotoAndStop(9);
};
if (_arg1 > 1){
_local2 = ((_local3 + "Hit") + _local4);
this.gotoAndPlay("Hit");
this.crystalMC.gotoAndPlay(_local2);
} else {
_local2 = (_local3 + "Die");
this.gotoAndPlay("Hit");
this.crystalMC.gotoAndPlay(_local2);
};
if (life <= 0){
chainMult++;
dispatchEvent(new Event("addcombo"));
dispatchEvent(new SoundfxEvent(ICE_EXPLODE, "sound_fx"));
dispatchEvent(new ScoreEvent((50 + (10 * (_local4 - 1))), this, SCORE));
chainTimer = new Timer(350, 1);
chainTimer.addEventListener(TimerEvent.TIMER, chainKill);
chainTimer.start();
chainStart = getTimer();
isCombo = true;
isChain = true;
return (true);
};
chainMult = 0;
dispatchEvent(new SoundfxEvent(ICE_BREAK, "sound_fx"));
dispatchEvent(new ScoreEvent((10 * _arg1), this, SCORE));
isChain = false;
isCombo = false;
return (false);
//unresolved jump
};
if (life == 8){
this.crystalMC.gotoAndPlay("GenDie");
dispatchEvent(new SoundfxEvent(ICE_EXPLODE, "sound_fx"));
dispatchEvent(new ScoreEvent(500, this, SCORE));
chainTimer = new Timer(500, 1);
chainTimer.addEventListener(TimerEvent.TIMER, generatorDie);
chainTimer.start();
isCombo = true;
return (true);
};
this.gotoAndPlay("Glow");
return (false);
}
public function getLife(){
return (life);
}
function frame103(){
gotoAndStop(1);
}
public function clearMemory(){
try {
chainTimer.stop();
chainTimer.removeEventListener(TimerEvent.TIMER, chainKill);
removeEventListener("enterFrame", checkPause);
collider = null;
} catch(error:Error) {
};
}
public function mouseClicked(_arg1:MouseEvent):void{
dispatchEvent(new Event(CLICKED));
}
function checkPause(_arg1:Object):void{
switch (gameState){
case CRYSTAL_PLAY:
break;
case CRYSTAL_PAUSE:
break;
case CRYSTAL_CHAIN:
dispatchChain();
break;
};
}
function chainKill(_arg1:TimerEvent){
chainTimer = null;
if (gameState != CRYSTAL_PAUSE){
gameState = CRYSTAL_CHAIN;
};
}
function getNeighbours(_arg1:int, _arg2:int, _arg3:Array2D):Array{
var _local4:Array;
_local4 = new Array();
if ((((((((_arg1 > 0)) && ((_arg1 < 9)))) && ((_arg2 > 0)))) && ((_arg2 < 9)))){
if ((_arg1 % 2) == 0){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
if (_arg3.get((_arg1 - 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local4);
} else {
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get((_arg1 + 1), (_arg2 + 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 + 1)));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), (_arg2 + 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
return (_local4);
};
} else {
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
return (_local4);
} else {
if ((((_arg1 == 14)) && ((_arg2 == 0)))){
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
return (_local4);
} else {
if ((((_arg1 == 14)) && ((_arg2 == 14)))){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
if (_arg3.get((_arg1 - 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local4);
} else {
if ((((_arg1 == 0)) && ((_arg2 == 14)))){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
return (_local4);
} else {
if (_arg1 == 0){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
return (_local4);
} else {
if (_arg2 == 0){
if ((_arg1 % 2) == 0){
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
return (_local4);
} else {
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get((_arg1 + 1), (_arg2 + 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 + 1)));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), (_arg2 + 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
return (_local4);
};
} else {
if (_arg1 == 9){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get(_arg1, (_arg2 + 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 + 1)));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
if (_arg3.get((_arg1 - 1), (_arg2 + 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 + 1)));
};
return (_local4);
} else {
if (_arg2 == 9){
if ((_arg1 % 2) == 0){
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 + 1), (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
if (_arg3.get((_arg1 - 1), (_arg2 - 1)) != null){
_local4.push(_arg3.get((_arg1 - 1), (_arg2 - 1)));
};
return (_local4);
} else {
if (_arg3.get(_arg1, (_arg2 - 1)) != null){
_local4.push(_arg3.get(_arg1, (_arg2 - 1)));
};
if (_arg3.get((_arg1 + 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 + 1), _arg2));
};
if (_arg3.get((_arg1 - 1), _arg2) != null){
_local4.push(_arg3.get((_arg1 - 1), _arg2));
};
return (_local4);
};
};
};
};
};
};
};
};
};
};
return (_local4);
}
}
}//package src.iceblast.objects
Section 78
//Thermobar (src.iceblast.userinterface.Thermobar)
package src.iceblast.userinterface {
import flash.display.*;
public class Thermobar extends MovieClip {
}
}//package src.iceblast.userinterface
Section 79
//UI (src.iceblast.userinterface.UI)
package src.iceblast.userinterface {
import flash.display.*;
import flash.text.*;
public class UI extends MovieClip {
public var comboGauge:MovieClip;
public var lunaButton:MovieClip;
public var thermoTimer:Thermobar;
public var scoreField:TextField;
public var sunButton:MovieClip;
public var powButton:MovieClip;
public var muteButton:MovieClip;
public var skyeButton:MovieClip;
public var thermometer:MovieClip;
public function UI(){
skyeButton.gotoAndStop(1);
lunaButton.gotoAndStop(1);
sunButton.gotoAndStop(1);
}
}
}//package src.iceblast.userinterface
Section 80
//construct (uk.co.bigroom.utils.construct)
package uk.co.bigroom.utils {
public function construct(_arg1:Class, _arg2:Array){
switch (_arg2.length){
case 0:
return (new (_arg1));
case 1:
return (new _arg1(_arg2[0]));
case 2:
return (new _arg1(_arg2[0], _arg2[1]));
case 3:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2]));
case 4:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3]));
case 5:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4]));
case 6:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5]));
case 7:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6]));
case 8:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7]));
case 9:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8]));
case 10:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9]));
default:
return (null);
};
}
}//package uk.co.bigroom.utils
Section 81
//ObjectPool (uk.co.bigroom.utils.ObjectPool)
package uk.co.bigroom.utils {
import flash.utils.*;
public class ObjectPool {
private static var size:int = 0;
private static var pools:Dictionary = new Dictionary();
private static var created:int = 0;
public static function getObject(_arg1:Class, ... _args){
var _local3:Array;
_local3 = getPool(_arg1);
if (_local3.length > 0){
size--;
return (_local3.pop());
};
created++;
return (construct(_arg1, _args));
}
private static function getPool(_arg1:Class):Array{
return (((_arg1 in pools)) ? pools[_arg1] : pools[_arg1] = new Array());
}
public static function disposeObject(_arg1, _arg2:Class=null):void{
var _local3:Array;
var _local4:String;
size++;
if (!_arg2){
_local4 = getQualifiedClassName(_arg1);
_arg2 = (getDefinitionByName(_local4) as Class);
};
_local3 = getPool(_arg2);
_local3.push(_arg1);
}
}
}//package uk.co.bigroom.utils
Section 82
//Beep2 (Beep2)
package {
import flash.media.*;
public dynamic class Beep2 extends Sound {
}
}//package
Section 83
//BG (BG)
package {
import flash.display.*;
public dynamic class BG extends MovieClip {
}
}//package
Section 84
//BG1 (BG1)
package {
import flash.display.*;
public dynamic class BG1 extends MovieClip {
}
}//package
Section 85
//BG2 (BG2)
package {
import flash.display.*;
public dynamic class BG2 extends MovieClip {
}
}//package
Section 86
//BG3 (BG3)
package {
import flash.display.*;
public dynamic class BG3 extends MovieClip {
}
}//package
Section 87
//Blizzard (Blizzard)
package {
import flash.media.*;
public dynamic class Blizzard extends Sound {
}
}//package
Section 88
//Chain (Chain)
package {
import flash.media.*;
public dynamic class Chain extends Sound {
}
}//package
Section 89
//ChainExclaim (ChainExclaim)
package {
import flash.display.*;
public dynamic class ChainExclaim extends MovieClip {
public var chainmc:MovieClip;
public function ChainExclaim(){
addFrameScript(25, frame26);
}
function frame26(){
gotoAndStop(1);
}
}
}//package
Section 90
//Charge (Charge)
package {
import flash.media.*;
public dynamic class Charge extends Sound {
}
}//package
Section 91
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 92
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 93
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 94
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 95
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 96
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 97
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 98
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 99
//Click (Click)
package {
import flash.media.*;
public dynamic class Click extends Sound {
}
}//package
Section 100
//Combo (Combo)
package {
import flash.media.*;
public dynamic class Combo extends Sound {
}
}//package
Section 101
//ConfirmDialog (ConfirmDialog)
package {
import flash.display.*;
public dynamic class ConfirmDialog extends MovieClip {
public var noButton:MovieClip;
public var yesButton:MovieClip;
}
}//package
Section 102
//CrystalClick (CrystalClick)
package {
import flash.media.*;
public dynamic class CrystalClick extends Sound {
}
}//package
Section 103
//CrystalCollider (CrystalCollider)
package {
import flash.display.*;
public dynamic class CrystalCollider extends MovieClip {
public function CrystalCollider(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 104
//CrystalDie (CrystalDie)
package {
import flash.media.*;
public dynamic class CrystalDie extends Sound {
}
}//package
Section 105
//CrystalRegen (CrystalRegen)
package {
import flash.media.*;
public dynamic class CrystalRegen extends Sound {
}
}//package
Section 106
//Ding (Ding)
package {
import flash.media.*;
public dynamic class Ding extends Sound {
}
}//package
Section 107
//Done (Done)
package {
import flash.media.*;
public dynamic class Done extends Sound {
}
}//package
Section 108
//Error1 (Error1)
package {
import flash.media.*;
public dynamic class Error1 extends Sound {
}
}//package
Section 109
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 110
//FX_Break (FX_Break)
package {
import flash.media.*;
public dynamic class FX_Break extends Sound {
}
}//package
Section 111
//FX_Explode (FX_Explode)
package {
import flash.media.*;
public dynamic class FX_Explode extends Sound {
}
}//package
Section 112
//FX_Grow (FX_Grow)
package {
import flash.media.*;
public dynamic class FX_Grow extends Sound {
}
}//package
Section 113
//FX_Heal (FX_Heal)
package {
import flash.media.*;
public dynamic class FX_Heal extends Sound {
}
}//package
Section 114
//FX_Pickaxe (FX_Pickaxe)
package {
import flash.media.*;
public dynamic class FX_Pickaxe extends Sound {
}
}//package
Section 115
//FX_Punch (FX_Punch)
package {
import flash.media.*;
public dynamic class FX_Punch extends Sound {
}
}//package
Section 116
//Gameover (Gameover)
package {
import flash.media.*;
public dynamic class Gameover extends Sound {
}
}//package
Section 117
//Gamewin (Gamewin)
package {
import flash.media.*;
public dynamic class Gamewin extends Sound {
}
}//package
Section 118
//GridHighlight (GridHighlight)
package {
import flash.display.*;
public dynamic class GridHighlight extends MovieClip {
}
}//package
Section 119
//GrowMC (GrowMC)
package {
import flash.display.*;
public dynamic class GrowMC extends MovieClip {
public function GrowMC(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package
Section 120
//Haah (Haah)
package {
import flash.media.*;
public dynamic class Haah extends Sound {
}
}//package
Section 121
//Hah (Hah)
package {
import flash.media.*;
public dynamic class Hah extends Sound {
}
}//package
Section 122
//HexGrid (HexGrid)
package {
import flash.display.*;
public dynamic class HexGrid extends MovieClip {
}
}//package
Section 123
//Hmph (Hmph)
package {
import flash.media.*;
public dynamic class Hmph extends Sound {
}
}//package
Section 124
//IceRock (IceRock)
package {
import flash.display.*;
public dynamic class IceRock extends MovieClip {
}
}//package
Section 125
//Land (Land)
package {
import flash.media.*;
public dynamic class Land extends Sound {
}
}//package
Section 126
//LevelBG (LevelBG)
package {
import flash.display.*;
public dynamic class LevelBG extends MovieClip {
}
}//package
Section 127
//LevelBG_Reveal (LevelBG_Reveal)
package {
import flash.display.*;
public dynamic class LevelBG_Reveal extends MovieClip {
public var mc:MovieClip;
public function LevelBG_Reveal(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package
Section 128
//LevelLose (LevelLose)
package {
import flash.display.*;
public dynamic class LevelLose extends MovieClip {
public var mc:MovieClip;
public function LevelLose(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 129
//LevelProps (LevelProps)
package {
import flash.display.*;
public dynamic class LevelProps extends MovieClip {
}
}//package
Section 130
//LevelWin (LevelWin)
package {
import flash.display.*;
public dynamic class LevelWin extends MovieClip {
public var mc:MovieClip;
public function LevelWin(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 131
//lunaWorkMC (lunaWorkMC)
package {
import flash.display.*;
public dynamic class lunaWorkMC extends MovieClip {
public var punchFX:MovieClip;
public var chargeFX:MovieClip;
public function lunaWorkMC(){
addFrameScript(0, frame1, 26, frame27, 33, frame34, 34, frame35, 50, frame51);
}
function frame1(){
stop();
chargeFX.visible = false;
chargeFX.gotoAndStop(1);
punchFX.visible = false;
punchFX.gotoAndStop(1);
}
function frame27(){
chargeFX.visible = true;
chargeFX.play();
}
function frame34(){
gotoAndPlay("Wait");
}
function frame35(){
chargeFX.visible = false;
chargeFX.stop();
punchFX.visible = true;
punchFX.play();
}
function frame51(){
stop();
}
}
}//package
Section 132
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 133
//MissionFail (MissionFail)
package {
import flash.display.*;
public dynamic class MissionFail extends MovieClip {
public var mc:MovieClip;
public function MissionFail(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 134
//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{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 135
//PauseScreen (PauseScreen)
package {
import flash.display.*;
public dynamic class PauseScreen extends MovieClip {
public var muteButton:MovieClip;
public var resumeButton:MovieClip;
}
}//package
Section 136
//RegenMC (RegenMC)
package {
import flash.display.*;
public dynamic class RegenMC extends MovieClip {
public function RegenMC(){
addFrameScript(28, frame29);
}
function frame29(){
gotoAndStop(1);
}
}
}//package
Section 137
//Roger (Roger)
package {
import flash.media.*;
public dynamic class Roger extends Sound {
}
}//package
Section 138
//Select (Select)
package {
import flash.media.*;
public dynamic class Select extends Sound {
}
}//package
Section 139
//Shield (Shield)
package {
import flash.media.*;
public dynamic class Shield extends Sound {
}
}//package
Section 140
//SingleHex (SingleHex)
package {
import flash.display.*;
public dynamic class SingleHex extends MovieClip {
}
}//package
Section 141
//skyeWorkMC (skyeWorkMC)
package {
import flash.display.*;
public dynamic class skyeWorkMC extends MovieClip {
public var teleport:MovieClip;
public function skyeWorkMC(){
addFrameScript(32, frame33, 44, frame45);
}
function frame33(){
gotoAndPlay("Swing");
}
function frame45(){
stop();
}
}
}//package
Section 142
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 143
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 144
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 145
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 146
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 147
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 148
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 149
//SnowFlake (SnowFlake)
package {
import flash.display.*;
public dynamic class SnowFlake extends MovieClip {
}
}//package
Section 150
//Snowstorm (Snowstorm)
package {
import flash.display.*;
public dynamic class Snowstorm extends MovieClip {
public var blizzardmc:MovieClip;
public function Snowstorm(){
addFrameScript(0, frame1, 120, frame121);
}
function frame1(){
play();
}
function frame121(){
stop();
}
}
}//package
Section 151
//sunCharMC (sunCharMC)
package {
import flash.display.*;
public dynamic class sunCharMC extends MovieClip {
public function sunCharMC(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 152
//sunWorkMC (sunWorkMC)
package {
import flash.display.*;
public dynamic class sunWorkMC extends MovieClip {
public var swordfx:MovieClip;
public function sunWorkMC(){
addFrameScript(0, frame1, 19, frame20, 54, frame55);
}
function frame1(){
swordfx.visible = false;
swordfx.stop();
}
function frame20(){
swordfx.visible = true;
swordfx.play();
}
function frame55(){
stop();
}
}
}//package
Section 153
//Sword (Sword)
package {
import flash.media.*;
public dynamic class Sword extends Sound {
}
}//package
Section 154
//Teleport (Teleport)
package {
import flash.media.*;
public dynamic class Teleport extends Sound {
}
}//package
Section 155
//Teleport2 (Teleport2)
package {
import flash.media.*;
public dynamic class Teleport2 extends Sound {
}
}//package
Section 156
//TimerMC (TimerMC)
package {
import flash.display.*;
public dynamic class TimerMC extends MovieClip {
}
}//package
Section 157
//TropicalMusic (TropicalMusic)
package {
import flash.media.*;
public dynamic class TropicalMusic extends Sound {
}
}//package
Section 158
//Wait (Wait)
package {
import flash.media.*;
public dynamic class Wait extends Sound {
}
}//package
Section 159
//Whip (Whip)
package {
import flash.media.*;
public dynamic class Whip extends Sound {
}
}//package
Section 160
//WhiteBG (WhiteBG)
package {
import flash.display.*;
public dynamic class WhiteBG extends MovieClip {
}
}//package