Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 2
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 3
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 4
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 5
//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 6
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import flash.utils.*;
import fl.events.*;
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 7
//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 8
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.display.*;
import flash.events.*;
import fl.controls.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 9
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
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 10
//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 11
//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 12
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 13
//Bounce (fl.transitions.easing.Bounce)
package fl.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.transitions.easing
Section 14
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public class TweenLite {
public var delay:Number;
private var _endTarget:Object;
private var _sound:SoundTransform;
public var target:Object;
public var onStart:Function;
public var duration:Number;
public var startTime:uint;
public var onCompleteParams:Array;
public var extraTweens:Object;
private var _color:ColorTransform;
private var _active:Boolean;
private var _endColor:ColorTransform;
public var onStartParams:Array;
public var vars:Object;
public var tweens:Object;
public var onComplete:Function;
public var initTime:uint;
private static var _sprite:Sprite = new Sprite();
private static var _timer:Timer = new Timer(2000);
private static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = killTweensOf;
public static var version:Number = 5.1;
private static var _listening:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null, _arg7:Boolean=true){
var _local8:Boolean;
super();
if (_arg1 == null){
return;
};
if (((((((!((_arg3.overwrite == false))) && (!((_arg7 == false))))) && (!((_arg1 == null))))) || ((_all[_arg1] == undefined)))){
delete _all[_arg1];
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
this.vars = _arg3;
this.duration = _arg2;
this.delay = ((((_arg3.delay) || (_arg4))) || (0));
if (_arg2 == 0){
this.duration = 0.001;
if (this.delay == 0){
this.vars.runBackwards = true;
};
};
this.target = (_endTarget = _arg1);
this.onComplete = ((_arg3.onComplete) || (_arg5));
this.onCompleteParams = ((((_arg3.onCompleteParams) || (_arg6))) || ([]));
this.onStart = _arg3.onStart;
this.onStartParams = ((_arg3.onStartParams) || ([]));
if (this.vars.ease == undefined){
this.vars.ease = easeOut;
} else {
if (!(this.vars.ease is Function)){
trace((("ERROR: You cannot use '" + this.vars.ease) + "' for the TweenLite ease property. Only functions are accepted."));
};
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
} else {
if (!isNaN(Number(this.vars._autoAlpha))){
this.vars.alpha = (this.vars.autoAlpha = Number(this.vars._autoAlpha));
};
};
this.tweens = {};
this.extraTweens = {};
this.initTime = getTimer();
if (this.vars.runBackwards == true){
initTweenVals();
};
_active = false;
_local8 = this.active;
if ((((_arg2 == 0)) && ((this.delay == 0)))){
if (this.vars.autoAlpha == 0){
this.target.visible = false;
};
if (this.onComplete != null){
this.onComplete.apply(null, this.onCompleteParams);
};
removeTween(this);
} else {
if (!_listening){
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
};
}
public function set volumeProxy(_arg1:Number):void{
_sound.volume = _arg1;
this.target.soundTransform = _sound;
}
public function set endTarget(_arg1:Object):void{
delete _all[_endTarget][this];
_endTarget = _arg1;
if (_all[_arg1] == undefined){
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
}
public function get colorProxy():Number{
return (0);
}
public function get endTarget():Object{
return (_endTarget);
}
public function initTweenVals():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local7:TweenLite;
var _local8:Object;
_local1 = (this.delay - ((getTimer() - this.initTime) / 1000));
if ((this.target is Array)){
_local4 = [];
for (_local2 in this.vars) {
if ((this.vars[_local2] is Array)){
_local4 = this.vars[_local2];
break;
};
};
_local5 = 0;
while (_local5 < _local4.length) {
if (((!((this.target[_local5] == _local4[_local5]))) && (!((this.target[_local5] == undefined))))){
this.tweens[_local5.toString()] = {o:this.target, s:this.target[_local5], c:(_local4[_local5] - this.target[_local5]), e:this.vars.ease};
};
_local5++;
};
} else {
for (_local2 in this.vars) {
if ((((_local2 == "volume")) && ((this.target is MovieClip)))){
_sound = this.target.soundTransform;
_local6 = new TweenLite(this, this.duration, {volumeProxy:this.vars[_local2], ease:easeOut, delay:_local1, overwrite:false, runBackwards:this.vars.runBackwards});
_local6.endTarget = this.target;
} else {
if ((((_local2.toLowerCase() == "mccolor")) && ((this.target is DisplayObject)))){
_color = this.target.transform.colorTransform;
_endColor = new ColorTransform();
_endColor.alphaMultiplier = ((this.vars.alpha) || (this.target.alpha));
if (((!((this.vars[_local2] == null))) && (!((this.vars[_local2] == ""))))){
_endColor.color = this.vars[_local2];
};
_local7 = new TweenLite(this, this.duration, {colorProxy:1, delay:_local1, overwrite:false, runBackwards:this.vars.runBackwards});
_local7.endTarget = this.target;
} else {
if ((((((((((((((((((((_local2 == "delay")) || ((_local2 == "ease")))) || ((_local2 == "overwrite")))) || ((_local2 == "onComplete")))) || ((_local2 == "onCompleteParams")))) || ((_local2 == "runBackwards")))) || ((_local2 == "autoAlpha")))) || ((_local2 == "_autoAlpha")))) || ((_local2 == "onStart")))) || ((_local2 == "onStartParams")))){
} else {
if (this.target.hasOwnProperty(_local2)){
if (typeof(this.vars[_local2]) == "number"){
_local3 = (this.vars[_local2] - this.target[_local2]);
} else {
_local3 = Number(this.vars[_local2]);
};
this.tweens[_local2] = {o:this.target, s:this.target[_local2], c:_local3, e:this.vars.ease};
} else {
this.extraTweens[_local2] = {o:this.target, s:0, c:0, e:this.vars.ease, v:this.vars[_local2]};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
for (_local2 in this.tweens) {
_local8 = this.tweens[_local2];
this.tweens[_local2].s = (_local8.s + _local8.c);
_local8.c = (_local8.c * -1);
if (_local8.c != 0){
_local8.o[_local2] = _local8.e(0, _local8.s, _local8.c, this.duration);
};
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
}
public function render():void{
var _local1:Number;
var _local2:Object;
var _local3:String;
_local1 = ((getTimer() - this.startTime) / 1000);
if (_local1 > this.duration){
_local1 = this.duration;
};
for (_local3 in this.tweens) {
_local2 = this.tweens[_local3];
_local2.o[_local3] = _local2.e(_local1, _local2.s, _local2.c, this.duration);
};
if (_local1 == this.duration){
if ((((typeof(this.vars.autoAlpha) == "number")) && ((this.target.alpha == 0)))){
this.target.visible = false;
};
if (this.onComplete != null){
this.onComplete.apply(null, this.onCompleteParams);
};
removeTween(this);
};
}
public function set colorProxy(_arg1:Number):void{
var _local2:Number;
_local2 = (1 - _arg1);
this.target.transform.colorTransform = new ColorTransform(((_color.redMultiplier * _local2) + (_endColor.redMultiplier * _arg1)), ((_color.greenMultiplier * _local2) + (_endColor.greenMultiplier * _arg1)), ((_color.blueMultiplier * _local2) + (_endColor.blueMultiplier * _arg1)), ((_color.alphaMultiplier * _local2) + (_endColor.alphaMultiplier * _arg1)), ((_color.redOffset * _local2) + (_endColor.redOffset * _arg1)), ((_color.greenOffset * _local2) + (_endColor.greenOffset * _arg1)), ((_color.blueOffset * _local2) + (_endColor.blueOffset * _arg1)), ((_color.alphaOffset * _local2) + (_endColor.alphaOffset * _arg1)));
}
public function get volumeProxy():Number{
return (_sound.volume);
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((getTimer() - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (this.vars.runBackwards != true){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.onStart != null){
this.onStart.apply(null, this.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:false}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null, _arg7:Boolean=true):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.endTarget] == null))))){
delete _all[_arg1.endTarget][_arg1];
};
}
private static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local2:Object;
var _local3:int;
var _local4:Boolean;
var _local5:Object;
var _local6:Object;
var _local7:Object;
_local2 = _all;
_local3 = 0;
for (_local5 in _local2) {
_local4 = false;
for (_local6 in _local2[_local5]) {
_local4 = true;
break;
};
if (!_local4){
delete _local2[_local5];
} else {
_local3++;
};
};
if (_local3 == 0){
_sprite.removeEventListener(Event.ENTER_FRAME, executeAll);
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function executeAll(_arg1:Event):void{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
_local2 = _all;
for (_local3 in _local2) {
for (_local4 in _local2[_local3]) {
_local5 = _local2[_local3][_local4];
if (_local5.active){
_local5.render();
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null, _arg7:Boolean=true):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function killTweensOf(_arg1:Object=null):void{
if (_arg1 != null){
delete _all[_arg1];
};
}
}
}//package gs
Section 15
//boardelements_3 (Pinball4_UGO_fla.boardelements_3)
package Pinball4_UGO_fla {
import flash.display.*;
public dynamic class boardelements_3 extends MovieClip {
public var wall54:MovieClip;
public var bumpL:MovieClip;
public var wall60:MovieClip;
public var wall62:MovieClip;
public var wall64:MovieClip;
public var wall65:MovieClip;
public var wall61:MovieClip;
public var wall63:MovieClip;
public var wall43:MovieClip;
public var wall37:MovieClip;
public var lite14:MovieClip;
public var lite23:MovieClip;
public var wall44:MovieClip;
public var wall0:MovieClip;
public var wall45:MovieClip;
public var _padL2:MovieClip;
public var flipBR1:MovieClip;
public var wall10:MovieClip;
public var flipBR2:MovieClip;
public var springHold:MovieClip;
public var hole:MovieClip;
public var holehit:MovieClip;
public var baby:MovieClip;
public var _padL:MovieClip;
public var _padR:MovieClip;
public var targ0:MovieClip;
public var targ5:MovieClip;
public var targ2:MovieClip;
public var targ4:MovieClip;
public var targ1:MovieClip;
public var targ3:MovieClip;
public var _padR2:MovieClip;
public var disc1:MovieClip;
public var disc2:MovieClip;
public var lite0:MovieClip;
public var lite1:MovieClip;
public var lite2:MovieClip;
public var lite3:MovieClip;
public var lite6:MovieClip;
public var lite4:MovieClip;
public var lite15:MovieClip;
public var lite16:MovieClip;
public var lite17:MovieClip;
public var lite19:MovieClip;
public var low1:MovieClip;
public var low3:MovieClip;
public var lite8:MovieClip;
public var low0:MovieClip;
public var lite18:MovieClip;
public var low2:MovieClip;
public var wall11:MovieClip;
public var wall12:MovieClip;
public var wall14:MovieClip;
public var wall15:MovieClip;
public var wall16:MovieClip;
public var wall18:MovieClip;
public var wall19:MovieClip;
public var wall13:MovieClip;
public var lite22:MovieClip;
public var wall17:MovieClip;
public var lite10:MovieClip;
public var lite20:MovieClip;
public var lite21:MovieClip;
public var lite13:MovieClip;
public var disc0:MovieClip;
public var lite7:MovieClip;
public var lite9:MovieClip;
public var wall21:MovieClip;
public var wall22:MovieClip;
public var wall23:MovieClip;
public var wall26:MovieClip;
public var wall20:MovieClip;
public var wall28:MovieClip;
public var wall29:MovieClip;
public var dt0:MovieClip;
public var flipBL1:MovieClip;
public var flipBL2:MovieClip;
public var wall24:MovieClip;
public var wall1:MovieClip;
public var wall2:MovieClip;
public var wall3:MovieClip;
public var wall4:MovieClip;
public var wall6:MovieClip;
public var wall7:MovieClip;
public var wall31:MovieClip;
public var wall32:MovieClip;
public var wall33:MovieClip;
public var wall5:MovieClip;
public var wall35:MovieClip;
public var wall36:MovieClip;
public var door:MovieClip;
public var wall30:MovieClip;
public var wall39:MovieClip;
public var dt1:MovieClip;
public var dt3:MovieClip;
public var wall8:MovieClip;
public var wall9:MovieClip;
public var lite12:MovieClip;
public var wall34:MovieClip;
public var wall27:MovieClip;
public var xlite0:MovieClip;
public var wall46:MovieClip;
public var wall47:MovieClip;
public var wall48:MovieClip;
public var wall49:MovieClip;
public var wall38:MovieClip;
public var xlite1:MovieClip;
public var bumpB:MovieClip;
public var wall40:MovieClip;
public var wall42:MovieClip;
public var xlite2:MovieClip;
public var bumpR:MovieClip;
public var lite5:MovieClip;
public var bumpT:MovieClip;
public var wall25:MovieClip;
public var lite11:MovieClip;
public var wall50:MovieClip;
public var wall51:MovieClip;
public var dt2:MovieClip;
public var wall41:MovieClip;
public var wall56:MovieClip;
public var wall57:MovieClip;
public var wall58:MovieClip;
public var wall59:MovieClip;
public var wall55:MovieClip;
public var wall53:MovieClip;
public var dt4:MovieClip;
public var dt5:MovieClip;
public var wall52:MovieClip;
}
}//package Pinball4_UGO_fla
Section 16
//Copy1_37 (Pinball4_UGO_fla.Copy1_37)
package Pinball4_UGO_fla {
import flash.display.*;
public dynamic class Copy1_37 extends MovieClip {
public var tourdates:SimpleButton;
public var fanclub:SimpleButton;
public var prod:SimpleButton;
public var site:SimpleButton;
public var startb:SimpleButton;
public var getItunes2:SimpleButton;
public var getCD1:SimpleButton;
public var getCD2:SimpleButton;
public var store:SimpleButton;
}
}//package Pinball4_UGO_fla
Section 17
//Copy2_26 (Pinball4_UGO_fla.Copy2_26)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Copy2_26 extends MovieClip {
public function Copy2_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 18
//Copy36_51 (Pinball4_UGO_fla.Copy36_51)
package Pinball4_UGO_fla {
import flash.display.*;
public dynamic class Copy36_51 extends MovieClip {
public var next:MovieClip;
public var discount:SimpleButton;
public var prod:SimpleButton;
public var hs2:MovieClip;
public var hs5:MovieClip;
public var hs4:MovieClip;
public var hs9:MovieClip;
public var hs3:MovieClip;
public var hs6:MovieClip;
public var hs0:MovieClip;
public var hs1:MovieClip;
public var playagain:MovieClip;
public var hs8:MovieClip;
public var hs7:MovieClip;
public var initials:MovieClip;
}
}//package Pinball4_UGO_fla
Section 19
//Copy4_23 (Pinball4_UGO_fla.Copy4_23)
package Pinball4_UGO_fla {
import flash.display.*;
public dynamic class Copy4_23 extends MovieClip {
public var spring:MovieClip;
}
}//package Pinball4_UGO_fla
Section 20
//Copy5_25 (Pinball4_UGO_fla.Copy5_25)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Copy5_25 extends MovieClip {
public function Copy5_25(){
addFrameScript(0, frame1, 34, frame35);
}
function frame1(){
stop();
}
function frame35(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 21
//Copy5_46 (Pinball4_UGO_fla.Copy5_46)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Copy5_46 extends MovieClip {
public var dig5:MovieClip;
public var dig6:MovieClip;
public var box0:TextField;
public var box4:TextField;
public var box5:TextField;
public var box1:TextField;
public var box2:TextField;
public var box3:TextField;
public var box6:TextField;
public var dig0:MovieClip;
public var dig1:MovieClip;
public var dig3:MovieClip;
public var dig4:MovieClip;
public var dig2:MovieClip;
}
}//package Pinball4_UGO_fla
Section 22
//drop_target_left_31 (Pinball4_UGO_fla.drop_target_left_31)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class drop_target_left_31 extends MovieClip {
public function drop_target_left_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 23
//drop_target_right_32 (Pinball4_UGO_fla.drop_target_right_32)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class drop_target_right_32 extends MovieClip {
public function drop_target_right_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 24
//enterinitials_54 (Pinball4_UGO_fla.enterinitials_54)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.text.*;
public dynamic class enterinitials_54 extends MovieClip {
public var let0:TextField;
public var let1:TextField;
public var let2:TextField;
}
}//package Pinball4_UGO_fla
Section 25
//green_22 (Pinball4_UGO_fla.green_22)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class green_22 extends MovieClip {
public var label:TextField;
public function green_22(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 26
//highscoreentry_52 (Pinball4_UGO_fla.highscoreentry_52)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.text.*;
public dynamic class highscoreentry_52 extends MovieClip {
public var num:TextField;
public var score:TextField;
public var initials:TextField;
}
}//package Pinball4_UGO_fla
Section 27
//MainTimeline (Pinball4_UGO_fla.MainTimeline)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import fl.transitions.easing.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class MainTimeline extends MovieClip {
public var diff:Number;
public var hiScore:MovieClip;
public var ugo:MovieClip;
public var highscores:HighScores;
public var bg:MovieClip;
public var introTimer:Timer;
public var gravity:Number;
public var balls:Array;
public var ballIsHeld:Boolean;
public var allLites:Array;
public var numBalls:uint;
public var pball:MovieClip;
public var intro:MovieClip;
public var allDiscs:Array;
public var xdiff:Number;
public var bounce:Number;
public var hscores:MovieClip;
public var gameTimer:Timer;
public var score:Score;
public var flipLV:Number;
public var _ap:AlbumPlayer;
public var songPath:String;
public var player:AlbumPlayer;
public var board:MovieClip;
public var basePHP:String;
public var gs:GameSound;
public var dataPath:String;
public var lines:Array;
public var numLines:Number;
public var oldX:Number;
public var lives:int;
public var paramObj:Object;
public var numXlites:Number;
public var oldY:Number;
public var dTargs:Array;
public var keyStr:String;
public var numTargs:Number;
public var flipRV:Number;
public var springClick:Boolean;
public var userScore:MovieClip;
public var numDiscs:int;
public var babyMode:Boolean;
public var ballIsDead:Boolean;
public var numLites:Number;
public var high:Score;
public var currentLite:Number;
public var daBalls:TextField;
public var flipLInMotion:Boolean;
public var flipRInMotion:Boolean;
public var xLites:Array;
public var mouseIsDown:Boolean;
public var bumps:Array;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function doLeftPad(_arg1:Boolean=true):void{
if (_arg1){
if (flipL.rotation > -35){
gs.buzz("flip");
flipLInMotion = true;
TweenLite.to(flipL, 0.07, {x:270, rotation:-35, onComplete:resetPadL, onCompleteParams:[]});
TweenLite.to(flipL2, 0.07, {x:24, rotation:-35});
TweenLite.to(_fbl1, 0.07, {rotation:-35});
TweenLite.to(_fbl2, 0.07, {rotation:-35});
flipLV = 3;
TweenLite.to(this, 0.07, {flipLV:1});
} else {
flipLInMotion = false;
};
} else {
flipLInMotion = false;
TweenLite.to(flipL, 0.07, {x:293, rotation:35});
TweenLite.to(flipL2, 0.07, {x:52, rotation:35});
TweenLite.to(_fbl1, 0.07, {rotation:35});
TweenLite.to(_fbl2, 0.07, {rotation:35});
};
}
public function gotoLink(_arg1:String):void{
navigateToURL(new URLRequest(_arg1), "_blank");
}
public function resetPadL():void{
flipLInMotion = false;
}
public function outro(_arg1:TimerEvent):void{
trace(" outro");
TweenLite.to(_ugo, 0.5, {autoAlpha:0, onComplete:init, onCompleteParams:[]});
}
public function springShoot():void{
var _local1:Number;
var _local2:Number;
springClick = false;
if (ballIsDead){
_local1 = ((1 - _spring.scaleY) / 0.3);
_local2 = -(((_local1 * 45) + (Math.random() * 10)));
balls[0].vy = _local2;
trace(_local2);
if (_local2 < -29){
ballIsDead = false;
TweenLite.to(_door, 0.5, {x:901, y:348, rotation:-66, delay:1, ease:Bounce.easeOut, onComplete:wallOut, onCompleteParams:[]});
} else {
ballIsDead = true;
};
};
TweenLite.to(_spring, 0.1, {scaleY:1});
}
public function fileLoading(_arg1:Event):void{
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
removeEventListener(Event.ENTER_FRAME, fileLoading);
gotoAndStop(2);
} else {
_pball.play();
_bg.play();
};
}
public function resetPadR():void{
flipRInMotion = false;
}
public function gotoHighScores():void{
if (score.scr >= 25000){
_discount.visible = true;
} else {
_discount.visible = false;
};
gameTimer.stop();
_hScores.alpha = 0;
_initials.visible = highscores.compareScore();
_next.visible = false;
if (_initials.visible){
highscores.enableInitials(_initials);
} else {
_playAgain.visible = true;
};
TweenLite.to(_hScores, 1, {autoAlpha:1});
}
public function updateLites():void{
allLites[currentLite].gotoAndPlay(2);
if (currentLite < (numLites - 1)){
currentLite++;
};
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
_local2 = uint(_arg1.keyCode);
switch (_local2){
case 37:
doLeftPad();
break;
case 39:
doRightPad();
break;
case 68:
break;
case 40:
springBack();
break;
};
}
function frame2(){
numBalls = 1;
gravity = 0.3;
bounce = -0.25;
mouseIsDown = false;
lines = new Array();
numLines = 66;
flipLInMotion = false;
flipRInMotion = false;
diff = 0;
numDiscs = 3;
allDiscs = new Array();
springClick = false;
ballIsDead = true;
babyMode = false;
ballIsHeld = false;
_board = board;
_board.visible = false;
_ugo = ugo;
_ugo.visible = false;
_uScore = userScore;
_hiScore = hiScore;
_uScore.visible = false;
_hiScore.visible = false;
_ap = player;
_ap.visible = false;
_ugo.gotoAndPlay(1);
_ugo.visible = true;
_tag = _ugo.tag;
_tag.addEventListener(MouseEvent.MOUSE_DOWN, ugoplayer);
introTimer = new Timer(3000, 1);
introTimer.addEventListener(TimerEvent.TIMER, outro);
introTimer.start();
}
function frame1(){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.BEST;
stop();
this.scrollRect = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
addEventListener(Event.ENTER_FRAME, fileLoading);
nielsen("game_intro");
paramObj = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
if (keyStr == "php_path"){
basePHP = String(paramObj[keyStr]);
};
if (keyStr == "song_path"){
songPath = String(paramObj[keyStr]);
};
};
if (!basePHP){
basePHP = "http://thespillcanvas.com/pinball/scores_ugo/";
};
if (!songPath){
songPath = "http://download.wbr.com/thespillcanvas/audio/alloveryou.swf";
};
}
public function doRightPad(_arg1:Boolean=true):void{
if (_arg1){
if (flipR.rotation < 35){
gs.buzz("flip");
flipRInMotion = true;
TweenLite.to(flipR, 0.07, {x:645, rotation:35, onComplete:resetPadR, onCompleteParams:[]});
TweenLite.to(flipR2, 0.07, {x:887, rotation:35});
TweenLite.to(_fbr1, 0.07, {rotation:35});
TweenLite.to(_fbr2, 0.07, {rotation:35});
flipRV = 3;
TweenLite.to(this, 0.07, {flipRV:1});
} else {
flipRInMotion = false;
};
} else {
flipRInMotion = false;
TweenLite.to(flipR, 0.07, {x:612, rotation:-35});
TweenLite.to(flipR2, 0.07, {x:860, rotation:-55});
TweenLite.to(_fbr1, 0.07, {rotation:-35});
TweenLite.to(_fbr2, 0.07, {rotation:-55});
};
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
_local2 = uint(_arg1.keyCode);
switch (_local2){
case 37:
doLeftPad(false);
break;
case 39:
doRightPad(false);
break;
case 40:
springShoot();
break;
};
}
public function springBack():void{
if (!springClick){
trace("do SPRING back");
springClick = true;
TweenLite.to(_spring, 1, {scaleY:0.7});
};
}
public function resetHold():void{
var _local1:Ball;
_local1 = Ball(balls[0]);
_local1.vx = ((Math.random() * 10) - 5);
_local1.vy = ((Math.random() * 10) - 5);
_hole.gotoAndPlay("close");
_baby.gotoAndStop(1);
babyMode = false;
ballIsHeld = false;
}
public function spitOutBall(_arg1:TimerEvent):void{
var _local2:int;
var _local3:Ball;
_local2 = int(Timer(_arg1.currentTarget).currentCount);
trace((" spitOutBall : " + currentLite));
if (_local2 == currentLite){
trace(" >>> DONE ");
removeLites();
_local3 = Ball(balls[0]);
TweenLite.to(_local3, 0.3, {scaleX:1, scaleY:1, ease:Bounce.easeOut});
_local3.vx = ((Math.random() * 10) - 5);
_local3.vy = ((Math.random() * 10) - 5);
_hole.gotoAndPlay("close");
_baby.gotoAndStop(1);
babyMode = false;
ballIsHeld = false;
} else {
trace(" >>> SCORE ");
if ((currentLite - _local2) == 0){
score.add(100);
} else {
score.add(allLites[(currentLite - _local2)].num);
allLites[(currentLite - _local2)].gotoAndStop(1);
};
high.checkHi(score.scr);
gs.buzz("bumper");
};
}
public function startNewGame(_arg1:MouseEvent):void{
trace(" PLAY AGAIN: ");
score.reset();
TweenLite.to(_hScores, 0.4, {autoAlpha:0});
_playAgain.visible = false;
_baby.gotoAndStop(1);
startGame(null);
}
public function init():void{
var _local1:uint;
var _local2:Number;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:Bumper;
var _local7:Bumper;
var _local8:Bumper;
var _local9:Bumper;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:Ball;
var _local15:MovieClip;
var _local16:MovieClip;
var _local17:MovieClip;
var _local18:MovieClip;
Security.allowDomain("*");
_board.visible = true;
TweenLite.to(_board, 0.4, {autoAlpha:1});
_uScore.visible = true;
_hiScore.visible = true;
score = new Score(_uScore);
high = new Score(_hiScore);
gs = new GameSound();
_ap.initPlayer(songPath);
_ap.visible = true;
dataPath = (basePHP + "scores.php");
highscores = new HighScores(dataPath, this);
_hScores = hscores;
_hScores.visible = false;
_hScores.alpha = 0;
_initials = _hScores.initials;
_next = _hScores.next;
_next.addEventListener(MouseEvent.CLICK, fromNext);
_next.buttonMode = true;
_next.visible = false;
_playAgain = _hScores.playagain;
_playAgain.addEventListener(MouseEvent.CLICK, startNewGame);
_playAgain.visible = false;
_playAgain.buttonMode = true;
_discount = _hScores.discount;
_discount.addEventListener(MouseEvent.CLICK, linkOUT);
_baby = _board.baby;
_hole = _board.hole;
_holehit = _board.holehit;
_holehit.visible = false;
_balls = daBalls;
_springH = _board.springHold;
_spring = _springH.spring;
_door = _board.door;
lines = new Array();
_local1 = 0;
while (_local1 < numLines) {
lines.push(board[("wall" + String(_local1))]);
_board[("wall" + String(_local1))].visible = false;
trace(board[("wall" + String(_local1))].name);
_local1++;
};
lines.push(_door);
numLines++;
balls = new Array();
_local2 = 25;
_local3 = 0;
while (_local3 < numBalls) {
_local14 = new Ball(_local2);
_local14.mass = _local2;
_local14.stop();
_local14.x = 937;
_local14.y = 1590;
_local14.vx = 0;
_local14.vy = 0;
_board.addChild(_local14);
balls.push(_local14);
_local3++;
};
_local4 = 55;
_local5 = 0;
_bumpT = _board.bumpT;
_local6 = new Bumper(_local4, 0xFF0000);
_local6.name = "bump1";
_local6.mass = (_local4 / 2);
_local6.alpha = 0.4;
_local6.x = 460;
_local6.y = 600;
_local6.vx = (_local6.vy = _local5);
_board.addChild(_local6);
_bumpL = _board.bumpL;
_local7 = new Bumper(_local4, 0xFF0000);
_local7.name = "bump2";
_local7.mass = (_local4 / 2);
_local7.alpha = 0.4;
_local7.x = 320;
_local7.y = 740;
_local7.vx = (_local7.vy = _local5);
_board.addChild(_local7);
_bumpR = _board.bumpR;
_local8 = new Bumper(_local4, 0xFF0000);
_local8.name = "bump3";
_local8.mass = (_local4 / 2);
_local8.alpha = 0.4;
_local8.x = 590;
_local8.y = 740;
_local8.vx = (_local8.vy = _local5);
_board.addChild(_local8);
_bumpB = _board.bumpB;
_local9 = new Bumper(_local4, 0xFF0000);
_local9.name = "bump4";
_local9.mass = (_local4 / 2);
_local9.alpha = 0.4;
_local9.x = 460;
_local9.y = 870;
_local9.vx = (_local9.vy = _local5);
_board.addChild(_local9);
bumps = new Array();
bumps.push(_local6);
bumps.push(_local7);
bumps.push(_local8);
bumps.push(_local9);
_board.setChildIndex(_bumpT, (_board.numChildren - 1));
_board.setChildIndex(_bumpL, (_board.numChildren - 1));
_board.setChildIndex(_bumpR, (_board.numChildren - 1));
_board.setChildIndex(_bumpB, (_board.numChildren - 1));
_board.setChildIndex(_springH, (_board.numChildren - 1));
dTargs = new Array();
numTargs = 6;
_local10 = 0;
while (_local10 < numTargs) {
_local15 = board[("dt" + _local10)];
dTargs.push(_local15);
_local15.targ = MovieClip(board[("targ" + _local10)]);
_local15.visible = false;
_local10++;
};
allLites = new Array();
numLites = 24;
currentLite = 0;
_local11 = 0;
while (_local11 < numLites) {
_local16 = MovieClip(_board[("lite" + _local11)]);
allLites.push(_local16);
switch (_local11){
case 0:
_local16.label.text = "SPILL";
_local16.num = 200;
break;
case 1:
_local16.label.text = "300";
_local16.num = 300;
break;
case 2:
case 3:
_local16.label.text = "400";
_local16.num = 400;
break;
case 4:
case 5:
case 6:
case 7:
_local16.label.text = "500";
_local16.num = 500;
break;
case 8:
case 9:
_local16.label.text = "600";
_local16.num = 600;
break;
case 10:
case 11:
case 12:
_local16.label.text = "750";
_local16.num = 750;
break;
case 13:
case 14:
_local16.label.text = "1000";
_local16.num = 1000;
break;
case 15:
case 16:
_local16.label.text = "1250";
_local16.num = 1250;
break;
case 17:
_local16.label.text = "1500";
_local16.num = 1500;
break;
case 18:
_local16.label.text = "1750";
_local16.num = 1750;
break;
case 19:
_local16.label.text = "2000";
_local16.num = 2000;
break;
case 20:
case 21:
_local16.label.text = "2500";
_local16.num = 2500;
break;
case 22:
_local16.label.text = "3000";
_local16.num = 3000;
break;
case 23:
_local16.label.text = "5000";
_local16.num = 5000;
break;
};
_local11++;
};
xLites = new Array();
numXlites = 3;
_local12 = 0;
while (_local12 < numXlites) {
_local17 = MovieClip(_board[("xlite" + _local12)]);
xLites.push(_local17);
switch (_local12){
case 0:
_local17.label.text = "ALL";
break;
case 1:
_local17.label.text = "OVER";
break;
case 2:
_local17.label.text = "YOU";
break;
};
_local12++;
};
flipL = _board._padL;
flipR = _board._padR;
flipL2 = _board._padL2;
flipR2 = _board._padR2;
_fbl1 = _board.flipBL1;
_fbl2 = _board.flipBL2;
_fbr1 = _board.flipBR1;
_fbr2 = _board.flipBR2;
flipL.rotation = (flipL2.rotation = (_fbl1.rotation = (_fbl2.rotation = 35)));
flipR.rotation = (_fbr1.rotation = -35);
flipL.x = 293;
flipL2.x = 52;
flipR.x = 616;
flipR.y = 1469;
flipR2.x = 860;
_fbr2.rotation = (flipR2.rotation = -55);
flipR.visible = (flipR2.visible = (flipL.visible = (flipL2.visible = false)));
_local13 = 0;
while (_local13 < numDiscs) {
_local18 = MovieClip(_board[("disc" + _local13)]);
allDiscs.push(_local18);
_local18.isHit = false;
_local18.id = _local13;
_local18.visible = false;
_local13++;
};
gameTimer = new Timer(13);
gameTimer.addEventListener(TimerEvent.TIMER, enterframe);
_intro = intro;
_startB = _intro.startb;
_startB.addEventListener(MouseEvent.CLICK, startGame);
_prod2 = _hScores.prod;
_prod2.addEventListener(MouseEvent.CLICK, linkOUT);
_siteb = _intro.site;
_prod = _intro.prod;
_tourb = _intro.tourdates;
_storeb = _intro.store;
_fanb = _intro.fanclub;
_getCD1 = _intro.getCD1;
_getCD2 = _intro.getCD2;
_getItunes2 = _intro.getItunes2;
_siteb.addEventListener(MouseEvent.CLICK, linkOUT);
_tourb.addEventListener(MouseEvent.CLICK, linkOUT);
_storeb.addEventListener(MouseEvent.CLICK, linkOUT);
_fanb.addEventListener(MouseEvent.CLICK, linkOUT);
_prod.addEventListener(MouseEvent.CLICK, linkOUT);
_getCD1.addEventListener(MouseEvent.CLICK, linkOUT);
_getCD2.addEventListener(MouseEvent.CLICK, linkOUT);
_getItunes2.addEventListener(MouseEvent.CLICK, linkOUT);
}
public function ballDead():void{
var _local1:Ball;
_local1 = Ball(balls[0]);
_local1.vx = (_local1.vy = 0);
_local1.x = 1040;
_local1.y = 1522;
removeLites();
ballIsDead = true;
if (lives > 0){
lives--;
TweenLite.to(_local1, 0.5, {x:937});
} else {
gotoHighScores();
};
_balls.text = String(lives);
TweenLite.to(_door, 0.5, {x:975, y:368, rotation:-89, ease:Bounce.easeOut});
_board.wall12.x = 970;
}
public function checkLine(_arg1:Sprite, _arg2:Ball):void{
var _local3:Rectangle;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local3 = _arg1.getBounds(this);
if ((((_arg2.x > _local3.left)) && ((_arg2.x < _local3.right)))){
_local4 = ((_arg1.rotation * Math.PI) / 180);
_local5 = Math.cos(_local4);
_local6 = Math.sin(_local4);
_local7 = (_arg2.x - _arg1.x);
_local8 = (_arg2.y - _arg1.y);
_local9 = ((_local5 * _local8) - (_local6 * _local7));
_local10 = ((_local5 * _arg2.vy) - (_local6 * _arg2.vx));
if ((((_local9 > (-(_arg2.height) / 2))) && ((_local9 < _local10)))){
_local11 = ((_local5 * _local7) + (_local6 * _local8));
_local12 = ((_local5 * _arg2.vx) + (_local6 * _arg2.vy));
_local9 = (-(_arg2.height) / 2);
_local10 = (_local10 * bounce);
_local7 = ((_local5 * _local11) - (_local6 * _local9));
_local8 = ((_local5 * _local9) + (_local6 * _local11));
_arg2.vx = (((_local5 * _local12) - (_local6 * _local10)) * 2);
_arg2.vy = (((_local5 * _local10) + (_local6 * _local12)) * 2);
_arg2.x = (_arg1.x + _local7);
_arg2.y = (_arg1.y + _local8);
};
};
}
public function checkCollision(_arg1:Ball, _arg2:Ball):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Object;
var _local17:Object;
var _local18:Object;
var _local19:Object;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 < (_arg1.radius + _arg2.radius)){
_local6 = Math.atan2(_local4, _local3);
_local7 = Math.sin(_local6);
_local8 = Math.cos(_local6);
_local9 = new Point(0, 0);
_local10 = rotate(_local3, _local4, _local7, _local8, true);
_local11 = rotate(_arg1.vx, _arg1.vy, _local7, _local8, true);
_local12 = rotate(_arg2.vx, _arg2.vy, _local7, _local8, true);
_local13 = (_local11.x - _local12.x);
_local11.x = ((((_arg1.mass - _arg2.mass) * _local11.x) + ((2 * _arg2.mass) * _local12.x)) / (_arg1.mass + _arg2.mass));
_local12.x = (_local13 + _local11.x);
_local14 = (Math.abs(_local11.x) + Math.abs(_local12.x));
_local15 = ((_arg1.radius + _arg2.radius) - Math.abs((_local9.x - _local10.x)));
_local9.x = (_local9.x + (((_local11.x / _local14) * _local15) * 2));
_local10.x = (_local10.x + ((_local12.x / _local14) * _local15));
_local16 = rotate(_local9.x, _local9.y, _local7, _local8, false);
_local17 = rotate(_local10.x, _local10.y, _local7, _local8, false);
_arg1.x = (_arg1.x + _local16.x);
_arg1.y = (_arg1.y + _local16.y);
_local18 = rotate(_local11.x, _local11.y, _local7, _local8, false);
_local19 = rotate(_local12.x, _local12.y, _local7, _local8, false);
_arg1.vx = _local18.x;
_arg1.vy = _local18.y;
};
}
public function linkOUT(_arg1:MouseEvent):void{
var _local2:SimpleButton;
_local2 = SimpleButton(_arg1.currentTarget);
switch (_local2.name){
case "site":
gotoLink("http://01detail.com/click/151/0");
break;
case "tourdates":
gotoLink("http://01detail.com/click/152/0");
break;
case "store":
gotoLink("http://01detail.com/click/153/0");
break;
case "discount":
gotoLink("http://01detail.com/click/153/0");
break;
case "fanclub":
gotoLink("http://01detail.com/click/154/0");
break;
case "prod":
gotoLink("http://www.prod4ever.com");
break;
case "getCD1":
gotoLink("http://01detail.com/click/155/0");
break;
case "getItunes1":
gotoLink("http://www.spillcanvas.com");
break;
case "getCD2":
gotoLink("http://01detail.com/click/153/0");
break;
case "getItunes2":
gotoLink("http://01detail.com/click/156/0");
break;
case "buynow":
gotoLink("http://01detail.com/click/156/0");
break;
};
}
public function scoresToStartOver():void{
_initials.visible = false;
_next.visible = false;
_playAgain.visible = true;
}
public function wallOut():void{
board.wall12.x = 893;
}
public function ugoplayer(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function checkDiscs(_arg1:MovieClip):void{
if (((_arg1.hitTestObject(Ball(balls[0]))) && (!(_arg1.isHit)))){
_arg1.isHit = true;
handleDisc(_arg1.id);
};
}
public function rotate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):Point{
var _local6:Point;
_local6 = new Point();
if (_arg5){
_local6.x = ((_arg1 * _arg4) + (_arg2 * _arg3));
_local6.y = ((_arg2 * _arg4) - (_arg1 * _arg3));
} else {
_local6.x = ((_arg1 * _arg4) - (_arg2 * _arg3));
_local6.y = ((_arg2 * _arg4) + (_arg1 * _arg3));
};
return (_local6);
}
public function checkCollisionBump(_arg1:Ball, _arg2:Bumper):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Object;
var _local17:Object;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 < (_arg1.radius + _arg2.radius)){
_local6 = Math.atan2(_local4, _local3);
_local7 = Math.sin(_local6);
_local8 = Math.cos(_local6);
_local9 = new Point(0, 0);
_local10 = rotate(_local3, _local4, _local7, _local8, true);
_local11 = rotate(_arg1.vx, _arg1.vy, _local7, _local8, true);
_local12 = rotate(-((_arg1.vx * 0.8)), -((_arg1.vy * 0.8)), _local7, _local8, true);
_local13 = (_local11.x - _local12.x);
_local11.x = ((((_arg1.mass - _arg2.mass) * _local11.x) + ((2 * _arg2.mass) * _local12.x)) / (_arg1.mass + _arg2.mass));
_local12.x = (_local13 + _local11.x);
_local14 = (Math.abs(_local11.x) + Math.abs(_local12.x));
_local15 = ((_arg1.radius + _arg2.radius) - Math.abs((_local9.x - _local10.x)));
_local9.x = (_local9.x + ((_local11.x / _local14) * _local15));
_local10.x = (_local10.x + ((_local12.x / _local14) * _local15));
_local16 = rotate(_local9.x, _local9.y, _local7, _local8, false);
_arg1.x = (_arg1.x + _local16.x);
_arg1.y = (_arg1.y + _local16.y);
_local17 = rotate(_local11.x, _local11.y, _local7, _local8, false);
_arg1.vx = _local17.x;
_arg1.vy = _local17.y;
switch (_arg2.name){
case "bump1":
_bumpT.gotoAndPlay(2);
break;
case "bump2":
_bumpL.gotoAndPlay(2);
break;
case "bump3":
_bumpR.gotoAndPlay(2);
break;
case "bump4":
_bumpB.gotoAndPlay(2);
break;
};
if (currentLite == 0){
score.add(100);
} else {
score.add(allLites[(currentLite - 1)].num);
};
high.checkHi(score.scr);
gs.buzz("bumper");
};
}
public function removeLites():void{
var _local1:int;
var _local2:int;
var _local3:int;
_baby.gotoAndStop(1);
_hole.gotoAndStop(1);
babyMode = false;
_local1 = 0;
while (_local1 < currentLite) {
allLites[_local1].gotoAndStop(1);
_local1++;
};
currentLite = 0;
_local2 = 0;
while (_local2 < xLites.length) {
xLites[_local2].gotoAndStop(1);
_local2++;
};
_local3 = 0;
while (_local3 < allDiscs.length) {
allDiscs[_local3].isHit = false;
_local3++;
};
}
public function nielsen(_arg1:String):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:Loader;
_local2 = "us-ugo";
_local3 = "ugoplayer_flashgames";
_local4 = escape(_arg1);
_local5 = new URLRequest(((((((("http://secure-us.imrworldwide.com/cgi-bin/m?ci=" + _local2) + "&cg=") + _local3) + "&si=") + _local4) + "&rnd=") + Math.ceil((Math.random() * 100000000))));
_local6 = new Loader();
_local6.load(_local5);
addChild(_local6);
}
public function startGame(_arg1:MouseEvent):void{
TweenLite.to(_intro, 0.3, {autoAlpha:0});
gameTimer.start();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
stage.quality = StageQuality.MEDIUM;
score.reset();
lives = 3;
_balls.text = String(lives);
ballDead();
}
public function displayScores(_arg1:Array):void{
var _local2:Array;
var _local3:int;
var _local4:MovieClip;
trace("display SCORES");
_local2 = _arg1;
_local3 = 0;
while (_local3 < 10) {
_local4 = MovieClip(_hScores.getChildByName(("hs" + String(_local3))));
_local4.num.text = String((_local3 + 1));
_local4.initials.text = _local2[_local3].name.toUpperCase();
_local4.score.text = _local2[_local3].score;
_local3++;
};
}
public function enterframe(_arg1:TimerEvent):void{
var _local2:Ball;
var _local3:int;
var _local4:uint;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
_local2 = balls[0];
_local2.vy = (_local2.vy + gravity);
if (!ballIsHeld){
_local2.x = (_local2.x + _local2.vx);
_local2.y = (_local2.y + _local2.vy);
};
if ((((int(Math.abs(_local2.vx)) == 0)) && ((int(Math.abs(_local2.vy)) == 0)))){
_local2.stop();
} else {
_local2.play();
};
_local2.filters = [new BlurFilter(Math.abs((_local2.vx / 5)), Math.abs((_local2.vy / 5)))];
_local3 = 0;
while (_local3 < bumps.length) {
checkCollisionBump(_local2, bumps[_local3]);
_local3++;
};
_local4 = 0;
while (_local4 < numLines) {
checkBounce(lines[_local4]);
_local4++;
};
checkBounce(flipL);
checkBounce(flipR);
checkBounce(flipL2);
checkBounce(flipR2);
checkFlip(flipL, "L1");
checkFlip(flipR, "R1");
checkFlip(flipL2, "L1");
checkFlip(flipR2, "R1");
_local5 = 0;
while (_local5 < numTargs) {
checkBounce(dTargs[_local5], "targ");
_local5++;
};
_local6 = 0;
while (_local6 < numDiscs) {
checkDiscs(allDiscs[_local6]);
_local6++;
};
if (babyMode){
checkHole(_local2);
};
_board.y = (_board.y + (diff * 0.5));
if (_board.y > 0){
_board.y = 0;
};
diff = (Math.abs(_board.y) - (_local2.y - 300));
_board.x = (_board.x + (xdiff * 0.5));
if (_board.x < -179){
_board.x = -179;
};
_local7 = (_local2.x / 970);
_local8 = (_local7 * 179);
xdiff = (Math.abs(_board.x) - _local8);
}
public function checkFlip(_arg1:MovieClip, _arg2:String):void{
var _local3:Ball;
_local3 = Ball(balls[0]);
if (_arg1.hitTestObject(_local3)){
if (((flipLInMotion) && ((_arg2 == "L1")))){
_local3.vx = (_local3.vx + ((7 / flipLV) * flipLV));
_local3.vy = (_local3.vy - (7 * flipLV));
} else {
if (((flipRInMotion) && ((_arg2 == "R1")))){
_local3.vx = (_local3.vx - ((7 / flipRV) * flipRV));
_local3.vy = (_local3.vy - (7 * flipRV));
};
};
};
}
public function checkBounce(_arg1:MovieClip, _arg2:String="wall"):void{
var _local3:Ball;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local3 = Ball(balls[0]);
if (_arg1.hitTestObject(_local3)){
if (_arg1.name == "wall65"){
ballDead();
return;
};
_local4 = ((_arg1.rotation * Math.PI) / 180);
_local5 = Math.cos(_local4);
_local6 = Math.sin(_local4);
_local7 = (_local3.x - _arg1.x);
_local8 = (_local3.y - _arg1.y);
_local9 = ((_local5 * _local8) - (_local6 * _local7));
_local10 = ((_local5 * _local3.vy) - (_local6 * _local3.vx));
if ((((_local9 > (-(_local3.height) / 2))) && ((_local9 < _local10)))){
_local11 = ((_local5 * _local7) + (_local6 * _local8));
_local12 = ((_local5 * _local3.vx) + (_local6 * _local3.vy));
_local9 = (-(_local3.height) / 2);
_local10 = (_local10 * bounce);
_local7 = ((_local5 * _local11) - (_local6 * _local9));
_local8 = ((_local5 * _local9) + (_local6 * _local11));
_local13 = 1;
if (_arg2 == "targ"){
MovieClip(_arg1.targ).gotoAndPlay(2);
if (currentLite == 0){
score.add(100);
} else {
score.add(allLites[(currentLite - 1)].num);
};
high.checkHi(score.scr);
gs.buzz("bumper");
updateLites();
};
_local3.vx = ((_local5 * _local12) - (_local6 * _local10));
_local3.vy = ((_local5 * _local10) + (_local6 * _local12));
_local3.x = (_arg1.x + _local7);
_local3.y = (_arg1.y + _local8);
};
};
}
public function fromNext(_arg1:MouseEvent):void{
trace(" fromNext: ");
highscores.submitNewScores();
}
public function checkWalls(_arg1:Ball):void{
if ((_arg1.x + _arg1.radius) > stage.stageWidth){
_arg1.x = (stage.stageWidth - _arg1.radius);
_arg1.vx = (_arg1.vx * bounce);
} else {
if ((_arg1.x - _arg1.radius) < 0){
_arg1.x = _arg1.radius;
_arg1.vx = (_arg1.vx * bounce);
};
};
if ((_arg1.y + _arg1.radius) > stage.stageHeight){
_arg1.y = (stage.stageHeight - _arg1.radius);
_arg1.vy = (_arg1.vy * bounce);
} else {
if ((_arg1.y - _arg1.radius) < 0){
_arg1.y = _arg1.radius;
_arg1.vy = (_arg1.vy * bounce);
};
};
}
public function handleDisc(_arg1:int):void{
xLites[_arg1].gotoAndPlay(2);
score.add(250);
if ((((((xLites[0].currentFrame > 1)) && ((xLites[1].currentFrame > 1)))) && ((xLites[2].currentFrame > 1)))){
trace("ALL OVER YOU");
_baby.gotoAndStop(2);
_hole.gotoAndPlay(2);
babyMode = true;
};
}
public function checkHole(_arg1:Ball):void{
var _local2:Timer;
if (((_holehit.hitTestPoint(_arg1.x, _arg1.y)) && (!(ballIsHeld)))){
_arg1.x = _holehit.x;
_arg1.y = _holehit.y;
ballIsHeld = true;
TweenLite.to(_arg1, 0.7, {scaleX:0.9, scaleY:0.9});
if (currentLite == 0){
TweenLite.to(_arg1, 0.3, {scaleX:1, scaleY:1, delay:1, ease:Bounce.easeOut, onComplete:resetHold, onCompleteParams:[]});
} else {
_local2 = new Timer(300, currentLite);
_local2.addEventListener(TimerEvent.TIMER, spitOutBall);
_local2.start();
};
trace((" START HOLD: " + currentLite));
};
}
}
}//package Pinball4_UGO_fla
Section 28
//nextBtn_53 (Pinball4_UGO_fla.nextBtn_53)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class nextBtn_53 extends MovieClip {
public function nextBtn_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 29
//playagainb_55 (Pinball4_UGO_fla.playagainb_55)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class playagainb_55 extends MovieClip {
public function playagainb_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 30
//red_21 (Pinball4_UGO_fla.red_21)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class red_21 extends MovieClip {
public var label:TextField;
public function red_21(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 31
//sc1_33 (Pinball4_UGO_fla.sc1_33)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sc1_33 extends MovieClip {
public function sc1_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 32
//sc2_34 (Pinball4_UGO_fla.sc2_34)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sc2_34 extends MovieClip {
public function sc2_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 33
//sc3_35 (Pinball4_UGO_fla.sc3_35)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sc3_35 extends MovieClip {
public function sc3_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 34
//sc4_36 (Pinball4_UGO_fla.sc4_36)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sc4_36 extends MovieClip {
public function sc4_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 35
//UGOmc_58 (Pinball4_UGO_fla.UGOmc_58)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class UGOmc_58 extends MovieClip {
public var tag:SimpleButton;
public function UGOmc_58(){
addFrameScript(50, frame51);
}
function frame51(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 36
//yellow_20 (Pinball4_UGO_fla.yellow_20)
package Pinball4_UGO_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class yellow_20 extends MovieClip {
public var label:TextField;
public function yellow_20(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package Pinball4_UGO_fla
Section 37
//AlbumPlayer (AlbumPlayer)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public dynamic class AlbumPlayer extends MovieClip {
private var loaded:Array;
public var _PLAY:MovieClip;
private var _play:MovieClip;
private var IsStopped:Boolean;
private var songNum:Number;// = -1
private var theSong:MovieClip;
private var songArray:Array;
private var _title:TextField;
private var _buyCD:SimpleButton;
public var buynow:SimpleButton;
private var _time:TextField;
private var songPath:String;
public function AlbumPlayer():void{
songNum = -1;
loaded = new Array();
super();
}
public function init():void{
newSong(0);
(IsStopped = false);
}
public function buyOnItunes():void{
navigateToURL(new URLRequest("http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=273419576&s=143441"), "_blank");
}
private function loadSong(_arg1:uint):void{
trace(("LOAD SONG: " + _arg1));
if (theSong){
(theSong = null);
};
if (loaded[_arg1]){
(theSong = MovieClip(loaded[_arg1]["content"]));
} else {
(loaded[_arg1] = new Loader());
loaded[_arg1].contentLoaderInfo.addEventListener(Event.INIT, startSong);
loaded[_arg1].load(new URLRequest(songArray[_arg1]));
};
}
private function doNext(_arg1:MouseEvent):void{
trace(" NEXT ");
gotoSong("next");
}
public function initPlayer(_arg1:String):void{
_play = MovieClip(getChildByName("_PLAY"));
_play.gotoAndStop(1);
_play.buttonMode = true;
_play.addEventListener(MouseEvent.MOUSE_DOWN, doPlay);
_play.addEventListener(MouseEvent.ROLL_OVER, playOver);
_play.addEventListener(MouseEvent.ROLL_OUT, playOut);
_title = TextField(getChildByName("title"));
_time = TextField(getChildByName("time"));
_buyCD = SimpleButton(getChildByName("buynow"));
_buyCD.addEventListener(MouseEvent.CLICK, buyCd);
songArray = new Array(_arg1);
init();
}
private function progressRed(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = (_arg1.bytesLoaded / _arg1.bytesTotal);
}
private function gotoSong(_arg1:String):void{
doPause(null);
if (_arg1 == "next"){
if (songNum == (songArray.length - 1)){
newSong(0);
} else {
newSong((songNum + 1));
};
} else {
if (songNum == 0){
newSong((songArray.length - 1));
} else {
newSong((songNum - 1));
};
};
}
public function doPause(_arg1:MouseEvent):void{
theSong.stop();
setPP("pause");
trace(" PAUSE");
}
public function doPlay(_arg1:MouseEvent):void{
if (!IsStopped){
theSong.stop();
_play.gotoAndStop(2);
(IsStopped = true);
} else {
theSong.play();
_play.gotoAndStop(1);
(IsStopped = false);
};
}
private function parseXML(_arg1:Event):void{
var _local2:URLLoader;
var _local3:XML;
var _local4:XML;
_local2 = URLLoader(_arg1.target);
_local3 = XML(_local2.data);
_local3.ignoreWhitespace = true;
songArray = new Array("sc_alloveryou_hi.swf");
for each (_local4 in _local3.playlist.song) {
};
init();
}
private function doPrev(_arg1:MouseEvent):void{
trace(" PREV ");
gotoSong("prev");
}
private function playOver(_arg1:MouseEvent):void{
var _local2:int;
_local2 = ((_play.currentFrame)==1) ? 2 : 1;
_play.gotoAndStop(_local2);
}
public function buyCd(_arg1):void{
navigateToURL(new URLRequest("http://01detail.com/click/156/0"), "_blank");
}
private function startSong(_arg1:Event):void{
(theSong = MovieClip(_arg1.currentTarget["loader"]["content"]));
theSong.play();
}
private function playOut(_arg1:MouseEvent):void{
var _local2:int;
_local2 = (IsStopped) ? 2 : 1;
_play.gotoAndStop(_local2);
}
private function handle(_arg1:String):void{
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(String(_arg1)));
_local2.addEventListener(Event.COMPLETE, parseXML);
}
function onEF(_arg1:Event):void{
var _local2:Number;
var _local3:String;
var _local4:String;
var _local5:Array;
if (theSong){
if (theSong.currentFrame == theSong.totalFrames){
theSong.stop();
gotoSong("next");
};
_local2 = Math.floor(((theSong.totalFrames / 60) - (theSong.currentFrame / 60)));
_local3 = String(Math.floor((_local2 / 60)));
_local4 = String((_local2 - (Number(_local3) * 60)));
_local4 = ("00" + _local4);
_local4;
_local5 = _local4.split("");
_local4 = (_local4.split("")[(_local5.length - 2)] + _local5[(_local5.length - 1)]);
_local4;
(_time.text = ((_local3 + ":") + _local4));
};
}
public function newSong(_arg1:int):void{
if (loaded[songNum]){
loaded[songNum].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressRed);
};
if (_arg1 !== songNum){
(songNum = _arg1);
};
loadSong(songNum);
}
private function setPP(_arg1:String):void{
if (_arg1 == "play"){
(_play.visible = false);
} else {
(_play.visible = true);
};
}
}
}//package
Section 38
//Ball (Ball)
package {
import flash.display.*;
public class Ball extends MovieClip {
public var mass:Number;
private var color:uint;
public var radius:Number;
public var vx:Number;// = 0
public var vy:Number;// = 0
public function Ball(_arg1:Number=40, _arg2:uint=0xFFFFFF){
vx = 0;
vy = 0;
super();
radius = _arg1;
color = _arg2;
init();
}
public function init():void{
}
}
}//package
Section 39
//Bumper (Bumper)
package {
import flash.display.*;
public class Bumper extends Sprite {
public var mass:Number;
private var color:uint;
public var radius:Number;
public var vx:Number;// = 0
public var vy:Number;// = 0
public function Bumper(_arg1:Number=40, _arg2:uint=0xFFFFFF){
vx = 0;
vy = 0;
super();
radius = _arg1;
color = _arg2;
init();
}
public function init():void{
graphics.beginFill(color);
graphics.drawCircle(0, 0, radius);
graphics.endFill();
visible = false;
}
}
}//package
Section 40
//BumperSnd (BumperSnd)
package {
import flash.media.*;
public class BumperSnd extends Sound {
public function BumperSnd():void{
play();
}
}
}//package
Section 41
//FlipSnd (FlipSnd)
package {
import flash.media.*;
public class FlipSnd extends Sound {
public function FlipSnd(){
play();
}
}
}//package
Section 42
//GameSound (GameSound)
package {
import flash.media.*;
public class GameSound {
public function GameSound():void{
}
public function buzz(_arg1:String):void{
var _local2:Sound;
var _local3:SoundTransform;
_local3 = new SoundTransform();
switch (_arg1){
case "bumper":
_local2 = new BumperSnd();
break;
case "drop":
break;
case "flip":
_local2 = new FlipSnd();
break;
};
}
}
}//package
Section 43
//HighScores (HighScores)
package {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
public class HighScores {
var myRequest:URLRequest;
var _game:MovieClip;
var myLoader:URLLoader;
var init0:TextField;
var init1:TextField;
var dataArray:Array;
var initialTimer:Timer;
var init2:TextField;
var myVariables:URLVariables;
var initials:String;
var phpPath:String;
public function HighScores(_arg1:String, _arg2){
_game = (_arg2 as MovieClip);
phpPath = _arg1;
loadScores(false);
}
private function onLoaded(_arg1:Event):void{
var _local2:Array;
var _local3:int;
var _local4:Array;
dataArray = new Array();
_local2 = String(myLoader.data).split("&");
_local3 = 0;
while (_local3 < (_local2.length - 1)) {
_local4 = String(_local2[_local3]).split(",");
dataArray.push({name:_local4[0], score:_local4[1], email:_local4[2]});
trace(((((((_local3 + " = name: ") + _local4[0]) + " // score ") + _local4[1]) + " // email") + _local4[2]));
if (_local3 == 0){
_game.high.reset();
_game.high.add(_local4[1]);
};
_local3++;
};
_game.displayScores(dataArray);
}
public function enableInitials(_arg1:MovieClip):void{
var _local2:FocusManager;
init0 = TextField(_arg1.let0);
init1 = TextField(_arg1.let1);
init2 = TextField(_arg1.let2);
init0.tabEnabled = (init1.tabEnabled = (init2.tabEnabled = true));
init0.maxChars = (init1.maxChars = (init2.maxChars = 1));
init0.tabIndex = 0;
init1.tabIndex = 1;
init2.tabIndex = 2;
_local2 = new FocusManager(_arg1);
_local2.setFocus(init0);
initialTimer = new Timer(200);
initialTimer.addEventListener(TimerEvent.TIMER, checkInitials);
initialTimer.start();
}
public function checkInitials(_arg1:TimerEvent):void{
init0.text = init0.text.toUpperCase();
init1.text = init1.text.toUpperCase();
init2.text = init2.text.toUpperCase();
initials = ((init0.text + init1.text) + init2.text);
if (initials.length == 3){
_game.hscores.next.visible = true;
} else {
_game.hscores.next.visible = false;
};
}
public function compareScore():Boolean{
var _local1:int;
var _local2:Boolean;
var _local3:int;
_local1 = _game.score.scr;
_local2 = false;
_local3 = 0;
while (_local3 < dataArray.length) {
if (_local1 >= dataArray[_local3].score){
_local2 = true;
};
_local3++;
};
return (_local2);
}
public function loadScores(_arg1:Boolean):void{
myRequest = new URLRequest(phpPath);
myLoader = new URLLoader();
myVariables = new URLVariables();
myVariables.scoresize = 10;
myVariables.viewtype = "FLASH";
if (!_arg1){
myVariables.action = "VIEW";
} else {
myVariables.action = "INSERT";
myVariables.winname = initials;
myVariables.winscore = _game.score.scr;
myVariables.winemail = "email";
};
myRequest.method = URLRequestMethod.POST;
myRequest.data = myVariables;
myLoader.addEventListener(Event.COMPLETE, onLoaded);
myLoader.load(myRequest);
}
public function submitNewScores():void{
initialTimer.stop();
loadScores(true);
_game.scoresToStartOver();
}
}
}//package
Section 44
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public class Score {
public var display:TextField;
public var scr:int;
private var digits:Array;
private var _d0:TextField;
private var _d1:TextField;
private var _d2:TextField;
private var _d3:TextField;
private var _d4:TextField;
private var _d5:TextField;
private var _d6:TextField;
private var holder:MovieClip;
public function Score(_arg1:MovieClip):void{
holder = _arg1;
_d0 = TextField(_arg1.getChildByName("box0"));
_d1 = TextField(_arg1.getChildByName("box1"));
_d2 = TextField(_arg1.getChildByName("box2"));
_d3 = TextField(_arg1.getChildByName("box3"));
_d4 = TextField(_arg1.getChildByName("box4"));
_d5 = TextField(_arg1.getChildByName("box5"));
_d6 = TextField(_arg1.getChildByName("box6"));
digits = new Array(_d0, _d1, _d2, _d3, _d4, _d5, _d6);
}
public function update():void{
var _local1:int;
var _local2:Array;
var _local3:int;
_local1 = String(scr).length;
_local2 = String(scr).split("");
_local2.reverse();
_local3 = 0;
while (_local3 < 7) {
if (_local3 < _local2.length){
digits[_local3].text = _local2[_local3];
digits[_local3].visible = true;
} else {
digits[_local3].visible = false;
};
_local3++;
};
}
public function add(_arg1:int):void{
scr = (scr + _arg1);
update();
}
public function reset():void{
scr = 0;
update();
}
public function checkHi(_arg1:int):void{
if (_arg1 >= scr){
scr = _arg1;
update();
};
}
}
}//package