Section 1
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 3
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 4
//anim_butterflyleft_25 (friendshipgarden_fla.anim_butterflyleft_25)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_butterflyleft_25 extends MovieClip {
public function anim_butterflyleft_25(){
addFrameScript(0, frame1, 46, frame47);
}
function frame1(){
stop();
}
function frame47(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 5
//anim_butterflyright_26 (friendshipgarden_fla.anim_butterflyright_26)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_butterflyright_26 extends MovieClip {
public function anim_butterflyright_26(){
addFrameScript(0, frame1, 46, frame47);
}
function frame1(){
stop();
}
function frame47(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 6
//anim_opal_waters_32 (friendshipgarden_fla.anim_opal_waters_32)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_opal_waters_32 extends MovieClip {
public function anim_opal_waters_32(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 7
//anim_puddle_31 (friendshipgarden_fla.anim_puddle_31)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_puddle_31 extends MovieClip {
public function anim_puddle_31(){
addFrameScript(0, frame1, 65, frame66);
}
function frame1(){
stop();
}
function frame66(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 8
//anim_tootwaves_33 (friendshipgarden_fla.anim_tootwaves_33)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_tootwaves_33 extends MovieClip {
public function anim_tootwaves_33(){
addFrameScript(0, frame1, 39, frame40);
}
function frame1(){
stop();
}
function frame40(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 9
//anim_tulipleft_30 (friendshipgarden_fla.anim_tulipleft_30)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_tulipleft_30 extends MovieClip {
public function anim_tulipleft_30(){
addFrameScript(0, frame1, 46, frame47);
}
function frame1(){
stop();
}
function frame47(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 10
//anim_tulipright_28 (friendshipgarden_fla.anim_tulipright_28)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_tulipright_28 extends MovieClip {
public function anim_tulipright_28(){
addFrameScript(0, frame1, 46, frame47);
}
function frame1(){
stop();
}
function frame47(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 11
//anim_worm_27 (friendshipgarden_fla.anim_worm_27)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class anim_worm_27 extends MovieClip {
public function anim_worm_27(){
addFrameScript(0, frame1, 32, frame33);
}
function frame1(){
stop();
}
function frame33(){
gotoAndStop(1);
}
}
}//package friendshipgarden_fla
Section 12
//hintsanim_48 (friendshipgarden_fla.hintsanim_48)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class hintsanim_48 extends MovieClip {
public function hintsanim_48(){
addFrameScript(56, frame57);
}
function frame57(){
stop();
}
}
}//package friendshipgarden_fla
Section 13
//puff_19 (friendshipgarden_fla.puff_19)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class puff_19 extends MovieClip {
public function puff_19(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package friendshipgarden_fla
Section 14
//resetCheck_45 (friendshipgarden_fla.resetCheck_45)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class resetCheck_45 extends MovieClip {
public var cancelReset:Cancel;
public var confirmReset:Confirm;
}
}//package friendshipgarden_fla
Section 15
//T_10 (friendshipgarden_fla.T_10)
package friendshipgarden_fla {
import flash.display.*;
public dynamic class T_10 extends MovieClip {
public function T_10(){
addFrameScript(63, frame64);
}
function frame64(){
stop();
}
}
}//package friendshipgarden_fla
Section 16
//ArrayUtil (ArrayUtil)
package {
public class ArrayUtil {
public static function unique(_arg1:Array):Array{
var _local2:*;
var _local3:Array;
_local3 = new Array();
for each (_local2 in _arg1) {
if (_local3.indexOf(_local2) < 0){
_local3.push(_local2);
};
};
return (_local3);
}
public static function each(_arg1:Array, _arg2:Function, _arg3:Object=null):void{
var _local4:Array;
var _local5:uint;
var _local6:*;
if (((((_arg1) && (_arg1.length))) && ((_arg2 is Function)))){
_local5 = _arg1.length;
while (_local5--) {
_local6 = _arg1[_local5];
_local4 = [_local6, _local5, _arg1].slice(0, _arg2.length);
if (_arg2.apply(_arg3, _local4) === false){
return;
};
};
};
}
public static function compact(_arg1:Array):Array{
return (ArrayUtil.remove(_arg1, null, undefined));
}
public static function flatten(_arg1:Array):Array{
var _local3:uint;
var _local4:Array;
var _local5:*;
if (((_arg1) && (_arg1.length))){
_local4 = new Array();
_local3 = _arg1.length;
while (_local3--) {
_local5 = _arg1[_local3];
if ((_local5 is Array)){
_local5 = _local5.slice();
_local5 = arguments.callee(_local5);
};
_local4 = [].concat(_local5, _local4);
};
} else {
_local4 = new Array();
};
return (_local4);
}
public static function normalize(_arg1:Array):Array{
var _local2:Array;
if (_arg1){
_local2 = _arg1.concat();
_local2 = ArrayUtil.flatten(_local2);
_local2 = ArrayUtil.unique(_local2);
_local2 = ArrayUtil.compact(_local2);
} else {
_local2 = new Array();
};
return (_local2);
}
public static function add(_arg1:Array, ... _args):Array{
var _local3:Array;
var _local2:Array = ArrayUtil.flatten(_args);
_local2 = ArrayUtil.compact(_local2);
if (_arg1){
_local3 = _arg1.concat();
} else {
_local3 = new Array();
};
_local3 = _local3.concat(_local2);
_local3 = ArrayUtil.unique(_local3);
return (_local3);
}
public static function type(_arg1:Array, _arg2:Class):Array{
var temp:Array;
var array = _arg1;
var type = _arg2;
temp = ArrayUtil.map(array, function (_arg1){
return ((_arg1 as type));
});
temp = ArrayUtil.compact(temp);
return (temp);
}
public static function remove(_arg1:Array, ... _args):Array{
var _local3:uint;
var _local4:Array;
var _local5:*;
if (((((((_arg1) && (_arg1.length))) && (_args))) && (_args.length))){
_local4 = _arg1.slice();
var _local2:Array = ArrayUtil.flatten(_args);
_local3 = _local2.length;
while (_local3--) {
_local5 = _local2[_local3];
while (_local4.indexOf(_local5) >= 0) {
_local4.splice(_local4.indexOf(_local5), 1);
};
};
} else {
_local4 = new Array();
};
return (_local4);
}
public static function map(_arg1:Array, _arg2:Function, _arg3:Object=null):Array{
var _local4:Array;
var _local5:uint;
var _local6:Array;
var _local7:*;
if (((((_arg1) && (_arg1.length))) && ((_arg2 is Function)))){
_local6 = new Array();
_local5 = _arg1.length;
while (_local5--) {
_local7 = _arg1[_local5];
_local4 = [_local7, _local5, _arg1].slice(0, _arg2.length);
_local6.unshift(_arg2.apply(_arg3, _local4));
};
} else {
_local6 = new Array();
};
return (_local6);
}
public static function empty(_arg1:Array):Boolean{
return ((_arg1.length === 0));
}
public static function contains(_arg1:Array, ... _args):Boolean{
var _local3:uint;
var _local4:*;
if (((((((_arg1) && (_arg1.length))) && (_args))) && (_args.length))){
var _local2:Array = ArrayUtil.unique(_args);
_local3 = _local2.length;
while (_local3--) {
_local4 = _local2[_local3];
if (_arg1.indexOf(_local4) < 0){
return (false);
};
};
return (true);
};
return (false);
}
}
}//package
Section 17
//Birdbath (Birdbath)
package {
public dynamic class Birdbath extends DragCopy {
public function Birdbath(){
addFrameScript(30, frame31, 36, frame37, 74, frame75);
}
function frame75(){
gotoAndStop("done");
}
function frame37(){
stop();
}
function frame31(){
stop();
}
}
}//package
Section 18
//BonusKite (BonusKite)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class BonusKite extends MovieClip {
public var gnome:DragCopy;
public var active:Boolean;// = false
public var birdbath:DragCopy;
public var windchime:DragCopy;
public var kiteTimer:Timer;
public var lantern:DragCopy;
public var soundManager:SimpleSoundManager;
public var scarecrow:DragCopy;
public var bonusNum:int;// = 0
public function BonusKite(){
active = false;
bonusNum = 0;
kiteTimer = new Timer(45000);
super();
addFrameScript(30, frame31, 43, frame44, 50, frame51, 58, frame59, 66, frame67, 74, frame75);
addEventListener(Event.ADDED_TO_STAGE, Ready);
kiteTimer.addEventListener(TimerEvent.TIMER, ShowKite);
soundManager = new SimpleSoundManager();
}
function ShowBonus(){
stop();
if (bonusNum < 5){
bonusNum++;
} else {
bonusNum = 1;
};
switch (bonusNum){
case 1:
gotoAndStop("gnome");
break;
case 2:
gotoAndStop("birdbath");
break;
case 3:
gotoAndStop("scarecrow");
break;
case 4:
gotoAndStop("windchimes");
break;
case 5:
gotoAndStop("lantern");
break;
};
}
function frame75(){
stop();
}
function ShowKite(_arg1:TimerEvent){
if (!active){
soundManager.play("voHeresSomething");
Label.play(this, "show", ShowBonus);
active = true;
};
}
function Ready(_arg1:Event){
stop();
kiteTimer.start();
}
function frame31(){
stop();
}
function frame44(){
stop();
}
function frame51(){
stop();
}
function frame59(){
stop();
}
function frame67(){
stop();
}
}
}//package
Section 19
//Cabbage (Cabbage)
package {
public dynamic class Cabbage extends DragCopy {
public function Cabbage(){
addFrameScript(30, frame31, 36, frame37, 57, frame58);
}
function frame37(){
stop();
}
function frame58(){
gotoAndStop("done");
}
function frame31(){
stop();
}
}
}//package
Section 20
//Cancel (Cancel)
package {
public dynamic class Cancel extends ClipButton {
}
}//package
Section 21
//Carrot (Carrot)
package {
public dynamic class Carrot extends DragCopy {
public function Carrot(){
addFrameScript(25, frame26, 31, frame32, 55, frame56);
}
function frame26(){
stop();
}
function frame32(){
stop();
}
function frame56(){
gotoAndStop("done");
}
}
}//package
Section 22
//ClipButton (ClipButton)
package {
import flash.display.*;
import flash.events.*;
public class ClipButton extends MovieClip {
public function ClipButton(){
stop();
buttonMode = true;
mouseChildren = false;
addMouseListeners();
}
private function addMouseListeners():void{
addEventListener(MouseEvent.ROLL_OVER, ButtonOver);
addEventListener(MouseEvent.ROLL_OUT, ButtonOut);
addEventListener(MouseEvent.MOUSE_DOWN, ButtonPress);
addEventListener(MouseEvent.MOUSE_UP, ButtonRelease);
}
private function ButtonPress(_arg1:MouseEvent){
if (this.currentLabel != "inactive"){
gotoAndStop("down");
};
}
private function ButtonRelease(_arg1:MouseEvent){
if (this.currentLabel != "inactive"){
gotoAndStop("up");
};
}
private function ButtonOver(_arg1:MouseEvent){
if (((!((this.currentLabel == "active"))) && (!((this.currentLabel == "inactive"))))){
gotoAndStop("over");
};
}
private function ButtonOut(_arg1:MouseEvent){
if (((!((this.currentLabel == "active"))) && (!((this.currentLabel == "inactive"))))){
gotoAndStop("up");
};
}
}
}//package
Section 23
//Confirm (Confirm)
package {
public dynamic class Confirm extends ClipButton {
}
}//package
Section 24
//DeleteKey (DeleteKey)
package {
public dynamic class DeleteKey extends KeyButton {
}
}//package
Section 25
//Document (Document)
package {
import flash.display.*;
public class Document extends MovieClip {
public var preloader:Preloader;
public function Document(){
stop();
}
}
}//package
Section 26
//DragCopy (DragCopy)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class DragCopy extends MovieClip {
public var masterNames:Array;
public var canCopy:Boolean;// = true
public var soundManager:SimpleSoundManager;
public function DragCopy(){
masterNames = new Array("tomato", "lettuce", "carrot", "yellowPepper", "squash", "cabbage", "purpleTulip", "redTulip", "pinkTulip", "gnome", "birdbath", "scarecrow", "windchime", "lantern");
canCopy = true;
super();
addEventListener(Event.ADDED_TO_STAGE, Ready);
soundManager = new SimpleSoundManager();
}
function RollOverClip(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = this;
switch (_local2.currentLabel){
case "done":
_local2.gotoAndPlay("over");
break;
case "icon":
_local2.scaleX = (_local2.scaleX + 0.1);
_local2.scaleY = (_local2.scaleY + 0.1);
break;
};
}
function Drag(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:Class;
var _local4:DragCopy;
if ((parent is BonusKite)){
_local2 = MovieClip(parent.parent.parent);
MovieClip(parent).gotoAndStop("hide");
MovieClip(parent).active = false;
soundManager.play("voKeepPlanting");
} else {
_local2 = MovieClip(parent.parent);
};
_local3 = Object(_arg1.target).constructor;
_local4 = (new (_local3) as DragCopy);
_local4.canCopy = false;
_local4.x = stage.mouseX;
_local4.y = stage.mouseY;
_local2.container.addChild(_local4);
_local4.gotoAndStop("proxy");
_local4.startDrag(true);
_local4.addEventListener(Event.ENTER_FRAME, _local4.ScaleClip);
stage.addEventListener(MouseEvent.MOUSE_UP, _local4.DropClip);
stage.addEventListener(Event.MOUSE_LEAVE, _local4.KillClip);
}
function DropCurrent(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
_local2 = MovieClip(parent.parent);
_local3 = this;
_local4 = (_local2.plot.x + _local2.plot.width);
_local5 = _local2.plot.y;
if (_local3.x > _local4){
soundManager.play("fxPoof");
Label.play(_local3, "kill", ForceKillCurrent);
} else {
if (_local3.y < _local5){
_local3.y = (_local5 + 10);
};
};
removeEventListener(Event.ENTER_FRAME, _local3.ScaleClip);
stage.removeEventListener(MouseEvent.MOUSE_UP, _local3.DropCurrent);
stage.removeEventListener(Event.MOUSE_LEAVE, _local3.KillClip);
stopDrag();
}
function ForceKillCurrent(){
var _local1:MovieClip;
_local1 = MovieClip(parent.parent);
_local1.container.removeChild(this);
removeEventListener(MouseEvent.ROLL_OVER, RollOverClip);
}
function Ready(_arg1:Event){
stop();
buttonMode = true;
mouseChildren = false;
if (canCopy){
addEventListener(MouseEvent.MOUSE_DOWN, Drag);
} else {
addEventListener(MouseEvent.MOUSE_DOWN, DragCurrent);
};
addEventListener(MouseEvent.ROLL_OVER, RollOverClip);
addEventListener(MouseEvent.ROLL_OUT, RollOutClip);
}
function ScaleClip(_arg1:Event){
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Number;
_local2 = MovieClip(parent.parent);
_local3 = this;
_local4 = (((((stage.mouseY - _local2.plot.y) * 100) / _local2.plot.height) * 1.5) / 100);
if (_local4 < 0.55){
_local4 = 0.55;
} else {
if (_local4 > 1){
_local4 = 1;
};
};
_local3.scaleX = _local4;
_local3.scaleY = _local4;
FixDepths(_local2.container);
}
function DragCurrent(_arg1:MouseEvent){
this.x = stage.mouseX;
this.y = stage.mouseY;
startDrag(true);
stage.addEventListener(MouseEvent.MOUSE_UP, DropCurrent);
stage.addEventListener(Event.MOUSE_LEAVE, KillClip);
addEventListener(Event.ENTER_FRAME, ScaleClip);
gotoAndStop("done");
}
function RollOutClip(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = this;
switch (_local2.currentLabel){
case "icon":
_local2.scaleX = (_local2.scaleX - 0.1);
_local2.scaleY = (_local2.scaleY - 0.1);
break;
};
}
function ForceKillClip(){
var _local1:MovieClip;
_local1 = MovieClip(parent.parent);
_local1.container.removeChild(this);
removeEventListener(MouseEvent.ROLL_OVER, RollOverClip);
}
function FixDepths(_arg1:MovieClip):void{
var _local2:uint;
var _local3:Array;
_local3 = new Array();
_local2 = _arg1.numChildren;
while (_local2--) {
_local3[_local2] = _arg1.getChildAt(_local2);
};
_local3.sortOn("y", Array.NUMERIC);
_local2 = _arg1.numChildren;
while (_local2--) {
if (_local3[_local2] != _arg1.getChildAt(_local2)){
_arg1.setChildIndex(_local3[_local2], _local2);
};
};
}
function KillClip(_arg1:Event){
var _local2:MovieClip;
_local2 = MovieClip(parent.parent);
_local2.container.removeChildAt((_local2.container.numChildren - 1));
stage.removeEventListener(MouseEvent.MOUSE_UP, DropClip);
stage.removeEventListener(Event.MOUSE_LEAVE, KillClip);
removeEventListener(Event.ENTER_FRAME, ScaleClip);
removeEventListener(MouseEvent.ROLL_OVER, RollOverClip);
}
function DropClip(_arg1:MouseEvent){
var _local2:uint;
var _local3:Boolean;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:Number;
var _local7:Number;
_local3 = false;
_local2 = 0;
while (_local2 <= masterNames.length) {
if (_arg1.target.name == masterNames[_local2]){
trace(masterNames[_local2]);
_local3 = true;
};
_local2++;
};
_local4 = MovieClip(parent.parent);
_local5 = this;
_local6 = (_local4.plot.x + _local4.plot.width);
_local7 = _local4.plot.y;
if (!_local3){
if (_local5.x > _local6){
soundManager.play("fxPoof");
Label.play(_local5, "kill", ForceKillClip);
} else {
if (_local5.y < _local7){
_local5.y = (_local7 + 10);
};
_local5.gotoAndPlay("enter");
if (_local4.soundManager.isPlaying("voFriendshipGarden")){
_local4.soundManager.stop("voFriendshipGarden");
};
soundManager.play(("vo" + getQualifiedClassName(_local5)));
};
};
_local5.removeEventListener(Event.ENTER_FRAME, _local5.ScaleClip);
stage.removeEventListener(MouseEvent.MOUSE_UP, _local5.DropClip);
stage.removeEventListener(Event.MOUSE_LEAVE, _local5.KillClip);
stopDrag();
}
}
}//package
Section 27
//FriendshipGarden (FriendshipGarden)
package {
import flash.display.*;
import flash.events.*;
public class FriendshipGarden extends MovieClip {
public var printback:PrintBack;
public var trash:MovieClip;
public var nameText:String;// = ""
public var palette:Palette;
public var toolbar:Toolbar;
public var container:MovieClip;
public var soundManager:SimpleSoundManager;
public var plot:Plot;
public function FriendshipGarden(){
nameText = "";
palette = new Palette();
toolbar = new Toolbar();
plot = new Plot();
printback = new PrintBack();
container = new MovieClip();
trash = new MovieClip();
super();
addEventListener(Event.ADDED_TO_STAGE, Ready);
nameText = Global.vars.playerName;
soundManager = new SimpleSoundManager();
}
public function Ready(_arg1:Event){
this.addChild(container);
this.addChild(palette);
this.addChild(toolbar);
printback.visible = false;
toolbar.nameField.text = (nameText + "’S GARDEN");
soundManager.play("fxAmbience", {loop:9999});
soundManager.play("voFriendshipGarden");
}
}
}//package
Section 28
//fxAmbience (fxAmbience)
package {
import flash.media.*;
public dynamic class fxAmbience extends Sound {
}
}//package
Section 29
//fxDeleteKey (fxDeleteKey)
package {
import flash.media.*;
public dynamic class fxDeleteKey extends Sound {
}
}//package
Section 30
//fxKey (fxKey)
package {
import flash.media.*;
public dynamic class fxKey extends Sound {
}
}//package
Section 31
//fxPlay (fxPlay)
package {
import flash.media.*;
public dynamic class fxPlay extends Sound {
}
}//package
Section 32
//fxPoof (fxPoof)
package {
import flash.media.*;
public dynamic class fxPoof extends Sound {
}
}//package
Section 33
//fxSubmit (fxSubmit)
package {
import flash.media.*;
public dynamic class fxSubmit extends Sound {
}
}//package
Section 34
//fxThemeMusic (fxThemeMusic)
package {
import flash.media.*;
public dynamic class fxThemeMusic extends Sound {
}
}//package
Section 35
//fxTinkle (fxTinkle)
package {
import flash.media.*;
public dynamic class fxTinkle extends Sound {
}
}//package
Section 36
//GameIntro (GameIntro)
package {
import flash.display.*;
import flash.events.*;
public class GameIntro extends MovieClip {
public var playbutton:ClipButton;
public var soundManager:SimpleSoundManager;
public function GameIntro(){
addFrameScript(0, frame1);
addEventListener(Event.ADDED_TO_STAGE, Ready);
soundManager = new SimpleSoundManager();
}
function RollOver(_arg1:MouseEvent){
soundManager.play("fxPlay");
}
function frame1(){
Global.vars.gameClass = "FriendshipGarden";
}
function Ready(_arg1:Event){
playbutton.addEventListener(MouseEvent.CLICK, DisplayGame);
playbutton.addEventListener(MouseEvent.MOUSE_OVER, RollOver);
soundManager.play("fxThemeMusic", {loop:999});
soundManager.fadeStart(1, 0, 1, "fxThemeMusic");
soundManager.play("voGameIntro");
}
function DisplayGame(_arg1:MouseEvent){
var _local2:NameInput;
playbutton.removeEventListener(MouseEvent.CLICK, DisplayGame);
soundManager.stop();
_local2 = new NameInput();
parent.addChild(_local2);
this.stage.focus = null;
parent.removeChild(this);
}
}
}//package
Section 37
//GardenAnimations (GardenAnimations)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class GardenAnimations extends MovieClip {
public var butterflyleft:MovieClip;
public var opalwaters:MovieClip;
public var tootwaves:MovieClip;
public var worm:MovieClip;
public var anim:Timer;
public var butterflyright:MovieClip;
public var tulipleft:MovieClip;
public var prompts:Timer;
public var soundManager:SimpleSoundManager;
public var puddle:MovieClip;
public var tulipright:MovieClip;
public function GardenAnimations():void{
anim = new Timer(15000);
prompts = new Timer(25000);
super();
addEventListener(Event.ADDED_TO_STAGE, Ready);
anim.addEventListener(TimerEvent.TIMER, Animate);
prompts.addEventListener(TimerEvent.TIMER, PlayPrompt);
soundManager = new SimpleSoundManager();
}
function PlayPrompt(_arg1:TimerEvent){
var _local2:int;
_local2 = (Math.floor((Math.random() * ((3 - 0) + 1))) + 0);
switch (_local2){
case 0:
soundManager.play("voPromptPrettyPlants");
break;
case 1:
soundManager.play("voPromptGoodJob");
break;
case 2:
soundManager.play("voPromptKeepPlanting");
break;
case 3:
soundManager.play("voPromptPrettyGarden");
break;
};
}
function Ready(_arg1:Event){
stop();
tulipleft.stop();
butterflyleft.stop();
tulipright.stop();
butterflyright.stop();
worm.stop();
puddle.stop();
opalwaters.stop();
tootwaves.stop();
anim.start();
prompts.start();
}
function Animate(_arg1:TimerEvent){
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = (Math.floor((Math.random() * ((7 - 0) + 1))) + 0);
_local3 = (Math.floor((Math.random() * ((300 - 0) + 1))) + 0);
_local4 = (Math.floor((Math.random() * ((150 - 0) + 1))) + 0);
switch (_local2){
case 0:
tulipleft.y = _local4;
tulipleft.play();
break;
case 1:
tulipright.y = _local4;
tulipright.play();
break;
case 2:
butterflyleft.y = _local4;
butterflyleft.play();
break;
case 3:
butterflyright.y = _local4;
butterflyright.play();
break;
case 4:
worm.x = _local3;
worm.play();
break;
case 5:
opalwaters.play();
break;
case 6:
puddle.play();
break;
case 7:
tootwaves.play();
break;
};
}
}
}//package
Section 38
//Global (Global)
package {
public class Global {
public static var vars:Object = {};
}
}//package
Section 39
//Gnome (Gnome)
package {
public dynamic class Gnome extends DragCopy {
public function Gnome(){
addFrameScript(30, frame31, 36, frame37, 57, frame58);
}
function frame37(){
stop();
}
function frame58(){
gotoAndStop("done");
}
function frame31(){
stop();
}
}
}//package
Section 40
//Key (Key)
package {
public dynamic class Key extends KeyButton {
}
}//package
Section 41
//KeyButton (KeyButton)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class KeyButton extends MovieClip {
private var letter:TextField;
public function KeyButton():void{
letter = new TextField();
super();
stop();
buttonMode = true;
mouseChildren = false;
addMouseListeners();
}
private function addMouseListeners():void{
addEventListener(MouseEvent.ROLL_OVER, ButtonOver);
addEventListener(MouseEvent.ROLL_OUT, ButtonOut);
addEventListener(MouseEvent.MOUSE_DOWN, ButtonPress);
addEventListener(MouseEvent.MOUSE_UP, ButtonRelease);
}
private function ButtonPress(_arg1:MouseEvent){
if (this.currentLabel != "inactive"){
gotoAndStop("down");
};
}
private function ButtonRelease(_arg1:MouseEvent){
if (this.currentLabel != "inactive"){
gotoAndStop("up");
};
}
private function ButtonOver(_arg1:MouseEvent){
if (((!((this.currentLabel == "active"))) && (!((this.currentLabel == "inactive"))))){
gotoAndStop("over");
};
}
private function ButtonOut(_arg1:MouseEvent){
if (((!((this.currentLabel == "active"))) && (!((this.currentLabel == "inactive"))))){
gotoAndStop("up");
};
}
}
}//package
Section 42
//Label (Label)
package {
import flash.utils.*;
import flash.display.*;
public class Label {
private var _name:String;
private var _totalFrames:int;
private var _firstFrame:int;
private var _lastFrame:int;
private static var _hash:Object;
public function Label(_arg1:String, _arg2:int, _arg3:int, _arg4:int){
_firstFrame = _arg2;
_lastFrame = _arg3;
_name = _arg1;
_totalFrames = _arg4;
}
public function get totalFrames():int{
return (_totalFrames);
}
public function get name():String{
return (_name);
}
public function get lastFrame():int{
return (_lastFrame);
}
public function get firstFrame():int{
return (_firstFrame);
}
public static function find(_arg1:MovieClip, _arg2:String):Label{
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:FrameLabel;
var _local7:int;
var _local8:int;
if (((((((_arg2) && (_arg2.length))) && (_arg1))) && (_arg1.currentLabels.length))){
_local5 = getQualifiedClassName(_arg1);
if (!_hash){
_hash = new Object();
};
if (!_hash[_local5]){
_hash[_local5] = new Object();
_local3 = (_arg1.totalFrames + 1);
_local4 = _arg1.currentLabels.length;
while (_local4--) {
_local6 = _arg1.currentLabels[_local4];
if (_local6.frame < _local3){
_local7 = (_local3 - 1);
_local8 = (_local3 - _local6.frame);
_local3 = _local6.frame;
};
_hash[_local5][_local6.name] = new Label(_local6.name, _local3, _local7, _local8);
};
};
return (((_hash[_local5][_arg2]) || (null)));
};
return (null);
}
public static function repeat(_arg1:MovieClip, _arg2:String, _arg3:Function):void{
var _local4:Label;
_local4 = find(_arg1, _arg2);
if ((((_local4 === null)) || ((_local4.totalFrames === 1)))){
_arg1.stop();
} else {
setTimeout(_arg3, 1);
};
}
public static function play(_arg1:MovieClip, _arg2:String, _arg3:Function):void{
var _local4:Label;
_local4 = find(_arg1, _arg2);
if (_local4 === null){
_arg3();
} else {
_arg1.addFrameScript((_local4.lastFrame - 1), _arg3);
if (_local4.totalFrames === 1){
_arg1.gotoAndStop(_local4.name);
} else {
if (((!((_arg1.currentLabel === _local4.name))) || ((_arg1.currentFrame === _local4.lastFrame)))){
_arg1.gotoAndPlay(_local4.name);
} else {
_arg1.play();
};
};
};
}
}
}//package
Section 43
//Lantern (Lantern)
package {
public dynamic class Lantern extends DragCopy {
public function Lantern(){
addFrameScript(30, frame31, 36, frame37, 57, frame58);
}
function frame37(){
stop();
}
function frame58(){
gotoAndStop("done");
}
function frame31(){
stop();
}
}
}//package
Section 44
//LeftButton (LeftButton)
package {
public dynamic class LeftButton extends ClipButton {
}
}//package
Section 45
//Link (Link)
package {
import flash.net.*;
public class Link {
public static function getURL(_arg1:String, _arg2:String=null):void{
var req:URLRequest;
var url = _arg1;
var window = _arg2;
req = new URLRequest(url);
try {
navigateToURL(req, window);
} catch(e:Error) {
trace("Navigate to URL failed", e.message);
};
}
}
}//package
Section 46
//NameInput (NameInput)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class NameInput extends MovieClip {
public var nameLetters:Array;
public var submit:ClipButton;
public var keyIsDown:Boolean;// = false
public var A:Key;
public var C:Key;
public var D:Key;
public var E:Key;
public var F:Key;
public var H:Key;
public var J:Key;
public var L:Key;
public var I:Key;
public var K:Key;
public var P:Key;
public var nameText:String;// = ""
public var R:Key;
public var T:Key;
public var G:Key;
public var Y:Key;
public var Z:Key;
public var S:Key;
public var N:Key;
public var O:Key;
public var Q:Key;
public var U:Key;
public var V:Key;
public var B:Key;
private var i:uint;
public var M:Key;
public var W:Key;
public var keyPressed:String;// = ""
public var X:Key;
public var letters:Array;
public var nameField:TextField;
public var nameCount:uint;// = 0
public var soundManager:SimpleSoundManager;
public var upperAlpha:RegExp;
public var DEL:DeleteKey;
public function NameInput(){
submit = new ClipButton();
letters = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
nameField = new TextField();
nameLetters = new Array();
nameText = "";
nameCount = 0;
keyIsDown = false;
keyPressed = "";
upperAlpha = /[A-Z]/;
super();
addEventListener(Event.ADDED_TO_STAGE, Ready);
soundManager = new SimpleSoundManager();
}
private function TypeLetter(_arg1:String){
if (nameCount < 12){
nameText = (nameText + _arg1);
nameField.text = nameText;
nameCount++;
soundManager.play("fxKey");
} else {
return;
};
if (nameCount > 1){
submit.gotoAndStop("up");
submit.addEventListener(MouseEvent.CLICK, Submit);
} else {
submit.gotoAndStop("inactive");
submit.removeEventListener(MouseEvent.CLICK, Submit);
};
}
private function Submit(_arg1:MouseEvent){
var _local2:*;
submit.removeEventListener(MouseEvent.CLICK, Submit);
i = 0;
while (i < 26) {
this[letters[i]].removeEventListener(MouseEvent.CLICK, LetterClick);
i++;
};
soundManager.stop("voNameInput");
soundManager.play("fxSubmit");
soundManager.stop("fxThemeMusic");
Global.vars.playerName = nameText;
_local2 = new ((getDefinitionByName(Global.vars.gameClass) as Class));
stage.addChild(_local2);
this.stage.focus = null;
parent.removeChild(this);
}
public function KeyRelease(_arg1:KeyboardEvent){
keyIsDown = false;
if (upperAlpha.test(keyPressed)){
this[keyPressed].gotoAndStop("up");
};
keyPressed = "";
}
private function LetterClick(_arg1:MouseEvent){
if (this.currentLabel != "inactive"){
if (_arg1.target.name != "DEL"){
TypeLetter(_arg1.target.name);
} else {
DeleteLetter();
};
};
}
public function KeyPress(_arg1:KeyboardEvent){
var _local2:uint;
if (!keyIsDown){
keyIsDown = true;
if ((((_arg1.charCode > 64)) && ((_arg1.charCode < 91)))){
keyPressed = String.fromCharCode(_arg1.charCode);
TypeLetter(keyPressed);
this[keyPressed].gotoAndStop("down");
} else {
if ((((_arg1.charCode > 96)) && ((_arg1.charCode < 123)))){
_local2 = (_arg1.charCode - 32);
keyPressed = String.fromCharCode(_local2);
TypeLetter(keyPressed);
this[keyPressed].gotoAndStop("down");
} else {
if ((((_arg1.charCode == 8)) || ((_arg1.charCode == 127)))){
keyPressed = "DEL";
this[keyPressed].gotoAndStop("down");
DeleteLetter();
} else {
return;
};
};
};
};
}
function Ready(_arg1:Event){
stop();
soundManager.play("fxThemeMusic", {loop:999});
soundManager.fadeStart(1, 0, 1, "fxThemeMusic");
soundManager.play("voNameInput");
nameField.text = nameText;
i = 0;
while (i < 26) {
this[letters[i]].letter.text = this[letters[i]].name;
this[letters[i]].addEventListener(MouseEvent.CLICK, LetterClick);
i++;
};
this["DEL"].addEventListener(MouseEvent.CLICK, LetterClick);
submit.gotoAndStop("inactive");
stage.addEventListener(KeyboardEvent.KEY_DOWN, KeyPress);
stage.addEventListener(KeyboardEvent.KEY_UP, KeyRelease);
}
private function DeleteLetter(){
if (nameCount > 0){
nameText = nameText.substring(0, (nameText.length - 1));
nameField.text = nameText;
nameCount--;
soundManager.play("fxDeleteKey");
};
if (nameCount < 1){
submit.gotoAndStop("inactive");
submit.removeEventListener(MouseEvent.CLICK, Submit);
};
}
}
}//package
Section 47
//Palette (Palette)
package {
import flash.display.*;
import flash.events.*;
public class Palette extends MovieClip {
public var tomato:DragCopy;
public var purpleTulip:DragCopy;
public var anim:GardenAnimations;
public var bonus:BonusKite;
public var cabbage:DragCopy;
public var squash:DragCopy;
public var redTulip:DragCopy;
public var carrot:DragCopy;
public var yellowPepper:DragCopy;
public var pinkTulip:DragCopy;
public function Palette(){
addEventListener(Event.ADDED_TO_STAGE, Ready);
mouseEnabled = false;
}
function Ready(_arg1:Event){
stop();
addChild(tomato);
addChild(carrot);
addChild(yellowPepper);
addChild(squash);
addChild(cabbage);
addChild(purpleTulip);
addChild(redTulip);
addChild(pinkTulip);
}
}
}//package
Section 48
//PinkTulip (PinkTulip)
package {
public dynamic class PinkTulip extends DragCopy {
public function PinkTulip(){
addFrameScript(29, frame30, 35, frame36, 59, frame60);
}
function frame60(){
gotoAndStop("done");
}
function frame30(){
stop();
}
function frame36(){
stop();
}
}
}//package
Section 49
//PlayGame (PlayGame)
package {
public dynamic class PlayGame extends ClipButton {
}
}//package
Section 50
//Plot (Plot)
package {
import flash.display.*;
public dynamic class Plot extends MovieClip {
}
}//package
Section 51
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
public class Preloader extends MovieClip {
public var document:Document;
public var pageText:String;
public var bytesTotalBar:MovieClip;
public var bytesLoadedBar:MovieClip;
public function Preloader(){
stop();
addEventListener(Event.ADDED_TO_STAGE, Ready);
addEventListener(Event.REMOVED_FROM_STAGE, Done);
}
private function Ready(_arg1:Event){
document = (root as Document);
if (document){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function Done(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event){
bytesLoadedBar.scaleX = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
bytesLoadedBar.width = Math.round(bytesLoadedBar.width);
if (loaderInfo.bytesLoaded == loaderInfo.bytesTotal){
if (parent){
parent.removeChild(this);
};
document.gotoAndStop(document.totalFrames);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
}
}//package
Section 52
//PrintBack (PrintBack)
package {
import flash.display.*;
public dynamic class PrintBack extends MovieClip {
}
}//package
Section 53
//Printer (Printer)
package {
public dynamic class Printer extends ClipButton {
}
}//package
Section 54
//PurpleTulip (PurpleTulip)
package {
public dynamic class PurpleTulip extends DragCopy {
public function PurpleTulip(){
addFrameScript(29, frame30, 35, frame36, 60, frame61);
}
function frame30(){
stop();
}
function frame36(){
stop();
}
function frame61(){
gotoAndStop("done");
}
}
}//package
Section 55
//RedTulip (RedTulip)
package {
public dynamic class RedTulip extends DragCopy {
public function RedTulip(){
addFrameScript(29, frame30, 35, frame36, 59, frame60);
}
function frame60(){
gotoAndStop("done");
}
function frame30(){
stop();
}
function frame36(){
stop();
}
}
}//package
Section 56
//Reset (Reset)
package {
public dynamic class Reset extends ClipButton {
}
}//package
Section 57
//Scarecrow (Scarecrow)
package {
public dynamic class Scarecrow extends DragCopy {
public function Scarecrow(){
addFrameScript(30, frame31, 36, frame37, 57, frame58);
}
function frame37(){
stop();
}
function frame58(){
gotoAndStop("done");
}
function frame31(){
stop();
}
}
}//package
Section 58
//SimpleSound (SimpleSound)
package {
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class SimpleSound extends EventDispatcher {
private var _sound:Sound;
private var _channels:Array;
private var _defaultOptions:SimpleSoundOptions;
public function SimpleSound(_arg1:Sound, _arg2:Object=null){
setChannels(new Array());
setSound(_arg1);
defaultOptions = new SimpleSoundOptions(_arg2);
}
public function stop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.stop();
});
}
private function onSoundStop(_arg1:Event):void{
var _local2:SimpleSoundChannel;
var _local3:Array;
_local2 = (_arg1.target as SimpleSoundChannel);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_CHANGE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_START, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_CHANGE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_START, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_STOP, onSoundStop);
_local3 = getChannels();
_local3 = ArrayUtil.remove(_local3, _local2);
setChannels(_local3);
}
public function get isBuffering():Boolean{
var _local1:Sound;
_local1 = getSound();
return (_local1.isBuffering);
}
public function get bytesTotal():uint{
var _local1:Sound;
_local1 = getSound();
return (_local1.bytesTotal);
}
public function pan(_arg1:Number=0):void{
panStart(0, NaN, _arg1);
}
public function fadeStop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeStop();
});
}
public function volume(_arg1:Number=1):void{
fadeStart(0, NaN, _arg1);
}
public function get defaultOptions():SimpleSoundOptions{
return (_defaultOptions);
}
public function get id3():ID3Info{
var _local1:Sound;
_local1 = getSound();
return (_local1.id3);
}
public function get isPlaying():Boolean{
return (getIsPlaying());
}
public function fadeOut(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeOut(duration);
});
}
public function play(_arg1:Object=null):SimpleSoundChannel{
var channel:SimpleSoundChannel;
var channels:Array;
var sound:Sound;
var options = _arg1;
sound = getSound();
options = new SimpleSoundOptions(defaultOptions, options);
if (options.mode === SimpleSoundOptions.PLAY_NEW){
stop();
};
if ((((((options.mode === SimpleSoundOptions.PLAY_ALL)) || ((options.mode === SimpleSoundOptions.PLAY_NEW)))) || (!(isPlaying)))){
try {
channel = new SimpleSoundChannel(sound.play(options.offset, options.loop), this);
channel.volume = options.volume;
channel.pan = options.pan;
channel.addEventListener(SimpleSoundChannelEvent.FADE_CHANGE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_START, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_CHANGE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_START, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_STOP, onSoundStop, false, 0, true);
channels = getChannels();
channels = ArrayUtil.add(channels, channel);
setChannels(channels);
} catch(error:ArgumentError) {
};
};
return (channel);
}
public function set defaultOptions(_arg1:SimpleSoundOptions):void{
_defaultOptions = _arg1;
}
public function panStop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panStop();
});
}
public function fadeIn(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeIn(duration);
});
}
public function panLeft(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panLeft(duration);
});
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var channels:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panStart(duration, start, finish);
});
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var channels:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeStart(duration, start, finish);
});
}
public function get bytesLoaded():uint{
var _local1:Sound;
_local1 = getSound();
return (_local1.bytesLoaded);
}
private function setChannels(_arg1:Array):void{
_channels = _arg1;
}
private function setSound(_arg1:Sound):void{
if (!_arg1){
throw (new ArgumentError("Sound cannot be null."));
};
_sound = _arg1;
_sound.addEventListener(Event.COMPLETE, dispatchEvent, false, 0, true);
_sound.addEventListener(Event.ID3, dispatchEvent, false, 0, true);
_sound.addEventListener(Event.OPEN, dispatchEvent, false, 0, true);
_sound.addEventListener(IOErrorEvent.IO_ERROR, dispatchEvent, false, 0, true);
_sound.addEventListener(ProgressEvent.PROGRESS, dispatchEvent, false, 0, true);
}
private function getChannels():Array{
return (_channels.concat());
}
public function get channels():Array{
return (getChannels());
}
private function getSound():Sound{
return (_sound);
}
public function panCenter(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panCenter(duration);
});
}
public function get length():Number{
var _local1:Sound;
_local1 = getSound();
return (_local1.length);
}
public function fadeOutAndStop(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeOutAndStop(duration);
});
}
public function load(_arg1:URLRequest, _arg2:SoundLoaderContext=null):void{
var _local3:Sound;
_local3 = getSound();
_local3.load(_arg1, _arg2);
}
private function getIsPlaying():Boolean{
return (((_channels) && (_channels.length)));
}
public function get url():String{
var _local1:Sound;
_local1 = getSound();
return (_local1.url);
}
public function close():void{
var _local1:Sound;
_local1 = getSound();
_local1.close();
}
public function panRight(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panRight(duration);
});
}
}
}//package
Section 59
//SimpleSoundChannel (SimpleSoundChannel)
package {
import flash.events.*;
import flash.media.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class SimpleSoundChannel extends EventDispatcher {
private var _sound:SimpleSound;
private var _isPlaying:Boolean;
private var _panTween:Tween;
private var _volumeTween:Tween;
private var _channel:SoundChannel;
private var _isPanning:Boolean;
private var _isFading:Boolean;
public function SimpleSoundChannel(_arg1:SoundChannel, _arg2:SimpleSound){
setSound(_arg2);
setChannel(_arg1);
setIsPlaying(true);
}
public function stop():void{
var _local1:SoundChannel;
fadeStop();
panStop();
_local1 = getChannel();
_local1.stop();
setIsPlaying(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.SOUND_STOP, false, false, this));
}
public function get isFading():Boolean{
return (getIsFading());
}
private function setIsFading(_arg1:Boolean):void{
_isFading = _arg1;
}
private function onFadeChange(_arg1:TweenEvent):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_CHANGE, false, false, this));
}
private function setIsPanning(_arg1:Boolean):void{
_isPanning = _arg1;
}
private function onPanChange(_arg1:TweenEvent):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_CHANGE, false, false, this));
}
private function getIsPanning():Boolean{
return (_isPanning);
}
public function get leftPeak():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.leftPeak);
}
public function get sound():SimpleSound{
return (getSound());
}
private function onPanComplete(_arg1:TweenEvent):void{
panStop();
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_COMPLETE, false, false, this));
}
public function get volume():Number{
return (getVolume());
}
public function get rightPeak():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.rightPeak);
}
private function setVolume(_arg1:Number):void{
var _local2:SoundChannel;
var _local3:Number;
_local2 = getChannel();
_local3 = getPan();
_local2.soundTransform = new SoundTransform(_arg1, _local3);
}
public function get pan():Number{
return (getPan());
}
public function fadeStop():void{
var _local1:Tween;
_local1 = getVolumeTween();
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_CHANGE, onFadeChange);
_local1.removeEventListener(TweenEvent.MOTION_FINISH, onFadeComplete);
_local1.stop();
setIsFading(false);
setVolumeTween(null);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_STOP, false, false, this));
};
}
public function get isPlaying():Boolean{
return (getIsPlaying());
}
private function getVolume():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform.volume);
}
public function get position():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.position);
}
public function get soundTransform():SoundTransform{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform);
}
private function setVolumeTween(_arg1:Tween):void{
_volumeTween = _arg1;
}
public function set volume(_arg1:Number):void{
setVolume(_arg1);
}
public function fadeOut(_arg1:Number):void{
fadeStart(_arg1, NaN, 0);
}
public function set pan(_arg1:Number):void{
setPan(_arg1);
}
private function getVolumeTween():Tween{
return (_volumeTween);
}
public function panStop():void{
var _local1:Tween;
_local1 = getPanTween();
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_CHANGE, onPanChange);
_local1.removeEventListener(TweenEvent.MOTION_FINISH, onPanComplete);
_local1.stop();
setIsPanning(false);
setPanTween(null);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_STOP, false, false, this));
};
}
private function setChannel(_arg1:SoundChannel):void{
if (!_arg1){
throw (new ArgumentError("Channel cannot be null."));
};
_channel = _arg1;
_channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var _local4:Tween;
if (isNaN(_arg2)){
_arg2 = pan;
};
if (isNaN(_arg3)){
_arg3 = pan;
};
if (isNaN(_arg1)){
_arg1 = 0;
};
panStop();
if ((((_arg2 === _arg3)) || ((_arg1 <= 0)))){
pan = _arg2;
setIsPanning(true);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_START, false, false, this));
pan = _arg3;
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_CHANGE, false, false, this));
setIsPanning(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_STOP, false, false, this));
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_COMPLETE, false, false, this));
} else {
_local4 = new Tween(this, "pan", Regular.easeInOut, _arg2, _arg3, _arg1, true);
_local4.addEventListener(TweenEvent.MOTION_CHANGE, onPanChange);
_local4.addEventListener(TweenEvent.MOTION_FINISH, onPanComplete);
setIsPanning(true);
setPanTween(_local4);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_START, false, false, this));
};
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var _local4:Tween;
if (isNaN(_arg2)){
_arg2 = volume;
};
if (isNaN(_arg3)){
_arg3 = volume;
};
if (isNaN(_arg1)){
_arg1 = 0;
};
fadeStop();
if ((((_arg2 === _arg3)) || ((_arg1 <= 0)))){
volume = _arg2;
setIsFading(true);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_START, false, false, this));
volume = _arg3;
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_CHANGE, false, false, this));
setIsFading(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_STOP, false, false, this));
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_COMPLETE, false, false, this));
} else {
_local4 = new Tween(this, "volume", Regular.easeInOut, _arg2, _arg3, _arg1, true);
_local4.addEventListener(TweenEvent.MOTION_CHANGE, onFadeChange);
_local4.addEventListener(TweenEvent.MOTION_FINISH, onFadeComplete);
setIsFading(true);
setVolumeTween(_local4);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_START, false, false, this));
};
}
private function onSoundComplete(_arg1:Event):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.SOUND_COMPLETE, false, false, this));
stop();
}
public function get isPanning():Boolean{
return (getIsPanning());
}
private function setPanTween(_arg1:Tween):void{
_panTween = _arg1;
}
public function set soundTransform(_arg1:SoundTransform):void{
var _local2:SoundChannel;
_local2 = getChannel();
_local2.soundTransform = _arg1;
}
private function getPanTween():Tween{
return (_panTween);
}
private function getSound():SimpleSound{
return (_sound);
}
private function setPan(_arg1:Number):void{
var _local2:SoundChannel;
var _local3:Number;
_local2 = getChannel();
_local3 = getVolume();
_local2.soundTransform = new SoundTransform(_local3, _arg1);
}
private function getChannel():SoundChannel{
return (_channel);
}
public function panCenter(_arg1:Number):void{
panStart(_arg1, NaN, 0);
}
private function onFadeComplete(_arg1:TweenEvent):void{
fadeStop();
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_COMPLETE, false, false, this));
}
private function setSound(_arg1:SimpleSound):void{
_sound = _arg1;
}
public function panLeft(_arg1:Number):void{
panStart(_arg1, NaN, -1);
}
private function getPan():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform.pan);
}
private function getIsPlaying():Boolean{
return (_isPlaying);
}
private function setIsPlaying(_arg1:Boolean):void{
_isPlaying = _arg1;
}
public function fadeOutAndStop(_arg1:Number):void{
var self:SimpleSoundChannel;
var onComplete:Function;
var onStop:Function;
var duration = _arg1;
onComplete = function (_arg1:Event):void{
self.removeEventListener("fadeComplete", onComplete);
self.removeEventListener("fadeStop", onStop);
};
onStop = function (_arg1:Event):void{
self.removeEventListener("fadeComplete", onComplete);
self.removeEventListener("fadeStop", onStop);
self.stop();
};
self = this;
self.addEventListener("fadeComplete", onComplete);
self.addEventListener("fadeStop", onStop);
fadeOut(duration);
}
private function getIsFading():Boolean{
return (_isFading);
}
public function fadeIn(_arg1:Number):void{
fadeStart(_arg1, NaN, 1);
}
public function panRight(_arg1:Number):void{
panStart(_arg1, NaN, 1);
}
}
}//package
Section 60
//SimpleSoundChannelEvent (SimpleSoundChannelEvent)
package {
import flash.events.*;
public class SimpleSoundChannelEvent extends Event {
private var _channel:SimpleSoundChannel;
public static const PAN_START:String = "panStart";
public static const SOUND_STOP:String = "soundStop";
public static const FADE_STOP:String = "fadeStop";
public static const SOUND_COMPLETE:String = "soundComplete";
public static const PAN_STOP:String = "panStop";
public static const PAN_CHANGE:String = "panChange";
public static const FADE_CHANGE:String = "fadeChange";
public static const PAN_COMPLETE:String = "panComplete";
public static const FADE_COMPLETE:String = "fadeComplete";
public static const FADE_START:String = "fadeStart";
public function SimpleSoundChannelEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:SimpleSoundChannel=null){
super(_arg1, _arg2, _arg3);
setChannel(_arg4);
}
override public function toString():String{
return (formatToString("SimpleSoundChannelEvent", "type", "bubbles", "cancelable", "channel"));
}
private function getChannel():SimpleSoundChannel{
return (_channel);
}
private function setChannel(_arg1:SimpleSoundChannel):void{
_channel = _arg1;
}
public function get channel():SimpleSoundChannel{
return (_channel);
}
override public function clone():Event{
return (new SimpleSoundChannelEvent(type, bubbles, cancelable, channel));
}
}
}//package
Section 61
//SimpleSoundManager (SimpleSoundManager)
package {
import flash.utils.*;
import flash.media.*;
public class SimpleSoundManager {
private var _nameLookup:Dictionary;
private var _soundList:Array;
private var _nameList:Array;
private var _soundLookup:Dictionary;
public function SimpleSoundManager(){
setNameList(new Array());
setNameLookup(new Dictionary());
setSoundList(new Array());
setSoundLookup(new Dictionary());
}
public function stop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.stop();
});
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN, _arg4=null):void{
var sounds:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
var names = _arg4;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panStart(duration, start, finish);
});
}
public function getChannels(_arg1):Array{
var _local2:Array;
var _local3:Array;
_local3 = getSounds(_arg1);
_local2 = ArrayUtil.map(_local3, mapSoundToChannels);
_local2 = ArrayUtil.flatten(_local2);
_local2 = ArrayUtil.unique(_local2);
_local2 = ArrayUtil.type(_local2, SimpleSoundChannel);
return (_local2);
}
public function getSounds(_arg1=null):Array{
var _local2:Array;
if (_arg1 === null){
_local2 = getSoundList();
} else {
_arg1 = new Array(_arg1);
_arg1 = ArrayUtil.flatten(_arg1);
_local2 = ArrayUtil.map(_arg1, mapNameToSound);
_local2 = ArrayUtil.type(_local2, SimpleSound);
_local2 = ArrayUtil.unique(_local2);
};
return (_local2);
}
private function setNameList(_arg1:Array):void{
_nameList = _arg1;
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN, _arg4=null):void{
var sounds:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
var names = _arg4;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeStart(duration, start, finish);
});
}
private function mapNameToSound(_arg1:String):SimpleSound{
return (getSound(_arg1));
}
private function setSoundList(_arg1:Array):void{
_soundList = _arg1;
}
public function panLeft(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panLeft(duration);
});
}
public function fadeIn(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeIn(duration);
});
}
public function unbind(_arg1:String):void{
bind(_arg1, null);
}
private function getSoundList():Array{
return (_soundList.concat());
}
public function createAndBind(_arg1:String, _arg2:Object=null):SimpleSound{
var _local3:SimpleSound;
_local3 = create(_arg1, _arg2);
if (_local3){
bind(_arg1, _local3);
};
return (_local3);
}
private function mapSoundToName(_arg1:SimpleSound){
return (getName(_arg1));
}
public function volume(_arg1:Number=1, _arg2=null):void{
var sounds:Array;
var value = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.volume(value);
});
}
private function getNameLookup():Dictionary{
return (_nameLookup);
}
public function pan(_arg1:Number=0, _arg2=null):void{
var sounds:Array;
var value = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.pan(value);
});
}
private function mapSoundToChannels(_arg1:SimpleSound):Array{
return (_arg1.channels);
}
public function getSound(_arg1:String):SimpleSound{
var _local2:Dictionary;
_local2 = getNameLookup();
return ((_local2[_arg1] as SimpleSound));
}
public function getNames(_arg1=null):Array{
var _local2:Array;
if (_arg1 === null){
_local2 = getNameList();
} else {
_arg1 = new Array(_arg1);
_arg1 = ArrayUtil.flatten(_arg1);
_local2 = ArrayUtil.map(_arg1, mapSoundToName);
_local2 = ArrayUtil.type(_local2, String);
_local2 = ArrayUtil.unique(_local2);
};
return (_local2);
}
public function getName(_arg1:SimpleSound):String{
var _local2:Dictionary;
_local2 = getSoundLookup();
return (((_local2[_arg1]) || (null)));
}
public function isPlaying(_arg1=null):Boolean{
var _local2:Array;
_local2 = getChannels(_arg1);
return ((_local2.length > 0));
}
public function fadeStop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeStop();
});
}
private function setSoundLookup(_arg1:Dictionary):void{
_soundLookup = _arg1;
}
public function isolate(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = ArrayUtil.remove(getSounds(), getSounds(names));
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.stop();
});
}
public function panRight(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panRight(duration);
});
}
private function setNameLookup(_arg1:Dictionary):void{
_nameLookup = _arg1;
}
public function fadeOut(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeOut(duration);
});
}
private function getSoundLookup():Dictionary{
return (_soundLookup);
}
public function panCenter(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panCenter(duration);
});
}
public function fadeOutAndStop(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeOutAndStop(duration);
});
}
public function panStop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panStop();
});
}
public function play(_arg1:String, _arg2:Object=null):SimpleSoundChannel{
var _local3:SimpleSound;
var _local4:SimpleSoundChannel;
_local3 = getSound(_arg1);
if (_local3){
_arg2 = new SimpleSoundOptions(_local3.defaultOptions, _arg2);
_local4 = _local3.play(_arg2);
} else {
_local3 = create((_arg1 as String), _arg2);
if (_local3){
_local4 = _local3.play(_local3.defaultOptions);
bind(_arg1, _local3);
};
};
return (_local4);
}
public function create(_arg1:String, _arg2:Object=null):SimpleSound{
var sound:Sound;
var simple:SimpleSound;
var classname = _arg1;
var options = _arg2;
try {
sound = (new (getDefinitionByName(classname)) as Sound);
simple = new SimpleSound(sound, options);
} catch(error:ReferenceError) {
} catch(error:ArgumentError) {
};
return (simple);
}
public function bind(_arg1:String, _arg2:SimpleSound):void{
var _local3:Array;
var _local4:Dictionary;
var _local5:Array;
var _local6:Dictionary;
var _local7:SimpleSound;
_local3 = getNameList();
_local4 = getNameLookup();
_local5 = getSoundList();
_local6 = getSoundLookup();
_local7 = getSound(_arg1);
if (_local7 !== _arg2){
if (_local7){
_local7.stop();
_local3 = ArrayUtil.remove(_local3, _arg1);
delete _local4[_arg1];
_local5 = ArrayUtil.remove(_local5, _local7);
delete _local6[_local7];
};
if (_arg2){
_local4[_arg1] = _arg2;
_local3 = ArrayUtil.add(_local3, _arg1);
_local6[_arg2] = _arg1;
_local5 = ArrayUtil.add(_local5, _arg2);
};
setNameList(_local3);
setNameLookup(_local4);
setSoundList(_local5);
setSoundLookup(_local6);
};
}
private function getNameList():Array{
return (_nameList.concat());
}
}
}//package
Section 62
//SimpleSoundOptions (SimpleSoundOptions)
package {
public class SimpleSoundOptions {
private var _volume:Number;
private var _mode:uint;
private var _loop:int;
private var _pan:Number;
private var _offset:Number;
public static const PLAY_NEW:uint = 2;
public static const PLAY_ALL:uint = 0;
public static const PLAY_CURRENT:uint = 1;
public function SimpleSoundOptions(... _args){
offset = 0;
loop = 0;
pan = 0;
volume = 1;
merge(_args);
}
public function set loop(_arg1:int):void{
_loop = Math.abs(_arg1);
}
public function set mode(_arg1:uint):void{
switch (_arg1){
case PLAY_CURRENT:
case PLAY_NEW:
_mode = _arg1;
break;
default:
_mode = PLAY_ALL;
break;
};
}
public function get offset():Number{
return (_offset);
}
public function get volume():Number{
return (_volume);
}
public function get pan():Number{
return (_pan);
}
public function toObject():Object{
return ({loop:loop, mode:mode, offset:offset, pan:pan, volume:volume});
}
public function get mode():uint{
return (_mode);
}
public function set offset(_arg1:Number):void{
if (isNaN(_arg1)){
_offset = 0;
} else {
_offset = _arg1;
};
}
public function get loop():int{
return (_loop);
}
public function toString():String{
var _local1:String;
_local1 = "[SimpleSoundOptions loop=!loop offset=!offset pan=!pan volume=!volume]";
_local1 = _local1.replace("!loop", loop);
_local1 = _local1.replace("!offset", offset);
_local1 = _local1.replace("!pan", pan);
_local1 = _local1.replace("!volume", volume);
return (_local1);
}
public function set volume(_arg1:Number):void{
if (!isNaN(_arg1)){
_volume = _arg1;
};
}
public function merge(... _args):void{
var args = _args;
args = ArrayUtil.flatten(args);
args = ArrayUtil.compact(args);
args = args.reverse();
ArrayUtil.each(args, function (_arg1:Object):void{
if (("loop" in _arg1)){
loop = _arg1.loop;
};
if (("mode" in _arg1)){
mode = _arg1.mode;
};
if (("offset" in _arg1)){
offset = _arg1.offset;
};
if (("pan" in _arg1)){
pan = _arg1.pan;
};
if (("volume" in _arg1)){
volume = _arg1.volume;
};
});
}
public function set pan(_arg1:Number):void{
if (!isNaN(_arg1)){
_pan = _arg1;
};
}
}
}//package
Section 63
//Sounds (Sounds)
package {
import flash.display.*;
public dynamic class Sounds extends MovieClip {
public function Sounds(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 64
//SoundToggle (SoundToggle)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class SoundToggle extends MovieClip {
private var _target:Sprite;
public function SoundToggle(_arg1:Sprite=null){
this.target = _arg1;
buttonMode = true;
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
stop();
}
public function set target(_arg1:Sprite):void{
_target = _arg1;
}
public function get target():Sprite{
return (_target);
}
private function onAddedToStage(_arg1:Event):void{
if (target){
if (target.soundTransform.volume){
gotoAndStop("on");
} else {
gotoAndStop("off");
};
} else {
if (SoundMixer.soundTransform.volume){
gotoAndStop("on");
} else {
gotoAndStop("off");
};
};
}
private function onClick(_arg1:MouseEvent):void{
if (target){
if (target.soundTransform.volume){
target.soundTransform = new SoundTransform(0, target.soundTransform.pan);
gotoAndStop("off");
} else {
target.soundTransform = new SoundTransform(1, target.soundTransform.pan);
gotoAndStop("on");
};
} else {
if (SoundMixer.soundTransform.volume){
SoundMixer.soundTransform = new SoundTransform(0, SoundMixer.soundTransform.pan);
gotoAndStop("off");
} else {
SoundMixer.soundTransform = new SoundTransform(1, SoundMixer.soundTransform.pan);
gotoAndStop("on");
};
};
}
}
}//package
Section 65
//Squash (Squash)
package {
public dynamic class Squash extends DragCopy {
public function Squash(){
addFrameScript(33, frame34, 39, frame40, 60, frame61);
}
function frame34(){
stop();
}
function frame40(){
stop();
}
function frame61(){
gotoAndStop("done");
}
}
}//package
Section 66
//Tomato (Tomato)
package {
public dynamic class Tomato extends DragCopy {
public function Tomato(){
addFrameScript(40, frame41, 46, frame47, 71, frame72);
}
function frame72(){
gotoAndStop("done");
}
function frame47(){
stop();
}
function frame41(){
stop();
}
}
}//package
Section 67
//Toolbar (Toolbar)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.printing.*;
public class Toolbar extends MovieClip {
public var nameField:TextField;
public var printButton:ClipButton;
public var soundToggle:SoundToggle;
public var resetButton:ClipButton;
public var soundManager:SimpleSoundManager;
public var resetCheck:MovieClip;
public function Toolbar(){
addEventListener(Event.ADDED_TO_STAGE, Ready);
soundManager = new SimpleSoundManager();
}
function ResetCheck(_arg1:MouseEvent){
soundManager.play("fxTinkle");
this.resetCheck.visible = true;
resetCheck.addEventListener(MouseEvent.CLICK, Reset);
}
function Reset(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:uint;
if (_arg1.target.name == "confirmReset"){
_local2 = MovieClip(parent);
_local3 = _local2.container.numChildren;
while (_local3--) {
_local2.container.removeChildAt(_local3);
};
if (_local2.palette.bonus.active){
_local2.palette.bonus.active = false;
_local2.palette.bonus.gotoAndStop("hide");
_local2.palette.bonus.bonusNum = 0;
};
this.resetCheck.visible = false;
soundManager.play("fxSubmit");
} else {
if (_arg1.target.name == "cancelReset"){
this.resetCheck.visible = false;
soundManager.play("fxDeleteKey");
};
};
}
function Ready(_arg1:Event){
this.resetCheck.visible = false;
printButton.addEventListener(MouseEvent.CLICK, Print);
resetButton.addEventListener(MouseEvent.CLICK, ResetCheck);
nameField.mouseEnabled = false;
mouseEnabled = false;
}
function Print(_arg1:MouseEvent){
var _local2:PrintJob;
var _local3:PrintJobOptions;
var _local4:MovieClip;
_local2 = new PrintJob();
_local3 = new PrintJobOptions();
_local4 = MovieClip(parent);
_local3.printAsBitmap = true;
if (_local2.start()){
_local4.printback.visible = true;
this.soundToggle.visible = false;
this.printButton.visible = false;
this.resetButton.visible = false;
_local4.palette.visible = false;
_local4.trash.visible = false;
if (_local2.orientation != PrintJobOrientation.LANDSCAPE){
_local4.rotation = 90;
};
_local2.addPage(_local4, null, _local3);
_local2.send();
} else {
_local2 = null;
};
_local4.rotation = 0;
_local4.printback.visible = false;
this.soundToggle.visible = true;
this.printButton.visible = true;
this.resetButton.visible = true;
_local4.palette.visible = true;
_local4.trash.visible = true;
_local2 = null;
}
function LaunchGames(_arg1:MouseEvent){
Link.getURL("games.html", "_self");
}
}
}//package
Section 68
//Windchime (Windchime)
package {
public dynamic class Windchime extends DragCopy {
public function Windchime(){
addFrameScript(30, frame31, 36, frame37, 57, frame58);
}
function frame37(){
stop();
}
function frame58(){
gotoAndStop("done");
}
function frame31(){
stop();
}
}
}//package
Section 69
//voCabbage (voCabbage)
package {
import flash.media.*;
public dynamic class voCabbage extends Sound {
}
}//package
Section 70
//voCarrot (voCarrot)
package {
import flash.media.*;
public dynamic class voCarrot extends Sound {
}
}//package
Section 71
//voFriendshipGarden (voFriendshipGarden)
package {
import flash.media.*;
public dynamic class voFriendshipGarden extends Sound {
}
}//package
Section 72
//voGameIntro (voGameIntro)
package {
import flash.media.*;
public dynamic class voGameIntro extends Sound {
}
}//package
Section 73
//voHeresSomething (voHeresSomething)
package {
import flash.media.*;
public dynamic class voHeresSomething extends Sound {
}
}//package
Section 74
//voKeepPlanting (voKeepPlanting)
package {
import flash.media.*;
public dynamic class voKeepPlanting extends Sound {
}
}//package
Section 75
//voLettuce (voLettuce)
package {
import flash.media.*;
public dynamic class voLettuce extends Sound {
}
}//package
Section 76
//voNameInput (voNameInput)
package {
import flash.media.*;
public dynamic class voNameInput extends Sound {
}
}//package
Section 77
//voPinkTulip (voPinkTulip)
package {
import flash.media.*;
public dynamic class voPinkTulip extends Sound {
}
}//package
Section 78
//voPromptGoodJob (voPromptGoodJob)
package {
import flash.media.*;
public dynamic class voPromptGoodJob extends Sound {
}
}//package
Section 79
//voPromptKeepPlanting (voPromptKeepPlanting)
package {
import flash.media.*;
public dynamic class voPromptKeepPlanting extends Sound {
}
}//package
Section 80
//voPromptPrettyGarden (voPromptPrettyGarden)
package {
import flash.media.*;
public dynamic class voPromptPrettyGarden extends Sound {
}
}//package
Section 81
//voPromptPrettyPlants (voPromptPrettyPlants)
package {
import flash.media.*;
public dynamic class voPromptPrettyPlants extends Sound {
}
}//package
Section 82
//voPurpleTulip (voPurpleTulip)
package {
import flash.media.*;
public dynamic class voPurpleTulip extends Sound {
}
}//package
Section 83
//voRedTulip (voRedTulip)
package {
import flash.media.*;
public dynamic class voRedTulip extends Sound {
}
}//package
Section 84
//voSquash (voSquash)
package {
import flash.media.*;
public dynamic class voSquash extends Sound {
}
}//package
Section 85
//voTomato (voTomato)
package {
import flash.media.*;
public dynamic class voTomato extends Sound {
}
}//package
Section 86
//voYellowPepper (voYellowPepper)
package {
import flash.media.*;
public dynamic class voYellowPepper extends Sound {
}
}//package
Section 87
//YellowPepper (YellowPepper)
package {
public dynamic class YellowPepper extends DragCopy {
public function YellowPepper(){
addFrameScript(23, frame24, 29, frame30, 51, frame52);
}
function frame24(){
stop();
}
function frame30(){
stop();
}
function frame52(){
gotoAndStop("done");
}
}
}//package