Section 1
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import fl.events.*;
import flash.geom.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 2
//CellRenderer (fl.controls.listClasses.CellRenderer)
package fl.controls.listClasses {
import fl.controls.*;
import flash.events.*;
public class CellRenderer extends LabelButton implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public function CellRenderer():void{
toggle = true;
focusEnabled = false;
}
override protected function toggleSelected(_arg1:MouseEvent):void{
}
override public function get selected():Boolean{
return (super.selected);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
label = _listData.label;
setStyle("icon", _listData.icon);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = 0;
if (icon != null){
icon.x = _local1;
icon.y = Math.round(((height - icon.height) >> 1));
_local2 = (icon.width + _local1);
};
if (label.length > 0){
textField.visible = true;
_local3 = Math.max(0, ((width - _local2) - (_local1 * 2)));
textField.width = _local3;
textField.height = (textField.textHeight + 4);
textField.x = (_local2 + _local1);
textField.y = Math.round(((height - textField.height) >> 1));
} else {
textField.visible = false;
};
background.width = width;
background.height = height;
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.listClasses
Section 3
//ICellRenderer (fl.controls.listClasses.ICellRenderer)
package fl.controls.listClasses {
public interface ICellRenderer {
function setSize(_arg1:Number, _arg2:Number):void;
function get listData():ListData;
function get data():Object;
function setMouseState(_arg1:String):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function set listData(_arg1:ListData):void;
function get selected():Boolean;
}
}//package fl.controls.listClasses
Section 4
//ListData (fl.controls.listClasses.ListData)
package fl.controls.listClasses {
import fl.core.*;
public class ListData {
protected var _index:uint;
protected var _owner:UIComponent;
protected var _label:String;
protected var _icon:Object;// = null
protected var _row:uint;
protected var _column:uint;
public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){
_icon = null;
super();
_label = _arg1;
_icon = _arg2;
_owner = _arg3;
_index = _arg4;
_row = _arg5;
_column = _arg6;
}
public function get owner():UIComponent{
return (_owner);
}
public function get label():String{
return (_label);
}
public function get row():uint{
return (_row);
}
public function get index():uint{
return (_index);
}
public function get icon():Object{
return (_icon);
}
public function get column():uint{
return (_column);
}
}
}//package fl.controls.listClasses
Section 5
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 6
//Button (fl.controls.Button)
package fl.controls {
import fl.core.*;
import flash.display.*;
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 7
//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 8
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get toggle():Boolean{
return (true);
}
override protected function configUI():void{
var _local1:Shape;
var _local2:Graphics;
super.configUI();
super.toggle = true;
_local1 = new Shape();
_local2 = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
var _local1:Number;
super.drawLayout();
_local1 = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
override protected function drawBackground():void{
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 9
//ComboBox (fl.controls.ComboBox)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
public class ComboBox extends UIComponent implements IFocusManagerComponent {
protected var _dropdownWidth:Number;
protected var highlightedCell:int;// = -1
protected var _prompt:String;
protected var isOpen:Boolean;// = false
protected var list:List;
protected var _rowCount:uint;// = 5
protected var currentIndex:int;
protected var isKeyDown:Boolean;// = false
protected var _labels:Array;
protected var background:BaseButton;
protected var inputField:TextInput;
protected var listOverIndex:uint;
protected var editableValue:String;
protected var _editable:Boolean;// = false
private var collectionItemImport:SimpleCollectionItem;
protected static const BACKGROUND_STYLES:Object = {overSkin:"overSkin", downSkin:"downSkin", upSkin:"upSkin", disabledSkin:"disabledSkin", repeatInterval:"repeatInterval"};
protected static const LIST_STYLES:Object = {upSkin:"comboListUpSkin", overSkin:"comboListOverSkin", downSkin:"comobListDownSkin", disabledSkin:"comboListDisabledSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval", textFormat:"textFormat", disabledAlpha:"disabledAlpha", skin:"listSkin"};
private static var defaultStyles:Object = {upSkin:"ComboBox_upSkin", downSkin:"ComboBox_downSkin", overSkin:"ComboBox_overSkin", disabledSkin:"ComboBox_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, buttonWidth:24, disabledAlpha:null, listSkin:null};
public static var createAccessibilityImplementation:Function;
public function ComboBox(){
_rowCount = 5;
_editable = false;
isOpen = false;
highlightedCell = -1;
isKeyDown = false;
super();
}
protected function drawList():void{
list.rowCount = Math.max(0, Math.min(_rowCount, list.dataProvider.length));
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
public function get dropdown():List{
return (list);
}
public function get dropdownWidth():Number{
return (list.width);
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (list.sortItemsOn(_arg1, _arg2));
}
protected function onEnter(_arg1:ComponentEvent):void{
_arg1.stopPropagation();
}
public function removeItemAt(_arg1:uint):void{
list.removeItemAt(_arg1);
invalidate(InvalidationType.DATA);
}
public function open():void{
currentIndex = selectedIndex;
if (((isOpen) || ((length == 0)))){
return;
};
dispatchEvent(new Event(Event.OPEN));
isOpen = true;
addEventListener(Event.ENTER_FRAME, addCloseListener, false, 0, true);
positionList();
list.scrollToSelected();
stage.addChild(list);
}
public function get selectedItem():Object{
return (list.selectedItem);
}
public function set text(_arg1:String):void{
if (!editable){
return;
};
inputField.text = _arg1;
}
public function get labelField():String{
return (list.labelField);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:uint;
var _local4:Number;
var _local5:int;
isKeyDown = true;
if (_arg1.ctrlKey){
switch (_arg1.keyCode){
case Keyboard.UP:
if (highlightedCell > -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
break;
case Keyboard.DOWN:
open();
break;
};
return;
};
_arg1.stopPropagation();
_local2 = Math.max(((calculateAvailableHeight() / list.rowHeight) << 0), 1);
_local3 = selectedIndex;
_local4 = ((highlightedCell)==-1) ? selectedIndex : highlightedCell;
_local5 = -1;
switch (_arg1.keyCode){
case Keyboard.SPACE:
if (isOpen){
close();
} else {
open();
};
return;
case Keyboard.ESCAPE:
if (isOpen){
if (highlightedCell > -1){
selectedIndex = selectedIndex;
};
close();
};
return;
case Keyboard.UP:
_local5 = Math.max(0, (_local4 - 1));
break;
case Keyboard.DOWN:
_local5 = Math.min((length - 1), (_local4 + 1));
break;
case Keyboard.PAGE_UP:
_local5 = Math.max((_local4 - _local2), 0);
break;
case Keyboard.PAGE_DOWN:
_local5 = Math.min((_local4 + _local2), (length - 1));
break;
case Keyboard.HOME:
_local5 = 0;
break;
case Keyboard.END:
_local5 = (length - 1);
break;
case Keyboard.ENTER:
if (((_editable) && ((highlightedCell == -1)))){
editableValue = inputField.text;
selectedIndex = -1;
} else {
if (((isOpen) && ((highlightedCell > -1)))){
editableValue = null;
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
};
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER));
close();
return;
default:
if (editable){
break;
};
_local5 = list.getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), _local4);
break;
};
if (_local5 > -1){
if (isOpen){
highlightCell(_local5);
inputField.text = list.itemToLabel(getItemAt(_local5));
} else {
highlightCell();
selectedIndex = _local5;
dispatchEvent(new Event(Event.CHANGE));
};
};
}
public function set dropdownWidth(_arg1:Number):void{
_dropdownWidth = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
super.focusInHandler(_arg1);
if (editable){
stage.focus = inputField.textField;
};
}
protected function onStageClick(_arg1:MouseEvent):void{
if (!isOpen){
return;
};
if (((!(contains((_arg1.target as DisplayObject)))) && (!(list.contains((_arg1.target as DisplayObject)))))){
if (highlightedCell != -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
invalidate(InvalidationType.DATA);
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
isKeyDown = false;
}
protected function onListItemUp(_arg1:MouseEvent):void{
var _local2:*;
stage.removeEventListener(MouseEvent.MOUSE_UP, onListItemUp);
if (((!((_arg1.target is ICellRenderer))) || (!(list.contains((_arg1.target as DisplayObject)))))){
return;
};
editableValue = null;
_local2 = selectedIndex;
selectedIndex = _arg1.target.listData.index;
if (_local2 != selectedIndex){
dispatchEvent(new Event(Event.CHANGE));
};
close();
}
public function removeAll():void{
list.removeAll();
inputField.text = "";
invalidate(InvalidationType.DATA);
}
public function set selectedItem(_arg1:Object):void{
list.selectedItem = _arg1;
invalidate(InvalidationType.SELECTED);
}
protected function highlightCell(_arg1:int=-1):void{
var _local2:ICellRenderer;
if (highlightedCell > -1){
_local2 = list.itemToCellRenderer(getItemAt(highlightedCell));
if (_local2 != null){
_local2.setMouseState("up");
};
};
if (_arg1 == -1){
return;
};
list.scrollToIndex(_arg1);
list.drawNow();
_local2 = list.itemToCellRenderer(getItemAt(_arg1));
if (_local2 != null){
_local2.setMouseState("over");
highlightedCell = _arg1;
};
}
public function itemToLabel(_arg1:Object):String{
if (_arg1 == null){
return ("");
};
return (list.itemToLabel(_arg1));
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
list.addItemAt(_arg1, _arg2);
invalidate(InvalidationType.DATA);
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (list.replaceItemAt(_arg1, _arg2));
}
protected function showPrompt():void{
inputField.text = _prompt;
}
public function set rowCount(_arg1:uint):void{
_rowCount = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get restrict():String{
return (inputField.restrict);
}
protected function setEmbedFonts():void{
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
inputField.textField.embedFonts = _local1;
};
}
public function sortItems(... _args){
return (list.sortItems.apply(list, _args));
}
public function set labelField(_arg1:String):void{
list.labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
drawTextField();
}
public function set prompt(_arg1:String):void{
if (_arg1 == ""){
_prompt = null;
} else {
_prompt = _arg1;
};
invalidate(InvalidationType.STATE);
}
public function get length():int{
return (list.length);
}
protected function drawTextField():void{
inputField.setStyle("upSkin", "");
inputField.setStyle("disabledSkin", "");
inputField.enabled = enabled;
inputField.editable = _editable;
inputField.textField.selectable = ((enabled) && (_editable));
inputField.mouseEnabled = (inputField.mouseChildren = ((enabled) && (_editable)));
inputField.focusEnabled = false;
if (_editable){
inputField.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus, false, 0, true);
inputField.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true);
} else {
inputField.removeEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus);
inputField.removeEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut);
};
}
protected function onInputFieldFocusOut(_arg1:FocusEvent):void{
inputField.removeEventListener(ComponentEvent.ENTER, onEnter);
selectedIndex = selectedIndex;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get imeMode():String{
return (inputField.imeMode);
}
public function get labelFunction():Function{
return (list.labelFunction);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return ((list.height - (_local1 * 2)));
}
public function get selectedIndex():int{
return (list.selectedIndex);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
isKeyDown = false;
if (isOpen){
if (((!(_arg1.relatedObject)) || (!(list.contains(_arg1.relatedObject))))){
if (((!((highlightedCell == -1))) && (!((highlightedCell == selectedIndex))))){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
};
super.focusOutHandler(_arg1);
}
public function get selectedLabel():String{
if (editableValue != null){
return (editableValue);
};
if (selectedIndex == -1){
return (null);
};
return (itemToLabel(selectedItem));
}
public function get text():String{
return (inputField.text);
}
protected function onListChange(_arg1:Event):void{
editableValue = null;
dispatchEvent(_arg1);
invalidate(InvalidationType.SELECTED);
if (isKeyDown){
return;
};
close();
}
protected function onToggleListVisibility(_arg1:MouseEvent):void{
_arg1.stopPropagation();
dispatchEvent(_arg1);
if (isOpen){
close();
} else {
open();
stage.addEventListener(MouseEvent.MOUSE_UP, onListItemUp, false, 0, true);
};
}
override protected function draw():void{
var _local1:*;
_local1 = selectedIndex;
if ((((_local1 == -1)) && (((((!((prompt == null))) || (editable))) || ((length == 0)))))){
_local1 = Math.max(-1, Math.min(_local1, (length - 1)));
} else {
editableValue = null;
_local1 = Math.max(0, Math.min(_local1, (length - 1)));
};
if (list.selectedIndex != _local1){
list.selectedIndex = _local1;
invalidate(InvalidationType.SELECTED, false);
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFonts();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.STATE)){
drawTextFormat();
drawLayout();
invalidate(InvalidationType.DATA);
};
if (isInvalid(InvalidationType.DATA)){
drawList();
invalidate(InvalidationType.SELECTED, true);
};
if (isInvalid(InvalidationType.SELECTED)){
if ((((_local1 == -1)) && (!((editableValue == null))))){
inputField.text = editableValue;
} else {
if (_local1 > -1){
if (length > 0){
inputField.horizontalScrollPosition = 0;
inputField.text = itemToLabel(list.selectedItem);
};
} else {
if ((((_local1 == -1)) && (!((_prompt == null))))){
showPrompt();
} else {
inputField.text = "";
};
};
};
if (((((editable) && ((selectedIndex > -1)))) && ((stage.focus == inputField.textField)))){
inputField.setSelection(0, inputField.length);
};
};
drawTextField();
super.draw();
}
public function addItem(_arg1:Object):void{
list.addItem(_arg1);
invalidate(InvalidationType.DATA);
}
public function get rowCount():uint{
return (_rowCount);
}
override protected function configUI():void{
super.configUI();
background = new BaseButton();
background.focusEnabled = false;
copyStylesToChild(background, BACKGROUND_STYLES);
background.addEventListener(MouseEvent.MOUSE_DOWN, onToggleListVisibility, false, 0, true);
addChild(background);
inputField = new TextInput();
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(Event.CHANGE, onTextInput, false, 0, true);
addChild(inputField);
list = new List();
list.focusEnabled = false;
copyStylesToChild(list, LIST_STYLES);
list.addEventListener(Event.CHANGE, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_CLICK, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OUT, passEvent, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OVER, passEvent, false, 0, true);
list.verticalScrollBar.addEventListener(Event.SCROLL, passEvent, false, 0, true);
}
protected function positionList():void{
var _local1:Point;
_local1 = localToGlobal(new Point(0, 0));
list.x = _local1.x;
if (((_local1.y + height) + list.height) > stage.stageHeight){
list.y = (_local1.y - list.height);
} else {
list.y = (_local1.y + height);
};
}
public function get value():String{
var _local1:Object;
if (editableValue != null){
return (editableValue);
};
_local1 = selectedItem;
if (((!(_editable)) && (!((_local1.data == null))))){
return (_local1.data);
};
return (itemToLabel(_local1));
}
public function get prompt():String{
return (_prompt);
}
public function set dataProvider(_arg1:DataProvider):void{
_arg1.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
list.dataProvider = _arg1;
invalidate(InvalidationType.DATA);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
if (!_editable){
return;
};
inputField.restrict = _arg1;
}
protected function onTextInput(_arg1:Event):void{
_arg1.stopPropagation();
if (!_editable){
return;
};
editableValue = inputField.text;
selectedIndex = -1;
dispatchEvent(new Event(Event.CHANGE));
}
protected function onInputFieldFocus(_arg1:FocusEvent):void{
inputField.addEventListener(ComponentEvent.ENTER, onEnter, false, 0, true);
close();
}
public function getItemAt(_arg1:uint):Object{
return (list.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (ComboBox.createAccessibilityImplementation != null){
ComboBox.createAccessibilityImplementation(this);
};
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
_local1 = (getStyleValue("buttonWidth") as Number);
_local2 = (getStyleValue("textPadding") as Number);
background.setSize(width, height);
inputField.x = (inputField.y = _local2);
inputField.setSize(((width - _local1) - _local2), (height - _local2));
list.width = (isNaN(_dropdownWidth)) ? width : _dropdownWidth;
background.enabled = enabled;
background.drawNow();
}
public function removeItem(_arg1:Object):Object{
return (list.removeItem(_arg1));
}
private function addCloseListener(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, addCloseListener);
if (!isOpen){
return;
};
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageClick, false, 0, true);
}
public function get dataProvider():DataProvider{
return (list.dataProvider);
}
public function get textField():TextInput{
return (inputField);
}
protected function setStyles():void{
copyStylesToChild(background, BACKGROUND_STYLES);
copyStylesToChild(list, LIST_STYLES);
}
public function set labelFunction(_arg1:Function):void{
list.labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
protected function drawTextFormat():void{
var _local1:TextFormat;
_local1 = (getStyleValue((_enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local1 == null){
_local1 = new TextFormat();
};
inputField.textField.defaultTextFormat = _local1;
inputField.textField.setTextFormat(_local1);
setEmbedFonts();
}
public function set selectedIndex(_arg1:int):void{
list.selectedIndex = _arg1;
highlightCell();
invalidate(InvalidationType.SELECTED);
}
public function close():void{
highlightCell();
highlightedCell = -1;
if (!isOpen){
return;
};
dispatchEvent(new Event(Event.CLOSE));
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageClick);
isOpen = false;
stage.removeChild(list);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, List.getStyleDefinition()));
}
}
}//package fl.controls
Section 10
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 11
//List (fl.controls.List)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.utils.*;
import flash.ui.*;
import flash.geom.*;
public class List extends SelectableList implements IFocusManagerComponent {
protected var _labelField:String;// = "label"
protected var _rowHeight:Number;// = 20
protected var _cellRenderer:Object;
protected var _iconField:String;// = "icon"
protected var _labelFunction:Function;
protected var _iconFunction:Function;
private static var defaultStyles:Object = {focusRectSkin:null, focusRectPadding:null};
public static var createAccessibilityImplementation:Function;
public function List(){
_rowHeight = 20;
_labelField = "label";
_iconField = "icon";
super();
}
public function get iconField():String{
return (_iconField);
}
protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{
var _local4:Boolean;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = false;
if (_arg2){
_local6 = [];
_local7 = lastCaretIndex;
_local8 = _arg1;
if (_local7 == -1){
_local7 = ((caretIndex)!=-1) ? caretIndex : _arg1;
};
if (_local7 > _local8){
_local8 = _local7;
_local7 = _arg1;
};
_local5 = _local7;
while (_local5 <= _local8) {
_local6.push(_local5);
_local5++;
};
selectedIndices = _local6;
caretIndex = _arg1;
_local4 = true;
} else {
selectedIndex = _arg1;
caretIndex = (lastCaretIndex = _arg1);
_local4 = true;
};
if (_local4){
dispatchEvent(new Event(Event.CHANGE));
};
invalidate(InvalidationType.DATA);
}
override protected function drawList():void{
var _local1:Rectangle;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:ICellRenderer;
var _local7:Dictionary;
var _local8:Dictionary;
var _local9:Boolean;
var _local10:String;
var _local11:Object;
var _local12:Sprite;
var _local13:String;
listHolder.x = (listHolder.y = contentPadding);
_local1 = listHolder.scrollRect;
_local1.x = _horizontalScrollPosition;
_local1.y = (Math.floor(_verticalScrollPosition) % rowHeight);
listHolder.scrollRect = _local1;
listHolder.cacheAsBitmap = useBitmapScrolling;
_local2 = Math.floor((_verticalScrollPosition / rowHeight));
_local3 = Math.min(length, ((_local2 + rowCount) + 1));
_local7 = (renderedItems = new Dictionary(true));
_local4 = _local2;
while (_local4 < _local3) {
_local7[_dataProvider.getItemAt(_local4)] = true;
_local4++;
};
_local8 = new Dictionary(true);
while (activeCellRenderers.length > 0) {
_local6 = (activeCellRenderers.pop() as ICellRenderer);
_local5 = _local6.data;
if ((((_local7[_local5] == null)) || ((invalidItems[_local5] == true)))){
availableCellRenderers.push(_local6);
} else {
_local8[_local5] = _local6;
invalidItems[_local5] = true;
};
list.removeChild((_local6 as DisplayObject));
};
invalidItems = new Dictionary(true);
_local4 = _local2;
while (_local4 < _local3) {
_local9 = false;
_local5 = _dataProvider.getItemAt(_local4);
if (_local8[_local5] != null){
_local9 = true;
_local6 = _local8[_local5];
delete _local8[_local5];
} else {
if (availableCellRenderers.length > 0){
_local6 = (availableCellRenderers.pop() as ICellRenderer);
} else {
_local6 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer);
_local12 = (_local6 as Sprite);
if (_local12 != null){
_local12.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true);
_local12.doubleClickEnabled = true;
_local12.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true);
if (_local12["setStyle"] != null){
for (_local13 in rendererStyles) {
var _local16 = _local12;
_local16["setStyle"](_local13, rendererStyles[_local13]);
};
};
};
};
};
list.addChild((_local6 as Sprite));
activeCellRenderers.push(_local6);
_local6.y = (rowHeight * (_local4 - _local2));
_local6.setSize((availableWidth + _maxHorizontalScrollPosition), rowHeight);
_local10 = itemToLabel(_local5);
_local11 = null;
if (_iconFunction != null){
_local11 = _iconFunction(_local5);
} else {
if (_iconField != null){
_local11 = _local5[_iconField];
};
};
if (!_local9){
_local6.data = _local5;
};
_local6.listData = new ListData(_local10, _local11, this, _local4, _local4, 0);
_local6.selected = !((_selectedIndices.indexOf(_local4) == -1));
if ((_local6 is UIComponent)){
(_local6 as UIComponent).drawNow();
};
_local4++;
};
}
public function get iconFunction():Function{
return (_iconFunction);
}
public function set iconField(_arg1:String):void{
if (_arg1 == _iconField){
return;
};
_iconField = _arg1;
invalidate(InvalidationType.DATA);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.SPACE:
if (caretIndex == -1){
caretIndex = 0;
};
doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey);
scrollToSelected();
break;
default:
_local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex);
if (_local2 > -1){
selectedIndex = _local2;
scrollToSelected();
};
break;
};
_arg1.stopPropagation();
}
override public function itemToLabel(_arg1:Object):String{
if (_labelFunction != null){
return (String(_labelFunction(_arg1)));
};
return (((_arg1[_labelField])!=null) ? String(_arg1[_labelField]) : "");
}
public function get labelField():String{
return (_labelField);
}
override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1);
_local5 = -1;
_local6 = 0;
switch (_arg1){
case Keyboard.UP:
if (caretIndex > 0){
_local5 = (caretIndex - 1);
};
break;
case Keyboard.DOWN:
if (caretIndex < (length - 1)){
_local5 = (caretIndex + 1);
};
break;
case Keyboard.PAGE_UP:
if (caretIndex > 0){
_local5 = Math.max((caretIndex - _local4), 0);
};
break;
case Keyboard.PAGE_DOWN:
if (caretIndex < (length - 1)){
_local5 = Math.min((caretIndex + _local4), (length - 1));
};
break;
case Keyboard.HOME:
if (caretIndex > 0){
_local5 = 0;
};
break;
case Keyboard.END:
if (caretIndex < (length - 1)){
_local5 = (length - 1);
};
break;
};
if (_local5 >= 0){
doKeySelection(_local5, _arg2, _arg3);
scrollToSelected();
};
}
public function set labelField(_arg1:String):void{
if (_arg1 == _labelField){
return;
};
_labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowCount(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0;
height = (((rowHeight * _arg1) + (2 * _local2)) + _local3);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
list.x = -(_arg1);
super.setHorizontalScrollPosition(_arg1, true);
}
public function set iconFunction(_arg1:Function):void{
if (_iconFunction == _arg1){
return;
};
_iconFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function get labelFunction():Function{
return (_labelFunction);
}
override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
invalidate(InvalidationType.SCROLL);
super.setVerticalScrollPosition(_arg1, true);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0));
}
override protected function draw():void{
var _local1:Boolean;
_local1 = !((contentHeight == (rowHeight * length)));
contentHeight = (rowHeight * length);
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
if (_cellRenderer != getStyleValue("cellRenderer")){
_invalidateList();
_cellRenderer = getStyleValue("cellRenderer");
};
};
if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){
drawLayout();
};
if (isInvalid(InvalidationType.RENDERER_STYLES)){
updateRendererStyles();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){
drawList();
};
updateChildren();
validate();
}
override protected function configUI():void{
useFixedHorizontalScrolling = true;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
super.configUI();
}
override public function get rowCount():uint{
return (Math.ceil((calculateAvailableHeight() / rowHeight)));
}
override protected function initializeAccessibility():void{
if (List.createAccessibilityImplementation != null){
List.createAccessibilityImplementation(this);
};
}
override public function scrollToIndex(_arg1:int):void{
var _local2:uint;
var _local3:uint;
drawNow();
_local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1);
_local3 = Math.ceil((_verticalScrollPosition / rowHeight));
if (_arg1 < _local3){
verticalScrollPosition = (_arg1 * rowHeight);
} else {
if (_arg1 > _local2){
verticalScrollPosition = (((_arg1 + 1) * rowHeight) - availableHeight);
};
};
}
public function get rowHeight():Number{
return (_rowHeight);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowHeight(_arg1:Number):void{
_rowHeight = _arg1;
invalidate(InvalidationType.SIZE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition()));
}
}
}//package fl.controls
Section 12
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 13
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 14
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 15
//SelectableList (fl.controls.SelectableList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import flash.ui.*;
import fl.containers.*;
public class SelectableList extends BaseScrollPane implements IFocusManagerComponent {
protected var invalidItems:Dictionary;
protected var renderedItems:Dictionary;
protected var listHolder:Sprite;
protected var _allowMultipleSelection:Boolean;// = false
protected var lastCaretIndex:int;// = -1
protected var _selectedIndices:Array;
protected var availableCellRenderers:Array;
protected var list:Sprite;
protected var caretIndex:int;// = -1
protected var updatedRendererStyles:Object;
protected var preChangeItems:Array;
protected var activeCellRenderers:Array;
protected var rendererStyles:Object;
protected var _verticalScrollPosition:Number;
protected var _dataProvider:DataProvider;
protected var _horizontalScrollPosition:Number;
private var collectionItemImport:SimpleCollectionItem;
protected var _selectable:Boolean;// = true
private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null};
public static var createAccessibilityImplementation:Function;
public function SelectableList(){
_allowMultipleSelection = false;
_selectable = true;
caretIndex = -1;
lastCaretIndex = -1;
super();
activeCellRenderers = [];
availableCellRenderers = [];
invalidItems = new Dictionary(true);
renderedItems = new Dictionary(true);
_selectedIndices = [];
if (dataProvider == null){
dataProvider = new DataProvider();
};
verticalScrollPolicy = ScrollPolicy.AUTO;
rendererStyles = {};
updatedRendererStyles = {};
}
protected function drawList():void{
}
public function set allowMultipleSelection(_arg1:Boolean):void{
if (_arg1 == _allowMultipleSelection){
return;
};
_allowMultipleSelection = _arg1;
if (((!(_arg1)) && ((_selectedIndices.length > 1)))){
_selectedIndices = [_selectedIndices.pop()];
invalidate(InvalidationType.DATA);
};
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (_dataProvider.sortOn(_arg1, _arg2));
}
public function removeItemAt(_arg1:uint):Object{
return (_dataProvider.removeItemAt(_arg1));
}
public function get selectedItem():Object{
return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
};
}
public function get selectable():Boolean{
return (_selectable);
}
public function itemToCellRenderer(_arg1:Object):ICellRenderer{
var _local2:*;
var _local3:ICellRenderer;
if (_arg1 != null){
for (_local2 in activeCellRenderers) {
_local3 = (activeCellRenderers[_local2] as ICellRenderer);
if (_local3.data == _arg1){
return (_local3);
};
};
};
return (null);
}
public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:String;
if (length == 0){
return (-1);
};
_arg1 = _arg1.toUpperCase();
_local3 = (length - 1);
_local4 = 0;
while (_local4 < _local3) {
_local5 = ((_arg2 + 1) + _local4);
if (_local5 > (length - 1)){
_local5 = (_local5 - length);
};
_local6 = getItemAt(_local5);
if (_local6 == null){
break;
};
_local7 = itemToLabel(_local6);
if (_local7 == null){
} else {
if (_local7.charAt(0).toUpperCase() == _arg1){
return (_local5);
};
};
_local4++;
};
return (-1);
}
public function invalidateList():void{
_invalidateList();
invalidate(InvalidationType.DATA);
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
list.mouseChildren = _enabled;
}
public function get selectedIndices():Array{
return (_selectedIndices.concat());
}
public function set selectable(_arg1:Boolean):void{
if (_arg1 == _selectable){
return;
};
if (!_arg1){
selectedIndices = [];
};
_selectable = _arg1;
}
public function itemToLabel(_arg1:Object):String{
return (_arg1["label"]);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
_dataProvider.addItemAt(_arg1, _arg2);
invalidateList();
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (_dataProvider.replaceItemAt(_arg1, _arg2));
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:uint;
_local2 = _arg1.startIndex;
_local3 = _arg1.endIndex;
_local4 = _arg1.changeType;
if (_local4 == DataChangeType.INVALIDATE_ALL){
clearSelection();
invalidateList();
} else {
if (_local4 == DataChangeType.INVALIDATE){
_local5 = 0;
while (_local5 < _arg1.items.length) {
invalidateItem(_arg1.items[_local5]);
_local5++;
};
} else {
if (_local4 == DataChangeType.ADD){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
_selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3));
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
if (_selectedIndices[_local5] <= _local3){
delete _selectedIndices[_local5];
} else {
_selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1));
};
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE_ALL){
clearSelection();
} else {
if (_local4 == DataChangeType.REPLACE){
} else {
selectedItems = preChangeItems;
preChangeItems = null;
};
};
};
};
};
};
invalidate(InvalidationType.DATA);
}
protected function _invalidateList():void{
availableCellRenderers = [];
while (activeCellRenderers.length > 0) {
list.removeChild((activeCellRenderers.pop() as DisplayObject));
};
}
protected function updateRendererStyles():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:String;
_local1 = availableCellRenderers.concat(activeCellRenderers);
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
if (_local1[_local3].setStyle == null){
} else {
for (_local4 in updatedRendererStyles) {
_local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]);
};
_local1[_local3].drawNow();
};
_local3++;
};
updatedRendererStyles = {};
}
public function set selectedItem(_arg1:Object):void{
var _local2:int;
_local2 = _dataProvider.getItemIndex(_arg1);
selectedIndex = _local2;
}
public function sortItems(... _args){
return (_dataProvider.sort.apply(_dataProvider, _args));
}
public function removeAll():void{
_dataProvider.removeAll();
}
protected function handleCellRendererChange(_arg1:Event):void{
var _local2:ICellRenderer;
var _local3:uint;
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
_dataProvider.invalidateItemAt(_local3);
}
protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _horizontalScrollPosition){
return;
};
_local3 = (_arg1 - _horizontalScrollPosition);
_horizontalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1));
};
}
public function scrollToSelected():void{
scrollToIndex(selectedIndex);
}
public function invalidateItem(_arg1:Object):void{
if (renderedItems[_arg1] == null){
return;
};
invalidItems[_arg1] = true;
invalidate(InvalidationType.DATA);
}
protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){
return;
};
_local4 = selectedIndices.indexOf(_local3);
if (!_allowMultipleSelection){
if (_local4 != -1){
return;
};
_local2.selected = true;
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
} else {
if (_arg1.shiftKey){
_local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3;
_selectedIndices = [];
if (_local6 > _local3){
_local5 = _local6;
while (_local5 >= _local3) {
_selectedIndices.push(_local5);
_local5--;
};
} else {
_local5 = _local6;
while (_local5 <= _local3) {
_selectedIndices.push(_local5);
_local5++;
};
};
caretIndex = _local3;
} else {
if (_arg1.ctrlKey){
if (_local4 != -1){
_local2.selected = false;
_selectedIndices.splice(_local4, 1);
} else {
_local2.selected = true;
_selectedIndices.push(_local3);
};
caretIndex = _local3;
} else {
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
};
};
};
dispatchEvent(new Event(Event.CHANGE));
invalidate(InvalidationType.DATA);
}
public function get length():uint{
return (_dataProvider.length);
}
public function get allowMultipleSelection():Boolean{
return (_allowMultipleSelection);
}
protected function onPreChange(_arg1:DataChangeEvent):void{
switch (_arg1.changeType){
case DataChangeType.REMOVE:
case DataChangeType.ADD:
case DataChangeType.INVALIDATE:
case DataChangeType.REMOVE_ALL:
case DataChangeType.REPLACE:
case DataChangeType.INVALIDATE_ALL:
break;
default:
preChangeItems = selectedItems;
break;
};
}
public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{
return (rendererStyles[_arg1]);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _verticalScrollPosition){
return;
};
_local3 = (_arg1 - _verticalScrollPosition);
_verticalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1));
};
}
protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function set selectedIndices(_arg1:Array):void{
if (!_selectable){
return;
};
_selectedIndices = ((_arg1)==null) ? [] : _arg1.concat();
invalidate(InvalidationType.SELECTED);
}
public function get selectedIndex():int{
return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]);
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
super.configUI();
listHolder = new Sprite();
addChild(listHolder);
listHolder.scrollRect = contentScrollRect;
list = new Sprite();
listHolder.addChild(list);
}
public function addItem(_arg1:Object):void{
_dataProvider.addItem(_arg1);
invalidateList();
}
protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:String;
_local2 = (_arg1.target as ICellRenderer);
_local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT;
dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data));
}
public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{
delete rendererStyles[_arg1];
updatedRendererStyles[_arg1] = null;
invalidate(InvalidationType.RENDERER_STYLES);
}
protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data));
}
public function get rowCount():uint{
return (0);
}
public function isItemSelected(_arg1:Object):Boolean{
return ((selectedItems.indexOf(_arg1) > -1));
}
public function set dataProvider(_arg1:DataProvider):void{
if (_dataProvider != null){
_dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange);
_dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange);
};
_dataProvider = _arg1;
_dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
_dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true);
clearSelection();
invalidateList();
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
listHolder.scrollRect = contentScrollRect;
}
public function getItemAt(_arg1:uint):Object{
return (_dataProvider.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (SelectableList.createAccessibilityImplementation != null){
SelectableList.createAccessibilityImplementation(this);
};
}
public function scrollToIndex(_arg1:int):void{
}
public function removeItem(_arg1:Object):Object{
return (_dataProvider.removeItem(_arg1));
}
public function get dataProvider():DataProvider{
return (_dataProvider);
}
public function set maxHorizontalScrollPosition(_arg1:Number):void{
_maxHorizontalScrollPosition = _arg1;
invalidate(InvalidationType.SIZE);
}
public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{
if (rendererStyles[_arg1] == _arg2){
return;
};
updatedRendererStyles[_arg1] = _arg2;
rendererStyles[_arg1] = _arg2;
invalidate(InvalidationType.RENDERER_STYLES);
}
public function invalidateItemAt(_arg1:uint):void{
var _local2:Object;
_local2 = _dataProvider.getItemAt(_arg1);
if (_local2 != null){
invalidateItem(_local2);
};
}
public function set selectedItems(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:int;
if (_arg1 == null){
selectedIndices = null;
return;
};
_local2 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _dataProvider.getItemIndex(_arg1[_local3]);
if (_local4 != -1){
_local2.push(_local4);
};
_local3++;
};
selectedIndices = _local2;
}
public function clearSelection():void{
selectedIndex = -1;
}
override public function get maxHorizontalScrollPosition():Number{
return (_maxHorizontalScrollPosition);
}
public function get selectedItems():Array{
var _local1:Array;
var _local2:uint;
_local1 = [];
_local2 = 0;
while (_local2 < _selectedIndices.length) {
_local1.push(_dataProvider.getItemAt(_selectedIndices[_local2]));
_local2++;
};
return (_local1);
}
public function set selectedIndex(_arg1:int):void{
selectedIndices = ((_arg1)==-1) ? null : [_arg1];
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.controls
Section 16
//TextInput (fl.controls.TextInput)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
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();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 17
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 18
//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 19
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 20
//DataProvider (fl.data.DataProvider)
package fl.data {
import flash.events.*;
import fl.events.*;
public class DataProvider extends EventDispatcher {
protected var data:Array;
public function DataProvider(_arg1:Object=null){
if (_arg1 == null){
data = [];
} else {
data = getDataFromObject(_arg1);
};
}
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
public function invalidateItemAt(_arg1:int):void{
checkIndex(_arg1, (data.length - 1));
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1);
}
public function getItemIndex(_arg1:Object):int{
return (data.indexOf(_arg1));
}
protected function getDataFromObject(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:XMLList;
var _local10:XML;
var _local11:XMLList;
var _local12:XML;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array);
if (_local3.length > 0){
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){
_local2 = [];
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = {label:String(_local3[_local4]), data:_local3[_local4]};
_local2.push(_local5);
_local4++;
};
return (_local2);
};
};
return (_arg1.concat());
//unresolved jump
};
if ((_arg1 is DataProvider)){
return (_arg1.toArray());
};
if ((_arg1 is XML)){
_local6 = (_arg1 as XML);
_local2 = [];
_local7 = _local6.*;
for each (_local8 in _local7) {
_arg1 = {};
_local9 = _local8.attributes();
for each (_local10 in _local9) {
_arg1[_local10.localName()] = _local10.toString();
};
_local11 = _local8.*;
for each (_local12 in _local11) {
if (_local12.hasSimpleContent()){
_arg1[_local12.localName()] = _local12.toString();
};
};
_local2.push(_arg1);
};
return (_local2);
//unresolved jump
};
throw (new TypeError((("Error: Type Coercion failed: cannot convert " + _arg1) + " to Array or DataProvider.")));
}
public function removeItemAt(_arg1:uint):Object{
var _local2:Array;
checkIndex(_arg1, (data.length - 1));
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1);
_local2 = data.splice(_arg1, 1);
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1);
return (_local2[0]);
}
public function addItem(_arg1:Object):void{
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
data.push(_arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
}
public function sortOn(_arg1:Object, _arg2:Object=null){
var _local3:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local3 = data.sortOn(_arg1, _arg2);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local3);
}
public function sort(... _args){
var _local2:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local2 = data.sort.apply(data, _args);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local2);
}
public function addItems(_arg1:Object):void{
addItemsAt(_arg1, data.length);
}
public function concat(_arg1:Object):void{
addItems(_arg1);
}
public function clone():DataProvider{
return (new DataProvider(data));
}
public function toArray():Array{
return (data.concat());
}
public function get length():uint{
return (data.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
checkIndex(_arg2, data.length);
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
data.splice(_arg2, 0, _arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
}
public function getItemAt(_arg1:uint):Object{
checkIndex(_arg1, (data.length - 1));
return (data[_arg1]);
}
override public function toString():String{
return ((("DataProvider [" + data.join(" , ")) + "]"));
}
public function invalidateItem(_arg1:Object):void{
var _local2:uint;
_local2 = getItemIndex(_arg1);
if (_local2 == -1){
return;
};
invalidateItemAt(_local2);
}
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
protected function checkIndex(_arg1:int, _arg2:int):void{
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")")));
};
}
public function addItemsAt(_arg1:Object, _arg2:uint):void{
var _local3:Array;
checkIndex(_arg2, data.length);
_local3 = getDataFromObject(_arg1);
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
data.splice.apply(data, [_arg2, 0].concat(_local3));
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
}
public function replaceItem(_arg1:Object, _arg2:Object):Object{
var _local3:int;
_local3 = getItemIndex(_arg2);
if (_local3 != -1){
return (replaceItemAt(_arg1, _local3));
};
return (null);
}
public function removeItem(_arg1:Object):Object{
var _local2:int;
_local2 = getItemIndex(_arg1);
if (_local2 != -1){
return (removeItemAt(_local2));
};
return (null);
}
public function merge(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Object;
_local2 = getDataFromObject(_arg1);
_local3 = _local2.length;
_local4 = data.length;
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
_local5 = 0;
while (_local5 < _local3) {
_local6 = _local2[_local5];
if (getItemIndex(_local6) == -1){
data.push(_local6);
};
_local5++;
};
if (data.length > _local4){
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
} else {
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1);
};
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
var _local3:Array;
checkIndex(_arg2, (data.length - 1));
_local3 = [data[_arg2]];
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
data[_arg2] = _arg1;
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
return (_local3[0]);
}
public function invalidate():void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length));
}
public function removeAll():void{
var _local1:Array;
_local1 = data.concat();
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
data = [];
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
}
}
}//package fl.data
Section 21
//SimpleCollectionItem (fl.data.SimpleCollectionItem)
package fl.data {
public dynamic class SimpleCollectionItem {
public var label:String;
public var data:String;
public function toString():String{
return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]"));
}
}
}//package fl.data
Section 22
//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 23
//DataChangeEvent (fl.events.DataChangeEvent)
package fl.events {
import flash.events.*;
public class DataChangeEvent extends Event {
protected var _items:Array;
protected var _endIndex:uint;
protected var _changeType:String;
protected var _startIndex:uint;
public static const PRE_DATA_CHANGE:String = "preDataChange";
public static const DATA_CHANGE:String = "dataChange";
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
super(_arg1);
_changeType = _arg2;
_startIndex = _arg4;
_items = _arg3;
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5;
}
public function get changeType():String{
return (_changeType);
}
public function get startIndex():uint{
return (_startIndex);
}
public function get items():Array{
return (_items);
}
override public function clone():Event{
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex));
}
override public function toString():String{
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable"));
}
public function get endIndex():uint{
return (_endIndex);
}
}
}//package fl.events
Section 24
//DataChangeType (fl.events.DataChangeType)
package fl.events {
public class DataChangeType {
public static const ADD:String = "add";
public static const REMOVE:String = "remove";
public static const REMOVE_ALL:String = "removeAll";
public static const CHANGE:String = "change";
public static const REPLACE:String = "replace";
public static const INVALIDATE:String = "invalidate";
public static const INVALIDATE_ALL:String = "invalidateAll";
public static const SORT:String = "sort";
}
}//package fl.events
Section 25
//ListEvent (fl.events.ListEvent)
package fl.events {
import flash.events.*;
public class ListEvent extends Event {
protected var _index:int;
protected var _item:Object;
protected var _columnIndex:int;
protected var _rowIndex:int;
public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick";
public static const ITEM_ROLL_OUT:String = "itemRollOut";
public static const ITEM_ROLL_OVER:String = "itemRollOver";
public static const ITEM_CLICK:String = "itemClick";
public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){
super(_arg1, _arg2, _arg3);
_rowIndex = _arg5;
_columnIndex = _arg4;
_index = _arg6;
_item = _arg7;
}
public function get rowIndex():Object{
return (_rowIndex);
}
public function get index():int{
return (_index);
}
public function get item():Object{
return (_item);
}
public function get columnIndex():int{
return (_columnIndex);
}
override public function clone():Event{
return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex));
}
override public function toString():String{
return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item"));
}
}
}//package fl.events
Section 26
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 27
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
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 28
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 29
//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 30
//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 31
//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 32
//BasicLetter (typeit_classes.BasicLetter)
package typeit_classes {
import flash.display.*;
public class BasicLetter extends Sprite {
public var codeValue:uint;
public var letterValue:String;
public function BasicLetter(_arg1:String, _arg2:uint){
letterValue = _arg1;
codeValue = _arg2;
}
}
}//package typeit_classes
Section 33
//Challenge (typeit_classes.Challenge)
package typeit_classes {
public class Challenge {
public var cUnlocked:Boolean;
public var cDescription:String;
public var cName:String;
public function Challenge(_arg1:String, _arg2:String){
cName = _arg1;
cDescription = _arg2;
cUnlocked = false;
}
}
}//package typeit_classes
Section 34
//HighlightButton (typeit_classes.HighlightButton)
package typeit_classes {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class HighlightButton extends MovieClip {
public var txtName:TextField;
public var hitBox:MovieClip;
private var rootRef:MovieClip;
public var modeType:String;
public var gameMode:String;
public function HighlightButton(){
rootRef = MovieClip(root);
buttonMode = true;
mouseChildren = false;
hitArea = hitBox;
hitBox.visible = false;
txtName.textColor = 0;
txtName.text = name.substr(7).toUpperCase().replace("_", " ");
addEventListener(MouseEvent.ROLL_OVER, btnMouseOver);
addEventListener(MouseEvent.ROLL_OUT, btnMouseOut);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
private function btnMouseOver(_arg1:MouseEvent):void{
txtName.textColor = 0x990000;
if (name.substr(3, 4) == "Mode"){
rootRef.menu_gfx.videoScreen.gotoAndStop(gameMode);
rootRef.menu_gfx.videoScreen.txtDescription.text = rootRef.gameDescriptions[gameMode];
} else {
if (name.substr(3, 4) == "Type"){
rootRef.menu_gfx.videoScreen.gotoAndStop(modeType);
rootRef.menu_gfx.videoScreen.txtDescription.text = rootRef.gameDescriptions[modeType];
};
};
}
private function removed(_arg1:Event):void{
removeEventListener(MouseEvent.ROLL_OUT, btnMouseOut);
rootRef = null;
}
private function btnMouseOut(_arg1:MouseEvent):void{
rootRef.menu_gfx.videoScreen.txtDescription.text = "Roll over an option for the description!";
rootRef.menu_gfx.videoScreen.gotoAndStop("empty");
txtName.textColor = 0;
}
}
}//package typeit_classes
Section 35
//Letter (typeit_classes.Letter)
package typeit_classes {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Letter extends BasicLetter {
public var tempY:Number;
private var bounced:Boolean;// = false
public var tempX;
public var frameHandler:String;// = ""
public var spinSpeed:Number;// = 0
private var gameWidth:Number;
private var halfHeight:Number;
public var txtLetterValue:TextField;
private var spinDirection:int;
public var color:uint;
private var halfWidth:Number;
public var verticalSpeed;
public var horizontalSpeed:Number;
private var gameHeight:Number;
private var _root:MovieClip;
private var moveSpeed:Number;
public function Letter(_arg1:String, _arg2:uint, _arg3:Number=550, _arg4:Number=400){
spinSpeed = 0;
bounced = false;
frameHandler = "";
super(_arg1, _arg2);
txtLetterValue.text = letterValue;
gameHeight = _arg4;
gameWidth = _arg3;
verticalSpeed = (horizontalSpeed = 0);
spinSpeed = 0;
}
public function type_classic_main(_arg1:Event):void{
tempX = (tempX + horizontalSpeed);
rotation = (rotation + (spinDirection * spinSpeed));
if ((((((horizontalSpeed > 0)) && ((tempX > (gameWidth + halfWidth))))) || ((((horizontalSpeed < 0)) && ((tempX < -(halfWidth))))))){
if (color != 0xFF0000){
_root.inflictPain(10);
};
freeze();
removeFromGame();
};
x = tempX;
}
public function setColor(_arg1:uint):void{
color = _arg1;
txtLetterValue.textColor = _arg1;
}
public function type_singularity_main(_arg1:Event):void{
tempX = (tempX + horizontalSpeed);
tempY = (tempY + verticalSpeed);
if ((((((((tempX > (gameWidth + halfWidth))) || ((tempX < -(halfWidth))))) || ((tempY < -(halfHeight))))) || ((tempY > (gameHeight + halfHeight))))){
if (color != 0xFF0000){
_root.inflictPain(10);
};
freeze();
removeFromGame();
};
x = tempX;
y = tempY;
}
public function type_float_init():void{
_root = MovieClip(root);
verticalSpeed = ((Math.random() * 1) + 0.5);
tempX = x;
tempY = y;
halfWidth = (width / 2);
halfHeight = (height / 2);
frameHandler = "type_float_main";
addEventListener(Event.ENTER_FRAME, this[frameHandler]);
}
public function removeFromGame():void{
parent.removeChild(this);
}
public function bgScrollMove():void{
rotation = (rotation + spinSpeed);
x = (x + moveSpeed);
}
public function type_classic_init():void{
_root = MovieClip(root);
spinDirection = 1;
horizontalSpeed = ((Math.random() * 3) + 3);
if (x > 0){
horizontalSpeed = -(horizontalSpeed);
spinDirection = -(spinDirection);
};
tempX = x;
halfWidth = (width / 2);
halfHeight = (height / 2);
frameHandler = "type_classic_main";
addEventListener(Event.ENTER_FRAME, this[frameHandler]);
}
public function type_singularity_init(_arg1, _arg2):void{
_root = MovieClip(root);
horizontalSpeed = _arg1;
verticalSpeed = _arg2;
tempX = x;
tempY = y;
halfWidth = (width / 2);
halfHeight = (height / 2);
frameHandler = "type_singularity_main";
addEventListener(Event.ENTER_FRAME, this[frameHandler]);
}
public function freeze():void{
if (frameHandler != ""){
removeEventListener(Event.ENTER_FRAME, this[frameHandler]);
};
}
public function type_bounce_main(_arg1:Event):void{
tempY = (tempY + verticalSpeed);
tempX = (tempX + horizontalSpeed);
verticalSpeed = (verticalSpeed + 0.2);
if (!bounced){
if ((tempY + halfHeight) > (gameHeight - 35)){
bounced = true;
tempY = (gameHeight - 35);
verticalSpeed = -((verticalSpeed * 0.8));
};
} else {
rotation = (rotation + spinSpeed);
};
if ((tempX - halfWidth) < 0){
tempX = (halfWidth + 2);
horizontalSpeed = -(horizontalSpeed);
spinSpeed = -(spinSpeed);
} else {
if ((tempX + halfWidth) > gameWidth){
tempX = ((gameWidth - halfWidth) - 2);
horizontalSpeed = -(horizontalSpeed);
spinSpeed = -(spinSpeed);
};
};
if (tempY > (gameHeight + 20)){
if (color != 0xFF0000){
_root.inflictPain(10);
};
freeze();
removeFromGame();
};
y = tempY;
x = tempX;
}
public function bgScrollInit():void{
alpha = ((Math.random() * 0.5) + 0.25);
rotation = (rotation + (Math.random() * 360));
scaleY = (scaleX = ((Math.random() * 1.5) + 0.5));
spinSpeed = ((Math.random() * 4) + 1);
moveSpeed = ((Math.random() * 3) + 1);
}
public function bgLinearMove(_arg1:Event):void{
tempX = (tempX + horizontalSpeed);
tempY = (tempY + verticalSpeed);
if (((((tempX - (width / 2)) < 0)) || (((tempX + (width / 2)) > gameWidth)))){
tempX = (tempX - horizontalSpeed);
horizontalSpeed = -(horizontalSpeed);
};
if (((((tempY - (height / 2)) < 0)) || (((tempY + (height / 2)) > gameHeight)))){
tempY = (tempY - verticalSpeed);
verticalSpeed = -(verticalSpeed);
};
x = tempX;
y = tempY;
}
public function type_float_main(_arg1:Event):void{
tempY = (tempY - verticalSpeed);
tempX = (tempX + horizontalSpeed);
verticalSpeed = (verticalSpeed + 0.08);
if ((tempX - halfWidth) < 0){
tempX = (halfWidth + 2);
horizontalSpeed = -(horizontalSpeed);
} else {
if ((tempX + halfWidth) > gameWidth){
tempX = ((gameWidth - halfWidth) - 2);
horizontalSpeed = -(horizontalSpeed);
};
};
if (tempY < -20){
if (color != 0xFF0000){
_root.inflictPain(10);
};
freeze();
removeFromGame();
};
y = tempY;
x = tempX;
}
public function type_bounce_init():void{
_root = MovieClip(root);
verticalSpeed = 1.5;
tempX = x;
tempY = y;
halfWidth = (width / 2);
halfHeight = (height / 2);
frameHandler = "type_bounce_main";
addEventListener(Event.ENTER_FRAME, this[frameHandler]);
}
public function bgLinearInit(_arg1:Number, _arg2:Number):void{
gameHeight = _arg1;
gameWidth = _arg2;
spinSpeed = ((Math.random() * 4) + 1);
if (Math.random() > 0.5){
spinDirection = 1;
} else {
spinDirection = -1;
};
if (Math.random() > 0.5){
horizontalSpeed = (5 * ((Math.random() > 0.5)) ? 1 : -1);
verticalSpeed = 0;
} else {
verticalSpeed = (5 * ((Math.random() > 0.5)) ? -1 : 1);
horizontalSpeed = 0;
};
tempX = x;
tempY = y;
addEventListener(Event.ENTER_FRAME, bgLinearMove);
}
}
}//package typeit_classes
Section 36
//LetterString (typeit_classes.LetterString)
package typeit_classes {
import flash.display.*;
public class LetterString extends MovieClip {
public function LetterString(){
var _local1:Number;
super();
_local1 = Math.ceil((Math.random() * totalFrames));
gotoAndPlay(_local1);
}
}
}//package typeit_classes
Section 37
//Particle (typeit_classes.Particle)
package typeit_classes {
import flash.display.*;
import flash.events.*;
public class Particle extends Sprite {
private var tempX;
private var tempY:Number;
private var gameWidth:Number;
private var gravity:Number;// = 1
public var verticalSpeed:Number;
public var horizontalSpeed;
private var gameHeight:Number;
private var bounced:Boolean;// = false
public function Particle(_arg1:Number=550, _arg2:Number=400){
gravity = 1;
bounced = false;
super();
gameHeight = _arg2;
gameWidth = _arg1;
}
private function explode_main(_arg1:Event):void{
tempX = (tempX + horizontalSpeed);
tempY = (tempY + verticalSpeed);
verticalSpeed = (verticalSpeed + gravity);
if (!bounced){
if (tempY > (gameHeight - 26)){
bounced = true;
tempY = (gameHeight - 26);
verticalSpeed = -((verticalSpeed / 2));
};
};
if (tempX < 0){
tempX = 1;
horizontalSpeed = -(horizontalSpeed);
} else {
if (tempX > gameWidth){
tempX = (gameWidth - 1);
horizontalSpeed = -(horizontalSpeed);
};
};
if (tempY > (gameHeight + 10)){
freeze();
removeFromGame();
};
x = tempX;
y = tempY;
}
public function removeFromGame():void{
parent.removeChild(this);
}
public function freeze():void{
removeEventListener(Event.ENTER_FRAME, explode_main);
}
public function explode_init(_arg1:String):void{
tempX = x;
tempY = y;
if (_arg1 == "TYPE_CLASSIC"){
if (horizontalSpeed < 0){
horizontalSpeed = (horizontalSpeed - (Math.random() * 2));
} else {
horizontalSpeed = (horizontalSpeed + (Math.random() * 2));
};
} else {
horizontalSpeed = ((Math.random() * 3) + 1);
if (Math.random() > 0.5){
horizontalSpeed = -(horizontalSpeed);
};
};
verticalSpeed = ((Math.random() * -7) - 3);
addEventListener(Event.ENTER_FRAME, explode_main);
}
}
}//package typeit_classes
Section 38
//ScreenFX (typeit_classes.ScreenFX)
package typeit_classes {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class ScreenFX extends Sprite {
private var FXTarget:MovieClip;
var totalMs:Number;
private var segmentAry:Array;
private var screenData:BitmapData;
private var segmentHeight:uint;
var endTime:Number;
var numTransitions:int;
private var segmentWidth:uint;
var startTime:Number;
private var i:uint;
private var nullElements:uint;
private var screenBitmap:Bitmap;
private var stageReference:Stage;
private var transitionSpeed:Number;
private var shrinkAmt:uint;
public function ScreenFX(_arg1:Stage, _arg2:DisplayObjectContainer){
stageReference = _arg1;
FXTarget = MovieClip(_arg2);
numTransitions = 0;
totalMs = 0;
}
private function fadeTransitionProcess(_arg1:Event):void{
screenBitmap.alpha = (screenBitmap.alpha - transitionSpeed);
if (screenBitmap.alpha <= 0){
destroyBitmap(screenBitmap);
removeEventListener(Event.ENTER_FRAME, fadeTransitionProcess);
};
}
private function blindsTransitionProcess(_arg1:Event):void{
var _local2:Bitmap;
i = 0;
while (i < segmentAry.length) {
_local2 = segmentAry[i];
if (_local2.width > shrinkAmt){
_local2.width = (_local2.width - shrinkAmt);
_local2.x = (_local2.x + (shrinkAmt / 2));
} else {
destroyBitmap(_local2);
segmentAry.splice(i, 1);
i--;
};
i++;
};
if (segmentAry.length == 0){
segmentAry = null;
removeEventListener(Event.ENTER_FRAME, blindsTransitionProcess);
};
}
public function captureScreen():void{
cleanupExistingTransitions();
screenData = new BitmapData(stageReference.stageWidth, stageReference.stageHeight);
screenData.draw(FXTarget);
screenBitmap = new Bitmap(screenData);
}
public function exploreFXTarget(_arg1:String=""):void{
trace(("CURRENT LISTING: " + _arg1));
i = 0;
while (i < FXTarget.numChildren) {
i++;
};
trace("\n");
}
private function doTransitionBenchmark(_arg1:Event):void{
startTime = getTimer();
blindsTransition(8, 4);
endTime = (getTimer() - startTime);
trace((("Time elapsed: " + endTime) + "ms"));
totalMs = (totalMs + endTime);
numTransitions++;
trace((("Avg time: " + (totalMs / numTransitions)) + "ms\n"));
}
private function FXTargetNavigate(_arg1, _arg2):void{
if (_arg1 != ""){
if (_arg2 != ""){
FXTarget.gotoAndStop(_arg1, _arg2);
} else {
FXTarget.gotoAndStop(_arg1);
};
};
}
public function blindsTransition(_arg1:uint=5, _arg2:uint=4, _arg3:String="", _arg4:String=""):void{
var _local5:uint;
var _local6:BitmapData;
var _local7:Bitmap;
shrinkAmt = _arg2;
segmentWidth = (stageReference.stageWidth / _arg1);
segmentHeight = stageReference.stageHeight;
segmentAry = new Array();
_local5 = 0;
while (_local5 < _arg1) {
_local6 = new BitmapData(segmentWidth, segmentHeight);
_local6.copyPixels(screenData, new Rectangle((segmentWidth * _local5), 0, segmentWidth, segmentHeight), new Point(0, 0));
_local7 = new Bitmap(_local6);
segmentAry.push(_local7);
_local7.x = (segmentWidth * _local5);
_local7.y = 0;
FXTarget.addChild(_local7);
_local5++;
};
screenData.dispose();
addEventListener(Event.ENTER_FRAME, blindsTransitionProcess);
}
private function destroyBitmap(_arg1:Bitmap):void{
FXTarget.removeChild(_arg1);
_arg1.bitmapData.dispose();
_arg1.bitmapData = null;
_arg1 = null;
}
private function cleanupExistingTransitions():void{
var _local1:Bitmap;
removeEventListener(Event.ENTER_FRAME, fadeTransitionProcess);
removeEventListener(Event.ENTER_FRAME, blindsTransitionProcess);
if (((!((screenBitmap == null))) && (FXTarget.contains(screenBitmap)))){
destroyBitmap(screenBitmap);
};
for each (_local1 in segmentAry) {
destroyBitmap(_local1);
};
segmentAry = null;
}
public function fadeTransition(_arg1:Number=0.02, _arg2:String="", _arg3:String=""):void{
transitionSpeed = _arg1;
FXTarget.addChild(screenBitmap);
addEventListener(Event.ENTER_FRAME, fadeTransitionProcess);
}
}
}//package typeit_classes
Section 39
//ad_switcher_1 (TYPEITII_fla.ad_switcher_1)
package TYPEITII_fla {
import flash.display.*;
public dynamic class ad_switcher_1 extends MovieClip {
public var AD_OBJECT:MovieClip;
public function ad_switcher_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 40
//ANI_afro_wig_15 (TYPEITII_fla.ANI_afro_wig_15)
package TYPEITII_fla {
import flash.display.*;
public dynamic class ANI_afro_wig_15 extends MovieClip {
public function ANI_afro_wig_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 41
//ANI_ah_face_12 (TYPEITII_fla.ANI_ah_face_12)
package TYPEITII_fla {
import flash.display.*;
public dynamic class ANI_ah_face_12 extends MovieClip {
public function ANI_ah_face_12(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package TYPEITII_fla
Section 42
//clear_data_clip_90 (TYPEITII_fla.clear_data_clip_90)
package TYPEITII_fla {
import flash.display.*;
public dynamic class clear_data_clip_90 extends MovieClip {
public var btnNo:MovieClip;
public var btnYeah:MovieClip;
public function clear_data_clip_90(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 43
//endclip_138 (TYPEITII_fla.endclip_138)
package TYPEITII_fla {
import flash.display.*;
import flash.text.*;
public dynamic class endclip_138 extends MovieClip {
public var highScoreAlert:MovieClip;
public var txtResults:TextField;
public var btnRetry:MovieClip;
public var btnMenu:MovieClip;
public var medalClip:MovieClip;
}
}//package TYPEITII_fla
Section 44
//HUD_134 (TYPEITII_fla.HUD_134)
package TYPEITII_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_134 extends MovieClip {
public var txtScore:TextField;
public var btnANLink:MovieClip;
public var life_switch_container:MovieClip;
public var txtLife:TextField;
}
}//package TYPEITII_fla
Section 45
//identifyobjects_145 (TYPEITII_fla.identifyobjects_145)
package TYPEITII_fla {
import flash.display.*;
public dynamic class identifyobjects_145 extends MovieClip {
public function identifyobjects_145(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 46
//life_switch_137 (TYPEITII_fla.life_switch_137)
package TYPEITII_fla {
import flash.display.*;
public dynamic class life_switch_137 extends MovieClip {
public function life_switch_137(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 47
//life_switch_container_136 (TYPEITII_fla.life_switch_container_136)
package TYPEITII_fla {
import flash.display.*;
public dynamic class life_switch_container_136 extends MovieClip {
public var life_switch:MovieClip;
public function life_switch_container_136(){
addFrameScript(0, frame1, 14, frame15, 28, frame29);
}
function frame15(){
gotoAndStop("normal");
}
function frame1(){
stop();
}
function frame29(){
gotoAndStop("normal");
}
}
}//package TYPEITII_fla
Section 48
//lockflash_123 (TYPEITII_fla.lockflash_123)
package TYPEITII_fla {
import flash.display.*;
public dynamic class lockflash_123 extends MovieClip {
public function lockflash_123(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 49
//MainTimeline (TYPEITII_fla.MainTimeline)
package TYPEITII_fla {
import flash.display.*;
import flash.events.*;
import typeit_classes.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const TYPE_CLASSIC:String = "classic";
public const MODE_QUICK_DRAW:String = "quick_draw";
public const MODE_CHALLENGE:String = "challenge";
public const MODE_SCROLL:String = "scroll";
public const TYPE_FLOAT:String = "float";
public const MODE_WORDS:String = "words";
public const TYPE_SINGLE:String = "single";
public const TYPE_RANDOM:String = "random";
public const TYPE_SECTIONS:String = "sections";
public const TYPE_FORWARDS:String = "forwards";
public const TYPE_BACKWARDS:String = "backwards";
public const GAME_HEIGHT:uint = 400;
public const TYPE_TARGET:String = "target";
public const TYPE_IDENTIFY:String = "identify";
public const TYPE_ARRGEEBEE:String = "arrgeebee";
public const TYPE_BOUNCE:String = "bounce";
public const GAME_WIDTH:uint = 550;
public const TYPE_SINGULARITY:String = "singularity";
public var showAd:Boolean;
public var colorAry:Array;
public var myScreenFX:ScreenFX;
public var gameTimer1:Timer;
public var quick_drawFilterAry:Array;
public var gameTimer2:Timer;
public var targetLetterCodeValue:uint;
public var letterSymbolAry:Array;
public var colorLoopAry:Array;
public var particleList:Array;
public var myIdentifyClip:identifyClip;
public var gameSymbolsTyped:uint;
public var letterAry:Array;
public var highScores:Object;
public var identifyType:String;
public var numberSymbolAry:Array;
public var i:uint;
public var bigNodeGroup:MovieClip;
public var sponsorTargets:Object;
public var menu_gfx:MovieClip;
public var goldScores:Object;
public var gameLetterContainer:Sprite;
public var totalSymbolsTyped:uint;
public var gameMode:String;
public var singularityOriginX:Number;
public var singularityOriginY:Number;
public var medalAwarded:uint;
public var words5Letters:Array;
public var inPreloader:Boolean;
public var gameOptionsDefaults:Array;
public var HUD:MovieClip;
public var btnPreloadPlay:MovieClip;
public var medalCollection:Object;
public var gameCodeAry:Array;
public var myColorClip:colorClip;
public var mySO:SharedObject;
public var gameDescriptions:Array;
public var gameTimeLimit:Number;
public var gameAry:Array;
public var countdownClip:MovieClip;
public var myMenu:ContextMenu;
public var singularityRadians:Number;
public var identifyOriginX:Number;
public var singularitySpeed:Number;
public var sponsorTarget:String;
public var maxLettersOnScreen:uint;
public var btnBack:MovieClip;
public var numCompleted:uint;
public var desiredColorIndex:uint;
public var platinumScores:Object;
public var bgScrollWidth;
public var allWords:Array;
public var sponsorClip:MovieClip;
public var silverScores:Object;
public var nodeGroup:MovieClip;
public var words6Letters:Array;
public var challengeModeUnlocked:Boolean;
public var scrollTypes:Array;
public var gameScore:int;
public var quick_drawTypes;
public var challengeTypes;
public var btnMusicToggle:MovieClip;
public var remainingTime:Number;
public var letterList:Array;
public var scoresheet:MovieClip;
public var gameLife:int;
public var buzzerObj:buzzer;
public var mainLoopChannel:SoundChannel;
public var gameOptions:Array;
public var startTime:Number;
public var myIdentifyCursor:identifyCursor;
public var musicPlaying:Boolean;
public var bronzeScores:Object;
public var numberAry:Array;
public var identifyStartX:Number;
public var identifyStartY:Number;
public var elapsedTime:Number;
public var wordLength:uint;
public var identifyLettersOnScreen:uint;
public var punctuationAry:Array;
public var gameParticleContainer:Sprite;
public var endClip:MovieClip;
public var singularityXSpeed:Number;
public var gameSponsor:String;
public var targetModeAry:Array;
public var letterContainer:Sprite;
public var words3Letters:Array;
public var item:ContextMenuItem;
public var word:String;
public var btnBack2:MovieClip;
public var targetNode:uint;
public var bgScrollHeight;
public var colorAssociations:Object;
public var wordsTyped:uint;
public var wordsTypes;
public var numTotal:uint;
public var btnCopyrightLink:MovieClip;
public var quick_drawFilter:GlowFilter;
public var ad_switcher:MovieClip;
public var item2:ContextMenuItem;
public var audioLoaded:Boolean;
public var modeType:String;
public var singularityYSpeed:Number;
public var challengeList:Array;
public var possibleScore:int;
public var identifyColor:uint;
public var wordString:String;
public var mainLoopObj:mainLoop;
public var challengesCompleted:Array;
public var genericbutton:MovieClip;
public var words4Letters:Array;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 141, frame142, 143, frame144, 144, frame145, 145, frame146, 146, frame147, 147, frame148, 148, frame149);
}
public function pressBtnPreloadPlay(_arg1:MouseEvent):void{
if (showAd){
removeChild(ad_switcher);
};
myScreenFX.captureScreen();
gotoAndPlay(1, "Sponsor");
myScreenFX.fadeTransition(0.03);
inPreloader = false;
}
public function menuBtnMouseOut(_arg1:MouseEvent):void{
_arg1.target.strip.gotoAndStop(1);
}
public function createLetterBG():void{
var _local1:uint;
destroyLetterBG();
letterContainer = new Sprite();
letterContainer.x = 0;
letterContainer.y = 0;
addChildAt(letterContainer, 0);
letterList = new Array();
_local1 = 0;
while (_local1 < 26) {
addBgLetter("anywhere");
_local1++;
};
letterContainer.addEventListener(Event.ENTER_FRAME, manageLetters);
}
public function rollOverChallengeIcon(_arg1:MouseEvent):void{
var _local2:uint;
var _local3:String;
_local2 = _arg1.target.name.substr(5);
_local3 = (("<b>" + challengeList[_local2].cName) + "</b>\n");
_local3 = (_local3 + (("<i>" + challengeList[_local2].cDescription) + "</i>"));
menu_gfx.txtChallengeDescription.htmlText = _local3;
}
public function placeLetter(_arg1:String="random", _arg2:Number=0, _arg3:Number=0, _arg4:Number=1, _arg5:uint=0):Letter{
var _local6:Letter;
if (_arg1 == "random"){
_local6 = chooseUniqueLetter();
} else {
_local6 = new Letter(_arg1, findKeyCode(_arg1), GAME_WIDTH, GAME_HEIGHT);
};
_local6.x = _arg2;
_local6.y = _arg3;
_local6.scaleX = (_local6.scaleY = (_local6.scaleX = (_local6.scaleX * _arg4)));
_local6.setColor(_arg5);
letterList.push(_local6);
gameLetterContainer.addChild(_local6);
return (_local6);
}
public function wordsHighlightLetter():void{
if (modeType == TYPE_FORWARDS){
targetNode = 0;
} else {
if (modeType == TYPE_BACKWARDS){
targetNode = (letterList.length - 1);
} else {
if (modeType == TYPE_RANDOM){
targetNode = Math.floor((Math.random() * letterList.length));
};
};
};
letterList[targetNode].alpha = 1;
targetLetterCodeValue = letterList[targetNode].codeValue;
}
public function pressBtnMenu(_arg1:MouseEvent):void{
exitGame();
}
public function type_forwards_init():void{
words_init();
}
public function type_forwards_cleanup():void{
words_cleanup();
}
public function type_identify_freeze():void{
removeEventListener(Event.ENTER_FRAME, type_identify_main);
}
public function cleanupScreen():void{
var _local1 = this;
_local1[(("type_" + modeType) + "_cleanup")]();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkPostGameKeys);
cleanupLetters();
i = 0;
while (i < particleList.length) {
particleList[i].removeEventListener(Event.REMOVED, removeFromParticleList);
particleList[i].removeFromGame();
particleList.splice(i, 1);
i--;
i++;
};
removeChild(gameLetterContainer);
gameLetterContainer = null;
removeChild(gameParticleContainer);
gameParticleContainer = null;
endClip.removeEventListener(Event.ENTER_FRAME, fadeIn);
removeChild(endClip);
endClip = null;
letterList = null;
particleList = null;
}
public function checkForUnlockedChallenges():String{
var _local1:String;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:String;
var _local8:uint;
var _local9:uint;
_local1 = "";
_local5 = 0;
_local6 = 0;
for (_local7 in medalCollection) {
_local9 = medalCollection[_local7];
if (_local9 == 1){
_local2++;
} else {
if (_local9 == 2){
_local2++;
_local3++;
} else {
if (_local9 == 3){
_local2++;
_local3++;
_local4++;
} else {
if (_local9 == 4){
_local2++;
_local3++;
_local4++;
_local5++;
};
};
};
};
_local6++;
};
if (!challengeList[0].cUnlocked){
if (_local6 > 0){
challengeList[0].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[0].cName) + ","));
};
};
if (!challengeList[1].cUnlocked){
if (_local4 > 0){
challengeList[1].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[1].cName) + ","));
};
};
if (!challengeList[2].cUnlocked){
if (_local5 > 0){
challengeList[2].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[2].cName) + ","));
};
};
if (!challengeList[3].cUnlocked){
if (_local2 == 12){
challengeList[3].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[3].cName) + ","));
};
};
if (!challengeList[4].cUnlocked){
if (_local3 == 12){
challengeList[4].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[4].cName) + ","));
};
};
if (!challengeList[5].cUnlocked){
if (_local4 == 12){
challengeList[5].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[5].cName) + ","));
};
};
if (!challengeList[6].cUnlocked){
if (_local5 == 12){
challengeList[6].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[6].cName) + ","));
};
};
if (!challengeList[7].cUnlocked){
if (challengeModeUnlocked){
challengeList[7].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[7].cName) + ","));
};
};
if (!challengeList[8].cUnlocked){
if (_local6 == 12){
challengeList[8].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[8].cName) + ","));
};
};
if (!challengeList[9].cUnlocked){
if ((((gameOptions[2] == 1)) && ((medalAwarded >= 3)))){
if (((((((!((modeType == TYPE_FORWARDS))) && (!((modeType == TYPE_BACKWARDS))))) && (!((modeType == TYPE_RANDOM))))) && (!((modeType == TYPE_IDENTIFY))))){
challengeList[9].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[9].cName) + ","));
};
};
};
if (!challengeList[10].cUnlocked){
if ((((gameOptions[3] == 1)) && ((medalAwarded >= 3)))){
if (((((((!((modeType == TYPE_FORWARDS))) && (!((modeType == TYPE_BACKWARDS))))) && (!((modeType == TYPE_RANDOM))))) && (!((modeType == TYPE_IDENTIFY))))){
challengeList[10].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[10].cName) + ","));
};
};
};
if (!challengeList[11].cUnlocked){
if (totalSymbolsTyped > 1500){
challengeList[11].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[11].cName) + ","));
};
};
if (!challengeList[12].cUnlocked){
if (totalSymbolsTyped > 3000){
challengeList[12].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[12].cName) + ","));
};
};
if (!challengeList[13].cUnlocked){
if (totalSymbolsTyped > 5000){
challengeList[13].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[13].cName) + ","));
};
};
_local8 = calculateCareerScore();
if (!challengeList[14].cUnlocked){
if (_local8 > 50000){
challengeList[14].cUnlocked = true;
_local1 = (_local1 + ((" " + challengeList[14].cName) + ","));
};
};
if (_local1.length > 0){
_local1 = _local1.substring(0, (_local1.length - 1));
};
return (_local1);
}
public function type_single_keyPress(_arg1:uint):void{
var _local2:Letter;
_local2 = findLetterByCode(_arg1);
if (_local2 == null){
timePenalty(1);
} else {
updateScore(35);
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
_local2.removeFromGame();
quick_drawPlaceLetter();
};
}
public function identifyCheckAnswer():void{
var _local1:Boolean;
var _local2:Letter;
var _local3:String;
_local1 = false;
_local3 = "";
for each (_local2 in letterList) {
_local3 = (_local3 + _local2.letterValue);
};
_local3 = _local3.toLowerCase();
if (identifyType == "Name?"){
if (_local3 == myIdentifyClip.objects.currentLabel){
_local1 = true;
};
} else {
if (identifyType == "Color?"){
if (((!((colorAssociations[_local3] == null))) && ((colorAssociations[_local3] == identifyColor)))){
_local1 = true;
};
};
};
if (_local1){
updateScore(100);
gameSymbolsTyped = (gameSymbolsTyped + letterList.length);
identifyLettersOnScreen = 0;
identifyStartX = identifyOriginX;
myIdentifyCursor.x = identifyStartX;
for each (_local2 in letterList) {
particleExplosion(_local2.x, _local2.y, 0, 0);
};
cleanupLetters();
if (identifyType == "Name?"){
identifyType = "Color?";
} else {
identifyType = "Name?";
};
identifyChooseObject();
};
}
public function type_sections_init():void{
gameTimeLimit = 60;
startTime = (getTimer() / 1000);
nodeGroup = new NodeGroup();
nodeGroup.x = (GAME_WIDTH / 2);
nodeGroup.y = (GAME_HEIGHT / 2);
nodeGroup.visible = false;
addChild(nodeGroup);
addEventListener(Event.ENTER_FRAME, type_sections_main);
quick_drawPlaceLetterGroup();
}
function frame1(){
stop();
wordString = <![CDATA[
able
about
account
acid
across
act
addition
adjustment
advertisement
after
again
against
agreement
air
all
almost
among
amount
amusement
and
angle
angry
animal
answer
ant
any
apparatus
apple
approval
arch
argument
arm
army
art
as
at
attack
attempt
attention
attraction
authority
automatic
awake
baby
back
bad
bag
balance
ball
band
base
basin
basket
bath
be
beautiful
because
bed
bee
before
behaviour
belief
bell
bent
berry
between
bird
birth
bit
bite
bitter
black
blade
blood
blow
blue
board
boat
body
boiling
bone
book
boot
bottle
box
boy
brain
brake
branch
brass
bread
breath
brick
bridge
bright
broken
brother
brown
brush
bucket
building
bulb
burn
burst
business
but
butter
button
by
cake
camera
canvas
card
care
carriage
cart
cat
cause
certain
chain
chalk
chance
change
cheap
cheese
chemical
chest
chief
chin
church
circle
clean
clear
clock
cloth
cloud
coal
coat
cold
collar
color
comb
come
comfort
committee
common
company
comparison
competition
complete
complex
condition
connection
conscious
control
cook
copper
copy
cord
cork
cotton
cough
country
cover
cow
crack
credit
crime
cruel
crush
cry
cup
cup
current
curtain
curve
cushion
damage
danger
dark
daughter
day
dead
dear
death
debt
decision
deep
degree
delicate
dependent
design
desire
destruction
detail
development
different
digestion
direction
dirty
discovery
discussion
disease
disgust
distance
distribution
division
do
dog
door
doubt
down
drain
drawer
dress
drink
driving
drop
dry
dust
ear
early
earth
east
edge
education
effect
egg
elastic
electric
end
engine
enough
equal
error
even
event
ever
every
example
exchange
existence
expansion
experience
expert
eye
face
fact
fall
false
family
far
farm
fat
father
fear
feather
feeble
feeling
female
fertile
fiction
field
fight
finger
fire
first
fish
fixed
flag
flame
flat
flight
floor
flower
fly
fold
food
foolish
foot
for
force
fork
form
forward
fowl
frame
free
frequent
friend
from
front
fruit
full
future
garden
general
get
girl
give
glass
glove
go
goat
gold
good
government
grain
grass
great
green
grey
grip
group
growth
guide
gun
hair
hammer
hand
hanging
happy
harbor
hard
harmony
hat
hate
have
he
head
healthy
hear
hearing
heart
heat
help
high
history
hole
hollow
hook
hope
horn
horse
hospital
hour
house
how
humor
I
ice
idea
if
ill
important
impulse
in
increase
industry
ink
insect
instrument
insurance
interest
invention
iron
island
jelly
jewel
join
journey
judge
jump
keep
kettle
key
kick
kind
kiss
knee
knife
knot
knowledge
land
language
last
late
laugh
law
lead
leaf
learning
leather
left
leg
let
letter
level
library
lift
light
like
limit
line
linen
lip
liquid
list
little
living
lock
long
look
loose
loss
loud
love
low
machine
make
male
man
manager
map
mark
market
married
mass
match
material
may
meal
measure
meat
medical
meeting
memory
metal
middle
military
milk
mind
mine
minute
mist
mixed
money
monkey
month
moon
morning
mother
motion
mountain
mouth
move
much
muscle
music
nail
name
narrow
nation
natural
near
necessary
neck
need
needle
nerve
net
new
news
night
no
noise
normal
north
nose
not
note
now
number
nut
observation
of
off
offer
office
oil
old
on
only
open
operation
opinion
opposite
or
orange
order
organization
ornament
other
out
oven
over
owner
page
pain
paint
paper
parallel
parcel
part
past
paste
payment
peace
pen
pencil
person
physical
picture
pig
pin
pipe
place
plane
plant
plate
play
please
pleasure
plough
pocket
point
poison
polish
political
poor
porter
position
possible
pot
potato
powder
power
present
price
print
prison
private
probable
process
produce
profit
property
prose
protest
public
pull
pump
punishment
purpose
push
put
quality
question
quick
quiet
quite
rail
rain
range
rat
rate
ray
reaction
reading
ready
reason
receipt
record
red
regret
regular
relation
religion
representative
request
respect
responsible
rest
reward
rhythm
rice
right
ring
river
road
rod
roll
roof
room
root
rough
round
rub
rule
run
sad
safe
sail
salt
same
sand
say
scale
school
science
scissors
screw
sea
seat
second
secret
secretary
see
seed
seem
selection
self
send
sense
separate
serious
servant
sex
shade
shake
shame
sharp
sheep
shelf
ship
shirt
shock
shoe
short
shut
side
sign
silk
silver
simple
sister
size
skin
skirt
sky
sleep
slip
slope
slow
small
smash
smell
smile
smoke
smooth
snake
sneeze
snow
so
soap
society
sock
soft
solid
some
son
song
sort
sound
soup
south
space
spade
special
sponge
spoon
spring
square
stage
stamp
star
start
statement
station
steam
steel
stem
step
stick
sticky
stiff
still
stitch
stocking
stomach
stone
stop
store
story
straight
strange
street
stretch
strong
structure
substance
such
sudden
sugar
suggestion
summer
sun
support
surprise
sweet
swim
system
table
tail
take
talk
tall
taste
tax
teaching
tendency
test
than
that
the
then
theory
there
thick
thin
thing
this
thought
thread
throat
through
thumb
thunder
ticket
tight
till
time
tin
tired
to
toe
together
tomorrow
tongue
tooth
top
touch
town
trade
train
transport
tray
tree
trick
trouble
trousers
true
turn
twist
umbrella
under
unit
up
use
value
verse
very
vessel
view
violent
voice
waiting
walk
wall
war
warm
wash
waste
watch
water
wave
wax
way
weather
week
weight
well
west
wet
wheel
when
where
while
whip
whistle
white
who
why
wide
will
wind
window
wine
wing
winter
wire
wise
with
woman
wood
wool
word
work
worm
wound
writing
wrong
year
yellow
yes
yesterday
you
young
]]>
.toString();
allWords = wordString.split("\r\n");
allWords.splice(0, 1);
allWords.splice((allWords.length - 1), 1);
words3Letters = new Array();
words4Letters = new Array();
words5Letters = new Array();
words6Letters = new Array();
for each (word in allWords) {
if ((((word.length > 2)) && ((word.length < 7)))){
MovieClip(root)[(("words" + word.length) + "Letters")].push(word);
};
};
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(4584);
showAd = true;
if (showAd){
ad_switcher.nextFrame();
};
gameSponsor = "newgrounds";
sponsorTargets = new Object();
sponsorTargets.afro = "http://afro-ninja.com";
sponsorTargets.newgrounds = "http://newgrounds.com";
sponsorTargets.addictinggames = "http://addictinggames.com";
sponsorTarget = sponsorTargets[gameSponsor];
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
item = new ContextMenuItem("Afro-Ninja Productions!");
myMenu.customItems.push(item);
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuHandler1);
item2 = new ContextMenuItem("Toggle Music");
item2.separatorBefore = true;
myMenu.customItems.push(item2);
item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuHandler2);
contextMenu = myMenu;
myScreenFX = new ScreenFX(stage, this);
gameMode = "";
modeType = "";
challengeModeUnlocked = false;
challengesCompleted = new Array();
gameScore = 0;
gameLife = 0;
gameTimeLimit = 0;
quick_drawFilter = new GlowFilter(0x990000, 1, 5, 5, 3, 2);
quick_drawFilterAry = new Array();
quick_drawFilterAry.push(quick_drawFilter);
singularityRadians = 0;
totalSymbolsTyped = 0;
gameSymbolsTyped = 0;
wordsTyped = 0;
scrollTypes = new Array(TYPE_CLASSIC, TYPE_FLOAT, TYPE_BOUNCE);
quick_drawTypes = new Array(TYPE_SINGLE, TYPE_SECTIONS, TYPE_TARGET);
wordsTypes = new Array(TYPE_FORWARDS, TYPE_BACKWARDS, TYPE_RANDOM);
challengeTypes = new Array(TYPE_SINGULARITY, TYPE_ARRGEEBEE, TYPE_IDENTIFY);
gameDescriptions = new Array();
gameDescriptions[MODE_SCROLL] = "Type the letters before they leave the screen! Green letters replenish life, red ones take it.";
gameDescriptions[MODE_QUICK_DRAW] = "Type the letters as soon as they appear! 1 min time limit. Missing letters results in a time penalty.";
gameDescriptions[MODE_WORDS] = "Type out complete words! 1.5 min time limit. Wrong letters result in a time penalty";
gameDescriptions[MODE_CHALLENGE] = "Play harder versions of the previous modes! [beat all types in all modes to unlock]";
gameDescriptions[TYPE_CLASSIC] = "Letters scroll from left to right.";
gameDescriptions[TYPE_FLOAT] = "Letters float up from the bottom.";
gameDescriptions[TYPE_BOUNCE] = "Letters fall from the top and bounce down.";
gameDescriptions[TYPE_SINGLE] = "One letter appears at a time.";
gameDescriptions[TYPE_SECTIONS] = "Letters appear in groups, choose your own order.";
gameDescriptions[TYPE_TARGET] = "Letters fill the screen, but you can only type the one highlighted.";
gameDescriptions[TYPE_FORWARDS] = "Spell the word from left to right.";
gameDescriptions[TYPE_BACKWARDS] = "Spell the word from right to left.";
gameDescriptions[TYPE_RANDOM] = "Spell the word randomly.";
gameDescriptions[TYPE_SINGULARITY] = "Letters move from the center outward in a spiral. 'Scroll' rules apply.";
gameDescriptions[TYPE_ARRGEEBEE] = "Type the letter of the correct color, alternating between red, green, and blue. 'Quick Draw' rules apply";
gameDescriptions[TYPE_IDENTIFY] = "Type the name OR color of the object on screen. You may backspace. 'Words' rules apply";
highScores = new Object();
bronzeScores = new Object();
silverScores = new Object();
goldScores = new Object();
platinumScores = new Object();
bronzeScores[TYPE_CLASSIC] = 1000;
bronzeScores[TYPE_FLOAT] = 1000;
bronzeScores[TYPE_BOUNCE] = 1000;
bronzeScores[TYPE_SINGLE] = 1000;
bronzeScores[TYPE_SECTIONS] = 3000;
bronzeScores[TYPE_TARGET] = 1000;
bronzeScores[TYPE_FORWARDS] = 3000;
bronzeScores[TYPE_BACKWARDS] = 2000;
bronzeScores[TYPE_RANDOM] = 1500;
bronzeScores[TYPE_SINGULARITY] = 1800;
bronzeScores[TYPE_ARRGEEBEE] = 1000;
bronzeScores[TYPE_IDENTIFY] = 3000;
silverScores[TYPE_CLASSIC] = 2000;
silverScores[TYPE_FLOAT] = 2000;
silverScores[TYPE_BOUNCE] = 2000;
silverScores[TYPE_SINGLE] = 2000;
silverScores[TYPE_SECTIONS] = 4000;
silverScores[TYPE_TARGET] = 1900;
silverScores[TYPE_FORWARDS] = 5500;
silverScores[TYPE_BACKWARDS] = 3500;
silverScores[TYPE_RANDOM] = 2000;
silverScores[TYPE_SINGULARITY] = 2500;
silverScores[TYPE_ARRGEEBEE] = 1500;
silverScores[TYPE_IDENTIFY] = 4000;
goldScores[TYPE_CLASSIC] = 3000;
goldScores[TYPE_FLOAT] = 3000;
goldScores[TYPE_BOUNCE] = 2700;
goldScores[TYPE_SINGLE] = 2800;
goldScores[TYPE_SECTIONS] = 5000;
goldScores[TYPE_TARGET] = 2400;
goldScores[TYPE_FORWARDS] = 7100;
goldScores[TYPE_BACKWARDS] = 4700;
goldScores[TYPE_RANDOM] = 3000;
goldScores[TYPE_SINGULARITY] = 3500;
goldScores[TYPE_ARRGEEBEE] = 2000;
goldScores[TYPE_IDENTIFY] = 5100;
platinumScores[TYPE_CLASSIC] = 3600;
platinumScores[TYPE_FLOAT] = 3700;
platinumScores[TYPE_BOUNCE] = 3100;
platinumScores[TYPE_SINGLE] = 3200;
platinumScores[TYPE_SECTIONS] = 6300;
platinumScores[TYPE_TARGET] = 2900;
platinumScores[TYPE_FORWARDS] = 8000;
platinumScores[TYPE_BACKWARDS] = 6200;
platinumScores[TYPE_RANDOM] = 3500;
platinumScores[TYPE_SINGULARITY] = 4600;
platinumScores[TYPE_ARRGEEBEE] = 2500;
platinumScores[TYPE_IDENTIFY] = 5800;
medalCollection = new Object();
medalAwarded = 0;
colorAry = new Array(0xFF0000, 0xFF00, 0xFF, 0xFFFF00, 0);
colorLoopAry = new Array(0xFF0000, 0xFF00, 0xFF);
colorAssociations = new Object();
colorAssociations.red = 0xFF0000;
colorAssociations.green = 0xFF00;
colorAssociations.blue = 0xFF;
colorAssociations.yellow = 0xFFFF00;
colorAssociations.black = 0;
gameCodeAry = new Array();
gameAry = new Array();
letterAry = new Array();
numberAry = new Array();
punctuationAry = new Array();
letterSymbolAry = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
i = 65;
while (i <= 90) {
gameCodeAry[i] = letterSymbolAry[(i - 65)];
letterAry.push(new BasicLetter(gameCodeAry[i], i));
i++;
};
numberSymbolAry = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
i = 48;
while (i <= 57) {
gameCodeAry[i] = numberSymbolAry[(i - 48)];
numberAry.push(new BasicLetter(gameCodeAry[i], i));
i++;
};
gameCodeAry[188] = ",";
gameCodeAry[190] = ".";
gameCodeAry[186] = ";";
gameCodeAry[191] = "/";
punctuationAry.push(new BasicLetter(gameCodeAry[188], 188));
punctuationAry.push(new BasicLetter(gameCodeAry[190], 190));
punctuationAry.push(new BasicLetter(gameCodeAry[186], 186));
punctuationAry.push(new BasicLetter(gameCodeAry[191], 191));
gameOptions = new Array();
gameOptionsDefaults = new Array();
gameOptionsDefaults[0] = 1;
gameOptionsDefaults[1] = 3;
gameOptionsDefaults[2] = 2;
gameOptionsDefaults[3] = 2;
gameOptionsDefaults[4] = 1;
gameOptions = gameOptionsDefaults.concat();
buildGameAry();
applyQuality();
maxLettersOnScreen = 26;
bgScrollWidth = stage.stageWidth;
bgScrollHeight = stage.stageHeight;
audioLoaded = false;
musicPlaying = false;
buzzerObj = new buzzer();
challengeList = new Array();
challengeList.push(new Challenge("Medalist", "Earn a medal"));
challengeList.push(new Challenge("Going Pro", "Earn a gold medal"));
challengeList.push(new Challenge("Making a Name for Yourself", "Earn a platinum medal"));
challengeList.push(new Challenge("TYPE IT Novice", "Earn bronze medals in all mode types"));
challengeList.push(new Challenge("TYPE IT Regular", "Earn silver medals in all mode types"));
challengeList.push(new Challenge("TYPE IT Pro", "Earn gold medals in all mode types"));
challengeList.push(new Challenge("Dammit, Mike", "Earn platinum medals in all mode types"));
challengeList.push(new Challenge("New Challenger", "Unlock challenge mode"));
challengeList.push(new Challenge("Well Traveled", "Earn medals in all game types"));
challengeList.push(new Challenge("Mathematician", "Win a gold medal with numbers turned on (options menu)"));
challengeList.push(new Challenge("Punctual", "Win a gold medal with basic punctuation turned on (options menu)"));
challengeList.push(new Challenge("Stiff Joints", "Type 1,500 total symbols (options menu > view scores)"));
challengeList.push(new Challenge("Arthritis", "Type 3,000 total symbols (options menu > view scores)"));
challengeList.push(new Challenge("Missing Fingers", "Type 5,000 total symbols (options menu > view scores)"));
challengeList.push(new Challenge("TYPE IT Legend", "Achieve a career score of 50,000 or greater (options menu > view scores)"));
mySO = SharedObject.getLocal("TYPEITII");
if (mySO.size > 0){
try {
loadGame();
} catch(e:Error) {
mySO.clear();
};
};
inPreloader = true;
addEventListener(Event.ENTER_FRAME, checkLoad);
btnCopyrightLink.buttonMode = true;
btnCopyrightLink.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnCopyrightLink);
}
function frame2(){
btnPreloadPlay.buttonMode = true;
btnPreloadPlay.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnPreloadPlay);
}
public function pressBtnChallenges(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("challenges");
}
function frame3(){
sponsorClip.gotoAndStop(gameSponsor);
genericbutton.buttonMode = true;
genericbutton.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnSponsor);
}
public function pressBtnClearData(_arg1:MouseEvent):void{
menu_gfx.clearDataClip.visible = true;
}
public function pressBtnDefaults(_arg1:MouseEvent):void{
gameOptions[1] = 3;
applyQuality();
menu_gfx.cmbMusic.selectedIndex = 0;
menu_gfx.cmbQuality.selectedIndex = 2;
menu_gfx.cmbPenalty.selectedIndex = 0;
menu_gfx.chkNumbers.selected = false;
menu_gfx.chkPunctuation.selected = false;
}
public function addBgLetter(_arg1:String):void{
var _local2:*;
_local2 = chooseUniqueLetter();
_local2.bgScrollInit();
if (_arg1 == "left"){
_local2.x = (0 - (_local2.width / 2));
_local2.y = (Math.random() * bgScrollHeight);
} else {
if (_arg1 == "anywhere"){
_local2.x = (Math.random() * bgScrollWidth);
_local2.y = (Math.random() * bgScrollHeight);
};
};
letterList.push(_local2);
letterContainer.addChild(_local2);
}
public function type_backwards_cleanup():void{
words_cleanup();
}
public function pressBtnBack1(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
destroyLetterBG();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("main");
}
public function pressBtnBack2(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
destroyLetterBG2();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("play");
}
public function pressBtnBack3(_arg1:MouseEvent):void{
saveOptions();
myScreenFX.captureScreen();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("main");
}
public function pressBtnBack4(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("main");
}
public function type_classic_keyPress(_arg1:uint):void{
scrollKeyPress(_arg1);
}
public function singleSpin(_arg1:Event):void{
_arg1.target.rotation = (_arg1.target.rotation + 2);
}
public function type_backwards_keyPress(_arg1:uint):void{
wordsKeyPress(_arg1);
}
public function type_target_freeze():void{
removeEventListener(Event.ENTER_FRAME, type_target_main);
}
public function fadeIn(_arg1:Event):void{
_arg1.target.alpha = (_arg1.target.alpha + 0.05);
if (_arg1.target.alpha >= 1){
_arg1.target.removeEventListener(Event.ENTER_FRAME, fadeIn);
};
}
public function type_sections_main(_arg1:Event):void{
updateTimer();
}
public function words_init():void{
gameTimeLimit = 90;
wordLength = 3;
wordsTyped = 0;
startTime = (getTimer() / 1000);
wordsLoadWord();
wordsHighlightLetter();
addEventListener(Event.ENTER_FRAME, words_main);
}
public function scrollAdjustSpeed():void{
if (gameScore > 4000){
gameTimer1.delay = 200;
} else {
if (gameScore > 4000){
gameTimer1.delay = 225;
} else {
if (gameScore > 3500){
gameTimer1.delay = 250;
} else {
if (gameScore > 3000){
gameTimer1.delay = 275;
} else {
if (gameScore > 2600){
gameTimer1.delay = 300;
} else {
if (gameScore > 2200){
gameTimer1.delay = 325;
} else {
if (gameScore > 1900){
gameTimer1.delay = 350;
} else {
if (gameScore > 1600){
gameTimer1.delay = 375;
} else {
if (gameScore > 1300){
gameTimer1.delay = 400;
} else {
if (gameScore > 1000){
gameTimer1.delay = 500;
} else {
if (gameScore > 800){
gameTimer1.delay = 600;
} else {
if (gameScore > 600){
gameTimer1.delay = 700;
} else {
if (gameScore > 400){
gameTimer1.delay = 800;
} else {
if (gameScore > 300){
gameTimer1.delay = 900;
} else {
if (gameScore > 250){
gameTimer1.delay = 1000;
} else {
if (gameScore > 200){
gameTimer1.delay = 1100;
} else {
if (gameScore > 150){
gameTimer1.delay = 1200;
} else {
if (gameScore > 75){
gameTimer1.delay = 1300;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function words_freeze():void{
removeEventListener(Event.ENTER_FRAME, words_main);
}
public function findKeyCode(_arg1:String):uint{
var _local2:BasicLetter;
for each (_local2 in gameAry) {
if (_local2.letterValue == _arg1){
return (_local2.codeValue);
};
};
return (0);
}
public function type_classic_cleanup():void{
}
public function timePenalty(_arg1:int):void{
gameTimeLimit = (gameTimeLimit - _arg1);
HUD.life_switch_container.gotoAndPlay("red");
if (gameOptions[4] == 1){
buzzerObj.play();
};
}
public function pressBtnMusicToggle(_arg1:MouseEvent):void{
musicToggle();
}
public function destroyLetterBG():void{
var _local1:Letter;
if (letterContainer != null){
letterContainer.removeEventListener(Event.ENTER_FRAME, manageLetters);
for each (_local1 in letterList) {
letterContainer.removeChild(_local1);
_local1 = null;
};
letterList = null;
removeChild(letterContainer);
letterContainer = null;
};
}
public function createLetterBG2():void{
var _local1:Letter;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:*;
var _local16:uint;
var _local17:*;
destroyLetterBG2();
letterContainer = new Sprite();
letterContainer.x = 0;
letterContainer.y = 0;
addChildAt(letterContainer, 0);
_local1 = new Letter("TEST", 0);
_local1.scaleX = (_local1.scaleX * 1.75);
_local1.scaleY = (_local1.scaleY * 1.75);
_local1.x = (_local1.width / 2);
_local1.y = (_local1.height / 2);
_local2 = _local1.width;
_local3 = _local1.height;
_local4 = (bgScrollWidth / _local1.width);
_local5 = (_local2 * _local4);
_local6 = (bgScrollWidth - _local5);
_local7 = (_local6 / 2);
_local8 = (_local7 + (_local2 / 2));
_local9 = _local8;
_local10 = (bgScrollHeight / _local3);
_local11 = (_local10 * _local3);
_local12 = (bgScrollHeight - _local11);
_local13 = (_local12 / 2);
_local14 = (_local13 + (_local3 / 2));
_local1 = null;
letterList = new Array();
_local15 = 0;
while (_local15 < _local10) {
_local16 = 0;
while (_local16 < _local4) {
_local17 = chooseUniqueLetter();
chooseUniqueLetter().scaleX = (_local17.scaleX * 1.75);
_local17.scaleY = (_local17.scaleY * 1.75);
_local17.x = _local8;
_local17.y = _local14;
_local17.alpha = 0.05;
_local17.name = ((_local15 + "_") + _local16);
_local8 = (_local8 + _local2);
_local17.bgLinearInit(bgScrollHeight, bgScrollWidth);
letterList.push(_local17);
letterContainer.addChild(_local17);
_local16++;
};
_local14 = (_local14 + _local3);
_local8 = _local9;
_local15++;
};
}
public function type_target_keyPress(_arg1:uint):void{
var _local2:Letter;
_local2 = findLetterByCode(_arg1);
if (_local2 == null){
timePenalty(1);
} else {
if (_local2.filters.length > 0){
updateScore(35);
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
_local2.removeFromGame();
quick_drawChooseTarget();
quick_drawPlaceLetter(_local2.x, _local2.y);
} else {
timePenalty(1);
};
};
}
public function performColorTransform(_arg1, _arg2:uint):void{
var _local3:*;
var _local4:*;
var _local5:uint;
var _local6:ColorTransform;
_local5 = 0;
if (_arg2 == 0xFF0000){
_local3 = 0xFF;
} else {
if (_arg2 == 0xFF00){
_local5 = 0xFF;
} else {
if (_arg2 == 0xFF){
_local4 = 0xFF;
} else {
if (_arg2 == 0xFFFF00){
_local5 = 0xFF;
_local3 = _local5;
};
};
};
};
_local6 = new ColorTransform(1, 1, 1, 1, _local3, _local5, _local4);
_arg1.transform.colorTransform = _local6;
}
public function loadMusicToggle():void{
btnMusicToggle.visible = true;
btnMusicToggle.gotoAndStop(((gameOptions[0] == 1)) ? "on" : "off");
btnMusicToggle.buttonMode = true;
btnMusicToggle.mouseChildren = false;
btnMusicToggle.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnMusicToggle);
if ((((gameOptions[0] == 1)) && (!(musicPlaying)))){
musicPlaying = true;
mainLoopChannel = mainLoopObj.play(0, 999);
};
}
public function type_arrgeebee_cleanup():void{
removeChild(myColorClip);
}
public function type_arrgeebee_freeze():void{
removeEventListener(Event.ENTER_FRAME, type_arrgeebee_main);
}
public function type_single_init():void{
gameTimeLimit = 60;
startTime = (getTimer() / 1000);
addEventListener(Event.ENTER_FRAME, type_single_main);
quick_drawPlaceLetter();
}
public function pressBtnOptions(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("options");
}
public function pressBtnChallenge(_arg1:MouseEvent):void{
if (challengeModeUnlocked){
gameMode = MODE_CHALLENGE;
myScreenFX.captureScreen();
destroyLetterBG();
myScreenFX.blindsTransition(10, 3, "mode_display");
gotoAndStop("mode_display");
} else {
menu_gfx.lockmc.gotoAndPlay(2);
};
}
public function type_random_freeze():void{
words_freeze();
}
public function type_single_cleanup():void{
}
public function identifyChooseObject():void{
var _local1:uint;
myIdentifyClip.txtIdentifyType.text = identifyType;
_local1 = Math.ceil((Math.random() * myIdentifyClip.objects.totalFrames));
myIdentifyClip.objects.gotoAndStop(_local1);
identifyColor = colorAry[Math.floor((Math.random() * colorAry.length))];
performColorTransform(myIdentifyClip.objects, identifyColor);
}
public function rollOutChallengeIcon(_arg1:MouseEvent):void{
menu_gfx.txtChallengeDescription.htmlText = "Roll over an icon for its description!";
}
public function type_target_init():void{
var _local1:uint;
var _local2:MovieClip;
var _local3:Point;
gameTimeLimit = 60;
startTime = (getTimer() / 1000);
bigNodeGroup = new BigNodeGroup();
bigNodeGroup.x = (GAME_WIDTH / 2);
bigNodeGroup.y = (GAME_HEIGHT / 2);
addEventListener(Event.ENTER_FRAME, type_target_main);
_local1 = 1;
while (_local1 < 15) {
_local2 = bigNodeGroup[("node" + _local1)];
_local3 = bigNodeGroup.localToGlobal(new Point(_local2.x, _local2.y));
quick_drawPlaceLetter(_local3.x, _local3.y);
_local1++;
};
bigNodeGroup = null;
quick_drawChooseTarget();
}
public function type_singularity_init():void{
gameLife = 100;
updateLife(0);
singularityRadians = 0;
singularitySpeed = 0.3;
singularityOriginX = (GAME_WIDTH / 2);
singularityOriginY = (GAME_HEIGHT / 2);
gameTimer1 = new Timer(450);
gameTimer1.addEventListener(TimerEvent.TIMER, type_singularity_main);
gameTimer1.start();
}
public function type_classic_init():void{
gameLife = 100;
updateLife(0);
gameTimer1 = new Timer(1400);
gameTimer1.addEventListener(TimerEvent.TIMER, type_classic_main);
gameTimer1.start();
}
public function inflictPain(_arg1:int):void{
updateLife(-(_arg1));
HUD.life_switch_container.gotoAndPlay("red");
if (gameOptions[4] == 1){
buzzerObj.play();
};
}
public function type_random_init():void{
words_init();
}
public function words_main(_arg1:Event):void{
updateTimer();
}
public function type_arrgeebee_init():void{
gameTimeLimit = 60;
startTime = (getTimer() / 1000);
desiredColorIndex = 0;
addEventListener(Event.ENTER_FRAME, type_arrgeebee_main);
placeRGBGroup();
myColorClip = new colorClip();
myColorClip.x = (GAME_WIDTH / 2);
myColorClip.y = 150;
addChildAt(myColorClip, 0);
}
public function type_target_cleanup():void{
}
public function clickLink(_arg1:String, _arg2:String="_blank"):void{
var req:URLRequest;
var inLocation = _arg1;
var inWindow = _arg2;
req = new URLRequest(inLocation);
try {
navigateToURL(req, inWindow);
} catch(e:SecurityError) {
};
}
public function formatConst(_arg1:String):String{
return (_arg1.toUpperCase().replace("_", " "));
}
public function applyQuality():void{
if (gameOptions[1] == 1){
stage.quality = StageQuality.LOW;
} else {
if (gameOptions[1] == 2){
stage.quality = StageQuality.MEDIUM;
} else {
if (gameOptions[1] == 3){
stage.quality = StageQuality.HIGH;
};
};
};
}
public function exploreChildren(_arg1:Event):void{
i = 0;
while (i < numChildren) {
trace(getChildAt(i).name);
i++;
};
}
public function type_arrgeebee_keyPress(_arg1:uint):void{
var _local2:Letter;
_local2 = findLetterByCode(_arg1);
if (_local2 == null){
timePenalty(1);
} else {
if (_local2.color == colorLoopAry[desiredColorIndex]){
updateScore(35);
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
cleanupLetters();
placeRGBGroup();
desiredColorIndex++;
if (desiredColorIndex == colorLoopAry.length){
desiredColorIndex = 0;
};
myColorClip.gotoAndStop((desiredColorIndex + 1));
} else {
timePenalty(1);
};
};
}
public function waitForStart(_arg1:Event){
if (_arg1.target.currentLabel == "end"){
_arg1.target.removeEventListener(Event.ENTER_FRAME, waitForStart);
_arg1.target.parent.removeChild(_arg1.target);
startGame();
};
}
public function removeFromParticleList(_arg1:Event):void{
var _local2:uint;
_local2 = 0;
while (_local2 < particleList.length) {
if (_arg1.target == particleList[_local2]){
particleList.splice(_local2, 1);
break;
};
_local2++;
};
_arg1.target.removeEventListener(Event.REMOVED, removeFromParticleList);
}
public function pressBtnSponsor(_arg1:MouseEvent):void{
clickLink(sponsorTarget);
}
public function pressBtnQuickDraw(_arg1:MouseEvent):void{
gameMode = MODE_QUICK_DRAW;
myScreenFX.captureScreen();
destroyLetterBG();
myScreenFX.blindsTransition(10, 3, "mode_display");
gotoAndStop("mode_display");
}
public function pressBtnCopyrightLink(_arg1:MouseEvent):void{
clickLink("http://afro-ninja.com");
}
public function cleanupLetters():void{
i = 0;
while (i < letterList.length) {
letterList[i].removeEventListener(Event.REMOVED, removeFromLetterList);
letterList[i].removeFromGame();
letterList.splice(i, 1);
i--;
i++;
};
}
public function type_single_main(_arg1:Event):void{
updateTimer();
}
public function quick_drawPlaceLetter(_arg1:Number=0, _arg2:Number=0, _arg3:uint=0):void{
var _local4:Number;
var _local5:Letter;
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
_arg1 = ((Math.random() * (GAME_WIDTH - 100)) + 50);
_arg2 = ((Math.random() * (GAME_HEIGHT - 100)) + 50);
};
_local4 = (Math.random() + 0.5);
_local5 = placeLetter("random", _arg1, _arg2, _local4, _arg3);
_local5.addEventListener(Event.REMOVED, removeFromLetterList);
}
public function musicToggle():void{
if (!inPreloader){
if (gameOptions[0] == 1){
musicPlaying = false;
gameOptions[0] = 2;
mainLoopChannel.stop();
if (btnMusicToggle != null){
btnMusicToggle.gotoAndStop("off");
};
} else {
if (gameOptions[0] == 2){
musicPlaying = true;
gameOptions[0] = 1;
mainLoopChannel = mainLoopObj.play(0, 999);
if (btnMusicToggle != null){
btnMusicToggle.gotoAndStop("on");
};
};
};
saveGame();
};
}
function frame142(){
myScreenFX.captureScreen();
gotoAndStop("main", "Menu");
myScreenFX.fadeTransition(0.03);
}
function frame145(){
btnBack.buttonMode = true;
btnBack.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnBack3);
btnMusicToggle.visible = false;
menu_gfx.btnClearData.buttonMode = true;
menu_gfx.btnViewScores.buttonMode = true;
menu_gfx.btnDefaults.buttonMode = true;
menu_gfx.btnClearData.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnClearData);
menu_gfx.btnViewScores.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnViewScores);
menu_gfx.btnDefaults.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnDefaults);
menu_gfx.clearDataClip.visible = false;
menu_gfx.clearDataClip.btnYeah.buttonMode = true;
menu_gfx.clearDataClip.btnNo.buttonMode = true;
menu_gfx.clearDataClip.btnYeah.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnYeah);
menu_gfx.clearDataClip.btnNo.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnNo);
loadOptions();
}
function frame146(){
btnBack.buttonMode = true;
btnBack.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnBack4);
menu_gfx.btnGuide.buttonMode = true;
menu_gfx.btnGuide.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnGuide);
numCompleted = 0;
numTotal = challengeList.length;
i = 0;
while (i < challengeList.length) {
menu_gfx[("cIcon" + i)].addEventListener(MouseEvent.ROLL_OVER, rollOverChallengeIcon);
menu_gfx[("cIcon" + i)].addEventListener(MouseEvent.ROLL_OUT, rollOutChallengeIcon);
if (challengeList[i].cUnlocked){
numCompleted++;
} else {
menu_gfx[("cIcon" + i)].alpha = 0.1;
};
i++;
};
menu_gfx.txtChallengesCompleted.text = (((numCompleted + " of ") + numTotal) + " completed");
}
function frame147(){
createLetterBG();
btnBack.buttonMode = true;
btnBack.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnBack1);
menu_gfx.btnModeScroll.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnScroll);
menu_gfx.btnModeQuick_Draw.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnQuickDraw);
menu_gfx.btnModeWords.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnWords);
menu_gfx.btnModeChallenge.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnChallenge);
menu_gfx.btnModeScroll.gameMode = MODE_SCROLL;
menu_gfx.btnModeQuick_Draw.gameMode = MODE_QUICK_DRAW;
menu_gfx.btnModeWords.gameMode = MODE_WORDS;
menu_gfx.btnModeChallenge.gameMode = MODE_CHALLENGE;
menu_gfx.lockmc.visible = !(challengeModeUnlocked);
}
public function heal(_arg1:int):void{
updateLife(_arg1);
HUD.life_switch_container.gotoAndPlay("green");
}
function frame144(){
stop();
menu_gfx.btnPlay.buttonMode = true;
menu_gfx.btnPlay.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnPlay);
menu_gfx.btnPlay.addEventListener(MouseEvent.ROLL_OVER, menuBtnMouseOver);
menu_gfx.btnPlay.addEventListener(MouseEvent.ROLL_OUT, menuBtnMouseOut);
menu_gfx.btnOptions.buttonMode = true;
menu_gfx.btnOptions.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnOptions);
menu_gfx.btnOptions.addEventListener(MouseEvent.ROLL_OVER, menuBtnMouseOver);
menu_gfx.btnOptions.addEventListener(MouseEvent.ROLL_OUT, menuBtnMouseOut);
menu_gfx.btnChallenges.buttonMode = true;
menu_gfx.btnChallenges.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnChallenges);
menu_gfx.btnChallenges.addEventListener(MouseEvent.ROLL_OVER, menuBtnMouseOver);
menu_gfx.btnChallenges.addEventListener(MouseEvent.ROLL_OUT, menuBtnMouseOut);
loadAudio();
loadMusicToggle();
}
public function pressBtnPlay(_arg1:MouseEvent):void{
myScreenFX.captureScreen();
myScreenFX.blindsTransition(10, 3);
gotoAndStop("play");
}
function frame149(){
HUD.btnANLink.buttonMode = true;
HUD.btnANLink.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnANLink);
countdownClip.addEventListener(Event.ENTER_FRAME, waitForStart);
HUD.life_switch_container.alpha = 0;
endClip.btnMenu.buttonMode = true;
endClip.btnMenu.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnMenu);
endClip.btnRetry.buttonMode = true;
endClip.btnRetry.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnRetry);
endClip.highScoreAlert.visible = false;
endClip.alpha = 0;
endClip.visible = false;
}
public function pressBtnType(_arg1:MouseEvent):void{
modeType = _arg1.target.modeType;
myScreenFX.captureScreen();
destroyLetterBG2();
gotoAndStop("gamemain", "Game");
myScreenFX.blindsTransition(10, 3, "gamemain", "Game");
}
public function type_bounce_keyPress(_arg1:uint):void{
scrollKeyPress(_arg1);
}
function frame148(){
createLetterBG2();
btnBack2.buttonMode = true;
btnBack2.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnBack2);
menu_gfx.btnGuide.buttonMode = true;
menu_gfx.btnGuide.addEventListener(MouseEvent.MOUSE_DOWN, pressBtnGuide);
menu_gfx.txtModeTitle.text = formatConst(gameMode);
menu_gfx.txtModeDescription.text = gameDescriptions[gameMode];
targetModeAry = root[(gameMode.toLowerCase() + "Types")];
i = 0;
while (i < targetModeAry.length) {
MovieClip(root).menu_gfx[("btnType" + (i + 1))].txtName.text = formatConst(targetModeAry[i]);
MovieClip(root).menu_gfx[("btnType" + (i + 1))].modeType = targetModeAry[i];
MovieClip(root).menu_gfx[("btnType" + (i + 1))].addEventListener(MouseEvent.MOUSE_DOWN, pressBtnType);
possibleScore = highScores[targetModeAry[i]];
if (possibleScore != 0){
MovieClip(root).menu_gfx[(("txtType" + (i + 1)) + "Score")].text = possibleScore;
};
if (medalCollection[targetModeAry[i]] != null){
MovieClip(root).menu_gfx[("medal" + (i + 1))].gotoAndStop(medalCollection[targetModeAry[i]]);
} else {
MovieClip(root).menu_gfx[("medal" + (i + 1))].visible = false;
};
i++;
};
}
public function loadGame():void{
highScores = mySO.data.highScores;
totalSymbolsTyped = mySO.data.totalSymbolsTyped;
gameOptions = mySO.data.gameOptions.concat();
challengeModeUnlocked = mySO.data.challengeModeUnlocked;
challengeList = mySO.data.challengeList.concat();
medalCollection = mySO.data.medalCollection;
buildGameAry();
applyQuality();
}
public function quick_drawChooseTarget():void{
var _local1:uint;
_local1 = Math.floor((Math.random() * letterList.length));
letterList[_local1].filters = quick_drawFilterAry;
}
public function checkChallengeModeStatus():void{
var _local1:uint;
var _local2:String;
_local1 = 0;
for each (_local2 in highScores) {
_local1++;
};
if (_local1 == 9){
challengeModeUnlocked = true;
};
}
public function type_random_keyPress(_arg1:uint):void{
wordsKeyPress(_arg1);
}
public function checkLoad(_arg1:Event):void{
if (framesLoaded == totalFrames){
removeEventListener(Event.ENTER_FRAME, checkLoad);
gotoAndStop("loaded");
};
}
public function type_identify_init():void{
gameTimeLimit = 90;
startTime = (getTimer() / 1000);
identifyType = "Name?";
identifyLettersOnScreen = 0;
identifyStartY = 310;
identifyOriginX = (identifyStartX = 100);
addEventListener(Event.ENTER_FRAME, type_identify_main);
myIdentifyClip = new identifyClip();
myIdentifyClip.x = (GAME_WIDTH / 2);
myIdentifyClip.y = 70;
addChildAt(myIdentifyClip, 0);
myIdentifyCursor = new identifyCursor();
myIdentifyCursor.x = identifyStartX;
myIdentifyCursor.y = (identifyStartY + 35);
addChildAt(myIdentifyCursor, 0);
identifyChooseObject();
}
public function pressBtnANLink(_arg1:MouseEvent):void{
clickLink("http://afro-ninja.com");
}
public function type_target_main(_arg1:Event):void{
updateTimer();
}
public function type_singularity_main(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:uint;
var _local4:Letter;
singularityRadians = (singularityRadians + singularitySpeed);
if (singularityRadians > (2 * Math.PI)){
singularityRadians = 0;
if ((gameTimer1.delay - 15) > 1){
gameTimer1.delay = (gameTimer1.delay - 15);
singularitySpeed = (singularitySpeed + 0.01);
};
};
singularityXSpeed = (Math.cos(singularityRadians) * 2.5);
singularityYSpeed = (Math.sin(singularityRadians) * 2.5);
if (letterList.length < maxLettersOnScreen){
_local2 = 1.4;
_local3 = 0;
if (Math.random() < 0.05){
if (Math.random() > 0.5){
_local3 = 0xFF0000;
} else {
_local3 = 0xFF00;
};
};
_local4 = placeLetter("random", singularityOriginX, singularityOriginY, _local2, _local3);
_local4.type_singularity_init(singularityXSpeed, singularityYSpeed);
_local4.addEventListener(Event.REMOVED, removeFromLetterList);
};
}
public function type_single_freeze():void{
removeEventListener(Event.ENTER_FRAME, type_single_main);
}
public function type_classic_main(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Letter;
if (letterList.length < maxLettersOnScreen){
if (Math.random() > 0.5){
_local2 = (GAME_WIDTH + 50);
} else {
_local2 = -50;
};
_local3 = ((Math.random() * (GAME_HEIGHT - 100)) + 50);
_local4 = (Math.random() + 0.5);
_local5 = 0;
if (Math.random() < 0.05){
if (Math.random() > 0.5){
_local5 = 0xFF0000;
} else {
_local5 = 0xFF00;
};
};
_local6 = placeLetter("random", _local2, _local3, _local4, _local5);
if (gameScore > 1000){
_local6.spinSpeed = 0.5;
};
_local6.type_classic_init();
_local6.addEventListener(Event.REMOVED, removeFromLetterList);
};
scrollAdjustSpeed();
}
public function exitGame():void{
myScreenFX.captureScreen();
cleanupScreen();
gotoAndStop("main", "Menu");
myScreenFX.fadeTransition(0.03);
}
public function type_forwards_keyPress(_arg1:uint):void{
wordsKeyPress(_arg1);
}
public function type_arrgeebee_main(_arg1:Event):void{
updateTimer();
}
public function type_sections_keyPress(_arg1:uint):void{
var _local2:Letter;
_local2 = findLetterByCode(_arg1);
if (_local2 == null){
timePenalty(1);
} else {
updateScore(35);
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
_local2.removeFromGame();
if (letterList.length == 0){
quick_drawPlaceLetterGroup();
};
};
}
public function saveOptions():void{
if (gameOptions[0] != int(menu_gfx.cmbMusic.selectedItem.data)){
musicToggle();
};
gameOptions[0] = int(menu_gfx.cmbMusic.selectedItem.data);
gameOptions[1] = int(menu_gfx.cmbQuality.selectedItem.data);
gameOptions[4] = int(menu_gfx.cmbPenalty.selectedItem.data);
if (menu_gfx.chkNumbers.selected){
gameOptions[2] = 1;
} else {
gameOptions[2] = 2;
};
if (menu_gfx.chkPunctuation.selected){
gameOptions[3] = 1;
} else {
gameOptions[3] = 2;
};
saveGame();
buildGameAry();
}
public function calculateCareerScore():uint{
var _local1:uint;
var _local2:Object;
_local1 = 0;
_local2 = new Object();
_local2 = processModeScores(scrollTypes);
_local1 = (_local1 + _local2.totalScore);
_local2 = processModeScores(quick_drawTypes);
_local1 = (_local1 + _local2.totalScore);
_local2 = processModeScores(wordsTypes);
_local1 = (_local1 + _local2.totalScore);
if (challengeModeUnlocked){
_local2 = processModeScores(challengeTypes);
_local1 = (_local1 + _local2.totalScore);
};
return (_local1);
}
public function pressBtnBackSub(_arg1:MouseEvent):void{
scoresheet.gotoAndStop(1);
}
public function loadAudio():void{
if (!audioLoaded){
audioLoaded = true;
mainLoopObj = new mainLoop();
};
}
public function type_classic_freeze():void{
gameTimer1.stop();
gameTimer1.removeEventListener(TimerEvent.TIMER, type_classic_main);
}
public function type_forwards_freeze():void{
words_freeze();
}
public function type_backwards_init():void{
words_init();
}
public function pressBtnNo(_arg1:MouseEvent):void{
menu_gfx.clearDataClip.visible = false;
}
public function type_float_freeze():void{
gameTimer1.stop();
gameTimer1.removeEventListener(TimerEvent.TIMER, type_float_main);
}
public function retryGame():void{
cleanupScreen();
nextFrame();
prevFrame();
}
public function type_sections_freeze():void{
removeEventListener(Event.ENTER_FRAME, type_sections_main);
}
public function type_identify_main(_arg1:Event):void{
updateTimer();
}
public function type_random_cleanup():void{
words_cleanup();
}
public function buildGameAry():void{
gameAry = letterAry.concat();
if (gameOptions[2] == 1){
gameAry = gameAry.concat(numberAry);
};
if (gameOptions[3] == 1){
gameAry = gameAry.concat(punctuationAry);
};
}
public function removeFromLetterList(_arg1:Event):void{
var _local2:uint;
_local2 = 0;
while (_local2 < letterList.length) {
if (_arg1.target == letterList[_local2]){
letterList.splice(_local2, 1);
break;
};
_local2++;
};
_arg1.target.removeEventListener(Event.REMOVED, removeFromLetterList);
}
public function identifyBackspace():void{
if (identifyLettersOnScreen > 0){
letterList[(letterList.length - 1)].removeFromGame();
identifyStartX = (identifyStartX - 40);
myIdentifyCursor.x = identifyStartX;
identifyLettersOnScreen--;
};
}
public function type_identify_cleanup():void{
removeChild(myIdentifyClip);
removeChild(myIdentifyCursor);
}
public function loadOptions():void{
menu_gfx.cmbMusic.selectedIndex = (gameOptions[0] - 1);
menu_gfx.cmbQuality.selectedIndex = (gameOptions[1] - 1);
menu_gfx.cmbPenalty.selectedIndex = (gameOptions[4] - 1);
menu_gfx.chkLetters.selected = true;
menu_gfx.chkLetters.enabled = false;
if (gameOptions[2] == 1){
menu_gfx.chkNumbers.selected = true;
} else {
menu_gfx.chkNumbers.selected = false;
};
if (gameOptions[3] == 1){
menu_gfx.chkPunctuation.selected = true;
} else {
menu_gfx.chkPunctuation.selected = false;
};
menu_gfx.cmbQuality.addEventListener(Event.CHANGE, cmbQualityChange);
}
public function wordsLoadWord():void{
var _local1:Array;
var _local2:Array;
var _local3:Letter;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:String;
var _local9:Letter;
_local1 = MovieClip(root)[(("words" + wordLength) + "Letters")];
_local2 = _local1[Math.floor((Math.random() * _local1.length))].split("");
_local3 = new Letter("TEST", 0);
_local3.scaleX = 1.5;
_local4 = _local3.width;
_local5 = (_local4 + ((_local2.length - 1) * 50));
_local6 = (((GAME_WIDTH - _local5) / 2) + (_local4 / 2));
_local7 = (GAME_HEIGHT / 2);
_local3 = null;
for each (_local8 in _local2) {
_local9 = placeLetter(_local8.toUpperCase(), _local6, _local7, 1.5, 0);
_local9.addEventListener(Event.REMOVED, removeFromLetterList);
_local9.alpha = 0.15;
_local6 = (_local6 + 50);
};
}
public function type_bounce_init():void{
gameLife = 100;
updateLife(0);
gameTimer1 = new Timer(1400);
gameTimer1.addEventListener(TimerEvent.TIMER, type_bounce_main);
gameTimer1.start();
}
public function quick_drawPlaceLetterGroup():void{
var _local1:uint;
var _local2:uint;
var _local3:MovieClip;
var _local4:Point;
_local1 = Math.ceil((Math.random() * 5));
nodeGroup.gotoAndStop(_local1);
_local2 = 1;
while (_local2 < 6) {
_local3 = nodeGroup[("node" + _local2)];
_local4 = nodeGroup.localToGlobal(new Point(_local3.x, _local3.y));
quick_drawPlaceLetter(_local4.x, _local4.y);
_local2++;
};
}
public function pressBtnYeah(_arg1:MouseEvent):void{
var _local2:Object;
mySO.clear();
highScores = new Object();
for each (_local2 in challengeList) {
_local2.cUnlocked = false;
};
medalCollection = new Object();
totalSymbolsTyped = 0;
menu_gfx.clearDataClip.gotoAndStop(2);
}
public function wordsKeyPress(_arg1:uint):void{
var _local2:Letter;
if (_arg1 == targetLetterCodeValue){
_local2 = letterList[targetNode];
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
_local2.removeFromGame();
if (letterList.length == 0){
updateScore(100);
wordsTyped++;
if ((((modeType == TYPE_FORWARDS)) || ((modeType == TYPE_BACKWARDS)))){
if (wordsTyped > 20){
wordLength = 4;
};
if (wordsTyped > 35){
wordLength = 5;
};
if (wordsTyped > 50){
wordLength = 6;
};
} else {
if (modeType == TYPE_RANDOM){
if (wordsTyped > 2){
wordLength = 4;
};
if (wordsTyped > 10){
wordLength = 5;
};
if (wordsTyped > 25){
wordLength = 6;
};
};
};
wordsLoadWord();
};
wordsHighlightLetter();
} else {
timePenalty(1);
};
}
public function checkPostGameKeys(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
if (_local2 == 77){
exitGame();
} else {
if (_local2 == 82){
retryGame();
};
};
}
public function findLetterByCode(_arg1:int):Letter{
var _local2:Letter;
_local2 = null;
i = 0;
while (i < letterList.length) {
if (letterList[i].codeValue == _arg1){
_local2 = letterList[i];
break;
};
i++;
};
return (_local2);
}
public function chooseUniqueLetter():Letter{
var _local1:BasicLetter;
var _local2:Boolean;
var _local3:*;
do {
_local1 = gameAry[uint((Math.random() * gameAry.length))];
_local2 = false;
for each (_local3 in letterList) {
if (_local3.codeValue == _local1.codeValue){
_local2 = true;
break;
};
};
} while (_local2);
return (new Letter(_local1.letterValue, _local1.codeValue, GAME_WIDTH, GAME_HEIGHT));
}
public function pressBtnWords(_arg1:MouseEvent):void{
gameMode = MODE_WORDS;
myScreenFX.captureScreen();
destroyLetterBG();
myScreenFX.blindsTransition(10, 3, "mode_display");
gotoAndStop("mode_display");
}
public function scrollKeyPress(_arg1:uint):void{
var _local2:Letter;
_local2 = findLetterByCode(_arg1);
if (_local2 == null){
inflictPain(10);
} else {
if (_local2.color == 0xFF00){
updateScore(15);
heal(10);
} else {
if (_local2.color == 0){
updateScore(15);
} else {
if (_local2.color == 0xFF0000){
inflictPain(10);
};
};
};
gameSymbolsTyped++;
particleExplosion(_local2.x, _local2.y, _local2.horizontalSpeed, _local2.color);
_local2.freeze();
_local2.removeFromGame();
};
}
public function words_cleanup():void{
}
public function pressBtnRetry(_arg1:MouseEvent):void{
retryGame();
}
public function type_singularity_cleanup():void{
}
public function menuBtnMouseOver(_arg1:MouseEvent):void{
_arg1.target.strip.gotoAndStop(2);
}
public function saveGame():void{
mySO.data.highScores = highScores;
mySO.data.totalSymbolsTyped = totalSymbolsTyped;
mySO.data.gameOptions = gameOptions.concat();
mySO.data.challengeModeUnlocked = challengeModeUnlocked;
mySO.data.challengeList = challengeList.concat();
mySO.data.medalCollection = medalCollection;
mySO.flush();
}
public function type_singularity_keyPress(_arg1:uint):void{
scrollKeyPress(_arg1);
}
public function checkKeys(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
if (_local2 == 27){
freezeGame();
exitGame();
} else {
if (_local2 == 8){
if (modeType == TYPE_IDENTIFY){
identifyBackspace();
};
};
};
if ((((_local2 >= 96)) && ((_local2 <= 111)))){
_local2 = (_local2 - 48);
};
if (gameCodeAry[_local2] != null){
var _local3 = this;
_local3[(("type_" + modeType) + "_keyPress")](_local2);
};
}
public function pressBtnViewScores(_arg1:MouseEvent):void{
scoresheet.gotoAndStop(2);
}
public function freezeGame():void{
stage.removeEventListener(KeyboardEvent.KEY_UP, checkKeys);
i = 0;
while (i < letterList.length) {
letterList[i].freeze();
i++;
};
i = 0;
while (i < particleList.length) {
particleList[i].freeze();
i++;
};
var _local1 = this;
_local1[(("type_" + modeType) + "_freeze")]();
}
public function type_backwards_freeze():void{
words_freeze();
}
public function type_identify_keyPress(_arg1:uint):void{
var _local2:Letter;
if (identifyLettersOnScreen < 10){
identifyLettersOnScreen++;
_local2 = placeLetter(gameCodeAry[_arg1], identifyStartX, identifyStartY, 1.5, 0);
_local2.addEventListener(Event.REMOVED, removeFromLetterList);
identifyStartX = (identifyStartX + 40);
myIdentifyCursor.x = identifyStartX;
identifyCheckAnswer();
};
}
public function particleExplosion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:uint=0):void{
var _local5:uint;
var _local6:*;
var _local7:*;
var _local8:uint;
var _local9:Particle;
var _local10:ColorTransform;
_local8 = 0;
_local5 = 0;
while (_local5 < 5) {
_local9 = new Particle(GAME_WIDTH, GAME_HEIGHT);
_local9.x = _arg1;
_local9.y = _arg2;
_local9.horizontalSpeed = _arg3;
performColorTransform(_local9, _arg4);
gameParticleContainer.addChild(_local9);
particleList.push(_local9);
_local9.explode_init(modeType);
_local9.addEventListener(Event.REMOVED, removeFromParticleList);
_local5++;
};
}
public function cmbQualityChange(_arg1:Event):void{
gameOptions[1] = int(menu_gfx.cmbQuality.selectedItem.data);
applyQuality();
}
public function type_float_init():void{
gameLife = 100;
updateLife(0);
gameTimer1 = new Timer(1400);
gameTimer1.addEventListener(TimerEvent.TIMER, type_float_main);
gameTimer1.start();
}
public function updateScore(_arg1:int):void{
gameScore = (gameScore + _arg1);
if (gameScore < 0){
gameScore = 0;
};
HUD.txtScore.text = String(gameScore);
}
public function pressBtnTest(_arg1:MouseEvent):void{
trace("test");
}
public function type_float_keyPress(_arg1:uint):void{
scrollKeyPress(_arg1);
}
public function pressBtnScroll(_arg1:MouseEvent):void{
gameMode = MODE_SCROLL;
myScreenFX.captureScreen();
destroyLetterBG();
myScreenFX.blindsTransition(10, 3, "mode_display");
gotoAndStop("mode_display");
}
public function pressBtnGuide(_arg1:MouseEvent):void{
clickLink("http://afro-ninja.com/walkthroughs.php");
}
public function endGame():void{
var _local1:String;
var _local2:String;
freezeGame();
_local1 = ("Score: " + gameScore);
totalSymbolsTyped = (totalSymbolsTyped + gameSymbolsTyped);
if (gameScore > int(highScores[modeType])){
highScores[modeType] = gameScore;
endClip.highScoreAlert.visible = true;
};
medalAwarded = 0;
if (gameScore >= platinumScores[modeType]){
medalAwarded = 4;
} else {
if (gameScore >= goldScores[modeType]){
medalAwarded = 3;
} else {
if (gameScore >= silverScores[modeType]){
medalAwarded = 2;
} else {
if (gameScore >= bronzeScores[modeType]){
medalAwarded = 1;
};
};
};
};
if (medalAwarded == 0){
endClip.medalClip.visible = false;
} else {
if ((((medalCollection[modeType] == null)) || ((medalAwarded > medalCollection[modeType])))){
medalCollection[modeType] = medalAwarded;
endClip.medalClip.gotoAndStop(medalAwarded);
} else {
endClip.medalClip.visible = false;
};
};
if (!challengeModeUnlocked){
checkChallengeModeStatus();
};
_local2 = checkForUnlockedChallenges();
_local1 = (_local1 + ("\nNew Challenges Completed:" + _local2));
endClip.txtResults.text = _local1;
endClip.visible = true;
endClip.addEventListener(Event.ENTER_FRAME, fadeIn);
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkPostGameKeys);
saveGame();
}
public function loadScoreSheet():void{
var _local1:uint;
var _local2:Object;
var _local3:String;
_local1 = 0;
_local2 = new Object();
_local2 = processModeScores(scrollTypes);
_local1 = (_local1 + _local2.totalScore);
scoresheet.txtModeList1.text = ("[SCROLL]\n" + _local2.resultString);
_local2 = processModeScores(quick_drawTypes);
_local1 = (_local1 + _local2.totalScore);
scoresheet.txtModeList1.text = (scoresheet.txtModeList1.text + ("[QUICK DRAW]\n" + _local2.resultString));
_local2 = processModeScores(wordsTypes);
_local1 = (_local1 + _local2.totalScore);
scoresheet.txtModeList2.text = ("[WORDS]\n" + _local2.resultString);
if (challengeModeUnlocked){
_local2 = processModeScores(challengeTypes);
_local1 = (_local1 + _local2.totalScore);
} else {
_local2.resultString = "";
};
scoresheet.txtModeList2.text = (scoresheet.txtModeList2.text + ("[CHALLENGE]\n" + _local2.resultString));
_local3 = ("CAREER SCORE : " + _local1);
_local3 = (_local3 + ("\nTOTAL SYMBOLS TYPED : " + totalSymbolsTyped));
scoresheet.txtTotals.text = _local3;
}
public function processModeScores(_arg1:Array):Object{
var _local2:Object;
var _local3:String;
var _local4:int;
var _local5:String;
_local2 = new Object();
_local3 = "";
_local4 = 0;
for (_local5 in _arg1) {
_local3 = (_local3 + ((" " + formatConst(_arg1[_local5])) + " : "));
if (highScores[_arg1[_local5]] != null){
_local4 = (_local4 + highScores[_arg1[_local5]]);
_local3 = (_local3 + highScores[_arg1[_local5]]);
} else {
_local3 = (_local3 + "--");
};
_local3 = (_local3 + "\n");
};
_local3 = (_local3 + "\n");
_local2.resultString = _local3;
_local2.totalScore = _local4;
return (_local2);
}
public function startGame():void{
gameScore = 0;
gameSymbolsTyped = 0;
gameLetterContainer = new Sprite();
gameParticleContainer = new Sprite();
addChildAt(gameLetterContainer, 0);
addChild(gameParticleContainer);
setChildIndex(endClip, (numChildren - 1));
letterList = new Array();
particleList = new Array();
if ((((((((((((((((modeType == TYPE_SINGLE)) || ((modeType == TYPE_SECTIONS)))) || ((modeType == TYPE_TARGET)))) || ((modeType == TYPE_ARRGEEBEE)))) || ((modeType == TYPE_FORWARDS)))) || ((modeType == TYPE_BACKWARDS)))) || ((modeType == TYPE_RANDOM)))) || ((modeType == TYPE_IDENTIFY)))){
HUD.life_switch_container.life_switch.nextFrame();
};
HUD.life_switch_container.addEventListener(Event.ENTER_FRAME, fadeIn);
stage.addEventListener(KeyboardEvent.KEY_UP, checkKeys);
var _local1 = this;
_local1[(("type_" + modeType) + "_init")]();
}
public function type_float_cleanup():void{
}
public function updateLife(_arg1:int):void{
gameLife = (gameLife + _arg1);
if (gameLife < 0){
gameLife = 0;
};
if (gameLife > 100){
gameLife = 100;
};
HUD.txtLife.text = String(gameLife);
if (gameLife == 0){
endGame();
};
}
public function type_bounce_main(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Letter;
if (letterList.length < maxLettersOnScreen){
_local2 = ((Math.random() * (GAME_WIDTH - 100)) + 50);
_local3 = -20;
_local4 = (Math.random() + 0.5);
_local5 = 0;
if (Math.random() < 0.05){
if (Math.random() > 0.5){
_local5 = 0xFF0000;
} else {
_local5 = 0xFF00;
};
};
_local6 = placeLetter("random", _local2, _local3, _local4, _local5);
if (gameScore > 1000){
_local6.horizontalSpeed = ((Math.random() * 2.5) + 1);
_local6.spinSpeed = (Math.random() * 2);
if (Math.random() > 0.5){
_local6.horizontalSpeed = -(_local6.horizontalSpeed);
_local6.spinSpeed = -(_local6.spinSpeed);
};
};
_local6.type_bounce_init();
_local6.addEventListener(Event.REMOVED, removeFromLetterList);
};
scrollAdjustSpeed();
}
public function type_bounce_cleanup():void{
}
public function type_singularity_freeze():void{
gameTimer1.stop();
gameTimer1.removeEventListener(TimerEvent.TIMER, type_singularity_main);
}
public function destroyLetterBG2():void{
var _local1:Letter;
if (letterContainer != null){
for each (_local1 in letterList) {
_local1.removeEventListener(Event.ENTER_FRAME, _local1.bgLinearMove);
letterContainer.removeChild(_local1);
_local1 = null;
};
letterList = null;
removeChild(letterContainer);
letterContainer = null;
};
}
public function placeRGBGroup():void{
var _local1:uint;
var _local2:*;
var _local3:uint;
var _local4:Letter;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Letter;
_local2 = 0;
while (_local2 < colorAry.length) {
_local1 = colorAry[_local2];
_local3 = Math.floor((Math.random() * colorAry.length));
colorAry[_local2] = colorAry[_local3];
colorAry[_local3] = _local1;
_local2++;
};
_local4 = new Letter("TEST", 0);
_local4.scaleX = 2;
_local5 = _local4.width;
_local6 = (_local5 + (4 * 50));
_local7 = (((GAME_WIDTH - _local6) / 2) + (_local5 / 2));
_local8 = 230;
_local4 = null;
_local2 = 0;
while (_local2 < colorAry.length) {
_local9 = placeLetter("random", _local7, _local8, 2, colorAry[_local2]);
_local9.addEventListener(Event.REMOVED, removeFromLetterList);
_local7 = (_local7 + 50);
_local2++;
};
}
public function type_float_main(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Letter;
if (letterList.length < maxLettersOnScreen){
_local2 = ((Math.random() * (GAME_WIDTH - 100)) + 50);
_local3 = (GAME_HEIGHT + 10);
_local4 = (Math.random() + 0.5);
_local5 = 0;
if (Math.random() < 0.05){
if (Math.random() > 0.5){
_local5 = 0xFF0000;
} else {
_local5 = 0xFF00;
};
};
_local6 = placeLetter("random", _local2, _local3, _local4, _local5);
if (gameScore > 1000){
_local6.horizontalSpeed = ((Math.random() * 2.5) + 1);
if (Math.random() > 0.5){
_local6.horizontalSpeed = -(_local6.horizontalSpeed);
};
};
_local6.type_float_init();
_local6.addEventListener(Event.REMOVED, removeFromLetterList);
};
scrollAdjustSpeed();
}
public function manageLetters(_arg1:Event):void{
var _local2:uint;
var _local3:Letter;
_local2 = 0;
while (_local2 < letterList.length) {
_local3 = letterList[_local2];
_local3.bgScrollMove();
if (_local3.x > (bgScrollWidth + (_local3.width / 2))){
letterList.splice(_local2, 1);
_local2--;
letterContainer.removeChild(_local3);
_local3 = null;
addBgLetter("left");
};
_local2++;
};
}
public function type_bounce_freeze():void{
gameTimer1.stop();
gameTimer1.removeEventListener(TimerEvent.TIMER, type_bounce_main);
}
public function contextMenuHandler1(_arg1:ContextMenuEvent):void{
clickLink("http://afro-ninja.com");
}
public function type_sections_cleanup():void{
removeChild(nodeGroup);
}
public function updateTimer():void{
elapsedTime = ((getTimer() / 1000) - startTime);
remainingTime = (gameTimeLimit - elapsedTime);
if (remainingTime <= 0){
remainingTime = 0;
};
if (remainingTime == 0){
endGame();
};
HUD.txtLife.text = remainingTime.toFixed(2);
}
public function contextMenuHandler2(_arg1:ContextMenuEvent):void{
musicToggle();
}
}
}//package TYPEITII_fla
Section 50
//mc_btnChallenges_28 (TYPEITII_fla.mc_btnChallenges_28)
package TYPEITII_fla {
import flash.display.*;
public dynamic class mc_btnChallenges_28 extends MovieClip {
public var strip:MovieClip;
}
}//package TYPEITII_fla
Section 51
//mc_btnOptions_26 (TYPEITII_fla.mc_btnOptions_26)
package TYPEITII_fla {
import flash.display.*;
public dynamic class mc_btnOptions_26 extends MovieClip {
public var strip:MovieClip;
}
}//package TYPEITII_fla
Section 52
//mc_btnPlay_24 (TYPEITII_fla.mc_btnPlay_24)
package TYPEITII_fla {
import flash.display.*;
public dynamic class mc_btnPlay_24 extends MovieClip {
public var strip:MovieClip;
}
}//package TYPEITII_fla
Section 53
//medalclip_128 (TYPEITII_fla.medalclip_128)
package TYPEITII_fla {
import flash.display.*;
public dynamic class medalclip_128 extends MovieClip {
public function medalclip_128(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 54
//menu_button_strip_25 (TYPEITII_fla.menu_button_strip_25)
package TYPEITII_fla {
import flash.display.*;
public dynamic class menu_button_strip_25 extends MovieClip {
public function menu_button_strip_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 55
//menu_button_strip2_27 (TYPEITII_fla.menu_button_strip2_27)
package TYPEITII_fla {
import flash.display.*;
public dynamic class menu_button_strip2_27 extends MovieClip {
public function menu_button_strip2_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 56
//menu_button_strip3_29 (TYPEITII_fla.menu_button_strip3_29)
package TYPEITII_fla {
import flash.display.*;
public dynamic class menu_button_strip3_29 extends MovieClip {
public function menu_button_strip3_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 57
//menu_gfx_0_23 (TYPEITII_fla.menu_gfx_0_23)
package TYPEITII_fla {
import flash.display.*;
public dynamic class menu_gfx_0_23 extends MovieClip {
public var btnChallenges:MovieClip;
public var btnOptions:MovieClip;
public var btnPlay:MovieClip;
}
}//package TYPEITII_fla
Section 58
//menu_gfx_1_120 (TYPEITII_fla.menu_gfx_1_120)
package TYPEITII_fla {
import flash.display.*;
import typeit_classes.*;
public dynamic class menu_gfx_1_120 extends MovieClip {
public var lockmc:MovieClip;
public var btnModeQuick_Draw:HighlightButton;
public var btnModeChallenge:HighlightButton;
public var btnModeWords:HighlightButton;
public var btnModeScroll:HighlightButton;
public var videoScreen:MovieClip;
}
}//package TYPEITII_fla
Section 59
//menu_gfx_2_127 (TYPEITII_fla.menu_gfx_2_127)
package TYPEITII_fla {
import flash.display.*;
import typeit_classes.*;
import flash.text.*;
public dynamic class menu_gfx_2_127 extends MovieClip {
public var btnGuide:MovieClip;
public var medal1:MovieClip;
public var medal2:MovieClip;
public var medal3:MovieClip;
public var txtType1Score:TextField;
public var btnType2:HighlightButton;
public var btnType3:HighlightButton;
public var btnType1:HighlightButton;
public var txtType3Score:TextField;
public var txtModeDescription:TextField;
public var videoScreen:MovieClip;
public var txtType2Score:TextField;
public var txtModeTitle:TextField;
}
}//package TYPEITII_fla
Section 60
//menu_gfx_3_39 (TYPEITII_fla.menu_gfx_3_39)
package TYPEITII_fla {
import fl.controls.*;
import flash.display.*;
import fl.data.*;
public dynamic class menu_gfx_3_39 extends MovieClip {
public var j2;
public var j3;
public var j1;
public var collObj1:DataProvider;
public var collObj2:DataProvider;
public var cmbPenalty:ComboBox;
public var collObj3:DataProvider;
public var chkLetters:CheckBox;
public var clearDataClip:MovieClip;
public var cmbQuality:ComboBox;
public var btnViewScores:MovieClip;
public var collProp1:Object;
public var btnClearData:MovieClip;
public var collProp2:Object;
public var cmbMusic:ComboBox;
public var btnDefaults:MovieClip;
public var itemObj3:SimpleCollectionItem;
public var collProp3:Object;
public var chkNumbers:CheckBox;
public var chkPunctuation:CheckBox;
public var itemObj2:SimpleCollectionItem;
public var collProps3:Array;
public var collProps2:Array;
public var itemObj1:SimpleCollectionItem;
public var i1:int;
public var i2:int;
public var collProps1:Array;
public var i3:int;
public function menu_gfx_3_39(){
__setProp_cmbMusic_menu_gfx_3_text_1();
__setProp_chkPunctuation_menu_gfx_3_text_1();
__setProp_cmbQuality_menu_gfx_3_text_1();
__setProp_chkLetters_menu_gfx_3_text_1();
__setProp_cmbPenalty_menu_gfx_3_text_1();
__setProp_chkNumbers_menu_gfx_3_text_1();
}
function __setProp_chkNumbers_menu_gfx_3_text_1(){
try {
chkNumbers["componentInspectorSetting"] = true;
} catch(e:Error) {
};
chkNumbers.enabled = true;
chkNumbers.label = "Numbers";
chkNumbers.labelPlacement = "right";
chkNumbers.selected = false;
chkNumbers.visible = true;
try {
chkNumbers["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_chkLetters_menu_gfx_3_text_1(){
try {
chkLetters["componentInspectorSetting"] = true;
} catch(e:Error) {
};
chkLetters.enabled = true;
chkLetters.label = "Letters";
chkLetters.labelPlacement = "right";
chkLetters.selected = false;
chkLetters.visible = true;
try {
chkLetters["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_cmbPenalty_menu_gfx_3_text_1(){
try {
cmbPenalty["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj3 = new DataProvider();
collProps3 = [{label:"on", data:1}, {label:"off", data:2}];
i3 = 0;
while (i3 < collProps3.length) {
itemObj3 = new SimpleCollectionItem();
collProp3 = collProps3[i3];
for (j3 in collProp3) {
itemObj3[j3] = collProp3[j3];
};
collObj3.addItem(itemObj3);
i3++;
};
cmbPenalty.dataProvider = collObj3;
cmbPenalty.editable = false;
cmbPenalty.enabled = true;
cmbPenalty.prompt = "";
cmbPenalty.restrict = "";
cmbPenalty.rowCount = 2;
cmbPenalty.visible = true;
try {
cmbPenalty["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_cmbQuality_menu_gfx_3_text_1(){
try {
cmbQuality["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj2 = new DataProvider();
collProps2 = [{label:"low", data:1}, {label:"medium", data:2}, {label:"high", data:3}];
i2 = 0;
while (i2 < collProps2.length) {
itemObj2 = new SimpleCollectionItem();
collProp2 = collProps2[i2];
for (j2 in collProp2) {
itemObj2[j2] = collProp2[j2];
};
collObj2.addItem(itemObj2);
i2++;
};
cmbQuality.dataProvider = collObj2;
cmbQuality.editable = false;
cmbQuality.enabled = true;
cmbQuality.prompt = "";
cmbQuality.restrict = "";
cmbQuality.rowCount = 3;
cmbQuality.visible = true;
try {
cmbQuality["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_cmbMusic_menu_gfx_3_text_1(){
try {
cmbMusic["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj1 = new DataProvider();
collProps1 = [{label:"on", data:1}, {label:"off", data:2}];
i1 = 0;
while (i1 < collProps1.length) {
itemObj1 = new SimpleCollectionItem();
collProp1 = collProps1[i1];
for (j1 in collProp1) {
itemObj1[j1] = collProp1[j1];
};
collObj1.addItem(itemObj1);
i1++;
};
cmbMusic.dataProvider = collObj1;
cmbMusic.editable = false;
cmbMusic.enabled = true;
cmbMusic.prompt = "";
cmbMusic.restrict = "";
cmbMusic.rowCount = 2;
cmbMusic.visible = true;
try {
cmbMusic["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_chkPunctuation_menu_gfx_3_text_1(){
try {
chkPunctuation["componentInspectorSetting"] = true;
} catch(e:Error) {
};
chkPunctuation.enabled = true;
chkPunctuation.label = "Period, Comma, Semicolon, Forward Slash";
chkPunctuation.labelPlacement = "right";
chkPunctuation.selected = false;
chkPunctuation.visible = true;
try {
chkPunctuation["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package TYPEITII_fla
Section 61
//menu_gfx4_96 (TYPEITII_fla.menu_gfx4_96)
package TYPEITII_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_gfx4_96 extends MovieClip {
public var btnGuide:MovieClip;
public var txtChallengeDescription:TextField;
public var txtChallengesCompleted:TextField;
public var cIcon1:MovieClip;
public var cIcon2:MovieClip;
public var cIcon4:MovieClip;
public var cIcon0:MovieClip;
public var cIcon3:MovieClip;
public var cIcon8:MovieClip;
public var cIcon9:MovieClip;
public var cIcon5:MovieClip;
public var cIcon6:MovieClip;
public var cIcon14:MovieClip;
public var cIcon12:MovieClip;
public var cIcon10:MovieClip;
public var cIcon11:MovieClip;
public var cIcon7:MovieClip;
public var cIcon13:MovieClip;
}
}//package TYPEITII_fla
Section 62
//music_note_switch_37 (TYPEITII_fla.music_note_switch_37)
package TYPEITII_fla {
import flash.display.*;
public dynamic class music_note_switch_37 extends MovieClip {
public var note:MovieClip;
public function music_note_switch_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TYPEITII_fla
Section 63
//NG_AD_OBJECT_3 (TYPEITII_fla.NG_AD_OBJECT_3)
package TYPEITII_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NG_AD_OBJECT_3 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_3(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(_arg1){
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
ng_ad.addChild(_local3);
}
}
}//package TYPEITII_fla
Section 64
//NG_TANK_5 (TYPEITII_fla.NG_TANK_5)
package TYPEITII_fla {
import flash.display.*;
import flash.events.*;
public dynamic class NG_TANK_5 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_5(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package TYPEITII_fla
Section 65
//scoresheet_94 (TYPEITII_fla.scoresheet_94)
package TYPEITII_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class scoresheet_94 extends MovieClip {
public var txtTotals:TextField;
public var btnBackSub:MovieClip;
public var txtModeList1:TextField;
public var txtModeList2:TextField;
public function scoresheet_94(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
btnBackSub.buttonMode = true;
btnBackSub.addEventListener(MouseEvent.MOUSE_DOWN, MovieClip(root).pressBtnBackSub);
MovieClip(root).loadScoreSheet();
}
}
}//package TYPEITII_fla
Section 66
//sponsorclip_10 (TYPEITII_fla.sponsorclip_10)
package TYPEITII_fla {
import flash.display.*;
public dynamic class sponsorclip_10 extends MovieClip {
public var afrohead:MovieClip;
public var AGpresented_mc:MovieClip;
public var AGlogo_mc:MovieClip;
public function sponsorclip_10(){
addFrameScript(1, frame2);
}
function frame2(){
afrohead.gotoAndStop(20);
}
}
}//package TYPEITII_fla
Section 67
//videoscreen_124 (TYPEITII_fla.videoscreen_124)
package TYPEITII_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class videoscreen_124 extends MovieClip {
public var border:MovieClip;
public var txtDescription:TextField;
public var qMark:MovieClip;
public function videoscreen_124(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
txtDescription.text = "Roll over an option for the description!";
qMark.addEventListener(Event.ENTER_FRAME, MovieClip(root).singleSpin);
}
}
}//package TYPEITII_fla
Section 68
//BigNodeGroup (BigNodeGroup)
package {
import flash.display.*;
public dynamic class BigNodeGroup extends MovieClip {
public var node2:MovieClip;
public var node3:MovieClip;
public var node7:MovieClip;
public var node1:MovieClip;
public var node6:MovieClip;
public var node4:MovieClip;
public var node5:MovieClip;
public var node8:MovieClip;
public var node9:MovieClip;
public var node10:MovieClip;
public var node11:MovieClip;
public var node14:MovieClip;
public var node13:MovieClip;
public var node12:MovieClip;
}
}//package
Section 69
//buzzer (buzzer)
package {
import flash.media.*;
public dynamic class buzzer extends Sound {
}
}//package
Section 70
//CellRenderer_disabledSkin (CellRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_disabledSkin extends MovieClip {
}
}//package
Section 71
//CellRenderer_downSkin (CellRenderer_downSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_downSkin extends MovieClip {
}
}//package
Section 72
//CellRenderer_overSkin (CellRenderer_overSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_overSkin extends MovieClip {
}
}//package
Section 73
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 74
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 75
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 76
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 77
//CellRenderer_upSkin (CellRenderer_upSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_upSkin extends MovieClip {
}
}//package
Section 78
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 79
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 80
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 81
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 82
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 83
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 84
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 85
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 86
//colorClip (colorClip)
package {
import flash.display.*;
public dynamic class colorClip extends MovieClip {
public function colorClip(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 87
//ComboBox_disabledSkin (ComboBox_disabledSkin)
package {
import flash.display.*;
public dynamic class ComboBox_disabledSkin extends MovieClip {
}
}//package
Section 88
//ComboBox_downSkin (ComboBox_downSkin)
package {
import flash.display.*;
public dynamic class ComboBox_downSkin extends MovieClip {
}
}//package
Section 89
//ComboBox_overSkin (ComboBox_overSkin)
package {
import flash.display.*;
public dynamic class ComboBox_overSkin extends MovieClip {
}
}//package
Section 90
//ComboBox_upSkin (ComboBox_upSkin)
package {
import flash.display.*;
public dynamic class ComboBox_upSkin extends MovieClip {
}
}//package
Section 91
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 92
//identifyClip (identifyClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class identifyClip extends MovieClip {
public var objects:MovieClip;
public var txtIdentifyType:TextField;
}
}//package
Section 93
//identifyCursor (identifyCursor)
package {
import flash.display.*;
public dynamic class identifyCursor extends MovieClip {
}
}//package
Section 94
//List_skin (List_skin)
package {
import flash.display.*;
public dynamic class List_skin extends MovieClip {
}
}//package
Section 95
//mainLoop (mainLoop)
package {
import flash.media.*;
public dynamic class mainLoop extends Sound {
}
}//package
Section 96
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object){
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1){
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String){
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String){
}
public static function loadMySite(_arg1:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String){
trace(("[NEWGROUNDS API] :: " + _arg1));
}
public static function linkAPI(_arg1){
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null){
var _local3:URLRequest;
var _local4:*;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1, _arg2=null){
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String){
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String){
trace(("[NEWGROUNDS API ERROR] :: " + _arg1));
}
public static function addCustomEvent(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function){
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1){
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:MovieClip;
var _local10:TextField;
var _local11:TextField;
var _local12:TextFormat;
var _local13:TextField;
var _local14:TextFormat;
var _local15:TextFormat;
_local4 = bridge.stage.stageWidth;
_local5 = bridge.stage.stageHeight;
_local6 = 350;
_local7 = 160;
_local8 = bridge.root;
_local9 = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
_local10 = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
_local11 = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
_local12 = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
_local13 = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
_local14 = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
_local15 = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number){
var _local2:String;
var _local3:*;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package
Section 97
//NodeGroup (NodeGroup)
package {
import flash.display.*;
public dynamic class NodeGroup extends MovieClip {
public var node2:MovieClip;
public var node3:MovieClip;
public var node1:MovieClip;
public var node4:MovieClip;
public var node5:MovieClip;
public function NodeGroup(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 98
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 99
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 100
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 101
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 102
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 103
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 104
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 105
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 106
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 107
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 108
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 109
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 110
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 111
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 112
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package