Section 1
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.geom.*;
import fl.events.*;
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
//ScrollPane (fl.containers.ScrollPane)
package fl.containers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public class ScrollPane extends BaseScrollPane implements IFocusManagerComponent {
protected var scrollDragHPos:Number;
protected var loader:Loader;
protected var yOffset:Number;
protected var currentContent:Object;
protected var xOffset:Number;
protected var _source:Object;// = ""
protected var scrollDragVPos:Number;
protected var _scrollDrag:Boolean;// = false
protected var contentClip:Sprite;
private static var defaultStyles:Object = {upSkin:"ScrollPane_upSkin", disabledSkin:"ScrollPane_disabledSkin", focusRectSkin:null, focusRectPadding:null, contentPadding:0};
public function ScrollPane(){
_source = "";
_scrollDrag = false;
super();
}
public function get source():Object{
return (_source);
}
public function set source(_arg1:Object):void{
var _local2:*;
clearContent();
if (isLivePreview){
return;
};
_source = _arg1;
if ((((_source == "")) || ((_source == null)))){
return;
};
currentContent = getDisplayObjectInstance(_arg1);
if (currentContent != null){
_local2 = contentClip.addChild((currentContent as DisplayObject));
dispatchEvent(new Event(Event.INIT));
update();
} else {
load(new URLRequest(_source.toString()));
};
}
public function get bytesLoaded():Number{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesLoaded);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = (scrollDragVPos - (mouseY - yOffset));
_verticalScrollBar.setScrollPosition(_local2);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, true);
_local3 = (scrollDragHPos - (mouseX - xOffset));
_horizontalScrollBar.setScrollPosition(_local3);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, true);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = calculateAvailableHeight();
switch (_arg1.keyCode){
case Keyboard.DOWN:
verticalScrollPosition++;
break;
case Keyboard.UP:
verticalScrollPosition--;
break;
case Keyboard.RIGHT:
horizontalScrollPosition++;
break;
case Keyboard.LEFT:
horizontalScrollPosition--;
break;
case Keyboard.END:
verticalScrollPosition = maxVerticalScrollPosition;
break;
case Keyboard.HOME:
verticalScrollPosition = 0;
break;
case Keyboard.PAGE_UP:
verticalScrollPosition = (verticalScrollPosition - _local2);
break;
case Keyboard.PAGE_DOWN:
verticalScrollPosition = (verticalScrollPosition + _local2);
break;
};
}
protected function doStartDrag(_arg1:MouseEvent):void{
if (!enabled){
return;
};
xOffset = mouseX;
yOffset = mouseY;
scrollDragHPos = horizontalScrollPosition;
scrollDragVPos = verticalScrollPosition;
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
}
public function get content():DisplayObject{
var _local1:Object;
_local1 = currentContent;
if ((_local1 is URLRequest)){
_local1 = loader.content;
};
return ((_local1 as DisplayObject));
}
public function get percentLoaded():Number{
if (loader != null){
return (Math.round(((bytesLoaded / bytesTotal) * 100)));
};
return (0);
}
protected function endDrag(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
}
public function update():void{
var _local1:DisplayObject;
_local1 = contentClip.getChildAt(0);
setContentSize(_local1.width, _local1.height);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:*;
_local3 = contentClip.scrollRect;
_local3.x = _arg1;
contentClip.scrollRect = _local3;
}
public function refreshPane():void{
if ((_source is URLRequest)){
_source = _source.url;
};
source = _source;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
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));
}
public function load(_arg1:URLRequest, _arg2:LoaderContext=null):void{
if (_arg2 == null){
_arg2 = new LoaderContext(false, ApplicationDomain.currentDomain);
};
clearContent();
initLoader();
currentContent = (_source = _arg1);
loader.load(_arg1, _arg2);
}
override protected function handleScroll(_arg1:ScrollEvent):void{
passEvent(_arg1);
super.handleScroll(_arg1);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:*;
_local3 = contentClip.scrollRect;
_local3.y = _arg1;
contentClip.scrollRect = _local3;
}
protected function initLoader():void{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, passEvent, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onContentLoad, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.INIT, passEvent, false, 0, true);
contentClip.addChild(loader);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
drawBackground();
};
if (isInvalid(InvalidationType.STATE)){
setScrollDrag();
};
super.draw();
}
override protected function configUI():void{
super.configUI();
contentClip = new Sprite();
addChild(contentClip);
contentClip.scrollRect = contentScrollRect;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
}
public function set scrollDrag(_arg1:Boolean):void{
_scrollDrag = _arg1;
invalidate(InvalidationType.STATE);
}
protected function clearContent():void{
if (contentClip.numChildren == 0){
return;
};
contentClip.removeChildAt(0);
currentContent = null;
if (loader != null){
try {
loader.close();
} catch(e) {
};
try {
loader.unload();
} catch(e) {
};
loader = null;
};
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = contentClip.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
contentClip.cacheAsBitmap = useBitmapScrolling;
contentClip.scrollRect = contentScrollRect;
contentClip.x = (contentClip.y = contentPadding);
}
override protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue((enabled) ? "upSkin" : "disabledSkin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function get bytesTotal():Number{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesTotal);
}
protected function onContentLoad(_arg1:Event):void{
var _local2:*;
update();
_local2 = calculateAvailableHeight();
calculateAvailableSize();
horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), availableWidth);
verticalScrollBar.setScrollProperties(_local2, 0, (contentHeight - _local2), _local2);
passEvent(_arg1);
}
public function get scrollDrag():Boolean{
return (_scrollDrag);
}
protected function setScrollDrag():void{
if (_scrollDrag){
contentClip.addEventListener(MouseEvent.MOUSE_DOWN, doStartDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, endDrag, false, 0, true);
} else {
contentClip.removeEventListener(MouseEvent.MOUSE_DOWN, doStartDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, endDrag);
removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
};
contentClip.buttonMode = _scrollDrag;
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.containers
Section 3
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
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 4
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 5
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 6
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 7
//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 8
//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 9
//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 10
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 11
//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 12
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.system.*;
import flash.utils.*;
import flash.text.*;
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 13
//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 14
//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 15
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 16
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 17
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 18
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 19
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 20
//BEEFRONTTOPANIMATION_164 (honeybeecode24_fla.BEEFRONTTOPANIMATION_164)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class BEEFRONTTOPANIMATION_164 extends MovieClip {
public function BEEFRONTTOPANIMATION_164(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 21
//beesidemove_173 (honeybeecode24_fla.beesidemove_173)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class beesidemove_173 extends MovieClip {
public function beesidemove_173(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package honeybeecode24_fla
Section 22
//bondinganimationforcoin_182 (honeybeecode24_fla.bondinganimationforcoin_182)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class bondinganimationforcoin_182 extends MovieClip {
public function bondinganimationforcoin_182(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package honeybeecode24_fla
Section 23
//buttonbackanimation_192 (honeybeecode24_fla.buttonbackanimation_192)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_192 extends MovieClip {
public function buttonbackanimation_192(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 24
//buttonbackanimation_219 (honeybeecode24_fla.buttonbackanimation_219)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_219 extends MovieClip {
public function buttonbackanimation_219(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 25
//buttonbackanimation_80 (honeybeecode24_fla.buttonbackanimation_80)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_80 extends MovieClip {
public function buttonbackanimation_80(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 26
//buttonbackanimation_over_195 (honeybeecode24_fla.buttonbackanimation_over_195)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_over_195 extends MovieClip {
public function buttonbackanimation_over_195(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 27
//buttonbackanimation_over_222 (honeybeecode24_fla.buttonbackanimation_over_222)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_over_222 extends MovieClip {
public function buttonbackanimation_over_222(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 28
//buttonbackanimation_over_83 (honeybeecode24_fla.buttonbackanimation_over_83)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class buttonbackanimation_over_83 extends MovieClip {
public function buttonbackanimation_over_83(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package honeybeecode24_fla
Section 29
//coindisappear_179 (honeybeecode24_fla.coindisappear_179)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class coindisappear_179 extends MovieClip {
public function coindisappear_179(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package honeybeecode24_fla
Section 30
//collectinghoney1_132 (honeybeecode24_fla.collectinghoney1_132)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney1_132 extends MovieClip {
public function collectinghoney1_132(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 31
//collectinghoney2_136 (honeybeecode24_fla.collectinghoney2_136)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney2_136 extends MovieClip {
public function collectinghoney2_136(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 32
//collectinghoney3_137 (honeybeecode24_fla.collectinghoney3_137)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney3_137 extends MovieClip {
public function collectinghoney3_137(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 33
//collectinghoney4_138 (honeybeecode24_fla.collectinghoney4_138)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney4_138 extends MovieClip {
public function collectinghoney4_138(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 34
//collectinghoney5_139 (honeybeecode24_fla.collectinghoney5_139)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney5_139 extends MovieClip {
public function collectinghoney5_139(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 35
//collectinghoney6_140 (honeybeecode24_fla.collectinghoney6_140)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney6_140 extends MovieClip {
public function collectinghoney6_140(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 36
//collectinghoney7_141 (honeybeecode24_fla.collectinghoney7_141)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney7_141 extends MovieClip {
public function collectinghoney7_141(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 37
//collectinghoney8_142 (honeybeecode24_fla.collectinghoney8_142)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney8_142 extends MovieClip {
public function collectinghoney8_142(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 38
//collectinghoney9_143 (honeybeecode24_fla.collectinghoney9_143)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class collectinghoney9_143 extends MovieClip {
public function collectinghoney9_143(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package honeybeecode24_fla
Section 39
//COLONYSIZE_ANIMATION_38 (honeybeecode24_fla.COLONYSIZE_ANIMATION_38)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class COLONYSIZE_ANIMATION_38 extends MovieClip {
public var colonyCount:MovieClip;
}
}//package honeybeecode24_fla
Section 40
//flashanimation_25 (honeybeecode24_fla.flashanimation_25)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class flashanimation_25 extends MovieClip {
public function flashanimation_25(){
addFrameScript(94, frame95);
}
function frame95(){
stop();
}
}
}//package honeybeecode24_fla
Section 41
//flashanimation_4 (honeybeecode24_fla.flashanimation_4)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class flashanimation_4 extends MovieClip {
public function flashanimation_4(){
addFrameScript(94, frame95);
}
function frame95(){
stop();
}
}
}//package honeybeecode24_fla
Section 42
//flower1_59 (honeybeecode24_fla.flower1_59)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class flower1_59 extends MovieClip {
public function flower1_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package honeybeecode24_fla
Section 43
//graphics_28 (honeybeecode24_fla.graphics_28)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class graphics_28 extends MovieClip {
public function graphics_28(){
addFrameScript(1, frame2);
}
function frame2(){
}
}
}//package honeybeecode24_fla
Section 44
//healthline_40 (honeybeecode24_fla.healthline_40)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class healthline_40 extends MovieClip {
public var percentbar:MovieClip;
}
}//package honeybeecode24_fla
Section 45
//highscorescreen_212 (honeybeecode24_fla.highscorescreen_212)
package honeybeecode24_fla {
import flash.display.*;
import flash.text.*;
public dynamic class highscorescreen_212 extends MovieClip {
public var score1:TextField;
public var score5:TextField;
public var score10:TextField;
public var backhs:SimpleButton;
public var score6:TextField;
public var date1:TextField;
public var date2:TextField;
public var date3:TextField;
public var date6:TextField;
public var date7:TextField;
public var playmorehs:SimpleButton;
public var date5:TextField;
public var date9:TextField;
public var player1:TextField;
public var player2:TextField;
public var player6:TextField;
public var player7:TextField;
public var player8:TextField;
public var player5:TextField;
public var date4:TextField;
public var date8:TextField;
public var player3:TextField;
public var player9:TextField;
public var player4:TextField;
public var date10:TextField;
public var player10:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score9:TextField;
public var score4:TextField;
}
}//package honeybeecode24_fla
Section 46
//instructionscreen_209 (honeybeecode24_fla.instructionscreen_209)
package honeybeecode24_fla {
import flash.display.*;
import flash.text.*;
import fl.containers.*;
public dynamic class instructionscreen_209 extends MovieClip {
public var introBar:MovieClip;
public var tf:TextFormat;
public var introf:MovieClip;
public var playMore:SimpleButton;
public var aSp:ScrollPane;
public var backIntro:SimpleButton;
public function instructionscreen_209(){
addFrameScript(0, frame1);
}
function frame1(){
aSp = new ScrollPane();
tf = new TextFormat();
aSp.setStyle("disabledTextFormat", tf);
aSp.source = introf;
aSp.setSize(500, 350);
aSp.move(-250, -200);
addChild(aSp);
}
}
}//package honeybeecode24_fla
Section 47
//l11_186 (honeybeecode24_fla.l11_186)
package honeybeecode24_fla {
import flash.display.*;
import flash.text.*;
public dynamic class l11_186 extends MovieClip {
public var percent:TextField;
}
}//package honeybeecode24_fla
Section 48
//LogoAniFlashA_198 (honeybeecode24_fla.LogoAniFlashA_198)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class LogoAniFlashA_198 extends MovieClip {
public function LogoAniFlashA_198(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package honeybeecode24_fla
Section 49
//LogoAniFlashA_94 (honeybeecode24_fla.LogoAniFlashA_94)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class LogoAniFlashA_94 extends MovieClip {
public function LogoAniFlashA_94(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package honeybeecode24_fla
Section 50
//total_mc_1 (honeybeecode24_fla.total_mc_1)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class total_mc_1 extends MovieClip {
public function total_mc_1(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
}
}
}//package honeybeecode24_fla
Section 51
//welcome_screen_189 (honeybeecode24_fla.welcome_screen_189)
package honeybeecode24_fla {
import flash.display.*;
public dynamic class welcome_screen_189 extends MovieClip {
public var highScore:SimpleButton;
public var intro:SimpleButton;
public var playGame:SimpleButton;
public var addMore:SimpleButton;
public var playMore:SimpleButton;
}
}//package honeybeecode24_fla
Section 52
//BeeLife (BeeLife)
package {
import flash.display.*;
public class BeeLife extends MovieClip {
}
}//package
Section 53
//BeeShield (BeeShield)
package {
import flash.display.*;
public class BeeShield extends Sprite {
}
}//package
Section 54
//BGSound (BGSound)
package {
import flash.media.*;
public class BGSound extends Sound {
}
}//package
Section 55
//BlackBee (BlackBee)
package {
import flash.geom.*;
public class BlackBee extends FriendBee {
private var targetFlowersArray:Array;
private var radiusX:Number;
private var radiusY:Number;
private var deltaAngular:Number;// = 0
private var prevPos:Point;
private var moveUp:Boolean;// = false
private var angularVel:Number;// = 0
private var minY:Number;// = 0
private var targetFlowerPos:Point;
private var maxY:Number;// = 0
private var center:Point;
private var maxX:Number;// = 0
private var minX:Number;// = 0
private var movementType:Number;// = 0
private var RTD:Number;// = 57.2957795130823
private var bounce:Number;// = -1
private var jumpCount:Number;// = 0
private var flowerTargetloopCount;// = 0
private var areaHalfHeight:Number;// = 300
private var areaHalfWidth:Number;// = 300
private var beeMovementStatus:Number;// = 0
private var loopCount:Number;// = 0
private var targetFlowerIndex:Number;// = 0
public function BlackBee(){
minX = 0;
maxX = 0;
minY = 0;
maxY = 0;
areaHalfWidth = 300;
areaHalfHeight = 300;
bounce = -1;
targetFlowerPos = new Point();
RTD = (180 / Math.PI);
movementType = 0;
angularVel = 0;
center = new Point();
prevPos = new Point();
targetFlowersArray = new Array();
loopCount = 0;
beeMovementStatus = 0;
targetFlowerIndex = 0;
flowerTargetloopCount = 0;
jumpCount = 0;
moveUp = false;
deltaAngular = 0;
super();
speed = GParams.blackBeeSpeed;
minWidth = (halfWidth * 2.1);
minHeight = (halfHeight * 2.1);
scaleX = 1.1;
scaleY = 1.1;
}
public function setParameters(_arg1:Array){
var _local2:Number;
var _local3:Number;
var _local4:Number;
this.x = _arg1[0].x;
this.y = _arg1[0].y;
_local2 = 1;
while (_local2 < _arg1.length) {
targetFlowersArray.push(_arg1[_local2]);
_local2++;
};
center.x = this.x;
center.y = this.y;
prevPos.x = this.x;
prevPos.y = this.y;
radiusX = ((Math.random() * 100) + 100);
radiusY = ((Math.random() * 100) + 100);
minX = (this.x - areaHalfWidth);
maxX = (this.x + areaHalfWidth);
minY = (this.y - areaHalfHeight);
maxY = (this.y + areaHalfHeight);
_local3 = (Math.PI / 4);
velocity.x = (Math.cos(_local3) * speed);
velocity.y = (Math.sin(_local3) * speed);
angularVel = ((Math.PI / 2) * 3);
this.rotation = (((angularVel - ((Math.PI / 2) * 3)) * 180) / Math.PI);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusX));
_local4 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = (30 / _local4);
beeMovementStatus = 0;
}
public function setTargetFlowerPosition(_arg1:Number, _arg2:Number){
targetFlowerPos.x = _arg1;
targetFlowerPos.y = _arg2;
}
private function moveBounceOnToFlower(){
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:Number;
if (moveUp == true){
this.y = (this.y - speed);
if (loopCount == flowerTargetloopCount){
moveUp = false;
loopCount = 0;
flowerTargetloopCount = 15;
};
} else {
this.y = (this.y + speed);
if (loopCount == flowerTargetloopCount){
jumpCount = (jumpCount + 1);
if (jumpCount != 5){
moveUp = true;
loopCount = 0;
flowerTargetloopCount = 20;
} else {
jumpCount = 0;
speed = speedMax;
beeMovementStatus = 0;
_local1 = (this.x - center.x);
_local2 = (this.x - center.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
angularVel = Math.atan2(_local2, _local1);
if (_local3 > 200){
radiusY = _local3;
radiusX = (_local3 - (Math.random() * 100));
} else {
radiusY = _local3;
radiusX = ((Math.random() * 100) + _local3);
};
_local4 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = (30 / _local4);
};
};
};
}
private function moveInSlope(){
var _local1:Number;
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
_local1 = 0;
if (this.x <= minX){
this.x = minX;
velocity.x = (velocity.x * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.x >= maxX){
this.x = maxX;
velocity.x = (velocity.x * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.y <= minY){
this.y = minY;
velocity.y = (velocity.y * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.y >= maxY){
this.y = maxY;
velocity.y = (velocity.y * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
};
};
};
};
}
override public function checkHoneyBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = (this.x - HoneyBee.honeyBee.actualPosition.x);
_local2 = (this.y - HoneyBee.honeyBee.actualPosition.y);
if ((((Math.abs(_local1) <= minWidth)) && ((Math.abs(_local2) <= minHeight)))){
if (((!((HoneyBee.honeyBee.currentFrame == 9))) && ((HoneyBee.honeyBee.hurtCount == 0)))){
SoundControl.tis.play();
_local3 = (Math.sqrt(((minWidth * minWidth) + (minHeight * minHeight))) - Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
HoneyBee.honeyBee.displayHurtClip();
_local4 = Math.atan2(_local2, _local1);
changeDirection(_local3, _local4);
return (true);
};
};
return (false);
}
private function moveSitOnFlower(){
if (loopCount == flowerTargetloopCount){
beeMovementStatus = 3;
loopCount = 0;
flowerTargetloopCount = 60;
moveUp = true;
};
}
private function moveCircular(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
angularVel = (angularVel + deltaAngular);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusX));
_local1 = (this.x - prevPos.x);
_local2 = (this.y - prevPos.y);
_local3 = Math.atan2(_local2, _local1);
prevPos.x = this.x;
prevPos.y = this.y;
this.rotation = (((_local3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
if (loopCount == 300){
beeMovementStatus = 1;
setTargetFlower();
loopCount = 0;
};
}
private function changeDirection(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:Number;
jumpCount = 0;
speed = speedMax;
_arg2 = (Math.PI + _arg2);
angularVel = _arg2;
beeMovementStatus = 0;
_local3 = (this.x - center.x);
_local4 = (this.x - center.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
angularVel = Math.atan2(_local4, _local3);
if (_local5 > 100){
radiusY = _local5;
radiusX = (_local5 - 100);
if (radiusX < 50){
radiusX = 50;
};
if (radiusY < 50){
radiusY = 50;
};
} else {
radiusY = _local5;
radiusX = (_local5 + 100);
if (radiusX < 50){
radiusX = 50;
};
if (radiusY < 50){
radiusY = 50;
};
};
this.x = (this.x + ((Math.cos(_arg2) * _arg1) * 2));
this.y = (this.y + ((Math.sin(_arg2) * _arg1) * 2));
this.rotation = (((_arg2 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
}
private function moveTowardsTargetFlower(){
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
if (loopCount >= flowerTargetloopCount){
beeMovementStatus = 2;
flowerTargetloopCount = 30;
loopCount = 0;
this.rotation = 0;
speed = speedMin;
};
}
public function setTargetFlower(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = 0;
_local2 = 0;
targetFlowerIndex = ((targetFlowerIndex + 1) % targetFlowersArray.length);
_local1 = (targetFlowersArray[targetFlowerIndex].x - this.x);
_local2 = (targetFlowersArray[targetFlowerIndex].y - this.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local4 = Math.atan2(_local2, _local1);
velocity.x = (Math.cos(_local4) * speed);
velocity.y = (Math.sin(_local4) * speed);
this.rotation = (((_local4 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
flowerTargetloopCount = Math.ceil((_local3 / speed));
}
override public function moveBee():Boolean{
loopCount = (loopCount + 1);
if (beeMovementStatus == 0){
moveCircular();
} else {
if (beeMovementStatus == 1){
moveTowardsTargetFlower();
} else {
if (beeMovementStatus == 2){
moveSitOnFlower();
} else {
if (beeMovementStatus == 3){
moveBounceOnToFlower();
} else {
if (beeMovementStatus == 4){
moveInSlope();
};
};
};
};
};
return (true);
}
}
}//package
Section 56
//BorderPanel (BorderPanel)
package {
import flash.display.*;
import flash.text.*;
public class BorderPanel extends MovieClip {
public var life:TextField;
public var colonySize:MovieClip;
public var timeTick:TextField;
public var healthLine:MovieClip;
public var level:TextField;
public var score:TextField;
public static var borderPanel:BorderPanel = null;
public function updateGameStats(_arg1:uint, _arg2:uint){
this.healthLine.percentbar.scaleX = HoneyBee.honeyBee.healthLine;
if (_arg1 != -1){
this.timeTick.text = (_arg2 - _arg1).toString();
};
this.colonySize.colonyCount.scaleY = (GParams.colonyDeltaIncrement[(GParams.currentLevel - 1)] * GParams.currentColonySize);
if (this.colonySize.colonyCount.scaleY >= 1){
GardenGame.setGameStatus = 1;
};
this.level.text = GParams.currentLevel.toString();
this.life.text = GParams.totalLives.toString();
this.score.text = GParams.scoreValue.toString();
}
public function calculateBonus(_arg1:uint, _arg2:uint){
var _local3:int;
if (_arg2 > _arg1){
_local3 = (_arg2 - _arg1);
GParams.bonusPoints = (_local3 * 25);
GParams.scoreValue = (GParams.scoreValue + (_local3 * 25));
if (GParams.totalLives > 0){
GParams.bonusPoints = (GParams.bonusPoints + ((GParams.totalLives * GParams.currentLevel) * 100));
GParams.scoreValue = (GParams.scoreValue + ((GParams.totalLives * GParams.currentLevel) * 100));
};
};
}
public function resetStats(){
this.healthLine.percentbar.scaleX = 1;
this.timeTick.text = "0";
this.colonySize.colonyCount.scaleY = 0;
this.level.text = GParams.currentLevel.toString();
this.life.text = GParams.totalLives.toString();
this.score.text = GParams.scoreValue.toString();
}
public static function createInstance(){
if (borderPanel == null){
borderPanel = new (BorderPanel);
};
}
}
}//package
Section 57
//CoinFactory (CoinFactory)
package {
public class CoinFactory {
private static var coinIndex:Number = -1;
private static var coins:Array = new Array(20);
public static function getCoin():PowerupCoin{
coinIndex = (coinIndex + 1);
if (coins[coinIndex] == null){
coins[coinIndex] = new PowerupCoin();
};
return (coins[coinIndex]);
}
}
}//package
Section 58
//Enemy (Enemy)
package {
import flash.display.*;
public class Enemy extends MovieClip {
protected var actualWidth:Number;// = 0
public var currentLife:Number;// = 0
protected var minDist;// = 15
protected var stingXMin:Number;// = 0
protected var actualHeight:Number;// = 0
protected var currDir:Number;// = -1
protected var hitAreaRadius:Number;// = 150
public var isAttacking:Boolean;// = false
protected var totalLife:Number;// = 0
public var enemyStatus:Number;// = 1
protected var stingXMax:Number;// = 0
protected var stingYMax:Number;// = 0
protected var totalHeight:Number;// = 0
protected var DTR;// = 0.0174532925199433
protected var currentMC:MovieClip;// = null
protected var stingYMin:Number;// = 0
public var enemyType:Number;// = -1
protected var totalWidth:Number;// = 0
public static var ACTIVE = 0;
public static var LEFT = 1;
public static var MOVERIGHT = 4;
public static var BOTTOM = 3;
public static var TOP = 2;
public static var RIGHT = 0;
public static var MOVELEFT = 5;
public function Enemy(){
enemyType = -1;
enemyStatus = 1;
currDir = -1;
stingXMin = 0;
stingXMax = 0;
stingYMin = 0;
stingYMax = 0;
totalWidth = 0;
totalHeight = 0;
actualWidth = 0;
actualHeight = 0;
hitAreaRadius = 150;
currentMC = null;
DTR = (Math.PI / 180);
isAttacking = false;
minDist = 15;
totalLife = 0;
currentLife = 0;
super();
}
public function checkStingCollision(_arg1:Number, _arg2:Number):Boolean{
if ((((((_arg1 >= stingXMin)) && ((_arg1 <= stingXMax)))) && ((((_arg2 >= stingYMin)) && ((_arg2 <= stingYMax)))))){
return (true);
};
return (false);
}
public function reinit(){
}
}
}//package
Section 59
//ExtractHoney (ExtractHoney)
package {
import flash.display.*;
public class ExtractHoney extends MovieClip {
private static var extractHoney:ExtractHoney = null;
public function ExtractHoney(){
addFrameScript(2, frame3, 5, frame6, 8, frame9, 11, frame12, 14, frame15, 17, frame18, 20, frame21, 23, frame24, 26, frame27);
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame24(){
stop();
}
function frame9(){
stop();
}
function frame21(){
stop();
}
function frame15(){
stop();
}
function frame27(){
stop();
}
public function playExtract(_arg1:Number){
gotoAndPlay(_arg1);
}
public static function getInstance():ExtractHoney{
if (extractHoney == null){
extractHoney = new (ExtractHoney);
};
return (extractHoney);
}
}
}//package
Section 60
//ExtractHoneySound (ExtractHoneySound)
package {
import flash.media.*;
public dynamic class ExtractHoneySound extends Sound {
}
}//package
Section 61
//FairyBee (FairyBee)
package {
import flash.events.*;
import flash.geom.*;
public class FairyBee extends FriendBee {
private var radiusX:Number;
private var radiusY:Number;
private var deltaAngular:Number;// = 0
private var prevPos:Point;
private var range:Number;// = 50
private var twoPI:Number;// = 0
private var angularVel:Number;// = 0
private var yspeed:Number;// = 0.05
private var center:Point;
private var deltaY:int;// = 5
private var centerY:Number;// = 200
private var dir:int;// = 0
private var moveOut:Boolean;// = false
private var loopCount:Number;// = 0
private var angle:Number;// = 0
private var targetX:int;// = -1
public static var fairy:FairyBee = null;
public function FairyBee(){
angularVel = 0;
center = new Point();
prevPos = new Point();
twoPI = 0;
loopCount = 0;
moveOut = false;
deltaAngular = 0;
dir = 0;
deltaY = 5;
targetX = -1;
angle = 0;
centerY = 200;
range = 50;
yspeed = 0.05;
super();
speed = 5;
minWidth = (halfWidth * 2);
minHeight = (halfHeight * 2);
twoPI = (Math.PI * 2);
scaleX = 0.8;
scaleY = 0.8;
}
private function removeFairyBee(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
}
private function moveCircular(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
angularVel = (angularVel + deltaAngular);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusX));
_local1 = (this.x - prevPos.x);
_local2 = (this.y - prevPos.y);
if (angularVel == twoPI){
angularVel = 0;
loopCount = (loopCount + 1);
if (loopCount > 4){
moveOut = true;
velocity.x = (_local1 * 2);
velocity.y = (_local2 * 2);
_local4 = radiusX;
radiusY = radiusX;
radiusX = _local4;
_local5 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = (30 / _local5);
};
};
_local3 = Math.atan2(_local2, _local1);
prevPos.x = this.x;
prevPos.y = this.y;
this.rotation = (((_local3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
}
private function moveWavy():Boolean{
this.x = (this.x + speed);
this.y = (centerY + (Math.sin(angle) * range));
angle = (angle + yspeed);
if ((((dir == 1)) && ((this.x > targetX)))){
return (false);
};
if ((((dir == -1)) && ((this.x < targetX)))){
return (false);
};
return (true);
}
public function onEnterFrame(_arg1:Event){
if (moveWavy() == false){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
if (this.checkHoneyBeeCollision() == true){
HoneyBee.honeyBee.addShield();
removeFairyBee();
};
}
public function initFairy(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number=0, _arg6:Boolean=false){
centerY = _arg2;
speed = (speed * _arg3);
this.targetX = _arg4;
this.dir = _arg3;
this.x = _arg1;
this.y = _arg2;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
if (_arg3 == 1){
rotation = 90;
} else {
rotation = -90;
};
}
override public function moveBee():Boolean{
return (false);
}
public static function createFairy(){
if (fairy == null){
fairy = new (FairyBee);
};
}
}
}//package
Section 62
//Flower (Flower)
package {
import flash.display.*;
public class Flower extends MovieClip {
public var lifeStatus:Number;// = 0
public var honeyCapacity:Number;// = 0
protected var minDist:Number;// = 0
public var flowerType:Number;// = 0
public var flowerStatus:Number;// = 1
public var radius:Number;// = 0
protected var hasHoney:Boolean;// = true
public function Flower(){
flowerType = 0;
lifeStatus = 0;
honeyCapacity = 0;
radius = 0;
flowerStatus = 1;
minDist = 0;
hasHoney = true;
super();
}
public function makeHoneyLess(){
hasHoney = false;
}
public function containsHoney():Boolean{
return (hasHoney);
}
public function fade(){
flowerStatus = 2;
gotoAndStop(flowerStatus);
}
public function setFlowerStatus(_arg1:Number){
this.flowerStatus = _arg1;
gotoAndStop(flowerStatus);
}
public function reinit(){
flowerStatus = 1;
hasHoney = true;
gotoAndStop(1);
}
public function checkBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Math.abs((HoneyBee.honeyBee.actualPosition.x - this.x));
_local2 = Math.abs((HoneyBee.honeyBee.actualPosition.y - this.y));
if ((((_local1 <= this.minDist)) && ((_local2 <= this.minDist)))){
return (true);
};
return (false);
}
}
}//package
Section 63
//FlowerCornivorous (FlowerCornivorous)
package {
import flash.events.*;
public class FlowerCornivorous extends Enemy {
private var closeCount:uint;// = 0
private var minHeight:Number;// = 0
private var minWidth:Number;// = 0
private var closeCountMax:Number;// = 50
public function FlowerCornivorous(){
minWidth = 0;
minHeight = 0;
closeCountMax = 50;
closeCount = 0;
super();
addFrameScript(0, frame1, 1, frame2, 22, frame23);
totalWidth = 77;
totalHeight = 47;
enemyType = GParams.ENEMY_CF;
}
public function checkCollision():Boolean{
var _local1:Number;
var _local2:Number;
minWidth = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].x + actualWidth);
minHeight = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].y + actualHeight);
_local2 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local1 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local2 < minWidth)) && ((_local1 < minHeight)))){
return (true);
};
return (false);
}
function frame1(){
stop();
}
function frame23(){
stop();
}
override public function checkStingCollision(_arg1:Number, _arg2:Number):Boolean{
return (false);
}
function frame2(){
stop();
}
public function removeTimelineListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
actualWidth = 30;
actualHeight = 20;
minWidth = (actualWidth + HoneyBee.halfWidth);
minHeight = (actualHeight + HoneyBee.halfHeight);
}
public function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
if ((((currentFrame > 5)) && ((closeCount == 0)))){
HoneyBee.honeyBee.visible = false;
};
if (currentFrame >= 23){
if (closeCount == 0){
HoneyBee.honeyBee.visible = true;
HoneyBee.honeyBee.displayHurtClip();
stop();
};
closeCount = (closeCount + 1);
if (closeCount == closeCountMax){
closeCount = 0;
GardenGame.garden.addEnemy(this);
gotoAndStop(1);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
};
}
public function addTimelineListener(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package
Section 64
//FlowerEight (FlowerEight)
package {
public class FlowerEight extends Flower {
public function FlowerEight(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 8;
lifeStatus = 1;
honeyCapacity = 5;
radius = 22;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 65
//FlowerFive (FlowerFive)
package {
public class FlowerFive extends Flower {
public function FlowerFive(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 5;
lifeStatus = 1;
honeyCapacity = 5;
radius = 23;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 66
//FlowerFour (FlowerFour)
package {
public class FlowerFour extends Flower {
public function FlowerFour(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 4;
lifeStatus = 1;
honeyCapacity = 3;
radius = 20;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 67
//FlowerNine (FlowerNine)
package {
public class FlowerNine extends Flower {
public function FlowerNine(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 9;
lifeStatus = 1;
honeyCapacity = 6;
radius = 15;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 68
//FlowerOne (FlowerOne)
package {
public class FlowerOne extends Flower {
public function FlowerOne(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 1;
lifeStatus = 1;
honeyCapacity = 10;
radius = 35;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.minDist = (radius * _arg4);
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 69
//FlowerPoison (FlowerPoison)
package {
import flash.events.*;
public class FlowerPoison extends Enemy {
private var closeCount:uint;// = 0
private var minHeight:Number;// = 0
private var minWidth:Number;// = 0
private var closeCountMax:Number;// = 50
public function FlowerPoison(){
minWidth = 0;
minHeight = 0;
closeCountMax = 50;
closeCount = 0;
super();
addFrameScript(0, frame1, 1, frame2, 22, frame23);
totalWidth = 77;
totalHeight = 47;
enemyType = GParams.ENEMY_CF;
}
public function checkCollision():Boolean{
var _local1:Number;
var _local2:Number;
minWidth = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].x + actualWidth);
minHeight = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].y + actualHeight);
_local2 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local1 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local2 < minWidth)) && ((_local1 < minHeight)))){
return (true);
};
return (false);
}
function frame1(){
stop();
}
function frame23(){
stop();
}
function frame2(){
stop();
}
public function removeTimelineListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
actualWidth = (totalWidth / 2);
actualHeight = (totalHeight / 2);
minWidth = ((actualWidth / 2) + HoneyBee.halfWidth);
minHeight = ((actualHeight / 2) + HoneyBee.halfHeight);
}
public function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
if ((((currentFrame > 5)) && ((closeCount == 0)))){
HoneyBee.honeyBee.visible = false;
};
if (currentFrame >= 23){
if (closeCount == 0){
HoneyBee.honeyBee.visible = true;
HoneyBee.honeyBee.displayHurtClip();
stop();
};
closeCount = (closeCount + 1);
if (closeCount == closeCountMax){
closeCount = 0;
GardenGame.garden.addEnemy(this);
gotoAndStop(1);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
};
}
public function addTimelineListener(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package
Section 70
//FlowerSeven (FlowerSeven)
package {
public class FlowerSeven extends Flower {
public function FlowerSeven(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 7;
lifeStatus = 1;
honeyCapacity = 4;
radius = 25;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 71
//FlowerSix (FlowerSix)
package {
public class FlowerSix extends Flower {
public function FlowerSix(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 6;
lifeStatus = 1;
honeyCapacity = 6;
radius = 30;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.minDist = (radius * _arg4);
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 72
//FlowerThree (FlowerThree)
package {
public class FlowerThree extends Flower {
public function FlowerThree(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 3;
lifeStatus = 1;
honeyCapacity = 8;
radius = 28;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 73
//FlowerTwo (FlowerTwo)
package {
public class FlowerTwo extends Flower {
public function FlowerTwo(){
addFrameScript(0, frame1, 1, frame2);
flowerType = 2;
lifeStatus = 1;
honeyCapacity = 3;
radius = 30;
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
this.minDist = ((radius * _arg4) + HoneyBee.halfWidth);
}
}
}//package
Section 74
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 75
//ForestBee (ForestBee)
package {
import flash.display.*;
import flash.geom.*;
public class ForestBee extends MovieClip {
private var targetCount:Number;// = 0
private var targetPos:Point;
protected var minHeight:Number;
private var totalSubAttacks:Number;// = 0
protected var speed:Number;// = 6
protected var halfWidth:Number;// = 30
private var increment:Number;// = 0.2
private var actualHalfHeight:Number;// = 0
private var actualHalfWidth:Number;// = 0
private var bounce:Number;// = -1
protected var speedMin:Number;// = 1.2
protected var speedMax:Number;// = 3
protected var minWidth:Number;
protected var moveVerticle:Boolean;// = false
protected var halfHeight:Number;// = 35
private var currentTargetCount:Number;// = 0
private var deltaV:Number;// = 5
protected var velocity:Point;
public function ForestBee(){
velocity = new Point();
speed = 6;
speedMax = 3;
speedMin = 1.2;
halfWidth = 30;
halfHeight = 35;
deltaV = 5;
increment = 0.2;
bounce = -1;
moveVerticle = false;
targetPos = new Point();
currentTargetCount = 0;
totalSubAttacks = 0;
targetCount = 0;
actualHalfWidth = 0;
actualHalfHeight = 0;
super();
minWidth = (halfWidth + (HoneyBee.halfWidth / 2));
minHeight = (halfHeight + (HoneyBee.halfHeight / 2));
}
public function init(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local5 = (_arg1 - HoneyBee.honeyBee.actualPosition.x);
_local6 = (_arg2 - HoneyBee.honeyBee.actualPosition.y);
_local3 = (Math.atan2(_local6, _local5) + Math.PI);
_local4 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
this.x = _arg1;
this.y = _arg2;
velocity.x = (Math.cos(_local3) * speed);
velocity.y = (Math.sin(_local3) * speed);
this.rotation = (((_local3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
targetCount = (Math.floor((_local4 / speed)) + (GParams.frameRate * 3));
}
public function changeTarget(){
currentTargetCount = 0;
init(this.x, this.y);
}
private function checkHoneyBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local3 = 0;
minWidth = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].x + halfWidth);
minHeight = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].y + halfHeight);
_local1 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local2 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local1 <= minWidth)) && ((_local2 <= minHeight)))){
_local3 = (Math.sqrt(((minWidth * minWidth) + (minHeight * minHeight))) - Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
HoneyBee.honeyBee.displayHurtClip();
changeDirection(_local3);
return (true);
};
return (false);
}
private function changeDirection(_arg1:Number){
var _local2:Number;
_local2 = Math.atan2(velocity.y, velocity.x);
_local2 = (Math.PI + _local2);
velocity.x = (Math.cos(_local2) * speed);
velocity.y = (Math.sin(_local2) * speed);
this.x = (this.x + ((Math.cos(_local2) * _arg1) * 3));
this.y = (this.y + ((Math.sin(_local2) * _arg1) * 3));
this.rotation = (((_local2 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
}
private function adjustVelocity(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local3 = (x - HoneyBee.honeyBee.actualPosition.x);
_local4 = (y - HoneyBee.honeyBee.actualPosition.y);
_local1 = (Math.atan2(_local4, _local3) + Math.PI);
_local2 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
velocity.x = (Math.cos(_local1) * speed);
velocity.y = (Math.sin(_local1) * speed);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.rotation = _arg3;
this.scaleX = _arg4;
this.scaleY = _arg4;
}
public function addTimelineListener(){
}
public function moveBee():Boolean{
currentTargetCount = (currentTargetCount + 1);
if (moveVerticle == true){
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
} else {
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
};
if (checkHoneyBeeCollision() == true){
SoundControl.tis.play();
currentTargetCount = (currentTargetCount + 1);
return (true);
};
if (targetCount == currentTargetCount){
if (totalSubAttacks < 5){
changeTarget();
totalSubAttacks = (totalSubAttacks + 1);
};
} else {
if (((targetCount - currentTargetCount) % 100) == 0){
adjustVelocity();
};
};
if ((((((((this.x < -50)) || ((this.x > (GParams.gardenWidth + 50))))) || ((this.y < -50)))) || ((this.y > (GParams.gardenHeight + 50))))){
if (totalSubAttacks >= 5){
return (false);
};
};
return (true);
}
}
}//package
Section 76
//FriendBee (FriendBee)
package {
import flash.display.*;
import flash.geom.*;
public class FriendBee extends Sprite {
private var destPoint:Point;
protected var minHeight:Number;
protected var halfHeight:Number;// = 20
private var startPoint:Point;
protected var speed:Number;// = 4
protected var halfWidth:Number;// = 15
private var increment:Number;// = 0.2
private var bounce:Number;// = -1
protected var speedMin:Number;// = 1.2
protected var speedMax:Number;// = 4
protected var minWidth:Number;
private var deltaV:Number;// = 5
protected var moveVerticle:Boolean;// = false
protected var velocity:Point;
public function FriendBee(){
startPoint = new Point();
destPoint = new Point();
velocity = new Point();
speed = 4;
speedMax = 4;
speedMin = 1.2;
halfWidth = 15;
halfHeight = 20;
deltaV = 5;
increment = 0.2;
bounce = -1;
moveVerticle = false;
super();
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
this.x = _arg1;
this.y = _arg2;
velocity.x = (Math.cos(_arg3) * speed);
velocity.y = (Math.sin(_arg3) * speed);
this.rotation = (((_arg3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
this.moveVerticle = _arg4;
}
public function checkHoneyBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
_local1 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local2 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local1 <= minWidth)) && ((_local2 <= minHeight)))){
return (true);
};
return (false);
}
public function moveBee():Boolean{
if (moveVerticle == true){
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
} else {
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
};
if ((((((((this.x < -50)) || ((this.x > (GParams.gardenWidth + 50))))) || ((this.y < -50)))) || ((this.y > (GParams.gardenHeight + 50))))){
return (false);
};
return (true);
}
}
}//package
Section 77
//FriendDynamicBee (FriendDynamicBee)
package {
import flash.geom.*;
public class FriendDynamicBee extends FriendBee {
private var radiusX:Number;
private var radiusY:Number;
private var deltaAngular:Number;// = 0
private var prevPos:Point;
private var twoPI:Number;// = 0
private var angularVel:Number;// = 0
private var center:Point;
private var moveOut:Boolean;// = false
private var loopCount:Number;// = 0
public function FriendDynamicBee(){
angularVel = 0;
center = new Point();
prevPos = new Point();
twoPI = 0;
loopCount = 0;
moveOut = false;
deltaAngular = 0;
super();
speed = GParams.dynamicBeeSpeed[(GParams.currentLevel - 1)];
minWidth = (halfWidth * 2.1);
minHeight = (halfHeight * 2.1);
twoPI = (Math.PI * 2);
scaleX = 1.1;
scaleY = 1.1;
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local5 = (HoneyBee.honeyBee.actualPosition.x - _arg1);
_local6 = (HoneyBee.honeyBee.actualPosition.y - _arg2);
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
radiusX = _local7;
radiusY = (_local7 - 50);
center.x = _arg1;
center.y = _arg2;
moveOut = false;
loopCount = 0;
_arg3 = (Math.atan2(_local6, _local5) - Math.PI);
center.x = HoneyBee.honeyBee.actualPosition.x;
center.y = HoneyBee.honeyBee.actualPosition.y;
prevPos.x = this.x;
prevPos.y = this.y;
this.rotation = (((_arg3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
angularVel = _arg3;
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusY));
deltaAngular = GParams.deltaAngle[Math.floor((Math.random() * GParams.deltaAngle.length))];
_local8 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = ((10 / _local8) * speed);
}
private function moveCircular(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
angularVel = (angularVel + deltaAngular);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusY));
_local1 = (this.x - prevPos.x);
_local2 = (this.y - prevPos.y);
if (angularVel == twoPI){
angularVel = 0;
loopCount = (loopCount + 1);
if (loopCount > 4){
moveOut = true;
velocity.x = (_local1 * 2);
velocity.y = (_local2 * 2);
_local4 = radiusX;
radiusY = radiusX;
radiusX = _local4;
};
};
_local3 = Math.atan2(_local2, _local1);
prevPos.x = this.x;
prevPos.y = this.y;
this.rotation = (((_local3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
}
override public function moveBee():Boolean{
if (moveOut == false){
moveCircular();
return (true);
};
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
if ((((((((this.x < -50)) || ((this.x > (GParams.gardenWidth + 50))))) || ((this.y < -50)))) || ((this.y > (GParams.gardenHeight + 50))))){
if (moveOut == true){
return (false);
};
};
return (true);
}
}
}//package
Section 78
//FriendshipSound (FriendshipSound)
package {
import flash.media.*;
public dynamic class FriendshipSound extends Sound {
}
}//package
Section 79
//FriendshipSuccess (FriendshipSuccess)
package {
import flash.display.*;
import flash.events.*;
public class FriendshipSuccess extends MovieClip {
public function FriendshipSuccess(){
addFrameScript(29, frame30);
}
public function init(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
gotoAndPlay(1);
}
function frame30(){
stop();
}
public function onEnterFrame(_arg1:Event){
if (currentFrame == 30){
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
}
}//package
Section 80
//FriendStaticBee (FriendStaticBee)
package {
public class FriendStaticBee extends FriendBee {
public function FriendStaticBee(){
minWidth = (halfWidth * 2);
minHeight = (halfHeight * 2);
}
override public function moveBee():Boolean{
return (false);
}
}
}//package
Section 81
//FriendTerritoryBee (FriendTerritoryBee)
package {
import flash.geom.*;
public class FriendTerritoryBee extends FriendBee {
private var targetFlowersArray:Array;
private var radiusX:Number;
private var radiusY:Number;
private var deltaAngular:Number;// = 0
private var prevPos:Point;
private var moveUp:Boolean;// = false
private var angularVel:Number;// = 0
private var minY:Number;// = 0
private var targetFlowerPos:Point;
private var maxY:Number;// = 0
private var center:Point;
private var maxX:Number;// = 0
private var minX:Number;// = 0
private var movementType:Number;// = 0
private var RTD:Number;// = 57.2957795130823
private var bounce:Number;// = -1
private var jumpCount:Number;// = 0
private var flowerTargetloopCount;// = 0
private var areaHalfHeight:Number;// = 200
private var areaHalfWidth:Number;// = 200
private var beeMovementStatus:Number;// = 0
private var loopCount:Number;// = 0
private var targetFlowerIndex:Number;// = 0
public function FriendTerritoryBee(){
minX = 0;
maxX = 0;
minY = 0;
maxY = 0;
areaHalfWidth = 200;
areaHalfHeight = 200;
bounce = -1;
targetFlowerPos = new Point();
RTD = (180 / Math.PI);
movementType = 0;
angularVel = 0;
center = new Point();
prevPos = new Point();
targetFlowersArray = new Array();
loopCount = 0;
beeMovementStatus = 0;
targetFlowerIndex = 0;
flowerTargetloopCount = 0;
jumpCount = 0;
moveUp = false;
deltaAngular = 0;
super();
speedMax = 3;
speedMin = 1.2;
minWidth = (halfWidth * 2);
minHeight = (halfHeight * 2);
}
public function setParameters(_arg1:Array){
var _local2:Number;
var _local3:Number;
var _local4:Number;
this.x = _arg1[0].x;
this.y = _arg1[0].y;
_local2 = 1;
while (_local2 < _arg1.length) {
targetFlowersArray.push(_arg1[_local2]);
_local2++;
};
center.x = this.x;
center.y = this.y;
prevPos.x = this.x;
prevPos.y = this.y;
radiusX = ((Math.random() * 100) + 100);
radiusY = ((Math.random() * 100) + 100);
minX = (this.x - areaHalfWidth);
maxX = (this.x + areaHalfWidth);
minY = (this.y - areaHalfHeight);
maxY = (this.y + areaHalfHeight);
_local3 = (Math.PI / 4);
velocity.x = (Math.cos(_local3) * speed);
velocity.y = (Math.sin(_local3) * speed);
angularVel = ((Math.PI / 2) * 3);
this.rotation = (((angularVel - ((Math.PI / 2) * 3)) * 180) / Math.PI);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusY));
_local4 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = (30 / _local4);
beeMovementStatus = 0;
}
public function setTargetFlowerPosition(_arg1:Number, _arg2:Number){
targetFlowerPos.x = _arg1;
targetFlowerPos.y = _arg2;
}
private function moveBounceOnToFlower(){
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:Number;
if (moveUp == true){
this.y = (this.y - speed);
if (loopCount == flowerTargetloopCount){
moveUp = false;
loopCount = 0;
flowerTargetloopCount = 15;
};
} else {
this.y = (this.y + speed);
if (loopCount == flowerTargetloopCount){
jumpCount = (jumpCount + 1);
if (jumpCount != 5){
moveUp = true;
loopCount = 0;
flowerTargetloopCount = 20;
} else {
jumpCount = 0;
beeMovementStatus = 0;
speed = speedMax;
_local1 = (this.x - center.x);
_local2 = (this.y - center.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
angularVel = Math.atan2(_local2, _local1);
if (_local3 > 200){
radiusY = _local3;
radiusX = (_local3 - (Math.random() * 100));
} else {
radiusY = _local3;
radiusX = ((Math.random() * 100) + _local3);
};
_local4 = (((2 * Math.PI) * (radiusX + radiusY)) / 2);
deltaAngular = (30 / _local4);
};
};
};
}
private function moveInSlope(){
var _local1:Number;
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
_local1 = 0;
if (this.x <= minX){
this.x = minX;
velocity.x = (velocity.x * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.x >= maxX){
this.x = maxX;
velocity.x = (velocity.x * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.y <= minY){
this.y = minY;
velocity.y = (velocity.y * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
} else {
if (this.y >= maxY){
this.y = maxY;
velocity.y = (velocity.y * bounce);
_local1 = Math.atan2(velocity.y, velocity.x);
this.rotation = (((_local1 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
};
};
};
};
}
private function moveSitOnFlower(){
if (loopCount == flowerTargetloopCount){
beeMovementStatus = 3;
loopCount = 0;
flowerTargetloopCount = 60;
moveUp = true;
};
}
private function moveCircular(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
angularVel = (angularVel + deltaAngular);
this.x = (center.x + (Math.cos(angularVel) * radiusX));
this.y = (center.y + (Math.sin(angularVel) * radiusY));
_local1 = (this.x - prevPos.x);
_local2 = (this.y - prevPos.y);
_local3 = Math.atan2(_local2, _local1);
prevPos.x = this.x;
prevPos.y = this.y;
this.rotation = (((_local3 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
if (loopCount == 300){
beeMovementStatus = 1;
setTargetFlower();
loopCount = 0;
};
}
private function moveTowardsTargetFlower(){
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
if (loopCount >= flowerTargetloopCount){
beeMovementStatus = 2;
flowerTargetloopCount = 30;
loopCount = 0;
this.rotation = 0;
speed = speedMin;
};
}
public function setTargetFlower(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = 0;
_local2 = 0;
targetFlowerIndex = ((targetFlowerIndex + 1) % targetFlowersArray.length);
_local1 = (targetFlowersArray[targetFlowerIndex].x - this.x);
_local2 = (targetFlowersArray[targetFlowerIndex].y - this.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local4 = Math.atan2(_local2, _local1);
velocity.x = (Math.cos(_local4) * speed);
velocity.y = (Math.sin(_local4) * speed);
this.rotation = (((_local4 - ((Math.PI / 2) * 3)) * 180) / Math.PI);
flowerTargetloopCount = Math.ceil((_local3 / speed));
}
override public function moveBee():Boolean{
loopCount = (loopCount + 1);
if (beeMovementStatus == 0){
moveCircular();
} else {
if (beeMovementStatus == 1){
moveTowardsTargetFlower();
} else {
if (beeMovementStatus == 2){
moveSitOnFlower();
} else {
if (beeMovementStatus == 3){
moveBounceOnToFlower();
} else {
if (beeMovementStatus == 4){
moveInSlope();
};
};
};
};
};
return (true);
}
}
}//package
Section 82
//GameOver (GameOver)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
public class GameOver extends MovieClip {
public var colonySize:TextField;
public var errormesg:TextField;
public var playerName:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var bonus:TextField;
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var playMore:SimpleButton;
public var totalScore:TextField;
public var playAgain:SimpleButton;
private static var gameOver:GameOver = null;
public function GameOver(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
addFrameScript(29, frame30);
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
gotoAndPlay(1);
this.bonus.text = GParams.bonusPoints.toString();
this.totalScore.text = GParams.scoreValue.toString();
this.colonySize.text = GParams.totalColonySize.toString();
}
function frame30(){
stop();
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():GameOver{
if (gameOver == null){
gameOver = new (GameOver);
};
return (gameOver);
}
}
}//package
Section 83
//GameOverSound (GameOverSound)
package {
import flash.media.*;
public dynamic class GameOverSound extends Sound {
}
}//package
Section 84
//Garden (Garden)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
public class Garden extends MovieClip {
protected var extractHoneyTimer:Timer;// = null
public var dynamicWorkerBees:Array;
public var permanentBeeCount:int;// = 0
public var territoryWorkerBees:Array;
private var twoPIByThree:Number;// = 2.0943951023932
public var permanentBeeGenerate:int;// = 0
protected var randomPositionArray:Array;// = null
public var flowerArray:Array;
protected var workerBees:Array;
public var blackBees:Array;
public var honeyBottle:HoneyBottle;// = null
public var lives:Number;
protected var fadeFlowerIndex:Number;// = -1
protected var totalcoins:Number;// = 0
protected var woodCutterInsects:Array;
protected var twoPI:Number;// = 6.28318530717959
private var dbcount:Number;// = 0
protected var dynamicWorkerBeeCount:Number;// = 2
public var coinsArray:Array;// = null
public var coinGenerateCount:int;// = 0
public var totalFlowerCount:Number;// = 0
public var remainingFlowerCount:Number;// = 0
public var showHoneyBottle:Number;// = 0
protected var extractHoneyClip:ExtractHoney;// = null
public var enemyArray:Array;
public var staticWorkerBees:Array;
protected var mcExtractHoney:Array;
private var PIByTwo:Number;// = 1.5707963267949
protected var powerCoins:Number;// = 0
public function Garden(){
flowerArray = new Array();
enemyArray = new Array();
dbcount = 0;
extractHoneyClip = null;
mcExtractHoney = new Array("flower1", "flower2", "flower3", "flower4", "flower5", "flower6", "flower7", "flower8");
extractHoneyTimer = null;
fadeFlowerIndex = -1;
remainingFlowerCount = 0;
totalFlowerCount = 0;
lives = GParams.totalLives;
workerBees = new Array();
twoPI = (Math.PI * 2);
twoPIByThree = ((Math.PI * 2) / 3);
PIByTwo = (Math.PI / 2);
staticWorkerBees = new Array();
territoryWorkerBees = new Array();
dynamicWorkerBees = new Array();
blackBees = new Array();
dynamicWorkerBeeCount = 2;
randomPositionArray = null;
powerCoins = 0;
totalcoins = 0;
coinsArray = null;
woodCutterInsects = new Array();
showHoneyBottle = 0;
honeyBottle = null;
permanentBeeCount = 0;
permanentBeeGenerate = 0;
coinGenerateCount = 0;
super();
}
public function createPowerCoins(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
coinGenerateCount = (coinGenerateCount + 1);
totalcoins = GParams.totalcoins[(GParams.currentLevel - 1)];
coinsArray = new Array(totalcoins);
_local1 = Math.ceil((Math.random() * 10));
_local2 = _local1;
_local3 = GParams.powerupPosL1[(GParams.currentLevel - 1)].length;
_local4 = 0;
while (_local4 < totalcoins) {
_local2 = ((_local2 + 3) % _local3);
if (checkIfInVisibleArea(GParams.powerupPosL1[(GParams.currentLevel - 1)][_local2].x, GParams.powerupPosL1[(GParams.currentLevel - 1)][_local2].y) == true){
_local4--;
} else {
coinsArray[_local4] = CoinFactory.getCoin();
addChild(coinsArray[_local4]);
if ((_local4 % 2) == 0){
coinsArray[_local4].init(true);
} else {
coinsArray[_local4].init(false);
};
coinsArray[_local4].x = GParams.powerupPosL1[(GParams.currentLevel - 1)][_local2].x;
coinsArray[_local4].y = GParams.powerupPosL1[(GParams.currentLevel - 1)][_local2].y;
};
_local4++;
};
}
public function generateWorkerBees(){
var _local1:Boolean;
var _local2:FriendBee;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local1 = false;
if (dynamicWorkerBees.length < dynamicWorkerBeeCount){
_local2 = WorkerFactory.getBeeDynamicInstance();
dbcount = (dbcount + 1);
dynamicWorkerBees.push(_local2);
_local3 = (GardenGame.garden.scrollRect.x - 50);
_local4 = (GardenGame.garden.scrollRect.x + (GParams.gardenViewWidth + 50));
_local5 = (GardenGame.garden.scrollRect.y - 50);
_local6 = (GardenGame.garden.scrollRect.y + (GParams.gardenViewHeight + 50));
_local7 = (Math.random() * 10);
_local8 = Math.random();
_local7 = 1.5;
if (_local7 <= 2.5){
_local9 = _local3;
_local10 = (_local5 + (_local8 * GParams.gardenViewHeight));
if (_local10 > (_local6 - (GParams.gardenViewHeight / 2))){
_local11 = ((Math.PI / 180) * (270 + (Math.random() * 90)));
} else {
_local11 = ((Math.PI / 180) * (Math.random() * 90));
};
_local1 = true;
addChild(dynamicWorkerBees[(dynamicWorkerBees.length - 1)]);
dynamicWorkerBees[(dynamicWorkerBees.length - 1)].init(_local9, _local10, _local11, _local1);
return;
} else {
if (_local7 < 7.5){
_local10 = _local5;
_local9 = (_local3 + (_local8 * GParams.gardenViewWidth));
if (_local9 > (_local4 - (GParams.gardenViewWidth / 2))){
_local11 = ((Math.PI / 180) * (90 + (Math.random() * 90)));
} else {
_local11 = ((Math.PI / 180) * (Math.random() * 90));
};
addChild(dynamicWorkerBees[(dynamicWorkerBees.length - 1)]);
dynamicWorkerBees[(dynamicWorkerBees.length - 1)].init(_local9, _local10, _local11, _local1);
return;
} else {
if (_local7 < 5){
_local9 = _local4;
_local10 = (_local5 + (_local8 * GParams.gardenViewHeight));
if (_local10 > (_local6 - (GParams.gardenViewHeight / 2))){
_local11 = ((Math.PI / 180) * (180 + (Math.random() * 90)));
} else {
_local11 = ((Math.PI / 180) * (90 + (Math.random() * 90)));
};
_local1 = true;
addChild(dynamicWorkerBees[(dynamicWorkerBees.length - 1)]);
dynamicWorkerBees[(dynamicWorkerBees.length - 1)].init(_local9, _local10, _local11, _local1);
return;
} else {
_local10 = _local6;
_local9 = (_local3 + (_local8 * GParams.gardenViewWidth));
if (_local9 > (_local4 - (GParams.gardenViewWidth / 2))){
_local11 = ((Math.PI / 180) * (180 + (Math.random() * 90)));
} else {
_local11 = ((Math.PI / 180) * (270 + (Math.random() * 90)));
};
addChild(dynamicWorkerBees[(dynamicWorkerBees.length - 1)]);
dynamicWorkerBees[(dynamicWorkerBees.length - 1)].init(_local9, _local10, _local11, _local1);
return;
};
};
};
};
}
public function decrementLife():Boolean{
SoundControl.lls.play();
GParams.totalLives = (GParams.totalLives - 1);
if (GParams.totalLives < 1){
GardenGame.setGameStatus = 0;
return (false);
};
return (true);
}
public function resetLevelStats(){
var _local1:Number;
dbcount = 0;
remainingFlowerCount = totalFlowerCount;
GParams.currentColonySize = 0;
showHoneyBottle = 0;
permanentBeeGenerate = 0;
permanentBeeCount = 0;
coinGenerateCount = 0;
_local1 = 0;
_local1 = 0;
while (_local1 < flowerArray.length) {
flowerArray[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1].reinit();
_local1++;
};
_local1 = (coinsArray.length - 1);
while (_local1 >= 0) {
coinsArray.pop();
_local1--;
};
this.gotoAndStop(2);
}
public function removeStaticWorkerBee(_arg1:Number, _arg2:Boolean=true){
var _local3:Number;
var _local4:Number;
_local3 = staticWorkerBees[_arg1].x;
_local4 = staticWorkerBees[_arg1].y;
if (contains(staticWorkerBees[_arg1])){
removeChild(staticWorkerBees[_arg1]);
};
staticWorkerBees.splice(_arg1, 1);
if (_arg2){
displayBondingAnimation(_local3, _local4);
};
permanentBeeCount = (permanentBeeCount - 1);
}
public function showHoney(){
var _local1:Point;
_local1 = getRandomPos();
honeyBottle.init(_local1);
showHoneyBottle = 2;
addChild(honeyBottle);
}
public function createHoneyBottle(){
honeyBottle = new HoneyBottle();
}
protected function incrementExtractHoney(_arg1:Number){
}
public function displayCoinTouchAnimation(_arg1:Number, _arg2:Number){
var _local3:TouchPowerUp;
_local3 = VanishFactory.getCoinTouchInstance();
_local3.init(_arg1, _arg2);
addChild(_local3);
}
public function createPermanentBees(){
var staticBees:Number;
var terriPos:Array;
var blackPos:Array;
var pos:Number;
var angle:Number;
var index:int;
var terriBees:Number;
var posIndex:Number;
var posArray:Array;
var blackBeeCount:Number;
try {
permanentBeeGenerate = (permanentBeeGenerate + 1);
staticBees = GParams.beeCount[(GParams.currentLevel - 1)][0];
terriPos = GParams.randomPosTerritoryBee[(GParams.currentLevel - 1)];
blackPos = GParams.randomPosBlackBee[(GParams.currentLevel - 1)];
pos = 0;
angle = (Math.random() * twoPI);
pos = Math.floor((Math.random() * flowerArray.length));
index = 0;
permanentBeeCount = staticBees;
index = 0;
while (index < staticBees) {
pos = ((pos + 5) % flowerArray.length);
if (checkIfInVisibleArea(flowerArray[pos].x, (flowerArray[pos].y - 10)) == true){
index = (index - 1);
} else {
staticWorkerBees.push(WorkerFactory.getBeeStaticInstance());
staticWorkerBees[index].rotation = (Math.random() * 360);
staticWorkerBees[index].x = flowerArray[pos].x;
staticWorkerBees[index].y = (flowerArray[pos].y - 10);
addChild(staticWorkerBees[index]);
};
index = (index + 1);
};
terriBees = GParams.beeCount[(GParams.currentLevel - 1)][1];
permanentBeeCount = (permanentBeeCount + terriBees);
posIndex = Math.floor((Math.random() * terriPos.length));
posArray = terriPos[posIndex];
index = 0;
while (index < terriBees) {
if (index < 0){
} else {
posIndex = ((posIndex + 1) % terriPos.length);
if (checkIfInVisibleArea(flowerArray[pos].x, (flowerArray[pos].y - 10)) == true){
pos = ((pos + 3) % flowerArray.length);
index = (index - 1);
} else {
territoryWorkerBees.push(WorkerFactory.getBeeTerritoryInstance());
territoryWorkerBees[index].x = flowerArray[pos].x;
territoryWorkerBees[index].y = flowerArray[pos].y;
posArray = terriPos[posIndex];
territoryWorkerBees[index].setParameters(posArray);
addChild(territoryWorkerBees[index]);
};
};
index = (index + 1);
};
if ((((GParams.currentLevel >= 3)) && ((permanentBeeGenerate == 1)))){
blackBeeCount = GParams.beeCount[(GParams.currentLevel - 1)][3];
posIndex = Math.floor((Math.random() * blackPos.length));
posArray = blackPos[posIndex];
index = 0;
while (index < blackBeeCount) {
blackBees.push(WorkerFactory.getForestBeeInstance());
addChild(blackBees[index]);
pos = ((pos + 3) % flowerArray.length);
blackBees[index].x = flowerArray[pos].x;
blackBees[index].y = flowerArray[pos].y;
posArray = blackPos[posIndex];
blackBees[index].setParameters(posArray);
posIndex = ((posIndex + 1) % blackPos.length);
index = (index + 1);
};
};
} catch(e:Error) {
};
}
public function displayExtractHoneyClip(_arg1:Number){
var _local2:Number;
HoneyBee.honeyBee.isExtracting = true;
HoneyBee.honeyBee.incrementHealth();
_local2 = (flowerArray[_arg1].flowerType - 1);
extractHoneyClip.y = flowerArray[_arg1].y;
extractHoneyClip.x = flowerArray[_arg1].x;
addChild(extractHoneyClip);
extractHoneyClip.gotoAndPlay(mcExtractHoney[_local2]);
extractHoneyTimer.reset();
extractHoneyTimer.start();
HoneyBee.honeyBee.visible = false;
HoneyBee.honeyBee.removeEventListener(Event.ENTER_FRAME, HoneyBee.honeyBee.onEnterFrame);
fadeFlowerIndex = _arg1;
GardenGame.extractKeyDown = false;
SoundControl.ehs.play();
}
protected function createExtractHoneyTimer(){
extractHoneyTimer = new Timer(500, 2);
extractHoneyTimer.addEventListener(TimerEvent.TIMER_COMPLETE, extractHoneyComplete);
extractHoneyTimer.reset();
extractHoneyTimer.stop();
}
public function checkWorkerBeeCollision(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < dynamicWorkerBees.length) {
if (dynamicWorkerBees[_local1].checkHoneyBeeCollision() == true){
incrementColonySize();
removeDynamicWorkerBee(_local1);
return;
};
_local1++;
};
_local1 = 0;
while (_local1 < territoryWorkerBees.length) {
if (territoryWorkerBees[_local1].checkHoneyBeeCollision() == true){
incrementColonySize();
removeTerritoryWorkerBee(_local1);
return;
};
_local1++;
};
_local1 = 0;
while (_local1 < staticWorkerBees.length) {
if (staticWorkerBees[_local1].checkHoneyBeeCollision() == true){
incrementColonySize();
removeStaticWorkerBee(_local1);
return;
};
_local1++;
};
_local1 = 0;
while (_local1 < blackBees.length) {
if (blackBees[_local1].checkHoneyBeeCollision() == true){
return;
};
_local1++;
};
}
public function addEnemyListeners(){
var _local1:Number;
_local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1].addTimelineListener();
_local1++;
};
}
public function extractHoneyComplete(_arg1:TimerEvent){
var _local2:Number;
flowerArray[fadeFlowerIndex].fade();
if (contains(extractHoneyClip)){
removeChild(extractHoneyClip);
};
HoneyBee.honeyBee.addEventListener(Event.ENTER_FRAME, HoneyBee.honeyBee.onEnterFrame);
HoneyBee.honeyBee.visible = true;
fadeFlowerIndex = -1;
remainingFlowerCount = (remainingFlowerCount - 1);
_local2 = (remainingFlowerCount / totalFlowerCount);
if ((((_local2 < 0.4)) && ((showHoneyBottle == 0)))){
showHoneyBottle = 1;
};
HoneyBee.honeyBee.isExtracting = false;
}
public function createExtractHoneyClip(){
extractHoneyClip = ExtractHoney.getInstance();
}
public function removeTerritoryWorkerBee(_arg1:Number, _arg2:Boolean=true){
var _local3:Number;
var _local4:Number;
_local3 = territoryWorkerBees[_arg1].x;
_local4 = territoryWorkerBees[_arg1].y;
if (contains(territoryWorkerBees[_arg1])){
removeChild(territoryWorkerBees[_arg1]);
};
territoryWorkerBees.splice(_arg1, 1);
if (_arg2){
displayBondingAnimation(_local3, _local4);
};
permanentBeeCount = (permanentBeeCount - 1);
}
public function removeBees(){
var _local1:uint;
_local1 = 0;
_local1 = 0;
while (_local1 < dynamicWorkerBees.length) {
if (contains(dynamicWorkerBees[_local1])){
removeChild(dynamicWorkerBees[_local1]);
};
_local1++;
};
_local1 = 0;
while (_local1 < territoryWorkerBees.length) {
if (contains(territoryWorkerBees[_local1])){
removeChild(territoryWorkerBees[_local1]);
};
_local1++;
};
_local1 = 0;
while (_local1 < staticWorkerBees.length) {
if (contains(staticWorkerBees[_local1])){
removeChild(staticWorkerBees[_local1]);
};
_local1++;
};
_local1 = 0;
while (_local1 < blackBees.length) {
if (contains(blackBees[_local1])){
removeChild(blackBees[_local1]);
};
_local1++;
};
if (woodCutterInsects[0] != null){
if (contains(woodCutterInsects[0])){
removeChild(woodCutterInsects[0]);
};
};
if (FairyBee.fairy != null){
if (contains(FairyBee.fairy)){
removeChild(FairyBee.fairy);
};
};
}
public function createFlowers(){
}
public function moveWoodCutterBee(){
var _local1:Number;
_local1 = 0;
while (_local1 < woodCutterInsects.length) {
if (woodCutterInsects[_local1].moveBee() == false){
if (contains(woodCutterInsects[_local1])){
removeChild(woodCutterInsects[_local1]);
};
woodCutterInsects.splice(_local1, 1);
};
_local1++;
};
if (honeyBottle != null){
if (honeyBottle.isActive){
if (honeyBottle.getBeeCollision() == true){
HoneyBee.honeyBee.healthLine = 1;
honeyBottle.disappear();
};
};
};
}
public function displayBondingAnimation(_arg1:Number, _arg2:Number){
var _local3:FriendshipSuccess;
_local3 = VanishFactory.getBondingInstance();
_local3.init(_arg1, _arg2);
addChild(_local3);
}
public function incrementColonySize(){
GParams.totalColonySize = (GParams.totalColonySize + 1);
GParams.currentColonySize = (GParams.currentColonySize + 1);
GParams.incrementScore(GParams.colonyIncrementPoint);
SoundControl.fs.play();
}
public function setRandomPositionArray(){
randomPositionArray = GParams.randomPosTerritoryBee[(GParams.currentLevel - 1)];
}
public function checkFlowerCollision():Number{
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local2 = 0;
for (;_local2 < flowerArray.length;_local2++) {
_local1 = (_local2 % flowerArray.length);
if (!flowerArray[_local1].containsHoney()){
} else {
if (flowerArray[_local1].checkBeeCollision() == true){
if (flowerArray[_local1].flowerStatus == 1){
return (_local1);
};
continue;
};
};
};
return (-1);
}
public function incrementLife(){
GParams.totalLives = (GParams.totalLives + 1);
Life.life.gotoAndStop(1);
SoundControl.lgs.play();
}
public function generateFairyBee(){
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:int;
_local1 = false;
FairyBee.createFairy();
_local2 = (GardenGame.garden.scrollRect.x - 50);
_local3 = (GardenGame.garden.scrollRect.x + (GParams.gardenViewWidth + 50));
_local4 = (GardenGame.garden.scrollRect.y - 50);
_local5 = (GardenGame.garden.scrollRect.y + (GParams.gardenViewHeight + 50));
_local6 = Math.random();
_local7 = Math.random();
_local13 = 0;
_local14 = 0;
_local15 = 0;
if (_local6 <= 5){
_local8 = _local2;
_local9 = (_local4 + (_local7 * GParams.gardenViewHeight));
_local14 = 1;
_local15 = (GParams.gardenWidth + 50);
} else {
_local8 = _local3;
_local9 = (_local4 + (_local7 * GParams.gardenViewHeight));
_local14 = -1;
_local15 = -50;
};
FairyBee.fairy.initFairy(_local8, _local9, _local14, _local15);
addChild(FairyBee.fairy);
}
public function removeEnemyListeners(){
var _local1:Number;
_local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1].removeTimelineListener();
_local1++;
};
}
public function generateWoodCutterInsect(){
var _local1:Boolean;
var _local2:ForestBee;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local1 = false;
_local2 = WoodCutterFactory.getWoodCutterInstance();
woodCutterInsects.push(_local2);
_local3 = (GardenGame.garden.scrollRect.x - 50);
_local4 = (GardenGame.garden.scrollRect.x + (GParams.gardenViewWidth + 50));
_local5 = (GardenGame.garden.scrollRect.y - 50);
_local6 = (GardenGame.garden.scrollRect.y + (GParams.gardenViewHeight + 50));
_local7 = (Math.random() * 10);
_local8 = Math.random();
_local14 = 0;
if (_local7 <= 2.5){
_local9 = _local3;
_local10 = (_local5 + (_local8 * GParams.gardenViewHeight));
} else {
if (_local7 < 5){
_local9 = _local4;
_local10 = (_local5 + (_local8 * GParams.gardenViewHeight));
} else {
if (_local7 < 7.5){
_local10 = _local5;
_local9 = (_local3 + (_local8 * GParams.gardenViewWidth));
} else {
_local10 = _local6;
_local9 = (_local3 + (_local8 * GParams.gardenViewWidth));
};
};
};
addChild(woodCutterInsects[(woodCutterInsects.length - 1)]);
woodCutterInsects[(woodCutterInsects.length - 1)].init(_local9, _local10);
}
public function removeDynamicWorkerBee(_arg1:Number, _arg2:Boolean=true){
var _local3:Number;
var _local4:Number;
_local3 = dynamicWorkerBees[_arg1].x;
_local4 = dynamicWorkerBees[_arg1].y;
if (contains(dynamicWorkerBees[_arg1])){
removeChild(dynamicWorkerBees[_arg1]);
//unresolved jump
};
dynamicWorkerBees.splice(_arg1, 1);
if (_arg2){
displayBondingAnimation(_local3, _local4);
};
}
public function addEnemy(_arg1:MovieClip){
enemyArray.push(_arg1);
}
public function makeHoneyLessFlowers(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = flowerArray.length;
_local2 = Math.ceil((_local1 * GParams.honeyLessFlowerPercent[(GParams.currentLevel - 1)]));
if (_local2 == 0){
return;
};
_local3 = Math.floor((Math.random() * _local1));
_local4 = 0;
while (_local4 < _local2) {
flowerArray[_local3].fade();
_local3 = ((_local3 + 3) % _local1);
_local4++;
};
}
private function checkIfInVisibleArea(_arg1:int, _arg2:int):Boolean{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
if (this.scrollRect == null){
return (false);
};
_local3 = scrollRect.x;
_local4 = scrollRect.y;
_local5 = (_local3 + GParams.gardenViewWidth);
_local6 = (_local4 + GParams.gardenViewHeight);
if ((((((((_arg1 > _local3)) && ((_arg1 < _local5)))) && ((_arg2 > _local4)))) && ((_arg2 < _local6)))){
return (true);
};
return (false);
}
public function checkCoinCollision(){
var _local1:Number;
var _local2:uint;
_local1 = 0;
while (_local1 < coinsArray.length) {
if (coinsArray[_local1].getBeeCollision() == true){
SoundControl.tps.play();
_local2 = GParams.incrementPartialLife();
if (_local2 == 100){
incrementLife();
GParams.accumulatedLife = 0;
};
displayCoinTouchAnimation(coinsArray[_local1].x, coinsArray[_local1].y);
if (contains(coinsArray[_local1])){
removeChild(coinsArray[_local1]);
};
coinsArray.splice(_local1, 1);
break;
};
_local1++;
};
}
public function blossomAll(){
var _local1:Number;
_local1 = 0;
while (_local1 < flowerArray.length) {
flowerArray[_local1].setFlowerStatus(1);
_local1++;
};
}
public function moveWorkerBees(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < territoryWorkerBees.length) {
territoryWorkerBees[_local1].moveBee();
_local1++;
};
_local1 = 0;
while (_local1 < blackBees.length) {
blackBees[_local1].moveBee();
_local1++;
};
_local1 = 0;
while (_local1 < dynamicWorkerBees.length) {
if (dynamicWorkerBees[_local1].moveBee() == false){
removeDynamicWorkerBee(_local1, false);
};
_local1++;
};
}
public function createEnemies(){
}
public function checkEnemyCollision(){
var _local1:Number;
_local1 = 0;
while (_local1 < enemyArray.length) {
if ((((HoneyBee.honeyBee.isShielded == false)) && ((enemyArray[_local1].checkCollision() == true)))){
SoundControl.tcs.play();
enemyArray[_local1].gotoAndPlay(3);
enemyArray[_local1].addTimelineListener();
enemyArray.splice(_local1, 1);
break;
};
_local1++;
};
}
private function getRandomPos():Point{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Point;
_local1 = (GardenGame.garden.scrollRect.x - 50);
_local2 = (GardenGame.garden.scrollRect.x + (GParams.gardenViewWidth + 50));
_local3 = (GardenGame.garden.scrollRect.y - 50);
_local4 = (GardenGame.garden.scrollRect.y + (GParams.gardenViewHeight + 50));
_local5 = (Math.random() * 10);
_local6 = Math.random();
_local10 = new Point();
if (_local5 <= 2.5){
_local10.x = _local1;
_local10.y = (_local3 + (_local6 * GParams.gardenViewHeight));
} else {
if (_local5 < 5){
_local10.x = _local2;
_local10.y = (_local3 + (_local6 * GParams.gardenViewHeight));
} else {
if (_local5 < 7.5){
_local10.y = _local3;
_local10.x = (_local1 + (_local6 * GParams.gardenViewWidth));
} else {
_local10.y = _local4;
_local10.x = (_local1 + (_local6 * GParams.gardenViewWidth));
};
};
};
return (_local10);
}
}
}//package
Section 85
//GardenFive (GardenFive)
package {
public class GardenFive extends Garden {
public var corni2:FlowerPoison;
public var corni5:FlowerCornivorous;
public var corni6:FlowerPoison;
public var corni1:FlowerCornivorous;
public var corni3:FlowerCornivorous;
public var corni4:FlowerPoison;
public var flower1:FlowerSeven;
public var flower3:FlowerSeven;
public var flower4:FlowerOne;
public var flower5:FlowerSix;
public var flower8:FlowerOne;
public var flower6:FlowerSix;
public var flower7:FlowerOne;
public var flower9:FlowerOne;
public var flower2:FlowerOne;
public var flower11:FlowerOne;
public var flower12:FlowerSix;
public var flower13:FlowerSix;
public var flower14:FlowerSix;
public var flower16:FlowerFour;
public var flower17:FlowerFour;
public var flower19:FlowerTwo;
public var flower10:FlowerSeven;
public var flower15:FlowerSix;
public var flower18:FlowerTwo;
public function GardenFive(){
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
makeHoneyLessFlowers();
createEnemies();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
createPermanentBees();
dynamicWorkerBeeCount = 4;
setRandomPositionArray();
createHoneyBottle();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray.push(this.flower1);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower2);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower3);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower4);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower5);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower6);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower8);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower9);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower10);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower11);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower12);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower13);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower14);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower15);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower16);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower17);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
_local1 = (_local1 + 1);
flowerArray.push(this.flower18);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
}
override public function createEnemies(){
var _local1:*;
_local1 = 0;
enemyArray.push(this.corni1);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni2);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni3);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni4);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni5);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni6);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
}
}
}//package
Section 86
//GardenFour (GardenFour)
package {
public class GardenFour extends Garden {
public var corni2:FlowerPoison;
public var corni1:FlowerPoison;
public var corni3:FlowerPoison;
public var corni4:FlowerPoison;
public var flower1:FlowerFive;
public var flower3:FlowerThree;
public var flower4:FlowerThree;
public var flower5:FlowerEight;
public var flower8:FlowerFive;
public var flower6:FlowerFive;
public var flower7:FlowerThree;
public var flower9:FlowerThree;
public var flower2:FlowerFive;
public var flower11:FlowerThree;
public var flower13:FlowerThree;
public var flower16:FlowerThree;
public var flower17:FlowerThree;
public var flower12:FlowerThree;
public var flower14:FlowerThree;
public var flower19:FlowerEight;
public var flower15:FlowerThree;
public var flower18:FlowerFive;
public var flower10:FlowerThree;
public var flower20:FlowerEight;
public var flower21:FlowerFive;
public var flower22:FlowerFive;
public var flower25:FlowerOne;
public var flower28:FlowerFive;
public var flower23:FlowerEight;
public var flower24:FlowerFive;
public var flower26:FlowerOne;
public var flower27:FlowerFive;
public function GardenFour(){
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
makeHoneyLessFlowers();
createEnemies();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
createPermanentBees();
dynamicWorkerBeeCount = 3;
setRandomPositionArray();
createHoneyBottle();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray.push(this.flower1);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower2);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower3);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower4);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower5);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower6);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower7);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower8);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower9);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower10);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower11);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower12);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower13);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower14);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower15);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower16);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower17);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower18);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower19);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower20);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower21);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower22);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower23);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower24);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower25);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower26);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower27);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower28);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
}
override public function createEnemies(){
var _local1:*;
_local1 = 0;
enemyArray.push(this.corni1);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni2);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni3);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni4);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
}
}
}//package
Section 87
//GardenGame (GardenGame)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
public class GardenGame extends MovieClip {
public var showFairy:Boolean;// = false
public var woodCutterInsetMaxCount:Number;// = 0
private var welcomePage:Welcome;// = null
private var levelPage:Levels;// = null
private var generateWorkerBeeCount:Number;// = 0
private var youWin:YouWin;// = null
var timer:Timer;
private var prevMouseX:Number;// = 0
private var generateWorkerBeeMaxCount:Number;// = 0
public var woodCutterInsectAttackCount:Number;// = 0
private var prevMouseY:Number;// = 0
public var showWoodCutter:Boolean;// = false
public var fairyBeeMaxCount:uint;// = 0
var levelStartTimer:Timer;
public var fairyBeeCount:uint;// = 0
public var woodCutterInsetCount:Number;// = 0
private var gameOver:GameOver;// = null
var _channel:SoundChannel;
public static var upKeyDown:Boolean = false;
public static var setGameStatus:Number = -1;
public static var leftKeyDown:Boolean = false;
public static var beeLife:BeeLife = null;
public static var downKeyDown:Boolean = false;
public static var extractKeyDown:Boolean = false;
public static var extractKeyPressed:Boolean = false;
public static var rightKeyDown:Boolean = false;
public static var scrollRectangle:Rectangle = null;
public static var rectMaxScrollX:Number = (GParams.gardenWidth - GParams.gardenViewWidth);
public static var rectMaxScrollY:Number = (GParams.gardenHeight - GParams.gardenViewHeight);
public static var garden:Garden = null;
public static var attackKeyDown:Boolean = false;
public static var scrollSpeed:Number = 10;
public function GardenGame(){
prevMouseX = 0;
prevMouseY = 0;
welcomePage = null;
levelPage = null;
gameOver = null;
youWin = null;
generateWorkerBeeCount = 0;
generateWorkerBeeMaxCount = 0;
woodCutterInsetCount = 0;
woodCutterInsetMaxCount = 0;
woodCutterInsectAttackCount = 0;
fairyBeeMaxCount = 0;
fairyBeeCount = 0;
showFairy = false;
showWoodCutter = false;
super();
timer = new Timer(1000, GParams.timeLimit[(GParams.currentLevel - 1)]);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.stop();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, timeout);
scrollRectangle = new Rectangle(0, 0, GParams.gardenViewWidth, GParams.gardenViewHeight);
new SoundControl();
init();
}
public function clickPlayAgain(_arg1:MouseEvent){
clearGraphics();
createWelcome();
}
private function stopSounds(){
SoundMixer.stopAll();
if (_channel != null){
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
_channel.removeEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
_channel.removeEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
};
}
public function createGameOver(){
clearGraphics();
gameOver = GameOver.getInstance();
gameOver.updateScores();
addChild(gameOver);
gameOver.x = GParams.stageCenter.x;
gameOver.y = GParams.stageCenter.y;
gameOver.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOver.submitScore.addEventListener(MouseEvent.CLICK, submitScoreOnGameOver);
_channel = SoundControl.gos.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
}
public function clearGraphics(){
stopSounds();
removeEventListener(MouseEvent.CLICK, checkMouseClick);
if (Life.life != null){
if (this.contains(Life.life)){
removeChild(Life.life);
};
};
if (GardenGame.garden != null){
garden.removeEnemyListeners();
garden.removeBees();
GardenGame.garden.resetLevelStats();
if (contains(GardenGame.garden)){
removeChild(GardenGame.garden);
};
};
if (welcomePage != null){
if (contains(welcomePage)){
removeChild(welcomePage);
};
};
if (levelPage != null){
if (contains(levelPage)){
removeChild(levelPage);
};
};
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
};
};
if (youWin != null){
if (contains(youWin)){
removeChild(youWin);
};
};
}
public function init(){
createWelcome();
}
private function checkMouseClick(_arg1:MouseEvent){
stage.focus = this;
stage.stageFocusRect = false;
leftKeyDown = false;
rightKeyDown = false;
upKeyDown = false;
downKeyDown = false;
}
public function displayHighScoreScreen(){
createWelcome();
fetchHighScore(null);
welcomePage.setChildIndex(welcomePage.hs, 2);
}
private function initHeart(){
Life.createLife();
Life.life.init();
addChild(Life.life);
}
public function gotoNextLevel(){
var _local1:Number;
var _local2:Number;
GardenGame.garden.alpha = 0.3;
clearGraphics();
GParams.currentLevel = (GParams.currentLevel + 1);
createLevelsPage();
setWoodCutterReferences();
setFairyBeeReferences();
BorderPanel.borderPanel.resetStats();
_local1 = GParams.timeLimit[(GParams.currentLevel - 1)];
_local2 = (GParams.beeCount[(GParams.currentLevel - 1)][2] * 2);
generateWorkerBeeMaxCount = GParams.dynamicBeeFrequency[(GParams.currentLevel - 1)];
BorderPanel.borderPanel.updateGameStats(-1, _local1);
timer.reset();
timer.repeatCount = GParams.timeLimit[(GParams.currentLevel - 1)];
timer.stop();
generateWorkerBeeCount = 0;
}
public function keyUpEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = false;
break;
case 38:
upKeyDown = false;
break;
case 40:
downKeyDown = false;
break;
case 39:
rightKeyDown = false;
break;
case 49:
case 32:
if (extractKeyPressed == true){
extractKeyDown = true;
extractKeyPressed = false;
};
break;
};
_arg1.updateAfterEvent();
}
public function sendDataGameOver(_arg1:String, _arg2:Number):Boolean{
var url:String;
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
try {
url = "http://www.flasharcade.com/setscores.php";
request = new URLRequest(url);
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace018";
variables.gameName = "Honey Bee";
request.data = variables;
sendToURL(request);
} catch(e:Error) {
gameOver.setErrorMesg("Could not submit the score");
return (false);
} catch(e:SecurityError) {
gameOver.setErrorMesg("Security Error ");
return (false);
};
return (true);
}
public function sendData(_arg1:String, _arg2:Number):Boolean{
var url:String;
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
try {
url = "http://www.flasharcade.com/setscores.php";
request = new URLRequest(url);
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace018";
variables.gameName = "Honey Bee";
request.data = variables;
sendToURL(request);
} catch(e:Error) {
youWin.setErrorMesg("Could not submit the score");
return (false);
} catch(e:SecurityError) {
youWin.setErrorMesg("Security Error ");
};
return (true);
}
public function afterSecond(_arg1:TimerEvent){
BorderPanel.borderPanel.updateGameStats(timer.currentCount, timer.repeatCount);
if (woodCutterInsetCount == woodCutterInsetMaxCount){
showWoodCutter = true;
};
woodCutterInsetCount = (woodCutterInsetCount + 1);
if (fairyBeeCount == fairyBeeMaxCount){
showFairy = true;
fairyBeeCount = 0;
};
fairyBeeCount = (fairyBeeCount + 1);
}
public function gotoLEVEL1(_arg1:MouseEvent){
var _local2:Number;
var _local3:Number;
removeChild(welcomePage);
clearGraphics();
_local2 = GParams.timeLimit[(GParams.currentLevel - 1)];
_local3 = (GParams.beeCount[(GParams.currentLevel - 1)][2] * 2);
generateWorkerBeeMaxCount = GParams.dynamicBeeFrequency[(GParams.currentLevel - 1)];
GardenGame.garden = null;
startLevel(null);
generateWorkerBeeCount = 0;
}
public function createYouWin(){
clearGraphics();
youWin = YouWin.getInstance();
youWin.updateScores();
addChild(youWin);
youWin.x = GParams.stageCenter.x;
youWin.y = GParams.stageCenter.y;
youWin.playAgain1.addEventListener(MouseEvent.CLICK, clickPlayAgain);
youWin.submitScore.addEventListener(MouseEvent.CLICK, submitScore);
_channel = SoundControl.gos.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
}
public function timeout(_arg1:TimerEvent){
removeEventListener(Event.ENTER_FRAME, onEnterFrame, false);
BorderPanel.borderPanel.updateGameStats(timer.currentCount, timer.repeatCount);
clearGraphics();
showResult(0);
}
public function keyDownEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = true;
break;
case 38:
upKeyDown = true;
break;
case 40:
downKeyDown = true;
break;
case 39:
rightKeyDown = true;
break;
case 49:
case 32:
extractKeyPressed = true;
break;
};
_arg1.updateAfterEvent();
}
private function showGarden(_arg1:TimerEvent){
garden.alpha = (garden.alpha + 0.06);
}
public function completeBGSHandler(_arg1:Event){
if (_channel != null){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
_channel = SoundControl.bgs.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
};
}
public function fetchHighScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
var _local4:URLVariables;
welcomePage.setChildIndex(welcomePage.hs, 2);
welcomePage.emptyScores();
_local2 = new URLRequest("http://www.flasharcade.com/getscoresas3.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4 = new URLVariables();
_local4.gameId = "ace018";
_local2.data = _local4;
_local3.load(_local2);
_local3.addEventListener(Event.COMPLETE, completeHandler);
}
public function startLevel(_arg1:TimerEvent){
var _local2:Rectangle;
if (levelPage != null){
if (contains(levelPage)){
removeChild(levelPage);
};
};
setGameStatus = -1;
BorderPanel.createInstance();
addChild(BorderPanel.borderPanel);
BorderPanel.borderPanel.resetStats();
if (GardenGame.garden == null){
switch (GParams.currentLevel){
case 1:
garden = new SquareGarden();
break;
case 2:
garden = new GardenTwo();
break;
case 3:
garden = new GardenThree();
break;
case 4:
garden = new GardenFour();
break;
case 5:
garden = new GardenFive();
break;
case 6:
garden = new GardenSix();
break;
};
garden.cacheAsBitmap = true;
garden.scrollRect = scrollRectangle;
_local2 = garden.scrollRect;
_local2.x = (GParams.gardenCenter.x - (GParams.gardenViewWidth / 2));
_local2.y = (GParams.gardenCenter.y - (GParams.gardenViewHeight / 2));
garden.scrollRect = _local2;
addChild(garden);
garden.x = GParams.borderLeft;
garden.y = GParams.borderTop;
garden.alpha = 1;
} else {
garden.gotoAndStop(1);
};
HoneyBee.createInstance();
addChild(HoneyBee.honeyBee);
HoneyBee.honeyBee.healthLine = 1;
HoneyBee.honeyBee.x = GParams.stageCenter.x;
HoneyBee.honeyBee.y = GParams.stageCenter.y;
HoneyBee.honeyBee.addHoneyBeeListener();
initHeart();
stage.focus = this;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
timer.reset();
timer.repeatCount = GParams.timeLimit[(GParams.currentLevel - 1)];
timer.start();
_channel = SoundControl.bgs.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
}
public function createLevelsPage(){
var _local1:Rectangle;
levelPage = new Levels();
levelPage.init();
levelPage.gotoAndPlay(1);
levelPage.x = GParams.stageCenter.x;
levelPage.y = GParams.stageCenter.y;
levelStartTimer = new Timer(500, 24);
if (GardenGame.garden != null){
if (contains(GardenGame.garden)){
removeChild(GardenGame.garden);
};
};
switch (GParams.currentLevel){
case 1:
garden = new SquareGarden();
break;
case 2:
garden = new GardenTwo();
break;
case 3:
garden = new GardenThree();
break;
case 4:
garden = new GardenFour();
break;
case 5:
garden = new GardenFive();
break;
case 6:
garden = new GardenSix();
break;
};
garden.cacheAsBitmap = true;
garden.scrollRect = scrollRectangle;
_local1 = garden.scrollRect;
_local1.x = (GParams.gardenCenter.x - (GParams.gardenViewWidth / 2));
_local1.y = (GParams.gardenCenter.y - (GParams.gardenViewHeight / 2));
garden.scrollRect = _local1;
addChild(garden);
garden.x = GParams.borderLeft;
garden.y = GParams.borderTop;
garden.alpha = 0.3;
levelStartTimer.addEventListener(TimerEvent.TIMER_COMPLETE, startLevel);
levelStartTimer.addEventListener(TimerEvent.TIMER, showGarden);
levelStartTimer.start();
addChild(levelPage);
}
public function submitScore(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
youWin.setErrorMesg("");
_local2 = null;
_local2 = youWin.getPlayerName();
_local3 = GParams.scoreValue;
if (_local3 <= 0){
youWin.setErrorMesg("You cannot submit an invalid score");
} else {
if ((((_local2 == null)) || ((_local2 == "")))){
youWin.setErrorMesg("Please enter your name");
} else {
if (sendData(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
};
}
public function completeGOSoundHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
_channel = SoundControl.gos.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
}
public function createWelcome(){
GParams.resetGameStats();
clearGraphics();
welcomePage = Welcome.getInstance();
welcomePage.setChildIndex(welcomePage.ipwelcome, 2);
addChild(welcomePage);
welcomePage.x = GParams.stageCenter.x;
welcomePage.y = GParams.stageCenter.y;
GParams.currentLevel = GParams.startLevel;
welcomePage.ipwelcome.playGame.addEventListener(MouseEvent.CLICK, gotoLEVEL1);
welcomePage.ipwelcome.highScore.addEventListener(MouseEvent.CLICK, fetchHighScore);
setWoodCutterReferences();
setFairyBeeReferences();
addEventListener(MouseEvent.CLICK, checkMouseClick);
_channel = SoundControl.ws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
}
private function completeHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:URLLoader;
var _local5:String;
var _local6:Array;
_local3 = 0;
_local4 = URLLoader(_arg1.target);
_local5 = "";
_local6 = null;
if (_local4.data.data0 != undefined){
_local6 = _local4.data.data0.split("|", 3);
welcomePage.hs.player1.text = _local6[0];
welcomePage.hs.score1.text = _local6[1];
welcomePage.hs.date1.text = _local6[2];
};
if (_local4.data.data1 != undefined){
_local6 = _local4.data.data1.split("|", 3);
welcomePage.hs.player2.text = _local6[0];
welcomePage.hs.score2.text = _local6[1];
welcomePage.hs.date2.text = _local6[2];
};
if (_local4.data.data2 != undefined){
_local6 = _local4.data.data2.split("|", 3);
welcomePage.hs.player3.text = _local6[0];
welcomePage.hs.score3.text = _local6[1];
welcomePage.hs.date3.text = _local6[2];
};
if (_local4.data.data3 != undefined){
_local6 = _local4.data.data3.split("|", 3);
welcomePage.hs.player4.text = _local6[0];
welcomePage.hs.score4.text = _local6[1];
welcomePage.hs.date4.text = _local6[2];
};
if (_local4.data.data4 != undefined){
_local6 = _local4.data.data4.split("|", 3);
welcomePage.hs.player5.text = _local6[0];
welcomePage.hs.score5.text = _local6[1];
welcomePage.hs.date5.text = _local6[2];
};
if (_local4.data.data5 != undefined){
_local6 = _local4.data.data5.split("|", 3);
welcomePage.hs.player6.text = _local6[0];
welcomePage.hs.score6.text = _local6[1];
welcomePage.hs.date6.text = _local6[2];
};
if (_local4.data.data6 != undefined){
_local6 = _local4.data.data6.split("|", 3);
welcomePage.hs.player7.text = _local6[0];
welcomePage.hs.score7.text = _local6[1];
welcomePage.hs.date7.text = _local6[2];
};
if (_local4.data.data7 != undefined){
_local6 = _local4.data.data7.split("|", 3);
welcomePage.hs.player8.text = _local6[0];
welcomePage.hs.score8.text = _local6[1];
welcomePage.hs.date8.text = _local6[2];
};
if (_local4.data.data8 != undefined){
_local6 = _local4.data.data8.split("|", 3);
welcomePage.hs.player9.text = _local6[0];
welcomePage.hs.score9.text = _local6[1];
welcomePage.hs.date9.text = _local6[2];
};
if (_local4.data.data9 != undefined){
_local6 = _local4.data.data9.split("|", 3);
welcomePage.hs.player10.text = _local6[0];
welcomePage.hs.score10.text = _local6[1];
welcomePage.hs.date10.text = _local6[2];
};
}
public function setFairyBeeReferences(){
fairyBeeMaxCount = GParams.fairyBeeEntryCount[(GParams.currentLevel - 1)];
fairyBeeCount = 0;
}
private function setWoodCutterReferences(){
woodCutterInsectAttackCount = GParams.woodCutterInsectAttackCount[(GParams.currentLevel - 1)];
if (woodCutterInsectAttackCount > 0){
woodCutterInsetMaxCount = (GParams.timeLimit[(GParams.currentLevel - 1)] / (woodCutterInsectAttackCount + 1));
} else {
woodCutterInsetMaxCount = GParams.timeLimit[(GParams.currentLevel - 1)];
};
woodCutterInsetCount = 0;
}
public function onEnterFrame(_arg1:Event){
var _local2:Rectangle;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (setGameStatus >= 0){
showResult(setGameStatus);
return;
};
if (garden != null){
garden.moveWorkerBees();
garden.checkWorkerBeeCollision();
garden.checkEnemyCollision();
garden.checkCoinCollision();
garden.moveWoodCutterBee();
if ((((garden.permanentBeeCount <= 0)) && ((garden.permanentBeeGenerate < GParams.beeGenerateCount[(GParams.currentLevel - 1)])))){
if ((((garden.staticWorkerBees.length == 0)) && ((garden.territoryWorkerBees.length == 0)))){
garden.createPermanentBees();
};
};
if ((((garden.coinsArray.length <= 0)) && ((garden.coinGenerateCount < GParams.generateCoinCount[(GParams.currentLevel - 1)])))){
garden.createPowerCoins();
};
};
if (showWoodCutter == true){
garden.generateWoodCutterInsect();
showWoodCutter = false;
};
if (showFairy == true){
garden.generateFairyBee();
showFairy = false;
};
_local2 = null;
if ((((((((rightKeyDown == true)) && ((leftKeyDown == true)))) || ((((downKeyDown == true)) && ((upKeyDown == true)))))) || ((((extractKeyDown == true)) || ((extractKeyPressed == true)))))){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
return;
};
if (HoneyBee.honeyBee.isExtracting){
if (generateWorkerBeeCount == generateWorkerBeeMaxCount){
garden.generateWorkerBees();
generateWorkerBeeCount = 0;
};
generateWorkerBeeCount = (generateWorkerBeeCount + 1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
return;
};
if (leftKeyDown == true){
if (HoneyBee.honeyBee.x <= GParams.stageCenter.x){
_local2 = garden.scrollRect;
_local2.x = (_local2.x - scrollSpeed);
if (_local2.x < 0){
_local2.x = 0;
HoneyBee.honeyBee.moveLeft = true;
} else {
if (_local2.x > rectMaxScrollX){
HoneyBee.honeyBee.moveLeft = true;
} else {
HoneyBee.honeyBee.moveLeft = false;
};
};
garden.scrollRect = _local2;
} else {
HoneyBee.honeyBee.moveLeft = true;
};
HoneyBee.honeyBee.decrementHealth();
} else {
HoneyBee.honeyBee.moveLeft = false;
};
if (rightKeyDown == true){
if (HoneyBee.honeyBee.x >= GParams.stageCenter.x){
_local2 = garden.scrollRect;
_local2.x = (_local2.x + scrollSpeed);
if (_local2.x >= rectMaxScrollX){
_local2.x = rectMaxScrollX;
HoneyBee.honeyBee.moveRight = true;
} else {
HoneyBee.honeyBee.moveRight = false;
};
garden.scrollRect = _local2;
} else {
HoneyBee.honeyBee.moveRight = true;
};
HoneyBee.honeyBee.decrementHealth();
} else {
HoneyBee.honeyBee.moveRight = false;
};
if (upKeyDown == true){
if (HoneyBee.honeyBee.y <= GParams.stageCenter.y){
_local2 = garden.scrollRect;
_local2.y = (_local2.y - scrollSpeed);
if (_local2.y < 0){
_local2.y = 0;
HoneyBee.honeyBee.moveUp = true;
} else {
HoneyBee.honeyBee.moveUp = false;
};
garden.scrollRect = _local2;
} else {
HoneyBee.honeyBee.moveUp = true;
};
HoneyBee.honeyBee.decrementHealth();
} else {
HoneyBee.honeyBee.moveUp = false;
};
if (downKeyDown == true){
if (HoneyBee.honeyBee.y >= GParams.stageCenter.y){
_local2 = garden.scrollRect;
_local2.y = (_local2.y + scrollSpeed);
if (_local2.y > rectMaxScrollY){
_local2.y = rectMaxScrollY;
HoneyBee.honeyBee.moveDown = true;
} else {
HoneyBee.honeyBee.moveDown = false;
};
garden.scrollRect = _local2;
} else {
HoneyBee.honeyBee.moveDown = true;
};
HoneyBee.honeyBee.decrementHealth();
} else {
HoneyBee.honeyBee.moveDown = false;
};
if (generateWorkerBeeCount == generateWorkerBeeMaxCount){
garden.generateWorkerBees();
generateWorkerBeeCount = 0;
};
generateWorkerBeeCount = (generateWorkerBeeCount + 1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function showResult(_arg1:Number){
SoundMixer.stopAll();
BorderPanel.borderPanel.updateGameStats(timer.currentCount, timer.repeatCount);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
HoneyBee.honeyBee.removeHoneyBeeListener();
timer.reset();
timer.stop();
switch (_arg1){
case 1:
BorderPanel.borderPanel.calculateBonus(timer.currentCount, timer.repeatCount);
if (GParams.currentLevel == 6){
clearGraphics();
createYouWin();
} else {
gotoNextLevel();
};
break;
case 0:
clearGraphics();
createGameOver();
break;
};
}
public function submitScoreOnGameOver(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
gameOver.setErrorMesg("");
_local2 = null;
_local2 = gameOver.getPlayerName();
_local3 = GParams.scoreValue;
if (_local3 <= 0){
gameOver.setErrorMesg("You cannot submit an invalid score");
} else {
if ((((_local2 == null)) || ((_local2 == "")))){
gameOver.setErrorMesg("Please enter your name");
} else {
if (sendDataGameOver(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
};
}
public function completeWelcomeSoundHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
_channel = SoundControl.ws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
}
}
}//package
Section 88
//GardenSix (GardenSix)
package {
public class GardenSix extends Garden {
public var corni2:FlowerCornivorous;
public var corni1:FlowerPoison;
public var corni3:FlowerPoison;
public var corni4:FlowerCornivorous;
public var flower1:FlowerOne;
public var flower3:FlowerSeven;
public var flower4:FlowerSeven;
public var flower5:FlowerFour;
public var flower8:FlowerSeven;
public var flower6:FlowerSeven;
public var flower7:FlowerSeven;
public var flower9:FlowerFour;
public var flower2:FlowerOne;
public var flower11:FlowerSeven;
public var flower12:FlowerFour;
public var flower13:FlowerFour;
public var flower14:FlowerSeven;
public var flower16:FlowerFour;
public var flower17:FlowerFour;
public var flower19:FlowerFour;
public var flower10:FlowerFour;
public var flower15:FlowerFour;
public var flower18:FlowerFour;
public var flower20:FlowerFour;
public var flower21:FlowerSeven;
public function GardenSix(){
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
makeHoneyLessFlowers();
createEnemies();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
createPermanentBees();
dynamicWorkerBeeCount = 4;
setRandomPositionArray();
createHoneyBottle();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray.push(this.flower1);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower2);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower3);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower4);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower5);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower6);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower7);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower8);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower9);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower10);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower11);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower12);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower13);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower14);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower15);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower16);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower17);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower18);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower19);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower20);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower21);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
}
override public function createEnemies(){
var _local1:*;
_local1 = 0;
enemyArray.push(this.corni1);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni2);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni3);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni4);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
}
}
}//package
Section 89
//GardenSound (GardenSound)
package {
import flash.display.*;
public dynamic class GardenSound extends MovieClip {
}
}//package
Section 90
//GardenThree (GardenThree)
package {
public class GardenThree extends Garden {
public var flower33:FlowerSeven;
public var corni2:FlowerCornivorous;
public var corni5:FlowerCornivorous;
public var corni1:FlowerCornivorous;
public var corni3:FlowerCornivorous;
public var corni4:FlowerCornivorous;
public var flower1:FlowerOne;
public var flower3:FlowerSix;
public var flower4:FlowerSeven;
public var flower5:FlowerFour;
public var flower8:FlowerSeven;
public var flower6:FlowerFour;
public var flower7:FlowerFour;
public var flower9:FlowerFour;
public var flower2:FlowerOne;
public var flower11:FlowerSeven;
public var flower13:FlowerFour;
public var flower16:FlowerFour;
public var flower17:FlowerFour;
public var flower12:FlowerFour;
public var flower14:FlowerFour;
public var flower19:FlowerThree;
public var flower15:FlowerFour;
public var flower18:FlowerFour;
public var flower10:FlowerFour;
public var flower20:FlowerSeven;
public var flower21:FlowerSeven;
public var flower22:FlowerSeven;
public var flower25:FlowerFour;
public var flower28:FlowerSeven;
public var flower29:FlowerSeven;
public var flower23:FlowerSeven;
public var flower24:FlowerFour;
public var flower26:FlowerFour;
public var flower27:FlowerSeven;
public var flower31:FlowerSix;
public var flower34:FlowerThree;
public var flower30:FlowerFour;
public function GardenThree(){
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
makeHoneyLessFlowers();
createEnemies();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
createPermanentBees();
dynamicWorkerBeeCount = 3;
setRandomPositionArray();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray.push(this.flower1);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower2);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower3);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower4);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower5);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower6);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower7);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower8);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower9);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower10);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower11);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower12);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower13);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower14);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower15);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower16);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower17);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower18);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower19);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower20);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower21);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower22);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower23);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower24);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower25);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower26);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower27);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower28);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower29);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower30);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower31);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower33);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower34);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
}
override public function createEnemies(){
var _local1:Number;
_local1 = 0;
enemyArray.push(this.corni1);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni2);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni3);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni4);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni5);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
}
}
}//package
Section 91
//GardenTwo (GardenTwo)
package {
import flash.display.*;
public class GardenTwo extends Garden {
public var corni2:FlowerCornivorous;
public var corni1:FlowerCornivorous;
public var flower1:FlowerSix;
public var flower3:FlowerSix;
public var flower4:FlowerTwo;
public var flower5:FlowerSix;
public var flower8:FlowerTwo;
public var flower6:FlowerSix;
public var flower7:FlowerTwo;
public var flower9:FlowerTwo;
public var flower2:FlowerSix;
public var flower11:FlowerTwo;
public var flower12:FlowerSix;
public var flower13:FlowerTwo;
public var flower14:FlowerTwo;
public var flower16:FlowerTwo;
public var flower17:FlowerTwo;
public var flower19:FlowerTwo;
public var flower10:FlowerTwo;
public var flower15:FlowerSix;
public var flower18:FlowerSix;
public var flower20:FlowerSix;
public var flower21:FlowerSix;
public var flower22:FlowerSix;
public function GardenTwo(){
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
createEnemies();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
makeHoneyLessFlowers();
createPermanentBees();
dynamicWorkerBeeCount = 3;
setRandomPositionArray();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray.push(this.flower1);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower2);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower3);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower4);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower5);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower6);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower7);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower8);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower9);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower10);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower11);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower12);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower13);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower14);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower15);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower16);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower17);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower18);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower19);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower20);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower21);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray.push(this.flower22);
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
}
override public function addEnemy(_arg1:MovieClip){
enemyArray.push(_arg1);
enemyArray[(enemyArray.length - 1)].setPosition(_arg1.x, _arg1.y, 0, _arg1.scaleX);
}
override public function createEnemies(){
var _local1:*;
_local1 = 0;
enemyArray.push(this.corni1);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
_local1 = (_local1 + 1);
enemyArray.push(this.corni2);
enemyArray[_local1].setPosition(enemyArray[_local1].x, enemyArray[_local1].y, 0, enemyArray[_local1].scaleX);
addChild(enemyArray[_local1]);
}
}
}//package
Section 92
//GParams (GParams)
package {
import flash.geom.*;
public class GParams {
public static var deltaAngle:Array = new Array(0.01, 0.011, 0.011, 0.012, 0.013, 0.014, 0.014, 0.018);
public static var blackBeeSpeed:Number = 6;
public static var generateCoinCount:Array = new Array(2, 3, 4, 5, 6, 7);
public static var fairyBeeEntryCount:Array = new Array(timeLimit[0], timeLimit[1], timeLimit[2], (timeLimit[3] / 2), (timeLimit[4] / 3), (timeLimit[5] / 4));
public static var randomPosBlackBeeL3:Array = new Array([new Point(740, 625), new Point(520, 565), new Point(745, 790)], [new Point(900, 990), new Point(735, 795), new Point(935, 1050)], [new Point(1340, 525), new Point(1375, 535), new Point(1295, 515)], [new Point(1450, 915), new Point(310, 820), new Point(520, 575)]);
public static var randomPosBlackBeeL4:Array = new Array([new Point(900, 350), new Point(715, 460)], [new Point(1250, 300), new Point(1150, 375)], [new Point(1500, 610), new Point(1400, 650)], [new Point(1050, 890), new Point(1225, 925)], [new Point(400, 1050), new Point(730, 1070)]);
public static var randomPosBlackBeeL5:Array = new Array([new Point(665, 210), new Point(520, 210)], [new Point(1410, 365), new Point(1620, 365)], [new Point(700, 890), new Point(1900, 1050)], [new Point(1050, 535), new Point(900, 515)], [new Point(360, 700), new Point(165, 800)], [new Point(580, 760), new Point(350, 970)]);
public static var randomPosBlackBeeL6:Array = new Array([new Point(550, 510), new Point(530, 320)], [new Point(1170, 425), new Point(1240, 320), new Point(1330, 360)], [new Point(1470, 885), new Point(1595, 710)], [new Point(400, 640), new Point(620, 700)], [new Point(650, 200), new Point(550, 320)], [new Point(1150, 110), new Point(890, 120)]);
public static var CP_AREA = 150;
public static var randomPosBlackBeeL1:Array = new Array();
public static var totalLives:Number = 10;
public static var colonyDeltaIncrement:Array = new Array((1 / maxColonySize[0]), (1 / maxColonySize[1]), (1 / maxColonySize[2]), (1 / maxColonySize[3]), (1 / maxColonySize[4]), (1 / maxColonySize[5]));
public static var powerupPosL1:Array = new Array([new Point(70, 110), new Point(355, 110), new Point(620, 110), new Point(950, 110), new Point(1200, 110), new Point(1450, 110), new Point(1600, 110), new Point(120, 400), new Point(480, 400), new Point(150, 580), new Point(150, 900), new Point(150, 1150), new Point(600, 0x0500), new Point(1180, 1270), new Point(1700, 1270), new Point(1700, 970), new Point(1615, 850), new Point(1550, 290), new Point(1700, 290)], [new Point(100, 75), new Point(70, 180), new Point(320, 135), new Point(100, 290), new Point(340, 380), new Point(200, 525), new Point(380, 430), new Point(670, 575), new Point(1050, 130), new Point(150, 175), new Point(1435, 165), new Point(1620, 250), new Point(1450, 250), new Point(1450, 1030), new Point(1115, 1275), new Point(260, 1150), new Point(510, 740), new Point(1050, 740), new Point(675, 895), new Point(1210, 845), new Point(810, 1100)], [new Point(125, 195), new Point(360, 260), new Point(190, 150), new Point(170, 515), new Point(515, 515), new Point(260, 660), new Point(110, 930), new Point(265, 1235), new Point(460, 1270), new Point(700, 1050), new Point(1080, 1230), new Point(1590, 1230), new Point(1420, 1100), new Point(1390, 900), new Point(1170, 1065), new Point(875, 1300), new Point(1420, 1100), new Point(1390, 900), new Point(1170, 1065), new Point(865, 875), new Point(1050, 860), new Point(1700, 390), new Point(1630, 700), new Point(1450, 615)], [new Point(150, 300), new Point(260, 370), new Point(150, 760), new Point(1355, 900), new Point(235, 1245), new Point(460, 1325), new Point(1345, 1290), new Point(1595, 1045), new Point(1520, 920), new Point(990, 925), new Point(1550, 740), new Point(1550, 575), new Point(1425, 320), new Point(1660, 210), new Point(920, 340), new Point(1720, 125), new Point(850, 500), new Point(610, 675), new Point(810, 890)], [new Point(400, 290), new Point(250, 520), new Point(196, 1050), new Point(500, 1160), new Point(900, 950), new Point(1475, 290), new Point(1050, 600), new Point(1455, 750), new Point(1550, 1250), new Point(1660, 1225), new Point(1050, 1150), new Point(380, 710), new Point(710, 600), new Point(1150, 225), new Point(1700, 400), new Point(1350, 820), new Point(380, 500)], [new Point(100, 100), new Point(200, 300), new Point(440, 240), new Point(770, 125), new Point(805, 275), new Point(750, 440), new Point(325, 695), new Point(710, 690), new Point(520, 1115), new Point(150, 1200), new Point(120, 1125), new Point(1090, 1125), new Point(1630, 1210), new Point(1685, 820), new Point(1115, 410), new Point(1305, 245), new Point(1685, 850), new Point(980, 520)]);
public static var randomPosBlackBeeL2:Array = new Array();
public static var ATTACK_DIST:Number = 150;
public static var totalcoins:Array = new Array(5, 5, 6, 6, 8, 8);
public static var beeGenerateCount:Array = new Array(4, 4, 5, 6, 8, 10);
public static var gardenViewHeight:Number = 440;
public static var startLevel:Number = 1;
public static var dynamicBeeSpeed:Array = new Array(4, 5, 5.5, 5.75, 6, 6.25, 6.5);
public static var randomPosTerritoryBee:Array = new Array(randomPosTerritoryBeeL1, randomPosTerritoryBeeL2, randomPosTerritoryBeeL3, randomPosTerritoryBeeL4, randomPosTerritoryBeeL5, randomPosTerritoryBeeL6);
public static var borderLeft:Number = 10;
public static var honeyLessFlowerPercent:Array = new Array(0, 0.1, 0.15, 0.15, 0.2, 0.25);
public static var maxWorkerBees:Number = 3;
public static var accumulatedLife:int = 0;
public static var randomPosTerritoryBeeL2:Array = new Array([new Point(350, 165), new Point(250, 175), new Point(405, 90), new Point(215, 0xFF)], [new Point(240, 835), new Point(238, 735)], [new Point(310, 1140), new Point(185, 1085), new Point(415, 1050), new Point(125, 1080)], [new Point(1650, 1035), new Point(1650, 925)], [new Point(1360, 220), new Point(1380, 135), new Point(1330, 135)], [new Point(1085, 280), new Point(990, 190), new Point(1050, 170)]);
public static var randomPosTerritoryBeeL3:Array = new Array([new Point(250, 415), new Point(190, 360), new Point(80, 310), new Point(75, 450)], [new Point(325, 895), new Point(310, 820)], [new Point(900, 820), new Point(980, 750), new Point(1055, 770), new Point(740, 786)], [new Point(870, 1220), new Point(1105, 1175), new Point(640, 1095), new Point(1050, 1100)], [new Point(1420, 475), new Point(1420, 335), new Point(1340, 315), new Point(1300, 525), new Point(1380, 540)], [new Point(1685, 380), new Point(1590, 350), new Point(1720, 435), new Point(1685, 0xFF)], [new Point(1325, 95), new Point(1125, 50), new Point(1570, 60), new Point(1475, 205)]);
public static var healthDecrementDelta:Number = 0.0015;
public static var randomPosTerritoryBeeL6:Array = new Array([new Point(25, 215), new Point(0xFF, 75), new Point(175, 75)], [new Point(300, 410), new Point(125, 450), new Point(150, 270)], [new Point(800, 325), new Point(550, 325), new Point(890, 110)], [new Point(1720, 300), new Point(1670, 350), new Point(1620, 110)], [new Point(1380, 780), new Point(1130, 680), new Point(1200, 900), new Point(1590, 700)], [new Point(1660, 1150), new Point(1665, 1020), new Point()], [new Point(400, 960), new Point(140, 990), new Point(580, 880)]);
public static var randomPosTerritoryBeeL1:Array = new Array([new Point(840, 460), new Point(890, 505), new Point(780, 525)], [new Point(310, 225), new Point(505, 195), new Point(155, 75), new Point(275, 325)], [new Point(340, 1025), new Point(340, 980)], [new Point(1320, 190), new Point(1305, 0xFF), new Point(1350, 250), new Point(1290, 90)], [new Point(1615, 435), new Point(1615, 380)]);
public static var stageWidth:Number = 600;
public static var woodCutterInsectAttackCount:Array = new Array(0, 2, 3, 4, 7, 9);
public static var honeyExtractScore:Number = 50;
public static var randomPosTerritoryBeeL5:Array = new Array([new Point(380, 150), new Point(275, 120), new Point(520, 210)], [new Point(325, 400), new Point(240, 300)], [new Point(740, 475), new Point(820, 535), new Point(750, 360)], [new Point(700, 250), new Point(740, 360)], [new Point(1325, 210), new Point(1295, 225)], [new Point(420, 860), new Point(355, 965)], [new Point(710, 600), new Point(820, 535)]);
public static var gardenViewWidth:Number = 580;
public static var currentColonySize:Number = 0;
public static var randomPosTerritoryBeeL4:Array = new Array([new Point(330, 275), new Point(575, 145), new Point(140, 95)], [new Point(325, 600), new Point(150, 560), new Point(365, 640)], [new Point(535, 230), new Point(675, 375), new Point(440, 425), new Point(520, 550)], [new Point(1410, 170), new Point(1320, 100), new Point(1520, 70)], [new Point(1275, 435), new Point(1125, 395), new Point(1405, 390)], [new Point(1310, 715), new Point(1400, 650), new Point(1220, 575)], [new Point(1570, 730), new Point(1510, 775), new Point(1590, 585), new Point(1400, 650)], [new Point(1400, 960), new Point(1510, 825), new Point(1220, 950)], [new Point(1505, 1175), new Point(1360, 1150), new Point(1650, 1100)], [new Point(370, 110), new Point(415, 1160), new Point(220, 1075)]);
public static var totalColonySize:Number = 0;
public static var borderTop:Number = 50;
public static var currentLevel:Number = 1;
public static var ENEMY_FORESTBEE_LIFE = 5;
public static var ENEMY_SNAKE = 1;
public static var gardenWidth:Number = 1800;
public static var friendScore:Number = 50;
public static var ENEMY_CF = 3;
public static var ENEMY_SPIDER = 4;
public static var maxColonySize:Array = new Array(15, 20, 25, 30, 35, 40);
public static var ENEMY_FROG_LIFE = 5;
public static var ENEMY_CP = 2;
public static var beeCount:Array = new Array([1, 2, 12, 1], [2, 2, 12, 1], [2, 3, 25, 2], [2, 3, 30, 3], [3, 3, 30, 3], [3, 3, 20, 5]);
public static var ENEMY_CP_LIFE = 5;
public static var randomPosBlackBee:Array = new Array(randomPosBlackBeeL1, randomPosBlackBeeL2, randomPosBlackBeeL3, randomPosBlackBeeL4, randomPosBlackBeeL5, randomPosBlackBeeL6);
public static var gardenHeight:Number = 1350;
public static var ENEMY_SPIDER_LIFE = 5;
public static var stageHeight:Number = 500;
public static var CP_SPEED = 3;
public static var dynamicBeeFrequency:Array = new Array(100, 100, 110, 100, 120, 140);
public static var powerupPos:Array = null;
public static var bonusCoin1:Number = 100;
public static var bonusPoints:Number = 0;
public static var gardenCenter:Point = new Point((gardenWidth / 2), (gardenHeight / 2));
public static var frameRate:uint = 60;
public static var timeLimit:Array = new Array(120, 150, 210, 270, 320, 380);
public static var powerUpPoint:Number = 50;
public static var ENEMY_SNAKE_LIFE = 5;
public static var stageCenter:Point = new Point((stageWidth / 2), (stageHeight / 2));
public static var colonyIncrementPoint:Number = 25;
public static var scoreValue:Number = 0;
public static function incrementPartialLife():int{
Life.life.nextFrame();
accumulatedLife = (accumulatedLife + 10);
if (accumulatedLife == 100){
return (accumulatedLife);
};
return (accumulatedLife);
}
public static function incrementScore(_arg1:Number){
scoreValue = (scoreValue + _arg1);
if ((((_arg1 == bonusCoin1)) || ((_arg1 == friendScore)))){
bonusPoints = (bonusPoints + _arg1);
};
}
public static function resetGameStats(){
scoreValue = 0;
bonusPoints = 0;
totalColonySize = 0;
totalLives = 5;
currentLevel = startLevel;
accumulatedLife = 0;
}
}
}//package
Section 93
//HoneyBee (HoneyBee)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class HoneyBee extends MovieClip {
private var attackDist:Number;
public var isShielded:Boolean;// = false
public var moveDown:Boolean;// = false
public var hurt:MovieClip;
private var shieldCurrentCount:uint;// = 0
public var moveUp:Boolean;// = false
public var hurtCount:Number;// = 0
public var healthDecrementDelta;
public var attackAngles:Array;
private var RTD:Number;// = 57.2957795130823
public var moveLeft:Boolean;// = false
public var isExtracting:Boolean;// = false
public var healthLine:Number;// = 1
private var DTR:Number;// = 0.0174532925199433
private var shieldCurrentCountMax:uint;
public var moveRight:Boolean;// = false
public var actualPosition:Point;
private var attackAdjustPos:Array;
public var speedX:Number;// = 15
public var speedY:Number;// = 15
public static var honeyBee:HoneyBee = null;
public static var honeyBeeSize:Array = new Array(new Point(37.5, 61.5), new Point(49, 32.5), new Point(29.5, 36), new Point(31, 38), new Point(37, 34.5), new Point(37, 34.5), new Point(48.5, 48.5), new Point(48.5, 48.5));
private static var beeShield:BeeShield = null;
public static var halfWidth:Number = 30;
public static var halfHeight:Number = 40;
public static var currentPos:Number = 1;
public function HoneyBee(){
speedX = 15;
speedY = 15;
moveLeft = false;
moveRight = false;
moveUp = false;
moveDown = false;
attackAngles = new Array(270, 90, 0, 180, 135, 45, 225, 315);
attackAdjustPos = new Array(new Point(0, -10), new Point(0, 20), new Point(25, 8), new Point(-25, 8), new Point(-20, 50), new Point(20, 50), new Point(-10, -15), new Point(10, -15));
actualPosition = new Point();
DTR = (Math.PI / 180);
RTD = (180 / Math.PI);
attackDist = GParams.ATTACK_DIST;
healthDecrementDelta = GParams.healthDecrementDelta;
healthLine = 1;
hurtCount = 0;
isExtracting = false;
shieldCurrentCountMax = (GParams.frameRate * 20);
isShielded = false;
shieldCurrentCount = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
public function moveBee(){
if (moveLeft == true){
this.x = (this.x - speedX);
if ((this.x - halfWidth) < GParams.borderLeft){
this.x = (GParams.borderLeft + halfWidth);
};
} else {
if (moveRight == true){
this.x = (this.x + speedX);
if ((this.x + halfWidth) > (GParams.gardenViewWidth + GParams.borderLeft)){
this.x = ((GParams.gardenViewWidth + GParams.borderLeft) - halfWidth);
};
} else {
if (moveUp == true){
this.y = (this.y - speedY);
if ((this.y - halfHeight) < GParams.borderTop){
this.y = (GParams.borderTop + halfHeight);
};
} else {
if (moveDown == true){
this.y = (this.y + speedY);
if ((this.y + halfHeight) > GParams.gardenViewHeight){
this.y = (GParams.gardenViewHeight - halfHeight);
};
};
};
};
};
updateActualPosition();
}
public function addShiled(){
isShielded = true;
shieldCurrentCount = 0;
}
public function addHoneyBeeListener(){
this.visible = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
gotoAndPlay("up");
currentPos = 0;
isShielded = false;
if (beeShield != null){
if (contains(beeShield)){
removeChild(beeShield);
};
};
}
public function updateActualPosition():Point{
actualPosition.x = (GardenGame.garden.scrollRect.x + x);
actualPosition.y = (GardenGame.garden.scrollRect.y + y);
return (actualPosition);
}
public function struggleInWeb(){
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
public function addShield(){
addChild(beeShield);
isShielded = true;
}
function frame1(){
stop();
}
public function dieInWeb(){
}
function frame4(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame7(){
stop();
}
function frame9(){
stop();
}
public function extractHoney():Boolean{
var _local1:*;
updateActualPosition();
_local1 = GardenGame.garden.checkFlowerCollision();
if (_local1 != -1){
GardenGame.garden.displayExtractHoneyClip(_local1);
return (true);
};
return (false);
}
function frame2(){
stop();
}
public function onEnterFrame(_arg1:Event){
if (isShielded){
shieldCurrentCount = (shieldCurrentCount + 1);
if (shieldCurrentCount == shieldCurrentCountMax){
isShielded = false;
shieldCurrentCount = 0;
if (contains(beeShield)){
removeChild(beeShield);
};
};
};
if (honeyBee.currentFrame == 9){
if (this.hurt != null){
if (this.hurt.currentFrame == 10){
GardenGame.garden.decrementLife();
gotoAndPlay("down");
currentPos = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
hurtCount = 0;
return;
};
};
return;
};
updateActualPosition();
if (GardenGame.extractKeyDown == true){
if (extractHoney() == true){
return;
};
GardenGame.extractKeyDown = false;
return;
};
if (GardenGame.leftKeyDown == true){
if (GardenGame.upKeyDown == true){
if (currentPos != 6){
gotoAndPlay("up_left");
currentPos = 6;
};
} else {
if (GardenGame.downKeyDown == true){
if (currentPos != 4){
gotoAndPlay("down_left");
currentPos = 4;
};
} else {
if (currentPos != 3){
gotoAndPlay("left");
currentPos = 3;
};
};
};
moveBee();
updateActualPosition();
return;
} else {
if (GardenGame.rightKeyDown == true){
if (GardenGame.upKeyDown == true){
if (currentPos != 7){
currentPos = 7;
gotoAndPlay("up_right");
};
} else {
if (GardenGame.downKeyDown == true){
if (currentPos != 5){
currentPos = 5;
gotoAndPlay("down_right");
};
} else {
if (currentPos != 2){
gotoAndPlay("right");
currentPos = 2;
};
};
};
moveBee();
updateActualPosition();
return;
} else {
if (GardenGame.upKeyDown == true){
if (currentPos != 0){
currentPos = 0;
gotoAndPlay("up");
};
moveBee();
updateActualPosition();
return;
} else {
if (GardenGame.downKeyDown == true){
if (currentPos != 1){
currentPos = 1;
gotoAndPlay("down");
};
moveBee();
updateActualPosition();
return;
};
};
};
};
}
public function incrementHealth(){
var _local1:*;
_local1 = (healthLine + 0.5);
_local1 = 1;
if (_local1 > 1){
healthLine = 1;
} else {
healthLine = _local1;
};
}
public function removeHoneyBeeListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function decrementHealth(){
healthLine = (healthLine - healthDecrementDelta);
if (healthLine <= 0){
if (GardenGame.garden.decrementLife() == true){
healthLine = 1;
};
};
if (GParams.currentLevel > 4){
if ((((healthLine < 0.4)) && ((GardenGame.garden.showHoneyBottle == 1)))){
GardenGame.garden.showHoney();
};
};
}
public function displayHurtClip(){
if (!isShielded){
gotoAndStop("hurt");
hurtCount = 1;
};
}
public static function createInstance(){
if (honeyBee == null){
honeyBee = new (HoneyBee);
if (beeShield == null){
beeShield = new BeeShield();
};
};
}
}
}//package
Section 94
//HoneyBottle (HoneyBottle)
package {
import flash.display.*;
public class HoneyBottle extends MovieClip {
private var minHalfHeight:Number;// = 0
private var minHalfWidth:Number;
private var maxOnOffCount:Number;// = 0
private var radius:Number;// = 20
public var onOffFlag:Boolean;// = false
public var isActive:Boolean;// = false
private var onOffCount:Number;// = 0
public function HoneyBottle(){
onOffFlag = false;
isActive = false;
minHalfHeight = 0;
radius = 20;
onOffCount = 0;
maxOnOffCount = 0;
super();
minHalfWidth = (20 + (HoneyBee.halfWidth / 2));
minHalfHeight = (30 + (HoneyBee.halfHeight / 2));
}
public function init(_arg1){
this.x = _arg1.x;
this.y = _arg1.y;
isActive = true;
maxOnOffCount = ((Math.random() * 100) + 200);
onOffCount = 0;
this.visible = true;
}
public function getBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
if (isActive == true){
_local1 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local2 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local1 <= minHalfWidth)) && ((_local2 <= minHalfWidth)))){
isActive = false;
return (true);
};
onOffCount = (onOffCount + 1);
if (onOffCount == maxOnOffCount){
visible = false;
isActive = false;
onOffCount = 0;
this.visible = false;
GardenGame.garden.showHoneyBottle = 0;
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
};
};
return (false);
}
public function disappear(){
visible = false;
isActive = false;
onOffCount = 0;
this.visible = false;
GardenGame.garden.showHoneyBottle = 0;
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
}
}
}//package
Section 95
//Levels (Levels)
package {
import flash.display.*;
import flash.events.*;
public class Levels extends MovieClip {
var levelNum:Number;// = 1
private var level:Levels;// = null
public function Levels(){
levelNum = 1;
level = null;
super();
addFrameScript(303, frame304);
}
public function init(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (currentFrame == 35){
SoundControl.lus1.play();
};
if (currentFrame == 181){
SoundControl.lgs.play();
};
if (currentFrame == 243){
SoundControl.lus1.play();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
function frame304(){
stop();
}
public static function getInstance():Levels{
return (null);
}
}
}//package
Section 96
//LevelupSound (LevelupSound)
package {
import flash.media.*;
public class LevelupSound extends Sound {
}
}//package
Section 97
//LevelupSoundOne (LevelupSoundOne)
package {
import flash.media.*;
public dynamic class LevelupSoundOne extends Sound {
}
}//package
Section 98
//Life (Life)
package {
import flash.display.*;
public class Life extends MovieClip {
public static var life:Life = null;
public function Life(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
public function init(){
var _local1:uint;
_local1 = ((GParams.accumulatedLife / 10) + 1);
gotoAndStop(_local1);
this.x = (GParams.borderLeft + 5);
this.y = (GParams.borderTop + 5);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
public static function createLife(){
if (life == null){
life = new (Life);
};
}
}
}//package
Section 99
//LifeGainedSound (LifeGainedSound)
package {
import flash.media.*;
public dynamic class LifeGainedSound extends Sound {
}
}//package
Section 100
//LifeLostSound (LifeLostSound)
package {
import flash.media.*;
public dynamic class LifeLostSound extends Sound {
}
}//package
Section 101
//NewBee (NewBee)
package {
import flash.display.*;
public class NewBee extends Sprite {
public function moveBee(){
}
}
}//package
Section 102
//Poison (Poison)
package {
import flash.display.*;
import flash.events.*;
public class Poison extends Sprite {
private var totalDist:Number;// = 0
private var easing;// = 0.1
private var minDistBee:Number;// = 50
private var dt:Number;// = 0
private var distTravelled:Number;// = 0
public var isActive:Boolean;// = false
private var generatePoison:Number;// = 0
private var targetY:Number;// = 0
private var targetX:Number;// = 0
private var speedX:Number;// = 2
private var speedY:Number;// = 2
public var adjustSpeed:Number;// = 5
public function Poison(){
targetX = 0;
targetY = 0;
speedX = 2;
speedY = 2;
dt = 0;
totalDist = 0;
distTravelled = 0;
easing = 0.1;
isActive = false;
adjustSpeed = 5;
generatePoison = 0;
minDistBee = 50;
super();
this.scaleY = (this.scaleY * 0.5);
}
public function init(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
_local4 = 0;
this.targetX = _arg1;
this.targetY = _arg2;
isActive = true;
visible = true;
_local3 = (targetX - x);
_local4 = (targetY - y);
totalDist = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
speedX = (_local3 / adjustSpeed);
speedY = (_local4 / adjustSpeed);
dt = (totalDist / adjustSpeed);
distTravelled = 0;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function checkBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (this.x - HoneyBee.honeyBee.actualPosition.x);
_local2 = (this.y - HoneyBee.honeyBee.actualPosition.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
if (_local3 <= minDistBee){
this.disappear();
HoneyBee.honeyBee.displayHurtClip();
return (true);
};
return (false);
}
public function onEnterFrame(_arg1:Event){
x = (x + speedX);
y = (y + speedY);
distTravelled = (distTravelled + dt);
if (distTravelled >= totalDist){
isActive = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
visible = false;
GardenGame.garden.removeChild(this);
};
checkBeeCollision();
}
public function disappear(){
isActive = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
visible = false;
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
}
}
}//package
Section 103
//PowerupCoin (PowerupCoin)
package {
import flash.display.*;
public class PowerupCoin extends MovieClip {
private var minHalfHeight:Number;// = 0
private var minHalfWidth:Number;
private var maxOnOffCount:Number;// = 0
private var radius:Number;// = 20
public var onOffFlag:Boolean;// = false
private var isActive:Boolean;// = false
private var onOffCount:Number;// = 0
public function PowerupCoin(){
onOffFlag = false;
isActive = false;
minHalfHeight = 0;
radius = 20;
onOffCount = 0;
maxOnOffCount = 0;
super();
addFrameScript(0, frame1, 1, frame2);
minHalfWidth = (radius + (HoneyBee.halfWidth / 2));
minHalfHeight = (radius + (HoneyBee.halfHeight / 2));
maxOnOffCount = ((Math.random() * 100) + 100);
}
public function init(_arg1:Boolean){
this.onOffFlag = _arg1;
isActive = true;
}
function frame1(){
stop();
}
public function getBeeCollision():Boolean{
var _local1:Number;
var _local2:Number;
if (isActive == true){
minHalfWidth = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].x + radius);
minHalfHeight = (HoneyBee.honeyBeeSize[HoneyBee.currentPos].y + radius);
_local1 = Math.abs((this.x - HoneyBee.honeyBee.actualPosition.x));
_local2 = Math.abs((this.y - HoneyBee.honeyBee.actualPosition.y));
if ((((_local1 <= minHalfWidth)) && ((_local2 <= minHalfHeight)))){
isActive = false;
return (true);
};
if (onOffFlag == true){
onOffCount = (onOffCount + 1);
if (onOffCount == maxOnOffCount){
visible = false;
isActive = false;
onOffCount = 0;
};
if (onOffCount == 50){
visible = true;
isActive = true;
};
};
};
return (false);
}
function frame2(){
stop();
}
}
}//package
Section 104
//Preloader (Preloader)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.text.*;
public class Preloader extends MovieClip {
private var percentText:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var percent:TextField;
var requestPlayMore:URLRequest;// = null
var timer:Timer;
private var progressBar:Sprite;
public var percentbar:MovieClip;
public var logo:MovieClip;
public static const startFrame:Number = 3;
public static const mainClass:String = "GardenGame";
public function Preloader(){
requestPlayMore = null;
urlPlayMore = "http://www.flasharcade.com";
addFrameScript(2, frame3);
stop();
super();
requestPlayMore = new URLRequest(urlPlayMore);
progressBar = (getChildByName("percentbar") as Sprite);
progressBar.scaleX = 0;
percentText = (getChildByName("percent") as TextField);
percentText.text = "0";
timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.start();
logo.buttonMode = true;
logo.useHandCursor = true;
logo.addEventListener(MouseEvent.CLICK, handleClick);
}
private function enterFrameHandler(_arg1:Event):void{
if (currentFrame >= _slot1.startFrame){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
initApp();
};
}
private function onComplete(_arg1:Event):void{
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function frame3(){
stop();
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function afterSecond(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
if (_local2 >= _local3){
timer.stop();
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
}
private function showProgress(_arg1:ProgressEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
}
private function initApp():void{
var _local1:Boolean;
var _local2:Class;
var _local3:Sprite;
_local1 = loaderInfo.applicationDomain.hasDefinition(_slot1.mainClass);
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.mainClass) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
}
}
}//package
Section 105
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 106
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 107
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 108
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 109
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 110
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 111
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 112
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 113
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 114
//ScrollPane_disabledSkin (ScrollPane_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollPane_disabledSkin extends MovieClip {
}
}//package
Section 115
//ScrollPane_upSkin (ScrollPane_upSkin)
package {
import flash.display.*;
public dynamic class ScrollPane_upSkin extends MovieClip {
}
}//package
Section 116
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 117
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 118
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 119
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 120
//SoundControl (SoundControl)
package {
public class SoundControl {
public static var ws:WelcomeSound = null;
public static var tcs:TouchCorniSound = null;
public static var ls:LevelupSound = null;
public static var ehs:ExtractHoneySound = null;
public static var lus1:LevelupSoundOne = null;
public static var gos:GameOverSound = null;
public static var fs:FriendshipSound = null;
public static var bgs:BGSound = null;
public static var lls:LifeLostSound = null;
public static var tps:TouchPowerupSound = null;
public static var lgs:LifeGainedSound = null;
public static var tis:TouchInsectSound = null;
public function SoundControl(){
bgs = new BGSound();
ws = new WelcomeSound();
gos = new GameOverSound();
fs = new FriendshipSound();
lls = new LifeLostSound();
lgs = new LifeGainedSound();
tps = new TouchPowerupSound();
ehs = new ExtractHoneySound();
tcs = new TouchCorniSound();
tis = new TouchInsectSound();
lus1 = new LevelupSoundOne();
}
}
}//package
Section 121
//SquareGarden (SquareGarden)
package {
public class SquareGarden extends Garden {
public var flower1:FlowerFive;
public var flower3:FlowerFive;
public var flower4:FlowerOne;
public var flower5:FlowerSix;
public var flower8:FlowerOne;
public var flower6:FlowerFive;
public var flower7:FlowerOne;
public var flower9:FlowerOne;
public var flower2:FlowerOne;
public var flower11:FlowerOne;
public var flower12:FlowerFive;
public var flower13:FlowerFive;
public var flower14:FlowerFive;
public var flower10:FlowerFive;
public var flower15:FlowerFive;
public function SquareGarden(){
addFrameScript(0, frame1);
createPowerCoins();
createFlowers();
totalFlowerCount = flowerArray.length;
remainingFlowerCount = totalFlowerCount;
makeHoneyLessFlowers();
createExtractHoneyClip();
createExtractHoneyTimer();
blossomAll();
createPermanentBees();
dynamicWorkerBeeCount = 3;
setRandomPositionArray();
}
function frame1(){
stop();
stop();
}
override public function createFlowers(){
var _local1:*;
_local1 = 0;
flowerArray[_local1] = this.flower1;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower2;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower3;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower4;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower5;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower6;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower7;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower8;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower9;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower10;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower11;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower12;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower13;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower14;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
_local1 = (_local1 + 1);
flowerArray[_local1] = this.flower15;
flowerArray[_local1].setPosition(flowerArray[_local1].x, flowerArray[_local1].y, flowerArray[_local1].rotation, flowerArray[_local1].scaleX);
addChild(flowerArray[_local1]);
}
}
}//package
Section 122
//TouchCorniSound (TouchCorniSound)
package {
import flash.media.*;
public dynamic class TouchCorniSound extends Sound {
}
}//package
Section 123
//TouchInsectSound (TouchInsectSound)
package {
import flash.media.*;
public dynamic class TouchInsectSound extends Sound {
}
}//package
Section 124
//TouchPowerUp (TouchPowerUp)
package {
import flash.display.*;
import flash.events.*;
public class TouchPowerUp extends MovieClip {
public function TouchPowerUp(){
addFrameScript(29, frame30);
}
public function init(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
gotoAndPlay(1);
}
function frame30(){
stop();
}
public function onEnterFrame(_arg1:Event){
if (currentFrame == 30){
if (GardenGame.garden.contains(this)){
GardenGame.garden.removeChild(this);
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
}
}//package
Section 125
//TouchPowerupSound (TouchPowerupSound)
package {
import flash.media.*;
public dynamic class TouchPowerupSound extends Sound {
}
}//package
Section 126
//VanishFactory (VanishFactory)
package {
public class VanishFactory {
private static var bondingIndex:Number = -1;
private static var coinTouchIndex:Number = -1;
private static var coinTouchClip:Array = new Array(5);
private static var bondingClip:Array = new Array(10);
public static function getCoinTouchInstance():TouchPowerUp{
coinTouchIndex = (coinTouchIndex + 1);
if (coinTouchClip[coinTouchIndex] == null){
coinTouchClip[coinTouchIndex] = new TouchPowerUp();
};
return (coinTouchClip[coinTouchIndex]);
}
public static function getBondingInstance():FriendshipSuccess{
bondingIndex = (bondingIndex + 1);
if (bondingClip[bondingIndex] == null){
bondingClip[bondingIndex] = new FriendshipSuccess();
};
return (bondingClip[bondingIndex]);
}
}
}//package
Section 127
//Welcome (Welcome)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Welcome extends MovieClip {
public var hs:MovieClip;
var requestAddMore:URLRequest;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var ipwelcome:MovieClip;
var requestPlayMore:URLRequest;// = null
public var introFrame:MovieClip;
var urlAddMoreGames:String;// = "http://www.flasharcade.com/flash-games/"
private static var welcome:Welcome = null;
public function Welcome(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
urlAddMoreGames = "http://www.flasharcade.com/flash-games/";
requestAddMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
requestAddMore = new URLRequest(urlAddMoreGames);
ipwelcome.playMore.addEventListener(MouseEvent.CLICK, handleClick);
ipwelcome.addMore.addEventListener(MouseEvent.CLICK, handleClickAddMore);
ipwelcome.intro.addEventListener(MouseEvent.CLICK, gotoIntro);
introFrame.backIntro.addEventListener(MouseEvent.CLICK, gotoWelCome);
introFrame.playMore.addEventListener(MouseEvent.CLICK, handleClick);
hs.playmorehs.addEventListener(MouseEvent.CLICK, handleClick);
hs.backhs.addEventListener(MouseEvent.CLICK, gotoWelCome);
}
public function handleClickAddMore(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestAddMore, "_blank");
} catch(e:Error) {
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function gotoWelCome(_arg1:MouseEvent){
setChildIndex(ipwelcome, 2);
}
public function gotoIntro(_arg1:MouseEvent){
setChildIndex(introFrame, 2);
}
public function emptyScores(){
var _local1:String;
_local1 = "";
hs.player1.text = _local1;
hs.score1.text = _local1;
hs.date1.text = _local1;
hs.player2.text = _local1;
hs.score2.text = _local1;
hs.date2.text = _local1;
hs.player3.text = _local1;
hs.score3.text = _local1;
hs.date3.text = _local1;
hs.player4.text = _local1;
hs.score4.text = _local1;
hs.date4.text = _local1;
hs.player5.text = _local1;
hs.score5.text = _local1;
hs.date5.text = _local1;
hs.player6.text = _local1;
hs.score6.text = _local1;
hs.date6.text = _local1;
hs.player7.text = _local1;
hs.score7.text = _local1;
hs.date7.text = _local1;
hs.player8.text = _local1;
hs.score8.text = _local1;
hs.date8.text = _local1;
hs.player9.text = _local1;
hs.score9.text = _local1;
hs.date9.text = _local1;
hs.player10.text = _local1;
hs.score10.text = _local1;
hs.date10.text = _local1;
}
public static function getInstance():Welcome{
if (welcome == null){
welcome = new (Welcome);
};
return (welcome);
}
}
}//package
Section 128
//WelcomeSound (WelcomeSound)
package {
import flash.media.*;
public dynamic class WelcomeSound extends Sound {
}
}//package
Section 129
//WoodCutterFactory (WoodCutterFactory)
package {
public class WoodCutterFactory {
private static var woodCutterArray:Array = new Array(totalCount);
private static var totalCount:Number = 5;
private static var woodCutterIndex:Number = -1;
public static function getWoodCutterInstance():ForestBee{
woodCutterIndex = ((woodCutterIndex + 1) % totalCount);
if (woodCutterArray[woodCutterIndex] == null){
woodCutterArray[woodCutterIndex] = new ForestBee();
};
return (woodCutterArray[woodCutterIndex]);
}
}
}//package
Section 130
//WorkerFactory (WorkerFactory)
package {
public class WorkerFactory {
private static var beeTerritoryIndex:Number = -1;
private static var beeChaseIndex:Number = -1;
private static var beeStaticIndex:Number = -1;
private static var beeChase:Array = new Array(10);
private static var beeStatic:Array = new Array(5);
private static var beeDynamicIndex:Number = -1;
private static var beeDynamic:Array = new Array(10);
private static var beeTerritory:Array = new Array(5);
public static function getBeeTerritoryInstance():FriendBee{
beeTerritoryIndex = ((beeTerritoryIndex + 1) % 2);
if (beeTerritory[beeTerritoryIndex] == null){
beeTerritory[beeTerritoryIndex] = new FriendTerritoryBee();
};
return (beeTerritory[beeTerritoryIndex]);
}
public static function getBeeDynamicInstance():FriendBee{
beeDynamicIndex = ((beeDynamicIndex + 1) % 10);
if (beeDynamic[beeDynamicIndex] == null){
beeDynamic[beeDynamicIndex] = new FriendDynamicBee();
};
return (beeDynamic[beeDynamicIndex]);
}
public static function getForestBeeInstance():FriendBee{
beeChaseIndex = ((beeChaseIndex + 1) % 10);
if (beeChase[beeChaseIndex] == null){
beeChase[beeChaseIndex] = new BlackBee();
};
return (beeChase[beeChaseIndex]);
}
public static function getBeeStaticInstance():FriendBee{
beeStaticIndex = ((beeStaticIndex + 1) % 2);
if (beeStatic[beeStaticIndex] == null){
beeStatic[beeStaticIndex] = new FriendStaticBee();
};
return (beeStatic[beeStaticIndex]);
}
}
}//package
Section 131
//YouWin (YouWin)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
public class YouWin extends MovieClip {
public var colonySize:TextField;
public var playAgain1:SimpleButton;
public var errormesg:TextField;
public var playerName:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var bonus:TextField;
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var playMore:SimpleButton;
public var totalScore:TextField;
private static var youWin:YouWin = null;
public function YouWin(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
addFrameScript(29, frame30);
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
gotoAndPlay(1);
bonus.text = GParams.bonusPoints.toString();
totalScore.text = GParams.scoreValue.toString();
this.colonySize.text = GParams.totalColonySize.toString();
}
function frame30(){
stop();
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():YouWin{
if (youWin == null){
youWin = new (YouWin);
};
return (youWin);
}
}
}//package