Section 1
//BBR_88 (kotaAdventure_fla.BBR_88)
package kotaAdventure_fla {
import flash.display.*;
public dynamic class BBR_88 extends MovieClip {
public var demo:MovieClip;
}
}//package kotaAdventure_fla
Section 2
//instruct_BallCurveTrail_89 (kotaAdventure_fla.instruct_BallCurveTrail_89)
package kotaAdventure_fla {
import flash.display.*;
import flash.events.*;
public dynamic class instruct_BallCurveTrail_89 extends MovieClip {
public function instruct_BallCurveTrail_89(){
addFrameScript(111, frame112);
}
function frame112(){
dispatchEvent(new Event(Event.COMPLETE));
stop();
}
}
}//package kotaAdventure_fla
Section 3
//Background (mousetodrive.obstacle.Background)
package mousetodrive.obstacle {
import flash.display.*;
public class Background extends MovieClip implements IBackground {
}
}//package mousetodrive.obstacle
Section 4
//BackgroundBitmap (mousetodrive.obstacle.BackgroundBitmap)
package mousetodrive.obstacle {
import flash.display.*;
public class BackgroundBitmap extends Bitmap implements IBackground {
public function BackgroundBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package mousetodrive.obstacle
Section 5
//BitmapObstacle (mousetodrive.obstacle.BitmapObstacle)
package mousetodrive.obstacle {
import mousetodrive.*;
import flash.display.*;
public class BitmapObstacle extends Bitmap implements IObstacle {
public function BitmapObstacle(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get impedesMovement():Boolean{
return (true);
}
public function collide(_arg1:Player):void{
}
public function reset():void{
}
public function get acceptsDirectCollision():Boolean{
return (false);
}
}
}//package mousetodrive.obstacle
Section 6
//HitAnimationObject (mousetodrive.obstacle.HitAnimationObject)
package mousetodrive.obstacle {
import mousetodrive.*;
public class HitAnimationObject extends Obstacle {
protected var _alreadyHit:Boolean;// = false
public function HitAnimationObject(){
_alreadyHit = false;
super();
stop();
}
override public function collide(_arg1:Player):void{
if (!_alreadyHit){
gotoAndPlay("hit");
};
_alreadyHit = true;
}
override public function reset():void{
_alreadyHit = false;
gotoAndStop(1);
}
}
}//package mousetodrive.obstacle
Section 7
//IBackground (mousetodrive.obstacle.IBackground)
package mousetodrive.obstacle {
public interface IBackground {
}
}//package mousetodrive.obstacle
Section 8
//IObstacle (mousetodrive.obstacle.IObstacle)
package mousetodrive.obstacle {
import mousetodrive.*;
import flash.geom.*;
import flash.display.*;
public interface IObstacle {
function collide(_arg1:Player):void;
function reset():void;
function get impedesMovement():Boolean;
function getBounds(_arg1:DisplayObject):Rectangle;
function get acceptsDirectCollision():Boolean;
}
}//package mousetodrive.obstacle
Section 9
//Item (mousetodrive.obstacle.Item)
package mousetodrive.obstacle {
import mousetodrive.*;
import flash.events.*;
public class Item extends Obstacle {
protected var _collected:Boolean;// = false
public static const COLLECTED:String = "collected";
public function Item(){
_collected = false;
super();
_impedesMovement = false;
}
override public function collide(_arg1:Player):void{
if (_collected){
return;
};
_collected = true;
dispatchEvent(new Event(COLLECTED, true));
}
override public function reset():void{
_collected = false;
}
}
}//package mousetodrive.obstacle
Section 10
//Obstacle (mousetodrive.obstacle.Obstacle)
package mousetodrive.obstacle {
import mousetodrive.*;
import flash.display.*;
import flash.events.*;
public class Obstacle extends MovieClip implements IObstacle {
protected var _acceptsDirectCollision:Boolean;// = false
protected var _impedesMovement:Boolean;// = true
public static const COLLIDE:String = "collide";
public function Obstacle(){
_impedesMovement = true;
_acceptsDirectCollision = false;
super();
}
public function collide(_arg1:Player):void{
dispatchEvent(new Event(COLLIDE));
}
public function get acceptsDirectCollision():Boolean{
return (_acceptsDirectCollision);
}
public function reset():void{
}
public function get impedesMovement():Boolean{
return (_impedesMovement);
}
}
}//package mousetodrive.obstacle
Section 11
//RenderableObstacle (mousetodrive.obstacle.RenderableObstacle)
package mousetodrive.obstacle {
import flash.display.*;
public class RenderableObstacle extends MovieClip {
}
}//package mousetodrive.obstacle
Section 12
//UnrenderableNonObstacle (mousetodrive.obstacle.UnrenderableNonObstacle)
package mousetodrive.obstacle {
public class UnrenderableNonObstacle extends Background {
}
}//package mousetodrive.obstacle
Section 13
//Map (mousetodrive.Map)
package mousetodrive {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import mousetodrive.obstacle.*;
import flash.utils.*;
import flash.system.*;
public class Map extends MovieClip {
protected var _player:Player;
private var _scroll:Rectangle;
private var _generationProgress:int;// = 0
private var _clips:Array;
protected var _viewArea:Rectangle;
private var _generatingObstacles:Boolean;// = true
protected var _maxClipSize:Number;// = 150
private var _depths:Dictionary;
private var _obstacles:Array;
protected var _playerYOffset:Number;// = 68
protected var _pushYDistance:Number;// = 30
private var _sortedClips:Array;
protected var _pushXDistance:Number;// = 100
private var _yValues:Dictionary;
private var _bounds:Dictionary;
protected var _unrenderableClasses:Array;
public static const READY:String = "ready";
public function Map(){
_viewArea = new Rectangle(0, 0, 720, 490);
_pushXDistance = 100;
_pushYDistance = 30;
_maxClipSize = 150;
_playerYOffset = 68;
_obstacles = new Array();
_bounds = new Dictionary(true);
_depths = new Dictionary(true);
_yValues = new Dictionary(true);
_clips = new Array();
_sortedClips = new Array();
_generatingObstacles = true;
_generationProgress = 0;
_unrenderableClasses = [UnrenderableNonObstacle, Obstacle, Bitmap];
super();
centerOnPlayer();
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
}
private function enterFrameHandler(_arg1:Event):void{
var _local2:Rectangle;
var _local3:Point;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:Point;
var _local8:Rectangle;
var _local9:DisplayObject;
var _local10:Number;
var _local11:Number;
var _local12:IObstacle;
var _local13:MovieClip;
var _local14:DisplayObject;
if (_generatingObstacles){
if (generateObstacles()){
return;
};
};
if (_player.allowPlayerControl){
_player.moveTo(new Point(mouseX, mouseY));
_local8 = _player.getBounds(this);
_player.inWater = false;
for each (_local9 in _obstacles) {
if (((!(_local9.parent)) || (!(_local9.visible)))){
} else {
if (!_local8.intersects(_bounds[_local9])){
} else {
if ((_local9 is BitmapObstacle)){
for each (_local6 in _player.perimeterPoints_arr) {
_local7 = _player.localToGlobal(_local6);
_local10 = ((_local7.x - _local9.x) - x);
_local11 = ((_local7.y - _local9.y) - y);
if ((((((((_local10 >= 0)) && ((_local10 < _maxClipSize)))) && ((_local11 >= 0)))) && ((_local11 <= _maxClipSize)))){
if (((Bitmap(_local9).bitmapData.getPixel32(_local10, _local11) >> 24) & 0xFF)){
_player.collide(IObstacle(_local9));
_player.revertPosition();
break;
};
};
};
} else {
if ((_local9 is Bitmap)){
} else {
if ((_local9 is IObstacle)){
_local12 = IObstacle(_local9);
_local13 = MovieClip(_local9);
_local14 = ((_local13.getChildByName("hitArea_mc")) || (_local13));
if (_local12.acceptsDirectCollision){
for each (_local6 in _player.extremePoints_arr) {
_local7 = _player.localToGlobal(_local6);
if (_local14.hitTestPoint(_local7.x, _local7.y, true)){
if (angleDiff(_player.currentDirection, ((Math.PI / 2) + Math.atan2(_local6.y, _local6.x))) < (Math.PI / 4)){
_player.collide(_local12, true);
};
break;
};
};
};
for each (_local6 in _player.perimeterPoints_arr) {
_local7 = _player.localToGlobal(_local6);
if (_local14.hitTestPoint(_local7.x, _local7.y, true)){
if (ApplicationDomain.currentDomain.hasDefinition("Pond")){
if ((_local12 is Class(getDefinitionByName("Pond")))){
_player.inWater = true;
};
};
_local12.collide(_player);
_player.collide(_local12);
if (_local12.impedesMovement){
_player.revertPosition();
break;
};
};
};
};
};
};
};
};
};
};
_local2 = _scroll.clone();
_local3 = globalToLocal(_player.localToGlobal(new Point(0, 0)));
_local4 = ((_scroll.left + (_scroll.width / 2)) - _local3.x);
_local5 = ((_scroll.top + (_scroll.height / 2)) - _local3.y);
if (_local4 > _pushXDistance){
_local2.x = (_local2.x - (_local4 - _pushXDistance));
} else {
if (_local4 < -(_pushXDistance)){
_local2.x = (_local2.x - (_pushXDistance + _local4));
};
};
if (_local5 > _pushYDistance){
_local2.y = (_local2.y - (_local5 - _pushYDistance));
} else {
if (_local5 < -(_pushYDistance)){
_local2.y = (_local2.y - (_pushYDistance + _local5));
};
};
scroll = _local2;
}
private function centerOnPlayer():void{
scroll = new Rectangle(((-(_viewArea.width) / 2) + _player.x), ((-(_viewArea.height) / 2) + _player.y), _viewArea.width, _viewArea.height);
}
public function addObstacle(_arg1:IObstacle):void{
_obstacles.push(_arg1);
_sortedClips.push(_arg1);
_clips.push(_arg1);
addChild(DisplayObject(_arg1));
_bounds[_arg1] = _arg1.getBounds(this);
}
public function reset():void{
var _local1:IObstacle;
for each (_local1 in _obstacles) {
_local1.reset();
};
}
public function refreshSortDepths():void{
var c:uint;
var child:DisplayObject;
_sortedClips.sort(function (_arg1:DisplayObject, _arg2:DisplayObject):Number{
var _local3:Boolean;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
_local3 = (_arg1 is BackgroundBitmap);
if (_local3 != (_arg2 is BackgroundBitmap)){
return ((_local3) ? -1 : 1);
};
_local4 = (_arg1 is IBackground);
if (_local4 != (_arg2 is IBackground)){
return ((_local4) ? -1 : 1);
};
_local5 = ((_yValues[_arg1] == undefined)) ? _arg1.y : _yValues[_arg1];
_local6 = ((_yValues[_arg2] == undefined)) ? _arg2.y : _yValues[_arg2];
return (((_local5 == _local6)) ? ((_arg1.x < _arg2.x)) ? -1 : 1 : ((_local5 < _local6)) ? -1 : 1);
});
c = 0;
for each (child in _sortedClips) {
if (c > numChildren){
} else {
addChildAt(child, c);
_depths[child] = c;
c = (c + 1);
};
};
}
protected function set scroll(_arg1:Rectangle):void{
var _local2:Boolean;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:uint;
var _local8:Number;
var _local9:uint;
var _local10:*;
var _local11:DisplayObject;
var _local12:Rectangle;
var _local13:Boolean;
var _local14:DisplayObject;
var _local15:uint;
var _local16:Number;
_local2 = !(((((_scroll) && ((_arg1.x == _scroll.x)))) && ((_arg1.y == _scroll.y))));
_local3 = _arg1.left;
_local4 = _arg1.right;
_local5 = _arg1.bottom;
_local6 = _arg1.top;
_local7 = 0;
_local8 = (_player.y + _playerYOffset);
_scroll = _arg1;
x = -(_arg1.left);
y = -(_arg1.top);
if (_local2){
for each (_local11 in _sortedClips) {
_local12 = _bounds[_local11];
_local13 = (((((((_local12.left < _local4)) && ((_local12.right > _local3)))) && ((_local12.top < _local5)))) && ((_local12.bottom > _local6)));
if (_local11.parent != null){
if (!_local13){
removeChild(_local11);
} else {
_local9 = getChildIndex(_local11);
};
} else {
if (_local13){
_local14 = null;
_local15 = _depths[_local11];
while (_local15 > 0) {
if (_sortedClips[_local15] == undefined){
_local15--;
} else {
_local14 = _sortedClips[_local15];
if (_local14.parent){
break;
};
_local14 = null;
_local15--;
};
};
_local9 = (_local14) ? (getChildIndex(_local14) + 1) : (_local15) ? numChildren : 0;
addChildAt(_local11, _local9);
};
};
};
};
for each (_local11 in _sortedClips) {
if (_local11.parent){
_local9 = getChildIndex(_local11);
_local16 = ((_yValues[_local11] == undefined)) ? _local11.y : _yValues[_local11];
if (_local16 < _local8){
_local7 = (_local9 + 1);
_local10 = _local11;
};
};
};
if (_local7 != getChildIndex(_player)){
addChildAt(_player, Math.min(numChildren, _local7));
};
}
public function removeObstacle(_arg1:IObstacle):void{
if (DisplayObject(_arg1).parent == this){
removeChild(DisplayObject(_arg1));
};
while (_obstacles.indexOf(_arg1) != -1) {
_obstacles.splice(_obstacles.indexOf(_arg1), 1);
};
while (_sortedClips.indexOf(_arg1) != -1) {
_sortedClips.splice(_sortedClips.indexOf(_arg1), 1);
};
while (_clips.indexOf(_arg1) != -1) {
_clips.splice(_clips.indexOf(_arg1), 1);
};
delete _bounds[_arg1];
delete _depths[_arg1];
}
private function angleDiff(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = Math.abs((_arg2 - _arg1));
_local3 = (_local3 % (2 * Math.PI));
_local4 = ((2 * Math.PI) - _local3);
return (Math.min(_local3, _local4));
}
protected function removedFromStageHandler(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function addedToStageHandler(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
}
protected function generateObstacles():Boolean{
var _local1:uint;
var _local2:Number;
var _local3:DisplayObject;
var _local4:Rectangle;
var _local5:Boolean;
var _local6:Class;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local12:BitmapData;
var _local13:Bitmap;
var _local14:Matrix;
_local1 = _generationProgress;
_local2 = getTimer();
while (_local1 < numChildren) {
if ((getTimer() - _local2) > 500){
_generationProgress = _local1;
return (true);
};
_local3 = getChildAt(_local1);
if (!(_local3 is Player)){
_local4 = _local3.getBounds(this);
_local5 = true;
for each (_local6 in _unrenderableClasses) {
if ((_local3 is _local6)){
_local5 = false;
break;
};
};
if (((_local5) && ((((_local4.width > _maxClipSize)) && ((_local4.height > _maxClipSize)))))){
_local7 = 0;
_local8 = 0;
_local9 = (_local3.x - _local4.left);
_local10 = (_local3.y - _local4.top);
_local11 = 0;
while (_local7 < _local4.width) {
_local8 = 0;
while (_local8 < _local4.height) {
_local12 = new BitmapData(_maxClipSize, _maxClipSize, true, 0xFFFFFF);
_local13 = ((_local3 is RenderableObstacle)) ? new BitmapObstacle(_local12) : ((_local3 is Background)) ? new BackgroundBitmap(_local12) : new Bitmap(_local12);
_local14 = _local3.transform.matrix.clone();
_local14.translate(((_local9 - _local7) - _local14.tx), ((_local10 - _local8) - _local14.ty));
_local12.draw(_local3, _local14, _local3.transform.colorTransform, null, new Rectangle(0, 0, _maxClipSize, _maxClipSize));
++_local11;
addChildAt(_local13, (_local11 + _local1));
_local13.y = (_local4.top + _local8);
_local13.x = (_local4.left + _local7);
_local13.name = ((((_local3.name + " clip ") + _local7) + ",") + _local8);
_local8 = (_local8 + _maxClipSize);
_yValues[_local13] = _local3.y;
};
_local7 = (_local7 + _maxClipSize);
};
removeChild(_local3);
} else {
_clips[_local1] = _local3;
_bounds[_local3] = _local4;
_sortedClips.push(_local3);
if ((_local3 is IObstacle)){
_obstacles.push(_local3);
};
};
};
_local1++;
};
refreshSortDepths();
dispatchEvent(new Event(READY));
_generatingObstacles = false;
return (false);
}
public function get player():Player{
return (_player);
}
}
}//package mousetodrive
Section 14
//Player (mousetodrive.Player)
package mousetodrive {
import flash.geom.*;
import flash.display.*;
import mousetodrive.obstacle.*;
public class Player extends MovieClip {
protected var _oldRotation:Number;
public var perimeterPoints_arr:Array;
protected var _allowPlayerControl:Boolean;// = true
protected var _speed:Number;// = 0
protected var _speedLimit:Number;// = 30
protected var _directionFrameOffset:uint;// = 0
protected var _rotationRads:Number;// = 0
protected var _inWater:Boolean;// = false
protected var _directionFrames:uint;// = 12
public var extremePoints_arr:Array;
protected var _oldY:Number;
protected var _oldX:Number;
public function Player(){
extremePoints_arr = [];
_speed = 0;
_rotationRads = 0;
_speedLimit = 30;
_allowPlayerControl = true;
_directionFrames = 12;
_directionFrameOffset = 0;
_inWater = false;
super();
_oldX = x;
_oldY = y;
_oldRotation = _rotationRads;
}
public function get currentDirection():Number{
return (_rotationRads);
}
public function moveTo(_arg1:Point):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
_local2 = _arg1.clone();
_oldX = x;
_oldY = y;
_oldRotation = _rotationRads;
_local3 = 20;
_local4 = Point.distance(new Point(x, y), _local2);
_speed = ((_local4 / 300) * _speedLimit);
if (_local4 < _local3){
_speed = 0;
} else {
if (_speed > _speedLimit){
_speed = _speedLimit;
};
};
_local5 = pointToDirection(_local2);
rotationRads = _local5;
_local6 = Point.polar(_speed, ((Math.PI / 2) - rotationRads));
x = (x + _local6.x);
y = (y - _local6.y);
}
public function revertPosition():void{
x = _oldX;
y = _oldY;
rotationRads = _oldRotation;
}
public function set rotationRads(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
while (_arg1 >= (Math.PI * 2)) {
_arg1 = (_arg1 - (Math.PI * 2));
};
while (_arg1 < 0) {
_arg1 = (_arg1 + (Math.PI * 2));
};
_rotationRads = _arg1;
_local2 = (_arg1 / (Math.PI * 2));
_local3 = (Math.round((_local2 * _directionFrames)) + 1);
if (_local3 > _directionFrames){
_local3 = 1;
};
gotoAndStop((_local3 + _directionFrameOffset));
_local4 = (_local2 - (Math.round((_local2 * _directionFrames)) / _directionFrames));
super.rotation = (_local4 * 360);
}
public function collide(_arg1:IObstacle, _arg2:Boolean=false):void{
}
public function set inWater(_arg1:Boolean):void{
_inWater = _arg1;
}
public function get allowPlayerControl():Boolean{
return (_allowPlayerControl);
}
private function pointToDirection(_arg1:Point):Number{
return (((Math.PI / 2) - Math.atan2(-((_arg1.y - y)), (_arg1.x - x))));
}
public function get rotationRads():Number{
return (_rotationRads);
}
public function set allowPlayerControl(_arg1:Boolean):void{
_allowPlayerControl = _arg1;
}
}
}//package mousetodrive
Section 15
//GrassObstacle (obstacle.GrassObstacle)
package obstacle {
import mousetodrive.*;
import flash.display.*;
import mousetodrive.obstacle.*;
import utils.sound.*;
public class GrassObstacle extends HitAnimationObject {
public var hitArea_mc:Sprite;
public function GrassObstacle(){
_impedesMovement = false;
}
override public function collide(_arg1:Player):void{
if (!_alreadyHit){
playSound("KotaGrassLoop");
};
super.collide(_arg1);
}
}
}//package obstacle
Section 16
//LeafItem (obstacle.LeafItem)
package obstacle {
import mousetodrive.*;
import flash.display.*;
import mousetodrive.obstacle.*;
public class LeafItem extends Item {
public var hitArea_mc:Sprite;
override public function collide(_arg1:Player):void{
if (!_collected){
gotoAndPlay(COLLECTED);
addFrameScript((totalFrames - 1), collectedComplete);
};
super.collide(_arg1);
}
private function collectedComplete():void{
stop();
}
}
}//package obstacle
Section 17
//RockObstacle (obstacle.RockObstacle)
package obstacle {
import mousetodrive.*;
import flash.display.*;
import mousetodrive.obstacle.*;
import utils.sound.*;
public class RockObstacle extends HitAnimationObject {
public var hitArea_mc:Sprite;
public function RockObstacle(){
_impedesMovement = false;
}
override public function collide(_arg1:Player):void{
if (!_alreadyHit){
playSound("KotaRockBreak");
};
super.collide(_arg1);
}
}
}//package obstacle
Section 18
//TreeObstacle (obstacle.TreeObstacle)
package obstacle {
import mousetodrive.*;
import flash.display.*;
import mousetodrive.obstacle.*;
import utils.sound.*;
public class TreeObstacle extends HitAnimationObject {
public var hitArea_mc:Sprite;
override public function collide(_arg1:Player):void{
if (!_alreadyHit){
playSound("KotaHitTree");
};
super.collide(_arg1);
}
}
}//package obstacle
Section 19
//playSound (utils.sound.playSound)
package utils.sound {
import flash.media.*;
import flash.utils.*;
public function playSound(_arg1:String, _arg2:Number=0, _arg3:int=0, _arg4:SoundTransform=null):SoundChannel{
var className = _arg1;
var startTime = _arg2;
var loops = _arg3;
var sndTransform = _arg4;
try {
return (new (getDefinitionByName(className)).play(startTime, loops, sndTransform));
} catch(error:Error) {
trace("-----------PLAY SOUND ERROR--------\n", error);
};
return (new SoundChannel());
}
}//package utils.sound
Section 20
//trackEvent (utils.tracking.trackEvent)
package utils.tracking {
import flash.external.*;
public class trackEvent {
public static var debugMode:Boolean = false;
public function as3event(_arg1:String, _arg2:Object){
var returnVal:*;
var property:String;
var event = _arg1;
var track = _arg2;
if (ExternalInterface.available){
try {
returnVal = ExternalInterface.call("trackEvent.event", event, track);
if (debugMode){
trace(("trackEvent.as3event: trackEvent.event call return value = " + returnVal));
};
if (debugMode){
trace("trackEvent.as3event: \ntrack { ");
for (property in track) {
trace(((("\t" + property) + ": ") + track[property]));
};
trace("}");
ExternalInterface.call("testTrackAlert", track);
};
} catch(error:Error) {
if (debugMode){
trace(("trackEvent.as3event: trackEvent.event call failed. Error = " + error.getStackTrace()));
};
};
};
}
}
}//package utils.tracking
Section 21
//AbstractIntegratedActivity (AbstractIntegratedActivity)
package {
import flash.display.*;
import flash.events.*;
public class AbstractIntegratedActivity extends MovieClip {
public var ready_fn:Function;
private var _standaloneFramesWaited:uint;// = 0
public var standalone:Boolean;// = false
protected var _standaloneWaitFrames:uint;// = 24
private var _availability:Boolean;// = false
public var playmatePlay_fn:Function;
protected var _gameType:String;
protected var _loaderParameters:Object;
protected var onAnimationComplete_fn:Function;
public function AbstractIntegratedActivity(_arg1="default"){
standalone = false;
_availability = false;
_standaloneFramesWaited = 0;
_standaloneWaitFrames = 24;
super();
_gameType = _arg1;
announceAvailability();
checkLoadStatus();
}
protected function playmatePlay(_arg1:String, _arg2:Function=null):void{
var instruction = _arg1;
var animationCompleteCallBack = _arg2;
if (animationCompleteCallBack != null){
onAnimationComplete_fn = animationCompleteCallBack;
};
try {
playmatePlay_fn(instruction);
} catch(error:Error) {
handleAnimationComplete();
};
}
public function handleIrisOpeningEnd():void{
}
public function handleIrisOpeningBegin():void{
}
private function runStandalone():void{
announceAvailability();
loaderParameters = loaderInfo.parameters;
standalone = true;
handleIrisOpeningBegin();
handleIrisOpeningEnd();
}
public function get gameType():String{
return (_gameType);
}
public function get availability():Boolean{
return (_availability);
}
protected function onLoaderParameters():void{
}
private function announceAvailability():void{
_availability = true;
dispatchEvent(new Event(Event.COMPLETE));
}
public function handleAnimationComplete():void{
try {
onAnimationComplete_fn();
onAnimationComplete_fn = null;
} catch(error:Error) {
};
}
private function checkLoadStatus():void{
if ((((loaderInfo.bytesLoaded == loaderInfo.bytesTotal)) && ((loaderInfo.bytesLoaded > 10)))){
onLoadComplete();
} else {
loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete, false, int.MAX_VALUE);
};
}
protected function onLoadComplete(_arg1:Event=null):void{
var event = _arg1;
announceAvailability();
loaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
try {
ready_fn();
} catch(error:Error) {
addEventListener(Event.ENTER_FRAME, standaloneCheck);
};
}
public function set loaderParameters(_arg1:Object):void{
_loaderParameters = _arg1;
onLoaderParameters();
}
private function standaloneCheck(_arg1:Event):void{
var event = _arg1;
_standaloneFramesWaited++;
try {
ready_fn();
removeEventListener(Event.ENTER_FRAME, standaloneCheck);
return;
} catch(error:Error) {
if (_standaloneFramesWaited > _standaloneWaitFrames){
removeEventListener(Event.ENTER_FRAME, standaloneCheck);
runStandalone();
};
};
}
}
}//package
Section 22
//AnimatedRiver (AnimatedRiver)
package {
import flash.display.*;
public dynamic class AnimatedRiver extends MovieClip {
}
}//package
Section 23
//DiagnosticUtilities (DiagnosticUtilities)
package {
import flash.text.*;
import flash.net.*;
public class DiagnosticUtilities {
public static var outputTextField:TextField;
public static var saveDecksThenRefreshFromServer:Function;
public static var navigateToRegister:Function;
public static var refreshDecksAndUpdateServer:Function;
public static var requestOutcomesSearch:Function;
private static var urlEncodingMap:Array = [{raw:"%", encoded:["%25"]}, {raw:"!", encoded:["%21"]}, {raw:"*", encoded:["%2A", "%2a"]}, {raw:"'", encoded:["%27"]}, {raw:"(", encoded:["%28"]}, {raw:")", encoded:["%29"]}, {raw:";", encoded:["%3B", "%3b"]}, {raw:":", encoded:["%3A", "%3a"]}, {raw:"@", encoded:["%40"]}, {raw:"&", encoded:["%26"]}, {raw:"=", encoded:["%3D", "%3d"]}, {raw:"+", encoded:["%2B", "%2b"]}, {raw:"$", encoded:["%24"]}, {raw:",", encoded:["%2C", "%2c"]}, {raw:"/", encoded:["%2F", "%2f"]}, {raw:"?", encoded:["%3F", "%3f"]}, {raw:"#", encoded:["%23"]}, {raw:"[", encoded:["%5B", "%5b"]}, {raw:"]", encoded:["%5D", "%5d"]}, {raw:"\n", encoded:["%0A", "%0a"]}, {raw:"\r", encoded:["%0D", "%0d"]}, {raw:" ", encoded:["%20"]}];
public static var requestGuidedSearch:Function;
public static var downloadDeckPDF:Function;
public static var languageXML:XML;
public static var pageIdIsInPersonalDecks:Function;
public static var outputString:String = "";
private static var xmlEncodingMap:Array = [{raw:"&", encoded:["$amp"]}];
public static var navigateToLogin:Function;
public static function output(_arg1:String):void{
outputString = ((outputString + _arg1) + "\n");
if ((outputTextField is TextField)){
outputTextField.text = outputString;
};
trace(_arg1);
}
public static function urlDecode(_arg1:String):String{
return (DiagnosticUtilities.decodeStringWithMap(_arg1, DiagnosticUtilities.urlEncodingMap));
}
public static function parseDate(_arg1:String):String{
var returnString:String;
var dateValue:String;
var yearValue:String;
var monthValue:String;
var dayValue:String;
var timeValue:String;
var hourValue:String;
var minuteValue:String;
var hourNum:int;
var value = _arg1;
try {
returnString = "";
dateValue = value.split("T")[0];
yearValue = dateValue.split("-")[0];
monthValue = dateValue.split("-")[1];
dayValue = dateValue.split("-")[2];
timeValue = value.split("T")[1];
hourValue = timeValue.split(":")[0];
minuteValue = timeValue.split(":")[1];
switch (monthValue){
case "01":
returnString = (returnString + "January");
break;
case "02":
returnString = (returnString + "February");
break;
case "03":
returnString = (returnString + "March");
break;
case "04":
returnString = (returnString + "April");
break;
case "05":
returnString = (returnString + "May");
break;
case "06":
returnString = (returnString + "June");
break;
case "07":
returnString = (returnString + "July");
break;
case "08":
returnString = (returnString + "August");
break;
case "09":
returnString = (returnString + "September");
break;
case "10":
returnString = (returnString + "October");
break;
case "11":
returnString = (returnString + "November");
break;
case "12":
returnString = (returnString + "December");
break;
};
returnString = (returnString + " ");
if (dayValue.charAt(0) == "0"){
dayValue = dayValue.substr(1, 1);
};
returnString = (returnString + dayValue);
switch (dayValue.charAt((dayValue.length - 1))){
case "1":
returnString = (returnString + "st");
break;
case "2":
returnString = (returnString + "nd");
break;
case "3":
returnString = (returnString + "rd");
break;
default:
returnString = (returnString + "th");
break;
};
returnString = (returnString + ((", " + yearValue) + " at "));
hourNum = int(hourValue);
if (hourNum < 13){
returnString = (returnString + hourNum.toString());
} else {
returnString = (returnString + (hourNum - 12).toString());
};
returnString = (returnString + (":" + minuteValue));
if (hourNum < 13){
returnString = (returnString + "AM");
} else {
returnString = (returnString + "PM");
};
return (returnString);
} catch(error:Error) {
DiagnosticUtilities.output(("ERROR - ModuleUtilities - parseDate() - value==" + value));
return ("Cannot calculate date.");
};
return ("Cannot calculate date.");
}
public static function truncateTextWithSuffix(_arg1:TextField, _arg2:String, _arg3:String, _arg4:int):String{
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:Number;
var _local9:String;
_arg1.text = _arg2;
if (_arg1.numLines <= _arg4){
return (_arg2);
};
_local5 = 0;
_local6 = 0;
while (_local6 < (_arg4 - 1)) {
_local9 = _arg1.getLineText(_local6);
_local5 = (_local5 + _local9.length);
_local6++;
};
_local7 = "";
_local8 = _local5;
while (_local8 < _arg2.length) {
_local7 = (_arg2.substring(0, _local8) + _arg3);
_arg1.text = _local7;
if (_arg1.numLines > _arg4){
_local7 = (_arg2.substring(0, (_local8 - 1)) + _arg3);
break;
};
_local8++;
};
return (_local7);
}
public static function decodeStringWithMap(_arg1:String, _arg2:Array):String{
var _local3:String;
var _local4:Object;
var _local5:String;
_local3 = _arg1;
for each (_local4 in _arg2) {
for each (_local5 in _local4.encoded) {
_local3 = DiagnosticUtilities.findAndReplace(_local3, _local5, _local4.raw);
};
};
return (_local3);
}
public static function urlEncode(_arg1:String, _arg2:Boolean=true):String{
var _local3:String;
var _local4:uint;
var _local5:String;
var _local6:Object;
_local3 = "";
_local4 = 0;
while (_local4 < _arg1.length) {
_local5 = _arg1.charAt(_local4);
if (((!((_local5 == "%"))) || (_arg2))){
for each (_local6 in DiagnosticUtilities.urlEncodingMap) {
if (_local6.raw == _local5){
_local5 = _local6.encoded[0];
break;
};
};
};
_local3 = (_local3 + _local5);
_local4++;
};
return (_local3);
}
public static function xmlDecode(_arg1:String):String{
return (DiagnosticUtilities.decodeStringWithMap(_arg1, DiagnosticUtilities.xmlEncodingMap));
}
public static function findAndReplace(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:String;
var _local5:String;
var _local6:Boolean;
_local4 = _arg1;
_local5 = "";
_local6 = false;
do {
_local5 = _local4.replace(_arg2, _arg3);
if (_local5 == _local4){
_local6 = true;
};
_local4 = _local5;
} while (!(_local6));
return (_local4);
}
public static function navigateToPage(_arg1:String):void{
navigateToURL(new URLRequest(_arg1), "_self");
DiagnosticUtilities.output(("ModuleUtilities - navigateToPage() - url==" + _arg1));
}
}
}//package
Section 24
//GameType (GameType)
package {
public class GameType {
public static const CREATIVE:String = "game_type_creative";
public static const SCORING:String = "game_type_scoring";
}
}//package
Section 25
//Grass (Grass)
package {
import obstacle.*;
public dynamic class Grass extends GrassObstacle {
public function Grass(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package
Section 26
//Kota (Kota)
package {
import flash.media.*;
import mousetodrive.*;
import flash.geom.*;
import flash.display.*;
import utils.sound.*;
public class Kota extends Player {
private var _slowWalkChannel:SoundChannel;
private var _walkCycle:MovieClip;
private var _soundOnTransform:SoundTransform;
private var _walkFrame:int;// = 1
private var _fastWalkChannel:SoundChannel;
private var _mediumWalkChannel:SoundChannel;
private var _soundOffTransform:SoundTransform;
public function Kota(){
_walkFrame = 1;
_soundOnTransform = new SoundTransform(1, 0);
_soundOffTransform = new SoundTransform(0, 0);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
_directionFrames = 8;
stop();
_slowWalkChannel = playSound("KotaSlowWalk", 0, int.MAX_VALUE);
_mediumWalkChannel = playSound("KotaMediumWalk", 0, int.MAX_VALUE);
_fastWalkChannel = playSound("KotaFastWalk", 0, int.MAX_VALUE);
muteSounds();
}
function frame2(){
perimeterPoints_arr = [new Point(3.8, -46.2), new Point(11.8, -38.2), new Point(13.8, -28.2), new Point(23.8, -24.2), new Point(33.8, -18.2), new Point(43.8, -23.2), new Point(53.8, -20.2), new Point(58.8, -11.2), new Point(55.8, -1.2), new Point(54.8, 8.8), new Point(49.8, 17.8), new Point(39.8, 21.8), new Point(29.8, 21.8), new Point(21.8, 25.8), new Point(14.8, 35.8), new Point(4.8, 44.8), new Point(-5.2, 52.8), new Point(-15.2, 51.8), new Point(-25.2, 42.8), new Point(-35.2, 34.8), new Point(-45.2, 25.8), new Point(-52.2, 15.8), new Point(-60.2, 5.8), new Point(-60.2, -4.2), new Point(-60.2, -14.2), new Point(-56.2, -24.2), new Point(-47.2, -32.2), new Point(-37.2, -34.2), new Point(-27.2, -31.2), new Point(-19.2, -28.2), new Point(-16.2, -38.2), new Point(-7.2, -46.2)];
}
override public function moveTo(_arg1:Point):void{
var _local2:int;
super.moveTo(_arg1);
if (_speed <= 10){
_local2 = int(_speed);
} else {
_local2 = 10;
};
if (_local2 == 0){
_slowWalkChannel.soundTransform = _soundOffTransform;
_mediumWalkChannel.soundTransform = _soundOffTransform;
_fastWalkChannel.soundTransform = _soundOffTransform;
} else {
if ((((_local2 > 0)) && ((_local2 < 3)))){
_slowWalkChannel.soundTransform = _soundOnTransform;
_mediumWalkChannel.soundTransform = _soundOffTransform;
_fastWalkChannel.soundTransform = _soundOffTransform;
} else {
if ((((_local2 >= 3)) && ((_local2 <= 6)))){
_slowWalkChannel.soundTransform = _soundOffTransform;
_mediumWalkChannel.soundTransform = _soundOnTransform;
_fastWalkChannel.soundTransform = _soundOffTransform;
} else {
if ((((_local2 > 6)) && ((_local2 <= 10)))){
_slowWalkChannel.soundTransform = _soundOffTransform;
_mediumWalkChannel.soundTransform = _soundOffTransform;
_fastWalkChannel.soundTransform = _soundOnTransform;
};
};
};
};
_walkFrame = int((_walkFrame + _local2));
if (_walkFrame > _walkCycle.totalFrames){
_walkFrame = 1;
};
_walkCycle.gotoAndStop(_walkFrame);
}
function frame6(){
perimeterPoints_arr = [new Point(-4.65, -35.7), new Point(5.35, -30.7), new Point(14.35, -27.7), new Point(24.35, -24.7), new Point(34.35, -21.7), new Point(44.35, -22.7), new Point(54.35, -20.7), new Point(59.35, -13.7), new Point(59.35, -3.7), new Point(56.35, 6.3), new Point(52.35, 16.3), new Point(44.35, 24.3), new Point(42.35, 34.3), new Point(40.35, 44.3), new Point(35.35, 54.3), new Point(29.35, 64.3), new Point(20.35, 68.3), new Point(10.35, 65.3), new Point(6.35, 55.3), new Point(4.35, 47.3), new Point(-5.65, 48.3), new Point(-15.65, 46.3), new Point(-25.65, 40.3), new Point(-33.65, 34.3), new Point(-43.65, 38.3), new Point(-53.65, 35.3), new Point(-60.65, 26.3), new Point(-60.65, 16.3), new Point(-58.65, 6.3), new Point(-51.65, -3.7), new Point(-41.65, -7.7), new Point(-31.65, -4.7), new Point(-25.65, -5.7), new Point(-25.65, -15.7), new Point(-22.65, -25.7), new Point(-14.65, -35.7)];
}
function frame7(){
perimeterPoints_arr = [new Point(30.95, -41), new Point(40.95, -35), new Point(46.95, -25), new Point(49.95, -15), new Point(53.95, -5), new Point(58.95, 5), new Point(60.95, 15), new Point(60.95, 25), new Point(53.95, 35), new Point(43.95, 40), new Point(33.95, 41), new Point(23.95, 41), new Point(13.95, 37), new Point(4.95, 29), new Point(-5.05, 29), new Point(-15.05, 35), new Point(-25.05, 40), new Point(-35.05, 41), new Point(-45.05, 39), new Point(-55.05, 33), new Point(-60.05, 23), new Point(-60.05, 13), new Point(-56.05, 3), new Point(-47.05, -6), new Point(-45.05, -16), new Point(-44.05, -26), new Point(-37.05, -35), new Point(-27.05, -39), new Point(-17.05, -37), new Point(-9.05, -30), new Point(-5.05, -20), new Point(4.95, -22), new Point(8.95, -32), new Point(17.95, -40)];
}
function frame3(){
perimeterPoints_arr = [new Point(-20.05, -42), new Point(-10.05, -36), new Point(-4.05, -26), new Point(2.95, -21), new Point(7.95, -28), new Point(14.95, -37), new Point(24.95, -40), new Point(34.95, -38), new Point(42.95, -30), new Point(45.95, -20), new Point(45.95, -10), new Point(54.95, -1), new Point(59.95, 9), new Point(60.95, 19), new Point(57.95, 29), new Point(48.95, 37), new Point(38.95, 40), new Point(28.95, 40), new Point(18.95, 36), new Point(8.95, 29), new Point(-1.05, 29), new Point(-11.05, 35), new Point(-21.05, 40), new Point(-31.05, 40), new Point(-41.05, 40), new Point(-51.05, 35), new Point(-59.05, 26), new Point(-60.05, 16), new Point(-58.05, 6), new Point(-55.05, -4), new Point(-49.05, -14), new Point(-47.05, -24), new Point(-42.05, -34), new Point(-32.05, -41)];
}
function frame4(){
perimeterPoints_arr = [new Point(30.05, -33.45), new Point(38.05, -24.45), new Point(42.05, -14.45), new Point(42.05, -4.45), new Point(47.05, -2.45), new Point(57.05, -5.45), new Point(67.05, -1.45), new Point(74.05, 7.55), new Point(77.05, 17.55), new Point(77.05, 27.55), new Point(71.05, 36.55), new Point(61.05, 40.55), new Point(51.05, 37.55), new Point(43.05, 41.55), new Point(33.05, 49.55), new Point(23.05, 52.55), new Point(13.05, 52.55), new Point(10.05, 60.55), new Point(3.05, 69.55), new Point(-6.95, 70.55), new Point(-14.95, 63.55), new Point(-20.95, 53.55), new Point(-23.95, 43.55), new Point(-26.95, 33.55), new Point(-30.95, 25.55), new Point(-36.95, 15.55), new Point(-40.95, 5.55), new Point(-42.95, -4.45), new Point(-42.95, -14.45), new Point(-34.95, -19.45), new Point(-24.95, -19.45), new Point(-14.95, -20.45), new Point(-4.95, -23.45), new Point(5.05, -26.45), new Point(14.05, -30.45)];
}
function frame1(){
perimeterPoints_arr = [new Point(-25.7, -42.9), new Point(-20.7, -34.9), new Point(-16.7, -30.9), new Point(-7.7, -30.9), new Point(2.3, -31.9), new Point(12.3, -30.9), new Point(21.3, -29.9), new Point(23.3, -39.9), new Point(31.3, -42.9), new Point(39.3, -38.9), new Point(41.3, -28.9), new Point(42.3, -18.9), new Point(47.3, -12.9), new Point(54.3, -4.9), new Point(57.3, 5.1), new Point(57.3, 15.1), new Point(57.3, 25.1), new Point(54.3, 35.1), new Point(45.3, 42.1), new Point(35.3, 42.1), new Point(25.3, 43.1), new Point(15.3, 43.1), new Point(5.3, 43.1), new Point(-4.7, 43.1), new Point(-14.7, 43.1), new Point(-24.7, 42.1), new Point(-34.7, 43.1), new Point(-44.7, 42.1), new Point(-50.7, 33.1), new Point(-52.7, 23.1), new Point(-52.7, 13.1), new Point(-52.7, 3.1), new Point(-49.7, -6.9), new Point(-40.7, -13.9), new Point(-41.7, -23.9), new Point(-40.7, -33.9)];
}
function frame8(){
perimeterPoints_arr = [new Point(10.9, -51.2), new Point(18.9, -43.2), new Point(22.9, -34.2), new Point(30.9, -36.2), new Point(40.9, -39.2), new Point(50.9, -37.2), new Point(58.9, -29.2), new Point(62.9, -19.2), new Point(62.9, -9.2), new Point(66.9, -1.2), new Point(57.9, 8.8), new Point(51.9, 18.8), new Point(41.9, 27.8), new Point(31.9, 35.8), new Point(21.9, 44.8), new Point(11.9, 45.8), new Point(1.9, 41.8), new Point(-8.1, 34.8), new Point(-16.1, 24.8), new Point(-22.1, 14.8), new Point(-32.1, 15.8), new Point(-42.1, 11.8), new Point(-49.1, 2.8), new Point(-53.1, -7.2), new Point(-56.1, -17.2), new Point(-50.1, -26.2), new Point(-40.1, -28.2), new Point(-30.1, -23.2), new Point(-21.1, -29.2), new Point(-11.1, -33.2), new Point(-9.1, -43.2), new Point(-1.1, -51.2)];
}
function frame5(){
perimeterPoints_arr = [new Point(32.5, -34.05), new Point(40.5, -28.05), new Point(42.5, -18.05), new Point(42.5, -8.05), new Point(41.5, 1.95), new Point(48.5, 8.95), new Point(51.5, 18.95), new Point(51.5, 28.95), new Point(51.5, 38.95), new Point(50.5, 48.95), new Point(43.5, 54.95), new Point(33.5, 54.95), new Point(28.5, 46.95), new Point(25.5, 37.95), new Point(16.5, 46.95), new Point(6.5, 49.95), new Point(-3.5, 49.95), new Point(-13.5, 47.95), new Point(-22.5, 42.95), new Point(-26.5, 45.95), new Point(-29.5, 55.95), new Point(-39.5, 56.95), new Point(-48.5, 53.95), new Point(-52.5, 43.95), new Point(-53.5, 33.95), new Point(-53.5, 23.95), new Point(-51.5, 13.95), new Point(-43.5, 6.95), new Point(-42.5, -1.05), new Point(-43.5, -11.05), new Point(-42.5, -21.05), new Point(-37.5, -31.05), new Point(-27.5, -32.05), new Point(-18.5, -28.05), new Point(-8.5, -28.05), new Point(1.5, -29.05), new Point(11.5, -29.05), new Point(20.5, -31.05)];
}
public function set walkCycle(_arg1:MovieClip):void{
_walkCycle = _arg1;
}
public function muteSounds():void{
_slowWalkChannel.soundTransform = _soundOffTransform;
_mediumWalkChannel.soundTransform = _soundOffTransform;
_fastWalkChannel.soundTransform = _soundOffTransform;
}
}
}//package
Section 27
//KotaAdventure (KotaAdventure)
package {
import flash.events.*;
public class KotaAdventure extends AbstractIntegratedActivity {
private var _mainView:MainView;
public function KotaAdventure(){
super(GameType.SCORING);
}
private function gameCompleteAnimationFinished():void{
playmatePlay("gameReplayed");
}
override public function handleIrisOpeningBegin():void{
DiagnosticUtilities.output("Kota - handleIrisOpeningBegin()");
_mainView = new MainView();
_mainView.playmatePlay_fn = playmatePlay;
_mainView.assignAnimationCompleteHandler_fn = assignAnimationCompleteHandler;
_mainView.addEventListener(MainView.GAME_FINISHED, gameFinished, false, 0, true);
addChildAt(_mainView, 0);
}
private function gameFinished(_arg1:Event):void{
_mainView.removeEventListener(MainView.GAME_FINISHED, gameFinished);
playmatePlay("gameCompletedWon", gameCompleteAnimationFinished);
}
public function assignAnimationCompleteHandler(_arg1:Function):void{
onAnimationComplete_fn = _arg1;
}
}
}//package
Section 28
//KotaBGMusic (KotaBGMusic)
package {
import flash.media.*;
public dynamic class KotaBGMusic extends Sound {
}
}//package
Section 29
//KotaEatLeaf (KotaEatLeaf)
package {
import flash.media.*;
public dynamic class KotaEatLeaf extends Sound {
}
}//package
Section 30
//KotaFastWalk (KotaFastWalk)
package {
import flash.media.*;
public dynamic class KotaFastWalk extends Sound {
}
}//package
Section 31
//KotaGrassLoop (KotaGrassLoop)
package {
import flash.media.*;
public dynamic class KotaGrassLoop extends Sound {
}
}//package
Section 32
//KotaHitTree (KotaHitTree)
package {
import flash.media.*;
public dynamic class KotaHitTree extends Sound {
}
}//package
Section 33
//KotaMap (KotaMap)
package {
import mousetodrive.*;
import flash.events.*;
public class KotaMap extends Map {
private var _kota:Kota;
public function set kota(_arg1:Kota):void{
_kota = _arg1;
_player = _arg1;
}
override protected function removedFromStageHandler(_arg1:Event):void{
super.removedFromStageHandler(_arg1);
_kota.muteSounds();
}
}
}//package
Section 34
//KotaMediumWalk (KotaMediumWalk)
package {
import flash.media.*;
public dynamic class KotaMediumWalk extends Sound {
}
}//package
Section 35
//KotaRiverLoop (KotaRiverLoop)
package {
import flash.media.*;
public dynamic class KotaRiverLoop extends Sound {
}
}//package
Section 36
//KotaRockBreak (KotaRockBreak)
package {
import flash.media.*;
public dynamic class KotaRockBreak extends Sound {
}
}//package
Section 37
//KotaSlowWalk (KotaSlowWalk)
package {
import flash.media.*;
public dynamic class KotaSlowWalk extends Sound {
}
}//package
Section 38
//KotaSnarlSound (KotaSnarlSound)
package {
import flash.media.*;
public dynamic class KotaSnarlSound extends Sound {
}
}//package
Section 39
//KotaVictory (KotaVictory)
package {
import flash.media.*;
public dynamic class KotaVictory extends Sound {
}
}//package
Section 40
//leaf_animation (leaf_animation)
package {
import obstacle.*;
public dynamic class leaf_animation extends LeafItem {
public function leaf_animation(){
addFrameScript(14, frame15);
}
function frame15(){
gotoAndPlay("loop");
}
}
}//package
Section 41
//MainView (MainView)
package {
import flash.media.*;
import mousetodrive.*;
import flash.display.*;
import flash.events.*;
import mousetodrive.obstacle.*;
import utils.tracking.*;
import flash.utils.*;
import utils.sound.*;
public class MainView extends Sprite {
public var mapHolder_mc:MovieClip;
private var _playmatePlay_fn:Function;
private var _victoryScreen:VictoryScreen;
private var _soundOnTransform:SoundTransform;
public var map:Map;
private var _snarlTimer:Timer;
private var _snarlChannel:SoundChannel;
public var scoreboard:Scoreboard;
public var _assignAnimationCompleteHandler_fn:Function;
private var _myTrackEvent:trackEvent;
public var instructions:MovieClip;
private var _oldMap:Map;
public static const GAME_FINISHED:String = "gameFinished";
public function MainView(){
_soundOnTransform = new SoundTransform(0.5, 0);
super();
_myTrackEvent = new trackEvent();
instructions.demo.addEventListener(Event.COMPLETE, instructionsComplete, false, 0, true);
}
private function instructionsComplete(_arg1:Event):void{
instructions.demo.removeEventListener(Event.COMPLETE, instructionsComplete);
startNewGame();
playSound("KotaBGMusic", 0, int.MAX_VALUE);
playSound("KotaRiverLoop", 0, int.MAX_VALUE, _soundOnTransform);
_snarlTimer = new Timer(6000, 1);
_snarlTimer.addEventListener(TimerEvent.TIMER_COMPLETE, playSnarl, false, 0, true);
_snarlTimer.start();
}
private function playSnarl(_arg1:TimerEvent):void{
_snarlTimer.stop();
_snarlTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, playSnarl);
_snarlTimer = null;
_snarlChannel = playSound("KotaSnarlSound");
_snarlChannel.addEventListener(Event.SOUND_COMPLETE, restartSnarlTimer, false, 0, true);
}
public function set assignAnimationCompleteHandler_fn(_arg1:Function):void{
_assignAnimationCompleteHandler_fn = _arg1;
scoreboard.assignAnimationCompleteHandler_fn = this._assignAnimationCompleteHandler_fn;
}
private function victoryScreenAnimationComplete(_arg1:Event):void{
_victoryScreen.removeEventListener(Event.COMPLETE, victoryScreenAnimationComplete);
if (_victoryScreen){
removeChild(_victoryScreen);
};
startNewGame();
scoreboard.startCoinsOver();
scoreboard.currentIndex = 0;
_assignAnimationCompleteHandler_fn(gameFinishedAnimationComplete);
_playmatePlay_fn("gameReplayed");
}
private function restartSnarlTimer(_arg1:Event):void{
_snarlTimer = new Timer(6000, 1);
_snarlTimer.addEventListener(TimerEvent.TIMER_COMPLETE, playSnarl, false, 0, true);
_snarlTimer.start();
}
public function set playmatePlay_fn(_arg1:Function):void{
_playmatePlay_fn = _arg1;
scoreboard.playmatePlay_fn = this._playmatePlay_fn;
}
private function coinCollectedHandler(_arg1:Event):void{
scoreboard.collectCoin();
if (scoreboard.currentIndex >= 10){
playVictoryAnimation();
};
}
private function mapReady(_arg1:Event):void{
if (instructions.parent){
removeChild(instructions);
};
if (_oldMap){
mapHolder_mc.removeChild(_oldMap);
};
_oldMap = map;
}
private function gameFinishedAnimationComplete():void{
dispatchEvent(new Event(GAME_FINISHED));
}
private function playVictoryAnimation():void{
var _local1:Object;
_assignAnimationCompleteHandler_fn(gameFinishedAnimationComplete);
_playmatePlay_fn("gameCompletedWon");
_victoryScreen = new VictoryScreen();
_victoryScreen.addEventListener(Event.COMPLETE, victoryScreenAnimationComplete, false, 0, true);
addChild(_victoryScreen);
_local1 = new Object();
_local1.activity = "completed";
_myTrackEvent.as3event("event.view", _local1);
}
private function startNewGame():void{
var _local1:Object;
var _local2:int;
_local1 = new Object();
_local1.activity = "plays";
_myTrackEvent.as3event("event.view", _local1);
_local2 = Math.ceil((Math.random() * 3));
switch (_local2){
case 1:
map = new Map1();
break;
case 2:
map = new Map2();
break;
case 3:
map = new Map3();
break;
default:
trace("map not created");
};
mapHolder_mc.addChildAt(map, 0);
map.addEventListener(Item.COLLECTED, coinCollectedHandler, false, 0, true);
map.addEventListener(Map.READY, mapReady, false, 0, true);
}
}
}//package
Section 42
//Map1 (Map1)
package {
public dynamic class Map1 extends KotaMap {
}
}//package
Section 43
//Map1Background (Map1Background)
package {
import mousetodrive.obstacle.*;
public dynamic class Map1Background extends Background {
}
}//package
Section 44
//Map2 (Map2)
package {
public dynamic class Map2 extends KotaMap {
}
}//package
Section 45
//map2BottomBorder (map2BottomBorder)
package {
import mousetodrive.obstacle.*;
public dynamic class map2BottomBorder extends RenderableObstacle {
}
}//package
Section 46
//map2LeftWall (map2LeftWall)
package {
import mousetodrive.obstacle.*;
public dynamic class map2LeftWall extends RenderableObstacle {
}
}//package
Section 47
//map2RightWall (map2RightWall)
package {
import mousetodrive.obstacle.*;
public dynamic class map2RightWall extends RenderableObstacle {
}
}//package
Section 48
//Map2RiverObstacle (Map2RiverObstacle)
package {
import mousetodrive.obstacle.*;
public dynamic class Map2RiverObstacle extends Obstacle {
}
}//package
Section 49
//Map3 (Map3)
package {
public dynamic class Map3 extends KotaMap {
}
}//package
Section 50
//map3leftWall (map3leftWall)
package {
import mousetodrive.obstacle.*;
public dynamic class map3leftWall extends RenderableObstacle {
}
}//package
Section 51
//map3rightwall (map3rightwall)
package {
import mousetodrive.obstacle.*;
public dynamic class map3rightwall extends RenderableObstacle {
}
}//package
Section 52
//river_obstacle (river_obstacle)
package {
import mousetodrive.obstacle.*;
public dynamic class river_obstacle extends Obstacle {
}
}//package
Section 53
//river1 (river1)
package {
import mousetodrive.obstacle.*;
public dynamic class river1 extends UnrenderableNonObstacle {
}
}//package
Section 54
//River2 (River2)
package {
import mousetodrive.obstacle.*;
public dynamic class River2 extends UnrenderableNonObstacle {
}
}//package
Section 55
//River3 (River3)
package {
import mousetodrive.obstacle.*;
public dynamic class River3 extends UnrenderableNonObstacle {
}
}//package
Section 56
//River3_1 (River3_1)
package {
import mousetodrive.obstacle.*;
public dynamic class River3_1 extends UnrenderableNonObstacle {
}
}//package
Section 57
//River3_2 (River3_2)
package {
import mousetodrive.obstacle.*;
public dynamic class River3_2 extends UnrenderableNonObstacle {
}
}//package
Section 58
//River3_3 (River3_3)
package {
import mousetodrive.obstacle.*;
public dynamic class River3_3 extends UnrenderableNonObstacle {
}
}//package
Section 59
//river3Obstacle (river3Obstacle)
package {
import mousetodrive.obstacle.*;
public dynamic class river3Obstacle extends Obstacle {
}
}//package
Section 60
//Rock1 (Rock1)
package {
import obstacle.*;
public dynamic class Rock1 extends RockObstacle {
public function Rock1(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 61
//Rock2 (Rock2)
package {
import obstacle.*;
public dynamic class Rock2 extends RockObstacle {
public function Rock2(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 62
//Rock3 (Rock3)
package {
import obstacle.*;
public dynamic class Rock3 extends RockObstacle {
public function Rock3(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 63
//Rock4 (Rock4)
package {
import obstacle.*;
public dynamic class Rock4 extends RockObstacle {
public function Rock4(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 64
//Scoreboard (Scoreboard)
package {
import flash.display.*;
import utils.sound.*;
public class Scoreboard extends Sprite {
private var _playmatePlay_fn:Function;
public var leaf_01:MovieClip;
public var leaf_02:MovieClip;
public var leaf_03:MovieClip;
public var leaf_06:MovieClip;
public var leaf_09:MovieClip;
public var leaf_08:MovieClip;
public var leaf_05:MovieClip;
public var leaf_07:MovieClip;
public var leaf_04:MovieClip;
public var leaf_10:MovieClip;
public var _assignAnimationCompleteHandler_fn:Function;
private var leaves:Array;
public var currentIndex:uint;// = 0
public function Scoreboard(){
var _local1:MovieClip;
currentIndex = 0;
super();
leaves = [leaf_01, leaf_02, leaf_03, leaf_04, leaf_05, leaf_06, leaf_07, leaf_08, leaf_09, leaf_10];
for each (_local1 in leaves) {
_local1.visible = false;
_local1.stop();
_local1.addFrameScript((_local1.totalFrames - 1), _local1.stop);
};
}
public function set assignAnimationCompleteHandler_fn(_arg1:Function):void{
_assignAnimationCompleteHandler_fn = _arg1;
}
private function scoreAnimationComplete():void{
}
public function set playmatePlay_fn(_arg1:Function):void{
_playmatePlay_fn = _arg1;
}
public function startCoinsOver():void{
var _local1:MovieClip;
for each (_local1 in leaves) {
_local1.visible = false;
_local1.gotoAndStop(1);
};
}
public function collectCoin():void{
var _local1:MovieClip;
if (currentIndex >= leaves.length){
return;
};
playSound("KotaEatLeaf");
_local1 = MovieClip(leaves[currentIndex]);
_local1.visible = true;
_local1.play();
currentIndex++;
_assignAnimationCompleteHandler_fn(scoreAnimationComplete);
_playmatePlay_fn("scoreSuccess");
}
}
}//package
Section 65
//Tree (Tree)
package {
import obstacle.*;
public dynamic class Tree extends TreeObstacle {
public function Tree(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package
Section 66
//wall (wall)
package {
import mousetodrive.obstacle.*;
public dynamic class wall extends RenderableObstacle {
}
}//package
Section 67
//WallBottomwWaterHole (WallBottomwWaterHole)
package {
import mousetodrive.obstacle.*;
public dynamic class WallBottomwWaterHole extends RenderableObstacle {
}
}//package
Section 68
//WallLeftwWaterHole (WallLeftwWaterHole)
package {
import mousetodrive.obstacle.*;
public dynamic class WallLeftwWaterHole extends RenderableObstacle {
}
}//package
Section 69
//VictoryScreen (VictoryScreen)
package {
import flash.display.*;
import flash.events.*;
import utils.sound.*;
public class VictoryScreen extends MovieClip {
public function VictoryScreen(){
addFrameScript(249, frame250);
playSound("KotaVictory");
}
function frame250(){
dispatchEvent(new Event(Event.COMPLETE));
stop();
}
}
}//package