Section 1
//GameIntroComponent (com.miniclip.components.GameIntroComponent)
package com.miniclip.components {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class GameIntroComponent extends UIComponent {
private var mcInternalAnimation:InternalAnimation;
public var debug:Boolean;// = false
private var hasStarted:Boolean;// = false
private var mcExternalAnimation:MovieClip;// = null
public var animationUrl:String;// = "http://www.miniclip.com/swfcontent/as3/intro.swf"
private var externalLoader:Loader;// = null
private var isOnMiniclip:Boolean;// = false
public static var DEFAULT_WIDTH:uint = 328;
public static var DEFAULT_HEIGHT:uint = 204;
public function GameIntroComponent():void{
externalLoader = null;
mcExternalAnimation = null;
isOnMiniclip = false;
hasStarted = false;
animationUrl = "http://www.miniclip.com/swfcontent/as3/intro.swf";
debug = false;
super();
}
private function updateProgress():void{
if (mcExternalAnimation){
mcExternalAnimation.updateProgress((loaderInfo.bytesLoaded / loaderInfo.bytesTotal));
};
}
private function detectOnMiniclip():Boolean{
var _local1:RegExp;
if ((((loaderInfo == null)) || ((loaderInfo.url == null)))){
return (false);
};
_local1 = /^http:\/\/[\w]+.miniclip.com/;
return (_local1.test(loaderInfo.url));
}
private function handleMiniclipClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.miniclip.com/"));
}
private function start():void{
if (!isLivePreview){
Security.allowDomain("*");
mcInternalAnimation.mcOffsite.addEventListener(MouseEvent.CLICK, handleMiniclipClick, false, 0, true);
mcInternalAnimation.mcOffsite.visible = false;
isOnMiniclip = (debug) ? true : detectOnMiniclip();
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
x = 0;
y = 0;
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
mcInternalAnimation.x = ((stage.stageWidth / 2) - (DEFAULT_WIDTH / 2));
mcInternalAnimation.y = ((stage.stageHeight / 2) - (DEFAULT_HEIGHT / 2));
mcInternalAnimation.visible = true;
loadExternalAnimation();
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
};
}
private function onExternalAnimationFinished(_arg1:Event):void{
removeExternalAnimation();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
removeComponent();
dispatchEvent(new Event(Event.COMPLETE));
}
private function externalAnimationIoErrorHandler(_arg1:IOErrorEvent):void{
externalAnimationError();
}
private function removeComponent():void{
if (externalLoader){
externalLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, externalAnimationLoaded);
externalLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, externalAnimationIoErrorHandler);
externalLoader = null;
};
}
private function removeInternalAnimation():void{
if (mcInternalAnimation){
removeChild(mcInternalAnimation);
mcInternalAnimation = null;
};
}
private function externalAnimationProgress(_arg1:ProgressEvent):void{
var _local2:uint;
_local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
mcInternalAnimation.mcProgress.gotoAndStop(_local2);
}
override protected function draw():void{
super.draw();
if (!hasStarted){
hasStarted = true;
start();
};
}
override protected function configUI():void{
super.configUI();
mcInternalAnimation = new InternalAnimation();
if (!isLivePreview){
mcInternalAnimation.visible = false;
};
addChild(mcInternalAnimation);
}
private function externalAnimationLoaded(_arg1:Event):void{
removeInternalAnimation();
addChild(externalLoader);
mcExternalAnimation = MovieClip(externalLoader.content);
mcExternalAnimation.addEventListener("finished", onExternalAnimationFinished, false, 0, true);
mcExternalAnimation.begin(isOnMiniclip);
}
private function externalAnimationError():void{
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
mcInternalAnimation.mcOffsite.visible = true;
}
private function loadExternalAnimation():void{
var _local1:String;
var _local2:URLRequest;
externalLoader = new Loader();
externalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externalAnimationLoaded);
externalLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, externalAnimationProgress);
externalLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, externalAnimationIoErrorHandler);
_local1 = ((animationUrl + "?") + Math.round((Math.random() * 10000)));
_local2 = new URLRequest(_local1);
externalLoader.load(_local2);
}
private function handleEnterFrame(_arg1:Event):void{
updateProgress();
}
private function removeExternalAnimation():void{
if (mcExternalAnimation != null){
removeChild(externalLoader);
mcExternalAnimation = null;
externalLoader.unload();
};
}
}
}//package com.miniclip.components
Section 2
//HighscoresLoader (com.miniclip.highscores.HighscoresLoader)
package com.miniclip.highscores {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class HighscoresLoader extends EventDispatcher {
private static const OFFSITE_SWF:String = "highscores_offsite.swf";
private static const ALLOWED_DOMAINS:Array = ["http://miniclip.com", "http://www.miniclip.com", "http://cms.miniclip.com", "miniclips.com"];
private static const HIGHSCORESBOX_SWF:String = "highscoresbox_v3.swf";
public static var ldr:Loader;
private static var URL_PREFIX:String;
private static var localConnectionID:String;
public static var target:DisplayObjectContainer;
public static var score:Number;
private static var firstrun:Boolean = true;
private static var objLocalConnection:LocalConnection;
private static var singleInstance:HighscoresLoader;
public function HighScoresLoader(){
}
protected static function buildQueryString():String{
var _local1:String;
var _local2:String;
var _local3:String;
_local1 = "?";
_local2 = "";
for (_local3 in target.stage.loaderInfo.parameters) {
_local1 = (_local1 + (((_local2 + _local3) + "=") + escape(target.stage.loaderInfo.parameters[_local3])));
_local2 = "&";
};
_local1 = (_local1 + ("&mc_lcid=" + localConnectionID));
return (_local1);
}
private static function handleTargetRemoved(_arg1:Event):void{
target = null;
}
protected static function validateDomain():Boolean{
var _local1:Boolean;
var _local2:String;
var _local3:Number;
_local1 = false;
_local2 = target.stage.loaderInfo.url;
_local3 = 0;
while (_local3 < ALLOWED_DOMAINS.length) {
if (_local2.indexOf(ALLOWED_DOMAINS[_local3]) >= 0){
_local1 = true;
};
_local3++;
};
return (_local1);
}
public static function hsbready():void{
sendScore();
}
private static function initialize():void{
var _local1:String;
objLocalConnection = new LocalConnection();
objLocalConnection.client = HighscoresLoader;
objLocalConnection.allowDomain("www.miniclip.com", "cms.miniclip.com");
objLocalConnection.connect((localConnectionID + "back"));
if (validateDomain()){
_local1 = buildQueryString();
ldr.load(new URLRequest(((URL_PREFIX + HIGHSCORESBOX_SWF) + _local1)));
} else {
ldr.load(new URLRequest((URL_PREFIX + OFFSITE_SWF)));
};
}
public static function hsbhidden():void{
singleInstance.dispatchEvent(new Event("close"));
}
private static function onLCStatus(_arg1:Event):void{
}
public static function start(_arg1:Stage, _arg2:Number=undefined):HighscoresLoader{
trace(("HighscoresLoader.start / score:" + _arg2));
URL_PREFIX = ((_arg1.loaderInfo.url.substring(0, 8))=="file:///") ? "http://www.miniclip.com/swfcontent/components/" : "/swfcontent/components/";
HighscoresLoader.score = (isNaN(_arg2)) ? undefined : Number(_arg2);
if (target == null){
target = _arg1;
target.addEventListener(Event.REMOVED_FROM_STAGE, handleTargetRemoved);
if (firstrun){
singleInstance = new (HighscoresLoader);
localConnectionID = ("LC" + String(Math.floor((Math.random() * 1000000))));
ldr = new Loader();
target.addChild(ldr);
initialize();
} else {
target.addChild(ldr);
sendScore();
};
} else {
sendScore();
};
firstrun = false;
return (singleInstance);
}
public static function sendScore():void{
var _local1:LocalConnection;
_local1 = new LocalConnection();
_local1.addEventListener(StatusEvent.STATUS, onLCStatus);
_local1.send(localConnectionID, "setScore", score);
}
}
}//package com.miniclip.highscores
Section 3
//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 4
//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 5
//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 6
//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 7
//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 8
//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 9
//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 10
//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 11
//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 12
//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 13
//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 14
//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 15
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 16
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 17
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 18
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 19
//mcProgressBar_3 (MiniclipIntroAS3_fla.mcProgressBar_3)
package MiniclipIntroAS3_fla {
import flash.display.*;
public dynamic class mcProgressBar_3 extends MovieClip {
public function mcProgressBar_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MiniclipIntroAS3_fla
Section 20
//instructions_mc_4 (twistedGame_fla.instructions_mc_4)
package twistedGame_fla {
import flash.display.*;
public dynamic class instructions_mc_4 extends MovieClip {
public var playButton:SimpleButton;
public var backButton:SimpleButton;
}
}//package twistedGame_fla
Section 21
//MainTimeline (twistedGame_fla.MainTimeline)
package twistedGame_fla {
import flash.display.*;
import flash.events.*;
import com.miniclip.highscores.*;
import fl.transitions.*;
import flash.net.*;
import flash.utils.*;
import fl.transitions.easing.*;
import flash.media.*;
import flash.text.*;
import com.miniclip.components.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var shootSound1:GooShoot01;
public var shootSound3:GooShoot03;
public var buttonDistToTarget:Number;
public var splatCanvas:Sprite;
public var allowRemoveSplats:Boolean;
public var stageAssets:MovieClip;
public var splat:splat_mc;
public var shootSound2:GooShoot02;
public var backgroundCanvas:Sprite;
public var hydrant:hydrant_mc;
public var levelButtonStart:Number;
public var twistedBar:twistedBar_mc;
public var gameMusicChannel:SoundChannel;
public var buttonSpeed:Number;
public var quietChannel:SoundChannel;
public var quiet:SoundTransform;
public var plopSound:plop;
public var tileArray:Array;
public var __setPropDict:Dictionary;
public var gravity:Number;
public var debug:debug_mc;
public var gameMusicVolume:SoundTransform;
public var intro:GameIntroComponent;
public var numberOfSplatters:uint;
public var fireSound:fire;
public var score:uint;
public var preGameScreens:preGameScreens_mc;
public var theta:Number;
public var gameCanvasTween:Tween;
public var menuTween:Tween;
public var splatted:Boolean;
public var cannonCanvas:Sprite;
public var thunderSound:Thunder;
public var numberOfSplatterlings:uint;
public var submitSuccess:Boolean;
public var gameOverSound:GooGameOver;
public var fpsCounter:Number;
public var splatterArray:Array;
public var whiskSound:whisk;
public var fps:Number;
public var laughterSound:GooLaughter;
public var cannon:cannon_mc;
public var arrowLeftDownFlag:Boolean;
public var power:Number;
public var bestScore:uint;
public var introMusic:Soundtrack;
public var hsLoader:URLLoader;
public var globalSound:SoundTransform;
public var powerCounter:uint;
public var gui:gui_mc;
public var soundToggle:soundToggle_mc;
public var gameWon:Boolean;
public var splatSpeed:Number;
public var numberOfSections:uint;
public var splattedObject:DisplayObject;
public var blackScreen:blackScreen_mc;
public var gameMusic:Twister;
public var soundOn:Boolean;
public var fpsNewTime:Number;
public var squelchSound:squelch;
public var fpsStartTime:Number;
public var objectCanvas:Sprite;
public var submitHighscoreScreen:submitHighscoreScreen_mc;
public var gameRunning:Boolean;
public var powerMeter:powerMeter_mc;
public var trajectory:Number;
public var lastButtonPressed:String;
public var boingSound:boing;
public var introMusicChannel:SoundChannel;
public var splatDead:Boolean;
public var splatSpeedX:Number;
public var splatSpeedY:Number;
public var introMusicVolume:SoundTransform;
public var hairdryerSound:Hairdryer;
public var fpsElapsedTime:Number;
public var instructionsTween:Tween;
public var projectCanvas:Sprite;
public var splatSound1:Splat01;
public var birdSound:bird;
public var splatSound2:Splat02;
public var blackScreenTween:Tween;
public var arrowRightDownFlag:Boolean;
public var resplatted:Boolean;
public var highscoresTween:Tween;
public var flashCounter:uint;
public var gameOver:Boolean;
public var gameCanvas:Sprite;
public var adjusting:Boolean;
public function MainTimeline(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function setupArrays(){
var _local1:*;
_local1 = 1;
while (_local1 <= numberOfSections) {
tileArray[_local1] = new MovieClip();
tileArray[_local1].exists = false;
_local1++;
};
}
public function submit(_arg1:String, _arg2:Number):URLLoader{
var _local3:URLVariables;
var _local4:URLRequest;
var _local5:URLLoader;
_local3 = new URLVariables();
_local3.hsname = _arg1;
_local3.score = String(_arg2);
_local4 = new URLRequest("http://www.andromedus.com/scripts/photobox_insert_score.php");
_local4.data = _local3;
_local4.method = URLRequestMethod.POST;
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.TEXT;
_local5.load(_local4);
return (_local5);
}
public function toggleSound(_arg1:MouseEvent):void{
if (soundOn == true){
soundOn = false;
soundToggle.gotoAndStop(2);
globalSound.volume = 0;
SoundMixer.soundTransform = globalSound;
} else {
soundOn = true;
soundToggle.gotoAndStop(1);
globalSound.volume = 1;
SoundMixer.soundTransform = globalSound;
};
}
public function removeBlackScreen(_arg1:TweenEvent):void{
blackScreenTween.removeEventListener(TweenEvent.MOTION_FINISH, removeBlackScreen);
stage.removeChild(blackScreen);
}
public function resetVars():void{
var _local1:*;
_local1 = 1;
while (_local1 <= numberOfSections) {
tileArray[_local1] = new MovieClip();
tileArray[_local1].exists = false;
_local1++;
};
gameRunning = true;
gameOver = false;
splatted = false;
resplatted = false;
splatDead = false;
splatterArray = new Array();
score = 0;
numberOfSplatters = 0;
}
public function exitGame():void{
gameRunning = false;
cleanUp();
}
public function showLightningEffect():void{
blackScreen = new blackScreen_mc();
stage.addChild(blackScreen);
blackScreen.mouseEnabled = false;
blackScreen.addEventListener(Event.ENTER_FRAME, flashScreen);
}
public function updateTiles():void{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:String;
var _local7:Class;
var _local8:uint;
_local1 = -(backgroundCanvas.x);
_local2 = Math.floor((_local1 / stage.stageWidth));
_local3 = (Math.floor((_local1 / stage.stageWidth)) + 1);
_local4 = (Math.floor((_local1 / stage.stageWidth)) + 2);
_local5 = 1;
while (_local5 <= numberOfSections) {
tileArray[_local5].on = false;
if ((((((_local5 == _local2)) || ((_local5 == _local4)))) || ((_local5 == _local3)))){
tileArray[_local5].on = true;
};
if ((((tileArray[_local5].on == true)) && ((tileArray[_local5].exists == false)))){
if (_local5 > 5){
_local8 = (_local5 % 5);
if (_local8 == 0){
_local8 = 5;
};
} else {
_local8 = _local5;
};
_local6 = (("background" + String(_local8)) + "_mc");
_local7 = (getDefinitionByName(_local6) as Class);
tileArray[_local5] = new (_local7);
tileArray[_local5].x = (stage.stageWidth * (_local5 - 1));
backgroundCanvas.addChild(tileArray[_local5]);
};
if ((((tileArray[_local5].on == false)) && ((tileArray[_local5].exists == true)))){
backgroundCanvas.removeChild(tileArray[_local5]);
tileArray[_local5].exists = false;
};
_local5++;
};
}
public function makeBin(_arg1:Number, _arg2:Number):void{
var _local3:bin_mc;
_local3 = new bin_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "bin";
_local3.splatted = false;
}
public function addGameElements():void{
var _local1:uint;
var _local2:String;
var _local3:Class;
var _local4:Array;
var _local5:MovieClip;
var _local6:*;
var _local7:DisplayObject;
powerMeter = new powerMeter_mc();
cannonCanvas.addChild(powerMeter);
powerMeter.x = 20;
powerMeter.y = 140;
_local1 = 1;
while (_local1 <= 6) {
_local2 = (("levelSection" + String(_local1)) + "_mc");
_local3 = (getDefinitionByName(_local2) as Class);
_local4 = new Array();
_local5 = new (_local3);
_local4[_local1] = _local5;
_local6 = 0;
while (_local6 < _local4[_local1].numChildren) {
_local7 = _local4[_local1].getChildAt(_local6);
if ((_local7 is wall_template)){
makeWall((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is launchPad_template)){
makeLaunchPad((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is cannon_template)){
makeCannon((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is bar_template)){
makeBar((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is toaster_template)){
makeToaster((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is bin_template)){
makeBin((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is hole_template)){
makeHole((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is hydrant_template)){
makeHydrant((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is grater_template)){
makeGrater((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is castle_template)){
makeCastle((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is cards_template)){
makeCards((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is bird_template)){
makeBird((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is hairdryer_template)){
makeHairdryer((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
if ((_local7 is whisk_template)){
makeWhisk((_local7.x + ((_local1 - 1) * (stage.stageWidth * 5))), _local7.y);
};
_local6++;
};
_local1++;
};
}
function frame3(){
stop();
fps = 0;
fpsStartTime = 0;
fpsNewTime = 0;
fpsElapsedTime = 0;
fpsCounter = 0;
levelButtonStart = 0;
buttonSpeed = 0;
buttonDistToTarget = 0;
splatSpeed = 0;
splatSpeedY = 0;
splatSpeedX = 0;
gravity = -0.3;
power = 0;
theta = 0;
trajectory = 0;
powerCounter = 0;
numberOfSections = 100;
bestScore = 0;
score = 0;
numberOfSplatters = 0;
numberOfSplatterlings = 0;
lastButtonPressed = "";
gameRunning = false;
gameOver = false;
gameWon = false;
submitSuccess = false;
arrowLeftDownFlag = false;
arrowRightDownFlag = false;
adjusting = false;
splatted = false;
resplatted = false;
splatDead = false;
soundOn = true;
allowRemoveSplats = false;
splatterArray = new Array();
tileArray = new Array();
globalSound = SoundMixer.soundTransform;
quiet = new SoundTransform();
quiet.volume = 0.3;
gameMusicVolume = new SoundTransform();
gameMusicVolume.volume = 0.4;
gameMusic = new Twister();
introMusicVolume = new SoundTransform();
introMusicVolume.volume = 1;
introMusic = new Soundtrack();
boingSound = new boing();
birdSound = new bird();
plopSound = new plop();
hairdryerSound = new Hairdryer();
whiskSound = new whisk();
squelchSound = new squelch();
fireSound = new fire();
shootSound1 = new GooShoot01();
shootSound2 = new GooShoot02();
shootSound3 = new GooShoot03();
gameOverSound = new GooGameOver();
splatSound1 = new Splat01();
splatSound2 = new Splat02();
thunderSound = new Thunder();
laughterSound = new GooLaughter();
initialise();
}
public function makeCards(_arg1:Number, _arg2:Number):void{
var _local3:cards_mc;
_local3 = new cards_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "cards";
_local3.splatted = false;
}
public function spawnSplatters(_arg1:uint, _arg2:String):void{
var _local3:*;
var _local4:*;
_local3 = (numberOfSplatters + 1);
while (_local3 <= (numberOfSplatters + _arg1)) {
_local4 = new splat_mc();
splatterArray[_local3] = _local4;
if (_arg2 == "medium"){
splatterArray[_local3].height = (splatterArray[_local3].height * 0.2);
splatterArray[_local3].width = (splatterArray[_local3].width * 0.2);
};
if (_arg2 == "small"){
splatterArray[_local3].height = (splatterArray[_local3].height * 0.1);
splatterArray[_local3].width = (splatterArray[_local3].width * 0.1);
};
splatCanvas.addChild(splatterArray[_local3]);
splatterArray[_local3].splatSpeedY = ((splatSpeedY - 0.5) + (Math.random() * 1));
splatterArray[_local3].splatSpeedX = ((splatSpeedX - 0.5) + (Math.random() * 1));
splatterArray[_local3].x = splat.x;
splatterArray[_local3].y = (splat.y + 2);
splatterArray[_local3].dead = false;
_local3++;
};
numberOfSplatters = (numberOfSplatters + _arg1);
}
public function flashScreen(_arg1:Event):void{
blackScreen.visible = true;
flashCounter++;
if (flashCounter <= 60){
blackScreen.alpha = (1 - (flashCounter / 200));
};
if ((((flashCounter > 60)) && ((flashCounter < 63)))){
blackScreen.visible = false;
};
if ((((flashCounter > 70)) && ((flashCounter < 73)))){
blackScreen.visible = false;
};
if (flashCounter > 90){
blackScreen.removeEventListener(Event.ENTER_FRAME, flashScreen);
blackScreenTween = new Tween(blackScreen, "alpha", None.easeNone, blackScreen.alpha, 0, 3, true);
blackScreenTween.addEventListener(TweenEvent.MOTION_FINISH, removeBlackScreen);
};
}
public function checkPosition(_arg1:Event):void{
splatSpeedY = 0;
if (splat.x >= (hydrant.x + hydrant.hitzone.x)){
resurface();
};
}
public function moveCamera():void{
var _local1:Number;
_local1 = splat.x;
if (_local1 > (stage.stageWidth / 2)){
backgroundCanvas.x = ((stage.stageWidth / 2) - _local1);
objectCanvas.x = ((stage.stageWidth / 2) - _local1);
cannonCanvas.x = ((stage.stageWidth / 2) - _local1);
splatCanvas.x = ((stage.stageWidth / 2) - _local1);
};
}
public function showSubmitHighscoreScreen(_arg1:MouseEvent):void{
var _local2:HighscoresLoader;
gui.playAgainButton.removeEventListener(MouseEvent.MOUSE_DOWN, replay);
gui.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showSubmitHighscoreScreen);
gui.exitButton.visible = false;
_local2 = HighscoresLoader.start(stage, score);
_local2.addEventListener("close", highScoreSubmitted);
gui.exitButton.addEventListener(MouseEvent.MOUSE_DOWN, highScoreSubmitted);
gui.loading_mc.visible = true;
gui.playAgainButton.visible = false;
gui.submitButton.visible = false;
}
public function trackThis(_arg1){
var _local2:URLVariables;
var _local3:URLRequest;
var _local4:URLLoader;
_local2 = new URLVariables();
_local3 = new URLRequest(_arg1);
_local3.data = _local2;
_local3.method = URLRequestMethod.POST;
_local4 = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.TEXT;
_local4.load(_local3);
return (_local4);
}
function frame1(){
if ((((__setPropDict[intro] == undefined)) || (!((((int(__setPropDict[intro]) >= 1)) && ((int(__setPropDict[intro]) <= 2))))))){
__setPropDict[intro] = currentFrame;
__setProp_intro_Scene1_preloader_1();
};
stop();
intro.addEventListener(Event.COMPLETE, introComplete);
}
public function makeCastle(_arg1:Number, _arg2:Number):void{
var _local3:castle_mc;
_local3 = new castle_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "castle";
_local3.splatted = false;
}
public function makeHydrant(_arg1:Number, _arg2:Number):void{
hydrant = new hydrant_mc();
hydrant.x = _arg1;
hydrant.y = _arg2;
objectCanvas.addChild(hydrant);
}
public function initialise():void{
playIntroSounds();
projectCanvas = new Sprite();
stage.addChild(projectCanvas);
showLightningEffect();
showSoundIcon();
showPreGameScreens();
setupArrays();
showMenu();
}
public function showMenu():void{
menuTween = new Tween(preGameScreens, "x", Strong.easeInOut, preGameScreens.x, (-(stage.stageWidth) * 2), 1, true);
}
public function showGuiButtons():void{
var _local1:String;
allowRemoveSplats = false;
splat.removeEventListener(Event.ENTER_FRAME, checkPosition);
gui.playAgainButton.visible = true;
gui.submitButton.visible = true;
gui.screenBlackout.visible = true;
gui.exitButton.visible = true;
gui.finalScore.visible = true;
gui.finalScoreLabel.visible = true;
gui.finalScore.text = String(score);
gui.loading_mc.visible = false;
gameMusicChannel.stop();
introMusicChannel = introMusic.play(0, 100);
if (score <= 1000){
_local1 = "Twisted? You’re in deep goo-goo.";
} else {
if (score <= 3000){
_local1 = "C’mon, we know you can goo better.";
} else {
if (score <= 4000){
_local1 = "Surely you can get more twisted than that!";
} else {
if (score <= 6000){
_local1 = "Nice try – you’re starting to get your goo on.";
} else {
if (score <= 8000){
_local1 = "Soon you’ll be showing us all how to goo it.";
} else {
if (score <= 10000){
_local1 = "Goo again – you’re getting the hang of it.";
} else {
if (score <= 12000){
_local1 = "Now you’re really showing us what you can goo.";
} else {
if (score <= 14000){
_local1 = "Congrats – that score is mad, bad and downright twisted.";
} else {
if (score <= 18000){
_local1 = "Well done – you’re the most twisted player in town.";
} else {
_local1 = "You are the goomeister!";
};
};
};
};
};
};
};
};
};
gui.msg_txt.text = _local1;
gui.playAgainButton.addEventListener(MouseEvent.MOUSE_DOWN, replay);
gui.submitButton.addEventListener(MouseEvent.MOUSE_DOWN, showSubmitHighscoreScreen);
}
public function makeWhisk(_arg1:Number, _arg2:Number):void{
var _local3:whisk_mc;
_local3 = new whisk_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "whisk";
_local3.splatted = false;
}
public function moveSplatters():void{
var _local1:*;
_local1 = 1;
while (_local1 <= numberOfSplatters) {
if (splatted == true){
if (((!((splatterArray[_local1] == undefined))) && (!((splatterArray[_local1] == 0))))){
if (splatterArray[_local1].dead == false){
splatterArray[_local1].x = (splatterArray[_local1].x + splatterArray[_local1].splatSpeedX);
splatterArray[_local1].y = (splatterArray[_local1].y - splatterArray[_local1].splatSpeedY);
splatterArray[_local1].splatSpeedY = (splatterArray[_local1].splatSpeedY + gravity);
splatterArray[_local1].rotation = (-70 + ((180 / Math.PI) * Math.atan2(splatterArray[_local1].splatSpeedX, splatterArray[_local1].splatSpeedY)));
};
};
};
_local1++;
};
}
public function makeCannon(_arg1:Number, _arg2:Number):void{
cannon = new cannon_mc();
cannonCanvas.addChild(cannon);
cannon.x = _arg1;
cannon.y = _arg2;
cannon.arrow.alpha = 0.5;
}
public function tweenToMenu(_arg1:MouseEvent):void{
showMenu();
}
public function submitCompleteHandler(_arg1:Event):void{
submitSuccess = true;
submitHighscoreScreen.message.text = "Score submitted!";
hsLoader.removeEventListener(Event.COMPLETE, submitCompleteHandler);
}
public function displayFPS():void{
}
public function makeHairdryer(_arg1:Number, _arg2:Number):void{
var _local3:hairdryer_mc;
_local3 = new hairdryer_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "hairdryer";
_local3.splatted = false;
}
public function moveSplat():void{
if (splatDead == false){
splat.x = (splat.x + splatSpeedX);
splat.y = (splat.y - splatSpeedY);
splatSpeedY = (splatSpeedY + gravity);
splat.rotation = (-110 + ((180 / Math.PI) * Math.atan2(splatSpeedX, splatSpeedY)));
};
}
public function highScoreSubmitted(_arg1){
trace("HIGH SCORE SUBMITTED");
projectCanvas.removeChild(gameCanvas);
stage.removeEventListener(Event.ENTER_FRAME, selectPower);
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, selectPowerComplete);
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, fireSplat);
stage.removeEventListener(Event.ENTER_FRAME, selectTrajectory);
gui.exitButton.removeEventListener(MouseEvent.MOUSE_DOWN, quit);
gui.loading_mc.visible = false;
stage.removeEventListener(Event.ENTER_FRAME, gameLoop);
showPreGameScreens();
showMenu();
}
public function showGame(_arg1:MouseEvent):void{
var _local2:*;
menuTween = new Tween(preGameScreens, "x", Strong.easeInOut, preGameScreens.x, (-(stage.stageWidth) * 3), 1, true);
menuTween.addEventListener(TweenEvent.MOTION_FINISH, removePreGameScreensAndIntialise);
_local2 = trackThis("http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/twisted_plays/142354@x01");
_local2.addEventListener(Event.COMPLETE, trackCompleteHandler);
}
public function quit(_arg1:MouseEvent):void{
gameMusicChannel.stop();
introMusicChannel.stop();
introMusicChannel = introMusic.play(0, 100);
exitGame();
showPreGameScreens();
showMenu();
}
public function cleanUp():void{
stage.removeEventListener(Event.ENTER_FRAME, selectPower);
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, selectPowerComplete);
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, fireSplat);
stage.removeEventListener(Event.ENTER_FRAME, selectTrajectory);
gui.exitButton.removeEventListener(MouseEvent.MOUSE_DOWN, quit);
stage.removeEventListener(Event.ENTER_FRAME, gameLoop);
projectCanvas.removeChild(gameCanvas);
}
public function showPreGameScreens():void{
preGameScreens = new preGameScreens_mc();
projectCanvas.addChild(preGameScreens);
preGameScreens.x = (-(stage.stageWidth) * 2);
preGameScreens.menu.playButton.addEventListener(MouseEvent.MOUSE_DOWN, showGame);
preGameScreens.menu.instructionsButton.addEventListener(MouseEvent.MOUSE_DOWN, showInstructions);
preGameScreens.menu.highscoresButton.addEventListener(MouseEvent.MOUSE_DOWN, showHighscores);
preGameScreens.instructions.playButton.addEventListener(MouseEvent.MOUSE_DOWN, showGame);
preGameScreens.instructions.backButton.addEventListener(MouseEvent.MOUSE_DOWN, tweenToMenu);
}
public function submitHighscore(_arg1:MouseEvent):void{
submitHighscoreScreen.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, submitHighscore);
submitHighscoreScreen.message.text = "Connecting: Please wait ...";
hsLoader = submit(submitHighscoreScreen.playerName.text, score);
hsLoader.addEventListener(Event.COMPLETE, submitCompleteHandler);
setTimeout(submitFail, 15000);
}
public function trackCompleteHandler(_arg1:Event):void{
trace("EVENT TRACKED.");
}
public function playIntroSounds():void{
introMusicChannel = introMusic.play(0, 100);
setTimeout(playThunder, 2000);
setTimeout(playLaughter, 4000);
}
public function playThunder():void{
thunderSound.play();
}
public function addGUI():void{
gui = new gui_mc();
gameCanvas.addChild(gui);
gui.playAgainButton.visible = false;
gui.submitButton.visible = false;
gui.loading_mc.visible = false;
gui.bestScoreDisplay.text = ("best: " + bestScore);
gui.screenBlackout.visible = false;
gui.finalScoreLabel.visible = false;
gui.finalScore.visible = false;
gui.exitButton.visible = false;
gui.exitButton.addEventListener(MouseEvent.MOUSE_DOWN, quit);
}
public function resurface():void{
splat.removeEventListener(Event.ENTER_FRAME, checkPosition);
splat.y = (splat.y - 50);
splat.visible = true;
splatSpeedX = (6 + (Math.random() * 8));
splatSpeedY = (8 + (Math.random() * 4));
hydrant.gotoAndPlay("b");
playSplat();
}
public function makeWall(_arg1:Number, _arg2:Number):void{
var _local3:wall_mc;
_local3 = new wall_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "wall";
_local3.splatted = false;
}
function frame2(){
if ((((__setPropDict[intro] == undefined)) || (!((((int(__setPropDict[intro]) >= 1)) && ((int(__setPropDict[intro]) <= 2))))))){
__setPropDict[intro] = currentFrame;
__setProp_intro_Scene1_preloader_1();
};
stageAssets.visible = false;
}
public function unsplat(_arg1:MovieClip){
_arg1.splatted = false;
}
public function showHighscores(_arg1:MouseEvent):void{
menuTween = new Tween(preGameScreens, "x", Strong.easeInOut, preGameScreens.x, 0, 1, true);
menuTween.addEventListener(TweenEvent.MOTION_FINISH, highScoresTweenDone);
}
public function checkGameOver():void{
var _local1:*;
if ((((splatted == false)) && ((splatDead == true)))){
gameOver = true;
};
if ((((splatted == true)) && ((splatDead == true)))){
gameOver = true;
_local1 = 1;
while (_local1 <= numberOfSplatters) {
if (((!((splatterArray[_local1] == undefined))) && (!((splatterArray[_local1] == 0))))){
if (splatterArray[_local1].dead == false){
gameOver = false;
};
};
_local1++;
};
};
if (gameOver == true){
showGuiButtons();
gameRunning = false;
gameOverSound.play();
};
}
public function makeGrater(_arg1:Number, _arg2:Number):void{
var _local3:grater_mc;
_local3 = new grater_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "grater";
_local3.splatted = false;
}
public function highscoresCompleted(_arg1:Event):void{
trace("Highscore component finished.");
}
public function makeToaster(_arg1:Number, _arg2:Number):void{
var _local3:toaster_mc;
_local3 = new toaster_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "toaster";
_local3.splatted = false;
}
public function initialiseGame():void{
var _local1:Date;
resetVars();
setupCanvases();
addGameElements();
addGUI();
debug = new debug_mc();
stage.addChild(debug);
debug.visible = false;
introMusicChannel.stop();
gameMusicChannel = gameMusic.play();
gameMusicChannel.soundTransform = gameMusicVolume;
_local1 = new Date();
fpsStartTime = _local1.getTime();
}
public function showInstructions(_arg1:MouseEvent):void{
menuTween = new Tween(preGameScreens, "x", Strong.easeInOut, preGameScreens.x, -(stage.stageWidth), 1, true);
}
public function playLaughter():void{
laughterSound.play();
}
public function makeBar(_arg1:Number, _arg2:Number):void{
twistedBar = new twistedBar_mc();
cannonCanvas.addChild(twistedBar);
twistedBar.x = _arg1;
twistedBar.y = _arg2;
}
public function removeSplatter(_arg1:uint):void{
if (allowRemoveSplats == true){
splatCanvas.removeChild(splatterArray[_arg1]);
};
}
public function selectPower(_arg1:Event):void{
var _local2:Number;
if (gameRunning == true){
displayFPS();
_local2 = (80 * (1 - Math.abs(Math.sin(((theta * Math.PI) / 180)))));
power = _local2;
theta = (theta + 6);
powerMeter.powerMask.height = ((100 * power) / 80);
if (power < 20){
power = 20;
};
};
}
public function updateScore():void{
var _local1:Number;
_local1 = splat.x;
if (_local1 < 0){
_local1 = 0;
};
score = _local1;
if (score > bestScore){
bestScore = score;
};
}
public function submitFail():void{
if (submitSuccess == false){
submitHighscoreScreen.message.text = "Sorry, could not connect. Try submitting again.";
hsLoader.removeEventListener(Event.COMPLETE, submitCompleteHandler);
submitHighscoreScreen.submitButton.addEventListener(MouseEvent.MOUSE_DOWN, submitHighscore);
};
}
public function playSplat():void{
var _local1:uint;
_local1 = Math.ceil((Math.random() * 2));
if (_local1 == 1){
splatSound1.play();
};
if (_local1 == 2){
splatSound2.play();
};
}
public function highScoresTweenDone(_arg1){
var _local2:HighscoresLoader;
_local2 = HighscoresLoader.start(stage, undefined);
_local2.addEventListener("close", highScoresClosed);
}
function __setProp_intro_Scene1_preloader_1(){
try {
intro["componentInspectorSetting"] = true;
} catch(e:Error) {
};
intro.debug = true;
intro.enabled = true;
intro.animationUrl = "http://www.miniclip.com/swfcontent/as3/intro.swf";
intro.visible = true;
try {
intro["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function removeSubmitHighscoreScreen(_arg1:MouseEvent):void{
submitHighscoreScreen.continueButton.removeEventListener(MouseEvent.MOUSE_DOWN, removeSubmitHighscoreScreen);
exitGame();
showPreGameScreens();
showMenu();
}
public function collisions():void{
var _local1:*;
var _local2:DisplayObject;
var _local3:MovieClip;
var _local4:*;
var _local5:*;
if (splat.visible == true){
if (splatDead == false){
_local1 = 0;
while (_local1 < objectCanvas.numChildren) {
_local2 = objectCanvas.getChildAt(_local1);
_local3 = (_local2 as MovieClip);
if (_local3.hasOwnProperty("id") == true){
if ((((splat.hitzone.hitTestObject(_local3.hitzone) == true)) && ((_local3.splatted == false)))){
_local3.splatted = true;
if (_local3.id != "cards"){
setTimeout(unsplat, 1000, _local3);
};
splatted = true;
splattedObject = _local2;
if (_local3.id == "wall"){
splatted = true;
splattedObject = _local2;
splatSpeedY = (splatSpeedY * -0.5);
spawnSplatters(5, "medium");
splat.y = (splat.y - 5);
playSplat();
};
if (_local3.id == "castle"){
splatted = true;
splattedObject = _local2;
splatSpeedY = (splatSpeedY * -1.5);
splatSpeedX = (splatSpeedX * 1.2);
spawnSplatters(5, "medium");
splat.y = (splat.y - 5);
boingSound.play();
_local3.gotoAndPlay("b");
};
if (_local3.id == "hairdryer"){
splatted = true;
splattedObject = _local2;
splatSpeedY = Math.abs((splatSpeedY * (0.9 + (Math.random() * 0.3))));
spawnSplatters(5, "medium");
splat.y = (splat.y - 5);
hairdryerSound.play();
_local3.gotoAndPlay("b");
};
if (_local3.id == "bird"){
splatted = true;
splattedObject = _local2;
splatSpeedY = Math.abs((splatSpeedY * 0.9));
spawnSplatters(5, "medium");
splat.y = (splat.y - 5);
birdSound.play();
_local3.gotoAndPlay("b");
};
if (_local3.id == "cards"){
splatted = true;
splattedObject = _local2;
splatSpeedY = Math.abs((splatSpeedY * 0.9));
spawnSplatters(5, "medium");
splat.y = (splat.y - 5);
playSplat();
_local3.gotoAndPlay("b");
};
if (_local3.id == "toaster"){
splatted = true;
splattedObject = _local2;
splatSpeedY = (splatSpeedY * -0.9);
spawnSplatters(10, "medium");
splat.y = (splat.y - 5);
playSplat();
_local3.gotoAndPlay("b");
};
if (_local3.id == "bin"){
_local3.gotoAndPlay(2);
splatted = true;
splattedObject = _local2;
splatSpeedY = (splatSpeedY * -0.8);
spawnSplatters(3, "medium");
splat.y = (splat.y - 5);
playSplat();
splatSpeedX = (splatSpeedX * -1.2);
};
if (_local3.id == "hole"){
splat.visible = false;
splat.addEventListener(Event.ENTER_FRAME, checkPosition);
splatSpeedX = 20;
splatSpeedY = 0;
splat.y = (splat.y - 5);
plopSound.play();
};
if (_local3.id == "grater"){
splatted = true;
splattedObject = _local2;
splatSpeedY = (splatSpeedY * -0.9);
spawnSplatters(10, "small");
splat.y = (splat.y - 5);
playSplat();
_local3.gotoAndPlay("b");
};
if (_local3.id == "whisk"){
splatted = true;
splattedObject = _local2;
splatSpeedY = Math.abs((splatSpeedY * 1.4));
spawnSplatters(20, "small");
splat.y = (splat.y - 5);
whiskSound.play();
_local3.gotoAndPlay("b");
};
};
};
if ((((splatted == true)) && (!((_local2 == splattedObject))))){
_local4 = 1;
while (_local4 <= numberOfSplatters) {
if (((!((splatterArray[_local4] == undefined))) && (!((splatterArray[_local4] == 0))))){
if ((((((splatterArray[_local4].hitzone.hitTestObject(_local2) == true)) && ((splatterArray[_local4].dead == false)))) && ((_local3.id == "hole")))){
splatterArray[_local4].visible = false;
splatterArray[_local4].dead = true;
};
};
_local4++;
};
};
_local1++;
};
};
if ((((splat.y > (cannon.y + 90))) && ((splatDead == false)))){
splatDead = true;
splat.rotation = 0;
splat.gotoAndStop("d");
playSplat();
};
if (splatted == true){
_local5 = 1;
while (_local5 <= numberOfSplatters) {
if (((!((splatterArray[_local5] == undefined))) && (!((splatterArray[_local5] == 0))))){
if ((((splatterArray[_local5].y > ((cannon.y + 90) + (Math.random() * 20)))) && ((splatterArray[_local5].dead == false)))){
splatterArray[_local5].rotation = 0;
splatterArray[_local5].gotoAndStop("d");
splatterArray[_local5].dead = true;
playSplatQuiet();
setTimeout(removeSplatter, 1000, _local5);
};
};
_local5++;
};
};
};
}
public function removePreGameScreensAndIntialise(_arg1:TweenEvent):void{
menuTween.removeEventListener(TweenEvent.MOTION_FINISH, removePreGameScreensAndIntialise);
preGameScreens.menu.playButton.removeEventListener(MouseEvent.MOUSE_DOWN, showGame);
preGameScreens.menu.instructionsButton.removeEventListener(MouseEvent.MOUSE_DOWN, showInstructions);
preGameScreens.menu.highscoresButton.removeEventListener(MouseEvent.MOUSE_DOWN, showHighscores);
preGameScreens.instructions.playButton.removeEventListener(MouseEvent.MOUSE_DOWN, showGame);
preGameScreens.instructions.backButton.removeEventListener(MouseEvent.MOUSE_DOWN, tweenToMenu);
initialiseGame();
activateGame();
projectCanvas.removeChild(preGameScreens);
}
public function makeLaunchPad(_arg1:Number, _arg2:Number):void{
var _local3:launchPad_mc;
_local3 = new launchPad_mc();
cannonCanvas.addChild(_local3);
_local3.x = _arg1;
_local3.y = _arg2;
}
public function playSplatQuiet():void{
var _local1:uint;
_local1 = Math.ceil((Math.random() * 2));
if (_local1 == 1){
quietChannel = splatSound1.play();
quietChannel.soundTransform = quiet;
};
if (_local1 == 2){
quietChannel = splatSound2.play();
quietChannel.soundTransform = quiet;
};
}
public function fireSplat(_arg1:MouseEvent):void{
var _local2:uint;
if (gameRunning == true){
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, fireSplat);
stage.removeEventListener(Event.ENTER_FRAME, selectTrajectory);
splat = new splat_mc();
splatCanvas.addChild(splat);
splatSpeed = (power / 3);
splatSpeedY = (splatSpeed * Math.cos(((trajectory * Math.PI) / 180)));
splatSpeedX = (splatSpeed * Math.sin(((trajectory * Math.PI) / 180)));
splat.x = cannon.x;
splat.y = cannon.y;
splat.width = (splat.width * 0.5);
splat.height = (splat.height * 0.5);
_local2 = Math.ceil((Math.random() * 3));
if (_local2 == 1){
shootSound1.play();
};
if (_local2 == 2){
shootSound2.play();
};
if (_local2 == 3){
shootSound3.play();
};
allowRemoveSplats = true;
stage.addEventListener(Event.ENTER_FRAME, gameLoop);
};
}
public function activateGame():void{
stage.addEventListener(Event.ENTER_FRAME, selectPower);
projectCanvas.addEventListener(MouseEvent.MOUSE_DOWN, selectPowerComplete);
}
public function highScoresClosed(_arg1){
showMenu();
}
public function mouseIsUp(_arg1:MouseEvent):void{
projectCanvas.removeEventListener(MouseEvent.MOUSE_UP, mouseIsUp);
activateGame();
}
public function showSoundIcon():void{
soundToggle = new soundToggle_mc();
stage.addChild(soundToggle);
soundToggle.x = 543;
soundToggle.y = 10;
soundOn = true;
soundToggle.addEventListener(MouseEvent.MOUSE_UP, toggleSound);
}
public function gameLoop(_arg1:Event):void{
if (gameRunning == true){
displayFPS();
checkGameOver();
collisions();
moveSplat();
moveSplatters();
moveCamera();
updateTiles();
updateScore();
updateGUI();
};
}
public function updateGUI():void{
gui.scoreDisplay.text = ("distance: " + score);
gui.bestScoreDisplay.text = ("best: " + bestScore);
}
public function introComplete(_arg1:Event):void{
gotoAndPlay(2);
}
public function selectPowerComplete(_arg1:MouseEvent):void{
if (gameRunning == true){
stage.removeEventListener(Event.ENTER_FRAME, selectPower);
projectCanvas.removeEventListener(MouseEvent.MOUSE_DOWN, selectPowerComplete);
theta = -45;
cannon.arrow.alpha = 1;
stage.addEventListener(Event.ENTER_FRAME, selectTrajectory);
projectCanvas.addEventListener(MouseEvent.MOUSE_DOWN, fireSplat);
};
}
public function makeBird(_arg1:Number, _arg2:Number):void{
var _local3:bird_mc;
_local3 = new bird_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "bird";
_local3.splatted = false;
}
public function makeHole(_arg1:Number, _arg2:Number):void{
var _local3:hole_mc;
_local3 = new hole_mc();
_local3.x = _arg1;
_local3.y = _arg2;
objectCanvas.addChild(_local3);
_local3.id = "hole";
_local3.splatted = false;
}
public function setupCanvases():void{
gameCanvas = new Sprite();
projectCanvas.addChild(gameCanvas);
backgroundCanvas = new Sprite();
gameCanvas.addChild(backgroundCanvas);
tileArray[1] = new background1_mc();
backgroundCanvas.addChild(tileArray[1]);
tileArray[1].exists = true;
objectCanvas = new Sprite();
gameCanvas.addChild(objectCanvas);
splatCanvas = new Sprite();
gameCanvas.addChild(splatCanvas);
cannonCanvas = new Sprite();
gameCanvas.addChild(cannonCanvas);
}
public function replay(_arg1:MouseEvent):void{
var _local2:*;
gui.playAgainButton.removeEventListener(MouseEvent.MOUSE_DOWN, replay);
gui.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showSubmitHighscoreScreen);
exitGame();
initialiseGame();
projectCanvas.addEventListener(MouseEvent.MOUSE_UP, mouseIsUp);
_local2 = trackThis("http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/twisted_replays/142375@x01");
_local2.addEventListener(Event.COMPLETE, trackCompleteHandler);
}
public function selectTrajectory(_arg1:Event):void{
if (gameRunning == true){
displayFPS();
trajectory = (45 + (45 * Math.sin(((theta * Math.PI) / 180))));
theta = (theta + 8);
if (theta > 360){
theta = 0;
};
cannon.rotation = (trajectory - 60);
};
}
}
}//package twistedGame_fla
Section 22
//menu_mc_8 (twistedGame_fla.menu_mc_8)
package twistedGame_fla {
import flash.display.*;
public dynamic class menu_mc_8 extends MovieClip {
public var instructionsButton:SimpleButton;
public var highscoresButton:SimpleButton;
public var playButton:SimpleButton;
}
}//package twistedGame_fla
Section 23
//background1_mc (background1_mc)
package {
import flash.display.*;
public dynamic class background1_mc extends MovieClip {
}
}//package
Section 24
//background2_mc (background2_mc)
package {
import flash.display.*;
public dynamic class background2_mc extends MovieClip {
}
}//package
Section 25
//background3_mc (background3_mc)
package {
import flash.display.*;
public dynamic class background3_mc extends MovieClip {
}
}//package
Section 26
//background4_mc (background4_mc)
package {
import flash.display.*;
public dynamic class background4_mc extends MovieClip {
}
}//package
Section 27
//background5_mc (background5_mc)
package {
import flash.display.*;
public dynamic class background5_mc extends MovieClip {
}
}//package
Section 28
//bar_template (bar_template)
package {
import flash.display.*;
public dynamic class bar_template extends MovieClip {
}
}//package
Section 29
//bin_mc (bin_mc)
package {
import flash.display.*;
public dynamic class bin_mc extends MovieClip {
public var hitzone:MovieClip;
public function bin_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 30
//bin_template (bin_template)
package {
import flash.display.*;
public dynamic class bin_template extends MovieClip {
}
}//package
Section 31
//bird (bird)
package {
import flash.media.*;
public dynamic class bird extends Sound {
}
}//package
Section 32
//bird_mc (bird_mc)
package {
import flash.display.*;
public dynamic class bird_mc extends MovieClip {
public var hitzone:MovieClip;
public function bird_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 33
//bird_template (bird_template)
package {
import flash.display.*;
public dynamic class bird_template extends MovieClip {
}
}//package
Section 34
//blackScreen_mc (blackScreen_mc)
package {
import flash.display.*;
public dynamic class blackScreen_mc extends MovieClip {
}
}//package
Section 35
//boing (boing)
package {
import flash.media.*;
public dynamic class boing extends Sound {
}
}//package
Section 36
//cannon_mc (cannon_mc)
package {
import flash.display.*;
public dynamic class cannon_mc extends MovieClip {
public var arrow:MovieClip;
}
}//package
Section 37
//cannon_template (cannon_template)
package {
import flash.display.*;
public dynamic class cannon_template extends MovieClip {
}
}//package
Section 38
//cards_mc (cards_mc)
package {
import flash.display.*;
public dynamic class cards_mc extends MovieClip {
public var hitzone:MovieClip;
public function cards_mc(){
addFrameScript(0, frame1, 15, frame16);
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 39
//cards_template (cards_template)
package {
import flash.display.*;
public dynamic class cards_template extends MovieClip {
}
}//package
Section 40
//castle_mc (castle_mc)
package {
import flash.display.*;
public dynamic class castle_mc extends MovieClip {
public var hitzone:MovieClip;
public function castle_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 41
//castle_template (castle_template)
package {
import flash.display.*;
public dynamic class castle_template extends MovieClip {
}
}//package
Section 42
//Debug (Debug)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Debug extends MovieClip {
public var text_txt:TextField;
}
}//package
Section 43
//debug_mc (debug_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class debug_mc extends MovieClip {
public var txt:TextField;
}
}//package
Section 44
//exit_bt (exit_bt)
package {
import flash.display.*;
public dynamic class exit_bt extends SimpleButton {
}
}//package
Section 45
//fire (fire)
package {
import flash.media.*;
public dynamic class fire extends Sound {
}
}//package
Section 46
//GooGameOver (GooGameOver)
package {
import flash.media.*;
public dynamic class GooGameOver extends Sound {
}
}//package
Section 47
//GooLaughter (GooLaughter)
package {
import flash.media.*;
public dynamic class GooLaughter extends Sound {
}
}//package
Section 48
//GooShoot01 (GooShoot01)
package {
import flash.media.*;
public dynamic class GooShoot01 extends Sound {
}
}//package
Section 49
//GooShoot02 (GooShoot02)
package {
import flash.media.*;
public dynamic class GooShoot02 extends Sound {
}
}//package
Section 50
//GooShoot03 (GooShoot03)
package {
import flash.media.*;
public dynamic class GooShoot03 extends Sound {
}
}//package
Section 51
//grater_mc (grater_mc)
package {
import flash.display.*;
public dynamic class grater_mc extends MovieClip {
public var hitzone:MovieClip;
public function grater_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 52
//grater_template (grater_template)
package {
import flash.display.*;
public dynamic class grater_template extends MovieClip {
}
}//package
Section 53
//gui_mc (gui_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gui_mc extends MovieClip {
public var submitButton:SimpleButton;
public var screenBlackout:MovieClip;
public var loading_mc:MovieClip;
public var finalScoreLabel:MovieClip;
public var msg_txt:TextField;
public var scoreDisplay:TextField;
public var bestScoreDisplay:TextField;
public var playAgainButton:SimpleButton;
public var finalScore:TextField;
public var exitButton:exit_bt;
}
}//package
Section 54
//Hairdryer (Hairdryer)
package {
import flash.media.*;
public dynamic class Hairdryer extends Sound {
}
}//package
Section 55
//hairdryer_mc (hairdryer_mc)
package {
import flash.display.*;
public dynamic class hairdryer_mc extends MovieClip {
public var hitzone:MovieClip;
public function hairdryer_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 56
//hairdryer_template (hairdryer_template)
package {
import flash.display.*;
public dynamic class hairdryer_template extends MovieClip {
}
}//package
Section 57
//hole_mc (hole_mc)
package {
import flash.display.*;
public dynamic class hole_mc extends MovieClip {
public var hitzone:MovieClip;
}
}//package
Section 58
//hole_template (hole_template)
package {
import flash.display.*;
public dynamic class hole_template extends MovieClip {
}
}//package
Section 59
//hydrant_mc (hydrant_mc)
package {
import flash.display.*;
public dynamic class hydrant_mc extends MovieClip {
public var hitzone:MovieClip;
public function hydrant_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 60
//hydrant_template (hydrant_template)
package {
import flash.display.*;
public dynamic class hydrant_template extends MovieClip {
}
}//package
Section 61
//InternalAnimation (InternalAnimation)
package {
import flash.display.*;
import flash.text.*;
public dynamic class InternalAnimation extends MovieClip {
public var mcProgress:MovieClip;
public var mcTimer:MovieClip;
public var textStatus:TextField;
public var mcOffsite:SimpleButton;
}
}//package
Section 62
//launchPad_mc (launchPad_mc)
package {
import flash.display.*;
public dynamic class launchPad_mc extends MovieClip {
}
}//package
Section 63
//launchPad_template (launchPad_template)
package {
import flash.display.*;
public dynamic class launchPad_template extends MovieClip {
}
}//package
Section 64
//levelSection1_mc (levelSection1_mc)
package {
import flash.display.*;
public dynamic class levelSection1_mc extends MovieClip {
}
}//package
Section 65
//levelSection2_mc (levelSection2_mc)
package {
import flash.display.*;
public dynamic class levelSection2_mc extends MovieClip {
}
}//package
Section 66
//levelSection3_mc (levelSection3_mc)
package {
import flash.display.*;
public dynamic class levelSection3_mc extends MovieClip {
}
}//package
Section 67
//levelSection4_mc (levelSection4_mc)
package {
import flash.display.*;
public dynamic class levelSection4_mc extends MovieClip {
}
}//package
Section 68
//levelSection5_mc (levelSection5_mc)
package {
import flash.display.*;
public dynamic class levelSection5_mc extends MovieClip {
}
}//package
Section 69
//levelSection6_mc (levelSection6_mc)
package {
import flash.display.*;
public dynamic class levelSection6_mc extends MovieClip {
}
}//package
Section 70
//plop (plop)
package {
import flash.media.*;
public dynamic class plop extends Sound {
}
}//package
Section 71
//powerArc_mc (powerArc_mc)
package {
import flash.display.*;
public dynamic class powerArc_mc extends MovieClip {
}
}//package
Section 72
//powerMeter_mc (powerMeter_mc)
package {
import flash.display.*;
public dynamic class powerMeter_mc extends MovieClip {
public var powerMask:MovieClip;
}
}//package
Section 73
//preGameScreens_mc (preGameScreens_mc)
package {
import flash.display.*;
public dynamic class preGameScreens_mc extends MovieClip {
public var highscores:MovieClip;
public var menu:MovieClip;
public var instructions:MovieClip;
public var background1:background1_mc;
}
}//package
Section 74
//preloader_mc (preloader_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_mc extends MovieClip {
public var loadingBar:MovieClip;
public var loadingText:TextField;
}
}//package
Section 75
//soundToggle_mc (soundToggle_mc)
package {
import flash.display.*;
public dynamic class soundToggle_mc extends MovieClip {
public function soundToggle_mc(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 76
//Soundtrack (Soundtrack)
package {
import flash.media.*;
public dynamic class Soundtrack extends Sound {
}
}//package
Section 77
//splat_mc (splat_mc)
package {
import flash.display.*;
public dynamic class splat_mc extends MovieClip {
public var hitzone:MovieClip;
public function splat_mc(){
addFrameScript(11, frame12);
}
function frame12(){
gotoAndPlay("a");
}
}
}//package
Section 78
//Splat01 (Splat01)
package {
import flash.media.*;
public dynamic class Splat01 extends Sound {
}
}//package
Section 79
//Splat02 (Splat02)
package {
import flash.media.*;
public dynamic class Splat02 extends Sound {
}
}//package
Section 80
//squelch (squelch)
package {
import flash.media.*;
public dynamic class squelch extends Sound {
}
}//package
Section 81
//submitHighscoreScreen_mc (submitHighscoreScreen_mc)
package {
import flash.display.*;
public dynamic class submitHighscoreScreen_mc extends MovieClip {
public var continueButton:SimpleButton;
}
}//package
Section 82
//Thunder (Thunder)
package {
import flash.media.*;
public dynamic class Thunder extends Sound {
}
}//package
Section 83
//toaster_mc (toaster_mc)
package {
import flash.display.*;
public dynamic class toaster_mc extends MovieClip {
public var hitzone:MovieClip;
public function toaster_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 84
//toaster_template (toaster_template)
package {
import flash.display.*;
public dynamic class toaster_template extends MovieClip {
}
}//package
Section 85
//twistedBar_mc (twistedBar_mc)
package {
import flash.display.*;
public dynamic class twistedBar_mc extends MovieClip {
}
}//package
Section 86
//Twister (Twister)
package {
import flash.media.*;
public dynamic class Twister extends Sound {
}
}//package
Section 87
//wall_mc (wall_mc)
package {
import flash.display.*;
public dynamic class wall_mc extends MovieClip {
public var hitzone:MovieClip;
}
}//package
Section 88
//wall_template (wall_template)
package {
import flash.display.*;
public dynamic class wall_template extends MovieClip {
}
}//package
Section 89
//whisk (whisk)
package {
import flash.media.*;
public dynamic class whisk extends Sound {
}
}//package
Section 90
//whisk_mc (whisk_mc)
package {
import flash.display.*;
public dynamic class whisk_mc extends MovieClip {
public var hitzone:MovieClip;
public function whisk_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 91
//whisk_template (whisk_template)
package {
import flash.display.*;
public dynamic class whisk_template extends MovieClip {
}
}//package