Section 1
//GameEvent (com.ubi.events.GameEvent)
package com.ubi.events {
import flash.events.*;
public class GameEvent extends Event {
public var score:Number;
public static const SUBMIT_SCORE:String = "submitScore";
public static const GET_HIGH_SCORES:String = "getHIgheScores";
public function GameEvent(type:String, score:Number=0){
super(type, bubbles, cancelable);
this.score = score;
}
override public function clone():Event{
return (new GameEvent(type, score));
}
override public function toString():String{
return (formatToString("GameEvent", "score"));
}
}
}//package com.ubi.events
Section 2
//GameBase (com.ubi.game.GameBase)
package com.ubi.game {
import flash.display.*;
import com.ubi.events.*;
public class GameBase extends MovieClip {
public function GameBase(){
super();
}
public function validateUbiland():void{
}
public function submitScore(score:Number):void{
dispatchEvent(new GameEvent(GameEvent.SUBMIT_SCORE, score));
}
public function destroy():void{
}
}
}//package com.ubi.game
Section 3
//FrameworkError (pl.fabrykagier.framework.error.FrameworkError)
package pl.fabrykagier.framework.error {
public class FrameworkError extends Error {
public static var LIST_NOOBJECT:String = "Can't find object with specific parameters";
public static var SM_NOOBJECT:String = "Object with this name dosen't exist.";
public static var SO_NAME:String = "FlashCookies Error: First you have to call static method 'init' and set object name.";
public static var LANGUAGE_TEXTFIELD_ERROR:String = "When you use LanguageObject you must have text field named 'languageField' in root directory of linkaged object";
public static var LANGUAGE_INSTANCENAME_ERROR:String = "When you use LanguageObject you must type instance name of linkaged object";
public static var SM_NONAME:String = "Can't find 'name' variable in parameteres object.";
public static var CANT_FIND_STAGE:String = "Can't find stage object.";
public static var CANT_FIND_PARENT:String = "Can't find object parent.";
public static var XML_IO_ERROR:String = "XML IO Error. Probably xml file doesn't exist.";
public static var LANGUAGE_EMPTY_POLL:String = "Elements doesn't exist in xml language file.";
public static var COUNTER:String = "You can't use two kind of counter in one time.";
public static var SO_ID:String = "ID already set to ";
public static var EXTERNAL_NOT_AVAILABLE:String = "External Interface is not available!";
public static var LOADER_NULL:String = "Reference to loaded DisplayObject is null.";
public static var LIST_WRONGTYPE:String = "Wrong type of object. You can use this method only when object type is ";
public static var XML_HAS_NO_CHILDREN:String = "XML node hasn't got any children.";
public static var XML_SECURITY_ERROR:String = "XML Security Error. Probably xml is on other server, try use crossdomain file.";
public static var DESTRUCTOR_ERROR:String = "You must implements destructor method!";
public static var SO_NAME_EMPTY:String = "FlashCookies Error: Object name must have at least one letter.";
public function FrameworkError(message:String){
super(message);
}
}
}//package pl.fabrykagier.framework.error
Section 4
//FrameworkEvent (pl.fabrykagier.framework.events.FrameworkEvent)
package pl.fabrykagier.framework.events {
import flash.events.*;
public class FrameworkEvent extends Event {
private var parametersArray:Array;
public function FrameworkEvent(type, bubbles=false, cancelable=false){
parametersArray = new Array();
super(type, bubbles, cancelable);
}
public function addParameter(parameterName:String, parameterValue):void{
parametersArray[parameterName] = parameterValue;
}
public function getParameter(parameterName:String){
return (parametersArray[parameterName]);
}
}
}//package pl.fabrykagier.framework.events
Section 5
//GameObject (pl.fabrykagier.framework.main.GameObject)
package pl.fabrykagier.framework.main {
import flash.display.*;
import flash.events.*;
public class GameObject extends MovieClip {
public var listenerArray:Array;
private var _state:String;
public static var STATE_STOP:String = "stop";
public static var STATE_PLAY:String = "play";
public static var STATE_PAUSE:String = "pause";
public function GameObject():void{
_state = STATE_STOP;
listenerArray = new Array();
super();
initObject();
}
override public function stop():void{
_state = STATE_STOP;
super.stop();
}
override public function gotoAndPlay(frame:Object, scene:String=null):void{
_state = STATE_PLAY;
super.gotoAndPlay(frame, scene);
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, prioryty:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, prioryty, useWeakReference);
listenerArray.push(new Array(type, listener, useCapture, prioryty, useWeakReference));
}
public function get grandparent():DisplayObject{
return (parent.parent);
}
public function get listenersNumber():int{
return (listenerArray.length);
}
override public function play():void{
_state = STATE_PLAY;
super.play();
}
public function pause():void{
_state = STATE_PAUSE;
super.stop();
}
private function callDestructor(e:Event):void{
destructor();
}
public function get state():String{
return (_state);
}
protected function destructor():void{
removeListeners();
}
public function removeListeners():void{
var i:*;
for (i in listenerArray) {
removeEventListener(listenerArray[i][0], listenerArray[i][1], listenerArray[i][2]);
};
listenerArray = new Array();
}
public function resume():void{
if (_state == STATE_PAUSE){
_state = STATE_PLAY;
super.play();
};
}
override public function gotoAndStop(frame:Object, scene:String=null):void{
_state = STATE_PLAY;
super.gotoAndStop(frame, scene);
}
private function initObject():void{
addEventListener(Event.REMOVED_FROM_STAGE, callDestructor);
}
}
}//package pl.fabrykagier.framework.main
Section 6
//SoundManager (pl.fabrykagier.framework.media.SoundManager)
package pl.fabrykagier.framework.media {
import flash.media.*;
import pl.fabrykagier.framework.error.*;
import flash.utils.*;
public class SoundManager {
public static var soundsObjects:Array = new Array();
private static var muteMode:Boolean;
private static var nextIndex:int = 0;
public function SoundManager(){
super();
}
public static function stopAllSounds():void{
var i:int;
while (i < soundsObjects.length) {
SoundObject(soundsObjects[i]).setVolume(0);
i++;
};
}
private static function checkSound(soundName:String):Boolean{
var i:*;
for (i in soundsObjects) {
if (SoundObject(soundsObjects[i]).soundName == soundName){
return (true);
};
};
return (false);
}
public static function playSound(parameters:Object):SoundObject{
var soundObj:SoundObject;
if (!parameters["name"]){
return (null);
};
if (!parameters["startTime"]){
parameters["startTime"] = 0;
};
if (!parameters["loops"]){
parameters["loops"] = 0;
};
if (!parameters["transform"]){
parameters["transform"] = null;
};
if (muteMode){
parameters["transform"] = new SoundTransform(0);
};
if (parameters["duplicate"] !== true){
if (checkSound(parameters["name"])){
soundObj = getSoundByName(parameters["name"]);
soundObj.play(parameters["startTime"], parameters["loops"], parameters["transform"]);
} else {
soundObj = addSound(parameters);
soundObj.play(parameters["startTime"], parameters["loops"], parameters["transform"]);
};
} else {
soundObj = addSound(parameters);
soundObj.play(parameters["startTime"], parameters["loops"], parameters["transform"]);
};
if (parameters["pause"] === true){
soundObj.pause = true;
} else {
soundObj.pause = false;
};
return (soundObj);
}
public static function getSoundByID(soundID:int):SoundObject{
var i:*;
for (i in soundsObjects) {
if (SoundObject(soundsObjects[i]).id == soundID){
return (SoundObject(soundsObjects[i]));
};
};
return (null);
}
public static function playPausedSound():void{
var i:int;
while (i < soundsObjects.length) {
SoundObject(soundsObjects[i]).setVolume(1);
i++;
};
}
public static function addSound(parameters:Object):SoundObject{
var SoundClass:Class;
var parameters = parameters;
if (!parameters["name"]){
throw (new FrameworkError(FrameworkError.SM_NONAME));
};
SoundClass = (getDefinitionByName(parameters["name"]) as Class);
//unresolved jump
var _slot1 = e;
throw (new FrameworkError(((FrameworkError.SM_NOOBJECT + " Sound name: ") + parameters["name"])));
var obj:SoundObject = new (SoundClass);
obj.id = nextIndex;
obj.soundName = parameters["name"];
soundsObjects.push(obj);
nextIndex++;
if (parameters["pause"] === true){
obj.pause = true;
} else {
obj.pause = false;
};
return (obj);
}
public static function refresh():void{
var j:int;
var i:int;
while (i < soundsObjects.length) {
j = 0;
while (j < soundsObjects.length) {
if (i == j){
} else {
if (((SoundObject(soundsObjects[i])) && ((SoundObject(soundsObjects[i]).soundName == SoundObject(soundsObjects[j]).soundName)))){
soundsObjects.splice(j, 1);
};
};
j++;
};
i++;
};
}
public static function stopSound(parameters:Object):void{
var sound:SoundObject;
if (parameters["name"]){
sound = getSoundByName(parameters["name"]);
};
if (parameters["id"]){
sound = getSoundByID(parameters["id"]);
};
if (sound){
sound.stop();
};
}
public static function muteOff():void{
playPausedSound();
muteMode = false;
}
public static function muteOn():void{
stopAllSounds();
muteMode = true;
}
public static function get mute():Boolean{
return (muteMode);
}
public static function getSoundByName(soundName:String):SoundObject{
var i:*;
for (i in soundsObjects) {
if (SoundObject(soundsObjects[i]).soundName == soundName){
return (SoundObject(soundsObjects[i]));
};
};
return (null);
}
}
}//package pl.fabrykagier.framework.media
Section 7
//SoundObject (pl.fabrykagier.framework.media.SoundObject)
package pl.fabrykagier.framework.media {
import flash.media.*;
import flash.events.*;
import pl.fabrykagier.framework.error.*;
public class SoundObject extends Sound {
private var pauseMode:Boolean;
private var state_:String;
private var locked:Boolean;
private var name:String;
private var loops:int;
private var sndTransform:SoundTransform;
private var id_:int;// = -1
private var pauseTime:int;
private var myChannel:SoundChannel;
private var toAddListener:Boolean;
public static var STATE_STOP:String = "sound_is_stop";
public static var STATE_PLAY:String = "sound_is_play";
public static var STATE_PAUSE:String = "state_is_pause";
public static var STATE_END:String = "sound_is_end";
public function SoundObject(){
super();
state_ = STATE_STOP;
}
public function get soundName():String{
return (name);
}
public function stop():void{
state_ = STATE_STOP;
if (pauseMode){
pauseSound();
};
if (myChannel){
myChannel.stop();
};
}
override public function play(startTime:Number=0, loops:int=0, sndTransform:SoundTransform=null):SoundChannel{
state_ = STATE_PLAY;
this.loops = loops;
this.sndTransform = sndTransform;
myChannel = super.play(startTime, loops, sndTransform);
if (myChannel){
myChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
};
return (myChannel);
}
public function get state():String{
return (state_);
}
public function get id():int{
return (id_);
}
public function setVolume(volume:Number){
if (myChannel){
myChannel.soundTransform = new SoundTransform(volume);
};
}
public function set lock(value:Boolean){
locked = value;
}
public function get lock():Boolean{
return (locked);
}
public function set pause(value:Boolean):void{
pauseMode = value;
}
public function resume():void{
if (pauseMode){
state_ = STATE_PLAY;
play(pauseTime, loops, sndTransform);
};
}
public function set soundName(value:String){
name = value;
}
public function addListener(listener:Function, useCapture:Boolean=false, prioryty:int=0, useWeakReference:Boolean=false):void{
}
public function get pause():Boolean{
return (pauseMode);
}
private function onComplete(e:Event):void{
state_ = STATE_END;
}
private function pauseSound():void{
state_ = STATE_PAUSE;
pauseTime = myChannel.position;
}
public function set id(value:int){
if (id_ == -1){
id_ = value;
} else {
throw (new FrameworkError(FrameworkError.SO_ID));
};
}
}
}//package pl.fabrykagier.framework.media
Section 8
//InterfaceButton (pl.fabrykagier.framework.ui.graphical.InterfaceButton)
package pl.fabrykagier.framework.ui.graphical {
import pl.fabrykagier.framework.media.*;
import pl.fabrykagier.framework.main.*;
import flash.events.*;
public class InterfaceButton extends GameObject {
protected var mouseOn:Boolean;
protected var mouseOutLabel;// = "ON_OUT"
protected var mouseDownLabel;// = "click"
protected var mouseOverLabel;// = "ON_OVER"
public function InterfaceButton(){
super();
useHandCursor = true;
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.MOUSE_DOWN, onButtonDown);
addEventListener(MouseEvent.MOUSE_UP, onButtonUp);
addEventListener(MouseEvent.MOUSE_OVER, onButtonOver);
addEventListener(MouseEvent.MOUSE_OUT, onButtonOut);
this.buttonMode = true;
this.mouseChildren = false;
}
protected function onButtonOver(e:MouseEvent):void{
mouseOn = true;
gotoAndPlay(mouseOverLabel);
SoundManager.playSound({name:"snd_buttonOn"});
}
protected function onClick(e:MouseEvent):void{
}
protected function onButtonUp(e:MouseEvent):void{
gotoAndStop(mouseOverLabel);
}
protected function onButtonDown(e:MouseEvent):void{
gotoAndStop(mouseDownLabel);
SoundManager.playSound({name:"snd_buttonClick"});
}
override protected function destructor():void{
removeListeners();
}
protected function onButtonOut(e:MouseEvent):void{
mouseOn = false;
gotoAndPlay(mouseOutLabel);
SoundManager.stopSound({name:"snd_buttonOn"});
}
}
}//package pl.fabrykagier.framework.ui.graphical
Section 9
//Popup (pl.fabrykagier.gardens.popups.Popup)
package pl.fabrykagier.gardens.popups {
import pl.fabrykagier.framework.main.*;
public class Popup extends GameObject {
public var pauseTime:Boolean;// = false
public var closeOnTime:Boolean;// = false
public var closeTime:int;// = 0
public var mimicButtonOnTime:String;// = ""
public var _label:String;
public function Popup(label:String="", pauseTime:Boolean=false, colseOnTime:Boolean=false, closeTime:int=0, mimicButtonOnTime:String=""){
super();
this._label = label;
this.pauseTime = pauseTime;
this.closeOnTime = closeOnTime;
this.closeTime = closeTime;
this.mimicButtonOnTime = mimicButtonOnTime;
}
public function clean():void{
}
public function initializeData(initParameters:Array):void{
gotoAndStop(_label);
}
}
}//package pl.fabrykagier.gardens.popups
Section 10
//PopupButton (pl.fabrykagier.gardens.popups.PopupButton)
package pl.fabrykagier.gardens.popups {
import flash.display.*;
import pl.fabrykagier.framework.media.*;
import flash.events.*;
import pl.fabrykagier.framework.events.*;
import pl.fabrykagier.framework.ui.graphical.*;
public class PopupButton extends InterfaceButton {
private var _highlighted:Boolean;// = false
private var highlightS:Sprite;
public static const BUTTON_CLICKED:String = "ButtonClicked";
public function PopupButton(){
super();
mouseChildren = false;
this.buttonMode = true;
}
override protected function onButtonDown(e:MouseEvent):void{
}
override protected function onButtonOver(e:MouseEvent):void{
super.onButtonOver(e);
}
override protected function onClick(e:MouseEvent):void{
var event:FrameworkEvent = new FrameworkEvent(BUTTON_CLICKED);
event.addParameter("name", this.name);
event.addParameter("source", this);
PopupManager.eventDispatcher.dispatchEvent(event);
SoundManager.playSound({name:"snd_buttonClick"});
}
public function removeHighlight():void{
removeChild(highlightS);
highlightS = null;
_highlighted = false;
}
public function get highlighted():Boolean{
return (_highlighted);
}
override protected function destructor():void{
}
public function highlight():void{
if (highlighted){
return;
};
highlightS = new Sprite();
highlightS.graphics.beginFill(0xFFFF00, 0.5);
highlightS.graphics.drawRect(0, 0, width, height);
highlightS.graphics.endFill();
_highlighted = true;
addChild(highlightS);
}
}
}//package pl.fabrykagier.gardens.popups
Section 11
//PopupManager (pl.fabrykagier.gardens.popups.PopupManager)
package pl.fabrykagier.gardens.popups {
import flash.display.*;
import pl.fabrykagier.framework.main.*;
import flash.events.*;
import pl.fabrykagier.framework.events.*;
import pl.fabrykagier.zookeeper.gameInterface.*;
import flash.utils.*;
public class PopupManager {
public static const PAUSE_TIME:String = "pauseTime";
public static const RESUME_TIME:String = "resumeTime";
public static const POPUP_HIDDEN:String = "popHidden";
public static var defaultDisplay:MovieClip;
private static var autoCloseTimer:Timer;
private static var _currentPopup:Popup;
private static var _eventDispatcher:GameObject = new GameObject();
private static var _popupDisplayed:Boolean = false;
private static var popupWindow:ZookeeperPopupWindow;
public function PopupManager(){
super();
}
public static function standardOKHandler(e:Event):void{
_eventDispatcher.removeEventListener(PopupButton.BUTTON_CLICKED, standardOKHandler);
hidePopup();
}
public static function hidePopup(skipAnim:Boolean=false, dontDisptachEvent:Boolean=false):void{
if (autoCloseTimer != null){
autoCloseTimer.stop();
};
if (_currentPopup.pauseTime){
_eventDispatcher.dispatchEvent(new Event(RESUME_TIME));
};
if (skipAnim){
popupWindow.parent.removeChild(popupWindow);
_currentPopup.clean();
_currentPopup = null;
popupWindow = null;
_popupDisplayed = false;
if (!dontDisptachEvent){
_eventDispatcher.dispatchEvent(new Event(POPUP_HIDDEN));
};
} else {
popupWindow.hide();
};
}
public static function clear():void{
reset();
_currentPopup = null;
defaultDisplay = null;
}
public static function reset():void{
clearListeners();
_popupDisplayed = false;
}
private static function autoHide(e:TimerEvent):void{
var fe:FrameworkEvent = new FrameworkEvent(PopupButton.BUTTON_CLICKED);
if (_currentPopup.mimicButtonOnTime != ""){
fe.addParameter("name", _currentPopup.mimicButtonOnTime);
fe.addParameter("source", (popupWindow.popupMessage.getChildAt(0) as MovieClip).getChildByName(_currentPopup.mimicButtonOnTime));
};
_eventDispatcher.dispatchEvent(fe);
}
public static function get popupDisplayed():Boolean{
return (_popupDisplayed);
}
public static function get eventDispatcher():GameObject{
return (_eventDispatcher);
}
public static function displayPopUp(display:MovieClip, popup:Popup, blockClicks:Boolean=true, skipIntro:Boolean=false, initParameters:Array=null):void{
var mClip:*;
if (_currentPopup != null){
hidePopup(true, true);
};
if (display == null){
mClip = defaultDisplay;
} else {
mClip = display;
};
_currentPopup = popup;
popupWindow = new ZookeeperPopupWindow();
popupWindow.popupMessage.addChild(popup);
popup.initializeData(initParameters);
popupWindow.appear(skipIntro);
if (_currentPopup.closeOnTime){
autoCloseTimer = new Timer(_currentPopup.closeTime);
autoCloseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, autoHide, false, 0, true);
autoCloseTimer.start();
};
if (_currentPopup.pauseTime){
eventDispatcher.dispatchEvent(new Event(PAUSE_TIME));
};
mClip.addChild(popupWindow);
if (blockClicks){
popupWindow.addEventListener(MouseEvent.MOUSE_DOWN, stopPropagation, false, 0, true);
popupWindow.addEventListener(MouseEvent.MOUSE_UP, stopPropagation, false, 0, true);
popupWindow.addEventListener(MouseEvent.MOUSE_OVER, stopPropagation, false, 0, true);
popupWindow.addEventListener(MouseEvent.MOUSE_OUT, stopPropagation, false, 0, true);
} else {
popupWindow.clickBlockade.visible = false;
};
_popupDisplayed = true;
}
private static function stopPropagation(e:MouseEvent):void{
e.stopImmediatePropagation();
e.stopPropagation();
}
public static function clearListeners():void{
_eventDispatcher.removeListeners();
}
public static function get currentPopup():Popup{
return (_currentPopup);
}
}
}//package pl.fabrykagier.gardens.popups
Section 12
//PopupWindow (pl.fabrykagier.gardens.popups.PopupWindow)
package pl.fabrykagier.gardens.popups {
import pl.fabrykagier.framework.main.*;
public class PopupWindow extends GameObject {
public function PopupWindow(){
super();
}
public function hide():void{
gotoAndPlay("hide");
}
protected function hideFinished():void{
PopupManager.hidePopup(true);
}
public function appear(skipIntro:Boolean=false):void{
if (skipIntro){
gotoAndStop("appeared");
} else {
gotoAndPlay("appear");
};
}
}
}//package pl.fabrykagier.gardens.popups
Section 13
//Functions (pl.fabrykagier.pluszakowo.Functions)
package pl.fabrykagier.pluszakowo {
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Functions {
public static function copyArray(tmpArray:Array):Array{
var returnArray:Array = new Array();
var i:int;
i = 0;
while (i < tmpArray.length) {
returnArray[i] = tmpArray[i];
i++;
};
return (returnArray);
}
public static function randomArray(tmpArray:Array):Array{
var tmpObject:Object;
var arrayLength:Number = tmpArray.length;
var i:Number = 0;
while (i < arrayLength) {
tmpObject = tmpArray.shift();
tmpArray.splice(Math.floor((Math.random() * arrayLength)), 0, tmpObject);
i++;
};
return (tmpArray);
}
public static function getChildByType(tmpMc:MovieClip, typeName:String, qualifiedClass:Boolean=false, qualifiedSuperClass:Boolean=false, byName:Boolean=false):Array{
var sName:String;
var tmpArray:Array;
var tmpMc = tmpMc;
var typeName = typeName;
var qualifiedClass = qualifiedClass;
var qualifiedSuperClass = qualifiedSuperClass;
var byName = byName;
var i:int;
var result:Array = new Array();
var checkArray:Array = new Array();
var j:int;
i = 0;
for (;i < tmpMc.numChildren;(i = (i + 1))) {
checkArray = new Array();
if (tmpMc.getChildAt(i) == null){
continue;
};
if (qualifiedClass){
sName = getQualifiedClassName(tmpMc.getChildAt(i)).split("::")[1];
checkArray.push(sName);
};
if (qualifiedSuperClass){
sName = getQualifiedSuperclassName(tmpMc.getChildAt(i)).split("::")[1];
checkArray.push(sName);
};
if (byName){
tmpArray = tmpMc.getChildAt(i).name.split("_");
j = 0;
while (j < tmpArray.length) {
checkArray.push(tmpArray[j]);
j = (j + 1);
};
//unresolved jump
var _slot1 = e;
};
};
return (result);
}
public static function playSound(sndName:String="snd_", times:int=1):SoundChannel{
var tmpClass:Class = (getDefinitionByName(sndName) as Class);
var tmpSound:Sound = (new (tmpClass) as Sound);
return (tmpSound.play(0, times));
}
public static function playerNumberToLetter(nr:Number):String{
switch (nr){
case 1:
return ("H");
case 2:
return ("D");
case 3:
return ("S");
case 4:
return ("B");
case 5:
return ("C");
};
return ("");
}
public static function correctGradka(nr:int):int{
var gradkaNew:Array = new Array(0, 7, 1, 9, 6, 3, 4, 8, 5, 10, 2);
return (gradkaNew[nr]);
}
}
}//package pl.fabrykagier.pluszakowo
Section 14
//ContinuePlayButton (pl.fabrykagier.zookeeper.gameInterface.ContinuePlayButton)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import flash.events.*;
import pl.fabrykagier.framework.ui.graphical.*;
public class ContinuePlayButton extends InterfaceButton {
public function ContinuePlayButton(){
addFrameScript(0, frame1, 1, frame2);
super();
}
override protected function onClick(e:MouseEvent):void{
MovieClip(this.parent).play();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 15
//LevelContainer (pl.fabrykagier.zookeeper.gameInterface.LevelContainer)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
public class LevelContainer extends MovieClip {
public function LevelContainer(){
super();
addFrameScript(0, frame1);
}
public function get resetNumber():int{
var tmpArray:Array = this.currentLabel.split("_");
tmpArray.splice(0, 7);
return (parseInt(tmpArray[0]));
}
public function get typesNumber():int{
var tmpArray:Array = this.currentLabel.split("_");
tmpArray.splice(0, 3);
return (parseInt(tmpArray[0]));
}
public function get cardsNumber():int{
var tmpArray:Array = this.currentLabel.split("_");
tmpArray.splice(0, 5);
return (parseInt(tmpArray[0]));
}
public function get levelNumber():int{
return (this.currentFrame);
}
function frame1(){
this.stop();
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 16
//MutteButton (pl.fabrykagier.zookeeper.gameInterface.MutteButton)
package pl.fabrykagier.zookeeper.gameInterface {
import pl.fabrykagier.framework.media.*;
import flash.events.*;
import pl.fabrykagier.framework.ui.graphical.*;
public class MutteButton extends InterfaceButton {
public function MutteButton(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
super();
this.setEventsLabels();
this.onButtonOut(null);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
override protected function onClick(e:MouseEvent):void{
if (!SoundManager.mute){
SoundManager.muteOn();
} else {
SoundManager.muteOff();
};
setEventsLabels();
this.onButtonOver(null);
}
private function setEventsLabels():void{
mouseOverLabel = "OverOn";
mouseOutLabel = "OutOn";
if (SoundManager.mute){
mouseOverLabel = "OverOff2";
mouseOutLabel = "OutOff2";
};
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 17
//PopupEnterName (pl.fabrykagier.zookeeper.gameInterface.PopupEnterName)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
import flash.events.*;
import pl.fabrykagier.framework.events.*;
import pl.fabrykagier.zookeeper.*;
import flash.text.*;
public class PopupEnterName extends PopupTemplate {
private var _enterName:TextField;
private var _oldName:String;
public function PopupEnterName(mc:MovieClip){
super(mc);
this._enterName = (this._mc.getChildByName("nameField") as TextField);
PopupManager.eventDispatcher.addEventListener(PopupButton.BUTTON_CLICKED, checkName);
this._enterName.addEventListener(Event.CHANGE, checkInputChar);
this._enterName.addEventListener(FocusEvent.FOCUS_IN, resetName);
}
private function resetName(e:FocusEvent):void{
this._enterName.text = "";
}
private function checkName(e:FrameworkEvent):void{
if (((!((this._enterName.text.toLowerCase() == ""))) && (!((this._enterName.text.toLowerCase() == "enter your first name"))))){
Settings.playerName = this._enterName.text;
this._enterName.removeEventListener(Event.CHANGE, checkInputChar);
this._enterName.removeEventListener(FocusEvent.FOCUS_IN, resetName);
PopupManager.hidePopup();
};
}
private function checkInputChar(e:Event):void{
var tmpInt:int;
var tmpString:String = "";
var resultString:String = "";
var i:int;
var tmpLength:int = this._enterName.text.length;
i = 0;
while (i < tmpLength) {
tmpString = this._enterName.text.charAt(i);
tmpInt = tmpString.charCodeAt();
if ((((((((tmpInt >= 48)) && ((tmpInt <= 57)))) || ((((tmpInt >= 65)) && ((tmpInt <= 90)))))) || ((((tmpInt >= 97)) && ((tmpInt <= 122)))))){
resultString = (resultString + tmpString);
};
i++;
};
this._enterName.text = resultString;
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 18
//PopupTemplate (pl.fabrykagier.zookeeper.gameInterface.PopupTemplate)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
import flash.events.*;
public class PopupTemplate {
protected var _mc:MovieClip;
public function PopupTemplate(mc:MovieClip=null){
super();
if (mc == null){
mc = (PopupManager.currentPopup.getChildAt(0) as MovieClip);
if (mc == null){
throw (new Error("no inner popup"));
};
};
this._mc = mc;
this._mc.addEventListener(Event.REMOVED_FROM_STAGE, destroy);
}
private function destroy(e:Event):void{
this._mc.removeEventListener(Event.REMOVED_FROM_STAGE, destroy);
this._mc = undefined;
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 19
//PopupTutorial (pl.fabrykagier.zookeeper.gameInterface.PopupTutorial)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
import pl.fabrykagier.framework.events.*;
import pl.fabrykagier.zookeeper.*;
import pl.fabrykagier.pluszakowo.*;
import flash.text.*;
public class PopupTutorial extends PopupTemplate {
public function PopupTutorial(mc:MovieClip){
super(mc);
PopupManager.eventDispatcher.addEventListener(PopupButton.BUTTON_CLICKED, mouseAcction);
TextField(this._mc.getChildByName("playerName")).text = (("Hello, " + Settings.playerName) + " !");
}
private function mouseAcction(e:FrameworkEvent):void{
var tmpMC:MovieClip;
var tmpArray:Array;
var sName:String = (e.getParameter("name") as String);
if ((((sName == "skip")) || ((this._mc.currentFrame == 2)))){
tmpArray = Functions.getChildByType(this._mc, "MovieClip", true, true, false);
for each (tmpMC in tmpArray) {
tmpMC.stop();
};
PopupManager.hidePopup();
return;
};
this._mc.gotoAndStop(2);
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 20
//PopupWellDone (pl.fabrykagier.zookeeper.gameInterface.PopupWellDone)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
import pl.fabrykagier.framework.events.*;
import pl.fabrykagier.zookeeper.*;
import flash.text.*;
public class PopupWellDone extends PopupTemplate {
public function PopupWellDone(mc:MovieClip){
var tmpTextField:TextField;
super(mc);
TextField(this._mc.getChildByName("totalPoints")).text = Settings.totalPoints.toString();
TextField(this._mc.getChildByName("levelPoints")).text = Settings.levelPoints.toString();
tmpTextField = (this._mc.getChildByName("retryCounter") as TextField);
if (tmpTextField != null){
tmpTextField.text = Settings.retryCounter.toString();
};
if (Settings.currentLevel > 10){
this._mc.gotoAndStop(2);
};
PopupManager.eventDispatcher.addEventListener(PopupButton.BUTTON_CLICKED, mouseAcction);
}
private function mouseAcction(e:FrameworkEvent):void{
var sName:String = (e.getParameter("name") as String);
switch (sName){
case "quit":
Settings.currentLevel = -1;
break;
case "start":
Settings.currentLevel = 1;
Settings.totalPoints = 0;
Settings.retryCounter = 3;
break;
case "next":
case "next2":
case "next3":
break;
default:
return;
};
PopupManager.hidePopup();
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 21
//TopInterface (pl.fabrykagier.zookeeper.gameInterface.TopInterface)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import flash.events.*;
import pl.fabrykagier.zookeeper.*;
import flash.text.*;
public class TopInterface extends MovieClip {
public var muteBtn:MutteButton;
public var game_level_indicator:MovieClip;
public var levelNumber:TextField;
public var levelPoints:TextField;
public var game_main_menu:button_hud_quitGame;
private static var dispatcher:EventDispatcher;
public function TopInterface(){
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED_TO_STAGE, setttings);
this.addEventListener(Event.REMOVED_FROM_STAGE, destroy);
if (TopInterface.dispatcher == null){
TopInterface.dispatcher = new EventDispatcher();
};
TopInterface.dispatcher.addEventListener(Event.CHANGE, setttings);
}
private function setttings(e:Event):void{
var tmpTextField:TextField;
var tmpMc:MovieClip;
removeEventListener(Event.ADDED_TO_STAGE, setttings);
tmpTextField = (this.getChildByName("levelPoints") as TextField);
tmpTextField.text = Settings.levelPoints.toString();
tmpTextField = (this.getChildByName("levelNumber") as TextField);
tmpTextField.text = Settings.currentLevel.toString();
tmpMc = (this.getChildByName("game_level_indicator") as MovieClip);
tmpMc.gotoAndStop((Settings.currentLevel + 1));
tmpMc = (this.getChildByName("game_main_menu") as MovieClip);
tmpMc.addEventListener(MouseEvent.CLICK, mouseAction);
tmpMc.gotoAndStop(1);
}
function frame1(){
}
private function destroy(e:Event):void{
var tmpMc:MovieClip = (this.getChildByName("game_main_menu") as MovieClip);
removeEventListener(Event.REMOVED_FROM_STAGE, destroy);
TopInterface.dispatcher.removeEventListener(Event.CHANGE, setttings);
tmpMc.removeEventListener(MouseEvent.CLICK, mouseAction);
}
private function mouseAction(e:MouseEvent):void{
(e.currentTarget as MovieClip).removeEventListener(MouseEvent.CLICK, mouseAction);
Settings.currentLevel = -1;
MovieClip(this.parent).play();
}
public static function showChanges():void{
TopInterface.dispatcher.dispatchEvent(new Event(Event.CHANGE));
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 22
//ZookeeperPopup (pl.fabrykagier.zookeeper.gameInterface.ZookeeperPopup)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
import flash.events.*;
import pl.fabrykagier.pluszakowo.*;
public class ZookeeperPopup extends Popup {
private var _oldParameters:Array;
private var _innerPopup:MovieClip;
public function ZookeeperPopup(gotoLabel:String=""){
addFrameScript(0, frame1, 18, frame19, 32, frame33, 51, frame52, 65, frame66, 85, frame86, 98, frame99, 117, frame118, 131, frame132, 150, frame151, 164, frame165);
super(gotoLabel);
}
function frame151(){
this.stop();
}
function frame52(){
this.stop();
}
function frame86(){
this.stop();
}
function frame99(){
stop();
this.finishPopup();
}
private function initializeInnerPopup():void{
var i:int;
this._innerPopup = null;
this.removeEventListener(Event.ENTER_FRAME, initializeDataEnterFrame);
this.addEventListener(Event.ENTER_FRAME, initializeDataEnterFrame);
var tmpMc:MovieClip = (Functions.getChildByType(this, "MovieCLip", true, true, false)[0] as MovieClip);
if (tmpMc != null){
i = 0;
this._innerPopup = tmpMc;
i = 0;
while (i < (tmpMc.numChildren - 1)) {
if (tmpMc.getChildAt(i) == null){
this._innerPopup = null;
return;
};
i++;
};
};
if (this._innerPopup != null){
this.removeEventListener(Event.ENTER_FRAME, initializeDataEnterFrame);
this.setPopup();
};
}
function frame1(){
this.stop();
}
function frame33(){
stop();
this.finishPopup();
}
private function initializeDataEnterFrame(e:Event=null):void{
this.initializeInnerPopup();
}
function frame165(){
stop();
this.finishPopup();
}
private function setPopup():void{
switch (this.currentLabel){
case "enterName":
new PopupEnterName(this._innerPopup);
break;
case "tutorial":
new PopupTutorial(this._innerPopup);
break;
default:
new PopupWellDone(this._innerPopup);
break;
};
}
function frame66(){
stop();
this.finishPopup();
}
function frame118(){
this.stop();
}
private function finishPopup():void{
PopupManager.hidePopup(true);
}
override public function initializeData(initParameters:Array):void{
this.gotoAndPlay(this._label);
this._oldParameters = initParameters;
this.initializeDataEnterFrame();
}
function frame132(){
stop();
this.finishPopup();
}
function frame19(){
this.stop();
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 23
//ZookeeperPopupWindow (pl.fabrykagier.zookeeper.gameInterface.ZookeeperPopupWindow)
package pl.fabrykagier.zookeeper.gameInterface {
import flash.display.*;
import pl.fabrykagier.gardens.popups.*;
public class ZookeeperPopupWindow extends PopupWindow {
public var popupMessage:MovieClip;
public var clickBlockade:MovieClip;
public function ZookeeperPopupWindow(){
super();
addFrameScript(14, frame15, 30, frame31);
}
function frame15(){
stop();
}
override public function hide():void{
PopupManager.currentPopup.gotoAndPlay((PopupManager.currentPopup.currentFrame + 1));
}
override public function appear(skipIntro:Boolean=false):void{
PopupManager.currentPopup.gotoAndPlay((PopupManager.currentPopup.currentFrame + 1));
}
function frame31(){
stop();
}
}
}//package pl.fabrykagier.zookeeper.gameInterface
Section 24
//Card (pl.fabrykagier.zookeeper.Card)
package pl.fabrykagier.zookeeper {
import flash.display.*;
import pl.fabrykagier.framework.media.*;
import flash.geom.*;
import pl.fabrykagier.pluszakowo.*;
import flash.utils.*;
public class Card extends MovieClip {
private var typeLEFT:int;
private var _points:int;
private var typeRIGHT:int;
private var lastXY:Point;
private var _happynes:Boolean;
private var fromDistributor:Boolean;// = true
private var typeBOTTOM:int;
private var position:Point;
private var typeTOP:int;
private var _lastParent:MovieClip;
protected static var animalsNames:Array;
public function Card(left:int=0, bottom:int=0, right:int=1, top:int=1){
var animalClassName:String;
super();
this._happynes = false;
lastXY = new Point(0, 0);
buttonMode = true;
mouseChildren = false;
this.typeBOTTOM = bottom;
this.typeLEFT = left;
this.typeTOP = top;
this.typeRIGHT = right;
this._points = (Math.ceil((Math.random() * 5)) * 5);
if ((((((((left == bottom)) && ((bottom == right)))) && ((right == top)))) && ((top == -1)))){
createAndAddGraphic("Card_superCard");
this._points = 0;
this._happynes = true;
} else {
if ((((((left == bottom)) && ((bottom == right)))) && ((right == top)))){
animalClassName = (("Card_" + Card.animalsNames[left]) + "_Full");
createAndAddGraphic(animalClassName);
} else {
if ((((left == bottom)) && ((right == top)))){
animalClassName = (("Card_" + Card.animalsNames[top]) + "_TopRight");
createAndAddGraphic(animalClassName);
animalClassName = (("Card_" + Card.animalsNames[left]) + "_BottomLeft");
createAndAddGraphic(animalClassName);
} else {
if ((((left == top)) && ((right == bottom)))){
animalClassName = (("Card_" + Card.animalsNames[left]) + "_TopLeft");
createAndAddGraphic(animalClassName);
animalClassName = (("Card_" + Card.animalsNames[bottom]) + "_BottomRight");
createAndAddGraphic(animalClassName);
//unresolved jump
};
};
};
};
var tmpPoints:CardPoints = new CardPoints(this.points);
if (this._points != 0){
this.addChild(tmpPoints);
};
this.setHappynes(!(this.getHappynes()));
this.setHappynes(!(this.getHappynes()));
}
public function set lastParent(value:MovieClip):void{
this.removeMask();
_lastParent = value;
}
public function get _typeRIGHT():int{
return (typeRIGHT);
}
public function setHappynes(happy:Boolean):void{
var tmpArray2:Array;
var tmpMc2:MovieClip;
var tmpMc:MovieClip;
var tmpArray:Array = Functions.getChildByType(this, "MovieClip", true, true, false);
if (this.getHappynes() == happy){
return;
};
this.alpha = 1;
this.visible = true;
if (happy){
this.alpha = 1;
for each (tmpMc in tmpArray) {
tmpArray2 = Functions.getChildByType(tmpMc, "MovieClip", true, true, false);
for each (tmpMc2 in tmpArray2) {
tmpMc2.gotoAndPlay(1);
};
tmpMc.gotoAndPlay(1);
};
} else {
for each (tmpMc in tmpArray) {
tmpArray2 = Functions.getChildByType(tmpMc, "MovieClip", true, true, false);
for each (tmpMc2 in tmpArray2) {
tmpMc2.gotoAndStop(1);
};
tmpMc.gotoAndStop(1);
};
};
this._happynes = happy;
}
public function get _position():Point{
return (position);
}
public function get _lastXY():Point{
return (lastXY);
}
override public function toString():String{
return ((((typeBOTTOM.toString() + typeLEFT.toString()) + typeTOP.toString()) + typeRIGHT.toString()));
}
public function resetXY():void{
if (this._lastParent != this.parent){
this._lastParent.addChild(this);
};
if (this._fromDistributor){
MovieClip(this.lastParent.parent).gotoAndStop("card");
};
this.x = lastXY.x;
this.y = lastXY.y;
var tmpPoint:* = new Point(0, 0);
tmpPoint = this.localToGlobal(tmpPoint);
this.removeMask();
}
public function get _typeBOTTOM():int{
return (typeBOTTOM);
}
public function set _fromDistributor(fromDistributor:Boolean):void{
this.fromDistributor = fromDistributor;
}
public function setLastXY(x:Number, y:Number):void{
this.lastXY.x = x;
this.lastXY.y = y;
}
public function destroy():void{
this._lastParent = undefined;
this.parent.removeChild(this);
}
public function get _fromDistributor():Boolean{
return (fromDistributor);
}
public function removeMask():void{
var tmpShap:Shape = (getChildAt(0) as Shape);
if (((!((tmpShap == null))) && ((tmpShap.width > 300)))){
this.removeChild(tmpShap);
};
}
public function get _typeLEFT():int{
return (typeLEFT);
}
private function createAndAddGraphic(className:String):void{
var classRef:Class = (getDefinitionByName(className) as Class);
addChild((new (classRef) as MovieClip));
}
public function get points():int{
return (_points);
}
public function get lastParent():MovieClip{
return (_lastParent);
}
public function setPosition(position:Point):void{
this.position = position;
}
public function compare(card:Card):int{
var isOK:int;
if (((((this.position.x - card._position.x) == 1)) && (((this.position.y - card._position.y) == 0)))){
if ((((((this._typeLEFT == card._typeRIGHT)) || ((this._typeLEFT == -1)))) || ((card._typeRIGHT == -1)))){
isOK = 1;
} else {
isOK = -1;
};
};
if (((((this.position.x - card._position.x) == -1)) && (((this.position.y - card._position.y) == 0)))){
if ((((((this._typeRIGHT == card._typeLEFT)) || ((this._typeLEFT == -1)))) || ((card._typeRIGHT == -1)))){
isOK = 1;
} else {
isOK = -1;
};
};
if (((((this.position.x - card._position.x) == 0)) && (((this.position.y - card._position.y) == 1)))){
if ((((((this._typeTOP == card._typeBOTTOM)) || ((this._typeTOP == -1)))) || ((card._typeBOTTOM == -1)))){
isOK = 1;
} else {
isOK = -1;
};
};
if (((((this.position.x - card._position.x) == 0)) && (((this.position.y - card._position.y) == -1)))){
if ((((((this._typeBOTTOM == card._typeTOP)) || ((this._typeTOP == -1)))) || ((card._typeBOTTOM == -1)))){
isOK = 1;
} else {
isOK = -1;
};
};
return (isOK);
}
public function addMask():void{
this.removeMask();
var tmpShape:Shape = new Shape();
tmpShape.graphics.beginFill(0xFFCC00);
tmpShape.graphics.lineStyle(1, 1);
tmpShape.graphics.drawCircle(0, 0, 400);
tmpShape.graphics.endFill();
tmpShape.alpha = 0;
this.addChildAt(tmpShape, 0);
}
public function getHappynes():Boolean{
return (this._happynes);
}
public function moveToPosition(x:int, y:int):void{
this.x = x;
this.y = y;
}
public function removeFromBoard():void{
this.parent.removeChild(this);
}
public function get _typeTOP():int{
return (typeTOP);
}
public static function randomAnimals(nr:int=3):void{
var tmpArray:Array = new Array("Bear", "Elephant", "Dolphin", "Lion", "Monkey", "Donkey");
Card.animalsNames = Functions.randomArray(tmpArray);
while (Card.animalsNames.length > nr) {
Card.animalsNames.pop();
};
}
public static function playSound(type:int=0):void{
var sName:String;
var tmpNumber:Number = Math.floor((Math.random() * 2));
sName = ((("snd_" + String(Card.animalsNames[type]).toLowerCase()) + "_") + tmpNumber.toString());
if (type < 0){
return;
};
SoundManager.playSound({name:sName});
}
public static function getCard():Card{
var b:int;
var a:int;
var tmpNumber:Number = Math.floor((Math.random() * Card.animalsNames.length));
a = tmpNumber;
tmpNumber = Math.floor((Math.random() * Card.animalsNames.length));
b = tmpNumber;
if ((Math.random() * 1) < 0.05){
return (new Card(-1, -1, -1, -1));
};
return (new Card(a, a, b, b));
}
}
}//package pl.fabrykagier.zookeeper
Section 25
//CardPoints (pl.fabrykagier.zookeeper.CardPoints)
package pl.fabrykagier.zookeeper {
import flash.display.*;
import flash.events.*;
import pl.fabrykagier.pluszakowo.*;
import flash.text.*;
public class CardPoints extends MovieClip {
private var _points:Number;
public function CardPoints(points:Number=10){
super();
this._points = points;
this.addEventListener(Event.ADDED_TO_STAGE, settings);
}
private function settings(e:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, settings);
var tmpTF:TextField = (Functions.getChildByType(this, "textfield", true, true, false)[0] as TextField);
tmpTF.text = this._points.toString();
}
}
}//package pl.fabrykagier.zookeeper
Section 26
//FreeSlotMarker (pl.fabrykagier.zookeeper.FreeSlotMarker)
package pl.fabrykagier.zookeeper {
import flash.display.*;
import flash.geom.*;
public class FreeSlotMarker extends MovieClip {
private var position:Point;
public function FreeSlotMarker(){
super();
}
public function get _position():Point{
return (position);
}
public function set _position(position:Point):void{
this.position = position;
}
}
}//package pl.fabrykagier.zookeeper
Section 27
//MainGame (pl.fabrykagier.zookeeper.MainGame)
package pl.fabrykagier.zookeeper {
import flash.display.*;
import pl.fabrykagier.framework.media.*;
import pl.fabrykagier.gardens.popups.*;
import flash.events.*;
import pl.fabrykagier.zookeeper.gameInterface.*;
import pl.fabrykagier.*;
import com.ubi.game.*;
import flash.ui.*;
public dynamic class MainGame extends GameBase {
public var muteBtn:MutteButton;
public var game_next_cards:MovieClip;
public var _TitleIn:Button_Hud_PlayNow;
public var game_levels:LevelContainer;
private var _zookeeperGame:ZookeeperManager;
public var progress_mc:PreloaderText;
public var menuBar:TopInterface;
public function MainGame(){
super();
addFrameScript(34, frame35, 40, frame41, 98, frame99, 122, frame123, 140, frame141, 144, frame145, 152, frame153, 165, frame166, 167, frame168, 168, frame169, 169, frame170, 187, frame188, 194, frame195, 196, frame197, 197, frame198, 407, frame408, 462, frame463, 495, frame496);
Settings.playerName = "";
this.resetCounters();
this.tabEnabled = false;
this.tabChildren = false;
this.resetCounters();
this.hideContextMenu();
MochiBot.track(this, "8395ab3e");
if ((((LoaderInfo(this.loaderInfo).parameters.InImagineTown == false)) || ((LoaderInfo(this.loaderInfo).parameters.InImagineTown == "false")))){
Settings.standAlone = false;
} else {
Settings.standAlone = true;
};
}
function frame195(){
this.blockGame(false);
}
private function continuePlay(e:Event):void{
PopupManager.eventDispatcher.removeListeners();
this.play();
}
function frame408(){
this.stop();
}
function frame153(){
this.blockGame(true);
}
function frame198(){
this.resetCounters();
}
function frame496(){
this.stop();
this.gotoAndPlay("startTitle");
}
private function hideContextMenu():void{
var tmpContext:ContextMenu = new ContextMenu();
tmpContext.hideBuiltInItems();
this.contextMenu = tmpContext;
}
private function outOfTheGame():void{
if (Settings.currentLevel <= 0){
this.gotoAndPlay("startTitle");
this.resetCounters();
} else {
if (Settings.currentLevel > 10){
this.resetCounters();
this.play();
} else {
Settings.levelPoints = 0;
this.gotoAndPlay("game");
};
};
}
private function initializeSoundManager():void{
this.playMusic();
}
function frame35(){
this.stop();
}
private function playMusic(sName:String="snd_gameMusic"):void{
SoundManager.stopSound({name:"snd_menuMusic"});
SoundManager.stopSound({name:"snd_gameMusic"});
SoundManager.playSound({name:sName, loops:9999});
}
public function playAgain():void{
this.destroyGame();
this.gotoAndPlay("startTitle");
}
function frame99(){
this.stop();
}
function frame197(){
this.outOfTheGame();
}
private function inicializeGame():void{
var sName:String;
var tmpNumber:Number;
var tmpLevel:LevelContainer = (this.getChildByName("game_levels") as LevelContainer);
var tmpNextCardContainer:MovieClip = (this.getChildByName("game_next_cards") as MovieClip);
tmpLevel.gotoAndStop(Settings.currentLevel);
tmpNumber = tmpLevel.cardsNumber;
switch (tmpNumber){
case -1:
this.resetCounters();
this.inicializeGame();
return;
case 4:
case 5:
sName = ("level_" + tmpNumber.toString());
tmpNextCardContainer.gotoAndStop(sName);
break;
default:
tmpNextCardContainer.gotoAndStop(1);
break;
};
Card.randomAnimals(tmpLevel.typesNumber);
}
override public function submitScore(score:Number):void{
if (isNaN(score)){
score = Settings.totalPoints;
};
super.submitScore(score);
}
private function destroyGame():void{
if (((!((this._zookeeperGame == null))) && (this.contains(this._zookeeperGame)))){
this.removeChild(this._zookeeperGame);
};
this.mouseChildren = false;
this.mouseEnabled = false;
}
function frame463(){
this.stop();
}
function frame141(){
this.inicializeGame();
}
function frame166(){
this.blockGame(false);
}
function frame123(){
this.showPopup("enterName");
this.resetCounters();
}
private function resetCounters():void{
Settings.currentLevel = 1;
var tmpNumber:Number = LoaderInfo(this.loaderInfo).parameters.jacus;
if (!isNaN(tmpNumber)){
Settings.currentLevel = tmpNumber;
};
Settings.levelPoints = 0;
Settings.totalPoints = 0;
Settings.retryCounter = 3;
Settings.tutorialDone = false;
}
function frame169(){
this.stop();
}
function frame41(){
this.initializeSoundManager();
}
function frame188(){
this.destroyGame();
}
function frame145(){
this.startGame();
}
private function levelDone(e:Event):void{
Settings.currentLevel++;
this._zookeeperGame.disableGame();
Settings.retryCounter = 3;
Settings.totalPoints = (Settings.totalPoints + Settings.levelPoints);
this.showPopup("wellDone");
if (Settings.currentLevel > 10){
SoundManager.playSound({name:"snd_win_1"});
};
}
private function blockGame(opt:Boolean=true):void{
if (this._zookeeperGame != null){
if (opt){
this._zookeeperGame.disableGame();
} else {
this._zookeeperGame.enableGame();
};
};
this.mouseChildren = !(opt);
this.mouseEnabled = !(opt);
}
function frame168(){
this.showPopup("tutorial");
}
private function showPopup(sName:String=""):void{
var tmpZookeeperPopup:ZookeeperPopup;
this.stop();
switch (sName){
case "tutorial":
if (!Settings.tutorialDone){
if (Settings.currentLevel != 1){
this.play();
return;
};
this.gotoAndStop((this.currentFrame - 1));
tmpZookeeperPopup = new ZookeeperPopup("tutorial");
Settings.tutorialDone = true;
} else {
this.play();
return;
};
break;
default:
tmpZookeeperPopup = new ZookeeperPopup(sName);
break;
};
this.hideContextMenu();
PopupManager.displayPopUp(this, tmpZookeeperPopup, true, true, ["a", "b", "c"]);
PopupManager.eventDispatcher.addEventListener(PopupManager.POPUP_HIDDEN, continuePlay);
}
private function levelLose(e:Event):void{
Settings.retryCounter--;
this._zookeeperGame.disableGame();
if (Settings.retryCounter <= 0){
this.showPopup("gameFailed");
Settings.currentLevel = -1;
return;
};
this.showPopup("levelFailed");
}
override public function destroy():void{
this.destroyGame();
stop();
}
private function startGame():void{
var tmpLevel:LevelContainer = (this.getChildByName("game_levels") as LevelContainer);
var tmpNextCardContainer:MovieClip = (this.getChildByName("game_next_cards") as MovieClip);
this._zookeeperGame = new ZookeeperManager();
this._zookeeperGame.settings(tmpLevel, tmpNextCardContainer);
this._zookeeperGame.addEventListener(ZookeeperManager.LEVEL_WON, levelDone);
this._zookeeperGame.addEventListener(ZookeeperManager.LEVEL_LOOSE, levelLose);
this.addChild(this._zookeeperGame);
}
function frame170(){
this.blockGame(true);
}
}
}//package pl.fabrykagier.zookeeper
Section 28
//Settings (pl.fabrykagier.zookeeper.Settings)
package pl.fabrykagier.zookeeper {
public class Settings {
public static var tutorialDone:Boolean;
public static var standAlone:Boolean;
public static var levelPoints:Number;
public static var currentLevel:int;
public static var playerName:String;
public static var retryCounter:Number;
public static var totalPoints:Number;
public function Settings(){
super();
}
}
}//package pl.fabrykagier.zookeeper
Section 29
//ZookeeperManager (pl.fabrykagier.zookeeper.ZookeeperManager)
package pl.fabrykagier.zookeeper {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import pl.fabrykagier.zookeeper.gameInterface.*;
import pl.fabrykagier.pluszakowo.*;
import flash.text.*;
public class ZookeeperManager extends MovieClip {
private var cardWidth:int;// = 93
private var _mapOffset:Point;
private var _nextCardContainer:MovieClip;
private var slots:Array;
private var maxResetNum:int;// = 3
private var cardHeight:int;// = 93
private var cardsOnMap:Array;
private var map:Array;
private var cardMargin:int;// = 0
private var resetButton:MovieClip;
private var maxCardsOnBoard:int;// = 3
private var dragCard:Card;
private var cardsOnBoard:Array;
private var _levelContainer:LevelContainer;
public static var LEVEL_LOOSE:String = "level_loose";
public static var LEVEL_WON:String = "level_won";
public function ZookeeperManager(){
map = [];
cardsOnMap = [];
cardsOnBoard = [];
super();
this.addEventListener(Event.ADDED_TO_STAGE, initialize);
this.addEventListener(Event.REMOVED_FROM_STAGE, destroy);
}
private function addResetButton():void{
resetButton = (Functions.getChildByType(this._nextCardContainer, "shuffle", false, false, true)[0] as MovieClip);
resetButton.addEventListener(MouseEvent.CLICK, resetCardsOnBoard);
}
private function startDraggingCard(card:Card):void{
var tmpPoint:*;
if (this.dragCard != null){
this.dragCard.resetXY();
this.dragCard.stopDrag();
this.dragCard = null;
return;
};
dragCard = card;
tmpPoint = new Point(card.x, card.y);
tmpPoint = card.lastParent.localToGlobal(tmpPoint);
if (card._fromDistributor){
MovieClip(card.lastParent.parent).gotoAndPlay("disappear");
};
card.lastParent = (card.lastParent as MovieClip);
card.setLastXY(card.x, card.y);
tmpPoint = this._levelContainer.globalToLocal(tmpPoint);
MovieClip(this._nextCardContainer.parent).addChild(card);
card.x = tmpPoint.x;
card.y = tmpPoint.y;
card.setHappynes(false);
card.addEventListener(MouseEvent.ROLL_OUT, onMouseUpAction);
card.addEventListener(MouseEvent.MOUSE_OUT, onMouseUpAction);
card.addEventListener(MouseEvent.MOUSE_UP, onMouseUpAction);
card.startDrag();
}
public function get _maxResetNum():int{
return (maxResetNum);
}
public function destroy(event:Event=null):void{
var tmpCard:Card;
for each (tmpCard in cardsOnBoard) {
tmpCard.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
tmpCard.destroy();
};
for each (tmpCard in cardsOnMap) {
tmpCard.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
tmpCard.destroy();
};
cardsOnBoard = new Array();
cardsOnMap = new Array();
this.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpAction);
stage.removeEventListener(MouseEvent.ROLL_OUT, onMouseUpAction);
resetButton.removeEventListener(MouseEvent.CLICK, resetCardsOnBoard);
this.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpAction);
this.removeEventListener(Event.ADDED_TO_STAGE, initialize);
this.removeEventListener(Event.REMOVED_FROM_STAGE, destroy);
this.resetButton = undefined;
this._levelContainer = undefined;
this._nextCardContainer = undefined;
}
private function setCardOnMap(card:Card, posintion:Point, depthMc:MovieClip=null):void{
var tmpNumber:Number;
card.setPosition(posintion);
this._levelContainer.addChild(card);
card.moveToPosition(((posintion.x * cardWidth) + this._mapOffset.x), ((posintion.y * cardWidth) + this._mapOffset.y));
map[posintion.x][posintion.y] = card;
if (card._fromDistributor){
card._fromDistributor = false;
card.lastParent = this._levelContainer;
cardsOnMap.push(card);
cardsOnBoard.splice(cardsOnBoard.indexOf(card), 1);
};
if (depthMc != null){
card.x = depthMc.x;
card.y = depthMc.y;
tmpNumber = (this._levelContainer.getChildIndex(depthMc) + 1);
if (tmpNumber >= this._levelContainer.numChildren){
tmpNumber = (this._levelContainer.numChildren - 1);
};
this._levelContainer.setChildIndex(card, tmpNumber);
};
}
private function buildMap():void{
var child:DisplayObject;
var slot:FreeSlotMarker;
var i:int;
map = [];
slots = [];
var tmpMap:Array = [];
var maxW:int;
var maxH:int;
var offX:Number = 100000;
var offY:Number = 1000000;
var j:int;
while (j < (this._levelContainer.numChildren - 1)) {
child = this._levelContainer.getChildAt(j);
if ((child is FreeSlotMarker)){
map.push(child);
slots.push(child);
};
j++;
};
for each (slot in map) {
offX = Math.min(offX, slot.x);
offY = Math.min(offY, slot.y);
};
this._mapOffset = new Point(offX, offY);
for each (slot in map) {
slot._position = new Point(int(((slot.x - this._mapOffset.x) / cardWidth)), int(((slot.y - this._mapOffset.y) / cardHeight)));
maxW = Math.max(maxW, slot._position.x);
maxH = Math.max(maxH, slot._position.y);
offX = Math.min(offX, slot.x);
offY = Math.min(offY, slot.y);
};
i = 0;
while (i < (maxW + 1)) {
tmpMap.push(new Array((maxH + 1)));
i++;
};
for each (slot in map) {
tmpMap[slot._position.x][slot._position.y] = "free";
};
this.map = tmpMap;
}
private function swapCards(cardA:Card, cardB:Card):void{
var tmpPosition:Point = cardA._position.clone();
var tmpSlotA:FreeSlotMarker = getNearesSlot(cardA);
var tmpSlotB:FreeSlotMarker = getNearesSlot(cardB);
setCardOnMap(cardA, cardB._position, tmpSlotB);
setCardOnMap(cardB, tmpPosition, tmpSlotA);
}
private function distributeCard(x:int, y:int, container:MovieClip=null):Card{
var tmpCard:Card;
if (container == null){
container = this._levelContainer;
};
tmpCard = Card.getCard();
tmpCard.x = x;
tmpCard.y = y;
container.addChild(tmpCard);
tmpCard.lastParent = container;
cardsOnBoard.push(tmpCard);
tmpCard.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
return (tmpCard);
}
public function enableGame():void{
var tmpCard:Card;
for each (tmpCard in cardsOnMap) {
tmpCard.mouseEnabled = true;
};
for each (tmpCard in cardsOnBoard) {
tmpCard.mouseEnabled = true;
};
}
public function get _map():Array{
return (map);
}
private function stopDraggingCard(card:Card):void{
var tmpCard:Card;
var nearestSlot:FreeSlotMarker;
var tmpObject:Object;
var i:int;
var bFlag:Boolean;
card.removeEventListener(MouseEvent.ROLL_OUT, mouseDownAction);
nearestSlot = this.getNearesSlot(card);
for each (tmpCard in cardsOnMap) {
tmpCard.removeMask();
};
if ((((nearestSlot == null)) || ((((nearestSlot._position.x == card.x)) && ((nearestSlot._position.y == card.y)))))){
card.resetXY();
} else {
if (map[nearestSlot._position.x][nearestSlot._position.y] == "free"){
if (!card._fromDistributor){
map[card._position.x][card._position.y] = "free";
} else {
this._levelContainer.addChild(card);
card.lastParent.gotoAndStop(1);
tmpCard = distributeCard(card._lastXY.x, card._lastXY.y, card.lastParent);
MovieClip(tmpCard.lastParent.parent).gotoAndPlay(2);
card.lastParent = this._levelContainer;
tmpCard.setHappynes(false);
};
setCardOnMap(card, nearestSlot._position, nearestSlot);
bFlag = true;
} else {
card.resetXY();
};
if (((!((map[nearestSlot._position.x][nearestSlot._position.y] == null))) && (!(card._fromDistributor)))){
swapCards(card, map[nearestSlot._position.x][nearestSlot._position.y]);
bFlag = true;
};
};
for each (tmpCard in cardsOnMap) {
tmpCard.removeMask();
};
dragCard.stopDrag();
dragCard = null;
tmpObject = checkHappynes();
this.calculatePoints();
bFlag = checkMatch();
i = 0;
i = 0;
while (i < 5) {
if (tmpObject[i] == true){
Card.playSound(i);
};
i++;
};
}
public function settings(levelContainer:LevelContainer=null, nextCardContainer:MovieClip=null):void{
if (levelContainer == null){
throw (new Error("you mass pass level container object"));
};
if (nextCardContainer == null){
nextCardContainer = this;
};
this._levelContainer = levelContainer;
this._nextCardContainer = nextCardContainer;
}
private function checkMatch():Boolean{
var tab:Array;
var cardA:Card;
var i:Object;
var cardB:Card;
var isOK:Boolean;
for each (tab in map) {
for each (i in tab) {
if (i == "free"){
return (false);
};
};
};
for each (cardA in cardsOnMap) {
for each (cardB in cardsOnMap) {
if (cardA == cardB){
} else {
if (cardA.compare(cardB) == -1){
isOK = false;
};
};
};
};
this.calculatePoints();
if (isOK){
dispatchEvent(new Event(LEVEL_WON));
} else {
dispatchEvent(new Event(LEVEL_LOOSE));
};
return (true);
}
public function initialize(e:Event=null):void{
this.removeEventListener(Event.ADDED_TO_STAGE, initialize);
buildMap();
distributeAllCards();
addResetButton();
}
public function get _maxCardsOnBoard():int{
return (maxCardsOnBoard);
}
private function distributeAllCards():void{
var tmpArray:Array;
var tmpMc:MovieClip;
var tmpCard:Card;
tmpArray = Functions.getChildByType(this._nextCardContainer, "card", false, false, true);
this._nextCardContainer.mouseChildren = true;
var i:int;
while (i < tmpArray.length) {
tmpMc = (MovieClip(tmpArray[i]).getChildAt(0) as MovieClip);
tmpMc.mouseChildren = true;
tmpCard = distributeCard(0, 0, tmpMc);
tmpCard.setHappynes(false);
MovieClip(tmpArray[i]).gotoAndPlay(2);
i++;
};
}
private function compareMapElements(card:Card, mapPositionX:int, mapPositionY:int):Boolean{
if (map[mapPositionX][mapPositionY] == null){
return (true);
};
if (map[mapPositionX][mapPositionY] == "free"){
return (false);
};
if (card.compare((map[mapPositionX][mapPositionY] as Card)) == 1){
return (true);
};
return (false);
}
public function set _maxCardsOnBoard(maxCardsOnBoard:int):void{
this.maxCardsOnBoard = maxCardsOnBoard;
}
private function resetCardsOnBoard(event:MouseEvent):void{
var card:Card;
for each (card in cardsOnBoard) {
card.removeFromBoard();
card.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
};
cardsOnBoard = [];
distributeAllCards();
if (--maxResetNum == 0){
resetButton.removeEventListener(MouseEvent.CLICK, resetCardsOnBoard);
resetButton.alpha = 0.5;
resetButton.mouseEnabled = false;
};
var tmpTF:TextField = (this._nextCardContainer.getChildByName("game_shuffles_left") as TextField);
tmpTF.text = maxResetNum.toString();
}
private function checkHappynes():Object{
var isOK:Boolean;
var bFlag:Boolean;
var card:Card;
var rows:int = (map[0].length - 1);
var cols:int = (map.length - 1);
var resultArray:Object = new Object();
for each (card in cardsOnMap) {
isOK = true;
bFlag = card.getHappynes();
if (((isOK) && ((card._position.x > 0)))){
isOK = compareMapElements(card, (card._position.x - 1), card._position.y);
};
if (((isOK) && ((card._position.x < cols)))){
isOK = compareMapElements(card, (card._position.x + 1), card._position.y);
};
if (((isOK) && ((card._position.y > 0)))){
isOK = compareMapElements(card, card._position.x, (card._position.y - 1));
};
if (((isOK) && ((card._position.y < rows)))){
isOK = compareMapElements(card, card._position.x, (card._position.y + 1));
};
if (((isOK) && (!(bFlag)))){
resultArray[card._typeTOP] = true;
resultArray[card._typeBOTTOM] = true;
};
card.setHappynes(isOK);
};
return (resultArray);
}
private function onMouseUpAction(event:MouseEvent):void{
dragCard.removeEventListener(MouseEvent.ROLL_OUT, onMouseUpAction);
dragCard.removeEventListener(MouseEvent.MOUSE_OUT, onMouseUpAction);
dragCard.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpAction);
if ((((event.type == "rollOut")) || ((event.type == "mouseOut")))){
dragCard.stopDrag();
Card(dragCard).resetXY();
dragCard = null;
return;
};
stopDraggingCard(dragCard);
}
private function calculatePoints():void{
var tmpCard:Card;
Settings.levelPoints = 0;
for each (tmpCard in cardsOnMap) {
if (tmpCard.getHappynes()){
Settings.levelPoints = (Settings.levelPoints + tmpCard.points);
};
};
TopInterface.showChanges();
}
private function getNearesSlot(card:Card):FreeSlotMarker{
var nearestSlot:FreeSlotMarker;
var tmpDistance:Number;
var tmpPoint:Point;
var slot:FreeSlotMarker;
var minDistance:Number = 70;
var cardTmpPosition:Point = new Point((card.x + (93 / 2)), (card.y + (93 / 2)));
for each (slot in slots) {
tmpPoint = new Point((slot.x + (slot.width / 2)), (slot.y + (slot.height / 2)));
tmpPoint = slot.parent.localToGlobal(tmpPoint);
tmpPoint = card.parent.globalToLocal(tmpPoint);
tmpDistance = Point.distance(tmpPoint, cardTmpPosition);
if (tmpDistance < minDistance){
minDistance = tmpDistance;
nearestSlot = slot;
};
};
return (nearestSlot);
}
public function disableGame():void{
var tmpCard:Card;
for each (tmpCard in cardsOnMap) {
tmpCard.mouseEnabled = false;
};
for each (tmpCard in cardsOnBoard) {
tmpCard.mouseEnabled = false;
};
}
private function mouseDownAction(event:MouseEvent):void{
if ((((event.target is Card)) && ((this.dragCard == null)))){
this.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownAction);
startDraggingCard((event.target as Card));
dragCard.addMask();
};
}
public function set _maxResetNum(maxResetNum:int):void{
this.maxResetNum = maxResetNum;
}
}
}//package pl.fabrykagier.zookeeper
Section 30
//PreloaderText (pl.fabrykagier.PreloaderText)
package pl.fabrykagier {
import flash.display.*;
import flash.events.*;
import pl.fabrykagier.pluszakowo.*;
import flash.text.*;
public class PreloaderText extends MovieClip {
private var _mc:MovieClip;
public var progress_txt:TextField;
private var _textField:TextField;
public function PreloaderText(tmpMc:MovieClip=null){
super();
this._mc = tmpMc;
if (this._mc == null){
this._mc = this;
};
if (this._mc.parent != null){
this.startLoad();
};
this._mc.addEventListener(Event.ADDED_TO_STAGE, startLoad);
}
private function progressListener(e:ProgressEvent):void{
var tmpTextfield:TextField;
var tmpArray:Array;
var loaded:Number = (e.bytesLoaded / e.bytesTotal);
var percent:int = Math.ceil((loaded * 100));
var i:int;
if (percent > 99){
return;
};
if (this._textField == null){
tmpArray = Functions.getChildByType(this._mc, "textField", true, false, false);
i = 0;
while (i < tmpArray.length) {
tmpTextfield = (tmpArray[i] as TextField);
if (tmpTextfield.type == TextFieldType.DYNAMIC){
break;
};
tmpTextfield = null;
i++;
};
this._textField = tmpTextfield;
};
if (this._textField != null){
this._textField.text = (percent.toString() + "%");
};
}
private function completeListener(e:Event):void{
MovieClip(this._mc.parent).loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressListener);
MovieClip(this._mc.parent).loaderInfo.removeEventListener(Event.COMPLETE, completeListener);
this._textField.text = "100";
this._textField = undefined;
this.finishLoading();
this._mc = undefined;
}
private function startLoad(e:Event=null):void{
this._mc.removeEventListener(Event.ADDED_TO_STAGE, startLoad);
if (MovieClip(this._mc.parent).loaderInfo.bytesLoaded >= MovieClip(this._mc.parent).loaderInfo.bytesTotal){
this.finishLoading();
} else {
MovieClip(this._mc.parent).loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
MovieClip(this._mc.parent).loaderInfo.addEventListener(Event.COMPLETE, completeListener);
};
}
private function finishLoading():void{
var tmpTextfield:TextField;
var tmpArray:Array;
var i:int;
tmpArray = Functions.getChildByType(this._mc, "textField", true, false, false);
i = 0;
while (i < tmpArray.length) {
tmpTextfield = (tmpArray[i] as TextField);
if (tmpTextfield.type == TextFieldType.DYNAMIC){
break;
};
tmpTextfield = null;
i++;
};
if (tmpTextfield != null){
tmpTextfield.text = "100";
};
MovieClip(this._mc.parent).gotoAndPlay("preloaderOut");
}
}
}//package pl.fabrykagier
Section 31
//interface_hud_cardsPanel_161 (Zookeeper_fla.interface_hud_cardsPanel_161)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_hud_cardsPanel_161 extends MovieClip {
public var next_card_0:MovieClip;
public var next_card_1:MovieClip;
public var next_card_2:MovieClip;
public var next_card_3:MovieClip;
public var next_card_4:MovieClip;
public var game_shuffle_cards:button_game_shuffle;
public var game_shuffles_left:TextField;
public function interface_hud_cardsPanel_161(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package Zookeeper_fla
Section 32
//interface_hud_cardtile_choice_animations_162 (Zookeeper_fla.interface_hud_cardtile_choice_animations_162)
package Zookeeper_fla {
import flash.display.*;
public dynamic class interface_hud_cardtile_choice_animations_162 extends MovieClip {
public var game_inner_show_card:MovieClip;
public function interface_hud_cardtile_choice_animations_162(){
addFrameScript(10, frame11, 19, frame20);
}
function frame20(){
this.gotoAndStop(1);
}
function frame11(){
this.stop();
}
}
}//package Zookeeper_fla
Section 33
//interface_hud_levelindicator_100 (Zookeeper_fla.interface_hud_levelindicator_100)
package Zookeeper_fla {
import flash.display.*;
public dynamic class interface_hud_levelindicator_100 extends MovieClip {
public function interface_hud_levelindicator_100(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package Zookeeper_fla
Section 34
//interface_hud_levelindicator_element_101 (Zookeeper_fla.interface_hud_levelindicator_element_101)
package Zookeeper_fla {
import flash.display.*;
public dynamic class interface_hud_levelindicator_element_101 extends MovieClip {
public function interface_hud_levelindicator_element_101(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package Zookeeper_fla
Section 35
//interface_popup_gameFailed_92 (Zookeeper_fla.interface_popup_gameFailed_92)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_popup_gameFailed_92 extends MovieClip {
public var start:button_startOver;
public var totalPoints:TextField;
public var levelPoints:TextField;
public var quit:button_quit;
public function interface_popup_gameFailed_92(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package Zookeeper_fla
Section 36
//interface_popup_levelFailed_90 (Zookeeper_fla.interface_popup_levelFailed_90)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_popup_levelFailed_90 extends MovieClip {
public var totalPoints:TextField;
public var quit:button_quit;
public var retryCounter:TextField;
public var levelPoints:TextField;
public var next2:button_tryAgain;
public function interface_popup_levelFailed_90(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package Zookeeper_fla
Section 37
//interface_popup_task_34 (Zookeeper_fla.interface_popup_task_34)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_popup_task_34 extends MovieClip {
public var next:button_next;
public var playerName:TextField;
public var skip:button_skip;
public function interface_popup_task_34(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package Zookeeper_fla
Section 38
//interface_popup_welcome_31 (Zookeeper_fla.interface_popup_welcome_31)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_popup_welcome_31 extends MovieClip {
public var okay:button_okay;
public var nameField:TextField;
public function interface_popup_welcome_31(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package Zookeeper_fla
Section 39
//interface_popup_wellDone_86 (Zookeeper_fla.interface_popup_wellDone_86)
package Zookeeper_fla {
import flash.display.*;
import flash.text.*;
public dynamic class interface_popup_wellDone_86 extends MovieClip {
public var next3:button_okay;
public var levelPoints:TextField;
public var quit:button_quit;
public var next:button_nextLevel;
public var totalPoints:TextField;
public function interface_popup_wellDone_86(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
this.stop();
}
function frame2(){
}
}
}//package Zookeeper_fla
Section 40
//MainContainer_16 (Zookeeper_fla.MainContainer_16)
package Zookeeper_fla {
import flash.display.*;
public dynamic class MainContainer_16 extends MovieClip {
public function MainContainer_16(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package Zookeeper_fla
Section 41
//button_game_shuffle (button_game_shuffle)
package {
import pl.fabrykagier.framework.ui.graphical.*;
public dynamic class button_game_shuffle extends InterfaceButton {
public function button_game_shuffle(){
addFrameScript(0, frame1, 8, frame9);
}
function frame9(){
this.gotoAndPlay(2);
}
function frame1(){
stop();
}
}
}//package
Section 42
//Button_Hud_BackToTown (Button_Hud_BackToTown)
package {
import pl.fabrykagier.zookeeper.*;
import pl.fabrykagier.framework.ui.graphical.*;
import flash.net.*;
public dynamic class Button_Hud_BackToTown extends InterfaceButton {
public function Button_Hud_BackToTown(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
gotoAndPlay("off");
}
function frame4(){
stop();
if (!Settings.standAlone){
navigateToURL(new URLRequest("javascript:showImagineTown()"));
} else {
navigateToURL(new URLRequest("http://imagine.ubi.com/zookeeper?utm_source=partnersites&utm_medium=flashgame&utm_campaign=zookeeper"));
};
}
}
}//package
Section 43
//Button_Hud_BuyNow (Button_Hud_BuyNow)
package {
import pl.fabrykagier.framework.ui.graphical.*;
import flash.net.*;
public dynamic class Button_Hud_BuyNow extends InterfaceButton {
public function Button_Hud_BuyNow(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
this.stop();
}
function frame4(){
stop();
navigateToURL(new URLRequest("http://imagine.ubi.com/zookeeperbuynow?utm_source=partnersites&utm_medium=flashgame_buynow&utm_campaign=zookeeper"));
}
}
}//package
Section 44
//Button_Hud_PlayNow (Button_Hud_PlayNow)
package {
import flash.display.*;
import pl.fabrykagier.zookeeper.gameInterface.*;
public dynamic class Button_Hud_PlayNow extends ContinuePlayButton {
public function Button_Hud_PlayNow(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
gotoAndPlay("off");
}
function frame4(){
stop();
MovieClip(this.parent).play();
}
}
}//package
Section 45
//Button_Hud_Quit (Button_Hud_Quit)
package {
import pl.fabrykagier.zookeeper.*;
import pl.fabrykagier.framework.ui.graphical.*;
import flash.net.*;
public dynamic class Button_Hud_Quit extends InterfaceButton {
public function Button_Hud_Quit(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
if (Settings.standAlone){
this.visible = false;
this.mouseEnabled = false;
};
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
this.stop();
}
function frame4(){
stop();
navigateToURL(new URLRequest("javascript:showImagineTown()"));
}
}
}//package
Section 46
//button_hud_quitGame (button_hud_quitGame)
package {
import pl.fabrykagier.framework.ui.graphical.*;
public dynamic class button_hud_quitGame extends InterfaceButton {
public function button_hud_quitGame(){
addFrameScript(0, frame1, 6, frame7, 13, frame14, 14, frame15);
}
function frame14(){
this.gotoAndStop(1);
}
function frame15(){
this.stop();
}
function frame7(){
stop();
}
function frame1(){
this.stop();
}
}
}//package
Section 47
//button_hud_quitGame_2 (button_hud_quitGame_2)
package {
import pl.fabrykagier.framework.ui.graphical.*;
public dynamic class button_hud_quitGame_2 extends InterfaceButton {
}
}//package
Section 48
//Button_Hud_Send_To_A_Friend (Button_Hud_Send_To_A_Friend)
package {
import pl.fabrykagier.framework.ui.graphical.*;
public dynamic class Button_Hud_Send_To_A_Friend extends InterfaceButton {
public function Button_Hud_Send_To_A_Friend(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
this.stop();
}
function frame4(){
}
}
}//package
Section 49
//button_next (button_next)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_next extends PopupButton {
public function button_next(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 50
//button_nextLevel (button_nextLevel)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_nextLevel extends PopupButton {
public function button_nextLevel(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 51
//button_okay (button_okay)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_okay extends PopupButton {
public function button_okay(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 52
//button_quit (button_quit)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_quit extends PopupButton {
public function button_quit(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 53
//button_skip (button_skip)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_skip extends PopupButton {
public function button_skip(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 54
//button_startOver (button_startOver)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_startOver extends PopupButton {
public function button_startOver(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 55
//button_tryAgain (button_tryAgain)
package {
import pl.fabrykagier.gardens.popups.*;
public dynamic class button_tryAgain extends PopupButton {
public function button_tryAgain(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 56
//Card_Bear_BottomLeft (Card_Bear_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Bear_BottomLeft extends MovieClip {
}
}//package
Section 57
//Card_Bear_Full (Card_Bear_Full)
package {
import flash.display.*;
public dynamic class Card_Bear_Full extends MovieClip {
}
}//package
Section 58
//Card_Bear_TopRight (Card_Bear_TopRight)
package {
import flash.display.*;
public dynamic class Card_Bear_TopRight extends MovieClip {
}
}//package
Section 59
//Card_Dolphin_BottomLeft (Card_Dolphin_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Dolphin_BottomLeft extends MovieClip {
}
}//package
Section 60
//Card_Dolphin_Full (Card_Dolphin_Full)
package {
import flash.display.*;
public dynamic class Card_Dolphin_Full extends MovieClip {
}
}//package
Section 61
//Card_Dolphin_TopRight (Card_Dolphin_TopRight)
package {
import flash.display.*;
public dynamic class Card_Dolphin_TopRight extends MovieClip {
}
}//package
Section 62
//Card_Donkey_BottomLeft (Card_Donkey_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Donkey_BottomLeft extends MovieClip {
}
}//package
Section 63
//Card_Donkey_Full (Card_Donkey_Full)
package {
import flash.display.*;
public dynamic class Card_Donkey_Full extends MovieClip {
}
}//package
Section 64
//Card_Donkey_TopRight (Card_Donkey_TopRight)
package {
import flash.display.*;
public dynamic class Card_Donkey_TopRight extends MovieClip {
}
}//package
Section 65
//Card_Elephant_BottomLeft (Card_Elephant_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Elephant_BottomLeft extends MovieClip {
}
}//package
Section 66
//Card_Elephant_Full (Card_Elephant_Full)
package {
import flash.display.*;
public dynamic class Card_Elephant_Full extends MovieClip {
}
}//package
Section 67
//Card_Elephant_TopRight (Card_Elephant_TopRight)
package {
import flash.display.*;
public dynamic class Card_Elephant_TopRight extends MovieClip {
}
}//package
Section 68
//Card_Lion_BottomLeft (Card_Lion_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Lion_BottomLeft extends MovieClip {
}
}//package
Section 69
//Card_Lion_Full (Card_Lion_Full)
package {
import flash.display.*;
public dynamic class Card_Lion_Full extends MovieClip {
}
}//package
Section 70
//Card_Lion_TopRight (Card_Lion_TopRight)
package {
import flash.display.*;
public dynamic class Card_Lion_TopRight extends MovieClip {
}
}//package
Section 71
//Card_Monkey_BottomLeft (Card_Monkey_BottomLeft)
package {
import flash.display.*;
public dynamic class Card_Monkey_BottomLeft extends MovieClip {
}
}//package
Section 72
//Card_Monkey_Full (Card_Monkey_Full)
package {
import flash.display.*;
public dynamic class Card_Monkey_Full extends MovieClip {
}
}//package
Section 73
//Card_Monkey_TopRight (Card_Monkey_TopRight)
package {
import flash.display.*;
public dynamic class Card_Monkey_TopRight extends MovieClip {
}
}//package
Section 74
//Card_superCard (Card_superCard)
package {
import flash.display.*;
public dynamic class Card_superCard extends MovieClip {
}
}//package
Section 75
//interface_popup_button_visitweb (interface_popup_button_visitweb)
package {
import pl.fabrykagier.framework.ui.graphical.*;
import flash.net.*;
public dynamic class interface_popup_button_visitweb extends InterfaceButton {
public function interface_popup_button_visitweb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
this.stop();
navigateToURL(new URLRequest("http://imagine.ubi.com/zookeeper?utm_source=partnersites&utm_medium=flashgame&utm_campaign=zookeeper"));
}
}
}//package
Section 76
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(parent:Sprite, tag:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var self:MochiBot = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var server:String = "http://core.mochibot.com/my/core.swf";
var lv:URLVariables = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
var url:String = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
var req:URLRequest = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
var loader:Loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 77
//snd_bear_0 (snd_bear_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_bear_0 extends SoundObject {
}
}//package
Section 78
//snd_bear_1 (snd_bear_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_bear_1 extends SoundObject {
}
}//package
Section 79
//snd_buttonClick (snd_buttonClick)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_buttonClick extends SoundObject {
}
}//package
Section 80
//snd_buttonOn (snd_buttonOn)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_buttonOn extends SoundObject {
}
}//package
Section 81
//snd_dolphin_0 (snd_dolphin_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_dolphin_0 extends SoundObject {
}
}//package
Section 82
//snd_dolphin_1 (snd_dolphin_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_dolphin_1 extends SoundObject {
}
}//package
Section 83
//snd_donkey_0 (snd_donkey_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_donkey_0 extends SoundObject {
}
}//package
Section 84
//snd_donkey_1 (snd_donkey_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_donkey_1 extends SoundObject {
}
}//package
Section 85
//snd_elephant_0 (snd_elephant_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_elephant_0 extends SoundObject {
}
}//package
Section 86
//snd_elephant_1 (snd_elephant_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_elephant_1 extends SoundObject {
}
}//package
Section 87
//snd_gameMusic (snd_gameMusic)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_gameMusic extends SoundObject {
}
}//package
Section 88
//snd_lion_0 (snd_lion_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_lion_0 extends SoundObject {
}
}//package
Section 89
//snd_lion_1 (snd_lion_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_lion_1 extends SoundObject {
}
}//package
Section 90
//snd_menuMusic (snd_menuMusic)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_menuMusic extends SoundObject {
}
}//package
Section 91
//snd_monkey_0 (snd_monkey_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_monkey_0 extends SoundObject {
}
}//package
Section 92
//snd_monkey_1 (snd_monkey_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_monkey_1 extends SoundObject {
}
}//package
Section 93
//snd_monkey_2 (snd_monkey_2)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_monkey_2 extends SoundObject {
}
}//package
Section 94
//snd_win_0 (snd_win_0)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_win_0 extends SoundObject {
}
}//package
Section 95
//snd_win_1 (snd_win_1)
package {
import pl.fabrykagier.framework.media.*;
public dynamic class snd_win_1 extends SoundObject {
}
}//package