Section 1
//BlindsClip (assets.BlindsClip)
package assets {
import flash.display.*;
public dynamic class BlindsClip extends Sprite {
}
}//package assets
Section 2
//BookmarkIcon_0 (assets.BookmarkIcon_0)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_0 extends Sprite {
}
}//package assets
Section 3
//BookmarkIcon_1 (assets.BookmarkIcon_1)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_1 extends Sprite {
}
}//package assets
Section 4
//BookmarkIcon_2 (assets.BookmarkIcon_2)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_2 extends Sprite {
}
}//package assets
Section 5
//BookmarkIcon_3 (assets.BookmarkIcon_3)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_3 extends Sprite {
}
}//package assets
Section 6
//BookmarkIcon_4 (assets.BookmarkIcon_4)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_4 extends Sprite {
}
}//package assets
Section 7
//BookmarkIcon_5 (assets.BookmarkIcon_5)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_5 extends Sprite {
}
}//package assets
Section 8
//BookmarkIcon_6 (assets.BookmarkIcon_6)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_6 extends Sprite {
}
}//package assets
Section 9
//BookmarkIcon_7 (assets.BookmarkIcon_7)
package assets {
import flash.display.*;
public dynamic class BookmarkIcon_7 extends Sprite {
}
}//package assets
Section 10
//BubbleClip (assets.BubbleClip)
package assets {
import flash.display.*;
public dynamic class BubbleClip extends Sprite {
public var bubble_food:MovieClip;
}
}//package assets
Section 11
//CatalogClip (assets.CatalogClip)
package assets {
import flash.display.*;
import flash.text.*;
public dynamic class CatalogClip extends MovieClip {
public var _info_field:TextField;
}
}//package assets
Section 12
//ChefClip (assets.ChefClip)
package assets {
import flash.display.*;
public dynamic class ChefClip extends MovieClip {
}
}//package assets
Section 13
//ClosedSignClip (assets.ClosedSignClip)
package assets {
import pdiner2.game.entityViews.*;
public dynamic class ClosedSignClip extends EntityViewAnimationClient {
}
}//package assets
Section 14
//ComicPage_0 (assets.ComicPage_0)
package assets {
import flash.display.*;
public dynamic class ComicPage_0 extends Sprite {
}
}//package assets
Section 15
//ComicPage_1 (assets.ComicPage_1)
package assets {
import flash.display.*;
public dynamic class ComicPage_1 extends Sprite {
}
}//package assets
Section 16
//ComicPage_10 (assets.ComicPage_10)
package assets {
import flash.display.*;
public dynamic class ComicPage_10 extends Sprite {
}
}//package assets
Section 17
//ComicPage_11 (assets.ComicPage_11)
package assets {
import flash.display.*;
public dynamic class ComicPage_11 extends Sprite {
}
}//package assets
Section 18
//ComicPage_12 (assets.ComicPage_12)
package assets {
import flash.display.*;
public dynamic class ComicPage_12 extends Sprite {
}
}//package assets
Section 19
//ComicPage_13 (assets.ComicPage_13)
package assets {
import flash.display.*;
public dynamic class ComicPage_13 extends Sprite {
}
}//package assets
Section 20
//ComicPage_14 (assets.ComicPage_14)
package assets {
import flash.display.*;
public dynamic class ComicPage_14 extends Sprite {
}
}//package assets
Section 21
//ComicPage_15 (assets.ComicPage_15)
package assets {
import flash.display.*;
public dynamic class ComicPage_15 extends Sprite {
}
}//package assets
Section 22
//ComicPage_2 (assets.ComicPage_2)
package assets {
import flash.display.*;
public dynamic class ComicPage_2 extends Sprite {
}
}//package assets
Section 23
//ComicPage_3 (assets.ComicPage_3)
package assets {
import flash.display.*;
public dynamic class ComicPage_3 extends Sprite {
}
}//package assets
Section 24
//ComicPage_4 (assets.ComicPage_4)
package assets {
import flash.display.*;
public dynamic class ComicPage_4 extends Sprite {
}
}//package assets
Section 25
//ComicPage_5 (assets.ComicPage_5)
package assets {
import flash.display.*;
public dynamic class ComicPage_5 extends Sprite {
}
}//package assets
Section 26
//ComicPage_6 (assets.ComicPage_6)
package assets {
import flash.display.*;
public dynamic class ComicPage_6 extends Sprite {
}
}//package assets
Section 27
//ComicPage_7 (assets.ComicPage_7)
package assets {
import flash.display.*;
public dynamic class ComicPage_7 extends Sprite {
}
}//package assets
Section 28
//ComicPage_8 (assets.ComicPage_8)
package assets {
import flash.display.*;
public dynamic class ComicPage_8 extends Sprite {
}
}//package assets
Section 29
//ComicPage_9 (assets.ComicPage_9)
package assets {
import flash.display.*;
public dynamic class ComicPage_9 extends Sprite {
}
}//package assets
Section 30
//CounterClip (assets.CounterClip)
package assets {
import flash.display.*;
import flash.text.*;
public dynamic class CounterClip extends Sprite {
public var goal_text_field:TextField;
public var decoration:MovieClip;
public var current_text_field:TextField;
}
}//package assets
Section 31
//CoupleBonusClip (assets.CoupleBonusClip)
package assets {
import flash.display.*;
public dynamic class CoupleBonusClip extends Sprite {
}
}//package assets
Section 32
//GameWonBack (assets.GameWonBack)
package assets {
import flash.display.*;
public dynamic class GameWonBack extends Sprite {
}
}//package assets
Section 33
//GuestClip (assets.GuestClip)
package assets {
import flash.display.*;
public dynamic class GuestClip extends MovieClip {
}
}//package assets
Section 34
//IcyBackground (assets.IcyBackground)
package assets {
import flash.display.*;
public dynamic class IcyBackground extends Sprite {
}
}//package assets
Section 35
//InstructionsClip (assets.InstructionsClip)
package assets {
import flash.display.*;
public dynamic class InstructionsClip extends MovieClip {
}
}//package assets
Section 36
//MainMenuBack (assets.MainMenuBack)
package assets {
import flash.display.*;
public dynamic class MainMenuBack extends Sprite {
}
}//package assets
Section 37
//MapBack (assets.MapBack)
package assets {
import flash.display.*;
public dynamic class MapBack extends Sprite {
public var icon_stage_0:MovieClip;
public var icon_stage_1:MovieClip;
public var icon_stage_2:MovieClip;
public var icon_stage_3:MovieClip;
}
}//package assets
Section 38
//MochiPreloader (assets.MochiPreloader)
package assets {
import flash.display.*;
public dynamic class MochiPreloader extends Sprite {
public var loader:MovieClip;
}
}//package assets
Section 39
//Penny_uniform_bakerStreet (assets.Penny_uniform_bakerStreet)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_bakerStreet extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var flügel_v:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
public var kopf_s:MovieClip;
}
}//package assets
Section 40
//Penny_uniform_blackTie (assets.Penny_uniform_blackTie)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_blackTie extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var flügel_v:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
public var kopf_s:MovieClip;
public var kopf_v:MovieClip;
}
}//package assets
Section 41
//Penny_uniform_carribean (assets.Penny_uniform_carribean)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_carribean extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var flügel_v:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
public var kopf_s:MovieClip;
public var kopf_v:MovieClip;
}
}//package assets
Section 42
//Penny_uniform_eco (assets.Penny_uniform_eco)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_eco extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var plate_left:MovieClip;
public var flügel:MovieClip;
public var plate_right:MovieClip;
}
}//package assets
Section 43
//Penny_uniform_hats (assets.Penny_uniform_hats)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_hats extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var flügel_v:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
}
}//package assets
Section 44
//Penny_uniform_paris (assets.Penny_uniform_paris)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_paris extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var flügel_v:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
public var kopf_s:MovieClip;
public var kopf_v:MovieClip;
}
}//package assets
Section 45
//Penny_uniform_standard (assets.Penny_uniform_standard)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_standard extends MovieClip {
public var head_15:MovieClip;
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var head_16:MovieClip;
public var flügel_v2:MovieClip;
public var plate_left:MovieClip;
public var head_4:MovieClip;
public var head_7:MovieClip;
public var head_8:MovieClip;
public var head_9:MovieClip;
public var flügel:MovieClip;
public var head_1:MovieClip;
public var flügel_v:MovieClip;
public var head_3:MovieClip;
public var plate_right:MovieClip;
public var head_2:MovieClip;
public var head_10:MovieClip;
public var head_13:MovieClip;
public var head_11:MovieClip;
public var head_14:MovieClip;
}
}//package assets
Section 46
//Penny_uniform_sushiQueen (assets.Penny_uniform_sushiQueen)
package assets {
import flash.display.*;
public dynamic class Penny_uniform_sushiQueen extends MovieClip {
public var foot_right:MovieClip;
public var foot_left:MovieClip;
public var plate_left:MovieClip;
public var eyes_2:penny_eyes_down;
public var flügel:MovieClip;
public var eyes_1:penny_eyes_side;
public var plate_right:MovieClip;
}
}//package assets
Section 47
//PlateClip (assets.PlateClip)
package assets {
import flash.display.*;
public dynamic class PlateClip extends MovieClip {
}
}//package assets
Section 48
//RoomBackground (assets.RoomBackground)
package assets {
import flash.display.*;
public dynamic class RoomBackground extends Sprite {
public var clocks:MovieClip;
public var lights:MovieClip;
public var pictures:MovieClip;
public var curtains:MovieClip;
public var animated_background:MovieClip;
public var entertainment:MovieClip;
public var carpet:MovieClip;
public var atmospheric:MovieClip;
}
}//package assets
Section 49
//StarResult (assets.StarResult)
package assets {
import flash.display.*;
public dynamic class StarResult extends Sprite {
}
}//package assets
Section 50
//TableClip (assets.TableClip)
package assets {
import flash.display.*;
public dynamic class TableClip extends Sprite {
public var seats:MovieClip;
public var plate_right_clip:PlateClip;
public var table_cloth:MovieClip;
public var money_clip:MovieClip;
public var flowers:MovieClip;
public var plate_left_clip:PlateClip;
public var table:MovieClip;
}
}//package assets
Section 51
//TrashbinClip (assets.TrashbinClip)
package assets {
import flash.display.*;
public dynamic class TrashbinClip extends Sprite {
}
}//package assets
Section 52
//TwoDPlayButtonIcon (assets.TwoDPlayButtonIcon)
package assets {
import flash.display.*;
public dynamic class TwoDPlayButtonIcon extends Sprite {
}
}//package assets
Section 53
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
}
}//package com.adobe.crypto
Section 54
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 55
//AbstractApplication (com.bigwigmedia.application.AbstractApplication)
package com.bigwigmedia.application {
import flash.display.*;
import com.bigwigmedia.transitions.*;
import flash.events.*;
import com.bigwigmedia.preloaders.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.core.*;
import flash.system.*;
public class AbstractApplication extends MovieClip implements IApplication {
protected var _cursorHolder:Sprite;
private var _info:ApplicationInfo;
protected var _mask:Sprite;
protected var _background:Sprite;
protected var _mainView:DisplayObjectContainer;
protected var _transition:AbstractTransition;
protected var _preloader:AbstractPreloader;
public function AbstractApplication(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String=null){
ApplicationGlobals.bigwigmedia_ns::_application = this;
_info = new ApplicationInfo(_arg1, _arg2, _arg3, _arg4, _arg5);
stop();
if (((root) && (root.loaderInfo))){
root.loaderInfo.addEventListener(Event.INIT, onRootInitHandler);
};
}
protected function createMask(_arg1:uint=0):void{
if (_mask){
return;
};
_mask = new Sprite();
var _local2:Graphics = _mask.graphics;
_local2.lineStyle();
_local2.beginFill(_arg1, 1);
var _local3:int = nominalWidth;
var _local4:int = nominalHeight;
_local2.moveTo(0, 0);
_local2.lineTo(_local3, 0);
_local2.lineTo(_local3, _local4);
_local2.lineTo(0, _local4);
_local2.lineTo(0, 0);
var _local5:int = ((maxScreenWidth - _local3) / 2);
var _local6:int = ((maxScreenHeight - _local4) / 2);
_local2.moveTo(-(_local5), -(_local6));
_local2.lineTo((_local3 + _local5), -(_local6));
_local2.lineTo((_local3 + _local5), (_local4 + _local6));
_local2.lineTo(-(_local5), (_local4 + _local6));
_local2.lineTo(-(_local5), -(_local6));
_local2.endFill();
addChild(_mask);
sortChildren();
}
public function createTransition(_arg1:AbstractTransition):void{
if (_transition){
return;
};
_transition = _arg1;
_transition.addEventListener(Event.COMPLETE, onTransitionCompleteHandler);
addChild(_transition);
sortChildren();
_transition.start();
}
private function initialize():void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = "";
dispatchEvent(new ApplicationEvent(ApplicationEvent.INIT));
}
protected function fillBackground(_arg1:uint=0):void{
if (!_background){
_background = new Sprite();
addChild(_background);
sortChildren();
};
var _local2:Graphics = _background.graphics;
_local2.clear();
_local2.lineStyle();
_local2.beginFill(_arg1, 1);
_local2.drawRect(0, 0, nominalWidth, nominalHeight);
_local2.endFill();
}
protected function loadingComplete():void{
dispatchEvent(new ApplicationEvent(ApplicationEvent.READY));
}
protected function removeMask():void{
if (_mask){
removeChild(_mask);
_mask = null;
};
}
protected function createMainView(_arg1:Object):void{
var _local2:Class;
if (_mainView){
return;
};
if ((_arg1 is Class)){
_local2 = (_arg1 as Class);
_mainView = new (_local2);
} else {
if ((_arg1 is DisplayObjectContainer)){
_mainView = (_arg1 as DisplayObjectContainer);
} else {
throw (new ArgumentError("Parameter view must be Class or DisplayObjectContainer object."));
};
};
addChild(_mainView);
sortChildren();
}
private function onRootInitHandler(_arg1:Event):void{
root.loaderInfo.removeEventListener(Event.INIT, onRootInitHandler);
if (stage){
initialize();
} else {
addEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler);
};
}
private function onTransitionCompleteHandler(_arg1:Event):void{
removeTransition();
}
public function get nominalHeight():int{
return (loaderInfo.height);
}
public function get cursorHolder():Sprite{
if (!_cursorHolder){
_cursorHolder = new Sprite();
_cursorHolder.mouseEnabled = false;
_cursorHolder.mouseChildren = false;
addChild(_cursorHolder);
sortChildren();
};
return (_cursorHolder);
}
public function get info():ApplicationInfo{
return (_info);
}
protected function get maxScreenWidth():int{
return (Capabilities.screenResolutionX);
}
protected function get maxScreenHeight():int{
return (Capabilities.screenResolutionY);
}
protected function startPreloading(_arg1:AbstractPreloader=null):void{
if (_preloader){
return;
};
_preloader = ((_arg1) || (new EmptyPreloader()));
addChild(_preloader);
_preloader.addEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler);
}
protected function sortChildren():void{
var _local5:DisplayObject;
var _local1:Array = childrenSortList;
var _local2:int = _local1.length;
var _local3:int;
var _local4:int;
while (_local4 < _local2) {
_local5 = _local1[_local4];
if (_local5){
var _temp1 = _local3;
_local3 = (_local3 + 1);
setChildIndex(_local5, _temp1);
};
_local4++;
};
}
private function onAddedToStageHandler(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler);
initialize();
}
public function get nominalWidth():int{
return (loaderInfo.width);
}
public function getURLVariable(_arg1:String, _arg2:Boolean=false):String{
var _local4:String;
var _local5:String;
var _local3:Object = loaderInfo.parameters;
if (_arg2){
return (_local3[_arg1]);
};
_local4 = _arg1.toLowerCase();
for (_local5 in _local3) {
if (_local5.toLowerCase() == _local4){
return (_local3[_local5]);
};
};
return (null);
}
private function preloadingCompleteHandler(_arg1:PreloaderEvent):void{
_preloader.removeEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler);
nextFrame();
dispatchEvent(new ApplicationEvent(ApplicationEvent.LOAD_COMPLETE));
loadingComplete();
}
protected function clearBackground():void{
if (_background){
_background.graphics.clear();
};
}
public function getClassByName(_arg1:String):Class{
var _local2:ApplicationDomain = loaderInfo.applicationDomain;
if (_local2.hasDefinition(_arg1)){
return ((_local2.getDefinition(_arg1) as Class));
};
return (null);
}
public function get nominalFrameRate():Number{
return (loaderInfo.frameRate);
}
public function removeTransition():void{
if (_transition){
_transition.removeEventListener(Event.COMPLETE, onTransitionCompleteHandler);
removeChild(_transition);
_transition.dispose();
_transition = null;
};
}
protected function get childrenSortList():Array{
var _local1:Array = [_background, _mainView, _preloader, _transition, _mask, _cursorHolder];
return (_local1);
}
public function get mainView():DisplayObjectContainer{
return (_mainView);
}
}
}//package com.bigwigmedia.application
Section 56
//AbstractApplication_2DPLay (com.bigwigmedia.application.AbstractApplication_2DPLay)
package com.bigwigmedia.application {
public class AbstractApplication_2DPLay extends AbstractApplication {
public function AbstractApplication_2DPLay(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
}
final public function getBigWigWrappedGameData():Object{
var _local1:Object = {url:loaderInfo.url, gameid:info.id, affid:loaderInfo.parameters.affid};
return (_local1);
}
}
}//package com.bigwigmedia.application
Section 57
//ApplicationGlobals (com.bigwigmedia.application.ApplicationGlobals)
package com.bigwigmedia.application {
import com.bigwigmedia.core.*;
public class ApplicationGlobals {
bigwigmedia_ns static var _application:IApplication;
public static function get application():IApplication{
return (bigwigmedia_ns::_application);
}
}
}//package com.bigwigmedia.application
Section 58
//ApplicationInfo (com.bigwigmedia.application.ApplicationInfo)
package com.bigwigmedia.application {
public class ApplicationInfo {
private var _sharedObjectPath:String;
private var _name:String;
private var _sharedObjectName:String;
private var _version:String;
private var _id:String;
public function ApplicationInfo(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String){
_name = _arg1;
_id = _arg2;
_version = _arg3;
_sharedObjectName = _arg4;
_sharedObjectPath = _arg5;
}
public function get id():String{
return (_id);
}
public function get sharedObjectPath():String{
return (_sharedObjectPath);
}
public function get name():String{
return (_name);
}
public function get sharedObjectName():String{
return (_sharedObjectName);
}
public function get version():String{
return (_version);
}
}
}//package com.bigwigmedia.application
Section 59
//IApplication (com.bigwigmedia.application.IApplication)
package com.bigwigmedia.application {
import flash.display.*;
import com.bigwigmedia.transitions.*;
import flash.events.*;
public interface IApplication extends IEventDispatcher {
function get cursorHolder():Sprite;
function get nominalHeight():int;
function getClassByName(_arg1:String):Class;
function get mainView():DisplayObjectContainer;
function get nominalWidth():int;
function get info():ApplicationInfo;
function createTransition(_arg1:AbstractTransition):void;
function getURLVariable(_arg1:String, _arg2:Boolean=false):String;
function get nominalFrameRate():Number;
function removeTransition():void;
function get stage():Stage;
}
}//package com.bigwigmedia.application
Section 60
//bigwigmedia_ns (com.bigwigmedia.core.bigwigmedia_ns)
package com.bigwigmedia.core {
public namespace bigwigmedia_ns = "http://www.bigwigmedia.com/flash/as3/namespace";
}//package com.bigwigmedia.core
Section 61
//IDisposable (com.bigwigmedia.core.IDisposable)
package com.bigwigmedia.core {
public interface IDisposable {
function dispose():void;
}
}//package com.bigwigmedia.core
Section 62
//IUpdatable (com.bigwigmedia.core.IUpdatable)
package com.bigwigmedia.core {
public interface IUpdatable {
function update():void;
}
}//package com.bigwigmedia.core
Section 63
//Singleton (com.bigwigmedia.core.Singleton)
package com.bigwigmedia.core {
public class Singleton {
private static var interfaceToClassHash:Object = {};
private static var interfaceToInstanceHash:Object = {};
public static function getClass(_arg1:String):Class{
return (interfaceToClassHash[_arg1]);
}
public static function registerClass(_arg1:String, _arg2:Class):void{
var _local3:Class = interfaceToClassHash[_arg1];
if (!_local3){
interfaceToClassHash[_arg1] = _arg2;
};
}
public static function getInstance(_arg1:String):Object{
var _local2:Object = interfaceToInstanceHash[_arg1];
if (_local2){
return (_local2);
};
var _local3:Class = interfaceToClassHash[_arg1];
if (!_local3){
throw (new Error((("No class registered for interface \"" + _arg1) + "\".")));
};
_local3.bigwigmedia_ns::singletonAccessor = true;
_local2 = new (_local3);
_local3.bigwigmedia_ns::singletonAccessor = true;
interfaceToInstanceHash[_arg1] = _local2;
return (_local2);
}
}
}//package com.bigwigmedia.core
Section 64
//ColorBeacon (com.bigwigmedia.display.ColorBeacon)
package com.bigwigmedia.display {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.motion.*;
public class ColorBeacon implements IBeacon {
private var _multiplier:Number;
private var _color:uint;
private var _colorTransform:Color;
private var _frameCounter:Number;// = 0
private var _target:DisplayObject;
private var _dFrameCounter:Number;
private var _period:int;
public function ColorBeacon(_arg1:uint, _arg2:Number=1, _arg3:int=30){
_colorTransform = new Color();
super();
_color = _arg1;
_multiplier = _arg2;
_period = _arg3;
_colorTransform.tintColor = _arg1;
_dFrameCounter = ((2 * Math.PI) / _arg3);
}
public function remove(_arg1:DisplayObject):void{
dispose();
}
public function clone():IBeacon{
return (new ColorBeacon(_color, _multiplier, _period));
}
public function apply(_arg1:DisplayObject):void{
_target = _arg1;
_target.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
private function onEnterFrameHandler(_arg1:Event):void{
_colorTransform.tintMultiplier = ((_multiplier / 2) * (1 + Math.sin(_frameCounter)));
_target.transform.colorTransform = _colorTransform;
_frameCounter = (_frameCounter + _dFrameCounter);
if (_frameCounter >= (2 * Math.PI)){
_frameCounter = 0;
};
}
public function dispose():void{
_target.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
_target.transform.colorTransform = new ColorTransform();
_target = null;
}
}
}//package com.bigwigmedia.display
Section 65
//ColorDecoration (com.bigwigmedia.display.ColorDecoration)
package com.bigwigmedia.display {
import flash.display.*;
import flash.geom.*;
public class ColorDecoration implements IDecoration {
private var _colorTransform:ColorTransform;
public function ColorDecoration(_arg1:ColorTransform){
_colorTransform = _arg1;
}
public function remove(_arg1:DisplayObject):void{
_arg1.transform.colorTransform = new ColorTransform();
}
public function apply(_arg1:DisplayObject):void{
_arg1.transform.colorTransform = _colorTransform;
}
}
}//package com.bigwigmedia.display
Section 66
//FilterDecoration (com.bigwigmedia.display.FilterDecoration)
package com.bigwigmedia.display {
import flash.display.*;
import flash.filters.*;
import com.bigwigmedia.ui2.utils.*;
public class FilterDecoration implements IDecoration {
private var _filters:Array;
public function FilterDecoration(_arg1:Array){
var _local4:BitmapFilter;
_filters = [];
super();
var _local2:int = _arg1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _arg1[_local3];
_filters.push(_local4.clone());
_local3++;
};
}
public function remove(_arg1:DisplayObject):void{
_arg1.filters = [];
}
public function apply(_arg1:DisplayObject):void{
_arg1.filters = _filters;
}
public static function fromString(_arg1:String):Object{
var _local4:String;
var _local2:Array = _arg1.split(" ");
var _local3:Array = [];
for each (_local4 in _local2) {
_local3.push(StyleUtil.filterFromString(_local4));
};
return (new FilterDecoration(_local3));
}
}
}//package com.bigwigmedia.display
Section 67
//IBeacon (com.bigwigmedia.display.IBeacon)
package com.bigwigmedia.display {
import com.bigwigmedia.core.*;
public interface IBeacon extends IDecoration, IDisposable {
function clone():IBeacon;
}
}//package com.bigwigmedia.display
Section 68
//IDecoration (com.bigwigmedia.display.IDecoration)
package com.bigwigmedia.display {
import flash.display.*;
public interface IDecoration {
function remove(_arg1:DisplayObject):void;
function apply(_arg1:DisplayObject):void;
}
}//package com.bigwigmedia.display
Section 69
//TintDecoration (com.bigwigmedia.display.TintDecoration)
package com.bigwigmedia.display {
import fl.motion.*;
public class TintDecoration extends ColorDecoration implements IDecoration {
public function TintDecoration(_arg1:uint, _arg2:Number){
var _local3:Color = new Color();
_local3.setTint(_arg1, _arg2);
super(_local3);
}
}
}//package com.bigwigmedia.display
Section 70
//ApplicationEvent (com.bigwigmedia.events.ApplicationEvent)
package com.bigwigmedia.events {
import flash.events.*;
public class ApplicationEvent extends Event {
public static const INIT:String = "ApplicationEvent.init";
public static const LOAD_COMPLETE:String = "ApplicationEvent.loadComplete";
public static const READY:String = "ApplicationEvent.ready";
public function ApplicationEvent(_arg1:String){
super(_arg1, false, false);
}
override public function toString():String{
return (formatToString("ApplicationEvent", "type"));
}
override public function clone():Event{
return (new ApplicationEvent(type));
}
}
}//package com.bigwigmedia.events
Section 71
//ComponentEvent (com.bigwigmedia.events.ComponentEvent)
package com.bigwigmedia.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const BUTTON_DOWN:String = "ComponentEvent.buttonDown";
public static const CHANGE:String = "ComponentEvent.change";
public static const MOVE:String = "ComponentEvent.move";
public static const RESIZE:String = "ComponentEvent.resize";
public static const CLOSE:String = "ComponentEvent.close";
public static const SELECT:String = "ComponentEvent.select";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package com.bigwigmedia.events
Section 72
//EventPriority (com.bigwigmedia.events.EventPriority)
package com.bigwigmedia.events {
public class EventPriority {
public static const DEFAULT:int = 0;
public static const HIGH:int = 2000;
public static const LOW:int = -2000;
public static const LOWEST:int = -5000;
public static const HIGHEST:int = 5000;
}
}//package com.bigwigmedia.events
Section 73
//KeyInputEvent (com.bigwigmedia.events.KeyInputEvent)
package com.bigwigmedia.events {
import flash.events.*;
public class KeyInputEvent extends KeyboardEvent {
private var _keyAction:String;
public static const SEQUENCE:String = "KeyInputEvent.sequence";
public static const KEY_DOWN:String = "KeyInputEvent.keyDown";
public static const KEY_UP:String = "KeyInputEvent.keyUp";
public static const KEY_HOLD:String = "KeyInputEvent.keyHold";
public function KeyInputEvent(_arg1:String, _arg2:String, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:Boolean, _arg7:Boolean, _arg8:Boolean){
super(_arg1, false, false, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
_keyAction = _arg2;
}
override public function toString():String{
return (formatToString("KeyInputEvent", "type", "keyAction", "keyCode", "ctrlKey", "altKey", "shiftKey"));
}
public function get keyAction():String{
return (_keyAction);
}
override public function clone():Event{
return (new KeyInputEvent(type, keyAction, charCode, keyCode, keyLocation, ctrlKey, altKey, shiftKey));
}
}
}//package com.bigwigmedia.events
Section 74
//PreloaderEvent (com.bigwigmedia.events.PreloaderEvent)
package com.bigwigmedia.events {
import flash.events.*;
public class PreloaderEvent extends Event {
private var _percentLoaded:Number;
public static const COMPLETE:String = "PreloaderEvent.complete";
public static const PROGRESS:String = "PreloaderEvent.progress";
public function PreloaderEvent(_arg1:String, _arg2:Number){
super(_arg1, false, false);
_percentLoaded = _arg2;
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
override public function toString():String{
return (formatToString("PreloaderEvent", "type", "percentLoaded"));
}
override public function clone():Event{
return (new PreloaderEvent(type, _percentLoaded));
}
}
}//package com.bigwigmedia.events
Section 75
//TweenEvent (com.bigwigmedia.events.TweenEvent)
package com.bigwigmedia.events {
import flash.events.*;
public class TweenEvent extends Event {
public static const COMPLETE:String = "TweenEvent.complete";
public function TweenEvent(_arg1:String){
super(_arg1);
}
override public function toString():String{
return (formatToString("TweenEvent", "type"));
}
override public function clone():Event{
return (new TweenEvent(type));
}
}
}//package com.bigwigmedia.events
Section 76
//FontManager (com.bigwigmedia.font.FontManager)
package com.bigwigmedia.font {
import flash.system.*;
import flash.text.*;
import com.bigwigmedia.core.*;
import flash.errors.*;
public class FontManager implements IFontManager {
private var _domain:ApplicationDomain;
bigwigmedia_ns static var singletonAccessor:Boolean = false;
public function FontManager(){
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of FontManager."));
};
_domain = ApplicationDomain.currentDomain;
}
public function getFontNameByID(_arg1:String):String{
return (getFont(_arg1).fontName);
}
public function get domain():ApplicationDomain{
return (_domain);
}
private function getFont(_arg1:String):Font{
var _local2:Class = getFontClass(_arg1);
return ((new (_local2) as Font));
}
public function registerFonts(... _args):void{
var _local2:uint;
while (_local2 < _args.length) {
Font.registerFont(getFontClass(_args[_local2]));
_local2++;
};
}
public function set domain(_arg1:ApplicationDomain):void{
_domain = _arg1;
}
private function getFontClass(_arg1:String):Class{
if (_domain){
return ((_domain.getDefinition(_arg1) as Class));
};
return ((ApplicationDomain.currentDomain.getDefinition(_arg1) as Class));
}
}
}//package com.bigwigmedia.font
Section 77
//IFontManager (com.bigwigmedia.font.IFontManager)
package com.bigwigmedia.font {
import flash.system.*;
public interface IFontManager {
function set domain(_arg1:ApplicationDomain):void;
function registerFonts(... _args):void;
function getFontNameByID(_arg1:String):String;
function get domain():ApplicationDomain;
}
}//package com.bigwigmedia.font
Section 78
//KeyInputManager (com.bigwigmedia.input.KeyInputManager)
package com.bigwigmedia.input {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.core.*;
public class KeyInputManager extends EventDispatcher implements IDisposable {
private var actionToMapperHash:Object;
private var target:InteractiveObject;
private var keySequences:Object;
private var keycodeToMapperHash:Object;
public function KeyInputManager(_arg1:InteractiveObject){
actionToMapperHash = {};
keycodeToMapperHash = {};
keySequences = {};
super();
this.target = _arg1;
this.target.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);
this.target.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);
}
public function mapKey(_arg1:String, _arg2:uint):void{
var _local3:KeyMapper;
_local3 = keycodeToMapperHash[_arg2];
if (_local3){
unmapKey(_local3.keyAction);
};
_local3 = actionToMapperHash[_arg1];
if (_local3){
unmapKey(_arg1);
};
_local3 = new KeyMapper(_arg1, _arg2);
actionToMapperHash[_arg1] = _local3;
keycodeToMapperHash[_arg2] = _local3;
}
public function unmapSequence(_arg1:String):void{
delete keySequences[_arg1];
}
private function onKeyDownHandler(_arg1:KeyboardEvent):void{
var _local4:KeySequence;
var _local2:uint = _arg1.keyCode;
var _local3:KeyMapper = keycodeToMapperHash[_local2];
if (_local3){
dispatchEvent(new KeyInputEvent((_local3.isDown) ? KeyInputEvent.KEY_HOLD : KeyInputEvent.KEY_DOWN, _local3.keyAction, _arg1.charCode, _local2, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey));
_local3.isDown = true;
};
for each (_local4 in keySequences) {
if (_local4.checkNext(_local2)){
dispatchEvent(new KeyInputEvent(KeyInputEvent.SEQUENCE, _local4.keyAction, _arg1.charCode, _local2, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey));
};
};
}
public function dispose():void{
unmapAll();
target.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);
target.removeEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);
target = null;
}
private function onKeyUpHandler(_arg1:KeyboardEvent):void{
var _local2:KeyMapper = keycodeToMapperHash[_arg1.keyCode];
if (_local2){
if (_local2.isDown){
dispatchEvent(new KeyInputEvent(KeyInputEvent.KEY_UP, _local2.keyAction, _arg1.charCode, _arg1.keyCode, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey));
};
_local2.isDown = false;
};
}
public function isKeyMapped(_arg1:uint):Boolean{
return (keycodeToMapperHash[_arg1]);
}
public function isKeyDown(_arg1:String):Boolean{
var _local2:KeyMapper = actionToMapperHash[_arg1];
return (((_local2) && (_local2.isDown)));
}
public function unmapKey(_arg1:String):void{
var _local2:KeyMapper = actionToMapperHash[_arg1];
if (_local2){
delete actionToMapperHash[_arg1];
delete keycodeToMapperHash[_local2.keyCode];
};
}
public function mapSequence(_arg1:String, _arg2:Array):void{
keySequences[_arg1] = new KeySequence(_arg1, _arg2.slice());
}
public function unmapAll():void{
actionToMapperHash = {};
keycodeToMapperHash = {};
keySequences = {};
}
public function depressAll():void{
var _local1:KeyMapper;
for each (_local1 in actionToMapperHash) {
_local1.isDown = false;
};
}
}
}//package com.bigwigmedia.input
Section 79
//KeyMapper (com.bigwigmedia.input.KeyMapper)
package com.bigwigmedia.input {
class KeyMapper {
public var keyCode:uint;
public var keyAction:String;
public var isDown:Boolean;// = false
function KeyMapper(_arg1:String, _arg2:uint){
this.keyAction = _arg1;
this.keyCode = _arg2;
}
}
}//package com.bigwigmedia.input
Section 80
//KeySequence (com.bigwigmedia.input.KeySequence)
package com.bigwigmedia.input {
import com.bigwigmedia.input.*;
class KeySequence {
private var sequence:Array;
public var keyAction:String;
private var nextKeyIndex:int;// = 0
function KeySequence(_arg1:String, _arg2:Array){
this.keyAction = _arg1;
this.sequence = _arg2;
}
public function checkNext(_arg1:uint):Boolean{
if (sequence[nextKeyIndex] != _arg1){
nextKeyIndex = 0;
};
if (sequence[nextKeyIndex] == _arg1){
if (++nextKeyIndex == sequence.length){
nextKeyIndex = 0;
return (true);
};
};
return (false);
}
}
}//package com.bigwigmedia.input
Section 81
//BaseEntityEvent (com.bigwigmedia.mvc.events.BaseEntityEvent)
package com.bigwigmedia.mvc.events {
import flash.events.*;
import com.bigwigmedia.mvc.*;
public class BaseEntityEvent extends EntityNativeEvent {
public static const ADDED:String = "BaseEntityEvent.added";
public static const REMOVED:String = "BaseEntityEvent.removed";
public function BaseEntityEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new BaseEntityEvent(type, bubbles, cancelable));
}
}
}//package com.bigwigmedia.mvc.events
Section 82
//ControllerEvent (com.bigwigmedia.mvc.events.ControllerEvent)
package com.bigwigmedia.mvc.events {
import flash.events.*;
public class ControllerEvent extends Event {
private var _data:Object;
public static const COMPLETE:String = "ControllerEvent.complete";
public static const MESSAGE:String = "ControllerEvent.message";
public function ControllerEvent(_arg1:String, _arg2:Object=null){
super(_arg1);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new ControllerEvent(type, _data));
}
}
}//package com.bigwigmedia.mvc.events
Section 83
//Entity (com.bigwigmedia.mvc.Entity)
package com.bigwigmedia.mvc {
import com.bigwigmedia.mvc.events.*;
import flash.events.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import flash.errors.*;
public class Entity extends EventDispatcher implements IUpdatable, IDisposable {
public var name:String;
private var _bubbleParent:EntityContainer;
protected var _parent:EntityContainer;
private static var idCount:int = 0;
public function Entity(){
name = ("Entity_" + String(idCount++));
}
override public function dispatchEvent(_arg1:Event):Boolean{
if (_arg1.bubbles){
if ((_arg1 is EntityNativeEvent)){
return (_dispatchEvent((_arg1 as EntityNativeEvent)));
};
throw (new ArgumentError("Only EntityNativeEvent and its derived classes can bubble."));
};
return (super.dispatchEvent(_arg1));
}
private function _dispatchEvent(_arg1:EntityNativeEvent):Boolean{
var _local3:EntityContainer;
var _local4:EntityNativeEvent;
var _local2:Boolean;
if (hasEventListener(_arg1.type)){
_local2 = super.dispatchEvent(_arg1);
};
if (_arg1.bubbles){
_local3 = _bubbleParent;
while (((_local3) && (!(_arg1._stopped)))) {
if (_local3.hasEventListener(_arg1.type)){
_local4 = (_arg1.clone() as EntityNativeEvent);
_local4._target = this;
_local4._canceled = _local2;
_local4._eventPhase = EventPhase.BUBBLING_PHASE;
_local3.$dispatchEvent(new EventContainer(_local4));
_local2 = _local4._canceled;
};
_local3 = _local3._bubbleParent;
};
};
return (_local2);
}
public function dispose():void{
}
public function update():void{
}
public function get parent():EntityContainer{
return (_parent);
}
function setParent(_arg1:EntityContainer):void{
if (_parent == _arg1){
return;
};
if (((_parent) && (_arg1))){
throw (new IllegalOperationError("Entity can't be added twice."));
};
_parent = _arg1;
if (_arg1){
_bubbleParent = _arg1;
_dispatchEvent(new BaseEntityEvent(BaseEntityEvent.ADDED, true));
} else {
_dispatchEvent(new BaseEntityEvent(BaseEntityEvent.REMOVED, true));
_bubbleParent = _arg1;
};
}
override public function toString():String{
return (ObjectUtil.formatToString(this, "name"));
}
private function $dispatchEvent(_arg1:Event):Boolean{
return (super.dispatchEvent(_arg1));
}
}
}//package com.bigwigmedia.mvc
import flash.events.*;
final class EventContainer extends Event {
private var _event:Event;
private static const TARGET:Object = new Object();
private function EventContainer(_arg1:EntityNativeEvent){
super(_arg1.type, _arg1.bubbles, _arg1.cancelable);
_event = _arg1;
}
override public function get target():Object{
return (TARGET);
}
override public function clone():Event{
return (_event);
}
}
Section 84
//EntityContainer (com.bigwigmedia.mvc.EntityContainer)
package com.bigwigmedia.mvc {
public class EntityContainer extends Entity {
protected var _children:Array;
public function EntityContainer(){
_children = [];
super();
}
protected function childAdded(_arg1:Entity):void{
}
protected function childRemoved(_arg1:Entity):void{
}
public function removeChild(_arg1:Entity):Entity{
if (_arg1.parent != this){
throw (new ArgumentError("Supplied entity is not a child."));
};
var _local2:int = _children.indexOf(_arg1);
_children.splice(_local2, 1);
_arg1.setParent(null);
childRemoved(_arg1);
return (_arg1);
}
public function addChild(_arg1:Entity):Entity{
if (_arg1 == this){
throw (new ArgumentError("Entity can't be added as a child of itself."));
};
_children.push(_arg1);
_arg1.setParent(this);
childAdded(_arg1);
return (_arg1);
}
override public function dispose():void{
var _local1:Entity;
while (_children.length > 0) {
_local1 = _children.pop();
_local1.setParent(null);
_local1.dispose();
};
}
}
}//package com.bigwigmedia.mvc
Section 85
//EntityNativeEvent (com.bigwigmedia.mvc.EntityNativeEvent)
package com.bigwigmedia.mvc {
import flash.events.*;
public class EntityNativeEvent extends Event {
var _eventPhase:uint;
var _stopped:Boolean;// = false
var _target:Object;
var _canceled:Boolean;// = false
public function EntityNativeEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function get eventPhase():uint{
return (((_eventPhase) || (super.eventPhase)));
}
override public function isDefaultPrevented():Boolean{
return (_canceled);
}
override public function clone():Event{
return (new EntityNativeEvent(type, bubbles, cancelable));
}
override public function preventDefault():void{
if (cancelable){
_canceled = true;
};
}
override public function stopPropagation():void{
_stopped = true;
}
override public function get target():Object{
return (((_target) || (super.target)));
}
override public function stopImmediatePropagation():void{
super.stopImmediatePropagation();
_stopped = true;
}
}
}//package com.bigwigmedia.mvc
Section 86
//IController (com.bigwigmedia.mvc.IController)
package com.bigwigmedia.mvc {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.core.*;
public interface IController extends IEventDispatcher, IDisposable {
function get view():DisplayObject;
}
}//package com.bigwigmedia.mvc
Section 87
//ISOManager (com.bigwigmedia.net.ISOManager)
package com.bigwigmedia.net {
import flash.events.*;
public interface ISOManager extends IEventDispatcher {
function flush(_arg1:int=0):String;
function get dataEmpty():Boolean;
function getValue(_arg1:String);
function clear():void;
function setValue(_arg1:String, _arg2):void;
}
}//package com.bigwigmedia.net
Section 88
//IURLCaller (com.bigwigmedia.net.IURLCaller)
package com.bigwigmedia.net {
public interface IURLCaller {
function submitScore(_arg1:Object):void;
function mainLink():void;
function viewScores():void;
function playMoreGames():void;
function getURL(_arg1:String, _arg2:String="_blank"):void;
function downloadGame():void;
function getGame():void;
}
}//package com.bigwigmedia.net
Section 89
//SOManager (com.bigwigmedia.net.SOManager)
package com.bigwigmedia.net {
import flash.events.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import flash.net.*;
import com.bigwigmedia.application.*;
import flash.errors.*;
public class SOManager extends EventDispatcher implements ISOManager {
private var dataObject:Object;
private var so:SharedObject;
bigwigmedia_ns static var singletonAccessor:Boolean = false;
public function SOManager(){
super();
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of SOManager."));
};
try {
so = SharedObject.getLocal(ApplicationGlobals.application.info.sharedObjectName, ApplicationGlobals.application.info.sharedObjectPath);
so.addEventListener(NetStatusEvent.NET_STATUS, onNetStatusEventHandler);
dataObject = so.data;
} catch(e:Error) {
dataObject = {};
};
}
private function onNetStatusEventHandler(_arg1:NetStatusEvent):void{
dispatchEvent(_arg1.clone());
}
public function getValue(_arg1:String){
return (dataObject[_arg1]);
}
public function get dataEmpty():Boolean{
var _local1:Boolean = ObjectUtil.hasProperties(dataObject);
return (!(_local1));
}
public function flush(_arg1:int=0):String{
if (so){
return (so.flush(_arg1));
};
return (SharedObjectFlushStatus.FLUSHED);
}
public function clear():void{
var _local1:String;
if (so){
for (_local1 in dataObject) {
delete dataObject[_local1];
};
so.clear();
} else {
dataObject = {};
};
}
public function setValue(_arg1:String, _arg2):void{
dataObject[_arg1] = _arg2;
}
}
}//package com.bigwigmedia.net
Section 90
//URLCaller_2DPlay (com.bigwigmedia.net.URLCaller_2DPlay)
package com.bigwigmedia.net {
import com.bigwigmedia.application.*;
import com.bigwigmedia.core.*;
import com.adobe.crypto.*;
import flash.net.*;
import flash.errors.*;
public class URLCaller_2DPlay implements IURLCaller {
private var applicationID:String;
bigwigmedia_ns static var singletonAccessor:Boolean = false;
public function URLCaller_2DPlay(){
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of URLCaller_2DPlay."));
};
applicationID = ApplicationGlobals.application.info.id;
}
public function submitScore(_arg1:Object):void{
var _local2:String = MD5.hash((((("gameid=" + applicationID) + "&hiscore=") + _arg1.toString()) + "2DPlay.com/"));
var _local3:String = ((((("http://www.2DPlay.com/highscores.php?gameid=" + applicationID) + "&hiscore=") + _arg1.toString()) + "&hash=") + _local2);
getURL(_local3);
}
public function viewScores():void{
getURL(("http://www.2Dplay.com/showscores.php?gameid=" + applicationID));
}
public function getGame():void{
getURL("http://www.2DPlay.com/freecontent.htm");
}
public function mainLink():void{
getURL(("http://www.2DPlay.com/index.php?gameid=" + applicationID));
}
public function playMoreGames():void{
getURL(("http://www.2DPlay.com/index.php?gameid=" + applicationID));
}
public function getURL(_arg1:String, _arg2:String="_blank"):void{
navigateToURL(new URLRequest(_arg1), _arg2);
}
public function downloadGame():void{
getURL(("http://www.2DPlay.com/downloadgame.php?gameid=" + applicationID));
}
}
}//package com.bigwigmedia.net
Section 91
//AbstractPreloader (com.bigwigmedia.preloaders.AbstractPreloader)
package com.bigwigmedia.preloaders {
import flash.display.*;
public class AbstractPreloader extends Sprite {
public function get percentLoaded():Number{
if (!root){
return (0);
};
var _local1:uint = root.loaderInfo.bytesLoaded;
var _local2:uint = root.loaderInfo.bytesTotal;
if (_local2 == 0){
return (((_local1 > 0)) ? 1 : 0);
};
return ((_local1 / _local2));
}
}
}//package com.bigwigmedia.preloaders
Section 92
//EmptyPreloader (com.bigwigmedia.preloaders.EmptyPreloader)
package com.bigwigmedia.preloaders {
import flash.events.*;
import com.bigwigmedia.events.*;
import flash.utils.*;
public class EmptyPreloader extends AbstractPreloader {
private var timer:Timer;
public function EmptyPreloader(){
timer = new Timer(100);
timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler);
timer.start();
}
private function onTimerEventHandler(_arg1:TimerEvent):void{
if (percentLoaded == 1){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler);
timer = null;
dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE, 1));
};
}
}
}//package com.bigwigmedia.preloaders
Section 93
//Preloader_2DPlay (com.bigwigmedia.preloaders.Preloader_2DPlay)
package com.bigwigmedia.preloaders {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class Preloader_2DPlay extends AbstractPreloader {
private var ad:Sprite;
private var adLoader:Loader;
private var logoAnimationCompleted:Boolean;// = false
private var timer:Timer;
private var animation:MovieClip;
private var barCompleted:Boolean;// = false
public var _logo:MovieClip;
private var progressBar:MovieClip;
private var progressBarMask:MovieClip;
private var _appNominalWidth:Number;
private var _appNominalHeight:Number;
private var _appID:String;
public static const AD_WIDTH:Number = 400;
public static const NOMINAL_WIDTH:Number = 468;
public static const AD_HEIGHT:Number = 350;
public static const NOMINAL_HEIGHT:Number = 117;
public function Preloader_2DPlay(_arg1:Boolean=true){
var _local2:Class;
var _local3:Object;
logoAnimationCompleted = false;
barCompleted = false;
super();
_local2 = (getDefinitionByName("com.bigwigmedia.application.ApplicationGlobals") as Class);
_local3 = _local2["application"];
_appNominalWidth = _local3.nominalWidth;
_appNominalHeight = _local3.nominalHeight;
_appID = _local3.info.id;
_logo.visible = false;
animation = _logo.animation;
progressBar = _logo.progressBar;
progressBarMask = progressBar.progressBarMask;
animation.stop();
animation.mouseChildren = false;
animation.buttonMode = true;
animation.addEventListener(MouseEvent.CLICK, onLogoClickHandler);
progressBar.alpha = 0;
if (NOMINAL_WIDTH > _appNominalWidth){
_logo.scaleX = (_logo.scaleY = ((_appNominalWidth * 0.9) / NOMINAL_WIDTH));
};
_logo.x = ((_appNominalWidth - _logo.width) / 2);
_logo.y = ((_appNominalHeight - _logo.height) / 2);
if (Security.sandboxType == Security.LOCAL_WITH_FILE){
trace("Movie sandbox type is LOCAL WITH FILE. It can't participate in BigWig Media ad network.");
startLogoAnimation();
} else {
if (_arg1){
loadAd();
} else {
startLogoAnimation();
};
};
}
private function onLogoClickHandler(_arg1:MouseEvent):void{
var event = _arg1;
try {
navigateToURL(new URLRequest(("http://www.2DPlay.com/index.php?gameid=" + _appID)), "_blank");
} catch(error:Error) {
trace("Can't navigate to http://www.2DPlay.com.");
};
}
private function onAdCompleteHandler(_arg1:Event):void{
completeAd();
}
private function onTimerEventHandler(_arg1:TimerEvent):void{
var _local2:Number;
_local2 = percentLoaded;
progressBarMask.scaleX = _local2;
if (!logoAnimationCompleted){
if (animation.currentFrame == animation.totalFrames){
logoAnimationCompleted = true;
} else {
animation.nextFrame();
};
} else {
if (!barCompleted){
if (_local2 == 1){
barCompleted = true;
} else {
progressBar.alpha = (progressBar.alpha + 0.1);
if (progressBar.alpha >= 1){
barCompleted = true;
progressBar.alpha = 1;
};
};
} else {
if (_local2 == 1){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler);
timer = null;
animation.removeEventListener(MouseEvent.CLICK, onLogoClickHandler);
dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE, 1));
};
};
};
_arg1.updateAfterEvent();
}
private function completeAd():void{
adLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onAdLoadErrorHandler);
adLoader.contentLoaderInfo.sharedEvents.removeEventListener("BigwigInGameAdComplete", onAdCompleteHandler);
try {
adLoader.unload();
} catch(error:Error) {
};
ad.removeChild(adLoader);
adLoader = null;
removeChild(ad);
ad = null;
startLogoAnimation();
}
private function loadAd():void{
Security.allowDomain("adserver.bigwigmedia.com");
ad = new Sprite();
ad.graphics.lineStyle();
ad.graphics.beginFill(0xFFFFFF);
ad.graphics.drawRect(0, 0, AD_WIDTH, AD_HEIGHT);
ad.graphics.endFill();
if (AD_HEIGHT > _appNominalHeight){
ad.scaleX = (ad.scaleY = ((_appNominalHeight * 0.9) / AD_HEIGHT));
};
ad.x = ((_appNominalWidth - ad.width) / 2);
ad.y = ((_appNominalHeight - ad.height) / 2);
addChild(ad);
adLoader = new Loader();
adLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onAdLoadErrorHandler);
adLoader.contentLoaderInfo.sharedEvents.addEventListener("BigwigInGameAdComplete", onAdCompleteHandler);
ad.addChild(adLoader);
try {
adLoader.load(new URLRequest("http://adserver.bigwigmedia.com/ingamead3.swf"));
} catch(error:Error) {
trace("Resource http://adserver.bigwigmedia.com/ingamead3.swf is unavailable.");
completeAd();
};
}
private function onAdLoadErrorHandler(_arg1:IOErrorEvent):void{
completeAd();
}
private function startLogoAnimation():void{
graphics.lineStyle();
graphics.beginFill(2045285, 1);
graphics.drawRect(0, 0, _appNominalWidth, _appNominalHeight);
graphics.endFill();
_logo.visible = true;
timer = new Timer(33);
timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler);
timer.start();
}
}
}//package com.bigwigmedia.preloaders
Section 94
//Channel (com.bigwigmedia.sound.Channel)
package com.bigwigmedia.sound {
import com.bigwigmedia.events.*;
import com.bigwigmedia.tweens.*;
public class Channel {
private var _tween:ITween;
private var _transitionVolume:Number;// = 1
private var _recordsHash:Object;
private var _volume:Number;// = 1
private var _pan:Number;// = 0
public function Channel(){
_recordsHash = new Object();
super();
}
private function setTransitionVolume(_arg1:Number):void{
var _local2:Record;
_transitionVolume = _arg1;
for each (_local2 in _recordsHash) {
_local2.volume = _arg1;
};
}
public function set pan(_arg1:Number):void{
var _local2:Record;
_pan = _arg1;
for each (_local2 in _recordsHash) {
_local2.channelPan = _pan;
};
}
public function stop():void{
var _local1:Record;
stopTween();
for each (_local1 in _recordsHash) {
_local1.stop();
};
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
stopTween();
}
public function playNextSound(_arg1:String, _arg2:int, _arg3:Number, _arg4:Number):void{
stopTween();
if (playing){
_tween = new SequenceTween([new SetterTween(this, setTransitionVolume, _transitionVolume, 0, _arg3), new Action(this, _playNextSound, [_arg1, _arg2]), new SetterTween(this, setTransitionVolume, 0, 1, _arg4)]);
} else {
setTransitionVolume(0);
_tween = new SequenceTween([new Action(this, _playNextSound, [_arg1, _arg2]), new SetterTween(this, setTransitionVolume, 0, 1, _arg4)]);
};
_tween.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tween.playAuto();
}
private function stopTween():void{
if (_tween){
_tween.removeEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tween.dispose();
_tween = null;
};
}
private function _playNextSound(_arg1:String, _arg2:int):void{
var _local3:Record;
for each (_local3 in _recordsHash) {
_local3.stop();
};
if (_arg1){
_recordsHash[_arg1].play(_arg2);
};
}
public function set volume(_arg1:Number):void{
var _local2:Record;
_volume = _arg1;
for each (_local2 in _recordsHash) {
_local2.channelVolume = _volume;
};
}
public function get playing():Boolean{
var _local1:Record;
for each (_local1 in _recordsHash) {
if (_local1.playing){
return (true);
};
};
return (false);
}
public function unregisterSound(_arg1:String):void{
var _local2:Record = _recordsHash[_arg1];
if (_local2){
stopTween();
_local2.dispose();
delete _recordsHash[_arg1];
};
}
public function registerSound(_arg1:String, _arg2:Record):void{
if (!_recordsHash[_arg1]){
_arg2.channelVolume = _volume;
_arg2.channelPan = _pan;
_recordsHash[_arg1] = _arg2;
};
}
}
}//package com.bigwigmedia.sound
Section 95
//ISoundManager (com.bigwigmedia.sound.ISoundManager)
package com.bigwigmedia.sound {
public interface ISoundManager {
function stopChannel(_arg1:String):void;
function stop(_arg1:String):void;
function registerRecord(_arg1:String, _arg2:Class, _arg3:String="default_channel"):void;
function getChannel(_arg1:String):Channel;
function playNext(_arg1:String, _arg2:String=null, _arg3:int=1, _arg4:Number=60, _arg5:Number=60):void;
function setAllChannelsVolume(_arg1:Number):void;
function setPan(_arg1:String, _arg2:Number):void;
function playSingle(_arg1:String, _arg2:int=1):Boolean;
function unregisterRecord(_arg1:String):void;
function getRecord(_arg1:String):Record;
function play(_arg1:String, _arg2:int=1):void;
function setVolume(_arg1:String, _arg2:Number):void;
function set masterVolume(_arg1:Number):void;
function setChannelVolume(_arg1:String, _arg2:Number):void;
function setChannelPan(_arg1:String, _arg2:Number):void;
function get masterVolume():Number;
function stopAll():void;
}
}//package com.bigwigmedia.sound
Section 96
//Record (com.bigwigmedia.sound.Record)
package com.bigwigmedia.sound {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import com.bigwigmedia.core.*;
public class Record implements IDisposable {
private var _volume:Number;// = 1
private var _soundTransform:SoundTransform;
private var _sound:Sound;
private var _pan:Number;// = 0
private var _playing:Boolean;// = false
private var _channels:Dictionary;
private var _numChannelsPlaying:int;// = 0
private var _channelPan:Number;// = 0
private var _masterVolume:Number;// = 1
private var _channelVolume:Number;// = 1
public function Record(_arg1:Sound){
_soundTransform = new SoundTransform();
_channels = new Dictionary();
super();
_sound = _arg1;
}
private function onCompleteHandler(_arg1:Event):void{
var _local2:SoundChannel = SoundChannel(_arg1.target);
_local2.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler);
delete _channels[_local2];
if (--_numChannelsPlaying == 0){
_playing = false;
};
}
public function stop():void{
var _local1:SoundChannel;
if (_playing){
for each (_local1 in _channels) {
_local1.stop();
_local1.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler);
delete _channels[_local1];
};
_numChannelsPlaying = 0;
_playing = false;
};
}
public function set pan(_arg1:Number):void{
_pan = _arg1;
setResultTransform();
}
public function set volume(_arg1:Number):void{
_volume = _arg1;
setResultTransform();
}
private function setResultTransform():void{
var _local3:SoundChannel;
var _local1:Number = (_pan + _channelPan);
if (_local1 < -1){
_local1 = -1;
} else {
if (_local1 > 1){
_local1 = 1;
};
};
_soundTransform.pan = _local1;
var _local2:Number = (_volume * _channelVolume);
_soundTransform.volume = ((_local2 > _masterVolume)) ? _masterVolume : _local2;
if (_playing){
for each (_local3 in _channels) {
_local3.soundTransform = _soundTransform;
};
};
}
function set channelPan(_arg1:Number):void{
_channelPan = _arg1;
setResultTransform();
}
public function get volume():Number{
return (_volume);
}
public function playSingle(_arg1:int):Boolean{
if (_playing){
return (false);
};
play(_arg1);
return (true);
}
public function get pan():Number{
return (_pan);
}
public function dispose():void{
stop();
_sound = null;
_soundTransform = null;
}
public function play(_arg1:int):void{
var _local2:SoundChannel = _sound.play(0, _arg1, _soundTransform);
_local2.addEventListener(Event.SOUND_COMPLETE, onCompleteHandler);
_channels[_local2] = _local2;
_numChannelsPlaying++;
_playing = true;
}
public function get playing():Boolean{
return (_playing);
}
function set channelVolume(_arg1:Number):void{
_channelVolume = _arg1;
setResultTransform();
}
function set masterVolume(_arg1:Number):void{
_masterVolume = _arg1;
if (_masterVolume < 0){
_masterVolume = 0;
} else {
if (_masterVolume > 1){
_masterVolume = 1;
};
};
setResultTransform();
}
}
}//package com.bigwigmedia.sound
Section 97
//SoundManager (com.bigwigmedia.sound.SoundManager)
package com.bigwigmedia.sound {
import com.bigwigmedia.core.*;
import flash.errors.*;
public class SoundManager implements ISoundManager {
private var channelsHash:Object;
private var _maxVolume:Number;// = 1
private var recordsHash:Object;
bigwigmedia_ns static var singletonAccessor:Boolean = false;
public function SoundManager(){
channelsHash = {};
recordsHash = {};
super();
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of SoundManager."));
};
}
public function stop(_arg1:String):void{
var _local2:Record = recordsHash[_arg1];
_local2.stop();
}
public function play(_arg1:String, _arg2:int=1):void{
var _local3:Record = recordsHash[_arg1];
_local3.play(_arg2);
}
public function playNext(_arg1:String, _arg2:String=null, _arg3:int=1, _arg4:Number=60, _arg5:Number=60):void{
var _local6:Channel = channelsHash[_arg1];
_local6.playNextSound(_arg2, _arg3, _arg4, _arg5);
}
public function getChannel(_arg1:String):Channel{
return (channelsHash[_arg1]);
}
public function setAllChannelsVolume(_arg1:Number):void{
var _local2:Channel;
for each (_local2 in channelsHash) {
_local2.volume = _arg1;
};
}
public function getRecord(_arg1:String):Record{
return (recordsHash[_arg1]);
}
public function registerRecord(_arg1:String, _arg2:Class, _arg3:String="default_channel"):void{
if (recordsHash[_arg1]){
throw (new Error((("Record with \"" + _arg1) + "\" identifier already exists.")));
};
var _local4:Channel = channelsHash[_arg3];
if (!_local4){
_local4 = new Channel();
channelsHash[_arg3] = _local4;
};
var _local5:Record = new Record(new (_arg2));
recordsHash[_arg1] = _local5;
_local4.registerSound(_arg1, _local5);
}
public function stopChannel(_arg1:String):void{
var _local2:Channel = channelsHash[_arg1];
_local2.stop();
}
public function setVolume(_arg1:String, _arg2:Number):void{
var _local3:Record = recordsHash[_arg1];
_local3.volume = _arg2;
}
public function playSingle(_arg1:String, _arg2:int=1):Boolean{
var _local3:Record = recordsHash[_arg1];
return (_local3.playSingle(_arg2));
}
public function setPan(_arg1:String, _arg2:Number):void{
var _local3:Record = recordsHash[_arg1];
_local3.pan = _arg2;
}
public function setChannelPan(_arg1:String, _arg2:Number):void{
var _local3:Channel = channelsHash[_arg1];
_local3.pan = _arg2;
}
public function unregisterRecord(_arg1:String):void{
var _local2:Channel;
if (!recordsHash[_arg1]){
throw (new Error((("Record with \"" + _arg1) + "\" identifier doesn't exist.")));
};
for each (_local2 in channelsHash) {
_local2.unregisterSound(_arg1);
};
delete recordsHash[_arg1];
}
public function get masterVolume():Number{
return (_maxVolume);
}
public function set masterVolume(_arg1:Number):void{
var _local2:Record;
_maxVolume = _arg1;
for each (_local2 in recordsHash) {
_local2.masterVolume = _arg1;
};
}
public function setChannelVolume(_arg1:String, _arg2:Number):void{
var _local3:Channel = channelsHash[_arg1];
_local3.volume = _arg2;
}
public function stopAll():void{
var _local1:Record;
for each (_local1 in recordsHash) {
_local1.stop();
};
}
}
}//package com.bigwigmedia.sound
Section 98
//HSMError (com.bigwigmedia.stateMachine.errors.HSMError)
package com.bigwigmedia.stateMachine.errors {
public class HSMError extends Error {
public function HSMError(_arg1:String=""){
super(_arg1);
}
}
}//package com.bigwigmedia.stateMachine.errors
Section 99
//HSMEvent (com.bigwigmedia.stateMachine.events.HSMEvent)
package com.bigwigmedia.stateMachine.events {
import com.bigwigmedia.stateMachine.*;
import flash.events.*;
public class HSMEvent extends Event {
private var _state:AbstractState;
private var _event:AbstractEvent;
public static const COMPLETE:String = "HSMEvent.complete";
public static const START:String = "HSMEvent.start";
public static const EVENT_RECIEVE:String = "HSMEvent.eventRecieve";
public static const STATE_CHANGE:String = "HSMEvent.stateChange";
public function HSMEvent(_arg1:String, _arg2:AbstractState=null, _arg3:AbstractEvent=null){
super(_arg1);
_state = _arg2;
_event = _arg3;
}
public function get state():AbstractState{
return (_state);
}
public function get event():AbstractEvent{
return (_event);
}
override public function toString():String{
return (formatToString("HSMEvent", "type", "state", "event"));
}
override public function clone():Event{
return (new HSMEvent(type, _state, _event));
}
}
}//package com.bigwigmedia.stateMachine.events
Section 100
//StateEvent (com.bigwigmedia.stateMachine.events.StateEvent)
package com.bigwigmedia.stateMachine.events {
import flash.events.*;
public class StateEvent extends Event {
private var _data:Object;
public static const ADDED_TRIGGER:String = "StateEvent.addedTrigger";
public static const DEACTIVATE:String = "StateEvent.deactivate";
public function StateEvent(_arg1:String, _arg2:Object=null){
super(_arg1);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new StateEvent(type, _data));
}
}
}//package com.bigwigmedia.stateMachine.events
Section 101
//TriggerEvent (com.bigwigmedia.stateMachine.events.TriggerEvent)
package com.bigwigmedia.stateMachine.events {
import com.bigwigmedia.stateMachine.*;
import flash.events.*;
public class TriggerEvent extends Event {
private var _raisedEvent:AbstractEvent;
public static const TRIGGER:String = "TriggerEvent.trigger";
public function TriggerEvent(_arg1:String, _arg2:AbstractEvent){
super(_arg1);
_raisedEvent = _arg2;
}
public function get raisedEvent():AbstractEvent{
return (_raisedEvent);
}
override public function clone():Event{
return (new TriggerEvent(type, _raisedEvent));
}
}
}//package com.bigwigmedia.stateMachine.events
Section 102
//AbstractEvent (com.bigwigmedia.stateMachine.AbstractEvent)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.utils.*;
public class AbstractEvent {
var _triggerID:int;
public function toString():String{
return (ObjectUtil.formatToString(this));
}
}
}//package com.bigwigmedia.stateMachine
Section 103
//AbstractState (com.bigwigmedia.stateMachine.AbstractState)
package com.bigwigmedia.stateMachine {
import flash.events.*;
import com.bigwigmedia.stateMachine.events.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import com.bigwigmedia.stateMachine.errors.*;
public class AbstractState extends EventDispatcher implements IUpdatable, IDisposable {
private var _id:int;
public var name:String;
private var _parent:CompositeState;
private var updatableTriggers:Array;
private var _active:Boolean;// = false
private var _owned:Boolean;// = false
protected var transitionsList:Array;
private static var idCount:int = 0;
public function AbstractState(){
transitionsList = [];
updatableTriggers = [];
super();
_id = idCount++;
name = ("State_" + _id);
}
function setParent(_arg1:CompositeState):void{
_parent = _arg1;
}
public function update():void{
var _local1:IUpdatable;
for each (_local1 in updatableTriggers) {
_local1.update();
};
}
public function get id():int{
return (_id);
}
public function isAncestor(_arg1:AbstractState):Boolean{
var _local2:AbstractState = _parent;
while (_local2) {
if (_local2 == _arg1){
return (true);
};
_local2 = _local2.parent;
};
return (false);
}
function setOwned(_arg1:Boolean):void{
_owned = _arg1;
}
public function get parent():CompositeState{
return (_parent);
}
override public function toString():String{
return (ObjectUtil.formatToString(this, "name"));
}
public function addTransition(_arg1:AbstractState, _arg2:AbstractTrigger=null, _arg3:Function=null, _arg4:Function=null):void{
var _local6:Transition;
_arg2 = ((_arg2) || (new EmptyTrigger()));
var _local5:Transition = new Transition(this, _arg1, _arg2, _arg3, _arg4);
for each (_local6 in transitionsList) {
if (_local6.conflicts(_local5)){
throw (new HSMError((("State " + this.toString()) + " have conflicting outgoing transitions.")));
};
};
transitionsList.push(_local5);
if ((_arg2 is IUpdatable)){
updatableTriggers.push(_arg2);
};
dispatchEvent(new StateEvent(StateEvent.ADDED_TRIGGER, _arg2));
}
public function getActiveTransition(_arg1:AbstractEvent):Transition{
var _local4:Transition;
var _local2:int = transitionsList.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = transitionsList[_local3];
if (_local4.willFire(_arg1)){
return (_local4);
};
_local3++;
};
return (null);
}
public function dispose():void{
var _local1:Transition;
deactivate(null);
for each (_local1 in transitionsList) {
_local1.dispose();
};
transitionsList = [];
updatableTriggers = [];
_parent = null;
}
public function getTransitionLevel(_arg1:AbstractState):String{
if (this == _arg1){
return (TransitionLevel.TO_SELF);
};
if (this.parent == _arg1.parent){
return (TransitionLevel.TO_SIBLING);
};
if (this.isAncestor(_arg1)){
return (TransitionLevel.TO_ANCESTOR);
};
if (_arg1.isAncestor(this)){
return (TransitionLevel.TO_DESCENDANT);
};
return (TransitionLevel.TO_IRRELATIVE);
}
public function activate(_arg1:AbstractEvent):void{
var _local2:Transition;
_active = true;
for each (_local2 in transitionsList) {
_local2.trigger.activate();
};
}
public function deactivate(_arg1:AbstractEvent):void{
var _local2:Transition;
_active = false;
for each (_local2 in transitionsList) {
_local2.trigger.deactivate();
};
dispatchEvent(new StateEvent(StateEvent.DEACTIVATE));
}
public function get owned():Boolean{
return (_owned);
}
}
}//package com.bigwigmedia.stateMachine
Section 104
//AbstractTrigger (com.bigwigmedia.stateMachine.AbstractTrigger)
package com.bigwigmedia.stateMachine {
import flash.events.*;
import com.bigwigmedia.core.*;
public class AbstractTrigger extends EventDispatcher implements IDisposable {
protected var _id:int;
private static var idCount:int = 0;
public function AbstractTrigger(){
_id = idCount++;
}
function activate():void{
}
public function dispose():void{
}
public function willFire(_arg1:AbstractEvent):Boolean{
throw (new Error("Method must be overriden in subclass."));
}
function deactivate():void{
}
public function equals(_arg1:AbstractTrigger):Boolean{
throw (new Error("Method must be overriden in subclass."));
}
}
}//package com.bigwigmedia.stateMachine
Section 105
//ChoiceState (com.bigwigmedia.stateMachine.ChoiceState)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.errors.*;
public class ChoiceState extends AbstractState {
override public function addTransition(_arg1:AbstractState, _arg2:AbstractTrigger=null, _arg3:Function=null, _arg4:Function=null):void{
if (((_arg2) && (!((_arg2 is EmptyTrigger))))){
throw (new HSMError("Transition from ChoiceState may not have a trigger."));
};
super.addTransition(_arg1, _arg2, _arg3, _arg4);
}
}
}//package com.bigwigmedia.stateMachine
Section 106
//CompositeState (com.bigwigmedia.stateMachine.CompositeState)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.events.*;
import com.bigwigmedia.stateMachine.errors.*;
public class CompositeState extends SimpleState {
private var substatesList:Array;
private var _initialState:InitialState;
private var _lastActiveState:AbstractState;
private var hasHistoryState:Boolean;// = false
public function CompositeState(_arg1:Function=null, _arg2:Function=null, _arg3:Function=null){
substatesList = [];
super(_arg1, _arg2, _arg3);
}
private function onStateDeactivateHandler(_arg1:StateEvent):void{
if (hasHistoryState){
_lastActiveState = (_arg1.target as AbstractState);
};
}
public function get initial():InitialState{
return (_initialState);
}
public function addState(_arg1:AbstractState):AbstractState{
if (_arg1.owned){
throw (new HSMError("State can't be added twice."));
};
if ((_arg1 is InitialState)){
if (_initialState){
throw (new HSMError("CompositeState can have at most one InitialState."));
};
_initialState = (_arg1 as InitialState);
} else {
if ((_arg1 is HistoryState)){
if (hasHistoryState){
throw (new HSMError("CompositeState can have at most one HistoryState."));
};
hasHistoryState = true;
};
};
_arg1.addEventListener(StateEvent.ADDED_TRIGGER, onAddedTriggerHandler);
_arg1.addEventListener(StateEvent.DEACTIVATE, onStateDeactivateHandler);
substatesList.push(_arg1);
_arg1.setParent(this);
_arg1.setOwned(true);
return (_arg1);
}
private function onAddedTriggerHandler(_arg1:StateEvent):void{
dispatchEvent(_arg1.clone());
}
public function get history():AbstractState{
return (((_lastActiveState) || (_initialState)));
}
override public function dispose():void{
var _local1:AbstractState;
for each (_local1 in substatesList) {
_local1.removeEventListener(StateEvent.DEACTIVATE, onStateDeactivateHandler);
_local1.removeEventListener(StateEvent.ADDED_TRIGGER, onAddedTriggerHandler);
_local1.dispose();
};
substatesList = [];
_initialState = null;
_lastActiveState = null;
super.dispose();
}
}
}//package com.bigwigmedia.stateMachine
Section 107
//EmptyEvent (com.bigwigmedia.stateMachine.EmptyEvent)
package com.bigwigmedia.stateMachine {
public class EmptyEvent extends AbstractEvent {
}
}//package com.bigwigmedia.stateMachine
Section 108
//EmptyTrigger (com.bigwigmedia.stateMachine.EmptyTrigger)
package com.bigwigmedia.stateMachine {
public class EmptyTrigger extends AbstractTrigger {
override public function willFire(_arg1:AbstractEvent):Boolean{
return ((_arg1 is EmptyEvent));
}
override public function equals(_arg1:AbstractTrigger):Boolean{
return ((_arg1 is EmptyTrigger));
}
}
}//package com.bigwigmedia.stateMachine
Section 109
//FinalState (com.bigwigmedia.stateMachine.FinalState)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.errors.*;
public class FinalState extends SimpleState {
override public function addTransition(_arg1:AbstractState, _arg2:AbstractTrigger=null, _arg3:Function=null, _arg4:Function=null):void{
throw (new HSMError("FinalState can't have any outgoing transitions."));
}
}
}//package com.bigwigmedia.stateMachine
Section 110
//FSM (com.bigwigmedia.stateMachine.FSM)
package com.bigwigmedia.stateMachine {
import flash.events.*;
import com.bigwigmedia.stateMachine.events.*;
import com.bigwigmedia.stateMachine.errors.*;
public class FSM extends EventDispatcher implements IStateMachine {
protected var statesList:Array;
protected var started:Boolean;// = false
protected var completed:Boolean;// = false
protected var currentState:AbstractState;
protected var inTransition:Boolean;// = false
protected var eventsQueue:Array;
public function FSM(){
statesList = [];
eventsQueue = [];
super();
}
public function update():void{
currentState.update();
}
protected function doTransition():void{
var _local1:AbstractEvent;
var _local2:Transition;
if (((inTransition) || ((eventsQueue.length == 0)))){
return;
};
inTransition = true;
while (eventsQueue.length > 0) {
_local1 = eventsQueue.shift();
_local2 = currentState.getActiveTransition(_local1);
if (_local2){
currentState = _local2.target;
_local2.source.deactivate(_local1);
_local2.invokeEffect(_local1);
_local2.target.activate(_local1);
dispatchEvent(new HSMEvent(HSMEvent.STATE_CHANGE, currentState, _local1));
if ((((currentState is FinalState)) && (!(currentState.parent)))){
completed = true;
dispatchEvent(new HSMEvent(HSMEvent.COMPLETE, currentState, _local1));
break;
};
sendEvent(new EmptyEvent());
};
};
inTransition = false;
}
public function sendSignal(_arg1:String, _arg2:Object=null):void{
sendEvent(new SignalEvent(_arg1, _arg2));
}
public function dispose():void{
var _local1:AbstractState;
for each (_local1 in statesList) {
_local1.removeEventListener(StateEvent.ADDED_TRIGGER, onAddedTriggerHandler);
_local1.dispose();
};
statesList = [];
currentState = null;
started = false;
}
public function start():void{
if (started){
return;
};
if (!currentState){
throw (new HSMError("InitialState doesn't exist or is not immediate state of state machine."));
};
started = true;
dispatchEvent(new HSMEvent(HSMEvent.START));
sendEvent(new EmptyEvent());
}
protected function stateAdded(_arg1:AbstractState):void{
_arg1.addEventListener(StateEvent.ADDED_TRIGGER, onAddedTriggerHandler);
statesList.push(_arg1);
_arg1.setOwned(true);
}
public function addState(_arg1:AbstractState):AbstractState{
if (_arg1.owned){
throw (new HSMError("State can't be added twice."));
};
if ((_arg1 is CompositeState)){
throw (new HSMError("FSM cannot have composite states."));
};
if ((_arg1 is HistoryState)){
throw (new HSMError("State machine can't have any HistoryState."));
};
if ((_arg1 is InitialState)){
if (currentState){
throw (new HSMError("State machine can have at most one InitialState."));
};
currentState = (_arg1 as InitialState);
};
stateAdded(_arg1);
return (_arg1);
}
private function onTriggerHandler(_arg1:TriggerEvent):void{
sendEvent(_arg1.raisedEvent);
}
protected function sendEvent(_arg1:AbstractEvent):void{
if (!started){
throw (new HSMError("State machine is not started."));
};
dispatchEvent(new HSMEvent(HSMEvent.EVENT_RECIEVE, currentState, _arg1));
if (!completed){
eventsQueue.push(_arg1);
doTransition();
};
}
private function onAddedTriggerHandler(_arg1:StateEvent):void{
var _local2:AbstractTrigger = (_arg1.data as AbstractTrigger);
_local2.addEventListener(TriggerEvent.TRIGGER, onTriggerHandler);
}
}
}//package com.bigwigmedia.stateMachine
Section 111
//HistoryState (com.bigwigmedia.stateMachine.HistoryState)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.errors.*;
public class HistoryState extends AbstractState {
override public function addTransition(_arg1:AbstractState, _arg2:AbstractTrigger=null, _arg3:Function=null, _arg4:Function=null):void{
if (transitionsList.length == 1){
throw (new HSMError("HistoryState can have at most one outgoing transition."));
};
if (((_arg2) && (!((_arg2 is EmptyTrigger))))){
throw (new HSMError("Transition from HistoryState may not have a trigger."));
};
super.addTransition(_arg1, _arg2, _arg3, _arg4);
}
}
}//package com.bigwigmedia.stateMachine
Section 112
//HSM (com.bigwigmedia.stateMachine.HSM)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.events.*;
import com.bigwigmedia.stateMachine.errors.*;
public class HSM extends FSM {
private var stateChanged:Boolean;// = false
private var routesHash:Object;
private var activeStates:Array;
public function HSM(){
activeStates = [];
routesHash = {};
super();
}
override protected function doTransition():void{
var _local1:AbstractEvent;
var _local2:Transition;
var _local3:int;
var _local4:int;
var _local5:AbstractState;
var _local6:Array;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
if (((inTransition) || ((eventsQueue.length == 0)))){
return;
};
inTransition = true;
while (eventsQueue.length > 0) {
_local1 = eventsQueue.shift();
_local3 = activeStates.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = activeStates[_local4].getActiveTransition(_local1);
if (_local2){
break;
};
_local4++;
};
if (_local2){
_local5 = _local2.target;
if ((_local5 is CompositeState)){
_local5 = ((CompositeState(_local5).initial) || (_local5));
} else {
if ((_local5 is HistoryState)){
_local5 = _local5.parent.history;
};
};
_local6 = getExitRoute(currentState, _local5);
_local7 = getEntryRoute(currentState, _local5);
activeStates = getStack(_local7[(_local7.length - 1)]);
currentState = activeStates[0];
_local8 = _local6.length;
_local9 = 0;
while (_local9 < _local8) {
_local6[_local9].deactivate(_local1);
_local9++;
};
_local2.invokeEffect(_local1);
_local10 = _local7.length;
_local11 = 0;
while (_local11 < _local10) {
_local7[_local11].activate(_local1);
_local11++;
};
stateChanged = true;
dispatchEvent(new HSMEvent(HSMEvent.STATE_CHANGE, currentState, _local1));
if ((((currentState is FinalState)) && (!(currentState.parent)))){
completed = true;
dispatchEvent(new HSMEvent(HSMEvent.COMPLETE, currentState, _local1));
break;
};
sendEvent(new EmptyEvent());
};
};
inTransition = false;
}
override public function update():void{
var _local1:int = activeStates.length;
var _local2:int;
while (_local2 < _local1) {
activeStates[_local2].update();
if (stateChanged){
stateChanged = false;
return;
};
_local2++;
};
}
private function getEntryRoute(_arg1:AbstractState, _arg2:AbstractState):Array{
var _local5:AbstractState;
var _local3:String = ((_arg1.id + "->") + _arg2.id);
var _local4:Array = routesHash[_local3];
if (_local4){
return (_local4);
};
_local4 = [];
var _local6:String = _arg1.getTransitionLevel(_arg2);
switch (_local6){
case TransitionLevel.TO_SELF:
case TransitionLevel.TO_SIBLING:
_local4.push(_arg2);
break;
case TransitionLevel.TO_ANCESTOR:
_local5 = _arg1.parent;
while (true) {
_local4.push(_local5);
if (_local5 == _arg2){
break;
};
_local5 = _local5.parent;
};
break;
case TransitionLevel.TO_IRRELATIVE:
_local5 = _arg2;
while (true) {
_local4.push(_local5);
if (((!(_local5.parent)) || ((_local5.parent == _arg1.parent)))){
break;
};
_local5 = _local5.parent;
};
_local4.reverse();
break;
case TransitionLevel.TO_DESCENDANT:
_local4 = getStack(_arg2).slice();
_local4 = _local4.splice(0, _local4.indexOf(_arg1));
_local4.reverse();
break;
};
routesHash[_local3] = _local4;
return (_local4);
}
override public function dispose():void{
routesHash = {};
activeStates = [];
super.dispose();
}
private function getExitRoute(_arg1:AbstractState, _arg2:AbstractState):Array{
var _local5:AbstractState;
var _local3:String = ((_arg1.id + "<-") + _arg2.id);
var _local4:Array = routesHash[_local3];
if (_local4){
return (_local4);
};
_local4 = [];
var _local6:String = _arg1.getTransitionLevel(_arg2);
switch (_local6){
case TransitionLevel.TO_SELF:
case TransitionLevel.TO_SIBLING:
_local4.push(_arg1);
break;
case TransitionLevel.TO_ANCESTOR:
_local5 = _arg1;
while (_local5 != _arg2) {
_local4.push(_local5);
_local5 = _local5.parent;
};
break;
case TransitionLevel.TO_DESCENDANT:
break;
case TransitionLevel.TO_IRRELATIVE:
_local5 = _arg1;
while (true) {
_local4.push(_local5);
if (((!(_local5.parent)) || ((_local5.parent == _arg2.parent)))){
break;
};
_local5 = _local5.parent;
};
break;
};
routesHash[_local3] = _local4;
return (_local4);
}
override public function addState(_arg1:AbstractState):AbstractState{
if (_arg1.owned){
throw (new HSMError("State can't be added twice."));
};
if ((_arg1 is InitialState)){
if (currentState){
throw (new HSMError("State machine can have at most one InitialState."));
};
activeStates = [_arg1];
currentState = _arg1;
} else {
if ((_arg1 is HistoryState)){
throw (new HSMError("State machine can't have any HistoryState."));
};
};
stateAdded(_arg1);
return (_arg1);
}
private function getStack(_arg1:AbstractState):Array{
var _local2:String = String(_arg1.id);
var _local3:Array = routesHash[_local2];
if (_local3){
return (_local3);
};
var _local4:AbstractState = _arg1;
_local3 = [_local4];
while (_local4.parent) {
_local3.push(_local4.parent);
_local4 = _local4.parent;
};
routesHash[_local2] = _local3;
return (_local3);
}
}
}//package com.bigwigmedia.stateMachine
Section 113
//InitialState (com.bigwigmedia.stateMachine.InitialState)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.errors.*;
public class InitialState extends SimpleState {
override public function addTransition(_arg1:AbstractState, _arg2:AbstractTrigger=null, _arg3:Function=null, _arg4:Function=null):void{
if (transitionsList.length == 1){
throw (new HSMError("InitialState can have at most one outgoing transition."));
};
if (((_arg2) && (!((_arg2 is EmptyTrigger))))){
throw (new HSMError("Transition from InitialState may not have a trigger."));
};
super.addTransition(_arg1, _arg2, _arg3, _arg4);
}
}
}//package com.bigwigmedia.stateMachine
Section 114
//IStateMachine (com.bigwigmedia.stateMachine.IStateMachine)
package com.bigwigmedia.stateMachine {
import flash.events.*;
import com.bigwigmedia.core.*;
public interface IStateMachine extends IEventDispatcher, IUpdatable, IDisposable {
function addState(_arg1:AbstractState):AbstractState;
function start():void;
function sendSignal(_arg1:String, _arg2:Object=null):void;
}
}//package com.bigwigmedia.stateMachine
Section 115
//SignalEvent (com.bigwigmedia.stateMachine.SignalEvent)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.utils.*;
public class SignalEvent extends AbstractEvent {
protected var _type:String;
protected var _data:Object;
public function SignalEvent(_arg1:String, _arg2:Object=null){
_type = _arg1;
_data = _arg2;
}
public function get data():Object{
return (_data);
}
public function get type():String{
return (_type);
}
override public function toString():String{
return (ObjectUtil.formatToString(this, "type", "data"));
}
}
}//package com.bigwigmedia.stateMachine
Section 116
//SignalTrigger (com.bigwigmedia.stateMachine.SignalTrigger)
package com.bigwigmedia.stateMachine {
public class SignalTrigger extends AbstractTrigger {
private var _type:String;
public function SignalTrigger(_arg1:String){
_type = _arg1;
}
override public function willFire(_arg1:AbstractEvent):Boolean{
var _local2:SignalEvent = (_arg1 as SignalEvent);
return (((_local2) && ((_local2.type == _type))));
}
override public function equals(_arg1:AbstractTrigger):Boolean{
var _local2:SignalTrigger = (_arg1 as SignalTrigger);
return (((_local2) && ((_local2._type == _type))));
}
}
}//package com.bigwigmedia.stateMachine
Section 117
//SimpleState (com.bigwigmedia.stateMachine.SimpleState)
package com.bigwigmedia.stateMachine {
public class SimpleState extends AbstractState {
protected var _entry:Function;// = null
protected var _doActivity:Function;// = null
protected var _exit:Function;// = null
public function SimpleState(_arg1:Function=null, _arg2:Function=null, _arg3:Function=null){
_entry = _arg1;
_doActivity = _arg2;
_exit = _arg3;
}
override public function update():void{
super.update();
if (_doActivity != null){
_doActivity();
};
}
override public function deactivate(_arg1:AbstractEvent):void{
if (_exit != null){
_exit(_arg1);
};
super.deactivate(_arg1);
}
override public function activate(_arg1:AbstractEvent):void{
super.activate(_arg1);
if (_entry != null){
_entry(_arg1);
};
}
override public function dispose():void{
_entry = null;
_doActivity = null;
_exit = null;
super.dispose();
}
}
}//package com.bigwigmedia.stateMachine
Section 118
//TimeEvent (com.bigwigmedia.stateMachine.TimeEvent)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.utils.*;
public class TimeEvent extends AbstractEvent {
private var _delay:Number;
public function TimeEvent(_arg1:Number){
_delay = _arg1;
}
public function get delay():Number{
return (_delay);
}
override public function toString():String{
return (ObjectUtil.formatToString(this, "delay"));
}
}
}//package com.bigwigmedia.stateMachine
Section 119
//TimeTrigger (com.bigwigmedia.stateMachine.TimeTrigger)
package com.bigwigmedia.stateMachine {
import flash.events.*;
import com.bigwigmedia.stateMachine.events.*;
import flash.utils.*;
public class TimeTrigger extends AbstractTrigger {
private var _delay:Number;
private var _timer:Timer;
public function TimeTrigger(_arg1:Number){
_delay = _arg1;
_timer = new Timer(_delay, 1);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerCompleteHandler);
}
override function deactivate():void{
_timer.reset();
}
override public function dispose():void{
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerCompleteHandler);
_timer = null;
}
override function activate():void{
_timer.start();
}
private function onTimerCompleteHandler(_arg1:TimerEvent):void{
var _local2:TimeEvent = new TimeEvent(_delay);
_local2._triggerID = _id;
dispatchEvent(new TriggerEvent(TriggerEvent.TRIGGER, _local2));
}
override public function equals(_arg1:AbstractTrigger):Boolean{
var _local2:TimeTrigger = (_arg1 as TimeTrigger);
return (((_local2) && ((_local2._delay == _delay))));
}
override public function willFire(_arg1:AbstractEvent):Boolean{
return ((_arg1._triggerID == _id));
}
}
}//package com.bigwigmedia.stateMachine
Section 120
//Transition (com.bigwigmedia.stateMachine.Transition)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
public class Transition implements IDisposable {
private var _guard:Function;
private var _target:AbstractState;
private var _effect:Function;
private var _trigger:AbstractTrigger;
private var _source:AbstractState;
public function Transition(_arg1:AbstractState, _arg2:AbstractState, _arg3:AbstractTrigger, _arg4:Function, _arg5:Function){
_source = _arg1;
_target = _arg2;
_trigger = _arg3;
_effect = _arg4;
_guard = _arg5;
}
public function conflicts(_arg1:Transition):Boolean{
return ((((((_source == _arg1.source)) && (_trigger.equals(_arg1.trigger)))) && ((_guard == _arg1.guard))));
}
public function get source():AbstractState{
return (_source);
}
public function get guard():Function{
return (_guard);
}
public function willFire(_arg1:AbstractEvent):Boolean{
if (_trigger.willFire(_arg1)){
return ((((guard == null)) || (_guard())));
};
return (false);
}
public function invokeEffect(_arg1:AbstractEvent):void{
if (_effect != null){
_effect(_arg1);
};
}
public function get target():AbstractState{
return (_target);
}
public function get trigger():AbstractTrigger{
return (_trigger);
}
public function toString():String{
return (ObjectUtil.formatToString(this, "source", "target", "trigger"));
}
public function dispose():void{
_source = null;
_target = null;
_trigger.dispose();
_trigger = null;
_effect = null;
_guard = null;
}
}
}//package com.bigwigmedia.stateMachine
Section 121
//TransitionLevel (com.bigwigmedia.stateMachine.TransitionLevel)
package com.bigwigmedia.stateMachine {
public class TransitionLevel {
public static const TO_SELF:String = "toSelf";
public static const TO_DESCENDANT:String = "toDescendant";
public static const TO_ANCESTOR:String = "toAncestor";
public static const TO_IRRELATIVE:String = "toIrrelative";
public static const TO_SIBLING:String = "toSibling";
}
}//package com.bigwigmedia.stateMachine
Section 122
//UpdateEvent (com.bigwigmedia.stateMachine.UpdateEvent)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.utils.*;
public class UpdateEvent extends AbstractEvent {
private var _count:int;
public function UpdateEvent(_arg1:int){
_count = _arg1;
}
override public function toString():String{
return (ObjectUtil.formatToString(this, "count"));
}
public function get count():int{
return (_count);
}
}
}//package com.bigwigmedia.stateMachine
Section 123
//UpdateTrigger (com.bigwigmedia.stateMachine.UpdateTrigger)
package com.bigwigmedia.stateMachine {
import com.bigwigmedia.stateMachine.events.*;
import com.bigwigmedia.core.*;
public class UpdateTrigger extends AbstractTrigger implements IUpdatable {
private var _count:int;
private var _updateCount:int;
public function UpdateTrigger(_arg1:int){
_count = _arg1;
}
override public function equals(_arg1:AbstractTrigger):Boolean{
var _local2:UpdateTrigger = (_arg1 as _slot1);
return (((_local2) && ((_local2._count == _count))));
}
override public function willFire(_arg1:AbstractEvent):Boolean{
return ((_arg1._triggerID == _id));
}
public function update():void{
var _local1:UpdateEvent;
if (_updateCount-- <= 1){
_local1 = new UpdateEvent(_count);
_local1._triggerID = _id;
dispatchEvent(new TriggerEvent(TriggerEvent.TRIGGER, _local1));
};
}
override function activate():void{
_updateCount = _count;
}
}
}//package com.bigwigmedia.stateMachine
Section 124
//AbstractTransition (com.bigwigmedia.transitions.AbstractTransition)
package com.bigwigmedia.transitions {
import flash.display.*;
import com.bigwigmedia.core.*;
public class AbstractTransition extends Sprite implements IDisposable {
public function start():void{
}
public function dispose():void{
}
}
}//package com.bigwigmedia.transitions
Section 125
//BlackoutTransition (com.bigwigmedia.transitions.BlackoutTransition)
package com.bigwigmedia.transitions {
import flash.events.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.application.*;
public class BlackoutTransition extends AbstractTransition {
private var _peakCallback:Function;
private var _color:int;
private var _halfDuration:int;
private var _tween:ITween;
private var _completeCallback:Function;
public function BlackoutTransition(_arg1:Function, _arg2:Function=null, _arg3:int=16, _arg4:uint=0){
_peakCallback = _arg1;
_completeCallback = _arg2;
_halfDuration = (_arg3 / 2);
_color = _arg4;
}
override public function start():void{
alpha = 0;
graphics.beginFill(_color, 1);
graphics.drawRect(0, 0, ApplicationGlobals.application.nominalWidth, ApplicationGlobals.application.nominalHeight);
graphics.endFill();
_tween = new SequenceTween([new PropertyTween(this, "alpha", 0, 1, _halfDuration), new Action(this, onPeak), new PropertyTween(this, "alpha", 1, 0, _halfDuration), new Action(this, onComplete)]);
_tween.playAuto();
}
override public function dispose():void{
_peakCallback = null;
_completeCallback = null;
graphics.clear();
}
private function onPeak():void{
_peakCallback();
}
private function onComplete():void{
graphics.clear();
if (_completeCallback != null){
_completeCallback();
};
dispatchEvent(new Event(Event.COMPLETE));
}
}
}//package com.bigwigmedia.transitions
Section 126
//Back (com.bigwigmedia.tweens.easing.Back)
package com.bigwigmedia.tweens.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 127
//Bounce (com.bigwigmedia.tweens.easing.Bounce)
package com.bigwigmedia.tweens.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 128
//Circular (com.bigwigmedia.tweens.easing.Circular)
package com.bigwigmedia.tweens.easing {
public class Circular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 129
//Cubic (com.bigwigmedia.tweens.easing.Cubic)
package com.bigwigmedia.tweens.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _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) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 130
//Easing (com.bigwigmedia.tweens.easing.Easing)
package com.bigwigmedia.tweens.easing {
public class Easing {
public static const QUADRATIC_IN_OUT:String = "quadraticInOut";
public static const CIRCULAR_IN:String = "circularIn";
public static const SINE_IN_OUT:String = "sineInOut";
public static const CUBIC_IN_OUT:String = "cubicInOut";
public static const SINE_OUT:String = "sineOut";
public static const QUADRATIC_IN:String = "quadraticIn";
public static const CIRCULAR_OUT:String = "circularOut";
public static const SINE_IN:String = "sineIn";
public static const CUBIC_OUT:String = "cubicOut";
public static const CUBIC_IN:String = "cubicIn";
public static const BACK_OUT:String = "backOut";
public static const ELASTIC_OUT:String = "elasticOut";
public static const LINEAR:String = "linear";
public static const QUADRATIC_OUT:String = "quadraticOut";
public static const BOUNCE_IN_OUT:String = "bounceInOut";
public static const BACK_IN_OUT:String = "backInOut";
public static const ELASTIC_IN_OUT:String = "elasticInOut";
public static const ELASTIC_IN:String = "elasticIn";
public static const BOUNCE_OUT:String = "bounceOut";
public static const CIRCULAR_IN_OUT:String = "circularInOut";
public static const BOUNCE_IN:String = "bounceIn";
public static const BACK_IN:String = "backIn";
public static function getEasingFunc(_arg1:String):Function{
switch (_arg1){
case null:
case LINEAR:
return (Linear.easeNone);
case BACK_IN:
return (Back.easeIn);
case BACK_OUT:
return (Back.easeOut);
case BACK_IN_OUT:
return (Back.easeInOut);
case BOUNCE_IN:
return (Bounce.easeIn);
case BOUNCE_OUT:
return (Bounce.easeOut);
case BOUNCE_IN_OUT:
return (Bounce.easeInOut);
case CIRCULAR_IN:
return (Circular.easeIn);
case CIRCULAR_OUT:
return (Circular.easeOut);
case CIRCULAR_IN_OUT:
return (Circular.easeInOut);
case CUBIC_IN:
return (Cubic.easeIn);
case CUBIC_OUT:
return (Cubic.easeOut);
case CUBIC_IN_OUT:
return (Cubic.easeInOut);
case ELASTIC_IN:
return (Elastic.easeIn);
case ELASTIC_OUT:
return (Elastic.easeOut);
case ELASTIC_IN_OUT:
return (Elastic.easeInOut);
case QUADRATIC_IN:
return (Quadratic.easeIn);
case QUADRATIC_OUT:
return (Quadratic.easeOut);
case QUADRATIC_IN_OUT:
return (Quadratic.easeInOut);
case SINE_IN:
return (Sine.easeIn);
case SINE_OUT:
return (Sine.easeOut);
case SINE_IN_OUT:
return (Sine.easeInOut);
};
throw (new ArgumentError((("Easing \"" + _arg1) + "\" is not supported.")));
}
}
}//package com.bigwigmedia.tweens.easing
Section 131
//Elastic (com.bigwigmedia.tweens.easing.Elastic)
package com.bigwigmedia.tweens.easing {
public class Elastic {
private static const _2PI:Number = 6.28318530717959;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 132
//Linear (com.bigwigmedia.tweens.easing.Linear)
package com.bigwigmedia.tweens.easing {
public class Linear {
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 133
//Quadratic (com.bigwigmedia.tweens.easing.Quadratic)
package com.bigwigmedia.tweens.easing {
public class Quadratic {
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 com.bigwigmedia.tweens.easing
Section 134
//Sine (com.bigwigmedia.tweens.easing.Sine)
package com.bigwigmedia.tweens.easing {
public class Sine {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package com.bigwigmedia.tweens.easing
Section 135
//AbstractNumberTween (com.bigwigmedia.tweens.AbstractNumberTween)
package com.bigwigmedia.tweens {
public class AbstractNumberTween extends AbstractTargetTween {
protected var _changeValue:Number;
protected var _startValue:Number;
public function AbstractNumberTween(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:int, _arg5:String, _arg6:Boolean){
super(_arg1, _arg4, _arg5, _arg6);
_startValue = _arg2;
_changeValue = (_arg3 - _arg2);
}
protected function getNumber():Number{
return (_easingFunc(_time, _startValue, _changeValue, _duration));
}
}
}//package com.bigwigmedia.tweens
Section 136
//AbstractTargetTween (com.bigwigmedia.tweens.AbstractTargetTween)
package com.bigwigmedia.tweens {
import com.bigwigmedia.events.*;
import com.bigwigmedia.tweens.easing.*;
public class AbstractTargetTween extends AbstractTween implements ITargetTween {
protected var _time:int;// = 0
protected var _easingFunc:Function;
protected var _target:Object;
protected var _duration:int;
public function AbstractTargetTween(_arg1:Object, _arg2:int, _arg3:String, _arg4:Boolean){
super(_arg4);
_target = _arg1;
_duration = _arg2;
_easingFunc = Easing.getEasingFunc(_arg3);
}
override public function update():void{
if (_completed){
return;
};
updateTarget();
if (_time < _duration){
_time++;
} else {
if (_repeat){
reset();
} else {
_completed = true;
dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
}
override public function reset():void{
_time = 0;
_completed = false;
}
public function get target():Object{
return (_target);
}
protected function updateTarget():void{
}
override public function dispose():void{
stopAuto();
_target = null;
_easingFunc = null;
}
}
}//package com.bigwigmedia.tweens
Section 137
//AbstractTween (com.bigwigmedia.tweens.AbstractTween)
package com.bigwigmedia.tweens {
import flash.display.*;
import flash.events.*;
public class AbstractTween extends EventDispatcher implements ITween {
private var _autoPlaying:Boolean;// = false
protected var _completed:Boolean;// = false
protected var _repeat:Boolean;
private static var _autoTicker:Shape = new Shape();
private static var _autoTweens:Array = [];
public function AbstractTween(_arg1:Boolean){
_repeat = _arg1;
}
public function playAuto():void{
if (_autoPlaying){
return;
};
if (!_autoTicker.hasEventListener(Event.ENTER_FRAME)){
_autoTicker.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
};
_autoTweens.push(this);
_autoPlaying = true;
}
public function update():void{
}
public function stopAuto():void{
if (!_autoPlaying){
return;
};
_autoTweens.splice(_autoTweens.indexOf(this), 1);
if (_autoTweens.length == 0){
_autoTicker.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
};
_autoPlaying = false;
}
public function reset():void{
_completed = false;
}
public function dispose():void{
stopAuto();
}
private static function onEnterFrameHandler(_arg1:Event):void{
var _local2:ITween;
for each (_local2 in _autoTweens) {
_local2.update();
};
}
}
}//package com.bigwigmedia.tweens
Section 138
//Action (com.bigwigmedia.tweens.Action)
package com.bigwigmedia.tweens {
import com.bigwigmedia.events.*;
public class Action extends AbstractTween {
private var _func:Function;
private var _scope:Object;
private var _args:Array;
public function Action(_arg1:Object, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false){
super(_arg4);
_scope = _arg1;
_func = _arg2;
_args = _arg3;
}
override public function update():void{
if (_completed){
return;
};
_func.apply(_scope, _args);
if (_repeat){
reset();
} else {
_completed = true;
dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
}
override public function dispose():void{
super.dispose();
_scope = null;
_func = null;
_args = null;
}
}
}//package com.bigwigmedia.tweens
Section 139
//Delay (com.bigwigmedia.tweens.Delay)
package com.bigwigmedia.tweens {
import com.bigwigmedia.events.*;
public class Delay extends AbstractTween {
private var _delay:int;
private var _count:int;
public function Delay(_arg1:int){
super(false);
_delay = _arg1;
_count = _arg1;
}
override public function update():void{
if (_completed){
return;
};
if (_count-- == 0){
_completed = true;
dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
}
override public function reset():void{
_completed = false;
_count = _delay;
}
}
}//package com.bigwigmedia.tweens
Section 140
//ITargetTween (com.bigwigmedia.tweens.ITargetTween)
package com.bigwigmedia.tweens {
public interface ITargetTween extends ITween {
function get target():Object;
}
}//package com.bigwigmedia.tweens
Section 141
//ITween (com.bigwigmedia.tweens.ITween)
package com.bigwigmedia.tweens {
import flash.events.*;
import com.bigwigmedia.core.*;
public interface ITween extends IEventDispatcher, IUpdatable, IDisposable {
function stopAuto():void;
function playAuto():void;
function reset():void;
}
}//package com.bigwigmedia.tweens
Section 142
//ParallelTween (com.bigwigmedia.tweens.ParallelTween)
package com.bigwigmedia.tweens {
import com.bigwigmedia.events.*;
public class ParallelTween extends AbstractTween {
private var _tweens:Array;
private var _numActiveTweens:int;// = 0
public function ParallelTween(_arg1:Array, _arg2:Boolean=false){
var _local5:ITween;
_tweens = [];
super(_arg2);
var _local3:int = _arg1.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = _arg1[_local4];
_local5.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tweens.push(_local5);
_local4++;
};
_numActiveTweens = _local3;
}
override public function dispose():void{
var _local1:ITween;
for each (_local1 in _tweens) {
_local1.removeEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_local1.dispose();
};
_tweens = [];
super.dispose();
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
if (--_numActiveTweens == 0){
_completed = true;
};
}
override public function update():void{
var _local1:ITween;
if (_completed){
return;
};
for each (_local1 in _tweens) {
_local1.update();
};
if (_completed){
if (_repeat){
reset();
} else {
dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
}
override public function reset():void{
var _local1:ITween;
_completed = false;
for each (_local1 in _tweens) {
_local1.reset();
};
_numActiveTweens = _tweens.length;
}
}
}//package com.bigwigmedia.tweens
Section 143
//PropertyTween (com.bigwigmedia.tweens.PropertyTween)
package com.bigwigmedia.tweens {
public class PropertyTween extends AbstractNumberTween {
private var _property:String;
public function PropertyTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int, _arg6:String="linear", _arg7:Boolean=false){
super(_arg1, _arg3, _arg4, _arg5, _arg6, _arg7);
_property = _arg2;
if (((!((_arg2 in _arg1))) || ((_arg1[_arg2] is Function)))){
throw (new ArgumentError((("Supplied property \"" + _arg2) + "\" is not found in target object.")));
};
}
override protected function updateTarget():void{
_target[_property] = getNumber();
}
}
}//package com.bigwigmedia.tweens
Section 144
//ScaleTween (com.bigwigmedia.tweens.ScaleTween)
package com.bigwigmedia.tweens {
public class ScaleTween extends AbstractNumberTween {
public function ScaleTween(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:int, _arg5:String="linear", _arg6:Boolean=false){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
override protected function updateTarget():void{
_target.scaleX = (_target.scaleY = getNumber());
}
}
}//package com.bigwigmedia.tweens
Section 145
//SequenceTween (com.bigwigmedia.tweens.SequenceTween)
package com.bigwigmedia.tweens {
import com.bigwigmedia.events.*;
public class SequenceTween extends AbstractTween {
private var _currentTweenIndex:int;// = 0
private var _tweens:Array;
private var _currentTween:ITween;
public function SequenceTween(_arg1:Array, _arg2:Boolean=false){
var _local5:ITween;
_tweens = [];
super(_arg2);
var _local3:int = _arg1.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = _arg1[_local4];
_local5.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tweens.push(_local5);
_local4++;
};
_currentTween = _tweens[0];
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
if (++_currentTweenIndex == _tweens.length){
if (_repeat){
reset();
} else {
if (!_completed){
_completed = true;
dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
} else {
_currentTween = _tweens[_currentTweenIndex];
};
}
override public function update():void{
if (!_completed){
_currentTween.update();
};
}
override public function reset():void{
var _local1:ITween;
_completed = false;
for each (_local1 in _tweens) {
_local1.reset();
};
_currentTweenIndex = 0;
_currentTween = _tweens[0];
}
override public function dispose():void{
var _local1:ITween;
_currentTween = null;
for each (_local1 in _tweens) {
_local1.removeEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_local1.dispose();
};
_tweens = [];
super.dispose();
}
}
}//package com.bigwigmedia.tweens
Section 146
//SetterTween (com.bigwigmedia.tweens.SetterTween)
package com.bigwigmedia.tweens {
public class SetterTween extends AbstractNumberTween {
private var _setterFunc:Function;
public function SetterTween(_arg1:Object, _arg2:Function, _arg3:Number, _arg4:Number, _arg5:int, _arg6:String="linear", _arg7:Boolean=false){
super(_arg1, _arg3, _arg4, _arg5, _arg6, _arg7);
_setterFunc = _arg2;
}
override protected function updateTarget():void{
_setterFunc.call(_target, getNumber());
}
override public function dispose():void{
_setterFunc = null;
super.dispose();
}
}
}//package com.bigwigmedia.tweens
Section 147
//AbstractBox (com.bigwigmedia.ui.containers.AbstractBox)
package com.bigwigmedia.ui.containers {
public class AbstractBox extends LayoutContainer {
protected var _gap:Number;// = 0
public function set gap(_arg1:Number):void{
_gap = _arg1;
invalidateLayout();
invalidateSize();
}
public function get gap():Number{
return (_gap);
}
}
}//package com.bigwigmedia.ui.containers
Section 148
//Constraint (com.bigwigmedia.ui.containers.Constraint)
package com.bigwigmedia.ui.containers {
import flash.display.*;
import com.bigwigmedia.ui.*;
import flash.geom.*;
public class Constraint {
private var _bottom:Number;// = NAN
private var _percentHeight:Number;// = NAN
private var _isPositionConstraint:Boolean;// = false
private var _verticalCenter:Number;// = NAN
private var _top:Number;// = NAN
private var _right:Number;// = NAN
private var _percentWidth:Number;// = NAN
private var _left:Number;// = NAN
private var _isSizeConstraint:Boolean;// = false
private var _horizontalCenter:Number;// = NAN
private static var LAYOUT_METHODS:Object = {percentWidth:true, percentHeight:true, left:true, right:true, horizontalCenter:true, top:true, bottom:true, verticalCenter:true};
public function Constraint(_arg1:Object){
var _local2:String;
super();
if (_arg1){
for (_local2 in _arg1) {
if ((_local2 in LAYOUT_METHODS)){
this[_local2] = _arg1[_local2];
} else {
throw (new ArgumentError((("Supplied layout method \"" + _local2) + "\" is not supported.")));
};
};
};
}
public function set percentWidth(_arg1:Number):void{
_percentWidth = _arg1;
_isSizeConstraint = true;
}
public function set verticalCenter(_arg1:Number):void{
_verticalCenter = _arg1;
_isPositionConstraint = true;
}
public function get isSizeConstraint():Boolean{
return (_isSizeConstraint);
}
public function set left(_arg1:Number):void{
_left = _arg1;
_isPositionConstraint = true;
if (!isNaN(_right)){
_isSizeConstraint = true;
};
}
public function set percentHeight(_arg1:Number):void{
_percentHeight = _arg1;
_isSizeConstraint = true;
}
public function set bottom(_arg1:Number):void{
_bottom = _arg1;
_isPositionConstraint = true;
if (!isNaN(_top)){
_isSizeConstraint = true;
};
}
public function set top(_arg1:Number):void{
_top = _arg1;
_isPositionConstraint = true;
if (!isNaN(_bottom)){
_isSizeConstraint = true;
};
}
public function apply(_arg1:DisplayObject):void{
var _local5:Number;
var _local6:Number;
var _local7:Rectangle;
var _local8:Number;
var _local9:Number;
var _local2:DisplayObject = _arg1.parent;
if (!_local2){
return;
};
var _local3:AbstractComponent = (_arg1 as AbstractComponent);
var _local4:LayoutContainer = (_arg1 as LayoutContainer);
if (((_isSizeConstraint) && (((!(_local4)) || (!(_local4.fitSizeToContent)))))){
_local5 = _arg1.width;
_local6 = _arg1.height;
if (!isNaN(_percentWidth)){
_local5 = ((_local2.width * _percentWidth) / 100);
} else {
if (((!(isNaN(_left))) && (!(isNaN(_right))))){
_local5 = ((_local2.width - _left) - _right);
};
};
if (!isNaN(_percentHeight)){
_local6 = ((_local2.height * _percentHeight) / 100);
} else {
if (((!(isNaN(_top))) && (!(isNaN(_bottom))))){
_local6 = ((_local2.height - _top) - _bottom);
};
};
if (_local3){
_local3.setSize(_local5, _local6);
} else {
_arg1.width = _local5;
_arg1.height = _local6;
};
};
if (_isPositionConstraint){
_local7 = _arg1.getBounds(_arg1.parent);
_local8 = _arg1.x;
_local9 = _arg1.y;
if (!isNaN(_horizontalCenter)){
_local8 = (_local8 + (((_local2.width / 2) - (_local7.left + (_local7.width / 2))) + _horizontalCenter));
} else {
if (!isNaN(_left)){
_local8 = (_local8 + (_left - _local7.left));
} else {
if (!isNaN(_right)){
_local8 = (_local8 + ((_local2.width - _local7.right) - _right));
};
};
};
if (!isNaN(_verticalCenter)){
_local9 = (_local9 + (((_local2.height / 2) - (_local7.top + (_local7.height / 2))) + _verticalCenter));
} else {
if (!isNaN(_top)){
_local9 = (_local9 + (_top - _local7.top));
} else {
if (!isNaN(_bottom)){
_local9 = (_local9 + ((_local2.height - _local7.bottom) - _bottom));
};
};
};
if (_local3){
_local3.move(_local8, _local9);
} else {
_arg1.x = _local8;
_arg1.y = _local9;
};
};
}
public function set horizontalCenter(_arg1:Number):void{
_horizontalCenter = _arg1;
_isPositionConstraint = true;
}
public function get isPositionConstraint():Boolean{
return (_isPositionConstraint);
}
public function set right(_arg1:Number):void{
_right = _arg1;
_isPositionConstraint = true;
if (!isNaN(_left)){
_isSizeConstraint = true;
};
}
}
}//package com.bigwigmedia.ui.containers
Section 149
//HBox (com.bigwigmedia.ui.containers.HBox)
package com.bigwigmedia.ui.containers {
import flash.display.*;
public class HBox extends AbstractBox {
override protected function drawLayout():void{
var _local4:DisplayObject;
var _local5:Constraint;
if (_fitSizeToContent){
this.height = maxChildHeight;
};
var _local1:Number = 0;
var _local2:int = _layoutChildren.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _layoutChildren[_local3];
_local5 = _childToConstraintDict[_local4];
if (_local5){
_local5.apply(_local4);
};
_local4.x = _local1;
_local1 = (_local1 + (_local4.width + ((_local3 < (_local2 - 1))) ? _gap : 0));
_local3++;
};
this.width = _local1;
}
}
}//package com.bigwigmedia.ui.containers
Section 150
//LayoutContainer (com.bigwigmedia.ui.containers.LayoutContainer)
package com.bigwigmedia.ui.containers {
import flash.display.*;
import com.bigwigmedia.ui.*;
import com.bigwigmedia.events.*;
import flash.utils.*;
public class LayoutContainer extends AbstractContainer {
private var invalidatingLayout:Boolean;// = false
protected var _childToConstraintDict:Dictionary;
private var invalidateLayoutFlag:Boolean;// = false
protected var _fitSizeToContent:Boolean;// = false
protected var _layoutChildren:Array;
public function LayoutContainer(){
_layoutChildren = [];
_childToConstraintDict = new Dictionary();
super();
}
override public function setSize(_arg1:Number, _arg2:Number):void{
var _local3:Number = Math.round(_arg1);
var _local4:Number = Math.round(_arg2);
if (_local3 < _minWidth){
_local3 = _minWidth;
} else {
if (_local3 > _maxWidth){
_local3 = _maxWidth;
};
};
if (_local4 < _minHeight){
_local4 = _minHeight;
} else {
if (_local4 > _maxHeight){
_local4 = _maxHeight;
};
};
var _local5:Boolean;
if (_explicitWidth != _local3){
_explicitWidth = _local3;
_local5 = true;
};
if (_explicitHeight != _local4){
_explicitHeight = _local4;
_local5 = true;
};
if (_local5){
invalidateLayout();
invalidateSize();
};
}
protected function invalidateLayout():void{
invalidateLayoutFlag = true;
callLater();
}
override protected function componentAdded(_arg1:AbstractComponent):void{
invalidateLayout();
}
private function onComponentEventHandler(_arg1:ComponentEvent):void{
if (_layoutChildren.indexOf(_arg1.target) != -1){
invalidateLayout();
};
}
override protected function draw():void{
if (invalidatingLayout){
return;
};
invalidatingLayout = true;
if (invalidateLayoutFlag){
drawLayout();
};
super.draw();
invalidatingLayout = false;
}
public function get maxChildWidth():Number{
var _local2:DisplayObject;
var _local1:Number = 0;
for each (_local2 in _layoutChildren) {
if (_local2.width > _local1){
_local1 = _local2.width;
};
};
return (_local1);
}
override protected function validate():void{
invalidateLayoutFlag = false;
super.validate();
}
public function set fitSizeToContent(_arg1:Boolean):void{
_fitSizeToContent = _arg1;
invalidateLayout();
invalidateSize();
}
protected function drawLayout():void{
var _local1:DisplayObject;
var _local2:Constraint;
if (_fitSizeToContent){
this.width = maxChildWidth;
this.height = maxChildHeight;
};
for each (_local1 in _layoutChildren) {
_local2 = _childToConstraintDict[_local1];
if (_local2){
_local2.apply(_local1);
};
};
}
public function get maxChildHeight():Number{
var _local2:DisplayObject;
var _local1:Number = 0;
for each (_local2 in _layoutChildren) {
if (_local2.height > _local1){
_local1 = _local2.height;
};
};
return (_local1);
}
public function addChildToLayout(_arg1:DisplayObject, _arg2:Object=null):DisplayObject{
return (addChildToLayoutAt(_arg1, numChildren, _arg2));
}
override protected function componentRemoved(_arg1:AbstractComponent):void{
delete _childToConstraintDict[_arg1];
var _local2:int = _layoutChildren.indexOf(_arg1);
if (_local2 != -1){
_layoutChildren.splice(_local2, 1);
_arg1.removeEventListener(ComponentEvent.RESIZE, onComponentEventHandler);
_arg1.removeEventListener(ComponentEvent.MOVE, onComponentEventHandler);
};
invalidateLayout();
}
override public function dispose():void{
var _local1:DisplayObject;
for each (_local1 in _layoutChildren) {
_local1.removeEventListener(ComponentEvent.RESIZE, onComponentEventHandler);
_local1.removeEventListener(ComponentEvent.MOVE, onComponentEventHandler);
};
_childToConstraintDict = new Dictionary();
_layoutChildren = [];
super.dispose();
}
public function get fitSizeToContent():Boolean{
return (_fitSizeToContent);
}
public function addChildToLayoutAt(_arg1:DisplayObject, _arg2:int, _arg3:Object=null):DisplayObject{
var _local4:Constraint = new Constraint(_arg3);
if (((_local4.isPositionConstraint) || (_local4.isSizeConstraint))){
_childToConstraintDict[_arg1] = _local4;
};
_arg1.addEventListener(ComponentEvent.RESIZE, onComponentEventHandler);
_arg1.addEventListener(ComponentEvent.MOVE, onComponentEventHandler);
_layoutChildren.push(_arg1);
return (addChildAt(_arg1, _arg2));
}
}
}//package com.bigwigmedia.ui.containers
Section 151
//VBox (com.bigwigmedia.ui.containers.VBox)
package com.bigwigmedia.ui.containers {
import flash.display.*;
public class VBox extends AbstractBox {
override protected function drawLayout():void{
var _local4:DisplayObject;
var _local5:Constraint;
if (_fitSizeToContent){
this.width = maxChildWidth;
};
var _local1:Number = 0;
var _local2:int = _layoutChildren.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _layoutChildren[_local3];
_local5 = _childToConstraintDict[_local4];
if (_local5){
_local5.apply(_local4);
};
_local4.y = _local1;
_local1 = (_local1 + (_local4.height + ((_local3 < (_local2 - 1))) ? _gap : 0));
_local3++;
};
this.height = _local1;
}
}
}//package com.bigwigmedia.ui.containers
Section 152
//AbstractButtonStyle (com.bigwigmedia.ui.styles.AbstractButtonStyle)
package com.bigwigmedia.ui.styles {
public class AbstractButtonStyle {
public static const MOUSE_CLICK_HANDLER:String = "mouseClickHandler";
public static const ROLL_OVER_HANDLER:String = "rollOverHandler";
public static const BEACON:String = "beacon";
public static const ROLL_OUT_HANDLER:String = "rollOutHandler";
public static const MOUSE_DOWN_HANDLER:String = "mouseDownHandler";
}
}//package com.bigwigmedia.ui.styles
Section 153
//AbstractComponentStyle (com.bigwigmedia.ui.styles.AbstractComponentStyle)
package com.bigwigmedia.ui.styles {
public class AbstractComponentStyle {
public static const DECORATION:String = "decoration";
public static const STYLE_SHEET:String = "styleSheet";
public static const DISABLED_DECORATION:String = "disabledDecoration";
public static const TEXT_FORMAT:String = "textFormat";
public static const EMBED_FONTS:String = "embedFonts";
}
}//package com.bigwigmedia.ui.styles
Section 154
//IconicButtonStyle (com.bigwigmedia.ui.styles.IconicButtonStyle)
package com.bigwigmedia.ui.styles {
public class IconicButtonStyle {
public static const UP_DECORATION:String = "upDecoration";
public static const OVER_DECORATION:String = "overDecoration";
public static const DOWN_DECORATION:String = "downDecoration";
}
}//package com.bigwigmedia.ui.styles
Section 155
//LabelButtonStyle (com.bigwigmedia.ui.styles.LabelButtonStyle)
package com.bigwigmedia.ui.styles {
public class LabelButtonStyle {
public static const UP_STATE_COLOR:String = "upStateColor";
public static const DOWN_STATE_COLOR:String = "downStateColor";
public static const OVER_STATE_COLOR:String = "overStateColor";
}
}//package com.bigwigmedia.ui.styles
Section 156
//AbstractButton (com.bigwigmedia.ui.AbstractButton)
package com.bigwigmedia.ui {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.display.*;
import com.bigwigmedia.events.*;
import flash.utils.*;
import com.bigwigmedia.ui.styles.*;
public class AbstractButton extends AbstractComponent {
protected var _selected:Boolean;// = false
private var pressTimer:Timer;
protected var _autoRepeat:Boolean;// = false
protected var _state:String;
protected var _beaconEffect:IBeacon;
protected var _toggle:Boolean;// = false
public static const REPEAT_INTERVAL:Number = 50;
public static const REPEAT_DELAY:Number = 500;
public function AbstractButton(){
_state = ButtonState.UP;
super();
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, onPressTimerHandler);
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler, false, EventPriority.HIGH);
addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler, false, EventPriority.HIGH);
addEventListener(MouseEvent.ROLL_OVER, onMouseEventHandler, false, EventPriority.HIGH);
addEventListener(MouseEvent.ROLL_OUT, onMouseEventHandler, false, EventPriority.HIGH);
addEventListener(MouseEvent.CLICK, onMouseEventHandler, false, EventPriority.HIGH);
}
public function set beacon(_arg1:Boolean):void{
var _local2:IBeacon;
if (_arg1){
_local2 = (getStyle(AbstractButtonStyle.BEACON) as IBeacon);
if (_local2){
_beaconEffect = _local2.clone();
_beaconEffect.apply(this.beaconTarget);
};
} else {
if (_beaconEffect){
_beaconEffect.dispose();
_beaconEffect = null;
};
};
}
public function get beacon():Boolean{
return (!((_beaconEffect == null)));
}
private function onPressTimerHandler(_arg1:TimerEvent):void{
if (!_autoRepeat){
pressTimer.reset();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = REPEAT_INTERVAL;
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
override public function set enabled(_arg1:Boolean):void{
if (_enabled != _arg1){
super.enabled = _arg1;
_state = ButtonState.UP;
invalidateState();
};
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
public function get toggle():Boolean{
return (_toggle);
}
override public function dispose():void{
pressTimer.reset();
pressTimer.removeEventListener(TimerEvent.TIMER, onPressTimerHandler);
if (_beaconEffect){
_beaconEffect.dispose();
};
super.dispose();
}
public function get selected():Boolean{
return (_selected);
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set toggle(_arg1:Boolean):void{
if (_toggle != _arg1){
_toggle = _arg1;
invalidateState();
};
}
protected function get beaconTarget():DisplayObject{
throw (new Error("Method must be overriden in subclass."));
}
private function onMouseEventHandler(_arg1:MouseEvent):void{
var _local2:Function;
var _local3:Function;
var _local4:Function;
var _local5:Function;
switch (_arg1.type){
case MouseEvent.ROLL_OVER:
_local2 = (getStyle(AbstractButtonStyle.ROLL_OVER_HANDLER) as Function);
if (_local2 != null){
_local2(this);
};
_state = ButtonState.OVER;
break;
case MouseEvent.ROLL_OUT:
_local3 = (getStyle(AbstractButtonStyle.ROLL_OUT_HANDLER) as Function);
if (_local3 != null){
_local3(this);
};
_state = ButtonState.UP;
break;
case MouseEvent.MOUSE_DOWN:
_local4 = (getStyle(AbstractButtonStyle.MOUSE_DOWN_HANDLER) as Function);
if (_local4 != null){
_local4(this);
};
_state = ButtonState.DOWN;
break;
case MouseEvent.MOUSE_UP:
_state = ButtonState.OVER;
break;
case MouseEvent.CLICK:
_local5 = (getStyle(AbstractButtonStyle.MOUSE_CLICK_HANDLER) as Function);
if (_local5 != null){
_local5(this);
};
if (_toggle){
selected = !(selected);
};
return;
};
if (_state == ButtonState.DOWN){
if (_autoRepeat){
pressTimer.delay = REPEAT_DELAY;
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
} else {
pressTimer.reset();
};
invalidateState();
}
public function set selected(_arg1:Boolean):void{
if (_selected != _arg1){
_selected = _arg1;
if (_toggle){
dispatchEvent(new ComponentEvent(ComponentEvent.CHANGE, true));
invalidateState();
};
};
}
public static function get defaultStyles():Object{
var _local1:Object = {rollOverHandler:null, rollOutHandler:null, mouseDownHandler:null, mouseClickHandler:null, beacon:null};
return (_local1);
}
}
}//package com.bigwigmedia.ui
Section 157
//AbstractComponent (com.bigwigmedia.ui.AbstractComponent)
package com.bigwigmedia.ui {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import com.bigwigmedia.display.*;
import flash.text.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.ui.styles.*;
public class AbstractComponent extends Sprite implements IDisposable {
protected var _enabled:Boolean;// = true
protected var _sharedStyles:Object;
private var invalidateStylesFlag:Boolean;// = false
private var _nestLevel:int;// = 0
protected var _explicitHeight:Number;// = NAN
private var invalidateStateFlag:Boolean;// = false
protected var _visible:Boolean;// = true
private var invalidateSizeFlag:Boolean;// = false
protected var _explicitWidth:Number;// = NAN
protected var _instanceStyles:Object;
private static var _enterFrameBeacon:Shape = new Shape();
private static var _styleManager:IStyleManager;
public function AbstractComponent(){
_instanceStyles = {};
_sharedStyles = {};
super();
super.visible = false;
tabEnabled = false;
styleManager.registerComponent(this);
createChildren();
invalidateAll();
}
public function setSize(_arg1:Number, _arg2:Number):void{
var _local3:Number = Math.round(_arg1);
var _local4:Number = Math.round(_arg2);
var _local5:Boolean;
if (_explicitWidth != _local3){
_explicitWidth = _local3;
_local5 = true;
};
if (_explicitHeight != _local4){
_explicitHeight = _local4;
_local5 = true;
};
if (_local5){
invalidateSize();
};
}
bigwigmedia_ns function setSharedStyle(_arg1:String, _arg2:Object):void{
_sharedStyles[_arg1] = _arg2;
invalidateAll();
}
override public function set width(_arg1:Number):void{
setSize(_arg1, height);
}
public function set enabled(_arg1:Boolean):void{
if (_enabled != _arg1){
_enabled = _arg1;
mouseEnabled = _arg1;
invalidateStyles();
};
}
public function set scale(_arg1:Number):void{
this.scaleX = (this.scaleY = _arg1);
}
private function enterFrameHandler(_arg1:Event):void{
_enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
draw();
}
protected function invalidateState():void{
invalidateStateFlag = true;
callLater();
}
public function set nestLevel(_arg1:int):void{
if (_nestLevel == _arg1){
return;
};
_nestLevel = _arg1;
callLater();
var _local2:DisplayObjectContainer = this.parent;
while ((_local2 is AbstractComponent)) {
AbstractComponent(_local2).callLater();
_local2 = _local2.parent;
};
}
protected function createChildren():void{
}
protected function validate():void{
invalidateSizeFlag = false;
invalidateStateFlag = false;
invalidateStylesFlag = false;
}
public function dispose():void{
_enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
styleManager.unregisterComponent(this);
_instanceStyles = {};
_sharedStyles = {};
}
public function get nestLevel():int{
return (_nestLevel);
}
override public function get height():Number{
return ((isNaN(_explicitHeight)) ? super.height : _explicitHeight);
}
override public function getBounds(_arg1:DisplayObject):Rectangle{
return (new Rectangle(super.x, super.y, this.width, this.height));
}
protected function drawState():void{
}
public function get enabled():Boolean{
return (_enabled);
}
protected function drawStyles():void{
}
protected function draw():void{
var _local3:IDecoration;
var _local1:Number = this.width;
var _local2:Number = this.height;
if (invalidateStylesFlag){
drawStyles();
_local3 = (getStyle((_enabled) ? AbstractComponentStyle.DECORATION : AbstractComponentStyle.DISABLED_DECORATION) as IDecoration);
if (_local3){
_local3.apply(this);
};
};
if (invalidateStateFlag){
drawState();
};
if (((((invalidateSizeFlag) || (!((_local1 == this.width))))) || (!((_local2 == this.height))))){
measureSizes();
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE));
};
validate();
if (((_visible) && (!(super.visible)))){
visible = true;
};
}
override public function get width():Number{
return ((isNaN(_explicitWidth)) ? super.width : _explicitWidth);
}
protected function callLater():void{
_enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
_enterFrameBeacon.addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, nestLevel);
}
public function move(_arg1:Number, _arg2:Number):void{
var _local3:Number = Math.round(_arg1);
var _local4:Number = Math.round(_arg2);
var _local5:Boolean;
if (super.x != _local3){
super.x = _local3;
_local5 = true;
};
if (super.y != _local4){
super.y = _local4;
_local5 = true;
};
if (_local5){
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
};
}
protected function measureSizes():void{
}
override public function set height(_arg1:Number):void{
setSize(width, _arg1);
}
protected function invalidateSize():void{
invalidateSizeFlag = true;
callLater();
}
override public function set visible(_arg1:Boolean):void{
_visible = _arg1;
super.visible = _arg1;
}
public function setStyle(_arg1:String, _arg2:Object):void{
if (_arg2 === null){
delete _instanceStyles[_arg1];
};
_instanceStyles[_arg1] = _arg2;
invalidateAll();
}
override public function set x(_arg1:Number):void{
move(_arg1, super.y);
}
override public function set y(_arg1:Number):void{
move(super.x, _arg1);
}
protected function invalidateAll():void{
invalidateSizeFlag = true;
invalidateStateFlag = true;
invalidateStylesFlag = true;
callLater();
}
override public function get visible():Boolean{
return (_visible);
}
public function getStyle(_arg1:String):Object{
var _local2:Object = (_instanceStyles.hasOwnProperty(_arg1)) ? _instanceStyles[_arg1] : _sharedStyles[_arg1];
return (_local2);
}
protected function invalidateStyles():void{
invalidateStylesFlag = true;
callLater();
}
public static function get defaultStyles():Object{
var _local1:Object = {textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), styleSheet:null, embedFonts:false, disabledDecoration:null, decoration:null};
return (_local1);
}
protected static function get styleManager():IStyleManager{
if (!_styleManager){
_styleManager = IStyleManager(Singleton.getInstance("com.bigwigmedia.ui::IStyleManager"));
};
return (_styleManager);
}
}
}//package com.bigwigmedia.ui
Section 158
//AbstractContainer (com.bigwigmedia.ui.AbstractContainer)
package com.bigwigmedia.ui {
import flash.display.*;
import flash.utils.*;
public class AbstractContainer extends AbstractComponent {
protected var _minHeight:Number;// = 0
protected var _maxWidth:Number;// = 10000
protected var _maxHeight:Number;// = 10000
protected var _components:Dictionary;
protected var _minWidth:Number;// = 0
public function AbstractContainer(){
_components = new Dictionary();
super();
}
override public function setSize(_arg1:Number, _arg2:Number):void{
var _local3:Number = Math.round(_arg1);
var _local4:Number = Math.round(_arg2);
if (_local3 < _minWidth){
_local3 = _minWidth;
} else {
if (_local3 > _maxWidth){
_local3 = _maxWidth;
};
};
if (_local4 < _minHeight){
_local4 = _minHeight;
} else {
if (_local4 > _maxHeight){
_local4 = _maxHeight;
};
};
var _local5:Boolean;
if (_explicitWidth != _local3){
_explicitWidth = _local3;
_local5 = true;
};
if (_explicitHeight != _local4){
_explicitHeight = _local4;
_local5 = true;
};
if (_local5){
invalidateSize();
};
}
public function set maxWidth(_arg1:Number):void{
_maxWidth = _arg1;
setSize(width, height);
}
override public function set enabled(_arg1:Boolean):void{
var _local2:Object;
for (_local2 in _components) {
AbstractComponent(_local2).enabled = _arg1;
};
super.enabled = _arg1;
}
protected function componentAdded(_arg1:AbstractComponent):void{
}
override public function removeChildAt(_arg1:int):DisplayObject{
var _local2:AbstractComponent = (getChildAt(_arg1) as AbstractComponent);
if (((_local2) && (_components[_local2]))){
delete _components[_local2];
componentRemoved(_local2);
};
var _local3:DisplayObject = getChildAt(_arg1);
return (super.removeChildAt(_arg1));
}
override public function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject{
var _local3:AbstractComponent = (_arg1 as AbstractComponent);
if (((_local3) && (!(_components[_local3])))){
_components[_local3] = true;
if (_local3.nestLevel <= this.nestLevel){
_local3.nestLevel = (this.nestLevel + 1);
};
componentAdded(_local3);
};
return (super.addChildAt(_arg1, _arg2));
}
public function get maxWidth():Number{
return (_maxWidth);
}
public function get minWidth():Number{
return (_minWidth);
}
public function set maxHeight(_arg1:Number):void{
_maxHeight = _arg1;
setSize(width, height);
}
public function get minHeight():Number{
return (_minHeight);
}
override public function set nestLevel(_arg1:int):void{
var _local2:Object;
var _local3:AbstractComponent;
super.nestLevel = _arg1;
for (_local2 in _components) {
_local3 = (_local2 as AbstractComponent);
if (_local3.nestLevel <= this.nestLevel){
_local3.nestLevel = (this.nestLevel + 1);
};
};
}
protected function componentRemoved(_arg1:AbstractComponent):void{
}
public function set minWidth(_arg1:Number):void{
_minWidth = _arg1;
setSize(width, height);
}
public function get maxHeight():Number{
return (_maxHeight);
}
override public function dispose():void{
var _local1:Object;
for (_local1 in _components) {
AbstractComponent(_local1).dispose();
};
_components = new Dictionary();
super.dispose();
}
public function set minHeight(_arg1:Number):void{
_minHeight = _arg1;
setSize(width, height);
}
override public function removeChild(_arg1:DisplayObject):DisplayObject{
var _local2:int = this.getChildIndex(_arg1);
return (removeChildAt(_local2));
}
override public function addChild(_arg1:DisplayObject):DisplayObject{
return (addChildAt(_arg1, numChildren));
}
}
}//package com.bigwigmedia.ui
Section 159
//ButtonState (com.bigwigmedia.ui.ButtonState)
package com.bigwigmedia.ui {
public class ButtonState {
public static const DOWN:String = "down";
public static const OVER:String = "over";
public static const UP:String = "up";
}
}//package com.bigwigmedia.ui
Section 160
//Console (com.bigwigmedia.ui.Console)
package com.bigwigmedia.ui {
import flash.display.*;
import com.bigwigmedia.application.*;
import flash.events.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.input.*;
public class Console {
private static var _view:ConsoleView;
private static var _active:Boolean = false;
private static var keyInputMan:KeyInputManager;
private static var toggleKeyCode:uint;
private static var _stage:Stage;
private static function onKeyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == toggleKeyCode){
toggle();
};
}
private static function onKeySequenceHandler(_arg1:KeyInputEvent):void{
if (_arg1.keyAction == "toggle_console"){
toggle();
};
}
private static function toggle():void{
_active = !(_active);
if (_active){
_stage.addChild(_view);
_stage.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
} else {
_stage.removeChild(_view);
_stage.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
};
}
private static function onEnterFrameHandler(_arg1:Event):void{
_view.update();
}
public static function initialize(_arg1:Array=null):void{
if (_view){
return;
};
_view = new ConsoleView();
_stage = ApplicationGlobals.application.stage;
if (!_arg1){
toggleKeyCode = 67;
_stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);
} else {
keyInputMan = new KeyInputManager(_stage);
keyInputMan.mapSequence("toggle_console", _arg1);
keyInputMan.addEventListener(KeyInputEvent.SEQUENCE, onKeySequenceHandler);
};
}
}
}//package com.bigwigmedia.ui
import flash.display.*;
import com.bigwigmedia.application.*;
import flash.events.*;
import flash.utils.*;
import com.bigwigmedia.core.*;
import flash.text.*;
import flash.system.*;
class ConsoleView extends Sprite implements IUpdatable {
private var maxMemory:int;
private var infoField:TextField;
private var viewMode:int;// = 0
private var tfDelay:int;// = 0
private var minMemory:int;
private var firstDraw:Boolean;// = true
private var tfTimer:int;
public static const PROFILER:int = 0;
public static const UPDATE_DELAY:int = 10;
public static const INFO:int = 1;
private function ConsoleView(){
infoField = new TextField();
infoField.defaultTextFormat = new TextFormat("_sans", 10);
infoField.selectable = false;
infoField.x = 1;
infoField.y = 0;
infoField.multiline = true;
addChild(infoField);
this.mouseChildren = false;
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
minMemory = (maxMemory = System.totalMemory);
tfTimer = getTimer();
draw();
}
private function draw():void{
var _local1:ApplicationInfo;
graphics.clear();
graphics.lineStyle(0, 0, 1, true);
graphics.beginFill(0x666666, 1);
switch (viewMode){
case ConsoleView.PROFILER:
infoField.autoSize = TextFieldAutoSize.LEFT;
infoField.htmlText = "";
graphics.drawRect(0, 0, 80, 56);
break;
case ConsoleView.INFO:
infoField.autoSize = TextFieldAutoSize.LEFT;
_local1 = ApplicationGlobals.application.info;
infoField.htmlText = (((((((((((((("<font color='#FFFFFF'>" + "APP: ") + _local1.name) + "\nID: ") + _local1.id) + "\nVER: ") + _local1.version) + "\nFP: ") + Capabilities.version) + " ") + Capabilities.playerType) + (Capabilities.isDebugger) ? " DEBUG" : " RELEASE") + "\nSANDBOX: ") + Security.sandboxType) + "</font>");
graphics.drawRect(0, 0, (infoField.width + 4), 68);
break;
};
graphics.endFill();
}
public function update():void{
var _local1:int;
var _local2:Number;
if (++tfDelay >= UPDATE_DELAY){
tfDelay = 0;
_local1 = System.totalMemory;
if (_local1 > maxMemory){
maxMemory = _local1;
};
if (_local1 < minMemory){
minMemory = _local1;
};
_local2 = ((1000 * UPDATE_DELAY) / (getTimer() - tfTimer));
tfTimer = getTimer();
switch (viewMode){
case ConsoleView.PROFILER:
infoField.htmlText = ((((((((((("<font color='#FFFFFF'>FPS: " + _local2.toFixed(2)) + "</font>\n") + "<font color='#9FCFFF'>MEM: ") + bytesToString(_local1)) + "</font>\n") + "<font color='#FFCC00'>MAX: ") + bytesToString(maxMemory)) + "</font>\n") + "<font color='#00FF00'>MIN: ") + bytesToString(minMemory)) + "</font>");
break;
};
};
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
viewMode++;
if (viewMode > ConsoleView.INFO){
viewMode = ConsoleView.PROFILER;
};
draw();
}
private function bytesToString(_arg1:uint):String{
var _local2:String;
if (_arg1 < 0x0400){
_local2 = (String(_arg1) + "b");
} else {
if (_arg1 < 0x2800){
_local2 = (Number((_arg1 / 0x0400)).toFixed(2) + "kb");
} else {
if (_arg1 < 102400){
_local2 = (Number((_arg1 / 0x0400)).toFixed(1) + "kb");
} else {
if (_arg1 < 0x100000){
_local2 = ((_arg1 >> 10) + "kb");
} else {
if (_arg1 < 0xA00000){
_local2 = (Number((_arg1 / 0x100000)).toFixed(2) + "mb");
} else {
if (_arg1 < 104857600){
_local2 = (Number((_arg1 / 0x100000)).toFixed(1) + "mb");
} else {
_local2 = ((_arg1 >> 20) + "mb");
};
};
};
};
};
};
return (_local2);
}
}
Section 161
//ContextMenu_2DPlay (com.bigwigmedia.ui.ContextMenu_2DPlay)
package com.bigwigmedia.ui {
import flash.events.*;
import flash.ui.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.net.*;
public class ContextMenu_2DPlay {
private static var moreGamesItem:ContextMenuItem = new ContextMenuItem("Play more games");
private static var getGameItem:ContextMenuItem = new ContextMenuItem("Get game for your site");
private static var scoresItem:ContextMenuItem = new ContextMenuItem("High scores");
private static var downloadItem:ContextMenuItem = new ContextMenuItem("Download this game");
private static var menu:ContextMenu;
private static function onMenuItemSelect(_arg1:ContextMenuEvent):void{
var _local2:IURLCaller = IURLCaller(Singleton.getInstance("com.bigwigmedia.net::IURLCaller"));
switch (_arg1.target){
case scoresItem:
_local2.viewScores();
break;
case moreGamesItem:
_local2.playMoreGames();
break;
case getGameItem:
_local2.getGame();
break;
case downloadItem:
_local2.downloadGame();
break;
};
}
public static function getEmptyMenu():ContextMenu{
var _local1:ContextMenu = new ContextMenu();
_local1.hideBuiltInItems();
return (_local1);
}
public static function getMenu():ContextMenu{
Singleton.registerClass("com.bigwigmedia.net::IURLCaller", URLCaller_2DPlay);
if (!menu){
menu = getEmptyMenu();
scoresItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect);
moreGamesItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect);
getGameItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect);
downloadItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect);
menu.customItems.push(scoresItem);
menu.customItems.push(moreGamesItem);
menu.customItems.push(getGameItem);
menu.customItems.push(downloadItem);
};
return (menu);
}
}
}//package com.bigwigmedia.ui
Section 162
//CursorManager (com.bigwigmedia.ui.CursorManager)
package com.bigwigmedia.ui {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.application.*;
import flash.errors.*;
import flash.ui.*;
public class CursorManager implements ICursorManager {
private var cursorLeftStage:Boolean;
private var nextCursorID:int;// = 1
private var _currentCursorID:int;// = 0
private var cursorQueue:Array;
private var cursorHolder:Sprite;
private var _currentCursor:DisplayObject;
private var stage:Stage;
bigwigmedia_ns static var singletonAccessor:Boolean = true;
public function CursorManager(){
cursorQueue = [];
super();
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of CursorManager."));
};
stage = ApplicationGlobals.application.stage;
cursorHolder = ApplicationGlobals.application.cursorHolder;
}
public function get currentCursor():DisplayObject{
return (_currentCursor);
}
public function removeCursor(_arg1:int):void{
var _local2:int = cursorQueue.length;
var _local3:int;
while (_local3 < _local2) {
if (cursorQueue[_local3].id == _arg1){
cursorQueue.splice(_local3, 1);
showCurrentCursor();
break;
};
_local3++;
};
}
public function get currentCursorID():int{
return (_currentCursorID);
}
private function removeCustomEventHandlers():void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler, true);
stage.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler, true);
var _local1:ContextMenu = InteractiveObject(ApplicationGlobals.application).contextMenu;
if (_local1){
_local1.removeEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelectHandler);
};
}
private function addCustomEventHandlers():void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler, true);
stage.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler, true);
var _local1:ContextMenu = InteractiveObject(ApplicationGlobals.application).contextMenu;
if (_local1){
_local1.addEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelectHandler);
};
}
private function onMouseMoveHandler(_arg1:MouseEvent):void{
cursorHolder.x = stage.mouseX;
cursorHolder.y = stage.mouseY;
var _local2:Object = _arg1.target;
if ((((_local2 is TextField)) && ((_local2.type == TextFieldType.INPUT)))){
cursorVisible = false;
Mouse.show();
} else {
cursorVisible = true;
};
if (cursorLeftStage){
cursorLeftStage = false;
cursorVisible = true;
};
if (cursorQueue.length > 0){
Mouse.hide();
};
}
public function setCursor(_arg1:Class, _arg2:int=2):int{
var _local3:int = nextCursorID++;
cursorQueue.push(new CursorInfo(_arg1, _local3, _arg2));
cursorQueue.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
showCurrentCursor();
return (_local3);
}
private function onMouseOutHandler(_arg1:MouseEvent):void{
if ((((_arg1.relatedObject == null)) && ((cursorQueue.length > 0)))){
stage.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
};
}
private function onContextMenuSelectHandler(_arg1:ContextMenuEvent):void{
stage.addEventListener(MouseEvent.MOUSE_OVER, contextMenuMouseOverHandler, true);
}
public function removeAllCursors():void{
cursorQueue = [];
showCurrentCursor();
}
private function showCurrentCursor():void{
var _local1:CursorInfo;
if (cursorQueue.length > 0){
_local1 = cursorQueue[0];
if (_local1.id != _currentCursorID){
if (_currentCursor){
cursorHolder.removeChild(_currentCursor);
};
_currentCursor = new _local1.cursorClass();
if (_currentCursor){
if ((_currentCursor is InteractiveObject)){
InteractiveObject(_currentCursor).mouseEnabled = false;
};
cursorHolder.x = stage.mouseX;
cursorHolder.y = stage.mouseY;
cursorHolder.addChild(_currentCursor);
_currentCursorID = _local1.id;
addCustomEventHandlers();
};
};
Mouse.hide();
} else {
if (_currentCursorID != 0){
_currentCursorID = 0;
cursorHolder.removeChild(_currentCursor);
_currentCursor = null;
removeCustomEventHandlers();
};
Mouse.show();
};
}
public function set cursorVisible(_arg1:Boolean):void{
if (cursorHolder){
cursorHolder.visible = _arg1;
};
}
private function onEnterFrameHandler(_arg1:Event):void{
stage.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
cursorLeftStage = true;
cursorVisible = false;
Mouse.show();
}
private function contextMenuMouseOverHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_OVER, contextMenuMouseOverHandler, true);
onMouseMoveHandler(_arg1);
}
}
}//package com.bigwigmedia.ui
class CursorInfo {
public var cursorClass:Class;
public var priority:int;
public var id:int;
private function CursorInfo(_arg1:Class, _arg2:int, _arg3:int){
this.cursorClass = _arg1;
this.id = _arg2;
this.priority = _arg3;
}
}
Section 163
//IconicButton (com.bigwigmedia.ui.IconicButton)
package com.bigwigmedia.ui {
import flash.display.*;
import com.bigwigmedia.display.*;
import flash.utils.*;
import com.bigwigmedia.ui.styles.*;
public class IconicButton extends AbstractButton {
private var _upIcon:DisplayObject;// = null
private var _currentIcon:DisplayObject;// = null
private var _overIcon:DisplayObject;// = null
private var _downIcon:DisplayObject;// = null
public function IconicButton(_arg1:Object=null, _arg2:Object=null, _arg3:Object=null){
this.upIcon = ((_arg1) || (DefaultIcon));
if (_arg2){
this.overIcon = _arg2;
};
if (_arg3){
this.downIcon = _arg3;
};
super();
}
public function set overIcon(_arg1:Object):void{
_overIcon = getIconDisplayObject(_arg1);
invalidateAll();
}
public function set upIcon(_arg1:Object):void{
_upIcon = getIconDisplayObject(_arg1);
invalidateAll();
}
override protected function createChildren():void{
setNewIcon(_upIcon);
}
private function getIconDisplayObject(_arg1:Object):DisplayObject{
if ((_arg1 is Class) == false){
return (DisplayObject(_arg1));
};
if (getQualifiedSuperclassName(_arg1) == "flash.display::BitmapData"){
return (new Bitmap(new _arg1(0, 0)));
};
return (new (_arg1));
}
override protected function get beaconTarget():DisplayObject{
return (_upIcon);
}
public function set downIcon(_arg1:Object):void{
_downIcon = getIconDisplayObject(_arg1);
invalidateAll();
}
private function setNewIcon(_arg1:DisplayObject):void{
if (_currentIcon == _arg1){
return;
};
if (_currentIcon){
removeChild(_currentIcon);
};
_currentIcon = _arg1;
measureSizes();
addChild(_currentIcon);
}
override protected function measureSizes():void{
if (((!(isNaN(_explicitWidth))) && (!(isNaN(_explicitHeight))))){
_currentIcon.width = _explicitWidth;
_currentIcon.height = _explicitHeight;
};
}
override protected function drawState():void{
var _local1:IDecoration;
switch (_state){
case ButtonState.UP:
setNewIcon(_upIcon);
_local1 = (getStyle(IconicButtonStyle.UP_DECORATION) as IDecoration);
break;
case ButtonState.OVER:
setNewIcon(((_overIcon) || (_upIcon)));
_local1 = (getStyle(IconicButtonStyle.OVER_DECORATION) as IDecoration);
break;
case ButtonState.DOWN:
setNewIcon(((_downIcon) || (((_overIcon) || (_upIcon)))));
_local1 = (getStyle(IconicButtonStyle.DOWN_DECORATION) as IDecoration);
break;
};
if (_local1){
_local1.apply(_currentIcon);
};
}
override public function dispose():void{
if (_currentIcon){
removeChild(_currentIcon);
};
_currentIcon = null;
_upIcon = null;
_overIcon = null;
_downIcon = null;
super.dispose();
}
public static function get defaultStyles():Object{
var _local1:Object = {upDecoration:null, overDecoration:null, downDecoration:null};
return (_local1);
}
}
}//package com.bigwigmedia.ui
import flash.display.*;
import flash.geom.*;
class DefaultIcon extends Shape {
public static const WIDTH:Number = 32;
public static const HEIGHT:Number = 24;
private function DefaultIcon(){
graphics.beginFill(0x333333, 1);
graphics.drawRect(0, 0, WIDTH, HEIGHT);
graphics.endFill();
var _local1:Matrix = new Matrix();
_local1.createGradientBox((WIDTH - 2), (HEIGHT - 2), (Math.PI / 2), 0, 0);
graphics.beginGradientFill(GradientType.LINEAR, [0xFFFFFF, 0xCCCCCC], [1, 1], [0, 0xFF], _local1);
graphics.drawRect(1, 1, (WIDTH - 2), (HEIGHT - 2));
graphics.endFill();
this.scale9Grid = new Rectangle(1, 1, (WIDTH - 2), (HEIGHT - 2));
}
}
Section 164
//ICursorManager (com.bigwigmedia.ui.ICursorManager)
package com.bigwigmedia.ui {
import flash.display.*;
public interface ICursorManager {
function removeAllCursors():void;
function removeCursor(_arg1:int):void;
function get currentCursor():DisplayObject;
function setCursor(_arg1:Class, _arg2:int=2):int;
function get currentCursorID():int;
function set cursorVisible(_arg1:Boolean):void;
}
}//package com.bigwigmedia.ui
Section 165
//IStyleManager (com.bigwigmedia.ui.IStyleManager)
package com.bigwigmedia.ui {
public interface IStyleManager {
function unregisterComponent(_arg1:AbstractComponent):void;
function registerComponent(_arg1:AbstractComponent):void;
function setSharedStyle(_arg1:Class, _arg2:String, _arg3:Object):void;
}
}//package com.bigwigmedia.ui
Section 166
//Label (com.bigwigmedia.ui.Label)
package com.bigwigmedia.ui {
import flash.text.*;
import com.bigwigmedia.ui.styles.*;
public class Label extends AbstractComponent {
protected var _text:String;
protected var _textField:TextField;
protected var _selectable:Boolean;// = false
protected var _htmlText:String;
public function Label(_arg1:String=""){
_text = _arg1;
super();
mouseChildren = false;
mouseEnabled = false;
}
public function set selectable(_arg1:Boolean):void{
_textField.selectable = _arg1;
}
public function get text():String{
return (_text);
}
override protected function drawStyles():void{
var _local2:TextFormat;
_textField.embedFonts = (getStyle(AbstractComponentStyle.EMBED_FONTS) as Boolean);
var _local1:StyleSheet = (getStyle(AbstractComponentStyle.STYLE_SHEET) as StyleSheet);
if (_local1){
_textField.styleSheet = _local1;
} else {
_textField.styleSheet = null;
_local2 = (getStyle(AbstractComponentStyle.TEXT_FORMAT) as TextFormat);
if (_local2){
_textField.setTextFormat(_local2);
_textField.defaultTextFormat = _local2;
};
};
}
override protected function drawState():void{
if (_htmlText != null){
_textField.htmlText = _htmlText;
} else {
_textField.text = _text;
};
}
public function set htmlText(_arg1:String):void{
if (_htmlText != _arg1){
_text = null;
_htmlText = _arg1;
invalidateSize();
invalidateState();
};
}
override protected function measureSizes():void{
_textField.width = this.width;
_textField.height = this.height;
}
public function get selectable():Boolean{
return (_textField.selectable);
}
public function set text(_arg1:String):void{
if (_text != _arg1){
_text = _arg1;
_htmlText = null;
invalidateSize();
invalidateState();
};
}
override protected function createChildren():void{
_textField = new TextField();
_textField.background = false;
_textField.wordWrap = false;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.text = _text;
addChild(_textField);
}
public function get htmlText():String{
return (_htmlText);
}
}
}//package com.bigwigmedia.ui
Section 167
//LabelButton (com.bigwigmedia.ui.LabelButton)
package com.bigwigmedia.ui {
import flash.display.*;
import flash.text.*;
import com.bigwigmedia.ui.styles.*;
public class LabelButton extends AbstractButton {
protected var _labelField:TextField;
protected var _label:String;
public function LabelButton(_arg1:String=""){
_label = _arg1;
super();
}
override protected function createChildren():void{
_labelField = new TextField();
_labelField.type = TextFieldType.DYNAMIC;
_labelField.selectable = false;
_labelField.autoSize = TextFieldAutoSize.LEFT;
_labelField.text = _label;
addChild(_labelField);
}
override protected function drawStyles():void{
_labelField.embedFonts = (getStyle(AbstractComponentStyle.EMBED_FONTS) as Boolean);
var _local1:TextFormat = (getStyle(AbstractComponentStyle.TEXT_FORMAT) as TextFormat);
if (_local1){
_labelField.setTextFormat(_local1);
_labelField.defaultTextFormat = _local1;
};
}
public function set label(_arg1:String):void{
if (_label != _arg1){
_labelField.text = (_label = _arg1);
invalidateSize();
};
}
override protected function drawState():void{
switch (_state){
case ButtonState.UP:
_labelField.textColor = (getStyle(LabelButtonStyle.UP_STATE_COLOR) as uint);
break;
case ButtonState.OVER:
_labelField.textColor = (getStyle(LabelButtonStyle.OVER_STATE_COLOR) as uint);
break;
case ButtonState.DOWN:
_labelField.textColor = (getStyle(LabelButtonStyle.DOWN_STATE_COLOR) as uint);
break;
};
}
override protected function measureSizes():void{
graphics.clear();
graphics.lineStyle();
graphics.beginFill(0xFFFFFF, 0);
graphics.drawRect(0, 0, this.width, this.height);
}
public function get label():String{
return (_label);
}
override protected function get beaconTarget():DisplayObject{
return (_labelField);
}
public static function get defaultStyles():Object{
var _local1:Object = {upStateColor:0xFFFFFF, overStateColor:0xFF0000, downStateColor:0x880000};
return (_local1);
}
}
}//package com.bigwigmedia.ui
Section 168
//StyleManager (com.bigwigmedia.ui.StyleManager)
package com.bigwigmedia.ui {
import flash.utils.*;
import com.bigwigmedia.core.*;
import flash.errors.*;
public class StyleManager implements IStyleManager {
private var cachedStylesHash:Dictionary;
private var sharedStylesHash:Dictionary;
private var _components:Dictionary;
bigwigmedia_ns static var singletonAccessor:Boolean = false;
public function StyleManager(){
sharedStylesHash = new Dictionary();
cachedStylesHash = new Dictionary();
_components = new Dictionary();
super();
if (!bigwigmedia_ns::singletonAccessor){
throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of StyleManager."));
};
}
public function unregisterComponent(_arg1:AbstractComponent):void{
if (_components[_arg1]){
delete _components[_arg1];
};
}
public function registerComponent(_arg1:AbstractComponent):void{
var _local2:Object;
var _local3:String;
if (!_components[_arg1]){
_components[_arg1] = true;
_local2 = getMergedSharedStyles(_arg1);
for (_local3 in _local2) {
var _local6 = _arg1;
_local6.bigwigmedia_ns::setSharedStyle(_local3, _local2[_local3]);
};
};
}
private function invalidateSharedStyles(_arg1:Class):void{
var _local2:Object;
var _local3:AbstractComponent;
var _local4:Object;
var _local5:String;
for each (_local2 in _components) {
_local3 = (_local2 as AbstractComponent);
if ((_local3 is _arg1)){
_local4 = getMergedSharedStyles(_local3);
for (_local5 in _local4) {
var _local10 = _local3;
_local10.bigwigmedia_ns::setSharedStyle(_local5, _local4[_local5]);
};
};
};
}
private function getMergedSharedStyles(_arg1:AbstractComponent):Object{
var _local5:String;
var _local6:Class;
var _local7:Object;
var _local8:String;
var _local2:Class = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
if (cachedStylesHash[_local2]){
return (cachedStylesHash[_local2]);
};
var _local3:Object = getSharedStyle(_local2);
var _local4:Object = {};
for (_local5 in _local3) {
_local4[_local5] = _local3[_local5];
};
_local6 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
while (true) {
_local7 = getSharedStyle(_local6);
for (_local8 in _local7) {
if (_local4[_local8] === undefined){
_local4[_local8] = _local7[_local8];
};
};
if (getQualifiedClassName(_local6) == "com.bigwigmedia.ui::AbstractComponent"){
break;
} else {
_local6 = (getDefinitionByName(getQualifiedSuperclassName(_local6)) as Class);
};
};
cachedStylesHash[_local2] = _local4;
return (_local4);
}
private function getSharedStyle(_arg1:Class):Object{
var _local2:Object;
if (!sharedStylesHash[_arg1]){
_local2 = _arg1["defaultStyles"];
sharedStylesHash[_arg1] = ((_local2) || (new Object()));
};
return (sharedStylesHash[_arg1]);
}
public function setSharedStyle(_arg1:Class, _arg2:String, _arg3:Object):void{
var _local4:Object = getSharedStyle(_arg1);
_local4[_arg2] = _arg3;
cachedStylesHash = new Dictionary();
invalidateSharedStyles(_arg1);
}
}
}//package com.bigwigmedia.ui
Section 169
//StyleUtil (com.bigwigmedia.ui2.utils.StyleUtil)
package com.bigwigmedia.ui2.utils {
import flash.text.*;
import flash.filters.*;
import flash.utils.*;
public class StyleUtil {
public static function getType(_arg1:String):String{
if (_arg1.indexOf("(") > 0){
return (_arg1.substr(0, _arg1.indexOf("(")));
};
return (null);
}
public static function parseStyleValue(_arg1:String){
var _local4:String;
var _local2:String = getType(_arg1);
if (_local2){
_local4 = getPropsString(_arg1);
switch (_local2){
case "TextFormat":
return (textFormatFromString(_local4));
case "Class":
return ((getDefinitionByName(_local4) as Class));
default:
return (typeFromString(_local2, _local4));
};
};
switch (_arg1){
case "true":
return (true);
case "false":
return (false);
case "null":
return (null);
};
if (_arg1.indexOf("0x") == 0){
return (parseInt(_arg1));
};
var _local3:Number = parseFloat(_arg1);
if (!isNaN(_local3)){
return (_local3);
};
return (_arg1);
}
public static function parsePropsPairs(_arg1:String):Object{
var _local6:Array;
var _local2:Array = _arg1.split(",");
var _local3:Object = {};
var _local4:int = _local2.length;
var _local5:int;
while (_local5 < _local4) {
_local6 = _local2[_local5].split("=");
_local3[_local6[0]] = _local6[1];
_local5++;
};
return (_local3);
}
private static function typeFromString(_arg1:String, _arg2:String):Object{
var _local3:Class = (getDefinitionByName(_arg1) as Class);
if (((_local3) && (("fromString" in _local3)))){
return (_local3["fromString"](_arg2));
};
throw (new ArgumentError((("Type \"" + _arg1) + "\" is not supported.")));
}
public static function filterFromString(_arg1:String):BitmapFilter{
var _local2:Object = parsePropsPairs(getPropsString(_arg1));
var _local3:Class = (getDefinitionByName(("flash.filters::" + getType(_arg1))) as Class);
return ((constructAndAssignParams(_local3, _local2) as BitmapFilter));
}
public static function getPropsString(_arg1:String):String{
return (_arg1.substring((_arg1.indexOf("(") + 1), _arg1.lastIndexOf(")")));
}
private static function constructAndAssignParams(_arg1:Class, _arg2:Object):Object{
var _local4:String;
var _local5:String;
var _local3:Object = new (_arg1);
for (_local4 in _arg2) {
if ((_local4 in _local3)){
_local5 = _arg2[_local4];
if ((_local3[_local4] is Boolean)){
_local3[_local4] = (_local5 == "true");
} else {
if ((_local3[_local4] is String)){
_local3[_local4] = _local5;
} else {
if ((_local3[_local4] is Number)){
if (_local5.indexOf("0x") == 0){
_local3[_local4] = parseInt(_local5);
} else {
_local3[_local4] = parseFloat(_local5);
};
} else {
if ((_local3[_local4] is Array)){
trace("Not supported yet");
};
};
};
};
};
};
return (_local3);
}
public static function textFormatFromString(_arg1:String):TextFormat{
var _local2:Object = parsePropsPairs(_arg1);
var _local3:TextFormat = new TextFormat(((_local2.font === undefined)) ? null : _local2.font, ((_local2.size === undefined)) ? null : Number(_local2.size), ((_local2.color === undefined)) ? null : Number(_local2.color), ((_local2.bold === undefined)) ? null : (_local2.bold == "true"), ((_local2.italic === undefined)) ? null : (_local2.italic == "true"), ((_local2.underline === undefined)) ? null : (_local2.underline == "true"), ((_local2.url === undefined)) ? null : _local2.url, ((_local2.target === undefined)) ? null : _local2.target, ((_local2.align === undefined)) ? null : _local2.align, ((_local2.leftMargin === undefined)) ? null : Number(_local2.leftMargin), ((_local2.rightMargin === undefined)) ? null : Number(_local2.rightMargin), ((_local2.indent === undefined)) ? null : Number(_local2.indent), ((_local2.leading === undefined)) ? null : Number(_local2.leading));
return (_local3);
}
}
}//package com.bigwigmedia.ui2.utils
Section 170
//AStar (com.bigwigmedia.utils.aStar.AStar)
package com.bigwigmedia.utils.aStar {
import com.bigwigmedia.core.*;
public class AStar implements IDisposable {
private var _closedHash:Object;
private var _heuristic:Function;
private var _testCorners:Boolean;
private var _walkableValue:Object;
private var _openHash:Object;
private var _map:Array;
private var _openList:Array;
private var _mapMaxX:int;
private var _mapMaxY:int;
private var _endX:int;
private var _endY:int;
public static const MANHATTAN:String = "manhattan";
private static const DIAG_COST:Number = 1.4142135623731;
private static const STRAIGHT_COST:Number = 1;
public static const DIAGONAL:String = "diagonal";
public static const EUCLIDIAN:String = "euclidian";
public function AStar(_arg1:Array, _arg2:Object=0, _arg3:Boolean=false, _arg4:String="manhattan"){
_map = _arg1;
_mapMaxX = (_map[0].length - 1);
_mapMaxY = (_map.length - 1);
_testCorners = _arg3;
_walkableValue = _arg2;
switch (_arg4){
case MANHATTAN:
_heuristic = manhattan;
break;
case EUCLIDIAN:
_heuristic = euclidian;
break;
case DIAGONAL:
_heuristic = diagonal;
break;
default:
throw (new ArgumentError((("Heuristic \"" + _arg4) + "\" is not supported.")));
};
}
private function nodesOnLine(_arg1:AStarNode, _arg2:AStarNode, _arg3:AStarNode):Boolean{
if ((((_arg1._x == _arg2._x)) && ((_arg2._x == _arg3._x)))){
return (true);
};
if ((((_arg1._y == _arg2._y)) && ((_arg2._y == _arg3._y)))){
return (true);
};
var _local4:Number = ((_arg1._x - _arg2._x) / (_arg3._x - _arg2._x));
var _local5:Number = ((_arg1._y - _arg2._y) / (_arg3._y - _arg2._y));
return (((!(isNaN(_local4))) && ((_local4 == _local5))));
}
private function _search(_arg1:AStarNode):Array{
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:String;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:AStarNode;
var _local2:AStarNode = _arg1;
while (((!((_local2._x == _endX))) || (!((_local2._y == _endY))))) {
_local5 = (_local2._x - 1);
if (_local5 < 0){
_local5 = 0;
};
_local6 = (_local2._x + 1);
if (_local6 > _mapMaxX){
_local6 = _mapMaxX;
};
_local7 = (_local2._y - 1);
if (_local7 < 0){
_local7 = 0;
};
_local8 = (_local2._y + 1);
if (_local8 > _mapMaxY){
_local8 = _mapMaxY;
};
_local9 = _local5;
while (_local9 <= _local6) {
_local10 = _local7;
while (_local10 <= _local8) {
_local11 = ((_local9 + "_") + _local10);
if ((((((((((_local9 == _local2._x)) && ((_local10 == _local2._y)))) || (!((_map[_local10][_local9] === _walkableValue))))) || (_closedHash[_local11]))) || (((_testCorners) && (((!((_map[_local10][_local2._x] === _walkableValue))) || (!((_map[_local2._y][_local9] === _walkableValue))))))))){
} else {
_local12 = ((((_local2._x == _local9)) || ((_local2._y == _local10)))) ? STRAIGHT_COST : DIAG_COST;
_local13 = (_local2.g + _local12);
_local14 = _heuristic(_local9, _local10);
_local15 = (_local13 + _local14);
_local16 = _openHash[_local11];
if (_local16 == null){
_local16 = new AStarNode(_local9, _local10, _local13, _local14, _local15);
_local16._parent = _local2;
_openList.push(_local16);
_openHash[_local16._id] = _local16;
} else {
if (_local16.f > _local15){
_local16.g = _local13;
_local16.h = _local14;
_local16.f = _local15;
_local16._parent = _local2;
};
};
};
_local10++;
};
_local9++;
};
if (_openList.length == 0){
return (null);
};
_openList.sortOn("f", Array.NUMERIC);
_local2 = _openList.shift();
delete _openHash[_local2._id];
_closedHash[_local2._id] = _local2;
};
var _local3:AStarNode = _local2;
var _local4:Array = [_local3];
while (_local3._parent) {
_local4.unshift(_local3._parent);
_local3 = _local3._parent;
};
return (_local4);
}
private function manhattan(_arg1:int, _arg2:int):Number{
var _local3:Number = (_arg1 - _endX);
if (_local3 < 0){
_local3 = -(_local3);
};
var _local4:Number = (_arg2 - _endY);
if (_local4 < 0){
_local4 = -(_local4);
};
return (((_local3 + _local4) * STRAIGHT_COST));
}
public function dispose():void{
_map = null;
_walkableValue = null;
_openList = null;
_openHash = null;
_closedHash = null;
}
public function search(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Array{
_openList = [];
_openHash = {};
_closedHash = {};
_endX = _arg3;
_endY = _arg4;
var _local5:Number = _heuristic(_arg1, _arg2);
return (_search(new AStarNode(_arg1, _arg2, 0, _local5, _local5)));
}
private function euclidian(_arg1:int, _arg2:int):Number{
var _local3:Number = (_arg1 - _endX);
var _local4:Number = (_arg2 - _endY);
return ((Math.sqrt(((_local3 * _local3) + (_local4 * _local4))) * STRAIGHT_COST));
}
private function diagonal(_arg1:int, _arg2:int):Number{
var _local3:Number = (_arg1 - _endX);
if (_local3 < 0){
_local3 = -(_local3);
};
var _local4:Number = (_arg2 - _endY);
if (_local4 < 0){
_local4 = -(_local4);
};
var _local5:Number = ((_local3 < _local4)) ? _local3 : _local4;
return (((_local5 * DIAG_COST) + (((_local3 + _local4) - (2 * _local5)) * STRAIGHT_COST)));
}
public function searchReduced(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int=2147483647):Array{
var _local9:AStarNode;
var _local10:AStarNode;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local6:Array = search(_arg1, _arg2, _arg3, _arg4);
if (((!(_local6)) || ((_arg5 == 1)))){
return (_local6);
};
var _local7 = 1;
while (_local7 < (_local6.length - 1)) {
if (nodesOnLine(_local6[(_local7 - 1)], _local6[_local7], _local6[(_local7 + 1)])){
_local6.splice(_local7, 1);
} else {
_local7++;
};
};
if (_arg5 == int.MAX_VALUE){
return (_local6);
};
var _local8:int;
while (_local8 < (_local6.length - 1)) {
_local9 = _local6[_local8];
_local10 = _local6[(_local8 + 1)];
_local11 = (_local10._x - _local9._x);
_local12 = ((_local11 < 0)) ? -(_local11) : _local11;
_local13 = (_local10._y - _local9._y);
_local14 = ((_local13 < 0)) ? -(_local13) : _local13;
_local15 = ((_local12 > _local14)) ? _local12 : _local14;
if (_local15 > _arg5){
_local16 = ((_local11 == 0)) ? 0 : ((_local11 < 0)) ? -1 : 1;
_local17 = ((_local13 == 0)) ? 0 : ((_local13 < 0)) ? -1 : 1;
_local18 = (_arg5 * _local16);
_local19 = (_arg5 * _local17);
_local20 = ((_local15 - 1) / _arg5);
_local21 = (((_local15 - (_arg5 * (_local20 - 1))) * 0.5) - _arg5);
_local22 = (_local9._x + (_local21 * _local16));
_local23 = (_local9._y + (_local21 * _local17));
_local24 = 1;
while (_local24 <= _local20) {
_local22 = (_local22 + _local18);
_local23 = (_local23 + _local19);
++_local8;
_local6.splice(_local8, 0, new AStarNode(_local22, _local23));
_local24++;
};
};
_local8++;
};
return (_local6);
}
}
}//package com.bigwigmedia.utils.aStar
Section 171
//AStarNode (com.bigwigmedia.utils.aStar.AStarNode)
package com.bigwigmedia.utils.aStar {
public class AStarNode {
var _y:int;
public var f:Number;
public var g:Number;
public var h:Number;
var _parent:AStarNode;// = null
var _x:int;
var _id:String;
public function AStarNode(_arg1:int, _arg2:int, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
_x = _arg1;
_y = _arg2;
_id = ((_x + "_") + _y);
this.g = _arg3;
this.h = _arg4;
this.f = _arg5;
}
public function get y():int{
return (_y);
}
public function toString():String{
return ((((("[AStarNode x=" + _x) + " y=") + _y) + "]"));
}
public function get x():int{
return (_x);
}
}
}//package com.bigwigmedia.utils.aStar
Section 172
//Message (com.bigwigmedia.utils.messages.Message)
package com.bigwigmedia.utils.messages {
import com.bigwigmedia.utils.*;
public class Message {
private var _priority:int;
private var _data:Object;
private var _removeDuplicates:Boolean;
private var _cancelQueue:Boolean;
private var _type:String;
public function Message(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:Boolean, _arg5:Object){
_type = _arg1;
_priority = _arg2;
_cancelQueue = _arg3;
_removeDuplicates = _arg4;
_data = _arg5;
}
public function get priority():int{
return (_priority);
}
public function get data():Object{
return (_data);
}
public function toString():String{
return (ObjectUtil.formatToString(this, "type", "priority", "data"));
}
function cloneWithData(_arg1:Object):Message{
return (new Message(_type, _priority, _cancelQueue, _removeDuplicates, _arg1));
}
public function get cancelQueue():Boolean{
return (_cancelQueue);
}
public function get type():String{
return (_type);
}
public function get removeDuplicates():Boolean{
return (_removeDuplicates);
}
}
}//package com.bigwigmedia.utils.messages
Section 173
//MessageQueue (com.bigwigmedia.utils.messages.MessageQueue)
package com.bigwigmedia.utils.messages {
import com.bigwigmedia.core.*;
import flash.errors.*;
public class MessageQueue implements IDisposable {
private var pendingMessages:Array;
private var locked:Boolean;// = false
private var pendingMessagesWhileLocked:Array;
private var messagePrototypes:Object;
public function MessageQueue(){
pendingMessages = [];
pendingMessagesWhileLocked = [];
messagePrototypes = {};
super();
}
private function indexOfLastEqualPriority(_arg1:int):int{
var _local4:uint;
var _local6:int;
var _local2:uint;
var _local3:int = (pendingMessages.length - 1);
var _local5:Boolean;
while (_local2 <= _local3) {
_local4 = ((_local3 + _local2) / 2);
_local6 = pendingMessages[_local4].priority;
if (_arg1 < _local6){
if (_local4 == _local2){
if (_local5){
return ((_local4 - 1));
};
return ((-1 - _local4));
};
_local3 = (_local4 - 1);
} else {
if (_arg1 > _local6){
if (_local4 == _local3){
return ((-1 - (_local4 + 1)));
};
_local2 = (_local4 + 1);
} else {
if (_local4 == _local3){
return (_local4);
};
_local5 = true;
_local2 = (_local4 + 1);
};
};
};
return (-1);
}
public function registerMessage(_arg1:String, _arg2:int, _arg3:Boolean=false, _arg4:Boolean=false):void{
if (messagePrototypes[_arg1] != undefined){
throw (new ArgumentError((("Message of type \"" + _arg1) + "\" is registered already.")));
};
messagePrototypes[_arg1] = new Message(_arg1, _arg2, _arg4, _arg3, null);
}
public function getNext():Message{
var _local1:Message = pendingMessages.pop();
if (_local1.cancelQueue){
pendingMessages = [];
};
return (_local1);
}
public function lock():void{
if (locked){
throw (new IllegalOperationError("Message queue is already locked"));
};
locked = true;
}
public function clear():void{
pendingMessages = [];
pendingMessagesWhileLocked = [];
}
public function dispose():void{
pendingMessages = [];
pendingMessagesWhileLocked = [];
messagePrototypes = {};
}
public function unlock():void{
if (!locked){
throw (new IllegalOperationError("Message queue is already unlocked"));
};
while (pendingMessagesWhileLocked.length > 0) {
_append(pendingMessagesWhileLocked.pop());
};
locked = false;
}
private function _append(_arg1:Message):void{
var _local3:Message;
var _local4:int;
if (_arg1.removeDuplicates){
for each (_local3 in pendingMessages) {
if (_arg1.type == _local3.type){
_local4 = pendingMessages.indexOf(_local3);
pendingMessages.splice(_local4, 1);
};
};
};
var _local2:int = indexOfLastEqualPriority(_arg1.priority);
if (_local2 > -1){
_local2++;
} else {
_local2 = (-(_local2) - 1);
};
pendingMessages.splice(_local2, 0, _arg1);
}
public function append(_arg1:String, _arg2:Object=null):void{
var _local3:Message = messagePrototypes[_arg1];
if (_local3 == null){
throw (new ArgumentError((("Message with type \"" + _arg1) + "\" is not registered.")));
};
var _local4:Message = _local3.cloneWithData(_arg2);
if (locked){
pendingMessagesWhileLocked.push(_local4);
} else {
_append(_local4);
};
}
public function hasNext():Boolean{
return ((pendingMessages.length > 0));
}
}
}//package com.bigwigmedia.utils.messages
Section 174
//ArrayUtil (com.bigwigmedia.utils.ArrayUtil)
package com.bigwigmedia.utils {
public class ArrayUtil {
public static function shuffle(_arg1:Array):Array{
var _local5:int;
var _local6:*;
var _local2:Array = _arg1.slice();
var _local3:int = _local2.length;
if (_local3 <= 1){
return (_local2);
};
var _local4:int;
while (_local4 < _local3) {
_local5 = int((Math.random() * _local3));
_local6 = _local2[_local4];
_local2[_local4] = _local2[_local5];
_local2[_local5] = _local6;
_local4++;
};
return (_local2);
}
public static function shuffleTrim(_arg1:Array, _arg2:int):Array{
var _local3:int = _arg1.length;
if (_arg2 > _local3){
throw (new ArgumentError("Supplied length is bigger than length of supplied array"));
};
if (_local3 <= 1){
return (_arg1.slice());
};
var _local4:Array = _slot1.shuffle(_arg1);
var _local5:Array = [];
var _local6:int;
while (_local6 < _arg2) {
_local5.push(_local4.pop());
_local6++;
};
return (_local5);
}
}
}//package com.bigwigmedia.utils
Section 175
//NameUtil (com.bigwigmedia.utils.NameUtil)
package com.bigwigmedia.utils {
import flash.display.*;
import flash.utils.*;
public class NameUtil {
public static function getClassName(_arg1):String{
var _local2:String = getQualifiedClassName(_arg1);
return (_local2.split("::").pop());
}
public static function toDisplayObjectString(_arg1:Object):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
if ((_arg1 is DisplayObject)){
_local3 = (_arg1 as DisplayObject);
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
} else {
_local2 = "Not a DisplayObject";
};
return (_local2);
}
}
}//package com.bigwigmedia.utils
Section 176
//NumberFormatter (com.bigwigmedia.utils.NumberFormatter)
package com.bigwigmedia.utils {
public class NumberFormatter {
public static function addLeadingZeros(_arg1:Object, _arg2:int=2):String{
var _local3:String = String(_arg1);
while (_local3.length < _arg2) {
_local3 = ("0" + _local3);
};
return (_local3);
}
public static function formatThousands(_arg1:Object, _arg2:String=","):String{
var _local3:String = String(_arg1);
var _local4 = "";
var _local5:Number = _local3.length;
var _local6:int;
while (_local6 < _local5) {
if (((((_local6 % 3) == 0)) && ((_local6 > 0)))){
_local4 = (_arg2 + _local4);
};
_local4 = (_local3.substr((_local5 - (_local6 + 1)), 1) + _local4);
_local6++;
};
return (_local4);
}
public static function formatPrecision(_arg1:Object, _arg2:String=".", _arg3:int=3):String{
var _local6:String;
var _local7:String;
var _local4:String = String(_arg1);
var _local5:Array = _local4.split(".");
_local5[0] = ((_local5[0].length == 0)) ? "0" : _local5[0];
if (_arg3 > 0){
_local6 = (_local5[1]) ? String(_local5[1]) : "";
_local7 = (_local6 + "000000000000000000000000000000000");
_local4 = ((_local5[0] + _arg2) + _local7.substr(0, _arg3));
} else {
_local4 = String(_local5[0]);
};
return (_local4);
}
}
}//package com.bigwigmedia.utils
Section 177
//ObjectUtil (com.bigwigmedia.utils.ObjectUtil)
package com.bigwigmedia.utils {
public class ObjectUtil {
public static function getRandomValue(_arg1:Object){
var _local3:Object;
var _local4:int;
var _local2:Array = [];
for each (_local3 in _arg1) {
_local2.push(_local3);
};
_local4 = (Math.random() * _local2.length);
return (_local2[_local4]);
}
public static function formatToString(_arg1, ... _args):String{
var _local6:String;
var _local7:Object;
var _local3:String = ("[" + NameUtil.getClassName(_arg1));
var _local4:int = _args.length;
var _local5:int;
while (_local5 < _local4) {
_local6 = _args[_local5];
if (_arg1.hasOwnProperty(_local6)){
_local7 = _arg1[_local6];
if ((_local7 is String)){
_local3 = (_local3 + ((((" " + _local6) + "=\"") + _local7) + "\""));
} else {
_local3 = (_local3 + (((" " + _local6) + "=") + _local7));
};
};
_local5++;
};
return ((_local3 + "]"));
}
public static function hasProperties(_arg1:Object):Boolean{
var _local2:String;
for (_local2 in _arg1) {
return (true);
};
return (false);
}
}
}//package com.bigwigmedia.utils
Section 178
//TimeCount (com.bigwigmedia.utils.TimeCount)
package com.bigwigmedia.utils {
import flash.events.*;
import flash.utils.*;
import com.bigwigmedia.core.*;
public class TimeCount extends EventDispatcher implements IUpdatable {
private var _percent:Number;// = 1
private var _timeDisp:int;
private var _completed:Boolean;// = false
private var _timeStart:int;
private var _timeOffset:int;
public function TimeCount(_arg1:int){
_timeStart = _arg1;
_timeOffset = getTimer();
}
public function get percent():Number{
return (_percent);
}
public function update():void{
if (_completed){
return;
};
_timeDisp = (getTimer() - _timeOffset);
_percent = (((_timeStart + _timeOffset) - getTimer()) / _timeStart);
if (_percent < 0){
_percent = 0;
};
if (_percent == 0){
_completed = true;
dispatchEvent(new Event(Event.COMPLETE));
};
}
public function unpause():void{
_timeOffset = (getTimer() - _timeDisp);
}
}
}//package com.bigwigmedia.utils
Section 179
//MochiItemSlot (components.MochiItemSlot)
package components {
import pdiner2.managers.*;
import flash.text.*;
import pdiner2.game.catalog.*;
public class MochiItemSlot extends StarItemSlot {
private var _mochiID:String;
private var _mochiManager:Object;
private var _progressManager:Object;
public function MochiItemSlot(_arg1:String, _arg2:String, _arg3:String){
_mochiID = _arg2;
super(_arg1, 0, _arg3);
}
override public function dispose():void{
_mochiManager.removeEventListener(MochiEvent.ITEM_OWNED, onItemOwnedHandler);
_mochiManager.removeEventListener(MochiEvent.ITEM_NEW, onItemOwnedHandler);
_mochiManager.removeEventListener(MochiEvent.STORE_ITEMS, onStoreItemsHandler);
_mochiManager = null;
_progressManager = null;
}
override protected function getAccessOption():String{
if ((((_itemSuperType == "theme")) && ((_itemType == _progressManager.roomTheme)))){
return (ITEM_EQUIPED);
};
if ((((_itemSuperType == "uniform")) && ((_itemType == _progressManager.pennyUniform)))){
return (ITEM_EQUIPED);
};
if (_mochiManager.getOwnedItemData(_mochiID)){
return (ITEM_OWNED);
};
return (ITEM_ACCESSIBLE);
}
override protected function get priceIcon():String{
return ("IconMochiCoin");
}
public function get mochiID():String{
return (_mochiID);
}
override protected function initialize():void{
var _local1:Object;
_mochiManager = managers["mochiManager"];
_mochiManager.addEventListener(MochiEvent.ITEM_OWNED, onItemOwnedHandler);
_mochiManager.addEventListener(MochiEvent.ITEM_NEW, onItemOwnedHandler);
_local1 = _mochiManager.getStoreItemData(_mochiID);
if (_local1){
_price = _local1.cost;
} else {
_mochiManager.addEventListener(MochiEvent.STORE_ITEMS, onStoreItemsHandler);
};
_progressManager = managers["progressManager"];
_descriptionField.autoSize = TextFieldAutoSize.LEFT;
_descriptionField.text = _description;
_descriptionField.y = ((78 - _descriptionField.height) / 2);
_itemIcon.gotoAndStop(((_itemSuperType + "_") + _itemType));
updateAccessOption();
}
private function onItemOwnedHandler(_arg1:MochiEvent):void{
if (_arg1.data.id == _mochiID){
updateAccessOption(true);
};
}
override protected function mouseClicked(_arg1:Object):void{
switch (_arg1){
case _buyButton:
dispatchEvent(new ItemSlotEvent(ItemSlotEvent.BUY_MOCHI));
break;
case _equipButton:
dispatchEvent(new ItemSlotEvent(ItemSlotEvent.EQUIP));
break;
};
}
private function onStoreItemsHandler(_arg1:MochiEvent):void{
var _local2:Object;
_local2 = _mochiManager.getStoreItemData(_mochiID);
if (_local2){
_price = _local2.cost;
updateAccessOption(true);
};
}
}
}//package components
Section 180
//StandardItemSlot (components.StandardItemSlot)
package components {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import pdiner2.game.catalog.*;
import flash.utils.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
public class StandardItemSlot extends Sprite implements IDisposable {
private var _configManager:Object;
public var _ownedIcon:Sprite;
protected var _description:String;
protected var _itemType:String;
protected var _price:int;
private var _progressManager:Object;
public var _itemIcon:MovieClip;
private var _level:int;
public var _descriptionField:TextField;
public var _priceField:TextField;
public var _buyButton:SimpleButton;
protected var _accessOption:String;
public static const ITEM_EQUIPED:String = "ITEM_EQUIPED";
public static const ITEM_OWNED:String = "ITEM_OWNED";
public static const ITEM_ACCESSIBLE:String = "ITEM_ACCESSIBLE";
public static const ITEM_NOT_ACCESSIBLE:String = "ITEM_NOT_ACCESSIBLE";
public function StandardItemSlot(_arg1:String, _arg2:int, _arg3:String){
_itemType = _arg1;
_descriptionField.mouseEnabled = false;
_priceField.mouseEnabled = false;
_level = _arg2;
_description = _arg3;
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
initialize();
}
public function dispose():void{
_configManager = null;
_progressManager = null;
}
protected function getUpgradeLevel():int{
switch (_itemType){
case "skates":
return (_progressManager.skateUpgrade);
case "tables":
return (_progressManager.tableUpgrade);
case "seats":
return (_progressManager.seatUpgrade);
case "chefs":
return (_progressManager.chefUpgrade);
case "entertainments":
return (_progressManager.entertaimentUpgrade);
case "pictureDecoration":
return (_progressManager.pictureDecoration);
case "curtainsDecoration":
return (_progressManager.curtainsDecoration);
case "lightsDecoration":
return (_progressManager.lightsDecoration);
case "tableClothDecoration":
return (_progressManager.tableClothDecoration);
case "clocksDecoration":
return (_progressManager.clocksDecoration);
case "carpetDecoration":
return (_progressManager.carpetDecoration);
};
throw (new Error((("Type \"" + _itemType) + "\" is not supported.")));
}
public function get price():int{
return (_price);
}
protected function get managers():Class{
var _local1:Class;
_local1 = (getDefinitionByName("pdiner2.managers::Managers") as Class);
return (_local1);
}
public function updateAccessOption(_arg1:Boolean=false):void{
var _local2:String;
_local2 = getAccessOption();
if ((((_accessOption == _local2)) && (!(_arg1)))){
return;
};
_accessOption = _local2;
_ownedIcon.visible = (_accessOption == ITEM_OWNED);
_buyButton.visible = (_accessOption == ITEM_ACCESSIBLE);
_priceField.text = ((_accessOption == ITEM_ACCESSIBLE)) ? ("BUY\n$" + NumberFormatter.formatThousands(_price)) : "";
if (_accessOption == ITEM_NOT_ACCESSIBLE){
_itemIcon.filters = [new ColorMatrixFilter([0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0, 0, 0, 1, 0])];
} else {
_itemIcon.filters = [];
};
}
protected function getAccessOption():String{
var _local1:int;
switch (_itemType){
case "tableClothDecoration":
if (_progressManager.tableClothDecoration == 1){
return (ITEM_OWNED);
};
return (ITEM_ACCESSIBLE);
case "pictureDecoration":
if (_progressManager.pictureDecoration == 1){
return (ITEM_OWNED);
};
if (_progressManager.tableClothDecoration == 1){
return (ITEM_ACCESSIBLE);
};
return (ITEM_NOT_ACCESSIBLE);
case "curtainsDecoration":
if (_progressManager.curtainsDecoration == 1){
return (ITEM_OWNED);
};
if (_progressManager.pictureDecoration == 1){
return (ITEM_ACCESSIBLE);
};
return (ITEM_NOT_ACCESSIBLE);
case "lightsDecoration":
if (_progressManager.lightsDecoration == 1){
return (ITEM_OWNED);
};
if (_progressManager.curtainsDecoration == 1){
return (ITEM_ACCESSIBLE);
};
return (ITEM_NOT_ACCESSIBLE);
case "clocksDecoration":
if (_progressManager.clocksDecoration == 1){
return (ITEM_OWNED);
};
if (_progressManager.lightsDecoration == 1){
return (ITEM_ACCESSIBLE);
};
return (ITEM_NOT_ACCESSIBLE);
case "carpetDecoration":
if (_progressManager.carpetDecoration == 1){
return (ITEM_OWNED);
};
if (_progressManager.clocksDecoration == 1){
return (ITEM_ACCESSIBLE);
};
return (ITEM_NOT_ACCESSIBLE);
};
_local1 = getUpgradeLevel();
if (_itemType.indexOf("Decoration") != -1){
return (((_local1 == 0)) ? ITEM_ACCESSIBLE : ITEM_OWNED);
};
return (((_level <= _local1)) ? ITEM_OWNED : ((_level == (_local1 + 1))) ? ITEM_ACCESSIBLE : ITEM_NOT_ACCESSIBLE);
}
public function get level():int{
return (_level);
}
protected function initialize():void{
var _local1:String;
_configManager = managers["configManager"];
_progressManager = managers["progressManager"];
_price = _configManager.getUpgradeXML(_itemType, _level).@price;
if (_itemType.indexOf("Decoration") != -1){
_local1 = _itemType;
} else {
_local1 = ((_itemType + "_") + _level);
};
_itemIcon.gotoAndStop(_local1);
_descriptionField.autoSize = TextFieldAutoSize.LEFT;
_descriptionField.text = _description;
_descriptionField.y = ((78 - _descriptionField.height) / 2);
updateAccessOption();
}
protected function mouseClicked(_arg1:Object):void{
if (_arg1 == _buyButton){
dispatchEvent(new ItemSlotEvent(ItemSlotEvent.BUY_STANDARD));
};
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
mouseClicked(_arg1.target);
}
public function get itemType():String{
return (_itemType);
}
}
}//package components
Section 181
//StarItemSlot (components.StarItemSlot)
package components {
import flash.display.*;
import flash.text.*;
import pdiner2.game.catalog.*;
import com.bigwigmedia.utils.*;
public class StarItemSlot extends StandardItemSlot {
public var _equipField:TextField;
protected var _itemSuperType:String;
private var _progressManager:Object;
public var _equipButton:SimpleButton;
public function StarItemSlot(_arg1:String, _arg2:int, _arg3:String){
var _local4:Array;
_local4 = _arg1.split("_");
_itemSuperType = _local4[0];
_price = _arg2;
super(_local4[1], -1, _arg3);
_equipField.mouseEnabled = false;
}
override public function dispose():void{
_progressManager = null;
}
override public function updateAccessOption(_arg1:Boolean=false):void{
var _local2:String;
var _local3:String;
_local2 = getAccessOption();
if ((((_accessOption == _local2)) && (!(_arg1)))){
return;
};
_accessOption = _local2;
_ownedIcon.visible = (_accessOption == ITEM_EQUIPED);
_buyButton.visible = (_accessOption == ITEM_ACCESSIBLE);
_equipButton.visible = (_accessOption == ITEM_OWNED);
_equipField.visible = (_accessOption == ITEM_OWNED);
if (_accessOption == ITEM_ACCESSIBLE){
_local3 = ((_price)==0) ? "?" : NumberFormatter.formatThousands(_price);
_priceField.htmlText = (((("<b>BUY<br /><img src='" + priceIcon) + "' hspace='0' vspace='6' />") + _local3) + "</b>");
} else {
_priceField.htmlText = "";
};
}
override protected function getAccessOption():String{
if ((((_itemSuperType == "theme")) && ((_itemType == _progressManager.roomTheme)))){
return (ITEM_EQUIPED);
};
if ((((_itemSuperType == "uniform")) && ((_itemType == _progressManager.pennyUniform)))){
return (ITEM_EQUIPED);
};
if (_progressManager.isStarItemOwned(((_itemSuperType + "_") + _itemType))){
return (ITEM_OWNED);
};
return (ITEM_ACCESSIBLE);
}
protected function get priceIcon():String{
return ("IconStar");
}
public function get itemSuperType():String{
return (_itemSuperType);
}
override protected function initialize():void{
_progressManager = managers["progressManager"];
_descriptionField.autoSize = TextFieldAutoSize.LEFT;
_descriptionField.text = _description;
_descriptionField.y = ((78 - _descriptionField.height) / 2);
_itemIcon.gotoAndStop(((_itemSuperType + "_") + _itemType));
updateAccessOption();
}
override protected function mouseClicked(_arg1:Object):void{
switch (_arg1){
case _buyButton:
dispatchEvent(new ItemSlotEvent(ItemSlotEvent.BUY_STAR));
break;
case _equipButton:
dispatchEvent(new ItemSlotEvent(ItemSlotEvent.EQUIP));
break;
};
}
}
}//package components
Section 182
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 183
//ClocksClip_11 (graphics_fla.ClocksClip_11)
package graphics_fla {
import flash.display.*;
public dynamic class ClocksClip_11 extends MovieClip {
public var hands:MovieClip;
}
}//package graphics_fla
Section 184
//eyes_side_8 (guest_fla.eyes_side_8)
package guest_fla {
import flash.display.*;
public dynamic class eyes_side_8 extends MovieClip {
public var eyes_female:eyes_normal_state_female;
public var eyes_male:eyes_normal_state_male;
}
}//package guest_fla
Section 185
//guest_head_back_20 (guest_fla.guest_head_back_20)
package guest_fla {
import flash.display.*;
public dynamic class guest_head_back_20 extends MovieClip {
public var face:MovieClip;
}
}//package guest_fla
Section 186
//guest_head_eating_27 (guest_fla.guest_head_eating_27)
package guest_fla {
import flash.display.*;
public dynamic class guest_head_eating_27 extends MovieClip {
public var eyes:MovieClip;
public var mouth:guest_mouth_eating;
}
}//package guest_fla
Section 187
//guest_head_front_15 (guest_fla.guest_head_front_15)
package guest_fla {
import flash.display.*;
public dynamic class guest_head_front_15 extends MovieClip {
public var face:MovieClip;
}
}//package guest_fla
Section 188
//guest_head_side_6 (guest_fla.guest_head_side_6)
package guest_fla {
import flash.display.*;
public dynamic class guest_head_side_6 extends MovieClip {
public var face:MovieClip;
public var eyes:MovieClip;
}
}//package guest_fla
Section 189
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 190
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 191
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 192
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguments package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 193
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 194
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _clip._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.7 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local4:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local5:URLRequest = new URLRequest(_local4);
var _local6:URLVariables = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 195
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 196
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 197
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 198
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
}
}//package mx.core
Section 199
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 200
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 201
//PopupEvent (pdiner2.common.PopupEvent)
package pdiner2.common {
import flash.events.*;
public class PopupEvent extends Event {
private var _data:Object;
public static const CLOSE:String = "PopupEvent.close";
public static const CONTINUE:String = "PopupEvent.continue";
public function PopupEvent(_arg1:String, _arg2:Boolean=false, _arg3:Object=null){
super(_arg1, _arg2);
_data = _arg3;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new PopupEvent(type, bubbles, _data));
}
}
}//package pdiner2.common
Section 202
//ChannelID (pdiner2.constants.ChannelID)
package pdiner2.constants {
public class ChannelID {
public static const SFX:String = "SFX";
public static const ENVIRONMENT_SFX:String = "ENVIRONMENT_SFX";
public static const CHEF_SFX:String = "CHEF_SFX";
}
}//package pdiner2.constants
Section 203
//RoomThemes (pdiner2.constants.RoomThemes)
package pdiner2.constants {
public class RoomThemes {
public static const BEACH:String = "beach";
public static const ECO:String = "eco";
public static const HATS:String = "hats";
public static const PIRATES:String = "pirates";
public static const STANDARD:String = "standard";
public static const BALL:String = "ball";
}
}//package pdiner2.constants
Section 204
//SoundID (pdiner2.constants.SoundID)
package pdiner2.constants {
public class SoundID {
public static const PENG_LOVE2_WAV:String = "peng_love2_wav";
public static const FOOD_READY_SFX:String = "food_ready_sfx";
public static const PENGUIN_READ_MENU_SFX:String = "penguin_read_menu_sfx";
public static const CANCEL_SFX:String = "cancel_sfx";
public static const MONEY_PICKUP_SFX:String = "money_pickup_sfx";
public static const FOOD_PICKUP_SFX:String = "food_pickup_sfx";
public static const ENT_TV3_SFX:String = "ent_tv3_sfx";
public static const WALK_ICE_02_SFX:String = "walk_ice_02_sfx";
public static const WALK_ICE_03_SFX:String = "walk_ice_03_sfx";
public static const CURTAIN_UP_SFX:String = "curtain_up_sfx";
public static const CLOSE_SIGN_FALL_SFX:String = "close_sign_fall_sfx";
public static const TRASHCAN_SFX:String = "trashcan_sfx";
public static const BUTTON_CLICK_SFX:String = "button_click_sfx";
public static const BG_WIND3_WAV:String = "bg_wind3_wav";
public static const UPGRADE_BUY_SFX:String = "upgrade_buy_sfx";
public static const ENT_JUGGLINGSEAL2_SFX:String = "ent_jugglingseal2_sfx";
public static const ENT_RADIO3_SFX:String = "ent_radio3_sfx";
public static const POP_SFX:String = "pop_sfx";
public static const HELLO_SFX:String = "hello_sfx";
public static const MESSAGE_POPUP_SFX:String = "message_popup_sfx";
public static const CLICK_PENGUIN_SFX:String = "click_penguin_sfx";
public static const BUTTON_ROLLOVER_SFX:String = "button_rollover_sfx";
public static const COOKSFX_01_WAV:String = "cooksfx_01_wav";
public static const COOKSFX_02_WAV:String = "cooksfx_02_wav";
public static const COOKSFX_03_WAV:String = "cooksfx_03_wav";
public static const CURTAIN_DOWN_SFX:String = "curtain_down_sfx";
public static const CROWD_CLAP_SFX:String = "crowd_clap_sfx";
public static const FOOD_GIVE_SFX:String = "food_give_sfx";
public static const CLICK_GAME_OBJECT_SFX:String = "click_game_object_sfx";
public static const HELLO_F2_SFX:String = "hello_f2_sfx";
}
}//package pdiner2.constants
Section 205
//SOValues (pdiner2.constants.SOValues)
package pdiner2.constants {
public class SOValues {
public static const SOUND_ENABLED:String = "SOUND_ENABLED";
public static const SHOWN_HINTS_IN_ORDER:String = "SHOWN_HINTS_IN_ORDER";
public static const GAME_PROGRESS:String = "GAME_PROGRESS";
public static const COMIC_POPUP_HASH:String = "COMIC_POPUP_HASH";
}
}//package pdiner2.constants
Section 206
//Uniforms (pdiner2.constants.Uniforms)
package pdiner2.constants {
public class Uniforms {
public static const STANDARD:String = "standard";
public static const BAKER_STREET:String = "bakerStreet";
public static const PARIS:String = "paris";
public static const SUSHI_QUEEN:String = "sushiQueen";
public static const BLACK_TIE:String = "blackTie";
public static const ECO:String = "eco";
public static const HATS:String = "hats";
public static const CARRIBEAN:String = "carribean";
}
}//package pdiner2.constants
Section 207
//MainController (pdiner2.core.MainController)
package pdiner2.core {
import com.bigwigmedia.stateMachine.*;
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.mainMenu.*;
import pdiner2.instructions.*;
import pdiner2.map.*;
import pdiner2.gameWin.*;
import com.bigwigmedia.transitions.*;
import com.bigwigmedia.application.*;
public class MainController extends EventDispatcher implements IController {
private var _view:Sprite;
private var _stateMachine:IStateMachine;
private var _controller:IController;
private var _controllerClass:Class;
public function MainController(){
_view = new Sprite();
Managers.initialize(onManagersInitCallback);
}
private function showInstructions(_arg1:AbstractEvent):void{
beginTransitionEffect(InstructionsController);
}
private function onControllerCompleteHandler(_arg1:ControllerEvent):void{
_stateMachine.sendSignal(String(_arg1.data));
}
private function showMapGuard():Boolean{
return ((Managers.progressManager.day == 0));
}
private function createNextController():void{
if (_controller){
_view.removeChild(_controller.view);
_controller.removeEventListener(ControllerEvent.COMPLETE, onControllerCompleteHandler);
_controller.dispose();
_controller = null;
};
_controller = new _controllerClass();
_controller.addEventListener(ControllerEvent.COMPLETE, onControllerCompleteHandler);
_view.addChild(_controller.view);
}
public function get view():DisplayObject{
return (_view);
}
public function dispose():void{
throw (new Error("Can't dispose MainController"));
}
private function showGame(_arg1:AbstractEvent):void{
beginTransitionEffect(GameController);
}
private function showWinGame(_arg1:AbstractEvent):void{
beginTransitionEffect(GameWinController);
}
private function onManagersInitCallback():void{
_stateMachine = new FSM();
var _local1:AbstractState = _stateMachine.addState(new InitialState());
var _local2:AbstractState = _stateMachine.addState(new SimpleState(showMainMenu));
var _local3:AbstractState = _stateMachine.addState(new ChoiceState());
var _local4:AbstractState = _stateMachine.addState(new SimpleState(showInstructions));
var _local5:AbstractState = _stateMachine.addState(new SimpleState(showMap));
var _local6:AbstractState = _stateMachine.addState(new SimpleState(showGame));
var _local7:AbstractState = _stateMachine.addState(new SimpleState(showWinGame));
_local1.addTransition(_local2);
_local2.addTransition(_local4, new SignalTrigger(MainSignal.SHOW_INSTRUCTIONS));
_local4.addTransition(_local2, new SignalTrigger(MainSignal.SHOW_MAIN_MENU));
_local2.addTransition(_local3, new SignalTrigger(MainSignal.START));
_local3.addTransition(_local5, null, null, showMapGuard);
_local3.addTransition(_local6);
_local5.addTransition(_local6, new SignalTrigger(MainSignal.START));
_local6.addTransition(_local2, new SignalTrigger(MainSignal.QUIT));
_local6.addTransition(_local6, new SignalTrigger(MainSignal.RESTART));
_local6.addTransition(_local3, new SignalTrigger(MainSignal.NEXT_DAY));
_local6.addTransition(_local7, new SignalTrigger(MainSignal.WIN_GAME));
_local7.addTransition(_local2, new SignalTrigger(MainSignal.SHOW_MAIN_MENU));
_stateMachine.start();
}
private function showMainMenu(_arg1:AbstractEvent):void{
beginTransitionEffect(MainMenuController);
}
private function beginTransitionEffect(_arg1:Class):void{
this._controllerClass = _arg1;
ApplicationGlobals.application.createTransition(new BlackoutTransition(createNextController));
}
private function showMap(_arg1:AbstractEvent):void{
beginTransitionEffect(MapController);
}
}
}//package pdiner2.core
Section 208
//MainSignal (pdiner2.core.MainSignal)
package pdiner2.core {
public class MainSignal {
public static const START:String = "START";
public static const SHOW_MAIN_MENU:String = "SHOW_MAIN_MENU";
public static const SHOW_INSTRUCTIONS:String = "SHOW_INSTRUCTIONS";
public static const QUIT:String = "QUIT";
public static const NEXT_DAY:String = "NEXT_DAY";
public static const WIN_GAME:String = "WIN_GAME";
public static const RESTART:String = "RESTART";
}
}//package pdiner2.core
Section 209
//BookmarkButton (pdiner2.game.catalog.BookmarkButton)
package pdiner2.game.catalog {
import com.bigwigmedia.ui.*;
public class BookmarkButton extends IconicButton {
private var _pageNum:int;
public function BookmarkButton(_arg1:Object, _arg2:int){
super(_arg1);
_pageNum = _arg2;
}
public function get pageNum():int{
return (_pageNum);
}
}
}//package pdiner2.game.catalog
Section 210
//CatalogPopup (pdiner2.game.catalog.CatalogPopup)
package pdiner2.game.catalog {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.common.*;
import flash.text.*;
import assets.*;
import components.*;
import com.bigwigmedia.utils.*;
import pdiner2.map.*;
import com.bigwigmedia.tweens.*;
import pdiner2.constants.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.application.*;
import pdiner2.*;
public class CatalogPopup extends LayoutContainer {
private var _slotsHolder:Sprite;
private var _messageTween:ITween;
private var _messageLabel:Label;
private var _scoreLabel:Label;
private var _currentPage:int;// = -1
private var _mochiManager:MochiManager;
private var _popup:AbstractComponent;
private var _clip:MovieClip;
private var _starsLabel:Label;
private var _backBtn:LabelButton;
public static const DISP_X:Number = 15;
public function CatalogPopup(){
setSize(640, 480);
addChild(new IcyBackground()).cacheAsBitmap = true;
var _local1:VBox = new VBox();
_local1.gap = 4;
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_0, 0));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_1, 1));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_2, 1));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_3, 2));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_4, 2));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_5, 3));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_6, 4));
_local1.addChildToLayout(new BookmarkButton(BookmarkIcon_7, 5));
addChildToLayout(_local1, {left:(DISP_X + 5), verticalCenter:0});
_mochiManager = Managers.mochiManager;
if (_mochiManager.connected){
_mochiManager.showLoginWidget();
};
_mochiManager.addEventListener(MochiEvent.CONNECT, onMochiConnectHandler);
_clip = MovieClip(addChild(new CatalogClip()));
_clip.x = DISP_X;
_backBtn = new LabelButton("Back");
_backBtn.beacon = true;
addChildToLayout(_backBtn, {right:10, bottom:4});
_slotsHolder = Sprite(addChild(new Sprite()));
var _local2:HBox = new HBox();
_local2.gap = 10;
_scoreLabel = new Label();
_local2.addChildToLayout(_scoreLabel);
_starsLabel = new Label();
_local2.addChildToLayout(_starsLabel);
showScoreLabels();
this.addChildToLayout(_local2, {left:10, bottom:4});
_messageLabel = new Label();
_messageLabel.visible = false;
addChildToLayout(_messageLabel, {horizontalCenter:0, verticalCenter:0});
addEventListener(Event.ADDED, onAddedHandler);
selectPage(0);
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
addEventListener(ItemSlotEvent.BUY_STANDARD, onBuyStandardHandler);
addEventListener(ItemSlotEvent.BUY_MOCHI, onBuyMochiHandler);
addEventListener(ItemSlotEvent.BUY_STAR, onBuyStarHandler);
addEventListener(ItemSlotEvent.EQUIP, onEquipHandler);
}
private function removeItemSlots():void{
var _local1:StandardItemSlot;
while (_slotsHolder.numChildren > 0) {
_local1 = StandardItemSlot(_slotsHolder.removeChildAt(0));
_local1.dispose();
};
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
if ((_arg1.target is BookmarkButton)){
selectPage(BookmarkButton(_arg1.target).pageNum);
return;
};
switch (_arg1.target){
case _backBtn:
dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true));
break;
};
}
private function setMessageLabelVisible(_arg1:Boolean):void{
_messageLabel.visible = _arg1;
}
private function showMessage(_arg1:String):void{
if (_messageTween){
_messageTween.dispose();
};
Managers.soundManager.play(SoundID.CANCEL_SFX);
_messageLabel.text = _arg1;
_messageTween = new SequenceTween([new Action(this, setMessageLabelVisible, [true]), new Delay(15), new Action(this, setMessageLabelVisible, [false]), new Delay(5), new Action(this, setMessageLabelVisible, [true]), new Delay(15), new Action(this, setMessageLabelVisible, [false]), new Delay(5), new Action(this, setMessageLabelVisible, [true]), new Delay(15), new Action(this, setMessageLabelVisible, [false])]);
_messageTween.playAuto();
}
private function onMochiConnectHandler(_arg1:MochiEvent):void{
_mochiManager.showLoginWidget();
}
private function onPopupCloseHandler(_arg1:PopupEvent):void{
_arg1.stopImmediatePropagation();
_popup.removeEventListener(PopupEvent.CLOSE, onPopupCloseHandler);
removeChild(_popup);
_popup.dispose();
_popup = null;
}
private function onBuyStandardHandler(_arg1:ItemSlotEvent):void{
var _local3:String;
var _local2:StandardItemSlot = StandardItemSlot(_arg1.target);
if (_local2.price <= Managers.progressManager.bank){
Managers.soundManager.play(SoundID.MESSAGE_POPUP_SFX);
Managers.progressManager.buyStandardItem(_local2.itemType, _local2.price, _local2.level);
updateSlots();
showScoreLabels();
if (_local2.itemType == "chefs"){
switch (_local2.level){
case 1:
_local3 = ComicPopup.BUY_CHEF_1;
break;
case 2:
_local3 = ComicPopup.BUY_CHEF_2;
break;
case 3:
_local3 = ComicPopup.BUY_CHEF_3;
break;
};
_popup = new ComicPopup(_local3);
Main(ApplicationGlobals.application).mochiWidgetHolder.visible = false;
_popup.addEventListener(PopupEvent.CLOSE, onPopupCloseHandler);
addChild(_popup);
};
} else {
showMessage("You don't have enough money");
};
}
private function selectPage(_arg1:int):void{
var _local3:XML;
var _local4:String;
var _local5:StandardItemSlot;
if (_currentPage == _arg1){
return;
};
_currentPage = _arg1;
removeItemSlots();
_clip.gotoAndStop((_currentPage + 2));
var _local2:XML = Managers.configManager.getCatalogPageXML(_currentPage);
for each (_local3 in _local2.children()) {
_local4 = _local3.name();
switch (_local4){
case "standardItemSlot":
_local5 = new StandardItemSlot(_local3.@itemType, _local3.@level, _local3.description);
break;
case "mochiItemSlot":
_local5 = new MochiItemSlot(_local3.@itemType, _local3.@mochiID, _local3.description);
break;
case "starItemSlot":
_local5 = new StarItemSlot(_local3.@itemType, _local3.@price, _local3.description);
break;
};
_local5.x = (Number(_local3.@x) + DISP_X);
_local5.y = Number(_local3.@y);
_slotsHolder.addChild(_local5);
};
}
override public function dispose():void{
if (_messageTween){
_messageTween.dispose();
};
removeItemSlots();
_mochiManager.removeEventListener(MochiEvent.CONNECT, onMochiConnectHandler);
_mochiManager = null;
Main(ApplicationGlobals.application).mochiWidgetHolder.visible = false;
super.dispose();
}
private function onAddedHandler(_arg1:Event):void{
var _local2:TextField;
if ((((_arg1.target is TextField)) && ((_arg1.target.name == "_info_field")))){
_local2 = TextField(_arg1.target);
_local2.embedFonts = true;
_local2.htmlText = Managers.configManager.getCatalogInfo();
};
}
private function onBuyStarHandler(_arg1:ItemSlotEvent):void{
var _local2:StarItemSlot = StarItemSlot(_arg1.target);
if (_local2.price <= Managers.progressManager.stars){
Managers.soundManager.play(SoundID.MESSAGE_POPUP_SFX);
Managers.progressManager.buyStarItem(((_local2.itemSuperType + "_") + _local2.itemType), _local2.price);
updateSlots();
showScoreLabels();
} else {
showMessage("You don't have enough stars");
};
}
private function showScoreLabels():void{
_scoreLabel.text = ("Penny's Bank: $" + NumberFormatter.formatThousands(Managers.progressManager.bank));
_starsLabel.text = ("Stars:" + Managers.progressManager.stars);
}
private function onEquipHandler(_arg1:ItemSlotEvent):void{
var _local2:StarItemSlot = StarItemSlot(_arg1.target);
if (_local2.itemSuperType == "theme"){
Managers.progressManager.roomTheme = _local2.itemType;
} else {
if (_local2.itemSuperType == "uniform"){
if (Managers.progressManager.roomTheme == RoomThemes.ECO){
showMessage("You can't use this uniform with eco theme");
} else {
Managers.progressManager.pennyUniform = _local2.itemType;
};
} else {
throw (new Error((("Type + \"" + _local2.itemSuperType) + "\" is not supported")));
};
};
Managers.soundManager.play(SoundID.MESSAGE_POPUP_SFX);
updateSlots();
}
private function updateSlots():void{
var _local3:StandardItemSlot;
var _local1:int = _slotsHolder.numChildren;
var _local2:int;
while (_local2 < _local1) {
_local3 = StandardItemSlot(_slotsHolder.getChildAt(_local2));
_local3.updateAccessOption();
_local2++;
};
}
private function onBuyMochiHandler(_arg1:ItemSlotEvent):void{
var _local2:MochiItemSlot = MochiItemSlot(_arg1.target);
_mochiManager.showStoreItem(_local2.mochiID);
}
}
}//package pdiner2.game.catalog
Section 211
//ItemSlotEvent (pdiner2.game.catalog.ItemSlotEvent)
package pdiner2.game.catalog {
import flash.events.*;
public class ItemSlotEvent extends Event {
public static const EQUIP:String = "ItemSlotEvent.equip";
public static const BUY_STANDARD:String = "ItemSlotEvent.buyStandard";
public static const BUY_MOCHI:String = "ItemSlotEvent.buyMochi";
public static const BUY_STAR:String = "ItemSlotEvent.buyStar";
public function ItemSlotEvent(_arg1:String){
super(_arg1, true);
}
override public function clone():Event{
return (new ItemSlotEvent(type));
}
}
}//package pdiner2.game.catalog
Section 212
//Chef (pdiner2.game.entities.Chef)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.constants.*;
public class Chef extends Entity {
private var _upgradeLevel:int;
private var _playing:Boolean;// = false
public function Chef(){
_upgradeLevel = Managers.progressManager.chefUpgrade;
}
override public function update():void{
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
}
public function start():void{
if (!_playing){
_playing = true;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
switch (_upgradeLevel){
case 1:
Managers.soundManager.playSingle(SoundID.COOKSFX_01_WAV, int.MAX_VALUE);
break;
case 2:
Managers.soundManager.playSingle(SoundID.COOKSFX_02_WAV, int.MAX_VALUE);
break;
case 3:
Managers.soundManager.playSingle(SoundID.COOKSFX_03_WAV, int.MAX_VALUE);
break;
};
};
}
public function stop():void{
if (_playing){
_playing = false;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
if (_upgradeLevel > 0){
Managers.soundManager.stopChannel(ChannelID.CHEF_SFX);
};
};
}
public function get playing():Boolean{
return (_playing);
}
}
}//package pdiner2.game.entities
Section 213
//ClosedSign (pdiner2.game.entities.ClosedSign)
package pdiner2.game.entities {
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
public class ClosedSign extends Entity {
override public function update():void{
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
}
}
}//package pdiner2.game.entities
Section 214
//CounterPlace (pdiner2.game.entities.CounterPlace)
package pdiner2.game.entities {
import flash.geom.*;
import com.bigwigmedia.mvc.*;
public class CounterPlace extends Entity implements IPathTarget {
public function getPathTargetTile(_arg1:Entity):Point{
return (new Point(15, 20));
}
public function characterAction(_arg1:Entity):void{
}
}
}//package pdiner2.game.entities
Section 215
//CounterPlate (pdiner2.game.entities.CounterPlate)
package pdiner2.game.entities {
import pdiner2.game.events.*;
import flash.geom.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
public class CounterPlate extends Entity implements IPathTarget {
private var _tileX:Number;
private var _tileY:Number;
private var _model:GameModel;
private var _foodType:String;
public function CounterPlate(_arg1:GameModel, _arg2:Number, _arg3:Number){
_model = _arg1;
_tileX = _arg2;
_tileY = _arg3;
}
public function characterAction(_arg1:Entity):void{
var _local2:Penny = Penny(_arg1);
if (((!((_foodType == null))) && (_local2.pickupCounterPlate(_foodType)))){
_model.pickupCounterPlate(this);
};
}
override public function dispose():void{
_model = null;
}
public function get tileX():Number{
return (_tileX);
}
public function set foodType(_arg1:String):void{
_foodType = _arg1;
dispatchEvent(new EntityEvent(EntityEvent.SHOW_FOOD));
}
public function get tileY():Number{
return (_tileY);
}
public function getPathTargetTile(_arg1:Entity):Point{
if ((_arg1 is Penny)){
return (new Point(_tileX, _tileY));
};
throw (new Error((("Entity " + _arg1) + " is not supported")));
}
public function get foodType():String{
return (_foodType);
}
}
}//package pdiner2.game.entities
Section 216
//Direction (pdiner2.game.entities.Direction)
package pdiner2.game.entities {
public class Direction {
public static var DOWN:String = "down";
public static var LEFT:String = "left";
public static var UP:String = "up";
public static var RIGHT:String = "right";
public static function getDirection(_arg1:Number, _arg2:Number):String{
var _local3:Number = ((_arg1 < 0)) ? -(_arg1) : _arg1;
var _local4:Number = ((_arg2 < 0)) ? -(_arg2) : _arg2;
if (_local3 > _local4){
if (_arg1 > 0){
return (Direction.RIGHT);
};
return (Direction.LEFT);
};
if (_arg2 > 0){
return (Direction.DOWN);
};
return (Direction.UP);
}
}
}//package pdiner2.game.entities
Section 217
//DoubleGuestGroup (pdiner2.game.entities.DoubleGuestGroup)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.*;
import pdiner2.game.gameModelClasses.*;
import pdiner2.constants.*;
public class DoubleGuestGroup implements IGuestGroup {
private var _guestLeft:Guest;
private var _nextQueuePositionGetCount:int;// = 2
private var _numInQueue:int;
private var _model:GameModel;
private var _guestRight:Guest;
private var _guestsRemoved:int;// = 0
private var _appearMood:int;
private var _table:Table;
private var _selected:Boolean;// = false
private static var _queuePlacesLeft:Array = [new PathPlace(9, 8), new PathPlace(7, 8), new PathPlace(5, 8)];
private static var _queuePlacesRight:Array = [new PathPlace(8, 10), new PathPlace(6, 10), new PathPlace(4, 10)];
public function DoubleGuestGroup(_arg1:GameModel, _arg2:GuestManager, _arg3:int, _arg4:Boolean){
_model = _arg1;
_numInQueue = _arg3;
_appearMood = _model.dayInfo.guestAppearMood;
if (((!((_appearMood == 3))) && ((Math.random() > _model.dayInfo.guestAppearWorseMoodChance)))){
_appearMood = 3;
};
var _local5 = (Math.random() < 0.5);
var _local6:Boolean = (_arg4) ? !(_local5) : _local5;
_guestLeft = new Guest(this, _arg1, _arg2, 1, 8, true, _local5, 8);
_guestRight = new Guest(this, _arg1, _arg2, 0, 10, false, _local6, 10);
_guestLeft.moveToNextQueuePosition();
_guestRight.moveToNextQueuePosition();
}
public function isReadyForServing():Boolean{
return (((_guestLeft.readyForServing) && (_guestRight.readyForServing)));
}
public function remove():void{
if (++_guestsRemoved == 2){
_model.removeGuestGroup(this);
};
}
public function isCouple():Boolean{
return (!((_guestLeft.male == _guestRight.male)));
}
public function get numInQueue():int{
return (_numInQueue);
}
public function serve():void{
_guestLeft.serve();
_guestRight.serve();
}
public function startEating(_arg1:Guest):void{
Managers.soundManager.play(SoundID.FOOD_GIVE_SFX);
_table.showFood(_arg1.foodType, _arg1.leftSide);
}
public function finishEating(_arg1:Guest):void{
_table.showFood("empty", _arg1.leftSide);
}
public function addPathTarget(_arg1:IPathTarget):void{
_guestLeft.addPathTarget(_arg1);
_guestRight.addPathTarget(_arg1);
}
public function get guests():Array{
return ([_guestLeft, _guestRight]);
}
public function set table(_arg1:Table):void{
_table = _arg1;
}
public function dispose():void{
_guestLeft.dispose();
_guestRight.dispose();
_guestLeft = null;
_guestRight = null;
_model = null;
}
public function get appearMood():int{
return (_appearMood);
}
public function set selected(_arg1:Boolean):void{
_selected = _arg1;
}
public function get maxMoney():int{
return ((_guestLeft.maxMoney + _guestRight.maxMoney));
}
public function get selected():Boolean{
return (_selected);
}
public function getNextQueuePlace(_arg1:Guest):IPathTarget{
var _local3:IPathTarget;
var _local2:Array = ((_arg1)==_guestLeft) ? _queuePlacesLeft : _queuePlacesRight;
if (--_nextQueuePositionGetCount == 0){
_nextQueuePositionGetCount = 2;
_local3 = _local2[--_numInQueue];
} else {
_local3 = _local2[(_numInQueue - 1)];
};
return (_local3);
}
public function get money():int{
return ((_guestLeft.money + _guestRight.money));
}
public function isCompleted():Boolean{
return (((_guestLeft.completed) && (_guestRight.completed)));
}
public function mouseRollOut():void{
_guestLeft.mouseRollOut();
_guestRight.mouseRollOut();
}
public function update():void{
_guestLeft.update();
_guestRight.update();
}
public function get table():Table{
return (_table);
}
public function mouseRollOver():void{
_guestLeft.mouseRollOver();
_guestRight.mouseRollOver();
}
public function leaveTable():void{
if (_table){
_table.removeGuestGroup();
};
}
public function sendSignal(_arg1:String):void{
_guestLeft.sendSignal(_arg1);
_guestRight.sendSignal(_arg1);
}
public function mouseDown():void{
_guestLeft.mouseDown();
_guestRight.mouseDown();
}
public function enableMouse():void{
if (((_guestLeft.canEnableMouse) && (_guestRight.canEnableMouse))){
_guestLeft.enableMouse();
_guestRight.enableMouse();
};
}
}
}//package pdiner2.game.entities
Section 218
//Effect (pdiner2.game.entities.Effect)
package pdiner2.game.entities {
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
public class Effect extends Entity {
private var _data:Object;
private var _effectType:String;
private var _x:Number;
private var _y:Number;
public static const COUPLE_BONUS:String = "COUPLE_BONUS";
public static const CLOSED_SIGN:String = "CLOSED_SIGN";
public static const MONEY_PICKUP:String = "MONEY_PICKUP";
public function Effect(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Object=null){
_effectType = _arg1;
_x = _arg2;
_y = _arg3;
_data = _arg4;
}
public function get y():Number{
return (_y);
}
public function remove():void{
dispatchEvent(new EntityEvent(EntityEvent.REMOVE, true));
}
public function get effectType():String{
return (_effectType);
}
public function get data():Object{
return (_data);
}
override public function update():void{
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
}
public function get x():Number{
return (_x);
}
}
}//package pdiner2.game.entities
Section 219
//Guest (pdiner2.game.entities.Guest)
package pdiner2.game.entities {
import com.bigwigmedia.stateMachine.*;
import pdiner2.managers.*;
import pdiner2.game.events.*;
import flash.geom.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.gameModelClasses.*;
import pdiner2.game.entityViews.*;
import pdiner2.constants.*;
public class Guest extends Entity {
private var _direction:String;// = null
private var _waitCounter:int;
private var _clothes:String;
private var _exitPlace:IPathTarget;
private var _canEnableMouse:Boolean;// = false
private var _foodType:String;
private var _maxMoney:int;
private var _tips:int;
private var _prevAnimationState:String;// = null
private var _model:GameModel;
private var _x:Number;
private var _pathPointsList:Array;
private var _speed:Number;
private var _changeMoodTime:int;
private var _stateMachine:IStateMachine;
private var _leftSide:Boolean;
private var _pathTargets:Array;
private var _tileX:int;
private var _tileY:int;
private var _group:IGuestGroup;
private var _animationState:String;// = null
private var _prevDirection:String;// = null
private var _worstMood:int;
private var _money:int;// = 0
private var _readyForServing:Boolean;// = false
private var _completed:Boolean;// = false
private var _mood:int;
private var _hat:String;
private var _male:Boolean;
private var _y:Number;
public static const SIGNAL_SELECT:String = "SIGNAL_SELECT";
public static const SIGNAL_SERVE:String = "SIGNAL_SERVE";
public static const SIGNAL_MOTION_END:String = "SIGNAL_MOTION_END";
public static const SIGNAL_TIMEOUT:String = "SIGNAL_TIMEOUT";
public static const SIGNAL_CONTINUE:String = "SIGNAL_CONTINUE";
public function Guest(_arg1:IGuestGroup, _arg2:GameModel, _arg3:GuestManager, _arg4:int, _arg5:int, _arg6:Boolean, _arg7:Boolean, _arg8:Number){
_pathPointsList = [];
_pathTargets = [];
super();
_group = _arg1;
_model = _arg2;
_leftSide = _arg6;
_male = _arg7;
_tileX = _arg4;
_tileY = _arg5;
_speed = _arg8;
_foodType = _arg3.getRandomFoodType();
_clothes = _arg3.getRandomGuestClothes(_male);
_hat = _arg3.getRandomGuestHat(_male);
_maxMoney = Managers.progressManager.getDayFoodPrice(_foodType);
_tips = Managers.progressManager.getDayTips();
_mood = (_worstMood = _group.appearMood);
_x = (((_tileX + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_X);
_y = (((_tileY + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_Y);
_stateMachine = new HSM();
var _local9:AbstractState = _stateMachine.addState(new InitialState());
var _local10:CompositeState = (_stateMachine.addState(new CompositeState()) as CompositeState);
var _local11:AbstractState = _local10.addState(new InitialState());
var _local12:AbstractState = _local10.addState(new SimpleState(enterGoingToNextPlace, null, exitGoingToNextPlace));
var _local13:AbstractState = _local10.addState(new SimpleState(enterWaitingInQueue, null, exitWaitingInQueue));
var _local14:AbstractState = _local10.addState(new ChoiceState());
var _local15:CompositeState = (_local10.addState(new CompositeState(null, updateWaiting, exitWaitingFirstComposite)) as CompositeState);
var _local16:AbstractState = _local15.addState(new InitialState());
var _local17:AbstractState = _local15.addState(new SimpleState(enterWaitingFirst));
var _local18:AbstractState = _local15.addState(new SimpleState(enterSelected, null, exitSelected));
var _local19:CompositeState = (_stateMachine.addState(new CompositeState(enterAtTableComposite)) as CompositeState);
var _local20:AbstractState = _local19.addState(new InitialState());
var _local21:AbstractState = _local19.addState(new SimpleState());
var _local22:AbstractState = _local19.addState(new SimpleState(enterReadingMenu));
var _local23:AbstractState = _local19.addState(new SimpleState(enterWaitingForPenny, updateWaiting, exitWaitingForPenny));
var _local24:AbstractState = _local19.addState(new SimpleState(enterWaitingForFood, updateWaiting, exitWaitingForFood));
var _local25:AbstractState = _local19.addState(new SimpleState(enterEating, null, exitEating));
var _local26:AbstractState = _local19.addState(new SimpleState(enterCompletedState));
var _local27:AbstractState = _local19.addState(new SimpleState(enterStandUpState, null, exitStandUpState));
var _local28:AbstractState = _stateMachine.addState(new SimpleState(enterLeaving));
var _local29:AbstractState = _stateMachine.addState(new FinalState());
_changeMoodTime = (_model.dayInfo.guestChangeMoodTime * Managers.progressManager.guestPatienceMultiplier);
_waitCounter = (_changeMoodTime * (_mood + 1));
_local9.addTransition(_local10, new EmptyTrigger());
_local11.addTransition(_local12, new EmptyTrigger());
_local12.addTransition(_local14, new SignalTrigger(SIGNAL_MOTION_END));
_local14.addTransition(_local15, new EmptyTrigger(), null, isFirstInQueue);
_local14.addTransition(_local13, new EmptyTrigger(), null);
_local13.addTransition(_local12, new SignalTrigger(SIGNAL_CONTINUE));
_local15.addTransition(_local28, new UpdateTrigger((_changeMoodTime * (_mood + 1))));
_local16.addTransition(_local17, new EmptyTrigger());
_local17.addTransition(_local18, new SignalTrigger(SIGNAL_SELECT));
_local18.addTransition(_local19, new SignalTrigger(SIGNAL_CONTINUE));
_local20.addTransition(_local21, new EmptyTrigger());
_local21.addTransition(_local22, new SignalTrigger(SIGNAL_MOTION_END));
_local22.addTransition(_local23, new UpdateTrigger(_model.dayInfo.guestReadingMenuTime));
_local23.addTransition(_local26, new UpdateTrigger((_changeMoodTime * 4)));
_local23.addTransition(_local24, new SignalTrigger(SIGNAL_SERVE), null, _group.isReadyForServing);
_local24.addTransition(_local26, new UpdateTrigger((_changeMoodTime * 4)));
_local24.addTransition(_local25, new SignalTrigger(SIGNAL_SERVE), null, isPennyHasCorrectFood);
_local25.addTransition(_local26, new UpdateTrigger(_model.dayInfo.guestEatingTime));
_local26.addTransition(_local27, new SignalTrigger(SIGNAL_CONTINUE), null, _group.isCompleted);
_local27.addTransition(_local28, new UpdateTrigger(5));
_local28.addTransition(_local29, new SignalTrigger(SIGNAL_MOTION_END), finish);
_stateMachine.start();
_exitPlace = new PathPlace(0, (_tileY - 1));
}
private function enterCompletedState(_arg1:AbstractEvent):void{
_completed = true;
_group.sendSignal(SIGNAL_CONTINUE);
}
public function get readyForServing():Boolean{
return (_readyForServing);
}
public function get male():Boolean{
return (_male);
}
public function serve():void{
_stateMachine.sendSignal(SIGNAL_SERVE);
}
private function enterReadingMenu(_arg1:AbstractEvent):void{
Managers.soundManager.play(SoundID.PENGUIN_READ_MENU_SFX);
_animationState = GuestView.STATE_READ_MENU;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
private function endWaitingCycle():void{
_waitCounter = (_changeMoodTime * 4);
_mood = 3;
dispatchEvent(new EntityEvent(EntityEvent.MOOD_CHANGE));
}
public function showHint(_arg1:String):void{
dispatchEvent(new HintEvent(HintEvent.SHOW, _arg1));
}
private function isPennyHasCorrectFood():Boolean{
return (_model.checkPennyFoodAndAquireIfHas(_foodType));
}
public function mouseRollOut():void{
dispatchEvent(new EntityEvent(EntityEvent.MOUSE_ROLL_OUT));
}
private function enterGoingToNextPlace(_arg1:AbstractEvent):void{
_animationState = GuestView.STATE_WALK;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
override public function dispose():void{
_stateMachine.dispose();
_stateMachine = null;
_model = null;
_group = null;
}
private function updateWaiting():void{
_waitCounter--;
_mood = (((_waitCounter < 0)) ? 0 : _waitCounter / _changeMoodTime);
dispatchEvent(new EntityEvent(EntityEvent.MOOD_CHANGE));
if (_mood < _worstMood){
_worstMood = _mood;
};
}
public function get completed():Boolean{
return (_completed);
}
private function exitStandUpState(_arg1:AbstractEvent):void{
dispatchEvent(new EntityEvent(EntityEvent.GUEST_REPARENT, true));
_group.leaveTable();
}
private function exitEating(_arg1:AbstractEvent):void{
_money = ((((_maxMoney * (_worstMood + 1)) / 4) + ((_worstMood == 3)) ? _tips : 0) + (((_group.isCouple()) && (_group.table.hasFlowers))) ? int(Managers.configManager.getCommonsXML("flowerAddTips")) : 0);
_group.finishEating(this);
_animationState = GuestView.STATE_WAIT_FOR_FOOD;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
public function sendSignal(_arg1:String):void{
_stateMachine.sendSignal(_arg1);
}
public function get clothes():String{
return (_clothes);
}
private function enterWaitingFirst(_arg1:AbstractEvent):void{
_canEnableMouse = true;
_group.enableMouse();
}
public function moveToNextQueuePosition():void{
addPathTarget(_group.getNextQueuePlace(this));
}
private function enterAtTableComposite(_arg1:AbstractEvent):void{
_exitPlace = new PathPlace(47, 10);
}
private function isFirstInQueue():Boolean{
return ((_group.numInQueue == 0));
}
public function get animationState():String{
return (_animationState);
}
private function exitWaitingForFood(_arg1:AbstractEvent):void{
endWaitingCycle();
dispatchEvent(new EntityEvent(EntityEvent.HIDE_SPEECH_BUBBLE));
_readyForServing = false;
}
public function get y():Number{
return (_y);
}
private function exitGoingToNextPlace(_arg1:AbstractEvent):void{
_animationState = GuestView.STATE_WAIT_IN_QUEUE;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
showHint(Hint.SELECT_CUSTOMER);
}
public function get group():IGuestGroup{
return (_group);
}
public function get direction():String{
return (_direction);
}
public function get x():Number{
return (_x);
}
private function enterEating(_arg1:AbstractEvent):void{
_group.startEating(this);
_animationState = GuestView.STATE_EATING;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
public function addPathTarget(_arg1:IPathTarget):void{
_pathTargets.push(_arg1);
}
private function finish(_arg1:AbstractEvent):void{
_group.remove();
}
public function get hat():String{
return (_hat);
}
private function exitWaitingInQueue(_arg1:AbstractEvent):void{
moveToNextQueuePosition();
}
private function enterSelected(_arg1:AbstractEvent):void{
Managers.soundManager.playSingle(SoundID.CLICK_PENGUIN_SFX);
dispatchEvent(new EntityEvent(EntityEvent.MOUSE_DISABLED));
showHint((_group.isCouple()) ? Hint.SEAT_CUSTOMER_COUPLE : Hint.SEAT_CUSTOMER);
}
private function enterWaitingForFood(_arg1:AbstractEvent):void{
Managers.soundManager.play(SoundID.POP_SFX);
_model.orderFood(_foodType);
dispatchEvent(new EntityEvent(EntityEvent.SHOW_SPEECH_BUBBLE));
_readyForServing = true;
_animationState = GuestView.STATE_WAIT_FOR_FOOD;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
public function mouseRollOver():void{
dispatchEvent(new EntityEvent(EntityEvent.MOUSE_ROLL_OVER));
}
public function get foodType():String{
return (_foodType);
}
public function get money():int{
return (_money);
}
private function enterLeaving(_arg1:AbstractEvent):void{
addPathTarget(_exitPlace);
_model.guestLeave(_group);
_animationState = GuestView.STATE_WALK;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
override public function update():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
var _local4:Point;
var _local5:IPathTarget;
var _local6:IPathTarget;
var _local7:Point;
var _local8:Array;
_stateMachine.update();
if (_pathPointsList.length > 1){
_local1 = _pathPointsList.shift();
_local2 = (_local1.x - _x);
_local3 = (_local1.y - _y);
if (((!((_local2 == 0))) || (!((_local3 == 0))))){
_animationState = GuestView.STATE_WALK;
_direction = Direction.getDirection(_local2, _local3);
_x = _local1.x;
_y = _local1.y;
dispatchEvent(new EntityEvent(EntityEvent.MOVE));
};
};
if (_pathPointsList.length <= 1){
if (_pathPointsList.length == 1){
_local4 = _pathPointsList.shift();
_tileX = _local4.x;
_tileY = _local4.y;
_local5 = _pathTargets.shift();
_local5.characterAction(this);
_stateMachine.sendSignal(SIGNAL_MOTION_END);
};
if (_pathTargets.length > 0){
_local6 = _pathTargets[0];
_local7 = _local6.getPathTargetTile(this);
_local8 = _model.getPathPoints(_tileX, _tileY, _local7.x, _local7.y, _speed);
_pathPointsList = _local8;
_pathPointsList.push(_local7);
};
};
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
if (_animationState == GuestView.STATE_WALK){
if ((((_prevDirection == _direction)) && ((_prevAnimationState == GuestView.STATE_WALK)))){
return;
};
} else {
if (_prevAnimationState == _animationState){
return;
};
};
_prevAnimationState = _animationState;
_prevDirection = _direction;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
private function exitWaitingForPenny(_arg1:AbstractEvent):void{
endWaitingCycle();
_readyForServing = false;
}
public function get maxMoney():int{
return ((_maxMoney + _tips));
}
private function enterWaitingForPenny(_arg1:AbstractEvent):void{
Managers.soundManager.playSingle((_male) ? SoundID.HELLO_SFX : SoundID.HELLO_F2_SFX);
_readyForServing = true;
_animationState = GuestView.STATE_WAIT_FOR_ORDER;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
private function enterWaitingInQueue(_arg1:AbstractEvent):void{
if (_model.advanceToNextPlace(_group)){
_group.sendSignal(SIGNAL_CONTINUE);
};
}
private function exitSelected(_arg1:AbstractEvent):void{
_group.selected = false;
dispatchEvent(new EntityEvent(EntityEvent.MOUSE_DISABLED));
}
public function enableMouse():void{
dispatchEvent(new EntityEvent(EntityEvent.MOUSE_ENABLED));
}
private function exitWaitingFirstComposite(_arg1:AbstractEvent):void{
endWaitingCycle();
}
public function mouseDown():void{
_group.selected = true;
_group.sendSignal(SIGNAL_SELECT);
}
public function get canEnableMouse():Boolean{
return (_canEnableMouse);
}
public function get mood():int{
return (_mood);
}
private function enterStandUpState(_arg1:AbstractEvent):void{
_animationState = GuestView.STATE_STAND_UP;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
public function get leftSide():Boolean{
return (_leftSide);
}
}
}//package pdiner2.game.entities
Section 220
//Hint (pdiner2.game.entities.Hint)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.constants.*;
public class Hint extends Entity {
private var _x:Number;
private var _message:String;
private var _y:Number;
public static const SELECT_CUSTOMER:String = "SELECT_CUSTOMER";
public static const PICKUP_ALL_MONEY:String = "PICKUP_ALL_MONEY";
public static const SEAT_CUSTOMER_COUPLE:String = "SEAT_CUSTOMER_COUPLE";
public static const PICKUP_FOOD:String = "PICKUP_FOOD";
public static const WAIT_CUSTOMER_MAKE_ORDER:String = "WAIT_CUSTOMER_MAKE_ORDER";
public static const TAKE_ORDER:String = "TAKE_ORDER";
public static const SEAT_CUSTOMER:String = "SEAT_CUSTOMER";
public static const CLEAN_TABLE:String = "CLEAN_TABLE";
public function Hint(_arg1:String, _arg2:Object){
if (_arg2){
_x = _arg2.x;
_y = _arg2.y;
} else {
_x = 320;
_y = 240;
};
switch (_arg1){
case SELECT_CUSTOMER:
_message = "Look, a customer!\nClick your guest to select";
break;
case SEAT_CUSTOMER:
_message = "Now click on a free table\nto seat the customer";
break;
case SEAT_CUSTOMER_COUPLE:
_message = "Seat these love birds\nat table with flowers\nto get more tips";
break;
case WAIT_CUSTOMER_MAKE_ORDER:
_message = "Wait for the customer\nto make an order";
break;
case TAKE_ORDER:
_message = "Click customer\nto take the order";
break;
case PICKUP_FOOD:
_message = "Take the food\nand serve it\nto the customer";
break;
case CLEAN_TABLE:
_message = "Now clean\nthe table and\npick up your tip";
break;
case PICKUP_ALL_MONEY:
_message = "Pickup all\nthe money!";
break;
};
Managers.soundManager.play(SoundID.MESSAGE_POPUP_SFX);
}
public function remove():void{
dispatchEvent(new EntityEvent(EntityEvent.REMOVE_NOW, true));
}
public function get message():String{
return (_message);
}
override public function update():void{
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
}
public function get y():Number{
return (_y);
}
public function get x():Number{
return (_x);
}
}
}//package pdiner2.game.entities
Section 221
//IGuestGroup (pdiner2.game.entities.IGuestGroup)
package pdiner2.game.entities {
import com.bigwigmedia.core.*;
public interface IGuestGroup extends IDisposable, IUpdatable {
function get money():int;
function isCompleted():Boolean;
function get maxMoney():int;
function remove():void;
function get numInQueue():int;
function isCouple():Boolean;
function startEating(_arg1:Guest):void;
function get table():Table;
function serve():void;
function sendSignal(_arg1:String):void;
function finishEating(_arg1:Guest):void;
function leaveTable():void;
function get selected():Boolean;
function set table(_arg1:Table):void;
function addPathTarget(_arg1:IPathTarget):void;
function enableMouse():void;
function mouseDown():void;
function get guests():Array;
function get appearMood():int;
function mouseRollOut():void;
function mouseRollOver():void;
function isReadyForServing():Boolean;
function set selected(_arg1:Boolean):void;
function getNextQueuePlace(_arg1:Guest):IPathTarget;
}
}//package pdiner2.game.entities
Section 222
//IPathTarget (pdiner2.game.entities.IPathTarget)
package pdiner2.game.entities {
import flash.geom.*;
import com.bigwigmedia.mvc.*;
public interface IPathTarget {
function getPathTargetTile(_arg1:Entity):Point;
function characterAction(_arg1:Entity):void;
}
}//package pdiner2.game.entities
Section 223
//PathPlace (pdiner2.game.entities.PathPlace)
package pdiner2.game.entities {
import flash.geom.*;
import com.bigwigmedia.mvc.*;
public class PathPlace implements IPathTarget {
private var _tile:Point;
public function PathPlace(_arg1:Number, _arg2:Number){
_tile = new Point(_arg1, _arg2);
}
public function getPathTargetTile(_arg1:Entity):Point{
return (_tile);
}
public function characterAction(_arg1:Entity):void{
}
}
}//package pdiner2.game.entities
Section 224
//Penny (pdiner2.game.entities.Penny)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.events.*;
import flash.geom.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.constants.*;
public class Penny extends Entity {
private var _direction:String;// = null
private var _prevIdle:Boolean;// = false
private var _x:Number;
private var _prevDirection:String;// = null
private var _model:GameModel;
private var _pathPointsList:Array;
private var _speed:Number;
private var _idle:Boolean;// = false
private var _pathTargets:Array;
private var _foodRight:String;// = null
private var _skateUpgrade:int;
private var _foodLeft:String;// = null
private var _tileX:int;
private var _tileY:int;
private var _uniform:String;
private var _y:Number;
public static const MAX_PATH_TARGETS:int = 4;
public function Penny(_arg1:GameModel, _arg2:int, _arg3:int){
_pathPointsList = [];
_pathTargets = [];
super();
_model = _arg1;
_tileX = _arg2;
_tileY = _arg3;
_uniform = Managers.progressManager.pennyUniform;
_skateUpgrade = Managers.progressManager.skateUpgrade;
_speed = Managers.progressManager.pennySpeed;
_x = (((_tileX + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_X);
_y = (((_tileY + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_Y);
}
public function get skateUpgrade():int{
return (_skateUpgrade);
}
public function get foodLeft():String{
return (_foodLeft);
}
public function serveFood(_arg1:String):void{
if (_foodLeft == _arg1){
_foodLeft = null;
} else {
if (_foodLeft){
_foodRight = _foodLeft;
_foodLeft = null;
} else {
_foodRight = null;
};
};
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
public function pickupCounterPlate(_arg1:String):Boolean{
if (((_foodLeft) && (_foodRight))){
return (false);
};
if (!_foodRight){
_foodRight = _arg1;
} else {
_foodLeft = _arg1;
};
Managers.soundManager.play(SoundID.FOOD_PICKUP_SFX);
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
return (true);
}
public function addPathTarget(_arg1:IPathTarget):void{
if ((((_pathTargets.length < MAX_PATH_TARGETS)) && (!((_pathTargets[(_pathTargets.length - 1)] == _arg1))))){
_pathTargets.push(_arg1);
};
}
public function hasFood(_arg1:String):Boolean{
return ((((_foodLeft == _arg1)) || ((_foodRight == _arg1))));
}
public function disposeFood():void{
if (((!(_foodLeft)) && (!(_foodRight)))){
return;
};
Managers.soundManager.play(SoundID.TRASHCAN_SFX);
_foodLeft = null;
_foodRight = null;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
}
override public function dispose():void{
_model = null;
}
public function get uniform():String{
return (_uniform);
}
public function removePathTarget(_arg1:IPathTarget):void{
var _local2:int = _pathTargets.indexOf(_arg1);
if (_local2 != -1){
_pathTargets.splice(_local2, 1);
};
}
public function get numPlates():int{
if (((_foodLeft) && (_foodRight))){
return (2);
};
if (((!(_foodLeft)) && (!(_foodRight)))){
return (0);
};
return (1);
}
override public function update():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
var _local4:Point;
var _local5:IPathTarget;
var _local6:IPathTarget;
var _local7:Point;
var _local8:Array;
if (_pathPointsList.length > 1){
_local1 = _pathPointsList.shift();
_local2 = (_local1.x - _x);
_local3 = (_local1.y - _y);
if (((!((_local2 == 0))) || (!((_local3 == 0))))){
_direction = Direction.getDirection(_local2, _local3);
_x = _local1.x;
_y = _local1.y;
_idle = false;
dispatchEvent(new EntityEvent(EntityEvent.MOVE));
};
};
if (_pathPointsList.length <= 1){
if (_pathPointsList.length == 1){
_local4 = _pathPointsList.shift();
_tileX = _local4.x;
_tileY = _local4.y;
_local5 = _pathTargets.shift();
_local5.characterAction(this);
_idle = true;
};
if (_pathTargets.length > 0){
_local6 = _pathTargets[0];
_local7 = _local6.getPathTargetTile(this);
_local8 = _model.getPathPoints(_tileX, _tileY, _local7.x, _local7.y, _speed);
if (_local8){
_pathPointsList = _local8;
_pathPointsList.push(_local7);
};
};
};
dispatchEvent(new EntityEvent(EntityEvent.UPDATE));
if (((!((_idle == _prevIdle))) || (!((_direction == _prevDirection))))){
_prevIdle = _idle;
_prevDirection = _direction;
dispatchEvent(new EntityEvent(EntityEvent.ANIMATION_CHANGE));
};
}
public function get idle():Boolean{
return (_idle);
}
public function get foodRight():String{
return (_foodRight);
}
public function get x():Number{
return (_x);
}
public function get y():Number{
return (_y);
}
public function get direction():String{
return (_direction);
}
}
}//package pdiner2.game.entities
Section 225
//SingleGuestGroup (pdiner2.game.entities.SingleGuestGroup)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.*;
import pdiner2.game.gameModelClasses.*;
import pdiner2.constants.*;
public class SingleGuestGroup implements IGuestGroup {
private var _numInQueue:int;
private var _model:GameModel;
private var _appearMood:int;
private var _table:Table;
private var _guest:Guest;
private var _selected:Boolean;// = false
private static var _queuePlaces:Array = [new PathPlace(9, 9), new PathPlace(7, 9), new PathPlace(5, 9)];
public function SingleGuestGroup(_arg1:GameModel, _arg2:GuestManager, _arg3:int){
_model = _arg1;
_numInQueue = _arg3;
_appearMood = _model.dayInfo.guestAppearMood;
if (((!((_appearMood == 3))) && ((Math.random() > _model.dayInfo.guestAppearWorseMoodChance)))){
_appearMood = 3;
};
_guest = new Guest(this, _arg1, _arg2, 0, 9, (Math.random() < 0.5), (Math.random() < 0.5), 8);
_guest.moveToNextQueuePosition();
}
public function isReadyForServing():Boolean{
return (_guest.readyForServing);
}
public function remove():void{
_model.removeGuestGroup(this);
}
public function get numInQueue():int{
return (_numInQueue);
}
public function isCouple():Boolean{
return (false);
}
public function startEating(_arg1:Guest):void{
Managers.soundManager.play(SoundID.FOOD_GIVE_SFX);
_table.showFood(_arg1.foodType, _arg1.leftSide);
}
public function serve():void{
_guest.serve();
}
public function finishEating(_arg1:Guest):void{
_table.showFood("empty", _arg1.leftSide);
}
public function addPathTarget(_arg1:IPathTarget):void{
_guest.addPathTarget(_arg1);
}
public function dispose():void{
_guest.dispose();
_guest = null;
_model = null;
}
public function get guests():Array{
return ([_guest]);
}
public function set table(_arg1:Table):void{
_table = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
public function get appearMood():int{
return (_appearMood);
}
public function set selected(_arg1:Boolean):void{
_selected = _arg1;
}
public function get maxMoney():int{
return (_guest.maxMoney);
}
public function getNextQueuePlace(_arg1:Guest):IPathTarget{
var _local2:IPathTarget = _queuePlaces[--_numInQueue];
return (_local2);
}
public function get money():int{
return (_guest.money);
}
public function isCompleted():Boolean{
return (_guest.completed);
}
public function mouseRollOut():void{
_guest.mouseRollOut();
}
public function mouseRollOver():void{
_guest.mouseRollOver();
}
public function update():void{
_guest.update();
}
public function get table():Table{
return (_table);
}
public function leaveTable():void{
_table.removeGuestGroup();
}
public function enableMouse():void{
if (_guest.canEnableMouse){
_guest.enableMouse();
};
}
public function mouseDown():void{
_guest.mouseDown();
}
public function sendSignal(_arg1:String):void{
_guest.sendSignal(_arg1);
}
}
}//package pdiner2.game.entities
Section 226
//Table (pdiner2.game.entities.Table)
package pdiner2.game.entities {
import pdiner2.managers.*;
import pdiner2.game.events.*;
import flash.geom.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.constants.*;
public class Table extends Entity implements IPathTarget {
private var _moneyAmountIndex:int;
private var _hasFlowers:Boolean;
private var _guestGroup:IGuestGroup;
private var _model:GameModel;
private var _tileX:Number;
private var _tileY:Number;
private var _moneyLeft:int;// = -1
private var _x:Number;
private var _y:Number;
private var _showCoupleBonusEffect:Boolean;
public function Table(_arg1:GameModel, _arg2:Boolean, _arg3:Number, _arg4:Number){
_model = _arg1;
_hasFlowers = _arg2;
_tileX = _arg3;
_tileY = _arg4;
_x = (((_arg3 + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_X);
_y = (((_arg4 + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_Y);
}
public function get y():Number{
return (_y);
}
public function showFood(_arg1:String, _arg2:Boolean):void{
var _local3:EntityEvent = new EntityEvent(EntityEvent.SHOW_FOOD);
_local3.data = {foodType:_arg1, leftSide:_arg2};
dispatchEvent(_local3);
}
public function removeGuestGroup():void{
var _local2:int;
var _local1:int = _guestGroup.money;
_moneyLeft = ((_local1 == 0)) ? -1 : _local1;
if (_moneyLeft != -1){
_local2 = _guestGroup.maxMoney;
_moneyAmountIndex = ((_local1 >= _local2)) ? 2 : ((_local1 > (_local2 / 2))) ? 1 : 0;
dispatchEvent(new EntityEvent(EntityEvent.SHOW_MONEY));
};
_guestGroup.table = null;
_guestGroup = null;
dispatchEvent(new HintEvent(HintEvent.SHOW, Hint.CLEAN_TABLE));
}
public function addGuestGroup(_arg1:IGuestGroup):void{
if (_guestGroup){
throw (new Error("Can't add multiple groups"));
};
_showCoupleBonusEffect = true;
_guestGroup = _arg1;
_guestGroup.table = this;
}
public function get moneyAmountIndex():int{
return (_moneyAmountIndex);
}
public function getPathTargetTile(_arg1:Entity):Point{
var _local2:Guest;
if ((_arg1 is Penny)){
if (Penny(_arg1).y > _y){
return (new Point(_tileX, (_tileY + 1)));
};
return (new Point(_tileX, (_tileY - 2)));
} else {
if ((_arg1 is Guest)){
_local2 = Guest(_arg1);
if (_local2.leftSide){
return (new Point((_tileX - 4), (_tileY + 1)));
};
return (new Point((_tileX + 4), (_tileY + 1)));
};
};
throw (new Error((("Entity " + _arg1) + " is not supported")));
}
public function get occupied():Boolean{
return (((!((_moneyLeft == -1))) || (!((_guestGroup == null)))));
}
override public function dispose():void{
_model = null;
}
public function get moneyLeft():int{
return (_moneyLeft);
}
public function get x():Number{
return (_x);
}
public function get hasFlowers():Boolean{
return (_hasFlowers);
}
public function characterAction(_arg1:Entity):void{
var _local2:EntityEvent;
if ((_arg1 as Penny)){
if (_guestGroup){
_guestGroup.serve();
} else {
if (_moneyLeft != -1){
Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX);
dispatchEvent(new EntityEvent(EntityEvent.PICKUP_MONEY));
_model.pickupMoney(this);
_moneyLeft = -1;
};
};
} else {
if ((_arg1 is Guest)){
if (((((_hasFlowers) && (Guest(_arg1).group.isCouple()))) && (_showCoupleBonusEffect))){
_showCoupleBonusEffect = false;
_model.showCoupleBonusEffect(this);
Managers.soundManager.play(SoundID.PENG_LOVE2_WAV);
};
_local2 = new EntityEvent(EntityEvent.GUEST_REPARENT, true);
_local2.data = this;
_arg1.dispatchEvent(_local2);
};
};
}
}
}//package pdiner2.game.entities
Section 227
//Trashbin (pdiner2.game.entities.Trashbin)
package pdiner2.game.entities {
import flash.geom.*;
import com.bigwigmedia.mvc.*;
public class Trashbin extends Entity implements IPathTarget {
private var _tileX:Number;// = 28
private var _tileY:Number;// = 20
public function getPathTargetTile(_arg1:Entity):Point{
if ((_arg1 is Penny)){
return (new Point(_tileX, _tileY));
};
throw (new Error((("Entity " + _arg1) + " is not supported")));
}
public function characterAction(_arg1:Entity):void{
var _local2:Penny = Penny(_arg1);
_local2.disposeFood();
}
}
}//package pdiner2.game.entities
Section 228
//AbstractCharacterView (pdiner2.game.entityViews.AbstractCharacterView)
package pdiner2.game.entityViews {
import flash.display.*;
import pdiner2.managers.*;
public class AbstractCharacterView extends AbstractEntityView {
private var _animationClients:Array;
public static const COMMAND_SHOW_HINT:String = "showHint";
public static const COMMAND_GOTO_FRAME_AND_PLAY:String = "gotoFrameAndPlay";
public static const COMMAND_PLAY_SOUND:String = "playSound";
public static const COMMAND_STOP:String = "stop";
public function AbstractCharacterView(){
_animationClients = [];
super();
}
protected function childAdded(_arg1:DisplayObject):void{
var _local2:EntityViewAnimationClient = (_arg1 as EntityViewAnimationClient);
if (_local2){
_local2.stop();
_animationClients.push(_local2);
};
}
protected function preEnterFrame():void{
_animationClients = [];
}
protected function executeCommand(_arg1:EntityViewAnimationClient, _arg2:String, _arg3:String):void{
switch (_arg2){
case COMMAND_PLAY_SOUND:
Managers.soundManager.play(_arg3);
break;
case COMMAND_STOP:
_arg1.playing = false;
_arg1.stop();
break;
case COMMAND_GOTO_FRAME_AND_PLAY:
_arg1.playing = true;
_arg1.gotoAndStop(int(_arg3));
break;
};
}
override public function dispose():void{
_animationClients = [];
}
protected function updateAnimations():void{
var _local1:EntityViewAnimationClient;
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:String;
for each (_local1 in _animationClients) {
if (_local1.playing){
if (_local1.currentFrame == _local1.totalFrames){
_local1.gotoAndStop(1);
} else {
_local1.nextFrame();
};
};
_local2 = _local1.currentLabel;
if (_local1.prevLabel != _local2){
_local1.prevLabel = _local2;
if (_local2){
_local3 = _local2.indexOf("#");
_local4 = ((_local3 == -1)) ? _local2 : _local2.substring(0, _local3);
_local5 = ((_local3 == -1)) ? null : _local2.substring((_local3 + 1));
executeCommand(_local1, _local4, _local5);
};
};
};
}
}
}//package pdiner2.game.entityViews
Section 229
//AbstractEntityView (pdiner2.game.entityViews.AbstractEntityView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.filters.*;
import com.bigwigmedia.core.*;
public class AbstractEntityView extends Sprite implements IDisposable {
protected static var _glowFilter:GlowFilter = new GlowFilter(0x9900, 1, 8, 8, 2, 1);
public function dispose():void{
}
}
}//package pdiner2.game.entityViews
Section 230
//ChefView (pdiner2.game.entityViews.ChefView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
public class ChefView extends AbstractCharacterView {
private var _entity:Chef;
private var _chefClip:ChefClip;
private var _animation:EntityViewAnimationClient;
public function ChefView(_arg1:Entity){
_entity = Chef(_arg1);
_entity.addEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity.addEventListener(EntityEvent.ANIMATION_CHANGE, onAnimationChangeHandler);
_chefClip = new ChefClip();
_chefClip.addEventListener(Event.ADDED, onChildAddedHandler);
_chefClip.gotoAndStop((Managers.progressManager.chefUpgrade + 1));
addChild(_chefClip);
this.x = 16;
this.y = 380;
}
private function onChildAddedHandler(_arg1:Event):void{
var _local2:DisplayObject = (_arg1.target as DisplayObject);
if (_local2.parent == _chefClip){
childAdded(_local2);
_animation = EntityViewAnimationClient(_local2);
_animation.playing = false;
_animation.gotoAndStop(1);
};
}
private function onUpdateHandler(_arg1:EntityEvent):void{
updateAnimations();
}
private function onAnimationChangeHandler(_arg1:EntityEvent):void{
if (_animation){
_animation.gotoAndStop(1);
_animation.playing = _entity.playing;
};
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity = null;
_animation = null;
_chefClip.removeEventListener(Event.ADDED, onChildAddedHandler);
removeChild(_chefClip);
_chefClip = null;
super.dispose();
}
}
}//package pdiner2.game.entityViews
Section 231
//ClosedSignView (pdiner2.game.entityViews.ClosedSignView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
public class ClosedSignView extends AbstractCharacterView {
private var _entity:ClosedSign;
private var _clip:ClosedSignClip;
public function ClosedSignView(_arg1:Entity){
_entity = ClosedSign(_arg1);
_entity.addEventListener(EntityEvent.UPDATE, onUpdateHandler);
this.addEventListener(Event.ADDED, onChildAddedHandler);
_clip = new ClosedSignClip();
addChild(_clip);
this.x = 32;
this.y = 240;
}
private function onUpdateHandler(_arg1:EntityEvent):void{
updateAnimations();
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity = null;
removeChild(_clip);
_clip = null;
super.dispose();
}
private function onChildAddedHandler(_arg1:Event):void{
var _local2:DisplayObject = (_arg1.target as DisplayObject);
if (_local2 == _clip){
childAdded(_local2);
};
}
}
}//package pdiner2.game.entityViews
Section 232
//CounterPlaceView (pdiner2.game.entityViews.CounterPlaceView)
package pdiner2.game.entityViews {
import com.bigwigmedia.mvc.*;
public class CounterPlaceView extends AbstractEntityView {
public function CounterPlaceView(_arg1:Entity){
cacheAsBitmap = true;
graphics.beginFill(0xFFFFFF, 0);
graphics.drawRect(0, 415, 350, 65);
graphics.endFill();
}
}
}//package pdiner2.game.entityViews
Section 233
//CounterPlateView (pdiner2.game.entityViews.CounterPlateView)
package pdiner2.game.entityViews {
import flash.events.*;
import pdiner2.game.events.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.tweens.easing.*;
public class CounterPlateView extends AbstractEntityView {
private var _entity:CounterPlate;
private var _plateClip:PlateClip;
private var _tween:ITween;
public function CounterPlateView(_arg1:Entity){
_entity = CounterPlate(_arg1);
_entity.addEventListener(EntityEvent.SHOW_FOOD, onShowFoodHandler);
this.mouseChildren = false;
_plateClip = new PlateClip();
_plateClip.scaleX = (_plateClip.scaleY = 1.15);
_plateClip.visible = false;
_plateClip.stop();
addChild(_plateClip);
_tween = new ParallelTween([new PropertyTween(_plateClip, "y", -15, 0, 15, Easing.BOUNCE_OUT), new PropertyTween(_plateClip, "alpha", 0, 1, 7, Easing.LINEAR)]);
this.addEventListener(MouseEvent.ROLL_OVER, onMouseRollOverHandler);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseRollOutHandler);
this.x = (((_entity.tileX + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_X);
this.y = (((_entity.tileY + 0.5) * GameModel.MAP_TILE_SIZE) + GameView.ROOM_DISP_Y);
}
private function onShowFoodHandler(_arg1:EntityEvent):void{
if (_entity.foodType != null){
_plateClip.y = -15;
_plateClip.alpha = 0;
_plateClip.gotoAndStop(_entity.foodType);
_plateClip.visible = true;
_tween.reset();
_tween.playAuto();
} else {
_plateClip.visible = false;
};
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.SHOW_FOOD, onShowFoodHandler);
_entity = null;
_tween.dispose();
_tween = null;
removeChild(_plateClip);
_plateClip = null;
}
private function onMouseRollOverHandler(_arg1:MouseEvent):void{
this.filters = [_glowFilter];
}
private function onMouseRollOutHandler(_arg1:MouseEvent):void{
this.filters = [];
}
}
}//package pdiner2.game.entityViews
Section 234
//CoupleBonusView (pdiner2.game.entityViews.CoupleBonusView)
package pdiner2.game.entityViews {
import flash.display.*;
import pdiner2.game.events.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.events.*;
import assets.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.tweens.easing.*;
public class CoupleBonusView extends AbstractEntityView {
private var _entity:Effect;
private var _tween:ITween;
private var _clip:Sprite;
public function CoupleBonusView(_arg1:Effect){
_entity = _arg1;
_entity.addEventListener(EntityEvent.UPDATE, onEntityUpdateHandler);
this.mouseChildren = false;
this.x = _arg1.x;
this.y = _arg1.y;
_clip = new CoupleBonusClip();
addChild(_clip);
_tween = new SequenceTween([new PropertyTween(_clip, "y", 0, -60, 30, Easing.QUADRATIC_OUT), new PropertyTween(_clip, "alpha", 1, 0, 5, Easing.LINEAR)]);
_tween.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
_entity.remove();
}
private function onEntityUpdateHandler(_arg1:EntityEvent):void{
_tween.update();
}
override public function dispose():void{
_entity = null;
_tween.dispose();
_tween = null;
removeChild(_clip);
_clip = null;
}
}
}//package pdiner2.game.entityViews
Section 235
//EntityViewAnimationClient (pdiner2.game.entityViews.EntityViewAnimationClient)
package pdiner2.game.entityViews {
import flash.display.*;
public class EntityViewAnimationClient extends MovieClip {
public var prevLabel:String;// = null
public var playing:Boolean;// = true
}
}//package pdiner2.game.entityViews
Section 236
//GuestView (pdiner2.game.entityViews.GuestView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.tweens.easing.*;
public class GuestView extends AbstractCharacterView {
private var _bubbleTween:ITween;
private var _entity:Guest;
private var _guestClip:MovieClip;
private var _bubble:Sprite;
private var _faceClip:MovieClip;
public static const STATE_WAIT_FOR_FOOD:String = "wait_for_food";
public static const STATE_STAND_UP:String = "stand_up";
public static const STATE_WAIT_IN_QUEUE:String = "wait_in_queue";
public static const STATE_WALK:String = "walk";
public static const STATE_EATING:String = "eating";
public static const STATE_READ_MENU:String = "read_menu";
public static const STATE_WAIT_FOR_ORDER:String = "wait_for_order";
public function GuestView(_arg1:Entity){
_entity = Guest(_arg1);
_entity.addEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity.addEventListener(EntityEvent.MOVE, onMoveHandler);
_entity.addEventListener(EntityEvent.MOOD_CHANGE, onMoodChangeHandler);
_entity.addEventListener(EntityEvent.ANIMATION_CHANGE, onAnimationChangeHandler);
_entity.addEventListener(EntityEvent.SHOW_SPEECH_BUBBLE, onShowBubbleHandler);
_entity.addEventListener(EntityEvent.HIDE_SPEECH_BUBBLE, onHideBubbleHandler);
_entity.addEventListener(EntityEvent.MOUSE_DISABLED, onMouseDisabledHandler);
_entity.addEventListener(EntityEvent.MOUSE_ENABLED, onMouseEnabledHandler);
_entity.addEventListener(EntityEvent.MOUSE_ROLL_OUT, onGroupRollOutHandler);
_entity.addEventListener(EntityEvent.MOUSE_ROLL_OVER, onGroupRollOverHandler);
this.mouseChildren = false;
this.mouseEnabled = false;
this.x = _entity.x;
this.y = _entity.y;
_guestClip = new GuestClip();
_guestClip.addEventListener(Event.ADDED, onChildAddedHandler);
_guestClip.gotoAndStop("walk_side");
addChild(_guestClip);
}
private function onMouseDisabledHandler(_arg1:EntityEvent):void{
this.mouseEnabled = false;
}
private function onChildAddedHandler(_arg1:Event):void{
var _local2:MovieClip = (_arg1.target as MovieClip);
if (!_local2){
return;
};
var _local3:String = _local2.name;
switch (_local3){
case "eyes":
_local2.gotoAndStop((_entity.male) ? "male" : "female");
break;
case "face":
_faceClip = _local2;
onMoodChangeHandler(null);
break;
case "flipper_left":
case "flipper_right":
case "body":
_local2.gotoAndStop(Number(_entity.clothes));
break;
case "head":
_local2.gotoAndStop(Number(_entity.hat));
break;
};
childAdded(_local2);
}
private function onShowBubbleHandler(_arg1:EntityEvent):void{
_bubble = new BubbleClip();
_bubble.x = 32;
_bubble.y = -100;
var _local2:MovieClip = MovieClip(_bubble.getChildByName("bubble_food"));
_local2.gotoAndStop(_entity.foodType);
if (_guestClip.scaleX == -1){
_local2.scaleX = -1;
};
_guestClip.addChild(_bubble);
_bubbleTween = new ScaleTween(_bubble, 0, 1, 20, Easing.ELASTIC_OUT);
}
private function onAnimationChangeHandler(_arg1:EntityEvent):void{
var _local2:String = _entity.animationState;
var _local3:String = _entity.direction;
var _local4:String = _local2;
if (_local2 == STATE_WALK){
switch (_local3){
case Direction.DOWN:
_local4 = (_local2 + "_front");
break;
case Direction.UP:
_local4 = (_local2 + "_back");
break;
case Direction.LEFT:
_local4 = (_local2 + "_side");
_guestClip.scaleX = -1;
break;
case Direction.RIGHT:
_local4 = (_local2 + "_side");
_guestClip.scaleX = 1;
break;
};
};
if (_local2 == STATE_READ_MENU){
_guestClip.scaleX = (_entity.leftSide) ? 1 : -1;
};
preEnterFrame();
_faceClip = null;
_guestClip.gotoAndStop(_local4);
}
override protected function executeCommand(_arg1:EntityViewAnimationClient, _arg2:String, _arg3:String):void{
if (_arg2 == COMMAND_SHOW_HINT){
_entity.showHint(_arg3);
} else {
super.executeCommand(_arg1, _arg2, _arg3);
};
}
private function onGroupRollOverHandler(_arg1:EntityEvent):void{
this.filters = [_glowFilter];
}
private function onMoveHandler(_arg1:EntityEvent):void{
if (int(_entity.y) != int(this.y)){
dispatchEvent(new EntityViewEvent(EntityViewEvent.DEPTH_CHANGE, true));
};
this.x = _entity.x;
this.y = _entity.y;
}
private function onMouseRollOutHandler(_arg1:MouseEvent):void{
_entity.group.mouseRollOut();
}
private function onUpdateHandler(_arg1:EntityEvent):void{
if (_bubbleTween){
_bubbleTween.update();
};
updateAnimations();
}
private function onMoodChangeHandler(_arg1:EntityEvent):void{
var _local2:int;
if (_faceClip){
_local2 = (_entity.mood + 1);
if (_faceClip.currentFrame != _local2){
_faceClip.gotoAndStop(_local2);
};
};
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity.removeEventListener(EntityEvent.MOVE, onMoveHandler);
_entity.removeEventListener(EntityEvent.MOOD_CHANGE, onMoodChangeHandler);
_entity.removeEventListener(EntityEvent.ANIMATION_CHANGE, onAnimationChangeHandler);
_entity.removeEventListener(EntityEvent.SHOW_SPEECH_BUBBLE, onShowBubbleHandler);
_entity.removeEventListener(EntityEvent.HIDE_SPEECH_BUBBLE, onHideBubbleHandler);
_entity.removeEventListener(EntityEvent.MOUSE_DISABLED, onMouseDisabledHandler);
_entity.removeEventListener(EntityEvent.MOUSE_ENABLED, onMouseEnabledHandler);
_entity.removeEventListener(EntityEvent.MOUSE_ROLL_OUT, onGroupRollOutHandler);
_entity.removeEventListener(EntityEvent.MOUSE_ROLL_OVER, onGroupRollOverHandler);
_entity = null;
if (_bubbleTween){
_bubbleTween.dispose();
_bubbleTween = null;
};
_faceClip = null;
_guestClip.removeEventListener(Event.ADDED, onChildAddedHandler);
removeChild(_guestClip);
_guestClip = null;
super.dispose();
}
private function onMouseDownHandler(_arg1:MouseEvent):void{
_entity.group.mouseDown();
}
private function onMouseEnabledHandler(_arg1:EntityEvent):void{
this.mouseEnabled = true;
}
private function onMouseRollOverHandler(_arg1:MouseEvent):void{
_entity.group.mouseRollOver();
}
private function onHideBubbleHandler(_arg1:EntityEvent):void{
_bubbleTween.dispose();
_bubbleTween = null;
_guestClip.removeChild(_bubble);
_bubble = null;
}
override public function set mouseEnabled(_arg1:Boolean):void{
if (_arg1){
this.addEventListener(MouseEvent.ROLL_OVER, onMouseRollOverHandler);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseRollOutHandler);
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
} else {
this.removeEventListener(MouseEvent.ROLL_OVER, onMouseRollOverHandler);
this.removeEventListener(MouseEvent.ROLL_OUT, onMouseRollOutHandler);
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
onGroupRollOutHandler(null);
};
super.mouseEnabled = _arg1;
}
private function onGroupRollOutHandler(_arg1:EntityEvent):void{
if (!_entity.group.selected){
this.filters = [];
};
}
}
}//package pdiner2.game.entityViews
Section 237
//HintView (pdiner2.game.entityViews.HintView)
package pdiner2.game.entityViews {
import flash.display.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import flash.text.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.tweens.easing.*;
public class HintView extends AbstractEntityView {
private var _closeBtn:LabelButton;
private var _container:LayoutContainer;
private var _tween:ITween;
private var _clip:Sprite;
private var _entity:Hint;
public static const REMOVE_DELAY:int = 150;
public function HintView(_arg1:Entity){
this.mouseEnabled = false;
this.mouseChildren = false;
_entity = Hint(_arg1);
_entity.addEventListener(EntityEvent.UPDATE, onUpdateHandler);
_clip = new Sprite();
_container = new LayoutContainer();
var _local2:TextField = new TextField();
_local2.embedFonts = true;
_local2.defaultTextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_2"), 12, 0, null, null, null, null, null, TextFormatAlign.CENTER);
_local2.selectable = false;
_local2.multiline = true;
_local2.autoSize = TextFieldAutoSize.CENTER;
_local2.text = _entity.message;
_local2.x = 0;
_container.setSize(_local2.width, _local2.height);
_container.addChild(_local2);
_container.x = (-(_container.width) / 2);
_container.y = (-(_container.height) / 2);
var _local3:Graphics = _container.graphics;
_local3.lineStyle(2, 0);
_local3.beginFill(0xFFFFFF);
_local3.drawRoundRect(-6, -6, (_container.width + 12), (_container.height + 12), 16, 16);
_local3.endFill();
_clip.addChild(_container);
_clip.x = 320;
_clip.y = ((_container.height / 2) + 12);
_clip.scaleX = (_clip.scaleY = 0);
addChild(_clip);
_tween = new SequenceTween([new ScaleTween(_clip, 0, 1, 20, Easing.ELASTIC_OUT), new Delay(REMOVE_DELAY)]);
_tween.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
}
private function onUpdateHandler(_arg1:EntityEvent):void{
_tween.update();
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
remove();
}
public function remove():void{
_entity.remove();
}
override public function dispose():void{
_entity = null;
_tween.removeEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tween.dispose();
_tween = null;
_container.dispose();
_container = null;
}
}
}//package pdiner2.game.entityViews
Section 238
//MoneyPickupView (pdiner2.game.entityViews.MoneyPickupView)
package pdiner2.game.entityViews {
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.tweens.easing.*;
public class MoneyPickupView extends AbstractEntityView {
private var _container:LayoutContainer;
private var _entity:Effect;
private var _tween:ITween;
public function MoneyPickupView(_arg1:Effect){
_entity = _arg1;
_entity.addEventListener(EntityEvent.UPDATE, onEntityUpdateHandler);
this.mouseChildren = false;
this.x = _arg1.x;
this.y = _arg1.y;
_container = new LayoutContainer();
_container.setSize(50, 30);
var _local2:Label = new Label(("$" + String(_entity.data)));
_container.addChildToLayout(_local2, {horizontalCenter:0});
_container.x = -25;
addChild(_container);
_tween = new SequenceTween([new PropertyTween(_container, "y", 0, -60, 30, Easing.QUADRATIC_OUT), new PropertyTween(_container, "alpha", 1, 0, 5, Easing.LINEAR)]);
_tween.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
_entity.remove();
}
override public function dispose():void{
_entity = null;
_tween.dispose();
_tween = null;
_container.dispose();
_container = null;
}
private function onEntityUpdateHandler(_arg1:EntityEvent):void{
_tween.update();
}
}
}//package pdiner2.game.entityViews
Section 239
//PennyView (pdiner2.game.entityViews.PennyView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.application.*;
public class PennyView extends AbstractCharacterView {
private var _entity:Penny;
private var _pennyClip:MovieClip;
public function PennyView(_arg1:Entity){
_entity = Penny(_arg1);
_entity.addEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity.addEventListener(EntityEvent.MOVE, onMoveHandler);
_entity.addEventListener(EntityEvent.ANIMATION_CHANGE, onAnimationChangeHandler);
this.mouseChildren = false;
this.mouseEnabled = false;
var _local2:Class = ApplicationGlobals.application.getClassByName(("assets.Penny_uniform_" + _entity.uniform));
_pennyClip = new (_local2);
_pennyClip.addEventListener(Event.ADDED, onChildAddedHandler);
_pennyClip.gotoAndStop("idle_front_0");
addChild(_pennyClip);
this.x = _entity.x;
this.y = _entity.y;
}
private function onMoveHandler(_arg1:EntityEvent):void{
if (int(_entity.y) != int(this.y)){
dispatchEvent(new EntityViewEvent(EntityViewEvent.DEPTH_CHANGE, true));
};
this.x = _entity.x;
this.y = _entity.y;
}
private function onChildAddedHandler(_arg1:Event):void{
var _local2:MovieClip = (_arg1.target as MovieClip);
if (!_local2){
return;
};
var _local3:String = _local2.name;
switch (_local3){
case "foot_left":
case "foot_right":
_local2.gotoAndStop((_entity.skateUpgrade + 1));
break;
case "plate_left":
_local2.gotoAndStop(_entity.foodLeft);
break;
case "plate_right":
_local2.gotoAndStop(_entity.foodRight);
break;
};
childAdded(_local2);
}
private function onUpdateHandler(_arg1:EntityEvent):void{
updateAnimations();
}
private function onAnimationChangeHandler(_arg1:EntityEvent):void{
var _local3:String;
var _local2:String = _entity.direction;
switch (_local2){
case Direction.DOWN:
_local3 = "front_";
break;
case Direction.UP:
_local3 = "back_";
break;
case Direction.LEFT:
_local3 = "side_";
_pennyClip.scaleX = -1;
break;
case Direction.RIGHT:
_local3 = "side_";
_pennyClip.scaleX = 1;
break;
};
preEnterFrame();
var _local4:String = (((_entity.idle) ? "idle_" : "walk_" + _local3) + _entity.numPlates);
_pennyClip.gotoAndStop(_local4);
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.UPDATE, onUpdateHandler);
_entity.removeEventListener(EntityEvent.MOVE, onMoveHandler);
_entity.removeEventListener(EntityEvent.ANIMATION_CHANGE, onAnimationChangeHandler);
_entity = null;
_pennyClip.removeEventListener(Event.ADDED, onChildAddedHandler);
removeChild(_pennyClip);
_pennyClip = null;
super.dispose();
}
}
}//package pdiner2.game.entityViews
Section 240
//TableView (pdiner2.game.entityViews.TableView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
public class TableView extends AbstractEntityView {
private var _entity:Table;
private var _plateLeftClip:MovieClip;
private var _moneyClip:MovieClip;
private var _plateRightClip:MovieClip;
private var _tableClip:Sprite;
public function TableView(_arg1:Entity){
_entity = Table(_arg1);
_entity.addEventListener(EntityEvent.SHOW_MONEY, onShowMoneyHandler);
_entity.addEventListener(EntityEvent.PICKUP_MONEY, onPickupMoneyHandler);
_entity.addEventListener(EntityEvent.SHOW_FOOD, onShowFoodHandler);
var _local2:Boolean = _entity.hasFlowers;
this.x = _entity.x;
this.y = _entity.y;
this.mouseChildren = false;
this.addEventListener(MouseEvent.ROLL_OVER, onMouseRollOverHandler);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseRollOutHandler);
_tableClip = new TableClip();
_moneyClip = MovieClip(_tableClip.getChildByName("money_clip"));
_plateLeftClip = MovieClip(_tableClip.getChildByName("plate_left_clip"));
_plateRightClip = MovieClip(_tableClip.getChildByName("plate_right_clip"));
var _local3:MovieClip = MovieClip(_tableClip.getChildByName("seats"));
var _local4:MovieClip = MovieClip(_tableClip.getChildByName("table"));
var _local5:MovieClip = MovieClip(_tableClip.getChildByName("table_cloth"));
var _local6:Sprite = Sprite(_tableClip.getChildByName("flowers"));
_local5.gotoAndStop(Managers.progressManager.roomTheme);
_local5.visible = !((Managers.progressManager.tableClothDecoration == 0));
_local6.visible = _local2;
_moneyClip.stop();
_moneyClip.visible = false;
_plateLeftClip.stop();
_plateLeftClip.visible = false;
_plateRightClip.stop();
_plateRightClip.visible = false;
_local3.gotoAndStop((Managers.progressManager.seatUpgrade + 1));
_local4.gotoAndStop(((Managers.progressManager.tableUpgrade == 0)) ? 1 : 2);
addChild(_tableClip);
}
override public function dispose():void{
_entity.removeEventListener(EntityEvent.SHOW_MONEY, onShowMoneyHandler);
_entity.removeEventListener(EntityEvent.PICKUP_MONEY, onPickupMoneyHandler);
_entity.removeEventListener(EntityEvent.SHOW_FOOD, onShowFoodHandler);
_entity = null;
removeChild(_tableClip);
_tableClip = null;
}
private function onPickupMoneyHandler(_arg1:EntityEvent):void{
_moneyClip.visible = false;
_plateLeftClip.visible = false;
_plateRightClip.visible = false;
}
private function onShowMoneyHandler(_arg1:EntityEvent):void{
_moneyClip.gotoAndStop((_entity.moneyAmountIndex + 1));
_moneyClip.visible = true;
}
private function onShowFoodHandler(_arg1:EntityEvent):void{
var _local2:MovieClip = (Boolean(_arg1.data.leftSide)) ? _plateLeftClip : _plateRightClip;
_local2.gotoAndStop(String(_arg1.data.foodType));
_local2.visible = true;
}
private function onMouseRollOutHandler(_arg1:MouseEvent):void{
this.filters = [];
}
private function onMouseRollOverHandler(_arg1:MouseEvent):void{
this.filters = [_glowFilter];
}
}
}//package pdiner2.game.entityViews
Section 241
//TrashbinView (pdiner2.game.entityViews.TrashbinView)
package pdiner2.game.entityViews {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import assets.*;
public class TrashbinView extends AbstractEntityView {
private var _entity:Trashbin;
private var _clip:Sprite;
public function TrashbinView(_arg1:Entity){
_entity = Trashbin(_arg1);
this.x = 360;
this.y = 411;
this.mouseChildren = false;
_clip = new TrashbinClip();
addChild(_clip);
this.addEventListener(MouseEvent.ROLL_OVER, onMouseRollOverHandler);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseRollOutHandler);
}
private function onMouseRollOutHandler(_arg1:MouseEvent):void{
this.filters = [];
}
override public function dispose():void{
_entity = null;
removeChild(_clip);
_clip = null;
}
private function onMouseRollOverHandler(_arg1:MouseEvent):void{
this.filters = [_glowFilter];
}
}
}//package pdiner2.game.entityViews
Section 242
//EntityEvent (pdiner2.game.events.EntityEvent)
package pdiner2.game.events {
import com.bigwigmedia.mvc.events.*;
import flash.events.*;
public class EntityEvent extends BaseEntityEvent {
public var data:Object;// = null
public static const GUEST_REPARENT:String = "EntityEvent.guestReparent";
public static const SHOW_SPEECH_BUBBLE:String = "EntityEvent.showSpeechBubble";
public static const UPDATE:String = "EntityEvent.update";
public static const REMOVE:String = "EntityEvent.remove";
public static const HIDE_SPEECH_BUBBLE:String = "EntityEvent.hideSpeechBubble";
public static const MOVE:String = "EntityEvent.move";
public static const MOUSE_ROLL_OVER:String = "EntityEvent.mouseRollOver";
public static const PICKUP_MONEY:String = "EntityEvent.pickupMoney";
public static const SHOW_MONEY:String = "EntityEvent.showMoney";
public static const SHOW_FOOD:String = "EntityEvent.showFood";
public static const MOUSE_ROLL_OUT:String = "EntityEvent.mouseRollOut";
public static const MOUSE_ENABLED:String = "EntityEvent.mouseEnabled";
public static const ANIMATION_CHANGE:String = "EntityEvent.animationChange";
public static const MOUSE_DISABLED:String = "EntityEvent.mouseDisabled";
public static const MOOD_CHANGE:String = "EntityEvent.moodChange";
public static const REMOVE_NOW:String = "EntityEvent.removeNow";
public function EntityEvent(_arg1:String, _arg2:Boolean=false){
super(_arg1, _arg2);
}
override public function clone():Event{
var _local1:EntityEvent = new EntityEvent(type, bubbles);
_local1.data = data;
return (_local1);
}
}
}//package pdiner2.game.events
Section 243
//EntityViewEvent (pdiner2.game.events.EntityViewEvent)
package pdiner2.game.events {
import flash.events.*;
public class EntityViewEvent extends Event {
public static const DEPTH_CHANGE:String = "EntityViewEvent.depthChange";
public function EntityViewEvent(_arg1:String, _arg2:Boolean=false){
super(_arg1, _arg2);
}
override public function clone():Event{
return (new EntityViewEvent(type, bubbles));
}
}
}//package pdiner2.game.events
Section 244
//HintEvent (pdiner2.game.events.HintEvent)
package pdiner2.game.events {
import com.bigwigmedia.mvc.events.*;
import flash.events.*;
public class HintEvent extends BaseEntityEvent {
private var _hintType:String;
private var _data:Object;
public static const SHOW:String = "HintEvent.show";
public function HintEvent(_arg1:String, _arg2:String, _arg3:Object=null){
super(_arg1, true);
_hintType = _arg2;
_data = _arg3;
}
public function get hintType():String{
return (_hintType);
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new HintEvent(type, _hintType, _data));
}
}
}//package pdiner2.game.events
Section 245
//ModelEvent (pdiner2.game.events.ModelEvent)
package pdiner2.game.events {
import flash.events.*;
public class ModelEvent extends Event {
private var _data:Object;
public static const MONEY_UPDATE:String = "ModelEvent.moneyUpdate";
public static const TIME_UPDATE:String = "ModelEvent.timeUpdate";
public static const DAY_COMPLETE:String = "ModelEvent.dayComplete";
public static const PAUSE:String = "ModelEvent.pause";
public function ModelEvent(_arg1:String, _arg2:Object=null){
super(_arg1);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new ModelEvent(type, _data));
}
}
}//package pdiner2.game.events
Section 246
//ViewEvent (pdiner2.game.events.ViewEvent)
package pdiner2.game.events {
import flash.events.*;
public class ViewEvent extends Event {
private var _data:Object;
public static const QUIT_GAME:String = "ViewEvent.guitGame";
public static const PLAY_NEXT_DAY:String = "ViewEvent.playNextDay";
public static const REQUEST_PAUSE_GAME:String = "ViewEvent.requestPauseGame";
public static const RESTART_DAY:String = "ViewEvent.restartDay";
public static const PATH_TARGET_CLICK:String = "ViewEvent.pathTargetClick";
public static const WIN_GAME:String = "ViewEvent.winGame";
public static const UNPAUSE_GAME:String = "ViewEvent.unpauseGame";
public function ViewEvent(_arg1:String, _arg2:Object=null){
super(_arg1, true);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new ViewEvent(type, _data));
}
}
}//package pdiner2.game.events
Section 247
//ViewReparentEvent (pdiner2.game.events.ViewReparentEvent)
package pdiner2.game.events {
import flash.events.*;
import com.bigwigmedia.mvc.*;
public class ViewReparentEvent extends Event {
private var _guest:Entity;
private var _parentEntity:Entity;
public static const PARENT_CHANGE:String = "ViewReparentEvent.parentChange";
public function ViewReparentEvent(_arg1:String, _arg2:Entity, _arg3:Entity){
super(_arg1);
_parentEntity = _arg3;
_guest = _arg2;
}
public function get parentEntity():Entity{
return (_parentEntity);
}
override public function clone():Event{
return (new ViewReparentEvent(type, _guest, _parentEntity));
}
public function get guest():Entity{
return (_guest);
}
}
}//package pdiner2.game.events
Section 248
//FoodOrder (pdiner2.game.gameModelClasses.FoodOrder)
package pdiner2.game.gameModelClasses {
import com.bigwigmedia.core.*;
public class FoodOrder implements IUpdatable {
private var _foodType:String;
private var _cookingTime:int;
public function FoodOrder(_arg1:String, _arg2:int){
_foodType = _arg1;
_cookingTime = _arg2;
}
public function update():void{
if (_cookingTime > 0){
_cookingTime--;
};
}
public function get ready():Boolean{
return ((_cookingTime == 0));
}
public function get foodType():String{
return (_foodType);
}
}
}//package pdiner2.game.gameModelClasses
Section 249
//FoodOrderManager (pdiner2.game.gameModelClasses.FoodOrderManager)
package pdiner2.game.gameModelClasses {
import pdiner2.managers.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
public class FoodOrderManager extends Entity {
private var _foodOrders:Array;
private var _model:GameModel;
private var _numReadyCounterPlates:int;// = 0
public function FoodOrderManager(_arg1:GameModel){
_foodOrders = [];
super();
_model = _arg1;
}
override public function dispose():void{
_model = null;
_foodOrders = [];
super.dispose();
}
public function addOrder(_arg1:String):void{
_foodOrders.push(new FoodOrder(_arg1, Managers.progressManager.chefCookingTime));
}
override public function update():void{
var _local1:FoodOrder;
var _local2:int;
for each (_local1 in _foodOrders) {
_local1.update();
if (((_local1.ready) && ((_numReadyCounterPlates < GameModel.MAX_COUNTER_PLATES)))){
_local2 = _foodOrders.indexOf(_local1);
_foodOrders.splice(_local2, 1);
_numReadyCounterPlates++;
_model.addCounterPlate(_local1.foodType);
};
};
}
public function pickupCounterPlate():void{
_numReadyCounterPlates--;
}
public function get hasOrders():Boolean{
return ((_foodOrders.length > 0));
}
}
}//package pdiner2.game.gameModelClasses
Section 250
//GuestManager (pdiner2.game.gameModelClasses.GuestManager)
package pdiner2.game.gameModelClasses {
import pdiner2.managers.*;
import pdiner2.game.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.utils.*;
public class GuestManager extends Entity {
private var _femaleHats:Array;
private var _maleHats:Array;
private var _prevMaleClothes:String;// = null
private var _maleClothes:Array;
private var _guestAppearCounter:int;
private var _tempFoodTypes:Array;
private var _prevMaleHat:String;// = null
private var _femaleClothes:Array;
private var _prevFemaleClothes:String;// = null
private var _prevFoodType:String;// = null
private var _model:GameModel;
private var _foodTypes:Array;
private var _prevFemaleHat:String;// = null
public function GuestManager(_arg1:GameModel){
_foodTypes = [];
_tempFoodTypes = [];
super();
_model = _arg1;
_foodTypes = Managers.progressManager.foodTypes;
_guestAppearCounter = (_model.dayInfo.guestAppearDelay / 2);
_maleClothes = Managers.progressManager.maleClothes;
_maleHats = Managers.progressManager.maleHats;
_femaleClothes = Managers.progressManager.femaleClothes;
_femaleHats = Managers.progressManager.femaleHats;
}
public function getRandomFoodType():String{
if (_tempFoodTypes.length == 0){
_tempFoodTypes = ArrayUtil.shuffle(_foodTypes);
if (_tempFoodTypes[(_tempFoodTypes.length - 1)] == _prevFoodType){
_tempFoodTypes.unshift(_tempFoodTypes.pop());
};
};
_prevFoodType = _tempFoodTypes.pop();
return (_prevFoodType);
}
override public function update():void{
if (--_guestAppearCounter < 0){
_guestAppearCounter = _model.dayInfo.guestAppearDelay;
createGuestGroup();
};
}
public function getRandomGuestHat(_arg1:Boolean):String{
var _local2:String;
var _local3:int;
if (_arg1){
while (true) {
_local3 = (Math.random() * _maleHats.length);
if (_maleHats[_local3] != _prevMaleHat){
_local2 = (_prevMaleHat = _maleHats[_local3]);
break;
};
};
} else {
while (true) {
_local3 = (Math.random() * _femaleHats.length);
if (_femaleHats[_local3] != _prevFemaleHat){
_local2 = (_prevFemaleHat = _femaleHats[_local3]);
break;
};
};
};
return (_local2);
}
public function getRandomGuestClothes(_arg1:Boolean):String{
var _local2:String;
var _local3:int;
if (_arg1){
while (true) {
_local3 = (Math.random() * _maleClothes.length);
if (_maleClothes[_local3] != _prevMaleClothes){
_local2 = (_prevMaleClothes = _maleClothes[_local3]);
break;
};
};
} else {
while (true) {
_local3 = (Math.random() * _femaleClothes.length);
if (_femaleClothes[_local3] != _prevFemaleClothes){
_local2 = (_prevFemaleClothes = _femaleClothes[_local3]);
break;
};
};
};
return (_local2);
}
private function createGuestGroup():void{
var _local2:IGuestGroup;
var _local1:int = _model.newGroupNumInQueue;
if (_local1 == -1){
return;
};
if (_model.dayInfo.guestDoubleAppearChance > Math.random()){
_local2 = new DoubleGuestGroup(_model, this, _local1, (_model.dayInfo.guestCoupleAppearChance > Math.random()));
} else {
_local2 = new SingleGuestGroup(_model, this, _local1);
};
_model.addGuestGroup(_local2);
}
}
}//package pdiner2.game.gameModelClasses
Section 251
//DayResultPopup (pdiner2.game.gameViewClasses.DayResultPopup)
package pdiner2.game.gameViewClasses {
import com.bigwigmedia.stateMachine.*;
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import pdiner2.common.*;
import pdiner2.game.*;
import flash.text.*;
import com.bigwigmedia.events.*;
import pdiner2.game.catalog.*;
import assets.*;
import com.bigwigmedia.utils.*;
import pdiner2.map.*;
import com.bigwigmedia.tweens.*;
import pdiner2.constants.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.tweens.easing.*;
public class DayResultPopup extends LayoutContainer {
private var _starEarned:Boolean;// = false
private var _restartDayBtn:LabelButton;
private var _nextDayBtn:LabelButton;
private var _gameView:GameView;
private var _lastDayGoal:int;
private var _catalogBtn:LabelButton;
private var _successfulDay:Boolean;// = false
private var _popup:AbstractComponent;
private var _clip:Sprite;
private var _lastDayEarned:int;
private var _submitScoreBtn:LabelButton;
private var _mainMenuBtn:LabelButton;
private var _gameWin:Boolean;// = false
private var _stateMachine:IStateMachine;
private var _tween:ITween;
private var _continueBtn:LabelButton;
private var _bankValueLabel:Label;
public function DayResultPopup(_arg1:GameView){
setSize(640, 480);
graphics.beginFill(0xFFFFFF, 0);
graphics.drawRect(0, 0, 640, 480);
graphics.endFill();
_gameView = _arg1;
_clip = Sprite(addChild(new BlindsClip()));
_clip.cacheAsBitmap = true;
_clip.y = -480;
_tween = new PropertyTween(_clip, "y", -480, 0, 50, Easing.BOUNCE_OUT);
_tween.addEventListener(TweenEvent.COMPLETE, onTweenCompleteHandler);
_tween.playAuto();
addEventListener(PopupEvent.CLOSE, onPopupCloseHandler);
Managers.soundManager.play(SoundID.CURTAIN_DOWN_SFX);
}
private function isGameWin():Boolean{
return (_gameWin);
}
private function showDayPassedControls(_arg1:AbstractEvent):void{
showCommonControls();
_nextDayBtn = new LabelButton("Start Next Day");
_nextDayBtn.beacon = true;
addChildToLayout(_nextDayBtn, {bottom:70, horizontalCenter:-130});
}
private function showCommonControls():void{
_catalogBtn = new LabelButton("Catalog");
_catalogBtn.beacon = true;
addChildToLayout(_catalogBtn, {bottom:70, horizontalCenter:130});
_mainMenuBtn = new LabelButton("Main Menu");
addChildToLayout(_mainMenuBtn, {bottom:30, horizontalCenter:130});
_submitScoreBtn = new LabelButton("Submit Score");
addChildToLayout(_submitScoreBtn, {bottom:30, horizontalCenter:-130});
var _local1:Label = new Label("(Your progress will be saved)");
_local1.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_2"), 12, 0));
_local1.setStyle(AbstractComponentStyle.DECORATION, null);
addChildToLayout(_local1, {bottom:6, horizontalCenter:0});
}
override public function dispose():void{
_stateMachine.dispose();
_stateMachine = null;
_tween.dispose();
_tween = null;
super.dispose();
}
private function showGoal(_arg1:AbstractEvent):void{
var _local2:Label = new Label("Needed:");
addChildToLayout(_local2, {top:100, right:325});
var _local3:Label = new Label(("$" + NumberFormatter.formatThousands(_lastDayGoal)));
addChildToLayout(_local3, {top:100, left:325});
Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX);
}
private function showGameWinControls(_arg1:AbstractEvent):void{
_continueBtn = new LabelButton("Continue");
addChildToLayout(_continueBtn, {bottom:30, horizontalCenter:0});
}
private function showResults():void{
_stateMachine = new FSM();
var _local1:AbstractState = _stateMachine.addState(new InitialState());
var _local2:AbstractState = _stateMachine.addState(new SimpleState(showDayResult));
var _local3:AbstractState = _stateMachine.addState(new SimpleState(showGoal));
var _local4:AbstractState = _stateMachine.addState(new SimpleState(showEarned));
var _local5:AbstractState = _stateMachine.addState(new SimpleState(showBank));
var _local6:AbstractState = _stateMachine.addState(new SimpleState(showTotal));
var _local7:AbstractState = _stateMachine.addState(new SimpleState(showStar));
var _local8:AbstractState = _stateMachine.addState(new ChoiceState());
var _local9:AbstractState = _stateMachine.addState(new SimpleState(showDayPassedControls));
var _local10:AbstractState = _stateMachine.addState(new SimpleState(showDayFailedControls));
var _local11:AbstractState = _stateMachine.addState(new SimpleState(showGameWinControls));
_local1.addTransition(_local2, new EmptyTrigger());
_local2.addTransition(_local3, new TimeTrigger(500));
_local3.addTransition(_local4, new TimeTrigger(500));
_local4.addTransition(_local5, new TimeTrigger(500));
_local5.addTransition(_local6, new TimeTrigger(500));
_local6.addTransition(_local7, new TimeTrigger(500));
_local7.addTransition(_local8, new TimeTrigger(500));
_local8.addTransition(_local11, new EmptyTrigger(), null, isGameWin);
_local8.addTransition(_local9, new EmptyTrigger(), null, isDaySuccessful);
_local8.addTransition(_local10, new EmptyTrigger());
_stateMachine.start();
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function showTotal(_arg1:AbstractEvent):void{
var _local2:Label = new Label("Total:");
addChildToLayout(_local2, {top:220, right:325});
var _local3:Label = new Label(("$" + NumberFormatter.formatThousands(Managers.progressManager.score)));
addChildToLayout(_local3, {top:220, left:325});
Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _catalogBtn:
_popup = new CatalogPopup();
addChild(_popup);
break;
case _mainMenuBtn:
dispatchEvent(new ViewEvent(ViewEvent.QUIT_GAME));
break;
case _restartDayBtn:
dispatchEvent(new ViewEvent(ViewEvent.RESTART_DAY));
break;
case _nextDayBtn:
dispatchEvent(new ViewEvent(ViewEvent.PLAY_NEXT_DAY));
break;
case _submitScoreBtn:
Managers.urlCaller.submitScore(Managers.progressManager.score);
break;
case _continueBtn:
dispatchEvent(new ViewEvent(ViewEvent.WIN_GAME));
break;
};
}
private function isDaySuccessful():Boolean{
return (_successfulDay);
}
private function showDayFailedControls(_arg1:AbstractEvent):void{
showCommonControls();
_restartDayBtn = new LabelButton("Restart Day");
_restartDayBtn.beacon = true;
addChildToLayout(_restartDayBtn, {bottom:70, horizontalCenter:-130});
}
private function showEarned(_arg1:AbstractEvent):void{
var _local2:Label = new Label("Earned:");
addChildToLayout(_local2, {top:140, right:325});
var _local3:Label = new Label(("$" + NumberFormatter.formatThousands(_lastDayEarned)));
addChildToLayout(_local3, {top:140, left:325});
Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX);
}
private function showBank(_arg1:AbstractEvent):void{
var _local2:Label = new Label("Bank:");
addChildToLayout(_local2, {top:180, right:325});
_bankValueLabel = new Label(("$" + NumberFormatter.formatThousands(Managers.progressManager.bank)));
addChildToLayout(_bankValueLabel, {top:180, left:325});
Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX);
}
private function showDayResult(_arg1:AbstractEvent):void{
var _local2:Label = new Label((_successfulDay) ? "A SUCCESSFUL DAY" : "YOU DID NOT EARN ENOUGH FOR THE DAY");
_local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 40, (_successfulDay) ? 0x9900 : 0xFF0000));
addChildToLayout(_local2, {top:30, horizontalCenter:0});
}
private function onPopupCloseHandler(_arg1:PopupEvent):void{
if ((_popup is ComicPopup)){
showResults();
};
if (_bankValueLabel){
_bankValueLabel.text = ("$" + NumberFormatter.formatThousands(Managers.progressManager.bank));
};
removeChild(_popup);
_popup.dispose();
_popup = null;
}
private function onTweenCompleteHandler(_arg1:TweenEvent):void{
var _local2:ProgressManager = Managers.progressManager;
_lastDayEarned = _local2.earned;
_lastDayGoal = _local2.dayInfo.goal;
_successfulDay = (_lastDayEarned >= _lastDayGoal);
_starEarned = (Number(_lastDayEarned) >= (Number(_lastDayGoal) * 1.3));
if (_successfulDay){
_gameWin = _local2.updateNextDay();
};
if (_starEarned){
_local2.stars = (_local2.stars + 1);
};
if (((_starEarned) && (Managers.progressManager.willShowComicPopup(ComicPopup.FIRST_STAR)))){
_popup = new ComicPopup(ComicPopup.FIRST_STAR);
} else {
if ((((Managers.progressManager.bank >= Managers.configManager.getUpgradeMinPrice())) && (Managers.progressManager.willShowComicPopup(ComicPopup.USE_CATALOG_HINT)))){
_popup = new ComicPopup(ComicPopup.USE_CATALOG_HINT);
} else {
if ((((Managers.progressManager.bank >= Managers.configManager.getChefMinPrice())) && (Managers.progressManager.willShowComicPopup(ComicPopup.HIRE_CHEF_HINT)))){
_popup = new ComicPopup(ComicPopup.HIRE_CHEF_HINT);
};
};
};
if (_popup){
addChild(_popup);
} else {
showResults();
};
}
private function showStar(_arg1:AbstractEvent):void{
var _local2:Sprite;
if (_starEarned){
_local2 = new StarResult();
_local2.x = ((640 - _local2.width) / 2);
_local2.y = 280;
addChild(_local2);
Managers.soundManager.play(SoundID.UPGRADE_BUY_SFX);
};
}
}
}//package pdiner2.game.gameViewClasses
Section 252
//DepthSort (pdiner2.game.gameViewClasses.DepthSort)
package pdiner2.game.gameViewClasses {
import flash.display.*;
public class DepthSort {
private var _container:DisplayObjectContainer;
private var _array:Array;
public function DepthSort(_arg1:DisplayObjectContainer){
_array = [];
super();
_container = _arg1;
}
public function addObject(_arg1:DisplayObject):void{
var _local2:int = indexOfLastEqualY(_arg1.y);
if (_local2 > -1){
_local2++;
} else {
_local2 = (-(_local2) - 1);
};
_array.splice(_local2, 0, _arg1);
_container.setChildIndex(_arg1, _local2);
}
public function removeObject(_arg1:DisplayObject):void{
var _local2:int = _array.indexOf(_arg1);
_array.splice(_local2, 1);
}
public function updateObject(_arg1:DisplayObject):void{
var _local2:int = _array.indexOf(_arg1);
_array.splice(_local2, 1);
_local2 = indexOfLastEqualY(_arg1.y);
if (_local2 > -1){
_local2++;
} else {
_local2 = (-(_local2) - 1);
};
_array.splice(_local2, 0, _arg1);
_container.setChildIndex(_arg1, _local2);
}
private function indexOfLastEqualY(_arg1:Number):int{
var _local4:uint;
var _local6:int;
var _local2:uint;
var _local3:int = (_array.length - 1);
var _local5:Boolean;
while (_local2 <= _local3) {
_local4 = ((_local3 + _local2) / 2);
_local6 = _array[_local4].y;
if (_arg1 < _local6){
if (_local4 == _local2){
if (_local5){
return ((_local4 - 1));
};
return ((-1 - _local4));
};
_local3 = (_local4 - 1);
} else {
if (_arg1 > _local6){
if (_local4 == _local3){
return ((-1 - (_local4 + 1)));
};
_local2 = (_local4 + 1);
} else {
if (_local4 == _local3){
return (_local4);
};
_local5 = true;
_local2 = (_local4 + 1);
};
};
};
return (-1);
}
}
}//package pdiner2.game.gameViewClasses
Section 253
//HUD (pdiner2.game.gameViewClasses.HUD)
package pdiner2.game.gameViewClasses {
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import assets.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
public class HUD extends LayoutContainer {
private var _twoDPlayBtn:IconicButton;
private var _pauseBtn:LabelButton;
public function HUD(){
setSize(640, 480);
_pauseBtn = new LabelButton("Pause");
_pauseBtn.setStyle(LabelButtonStyle.UP_STATE_COLOR, 0xFFCC00);
_pauseBtn.setStyle(LabelButtonStyle.OVER_STATE_COLOR, 0xFFFFFF);
_pauseBtn.setStyle(LabelButtonStyle.DOWN_STATE_COLOR, 0xFFFFFF);
addChildToLayout(_pauseBtn, {bottom:10, right:10});
_twoDPlayBtn = new IconicButton(TwoDPlayButtonIcon);
_twoDPlayBtn.scale = 0.6;
addChildToLayout(_twoDPlayBtn, {top:6, right:6});
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _pauseBtn:
dispatchEvent(new ViewEvent(ViewEvent.REQUEST_PAUSE_GAME));
break;
case _twoDPlayBtn:
Managers.urlCaller.mainLink();
break;
};
}
}
}//package pdiner2.game.gameViewClasses
Section 254
//OpeningBlinds (pdiner2.game.gameViewClasses.OpeningBlinds)
package pdiner2.game.gameViewClasses {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import flash.text.*;
import assets.*;
import com.bigwigmedia.utils.*;
import com.bigwigmedia.tweens.*;
import pdiner2.constants.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.tweens.easing.*;
public class OpeningBlinds extends LayoutContainer {
private var _label_1:Label;
private var _label_2:Label;
private var _tween:ITween;
private var _clip:Sprite;
public static const EVENT_BLINDS_COMPLETE:String = "EVENT_BLINDS_COMPLETE";
public static const EVENT_BLINDS_OPEN:String = "EVENT_BLINDS_OPEN";
public function OpeningBlinds(){
setSize(640, 480);
graphics.beginFill(0xFFFFFF, 0);
graphics.drawRect(0, 0, 640, 480);
graphics.endFill();
_clip = Sprite(addChild(new BlindsClip()));
_clip.cacheAsBitmap = true;
_label_1 = new Label(((Managers.progressManager.stageName + ", Day ") + String((Managers.progressManager.day + 1))));
_label_1.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 46, 0xFFFFFF));
_label_2 = new Label(("You need to make $" + NumberFormatter.formatThousands(Managers.progressManager.dayInfo.goal)));
addChildToLayout(_label_1, {horizontalCenter:0, bottom:240});
addChildToLayout(_label_2, {horizontalCenter:0, top:240});
_tween = new SequenceTween([new Delay(30), new Action(this, open), new PropertyTween(_clip, "y", 0, -480, 50, Easing.CUBIC_IN), new Action(this, clearGraphics), new Delay(30), new ParallelTween([new PropertyTween(_label_1, "alpha", 1, 0, 20, Easing.LINEAR), new PropertyTween(_label_2, "alpha", 1, 0, 20, Easing.LINEAR)]), new Action(this, complete)]);
_tween.playAuto();
}
override public function dispose():void{
_tween.dispose();
_tween = null;
super.dispose();
}
private function open():void{
Managers.soundManager.play(SoundID.CURTAIN_UP_SFX);
dispatchEvent(new Event(EVENT_BLINDS_OPEN, true));
}
private function clearGraphics():void{
graphics.clear();
this.mouseChildren = false;
this.mouseEnabled = false;
}
private function complete():void{
dispatchEvent(new Event(EVENT_BLINDS_COMPLETE));
}
}
}//package pdiner2.game.gameViewClasses
Section 255
//PausePopup (pdiner2.game.gameViewClasses.PausePopup)
package pdiner2.game.gameViewClasses {
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import flash.text.*;
import assets.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
public class PausePopup extends LayoutContainer {
private var _resetHintBtn:LabelButton;
private var _switchSoundBtn:LabelButton;
private var _resumeBtn:LabelButton;
private var _vBox:VBox;
private var _endDayBtn:LabelButton;
public function PausePopup(){
setSize(640, 480);
addChild(new IcyBackground()).cacheAsBitmap = true;
var _local1:Label = new Label("Game Paused");
_local1.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 50, 0xFFFFFF));
addChildToLayout(_local1, {horizontalCenter:0, top:50});
_vBox = new VBox();
addChildToLayout(_vBox, {horizontalCenter:0, verticalCenter:0});
_resumeBtn = new LabelButton("Resume Game");
_resumeBtn.beacon = true;
_vBox.addChildToLayout(_resumeBtn, {horizontalCenter:0});
_endDayBtn = new LabelButton("End Day");
_vBox.addChildToLayout(_endDayBtn, {horizontalCenter:0});
var _local2:Label = new Label("(Your Progress Will Be Saved)");
_local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_2"), 14, 0));
_local2.setStyle(AbstractComponentStyle.DECORATION, null);
_vBox.addChildToLayout(_local2, {horizontalCenter:0});
_switchSoundBtn = new LabelButton(soundEnableString);
_vBox.addChildToLayout(_switchSoundBtn, {horizontalCenter:0});
_resetHintBtn = new LabelButton("Reset Hints");
_vBox.addChildToLayout(_resetHintBtn, {horizontalCenter:0});
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function get soundEnableString():String{
return ((Managers.configManager.soundEnabled) ? "Switch Sound Off" : "Switch Sound On");
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _resumeBtn:
dispatchEvent(new ViewEvent(ViewEvent.UNPAUSE_GAME));
break;
case _endDayBtn:
dispatchEvent(new ViewEvent(ViewEvent.QUIT_GAME));
break;
case _switchSoundBtn:
Managers.configManager.soundEnabled = !(Managers.configManager.soundEnabled);
_switchSoundBtn.label = soundEnableString;
break;
case _resetHintBtn:
Managers.progressManager.resetHints();
break;
};
}
}
}//package pdiner2.game.gameViewClasses
Section 256
//DayInfo (pdiner2.game.DayInfo)
package pdiner2.game {
public class DayInfo {
private var _guestCoupleAppearChance:Number;
private var _guestDoubleAppearChance:Number;
private var _guestAppearDelay:int;
private var _guestReadingMenuTime:int;
private var _guestAppearMood:int;
private var _maxGuestGroups:int;
private var _guestAppearWorseMoodChance:Number;
private var _guestChangeMoodTime:int;
private var _guestEatingTime:int;
private var _goal:int;
public function DayInfo(_arg1:XML){
_goal = _arg1.goal;
_guestAppearDelay = _arg1.guestAppearDelay;
_guestReadingMenuTime = _arg1.guestReadingMenuTime;
_guestChangeMoodTime = _arg1.guestChangeMoodTime;
_guestEatingTime = _arg1.guestEatingTime;
_maxGuestGroups = _arg1.maxGuestGroups;
_guestDoubleAppearChance = _arg1.guestDoubleAppearChance;
_guestCoupleAppearChance = _arg1.guestCoupleAppearChance;
_guestAppearMood = _arg1.guestAppearMood;
_guestAppearWorseMoodChance = _arg1.guestAppearWorseMoodChance;
}
public function get guestReadingMenuTime():int{
return (_guestReadingMenuTime);
}
public function get guestCoupleAppearChance():Number{
return (_guestCoupleAppearChance);
}
public function get maxGuestGroups():int{
return (_maxGuestGroups);
}
public function get guestAppearWorseMoodChance():Number{
return (_guestAppearWorseMoodChance);
}
public function get guestDoubleAppearChance():Number{
return (_guestDoubleAppearChance);
}
public function get goal():int{
return (_goal);
}
public function get guestAppearMood():int{
return (_guestAppearMood);
}
public function get guestChangeMoodTime():int{
return (_guestChangeMoodTime);
}
public function get guestEatingTime():int{
return (_guestEatingTime);
}
public function get guestAppearDelay():int{
return (_guestAppearDelay);
}
}
}//package pdiner2.game
Section 257
//GameController (pdiner2.game.GameController)
package pdiner2.game {
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import pdiner2.game.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import pdiner2.core.*;
import pdiner2.game.gameViewClasses.*;
public class GameController extends EventDispatcher implements IController {
private var _view:GameView;
private var _model:GameModel;
public function GameController(){
_view = new GameView();
_model = new GameModel();
_view.addEventListener(ViewEvent.PATH_TARGET_CLICK, onPathTargetClickHandler);
_view.addEventListener(ViewEvent.REQUEST_PAUSE_GAME, onRequestPauseGameHandler);
_view.addEventListener(ViewEvent.UNPAUSE_GAME, onUnpauseGameHandler);
_view.addEventListener(ViewEvent.QUIT_GAME, onQuitGameHandler);
_view.addEventListener(ViewEvent.RESTART_DAY, onRestartDayHandler);
_view.addEventListener(ViewEvent.PLAY_NEXT_DAY, onPlayNextDayHandler);
_view.addEventListener(ViewEvent.WIN_GAME, onWinGameHandler);
_view.addEventListener(OpeningBlinds.EVENT_BLINDS_OPEN, onBlindsOpenHandler);
_model.addEventListener(BaseEntityEvent.ADDED, onAddedEntityHandler);
_model.addEventListener(BaseEntityEvent.REMOVED, onRemovedEntityHandler);
_model.addEventListener(ModelEvent.TIME_UPDATE, onTimeUpdateHandler);
_model.addEventListener(ModelEvent.MONEY_UPDATE, onMoneyUpdateHandler);
_model.addEventListener(ModelEvent.DAY_COMPLETE, onDayCompleteHandler);
_model.addEventListener(ModelEvent.PAUSE, onPauseGameHandler);
_model.addEventListener(ViewReparentEvent.PARENT_CHANGE, onViewReparentHandler);
_model.initialize();
}
private function onMoneyUpdateHandler(_arg1:ModelEvent):void{
_view.showCurrentMoney(int(_arg1.data));
}
private function onPauseGameHandler(_arg1:ModelEvent):void{
_view.showPausePopup();
}
private function onWinGameHandler(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.WIN_GAME));
}
private function onBlindsOpenHandler(_arg1:Event):void{
_model.start();
}
public function get view():DisplayObject{
return (_view);
}
private function onRemovedEntityHandler(_arg1:BaseEntityEvent):void{
_view.removeEntityView(Entity(_arg1.target));
}
private function onViewReparentHandler(_arg1:ViewReparentEvent):void{
_view.reparentEntityView(Entity(_arg1.guest), Entity(_arg1.parentEntity));
}
private function onQuitGameHandler(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.QUIT));
}
private function onPlayNextDayHandler(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.NEXT_DAY));
}
private function onAddedEntityHandler(_arg1:BaseEntityEvent):void{
_view.addEntityView(Entity(_arg1.target));
}
private function onRequestPauseGameHandler(_arg1:ViewEvent):void{
_model.requestPause();
}
private function onTimeUpdateHandler(_arg1:ModelEvent):void{
_view.showTime(Number(_arg1.data));
}
private function onPathTargetClickHandler(_arg1:ViewEvent):void{
_model.pathTargetMouseDown(IPathTarget(_arg1.data));
}
private function onUnpauseGameHandler(_arg1:ViewEvent):void{
_view.removePausePopup();
_model.unpause();
}
private function onDayCompleteHandler(_arg1:ModelEvent):void{
_view.showDayResult();
}
private function onRestartDayHandler(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.RESTART));
}
public function dispose():void{
_model.dispose();
_model = null;
_view.dispose();
_view = null;
}
}
}//package pdiner2.game
Section 258
//GameModel (pdiner2.game.GameModel)
package pdiner2.game {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.sound.*;
import pdiner2.game.events.*;
import flash.geom.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import com.bigwigmedia.utils.messages.*;
import pdiner2.game.gameModelClasses.*;
import com.bigwigmedia.utils.aStar.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import pdiner2.constants.*;
import com.bigwigmedia.tweens.easing.*;
import Singularity.Geom.*;
public class GameModel extends EntityContainer {
private var _guestGroups:Array;
private var _guestManager:GuestManager;
private var _moneyEarned:int;// = 0
private var _chef:Chef;
private var _messageQueue:MessageQueue;
private var _penny:Penny;
private var _trashbin:Trashbin;
private var _updatablesList:Array;
private var _guestQueue:Array;
private var _dayInfo:DayInfo;
private var _enterFrameTicker:Shape;
private var _counterPlates:Array;
private var _tablesList:Array;
private var _timeCount:TimeCount;
private var _completed:Boolean;// = false
private var _paused:Boolean;// = false
private var _aStar:AStar;
private var _foodOrderManager:FoodOrderManager;
public static const MAX_GUESTS_IN_QUEUE:int = 3;
public static const MAX_FLOWERS_ON_TABLES:int = 2;
public static const MESSAGE_LEVEL_COMPLETE:String = "MESSAGE_LEVEL_COMPLETE";
public static const MESSAGE_REMOVE_ENTITY:String = "MESSAGE_REMOVE_ENTITY";
public static const MAP_TILE_SIZE:Number = 16;
public static const MESSAGE_REMOVE_GUEST_GROUP:String = "MESSAGE_REMOVE_GUEST_GROUP";
public static const MAX_COUNTER_PLATES:int = 5;
public static const MESSAGE_PAUSE:String = "MESSAGE_PAUSE";
public static const MESSAGE_HINT:String = "MESSAGE_HINT";
private static var _mapsCache:Object = {};
public function GameModel(){
_updatablesList = [];
_guestQueue = [];
_guestGroups = [];
_tablesList = [];
super();
}
public function addGuestGroup(_arg1:IGuestGroup):void{
var _local3:Guest;
var _local2:Array = _arg1.guests;
for each (_local3 in _local2) {
addChild(_local3);
};
_guestQueue.push(_arg1);
_guestGroups.push(_arg1);
_updatablesList.push(_arg1);
}
private function _removeGuestGroup(_arg1:IGuestGroup):void{
var _local4:Guest;
var _local2:int = _guestGroups.indexOf(_arg1);
_guestGroups.splice(_local2, 1);
_local2 = _updatablesList.indexOf(_arg1);
_updatablesList.splice(_local2, 1);
var _local3:Array = _arg1.guests;
for each (_local4 in _local3) {
removeChild(_local4);
};
_arg1.dispose();
}
public function initialize():void{
var _local10:XML;
var _local11:Boolean;
var _local12:int;
addEventListener(EntityEvent.GUEST_REPARENT, onGuestReparentHandler);
addEventListener(EntityEvent.REMOVE, onEntityRemoveHandler);
addEventListener(EntityEvent.REMOVE_NOW, onEntityRemoveNowHandler);
addEventListener(HintEvent.SHOW, onShowHintHandler);
_dayInfo = Managers.progressManager.dayInfo;
var _local1:int = Managers.progressManager.numTables;
_aStar = new AStar(getCachedMap(_local1), "0");
var _local2:XML = Managers.configManager.getMapXML(_local1);
var _local3:Array = [];
var _local4:int;
while (_local4 < _local1) {
_local3.push(_local4);
_local4++;
};
_local3 = ArrayUtil.shuffleTrim(_local3, MAX_FLOWERS_ON_TABLES);
var _local5:XMLList = _local2.table;
var _local6:int;
while (_local6 < _local1) {
_local10 = _local5[_local6];
_local11 = false;
_local12 = _local3.indexOf(_local6);
if (_local12 != -1){
_local3.splice(_local12, 1);
_local11 = true;
};
addChild(new Table(this, _local11, _local10.@tileX, _local10.@tileY));
_local6++;
};
addChild(new CounterPlace());
_counterPlates = [new CounterPlate(this, 10, 20), new CounterPlate(this, 13, 20), new CounterPlate(this, 16, 20), new CounterPlate(this, 19, 20), new CounterPlate(this, 22, 20)];
var _local7:int;
while (_local7 < MAX_COUNTER_PLATES) {
addChild(_counterPlates[_local7]);
_local7++;
};
_chef = new Chef();
addChild(_chef);
var _local8:XML = _local2.penny[0];
_penny = new Penny(this, _local8.@tileX, _local8.@tileY);
addChild(_penny);
_trashbin = new Trashbin();
addChild(_trashbin);
var _local9:int = Managers.progressManager.entertaimentUpgrade;
switch (_local9){
case 1:
Managers.soundManager.play(SoundID.ENT_RADIO3_SFX, int.MAX_VALUE);
break;
case 2:
Managers.soundManager.play(SoundID.ENT_TV3_SFX, int.MAX_VALUE);
break;
case 3:
Managers.soundManager.play(SoundID.ENT_JUGGLINGSEAL2_SFX, int.MAX_VALUE);
break;
};
Managers.soundManager.playSingle(SoundID.BG_WIND3_WAV, int.MAX_VALUE);
_messageQueue = new MessageQueue();
_messageQueue.registerMessage(MESSAGE_LEVEL_COMPLETE, 10, true, true);
_messageQueue.registerMessage(MESSAGE_REMOVE_ENTITY, 5);
_messageQueue.registerMessage(MESSAGE_REMOVE_GUEST_GROUP, 5);
_messageQueue.registerMessage(MESSAGE_HINT, 1, true, true);
_messageQueue.registerMessage(MESSAGE_PAUSE, 0, true, true);
_foodOrderManager = new FoodOrderManager(this);
addChild(_foodOrderManager);
_guestManager = new GuestManager(this);
addChild(_guestManager);
}
public function pickupCounterPlate(_arg1:CounterPlate):void{
var _local2:CounterPlate;
for each (_local2 in _counterPlates) {
if (_local2 == _arg1){
_local2.foodType = null;
_foodOrderManager.pickupCounterPlate();
return;
};
};
throw (new Error("Wrong plate picked up"));
}
override protected function childRemoved(_arg1:Entity):void{
if ((((((((((_arg1 is Penny)) || ((_arg1 is Chef)))) || ((_arg1 is Effect)))) || ((_arg1 is ClosedSign)))) || ((_arg1 is Hint)))){
_updatablesList.splice(_updatablesList.indexOf(_arg1), 1);
} else {
if ((_arg1 is Table)){
_tablesList.splice(_tablesList.indexOf(_arg1), 1);
};
};
}
override public function dispose():void{
_enterFrameTicker.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
_enterFrameTicker = null;
Managers.soundManager.stopChannel(ChannelID.ENVIRONMENT_SFX);
Managers.soundManager.stopChannel(ChannelID.CHEF_SFX);
_aStar.dispose();
_aStar = null;
_dayInfo = null;
_messageQueue.dispose();
_messageQueue = null;
_updatablesList = null;
_counterPlates = null;
_guestQueue = null;
_guestGroups = null;
_tablesList = null;
_chef = null;
_penny = null;
_trashbin = null;
_timeCount = null;
super.dispose();
}
private function onShowHintHandler(_arg1:HintEvent):void{
var _local2:String = _arg1.hintType;
if (Managers.progressManager.willShowHint(_local2)){
_messageQueue.append(MESSAGE_HINT, {hintType:_local2, data:_arg1.data});
};
}
private function onEntityRemoveHandler(_arg1:EntityEvent):void{
_messageQueue.append(MESSAGE_REMOVE_ENTITY, _arg1.target);
}
public function requestPause():void{
_messageQueue.append(MESSAGE_PAUSE);
}
public function advanceToNextPlace(_arg1:IGuestGroup):Boolean{
return (!((_arg1.numInQueue == _guestQueue.indexOf(_arg1))));
}
public function addCounterPlate(_arg1:String):void{
var _local3:CounterPlate;
var _local2:int;
while (_local2 < MAX_COUNTER_PLATES) {
_local3 = _counterPlates[_local2];
if (_local3.foodType == null){
_local3.foodType = _arg1;
Managers.soundManager.play(SoundID.FOOD_READY_SFX);
dispatchEvent(new HintEvent(HintEvent.SHOW, Hint.PICKUP_FOOD));
break;
};
_local2++;
};
if (!_foodOrderManager.hasOrders){
_chef.stop();
};
}
public function pickupMoney(_arg1:Table):void{
var _local2:int = _arg1.moneyLeft;
addChild(new Effect(Effect.MONEY_PICKUP, _arg1.x, (_arg1.y - 40), _local2));
_moneyEarned = (_moneyEarned + _local2);
dispatchEvent(new ModelEvent(ModelEvent.MONEY_UPDATE, _moneyEarned));
}
public function get newGroupNumInQueue():int{
var _local1:int = _guestQueue.length;
if ((((_local1 < MAX_GUESTS_IN_QUEUE)) && ((_guestGroups.length < _dayInfo.maxGuestGroups)))){
return ((_local1 + 1));
};
return (-1);
}
override protected function childAdded(_arg1:Entity):void{
if ((((((((((_arg1 is Penny)) || ((_arg1 is Chef)))) || ((_arg1 is Effect)))) || ((_arg1 is ClosedSign)))) || ((_arg1 is Hint)))){
_updatablesList.push(_arg1);
} else {
if ((_arg1 is Table)){
_tablesList.push(_arg1);
};
};
}
public function guestLeave(_arg1:IGuestGroup):void{
var _local2:int;
var _local3:int;
if (_arg1 == _guestQueue[0]){
_guestQueue.shift();
_local2 = _guestQueue.length;
_local3 = 0;
while (_local3 < _local2) {
_guestQueue[_local3].sendSignal(Guest.SIGNAL_CONTINUE);
_local3++;
};
};
}
public function checkPennyFoodAndAquireIfHas(_arg1:String):Boolean{
if (!_penny.hasFood(_arg1)){
return (false);
};
_penny.serveFood(_arg1);
return (true);
}
public function showCoupleBonusEffect(_arg1:Table):void{
addChild(new Effect(Effect.COUPLE_BONUS, _arg1.x, (_arg1.y - 40)));
}
public function orderFood(_arg1:String):void{
_foodOrderManager.addOrder(_arg1);
_chef.start();
}
public function removeGuestGroup(_arg1:IGuestGroup):void{
_messageQueue.append(MESSAGE_REMOVE_GUEST_GROUP, _arg1);
}
private function getCachedMap(_arg1:int):Array{
var numTables = _arg1;
if (_mapsCache[numTables]){
return (_mapsCache[numTables]);
};
var map:Array = [];
var mapXML:XML = Managers.configManager.getMapXML(numTables);
mapXML.row.(map.push(toString().split(""))); //not popped
_mapsCache[numTables] = map;
return (map);
}
public function getPathPoints(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Number):Array{
var _local14:AStarNode;
var _local15:Number;
var _local6:Array = _aStar.searchReduced(_arg1, _arg2, _arg3, _arg4, 3);
if (!_local6){
return (null);
};
var _local7:PSpline3 = new PSpline3();
var _local8:int = _local6.length;
var _local9:int;
while (_local9 < _local8) {
_local14 = _local6[_local9];
_local7.addControlPoint(((_local14.x + 0.5) * MAP_TILE_SIZE), ((_local14.y + 0.5) * MAP_TILE_SIZE));
_local9++;
};
var _local10:int = (_local7.chordLength / _arg5);
if (_local10 < 1){
_local10 = 1;
};
var _local11:Array = [];
var _local12:Function = Easing.getEasingFunc(Easing.SINE_IN_OUT);
var _local13:int;
while (_local13 <= _local10) {
_local15 = _local12((_local13 / _local10), 0, 1, 1);
_local11.push(new Point((_local7.getX(_local15) + GameView.ROOM_DISP_X), (_local7.getY(_local15) + GameView.ROOM_DISP_Y)));
_local13++;
};
return (_local11);
}
public function start():void{
var _local1:int = int(Managers.configManager.getCommonsXML("dayDuration"));
_timeCount = new TimeCount((_local1 * 1000));
_updatablesList.push(_timeCount);
_timeCount.addEventListener(Event.COMPLETE, onTimeCompleteHandler);
_enterFrameTicker = new Shape();
_enterFrameTicker.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
private function onTimeCompleteHandler(_arg1:Event):void{
Managers.soundManager.play(SoundID.CLOSE_SIGN_FALL_SFX);
addChild(new ClosedSign());
}
public function get dayInfo():DayInfo{
return (_dayInfo);
}
public function pathTargetMouseDown(_arg1:IPathTarget):void{
var _local3:IGuestGroup;
var _local4:int;
var _local5:int;
var _local2:Table = (_arg1 as Table);
if (((_local2) && ((_guestQueue.length > 0)))){
_local3 = _guestQueue[0];
if (((_local3.selected) && (!(_local2.occupied)))){
_local2.addGuestGroup(_local3);
_local3.sendSignal(Guest.SIGNAL_CONTINUE);
_local3.addPathTarget(_arg1);
_guestQueue.shift();
_local4 = _guestQueue.length;
_local5 = 0;
while (_local5 < _local4) {
_guestQueue[_local5].sendSignal(Guest.SIGNAL_CONTINUE);
_local5++;
};
return;
};
};
_penny.addPathTarget(_arg1);
}
private function onGuestReparentHandler(_arg1:EntityEvent):void{
dispatchEvent(new ViewReparentEvent(ViewReparentEvent.PARENT_CHANGE, Entity(_arg1.target), Entity(_arg1.data)));
}
private function onEnterFrameHandler(_arg1:Event):void{
var _local2:IUpdatable;
var _local3:Boolean;
var _local4:Table;
var _local5:Message;
var _local6:ISoundManager;
if (_paused){
return;
};
for each (_local2 in _updatablesList) {
_local2.update();
};
if (_completed){
return;
};
_foodOrderManager.update();
if (_timeCount.percent > 0){
_guestManager.update();
} else {
if (_guestGroups.length == 0){
_local3 = false;
for each (_local4 in _tablesList) {
if (_local4.occupied){
_local3 = true;
break;
};
};
if (_local3){
dispatchEvent(new HintEvent(HintEvent.SHOW, Hint.PICKUP_ALL_MONEY));
} else {
_messageQueue.append(MESSAGE_LEVEL_COMPLETE);
};
};
};
dispatchEvent(new ModelEvent(ModelEvent.TIME_UPDATE, _timeCount.percent));
_messageQueue.lock();
while (_messageQueue.hasNext()) {
_local5 = _messageQueue.getNext();
switch (_local5.type){
case MESSAGE_REMOVE_GUEST_GROUP:
_removeGuestGroup(IGuestGroup(_local5.data));
break;
case MESSAGE_REMOVE_ENTITY:
removeChild(Entity(_local5.data));
break;
case MESSAGE_PAUSE:
_paused = true;
_local6 = Managers.soundManager;
_local6.setChannelVolume(ChannelID.CHEF_SFX, 0);
_local6.setChannelVolume(ChannelID.ENVIRONMENT_SFX, 0);
dispatchEvent(new ModelEvent(ModelEvent.PAUSE));
break;
case MESSAGE_LEVEL_COMPLETE:
_completed = true;
Managers.soundManager.stopChannel(ChannelID.ENVIRONMENT_SFX);
Managers.progressManager.earned = _moneyEarned;
dispatchEvent(new ModelEvent(ModelEvent.DAY_COMPLETE));
break;
case MESSAGE_HINT:
addChild(new Hint(_local5.data.hintType, _local5.data.data));
break;
};
};
_messageQueue.unlock();
}
private function onEntityRemoveNowHandler(_arg1:EntityEvent):void{
removeChild(Entity(_arg1.target));
}
public function unpause():void{
_timeCount.unpause();
_paused = false;
var _local1:ISoundManager = Managers.soundManager;
_local1.setChannelVolume(ChannelID.CHEF_SFX, 1);
_local1.setChannelVolume(ChannelID.ENVIRONMENT_SFX, 1);
}
}
}//package pdiner2.game
Section 259
//GameView (pdiner2.game.GameView)
package pdiner2.game {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.game.events.*;
import flash.geom.*;
import flash.text.*;
import com.bigwigmedia.mvc.*;
import pdiner2.game.entities.*;
import pdiner2.game.entityViews.*;
import flash.utils.*;
import assets.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import pdiner2.constants.*;
import pdiner2.game.gameViewClasses.*;
public class GameView extends Sprite implements IDisposable {
private var _depthSort:DepthSort;
private var _effects:Sprite;
private var _clockHandsClip:MovieClip;
private var _currentMoneyTextField:TextField;
private var _hints:Sprite;
private var _controller:GameController;
private var _background:Sprite;
private var _viewToIPathTargetDict:Dictionary;
private var _goalMoneyTextField:TextField;
private var _popup:AbstractComponent;
private var _atmosphericClip:MovieClip;
private var _entityToViewDict:Dictionary;
private var _room:Sprite;
private var _prevFrame:int;// = -1
private var _counter:Sprite;
private var _openingBlinds:OpeningBlinds;
private var _hud:HUD;
public static const ROOM_DISP_Y:Number = 96;
public static const COUNTER_SPRITE:String = "COUNTER_SPRITE";
public static const ROOM_SPRITE:String = "ROOM_SPRITE";
public static const EFFECTS_SPRITE:String = "EFFECTS_SPRITE";
public static const ROOM_DISP_X:Number = -64;
public function GameView(){
_entityToViewDict = new Dictionary();
_viewToIPathTargetDict = new Dictionary();
super();
_background = new RoomBackground();
var _local1:String = Managers.progressManager.roomTheme;
var _local2:MovieClip = MovieClip(_background.getChildByName("animated_background"));
_local2.gotoAndStop(_local1);
var _local3:MovieClip = MovieClip(_background.getChildByName("carpet"));
if (Managers.progressManager.carpetDecoration == 0){
_local3.gotoAndStop(_local1);
} else {
_local3.gotoAndStop((_local1 + "_upgraded"));
};
var _local4:MovieClip = MovieClip(_background.getChildByName("pictures"));
_local4.gotoAndStop(_local1);
_local4.visible = !((Managers.progressManager.pictureDecoration == 0));
var _local5:MovieClip = MovieClip(_background.getChildByName("curtains"));
_local5.gotoAndStop(_local1);
_local5.visible = !((Managers.progressManager.curtainsDecoration == 0));
var _local6:MovieClip = MovieClip(_background.getChildByName("lights"));
_local6.gotoAndStop(_local1);
_local6.visible = !((Managers.progressManager.lightsDecoration == 0));
var _local7:MovieClip = MovieClip(_background.getChildByName("entertainment"));
_local7.gotoAndStop((Managers.progressManager.entertaimentUpgrade + 1));
var _local8:MovieClip = MovieClip(_background.getChildByName("clocks"));
if ((((_local1 == RoomThemes.STANDARD)) && (!((Managers.progressManager.clocksDecoration == 0))))){
_local8.gotoAndStop("standard_upgraded");
} else {
_local8.gotoAndStop(_local1);
};
_clockHandsClip = MovieClip(_local8.getChildByName("hands"));
_clockHandsClip.stop();
_atmosphericClip = MovieClip(_background.getChildByName("atmospheric"));
_atmosphericClip.stop();
addChild(_background);
_room = new Sprite();
addChild(_room);
var _local9:CounterClip = new CounterClip();
_counter = new Sprite();
_counter.addChild(_local9);
addChild(_counter);
var _local10:MovieClip = MovieClip(_local9.getChildByName("decoration"));
_local10.gotoAndStop(_local1);
_currentMoneyTextField = TextField(_local9.getChildByName("current_text_field"));
_goalMoneyTextField = TextField(_local9.getChildByName("goal_text_field"));
_goalMoneyTextField.text = String(Managers.progressManager.dayInfo.goal);
_effects = new Sprite();
addChild(_effects);
_hud = new HUD();
addChild(_hud);
_hints = new Sprite();
addChild(_hints);
_openingBlinds = new OpeningBlinds();
_openingBlinds.addEventListener(OpeningBlinds.EVENT_BLINDS_COMPLETE, onBlindsCompleteHandler);
addChild(_openingBlinds);
_depthSort = new DepthSort(_room);
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
}
public function removePausePopup():void{
removeChild(_popup);
_popup.dispose();
_popup = null;
}
public function showPausePopup():void{
_popup = new PausePopup();
addChild(_popup);
}
public function removeEntityView(_arg1:Entity):void{
var _local2:AbstractEntityView = _entityToViewDict[_arg1];
if (!_local2){
return;
};
_local2.removeEventListener(EntityViewEvent.DEPTH_CHANGE, onDepthChangeHandler);
if (_local2.parent == _room){
_depthSort.removeObject(_local2);
};
delete _entityToViewDict[_arg1];
delete _viewToIPathTargetDict[_local2];
_local2.parent.removeChild(_local2);
_local2.dispose();
}
private function onBlindsCompleteHandler(_arg1:Event):void{
_openingBlinds.removeEventListener(OpeningBlinds.EVENT_BLINDS_COMPLETE, onBlindsCompleteHandler);
removeChild(_openingBlinds);
_openingBlinds.dispose();
_openingBlinds = null;
}
public function dispose():void{
if (_popup){
removeChild(_popup);
_popup.dispose();
_popup = null;
};
if (_openingBlinds){
removeChild(_openingBlinds);
_openingBlinds.dispose();
_openingBlinds = null;
};
_hud.dispose();
_hud = null;
}
private function onMouseDownHandler(_arg1:MouseEvent):void{
var _local2:IPathTarget = (_viewToIPathTargetDict[_arg1.target] as IPathTarget);
if (_local2){
Managers.soundManager.play(SoundID.CLICK_GAME_OBJECT_SFX);
dispatchEvent(new ViewEvent(ViewEvent.PATH_TARGET_CLICK, _local2));
};
}
public function showDayResult():void{
_popup = new DayResultPopup(this);
addChild(_popup);
}
public function showCurrentMoney(_arg1:int):void{
_currentMoneyTextField.text = String(_arg1);
}
public function reparentEntityView(_arg1:Entity, _arg2:Entity):void{
var _local3:DisplayObjectContainer = (_arg2) ? _entityToViewDict[_arg2] : _room;
var _local4:DisplayObject = _entityToViewDict[_arg1];
var _local5:Point = new Point(_local4.x, _local4.y);
_local5 = _local4.parent.localToGlobal(_local5);
_local5 = _local3.globalToLocal(_local5);
_local4.x = _local5.x;
_local4.y = _local5.y;
if (_local3 != _room){
_local3.addChild(_local4);
_depthSort.removeObject(_local4);
} else {
_room.addChild(_local4);
_depthSort.addObject(_local4);
};
}
private function removeHints():void{
var _local1:HintView;
while (_hints.numChildren != 0) {
_local1 = (_hints.getChildAt(0) as HintView);
_local1.remove();
};
}
public function showTime(_arg1:Number):void{
var _local2:int = (1000 * (1 - _arg1));
if (_prevFrame != _local2){
_clockHandsClip.gotoAndStop(_local2);
_atmosphericClip.gotoAndStop(_local2);
_prevFrame = _local2;
};
}
public function addEntityView(_arg1:Entity):void{
var _local2:AbstractEntityView;
var _local3:DisplayObjectContainer;
var _local5:Effect;
var _local4:String = NameUtil.getClassName(_arg1);
switch (_local4){
case "CounterPlace":
_local2 = new CounterPlaceView(_arg1);
_local3 = _counter;
break;
case "Chef":
_local2 = new ChefView(_arg1);
_local3 = _counter;
break;
case "ClosedSign":
_local2 = new ClosedSignView(_arg1);
_local3 = _room;
break;
case "CounterPlate":
_local2 = new CounterPlateView(_arg1);
_local3 = _counter;
break;
case "Effect":
_local5 = Effect(_arg1);
if (_local5.effectType == Effect.COUPLE_BONUS){
_local2 = new CoupleBonusView(_local5);
} else {
if (_local5.effectType == Effect.MONEY_PICKUP){
_local2 = new MoneyPickupView(_local5);
};
};
_local3 = _effects;
break;
case "Guest":
_local2 = new GuestView(_arg1);
_local2.addEventListener(EntityViewEvent.DEPTH_CHANGE, onDepthChangeHandler);
_local3 = _room;
break;
case "Penny":
_local2 = new PennyView(_arg1);
_local2.addEventListener(EntityViewEvent.DEPTH_CHANGE, onDepthChangeHandler);
_local3 = _room;
break;
case "Table":
_local2 = new TableView(_arg1);
_local3 = _room;
break;
case "Trashbin":
_local2 = new TrashbinView(_arg1);
_local3 = _counter;
break;
case "Hint":
removeHints();
_local2 = new HintView(_arg1);
_local3 = _hints;
break;
default:
return;
};
_entityToViewDict[_arg1] = _local2;
if ((_arg1 is IPathTarget)){
_viewToIPathTargetDict[_local2] = _arg1;
};
_local3.addChild(_local2);
if (_local3 == _room){
_depthSort.addObject(_local2);
};
}
private function onDepthChangeHandler(_arg1:EntityViewEvent):void{
var _local2:DisplayObject = DisplayObject(_arg1.target);
_depthSort.updateObject(_local2);
}
}
}//package pdiner2.game
Section 260
//GameWinController (pdiner2.gameWin.GameWinController)
package pdiner2.gameWin {
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.core.*;
public class GameWinController extends EventDispatcher implements IController {
private var _view:GameWinView;
public function GameWinController(){
_view = new GameWinView();
_view.addEventListener(Event.COMPLETE, onViewCompleteHandler);
}
public function get view():DisplayObject{
return (_view);
}
private function onViewCompleteHandler(_arg1:Event):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.SHOW_MAIN_MENU));
}
public function dispose():void{
_view.removeEventListener(Event.COMPLETE, onViewCompleteHandler);
_view.dispose();
}
}
}//package pdiner2.gameWin
Section 261
//GameWinView (pdiner2.gameWin.GameWinView)
package pdiner2.gameWin {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.common.*;
import flash.text.*;
import assets.*;
import com.bigwigmedia.core.*;
import com.bigwigmedia.utils.*;
import pdiner2.map.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
public class GameWinView extends Sprite implements IDisposable {
private var _submitScoreBtn:LabelButton;
private var _container:LayoutContainer;
private var _mainMenuBtn:LabelButton;
private var _comicPopup:ComicPopup;
private var _viewScoresBtn:LabelButton;
private var _finalScore:int;
private var _2dplayBtn:IconicButton;
public function GameWinView(){
_comicPopup = new ComicPopup(ComicPopup.GAME_WIN);
addChild(_comicPopup);
_container = new LayoutContainer();
_container.setSize(640, 480);
addChild(_container);
_finalScore = Managers.progressManager.score;
Managers.progressManager.restartGame();
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
addEventListener(PopupEvent.CONTINUE, onPopupContinueHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _submitScoreBtn:
Managers.urlCaller.submitScore(_finalScore);
break;
case _viewScoresBtn:
Managers.urlCaller.viewScores();
break;
case _mainMenuBtn:
dispatchEvent(new Event(Event.COMPLETE));
break;
case _2dplayBtn:
Managers.urlCaller.mainLink();
break;
};
}
private function onPopupContinueHandler(_arg1:PopupEvent):void{
_2dplayBtn = new IconicButton(TwoDPlayButtonIcon);
_container.addChildToLayout(_2dplayBtn, {bottom:10, right:10});
var _local2:Label = new Label(("Final Score: $" + NumberFormatter.formatThousands(_finalScore)));
_local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 45, 0xFFFFFF));
_container.addChildToLayout(_local2, {top:10, left:10});
_submitScoreBtn = new LabelButton("Submit Score");
_submitScoreBtn.beacon = true;
_container.addChildToLayout(_submitScoreBtn, {top:60, left:10});
_viewScoresBtn = new LabelButton("View Scores");
_container.addChildToLayout(_viewScoresBtn, {top:100, left:10});
_mainMenuBtn = new LabelButton("Main Menu");
_container.addChildToLayout(_mainMenuBtn, {top:140, left:10});
}
public function dispose():void{
_container.dispose();
_container = null;
}
}
}//package pdiner2.gameWin
Section 262
//InstructionsController (pdiner2.instructions.InstructionsController)
package pdiner2.instructions {
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.core.*;
public class InstructionsController extends EventDispatcher implements IController {
private var _view:InstructionsView;
public function InstructionsController(){
_view = new InstructionsView(this);
}
public function get view():DisplayObject{
return (_view);
}
public function gotoMainMenu():void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.SHOW_MAIN_MENU));
}
public function dispose():void{
_view.dispose();
_view = null;
}
}
}//package pdiner2.instructions
Section 263
//InstructionsView (pdiner2.instructions.InstructionsView)
package pdiner2.instructions {
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.ui.*;
import assets.*;
import com.bigwigmedia.ui.containers.*;
public class InstructionsView extends LayoutContainer {
private var _controller:InstructionsController;
private var _mainMenuBtn:LabelButton;
private var _prevBtn:LabelButton;
private var _clip:MovieClip;
private var _nextBtn:LabelButton;
public function InstructionsView(_arg1:InstructionsController){
_controller = _arg1;
_clip = new InstructionsClip();
_clip.stop();
addChild(_clip);
_nextBtn = new LabelButton("Next page");
this.addChildToLayout(_nextBtn, {bottom:10, right:10});
_prevBtn = new LabelButton("Previous page");
this.addChildToLayout(_prevBtn, {bottom:10, left:10});
_mainMenuBtn = new LabelButton("Main Menu");
_mainMenuBtn.beacon = true;
this.addChildToLayout(_mainMenuBtn, {bottom:10, horizontalCenter:10});
updateControls();
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _nextBtn:
_clip.nextFrame();
updateControls();
break;
case _prevBtn:
_clip.prevFrame();
updateControls();
break;
case _mainMenuBtn:
_controller.gotoMainMenu();
break;
};
}
private function updateControls():void{
_prevBtn.visible = !((_clip.currentFrame == 1));
_nextBtn.visible = !((_clip.currentFrame == _clip.totalFrames));
}
}
}//package pdiner2.instructions
Section 264
//ContinueGamePopup (pdiner2.mainMenu.ContinueGamePopup)
package pdiner2.mainMenu {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.common.*;
import flash.text.*;
import com.bigwigmedia.ui.containers.*;
public class ContinueGamePopup extends LayoutContainer {
private var _container:LayoutContainer;
private var _yesBtn:LabelButton;
private var _noBtn:LabelButton;
public function ContinueGamePopup(){
setSize(640, 480);
graphics.beginFill(0xFFFFFF, 0);
graphics.drawRect(0, 0, 640, 480);
graphics.endFill();
_container = new LayoutContainer();
var _local1:TextField = new TextField();
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_2"), 16, 0, null, null, null, null, null, TextFormatAlign.CENTER);
_local1.selectable = false;
_local1.multiline = true;
_local1.autoSize = TextFieldAutoSize.CENTER;
_local1.text = "Do you want to resume\nyour previous game?";
_local1.x = 0;
_container.setSize(_local1.textWidth, (_local1.textHeight + 60));
_container.addChild(_local1);
_yesBtn = new LabelButton("YES");
_yesBtn.beacon = true;
_container.addChildToLayout(_yesBtn, {bottom:6, left:40});
_noBtn = new LabelButton("NO");
_container.addChildToLayout(_noBtn, {bottom:6, right:40});
var _local2:Graphics = _container.graphics;
_local2.lineStyle(2, 0);
_local2.beginFill(0xFFFFFF);
_local2.drawRoundRect(-6, -6, (_container.width + 12), (_container.height + 12), 16, 16);
_local2.endFill();
this.addChildToLayout(_container, {horizontalCenter:0, verticalCenter:0});
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _yesBtn:
dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true, "yes"));
break;
case _noBtn:
dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true, "no"));
break;
};
}
}
}//package pdiner2.mainMenu
Section 265
//MainMenuController (pdiner2.mainMenu.MainMenuController)
package pdiner2.mainMenu {
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import pdiner2.common.*;
import com.bigwigmedia.mvc.*;
import pdiner2.core.*;
public class MainMenuController extends EventDispatcher implements IController {
private var _view:MainMenuView;
public function MainMenuController(){
_view = new MainMenuView(this);
_view.addEventListener(PopupEvent.CLOSE, onPopupEventHandler);
}
public function get view():DisplayObject{
return (_view);
}
public function playGame():void{
if ((((Managers.progressManager.stage > 0)) || ((Managers.progressManager.day > 0)))){
_view.showContinueGamePopup();
} else {
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.START));
};
}
public function viewInstructions():void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.SHOW_INSTRUCTIONS));
}
private function onPopupEventHandler(_arg1:PopupEvent):void{
if (_arg1.data == "no"){
Managers.progressManager.restartGame();
};
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.START));
}
public function dispose():void{
_view.dispose();
}
}
}//package pdiner2.mainMenu
Section 266
//MainMenuView (pdiner2.mainMenu.MainMenuView)
package pdiner2.mainMenu {
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import flash.text.*;
import assets.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.ui.containers.*;
public class MainMenuView extends LayoutContainer {
private var _playBtn:LabelButton;
private var _popup:AbstractComponent;
private var _twoDPlayBtn:IconicButton;
private var _viewScoresBtn:LabelButton;
private var _instructionsBtn:LabelButton;
private var _controller:MainMenuController;
public function MainMenuView(_arg1:MainMenuController){
setSize(640, 480);
addChild(new MainMenuBack()).cacheAsBitmap = true;
_controller = _arg1;
_playBtn = new LabelButton("Play Game");
_playBtn.beacon = true;
addChildToLayout(_playBtn, {right:10, bottom:90});
_viewScoresBtn = new LabelButton("View Scores");
addChildToLayout(_viewScoresBtn, {right:10, bottom:50});
_instructionsBtn = new LabelButton("Instructions");
addChildToLayout(_instructionsBtn, {right:10, bottom:10});
_twoDPlayBtn = new IconicButton(TwoDPlayButtonIcon);
addChildToLayout(_twoDPlayBtn, {left:10, bottom:10});
var _local2:Label = new Label("©2DPlay.com");
_local2.setStyle(AbstractComponentStyle.EMBED_FONTS, false);
_local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat("_sans", 12, 0xFFFFFF));
addChildToLayout(_local2, {top:6, right:10});
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _playBtn:
_controller.playGame();
break;
case _viewScoresBtn:
Managers.urlCaller.viewScores();
break;
case _instructionsBtn:
_controller.viewInstructions();
break;
case _twoDPlayBtn:
Managers.urlCaller.mainLink();
break;
};
}
public function showContinueGamePopup():void{
_popup = new ContinueGamePopup();
addChild(_popup);
}
override public function dispose():void{
_controller = null;
super.dispose();
}
}
}//package pdiner2.mainMenu
Section 267
//ConfigManager (pdiner2.managers.ConfigManager)
package pdiner2.managers {
import flash.events.*;
import pdiner2.constants.*;
public class ConfigManager extends EventDispatcher {
private var _minUpgradePrice:int;// = -1
private var configXMLClass:Class;
private var catalogNoMochiConfigXMLClass:Class;
private var levelsConfigXML:XML;
private var _soundEnabled:Boolean;// = true
private var levelsConfigXMLClass:Class;
private var catalogConfigXML:XML;
private var _initialized:Boolean;// = false
private var _minChefMinPrice:int;// = -1
private var configXML:XML;
private var catalogConfigXMLClass:Class;
public function ConfigManager(){
configXMLClass = ConfigManager_configXMLClass;
levelsConfigXMLClass = ConfigManager_levelsConfigXMLClass;
catalogConfigXMLClass = ConfigManager_catalogConfigXMLClass;
catalogNoMochiConfigXMLClass = ConfigManager_catalogNoMochiConfigXMLClass;
super();
}
public function getCommonsXML(_arg1:String):XML{
return (configXML.common.child(_arg1)[0]);
}
public function getCatalogInfo():String{
return (catalogConfigXML.info.toString());
}
public function getRoomThemeXML(_arg1:String):XML{
var xml:XMLList;
var themeName = _arg1;
xml = configXML.themes.theme.(@name == themeName);
return (xml[0]);
}
public function initialize():void{
if (_initialized){
throw (new Error("ConfigManager initialized already"));
};
_initialized = true;
if (!false){
setXML(new configXMLClass(), new levelsConfigXMLClass(), new catalogNoMochiConfigXMLClass());
};
if (Managers.soManager.getValue(SOValues.SOUND_ENABLED) === false){
soundEnabled = false;
};
}
private function setXML(_arg1:Object, _arg2:Object, _arg3:Object):void{
configXML = XML(_arg1);
catalogConfigXML = XML(_arg3);
levelsConfigXML = parseLevelsConfig(XML(_arg2));
dispatchEvent(new Event(Event.INIT));
}
public function set soundEnabled(_arg1:Boolean):void{
_soundEnabled = _arg1;
Managers.soundManager.masterVolume = (_soundEnabled) ? 1 : 0;
Managers.soManager.setValue(SOValues.SOUND_ENABLED, _soundEnabled);
}
public function getMapXML(_arg1:int):XML{
var xml:XMLList;
var numTables = _arg1;
xml = configXML.maps.map.(@numTables == numTables);
return (xml[0]);
}
public function getUpgradeMinPrice():int{
var _local3:XML;
var _local4:int;
if (_minUpgradePrice != -1){
return (_minUpgradePrice);
};
var _local1:XMLList = configXML.upgrades.*.*;
var _local2:int = int.MAX_VALUE;
for each (_local3 in _local1) {
if (_local3.@level > 0){
_local4 = _local3.@price;
if (_local4 < _local2){
_local2 = _local4;
};
};
};
_minUpgradePrice = _local2;
return (_minUpgradePrice);
}
public function getDayXML(_arg1:int, _arg2:int):XML{
var _local3:XML = levelsConfigXML.stage[_arg1].day[_arg2];
return (_local3);
}
public function getNumStages():int{
return (levelsConfigXML.stage.length());
}
public function getUpgradeXML(_arg1:String, _arg2:int):XML{
var xml:XMLList;
var upgrade = _arg1;
var level = _arg2;
xml = configXML.upgrades.child(upgrade).children().(@level == level);
return (xml[0]);
}
private function parseLevelsConfig(_arg1:XML):XML{
var _local8:XML;
var _local9:XML;
var _local10:XML;
var _local11:XMLList;
var _local12:int;
var _local13:XML;
var _local14:String;
var _local2:Namespace = _arg1.namespace("ss");
var _local3:XML = _arg1._local2::Worksheet._local2::Table[0];
var _local4:XMLList = _local3._local2::Row;
var _local5:int;
var _local6:int;
var _local7:XML = <stages/>
;
for each (_local9 in _local4) {
if (_local5 >= 2){
if ((_local6 % 10) == 0){
_local8 = <stage/>
;
_local7.appendChild(_local8);
};
_local10 = <day/>
;
_local11 = _local9._local2::Cell;
_local12 = 0;
for each (_local13 in _local11) {
if (_local13.hasOwnProperty(new QName(_local2, "@Index"))){
_local12 = int(_local13.@_local2::Index);
} else {
_local12++;
};
_local14 = _local13._local2::Data.toString();
switch (_local12){
case 3:
_local10.appendChild(new XML((("<goal>" + ??esc_xelem
) + "</goal>")));
break;
case 4:
_local10.appendChild(new XML((("<maxGuestGroups>" + ??esc_xelem
) + "</maxGuestGroups>")));
break;
case 5:
_local10.appendChild(new XML((("<guestAppearDelay>" + ??esc_xelem
) + "</guestAppearDelay>")));
break;
case 6:
_local10.appendChild(new XML((("<guestChangeMoodTime>" + ??esc_xelem
) + "</guestChangeMoodTime>")));
break;
case 7:
_local10.appendChild(new XML((("<guestDoubleAppearChance>" + ??esc_xelem
) + "</guestDoubleAppearChance>")));
break;
case 8:
_local10.appendChild(new XML((("<guestCoupleAppearChance>" + ??esc_xelem
) + "</guestCoupleAppearChance>")));
break;
case 9:
_local10.appendChild(new XML((("<guestAppearMood>" + ??esc_xelem
) + "</guestAppearMood>")));
break;
case 10:
_local10.appendChild(new XML((("<guestAppearWorseMoodChance>" + ??esc_xelem
) + "</guestAppearWorseMoodChance>")));
break;
};
};
_local10.appendChild(<guestReadingMenuTime>200</guestReadingMenuTime>
);
_local10.appendChild(<guestEatingTime>300</guestEatingTime>
);
_local8.appendChild(_local10);
_local6++;
};
_local5++;
};
return (_local7);
}
public function getCatalogPageXML(_arg1:int):XML{
var xml:XMLList;
var pageNum = _arg1;
xml = catalogConfigXML.page.(@num == pageNum);
return (xml[0]);
}
public function get soundEnabled():Boolean{
return (_soundEnabled);
}
public function getChefMinPrice():int{
var _local3:XML;
var _local4:int;
if (_minChefMinPrice != -1){
return (_minChefMinPrice);
};
var _local1:int = int.MAX_VALUE;
var _local2:XMLList = configXML.upgrades.chefs.*;
for each (_local3 in _local2) {
if (_local3.@level > 0){
_local4 = _local3.@price;
if (_local4 < _local1){
_local1 = _local4;
};
};
};
_minChefMinPrice = _local1;
return (_minChefMinPrice);
}
public function getStageDays(_arg1:int):int{
var _local2:XML = levelsConfigXML.stage[_arg1];
return (_local2.day.length());
}
}
}//package pdiner2.managers
Section 268
//ConfigManager_catalogConfigXMLClass (pdiner2.managers.ConfigManager_catalogConfigXMLClass)
package pdiner2.managers {
import mx.core.*;
public class ConfigManager_catalogConfigXMLClass extends ByteArrayAsset {
}
}//package pdiner2.managers
Section 269
//ConfigManager_catalogNoMochiConfigXMLClass (pdiner2.managers.ConfigManager_catalogNoMochiConfigXMLClass)
package pdiner2.managers {
import mx.core.*;
public class ConfigManager_catalogNoMochiConfigXMLClass extends ByteArrayAsset {
}
}//package pdiner2.managers
Section 270
//ConfigManager_configXMLClass (pdiner2.managers.ConfigManager_configXMLClass)
package pdiner2.managers {
import mx.core.*;
public class ConfigManager_configXMLClass extends ByteArrayAsset {
}
}//package pdiner2.managers
Section 271
//ConfigManager_levelsConfigXMLClass (pdiner2.managers.ConfigManager_levelsConfigXMLClass)
package pdiner2.managers {
import mx.core.*;
public class ConfigManager_levelsConfigXMLClass extends ByteArrayAsset {
}
}//package pdiner2.managers
Section 272
//Managers (pdiner2.managers.Managers)
package pdiner2.managers {
import flash.events.*;
import com.bigwigmedia.ui.*;
import com.bigwigmedia.font.*;
import com.bigwigmedia.sound.*;
import com.bigwigmedia.net.*;
import com.bigwigmedia.display.*;
import flash.text.*;
import flash.filters.*;
import com.bigwigmedia.core.*;
import pdiner2.constants.*;
import com.bigwigmedia.ui.styles.*;
import com.bigwigmedia.application.*;
import pdiner2.*;
public class Managers {
private static var _progressManager:ProgressManager;
private static var _soundManager:ISoundManager;
private static var _configManager:ConfigManager;
private static var _urlCaller:IURLCaller;
private static var _fontManager:IFontManager;
private static var initialized:Boolean = false;
private static var _mochiManager:MochiManager;
private static var _soManager:ISOManager;
private static var _styleManager:IStyleManager;
private static var onInitCallback:Function;
private static var _cursorManager:ICursorManager;
public static function get progressManager():ProgressManager{
return (_progressManager);
}
private static function onButtonMouseOverHandler(_arg1:AbstractButton):void{
_soundManager.play(SoundID.BUTTON_ROLLOVER_SFX);
}
public static function get mochiManager():MochiManager{
return (_mochiManager);
}
public static function initialize(_arg1:Function):void{
if (initialized){
throw (new Error("Managers initialized already"));
};
initialized = true;
Managers.onInitCallback = _arg1;
Singleton.registerClass("com.bigwigmedia.font::IFontManager", FontManager);
_fontManager = IFontManager(Singleton.getInstance("com.bigwigmedia.font::IFontManager"));
Singleton.registerClass("com.bigwigmedia.ui::ICursorManager", CursorManager);
_cursorManager = ICursorManager(Singleton.getInstance("com.bigwigmedia.ui::ICursorManager"));
Singleton.registerClass("com.bigwigmedia.sound::ISoundManager", SoundManager);
_soundManager = ISoundManager(Singleton.getInstance("com.bigwigmedia.sound::ISoundManager"));
Singleton.registerClass("com.bigwigmedia.ui::IStyleManager", StyleManager);
_styleManager = IStyleManager(Singleton.getInstance("com.bigwigmedia.ui::IStyleManager"));
Singleton.registerClass("com.bigwigmedia.net::ISOManager", SOManager);
_soManager = ISOManager(Singleton.getInstance("com.bigwigmedia.net::ISOManager"));
Singleton.registerClass("com.bigwigmedia.net::IURLCaller", URLCaller_2DPlay);
_urlCaller = IURLCaller(Singleton.getInstance("com.bigwigmedia.net::IURLCaller"));
_mochiManager = new MochiManager("7b0a76b001ebd8c4", Main(ApplicationGlobals.application).mochiWidgetHolder);
_fontManager.registerFonts("Font_1");
_styleManager.setSharedStyle(AbstractComponent, AbstractComponentStyle.TEXT_FORMAT, new TextFormat(_fontManager.getFontNameByID("Font_1"), 35, 0xFFFFFF));
_styleManager.setSharedStyle(AbstractComponent, AbstractComponentStyle.EMBED_FONTS, true);
_styleManager.setSharedStyle(LabelButton, AbstractComponentStyle.DECORATION, new FilterDecoration([new GlowFilter(2900549, 1, 4, 4, 5)]));
_styleManager.setSharedStyle(Label, AbstractComponentStyle.DECORATION, new FilterDecoration([new GlowFilter(2900549, 1, 4, 4, 5)]));
_styleManager.setSharedStyle(IconicButton, IconicButtonStyle.UP_DECORATION, new TintDecoration(0xFFFFFF, 0));
_styleManager.setSharedStyle(IconicButton, IconicButtonStyle.OVER_DECORATION, new TintDecoration(0xFFFFFF, 0.4));
_styleManager.setSharedStyle(LabelButton, LabelButtonStyle.UP_STATE_COLOR, 0xFFFFFF);
_styleManager.setSharedStyle(LabelButton, LabelButtonStyle.OVER_STATE_COLOR, 0xFFCC00);
_styleManager.setSharedStyle(LabelButton, LabelButtonStyle.DOWN_STATE_COLOR, 0xFFCC00);
_styleManager.setSharedStyle(AbstractButton, AbstractButtonStyle.MOUSE_DOWN_HANDLER, Managers.onButtonMouseDownHandler);
_styleManager.setSharedStyle(AbstractButton, AbstractButtonStyle.ROLL_OVER_HANDLER, Managers.onButtonMouseOverHandler);
_styleManager.setSharedStyle(LabelButton, AbstractButtonStyle.BEACON, new ColorBeacon(0xFFCC00));
_soundManager = new SoundManager();
_soundManager.registerRecord("button_rollover_sfx", button_rollover_sfx, ChannelID.SFX);
_soundManager.registerRecord("click_game_object_sfx", click_game_object_sfx, ChannelID.SFX);
_soundManager.registerRecord("click_penguin_sfx", click_penguin_sfx, ChannelID.SFX);
_soundManager.registerRecord("close_sign_fall_sfx", close_sign_fall_sfx, ChannelID.SFX);
_soundManager.registerRecord("crowd_clap_sfx", crowd_clap_sfx, ChannelID.SFX);
_soundManager.registerRecord("curtain_down_sfx", curtain_down_sfx, ChannelID.SFX);
_soundManager.registerRecord("curtain_up_sfx", curtain_up_sfx, ChannelID.SFX);
_soundManager.registerRecord("food_give_sfx", food_give_sfx, ChannelID.SFX);
_soundManager.registerRecord("food_pickup_sfx", food_pickup_sfx, ChannelID.SFX);
_soundManager.registerRecord("food_ready_sfx", food_ready_sfx, ChannelID.SFX);
_soundManager.registerRecord("hello_sfx", hello_sfx, ChannelID.SFX);
_soundManager.registerRecord("message_popup_sfx", message_popup_sfx, ChannelID.SFX);
_soundManager.registerRecord("money_pickup_sfx", money_pickup_sfx, ChannelID.SFX);
_soundManager.registerRecord("penguin_read_menu_sfx", penguin_read_menu_sfx, ChannelID.SFX);
_soundManager.registerRecord("trashcan_sfx", trashcan_sfx, ChannelID.SFX);
_soundManager.registerRecord("upgrade_buy_sfx", upgrade_buy_sfx, ChannelID.SFX);
_soundManager.registerRecord("walk_ice_02_sfx", walk_ice_02_sfx, ChannelID.SFX);
_soundManager.registerRecord("walk_ice_03_sfx", walk_ice_03_sfx, ChannelID.SFX);
_soundManager.registerRecord("hello_f2_sfx", hello_f2_sfx, ChannelID.SFX);
_soundManager.registerRecord("pop_sfx", pop_sfx, ChannelID.SFX);
_soundManager.registerRecord("cancel_sfx", cancel_sfx, ChannelID.SFX);
_soundManager.registerRecord("cooksfx_01_wav", cooksfx_01_wav, ChannelID.CHEF_SFX);
_soundManager.registerRecord("cooksfx_02_wav", cooksfx_02_wav, ChannelID.CHEF_SFX);
_soundManager.registerRecord("cooksfx_03_wav", cooksfx_03_wav, ChannelID.CHEF_SFX);
_soundManager.registerRecord("peng_love2_wav", peng_love2_wav, ChannelID.SFX);
_soundManager.registerRecord("button_click_sfx", button_click_sfx, ChannelID.SFX);
_soundManager.registerRecord("ent_jugglingseal2_sfx", ent_jugglingseal2_sfx, ChannelID.ENVIRONMENT_SFX);
_soundManager.registerRecord("ent_radio3_sfx", ent_radio3_sfx, ChannelID.ENVIRONMENT_SFX);
_soundManager.registerRecord("ent_tv3_sfx", ent_tv3_sfx, ChannelID.ENVIRONMENT_SFX);
_soundManager.registerRecord("bg_wind3_wav", bg_wind3_wav, ChannelID.ENVIRONMENT_SFX);
_progressManager = new ProgressManager();
_configManager = new ConfigManager();
_configManager.addEventListener(Event.INIT, Managers.onConfigManCompleteHandler);
_configManager.initialize();
}
public static function get configManager():ConfigManager{
return (_configManager);
}
public static function get urlCaller():IURLCaller{
return (_urlCaller);
}
public static function get fontManager():IFontManager{
return (_fontManager);
}
public static function get soundManager():ISoundManager{
return (_soundManager);
}
public static function get soManager():ISOManager{
return (_soManager);
}
public static function get cursorManager():ICursorManager{
return (_cursorManager);
}
private static function onConfigManCompleteHandler(_arg1:Event):void{
_configManager.removeEventListener(Event.INIT, Managers.onConfigManCompleteHandler);
Managers.onInitCallback();
Managers.onInitCallback = null;
}
private static function onButtonMouseDownHandler(_arg1:AbstractButton):void{
_soundManager.play(SoundID.BUTTON_CLICK_SFX);
}
public static function get styleManager():IStyleManager{
return (_styleManager);
}
}
}//package pdiner2.managers
Section 273
//MochiEvent (pdiner2.managers.MochiEvent)
package pdiner2.managers {
import flash.events.*;
public class MochiEvent extends Event {
private var _data:Object;
public static const STORE_HIDE:String = "MochiEvent.storeHide";
public static const ITEM_NEW:String = "MochiEvent.itemNew";
public static const ERROR:String = "MochiEvent.error";
public static const LOGGED_IN:String = "MochiEvent.loggedIn";
public static const CONNECT:String = "MochiEvent.connect";
public static const STORE_ITEMS:String = "MochiEvent.storeItems";
public static const LOGGED_OUT:String = "MochiEvent.loggedOut";
public static const LOGIN_SHOW:String = "MochiEvent.loginShow";
public static const LOGIN_HIDE:String = "MochiEvent.loginHide";
public static const ITEM_OWNED:String = "MochiEvent.itemOwned";
public static const STORE_SHOW:String = "MochiEvent.storeShow";
public function MochiEvent(_arg1:String, _arg2:Object=null){
super(_arg1);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function clone():Event{
return (new MochiEvent(type, _data));
}
}
}//package pdiner2.managers
Section 274
//MochiManager (pdiner2.managers.MochiManager)
package pdiner2.managers {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import mochi.as3.*;
import flash.utils.*;
import assets.*;
import flash.errors.*;
public class MochiManager extends EventDispatcher {
private var _timer:Timer;
private var _connecting:Boolean;// = false
private var _loggedIn:Boolean;// = false
private var _ownedItemsHash:Object;
private var _storeItemsHash:Object;
private var _widgetHolder:MovieClip;
private var _preloader:Sprite;
private var _widgetLocation:Point;
private var _gameID:String;
private static var _initialized:Boolean = false;
public function MochiManager(_arg1:String, _arg2:MovieClip, _arg3:Point=null){
_ownedItemsHash = {};
_storeItemsHash = {};
super();
if (_initialized){
throw (new IllegalOperationError("Can't be instantiated twice"));
};
_initialized = true;
_gameID = _arg1;
_widgetHolder = _arg2;
_widgetLocation = ((_arg3) || (new Point()));
}
public function getStoreItemData(_arg1:String):Object{
return (_storeItemsHash[_arg1]);
}
public function get loggedIn():Boolean{
return (_loggedIn);
}
public function get connected():Boolean{
return (MochiServices.connected);
}
private function onStoreHideHandler(_arg1:Object):void{
dispatchEvent(new MochiEvent(MochiEvent.STORE_HIDE));
}
private function onErrorCallback(_arg1:String):void{
dispatchEvent(new MochiEvent(MochiEvent.ERROR, _arg1));
}
private function onLoggedInHandler(_arg1:Object):void{
_loggedIn = true;
dispatchEvent(new MochiEvent(MochiEvent.LOGGED_IN, _arg1));
}
private function registerItem(_arg1:Object):void{
_ownedItemsHash[_arg1.id] = _arg1;
}
public function showStoreItem(_arg1:String, _arg2:Point=null):void{
var _local3:Object = {item:_arg1};
if (_arg2){
_local3.x = _arg2.x;
_local3.y = _arg2.y;
};
MochiCoins.showItem(_local3);
}
private function onErrorEventHandler(_arg1:Object):void{
dispatchEvent(new MochiEvent(MochiEvent.ERROR, _arg1));
}
private function onStoreItemsHandler(_arg1:Object):void{
var _local3:Object;
var _local2:Array = (_arg1 as Array);
for each (_local3 in _local2) {
_storeItemsHash[_local3.id] = _local3;
};
dispatchEvent(new MochiEvent(MochiEvent.STORE_ITEMS));
}
public function showLoginWidget():void{
MochiSocial.showLoginWidget({x:_widgetLocation.x, y:_widgetLocation.y});
}
private function onLoginShowHandler(_arg1:Object):void{
if (_preloader){
_widgetHolder.removeChild(_preloader);
_preloader = null;
};
dispatchEvent(new MochiEvent(MochiEvent.LOGIN_SHOW));
}
public function showStore(_arg1:Array=null):void{
var _local2:Object = ((_arg1 == null)) ? null : {tags:_arg1};
MochiCoins.showStore(_local2);
}
public function connect():void{
if (((_connecting) || (connected))){
return;
};
_connecting = true;
_preloader = new MochiPreloader();
_preloader.x = _widgetLocation.x;
_preloader.y = _widgetLocation.y;
_widgetHolder.addChild(_preloader);
MochiSocial.addEventListener(MochiSocial.LOGIN_SHOW, onLoginShowHandler);
MochiSocial.addEventListener(MochiSocial.LOGIN_HIDE, onLoginHideHandler);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, onLoggedInHandler);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, onLoggedOutHandler);
MochiSocial.addEventListener(MochiSocial.ERROR, onErrorEventHandler);
MochiCoins.addEventListener(MochiCoins.ERROR, onErrorEventHandler);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, onItemNewHandler);
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, onItemOwnedHandler);
MochiCoins.addEventListener(MochiCoins.STORE_SHOW, onStoreShowHandler);
MochiCoins.addEventListener(MochiCoins.STORE_HIDE, onStoreHideHandler);
MochiCoins.addEventListener(MochiCoins.STORE_ITEMS, onStoreItemsHandler);
MochiServices.connect(_gameID, _widgetHolder, onErrorCallback);
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, onWaitConnectionHandler);
_timer.start();
}
public function hideLoginWidget():void{
MochiSocial.hideLoginWidget();
}
private function onStoreShowHandler(_arg1:Object):void{
dispatchEvent(new MochiEvent(MochiEvent.STORE_SHOW));
}
public function getOwnedItemData(_arg1:String):Object{
return (_ownedItemsHash[_arg1]);
}
private function onItemOwnedHandler(_arg1:Object):void{
registerItem(_arg1);
dispatchEvent(new MochiEvent(MochiEvent.ITEM_OWNED, _arg1));
}
private function onItemNewHandler(_arg1:Object):void{
registerItem(_arg1);
dispatchEvent(new MochiEvent(MochiEvent.ITEM_NEW, _arg1));
}
private function onLoggedOutHandler(_arg1:Object):void{
var _local2:Boolean = _loggedIn;
_loggedIn = false;
if (_local2){
dispatchEvent(new MochiEvent(MochiEvent.LOGGED_OUT));
};
}
private function onLoginHideHandler(_arg1:Object):void{
dispatchEvent(new MochiEvent(MochiEvent.LOGIN_HIDE));
}
private function onWaitConnectionHandler(_arg1:TimerEvent):void{
if (connected){
_connecting = false;
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, onWaitConnectionHandler);
dispatchEvent(new MochiEvent(MochiEvent.CONNECT));
MochiCoins.getStoreItems();
};
}
}
}//package pdiner2.managers
Section 275
//ProgressManager (pdiner2.managers.ProgressManager)
package pdiner2.managers {
import pdiner2.game.*;
import pdiner2.game.entities.*;
import pdiner2.map.*;
import pdiner2.constants.*;
public class ProgressManager {
private var _hintsOrder:Array;
private var _dayInfoCache:Object;
private var _foodPricesCash:Object;
private var _earned:int;
private var _vo:Object;
private var _comicPopupHash:Object;
public function ProgressManager(){
_dayInfoCache = {};
super();
_vo = Managers.soManager.getValue(SOValues.GAME_PROGRESS);
if (!_vo){
_vo = defaultValueObject;
Managers.soManager.setValue(SOValues.GAME_PROGRESS, _vo);
};
_hintsOrder = Managers.soManager.getValue(SOValues.SHOWN_HINTS_IN_ORDER);
if (!_hintsOrder){
_hintsOrder = defaultHintsOrder;
Managers.soManager.setValue(SOValues.SHOWN_HINTS_IN_ORDER, _hintsOrder);
};
_comicPopupHash = Managers.soManager.getValue(SOValues.COMIC_POPUP_HASH);
if (!_comicPopupHash){
_comicPopupHash = defaultComicPopupHash;
Managers.soManager.setValue(SOValues.COMIC_POPUP_HASH, _comicPopupHash);
};
}
public function get defaultHintsOrder():Array{
var _local1:Array = [[Hint.SELECT_CUSTOMER], [Hint.SEAT_CUSTOMER, Hint.SEAT_CUSTOMER_COUPLE], [Hint.WAIT_CUSTOMER_MAKE_ORDER], [Hint.TAKE_ORDER], [Hint.PICKUP_FOOD], [Hint.CLEAN_TABLE], [Hint.PICKUP_ALL_MONEY]];
return (_local1);
}
public function set skateUpgrade(_arg1:int):void{
_vo.skateUpgrade = _arg1;
}
public function get skateUpgrade():int{
return (_vo.skateUpgrade);
}
public function get pennySpeed():Number{
var _local1:XML = Managers.configManager.getUpgradeXML("skates", skateUpgrade);
return (_local1.@speed);
}
public function get numTables():int{
var _local1:int = tableUpgrade;
switch (_local1){
case 0:
case 1:
return (5);
case 2:
return (6);
case 3:
return (7);
};
throw (new Error((("tableUpgrade value \"" + _local1) + "\" is incorrect")));
}
public function get defaultValueObject():Object{
var _local1:Object = {};
_local1[("theme_" + RoomThemes.STANDARD)] = true;
_local1[("uniform_" + Uniforms.STANDARD)] = true;
var _local2:Object = {gameSaved:true, stage:0, day:0, roomTheme:RoomThemes.STANDARD, pennyUniform:Uniforms.STANDARD, ownedItems:_local1, score:0, bank:0, stars:0, daysPlayed:0, tableUpgrade:0, chefUpgrade:0, seatUpgrade:0, skateUpgrade:0, entertaimentUpgrade:0, tableClothDecoration:0, pictureDecoration:0, curtainsDecoration:0, lightsDecoration:0, clocksDecoration:0, carpetDecoration:0};
return (_local2);
}
public function get daysPlayed():int{
return (_vo.daysPlayed);
}
public function get score():int{
return (_vo.score);
}
public function set daysPlayed(_arg1:int):void{
_vo.daysPlayed = _arg1;
}
public function willShowHint(_arg1:String):Boolean{
var _local5:Array;
var _local6:int;
var _local2:Boolean;
var _local3:int = _hintsOrder.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = _hintsOrder[_local4];
_local6 = _local5.indexOf(_arg1);
if (_local6 != -1){
_local5[_local6] = "NO";
_local2 = true;
break;
} else {
if ((((_local5.length == 1)) && (!((_local5[0] == "NO"))))){
break;
};
};
_local4++;
};
if (!_local2){
return (false);
};
Managers.soManager.setValue(SOValues.SHOWN_HINTS_IN_ORDER, _hintsOrder);
return (true);
}
public function get guestPatienceMultiplier():Number{
var _local1:ConfigManager = Managers.configManager;
var _local2:Number = (Number(_local1.getUpgradeXML("tables", tableUpgrade).@patienceMult) * Number(_local1.getUpgradeXML("entertainments", entertaimentUpgrade).@patienceMult));
return (_local2);
}
public function get entertaimentUpgrade():int{
return (_vo.entertaimentUpgrade);
}
public function get day():int{
return (_vo.day);
}
public function isStarItemOwned(_arg1:String):Boolean{
return (Boolean(_vo.ownedItems[_arg1]));
}
public function updateNextDay():Boolean{
daysPlayed = (daysPlayed + 1);
score = (score + earned);
bank = (bank + earned);
if (day == (Managers.configManager.getStageDays(stage) - 1)){
if (stage == (Managers.configManager.getNumStages() - 1)){
return (true);
};
day = 0;
stage = (stage + 1);
} else {
day = (day + 1);
};
return (false);
}
public function restartGame():void{
_vo = defaultValueObject;
Managers.soManager.setValue(SOValues.GAME_PROGRESS, _vo);
_comicPopupHash = defaultComicPopupHash;
Managers.soManager.setValue(SOValues.COMIC_POPUP_HASH, _comicPopupHash);
}
public function set pictureDecoration(_arg1:int):void{
_vo.pictureDecoration = _arg1;
}
public function set score(_arg1:int):void{
_vo.score = _arg1;
}
public function buyStandardItem(_arg1:String, _arg2:int, _arg3:int):void{
switch (_arg1){
case "skates":
_arg1 = "skateUpgrade";
break;
case "tables":
_arg1 = "tableUpgrade";
break;
case "seats":
_arg1 = "seatUpgrade";
break;
case "chefs":
_arg1 = "chefUpgrade";
break;
case "entertainments":
_arg1 = "entertaimentUpgrade";
break;
};
_vo[_arg1] = _arg3;
bank = (bank - _arg2);
}
public function get stageName():String{
switch (stage){
case 0:
return ("Terra Penguinia");
case 1:
return ("Bird Land");
case 2:
return ("New Seal Land");
};
return ("Whale Bay");
}
public function buyStarItem(_arg1:String, _arg2:int):void{
_vo.ownedItems[_arg1] = true;
stars = (stars - _arg2);
}
public function get lightsDecoration():int{
return (_vo.lightsDecoration);
}
public function set seatUpgrade(_arg1:int):void{
_vo.seatUpgrade = _arg1;
}
public function get curtainsDecoration():int{
return (_vo.curtainsDecoration);
}
public function set entertaimentUpgrade(_arg1:int):void{
_vo.entertaimentUpgrade = _arg1;
}
public function set carpetDecoration(_arg1:int):void{
_vo.carpetDecoration = _arg1;
}
public function set day(_arg1:int):void{
_vo.day = _arg1;
}
public function get foodTypes():Array{
var _local1:XML = Managers.configManager.getUpgradeXML("chefs", chefUpgrade);
var _local2:String = _local1.food;
return (_local2.split(","));
}
public function get roomTheme():String{
return (_vo.roomTheme);
}
public function getDayTips():int{
var _local1:ConfigManager = Managers.configManager;
var _local2:int = int(_local1.getCommonsXML("baseTipsAmount"));
_local2 = (_local2 + int(_local1.getUpgradeXML("seats", seatUpgrade).@addTips));
return (_local2);
}
public function set stars(_arg1:int):void{
_vo.stars = _arg1;
}
public function get bank():int{
return (_vo.bank);
}
public function resetHints():void{
_hintsOrder = defaultHintsOrder;
Managers.soManager.setValue(SOValues.SHOWN_HINTS_IN_ORDER, _hintsOrder);
}
public function getDayFoodPrice(_arg1:String):int{
var prices:XML;
var foodType = _arg1;
var configMan:ConfigManager = Managers.configManager;
if (_foodPricesCash == null){
_foodPricesCash = {};
prices = configMan.getCommonsXML("foodPrice");
prices.children().(_foodPricesCash[@type] = int(@price)); //not popped
};
var addPrice:int = (((((int(configMan.getUpgradeXML("tableClothDecoration", tableClothDecoration).@addPrice) + int(configMan.getUpgradeXML("pictureDecoration", pictureDecoration).@addPrice)) + int(configMan.getUpgradeXML("curtainsDecoration", curtainsDecoration).@addPrice)) + int(configMan.getUpgradeXML("lightsDecoration", lightsDecoration).@addPrice)) + int(configMan.getUpgradeXML("clocksDecoration", clocksDecoration).@addPrice)) + int(configMan.getUpgradeXML("carpetDecoration", carpetDecoration).@addPrice));
return ((_foodPricesCash[foodType] + addPrice));
}
public function get femaleHats():Array{
var _local1:XML = Managers.configManager.getRoomThemeXML(roomTheme);
return (_local1.femaleHats.toString().split(","));
}
public function get tableClothDecoration():int{
return (_vo.tableClothDecoration);
}
public function get clocksDecoration():int{
return (_vo.clocksDecoration);
}
public function get pictureDecoration():int{
return (_vo.pictureDecoration);
}
public function setTestValues(_arg1:Object, _arg2:DayInfo):void{
_vo = _arg1;
var _local3:String = ((_vo.stage + "_") + _vo.day);
_dayInfoCache[_local3] = _arg2;
}
public function get seatUpgrade():int{
return (_vo.seatUpgrade);
}
public function set lightsDecoration(_arg1:int):void{
_vo.lightsDecoration = _arg1;
}
public function get carpetDecoration():int{
return (_vo.carpetDecoration);
}
public function set tableUpgrade(_arg1:int):void{
_vo.tableUpgrade = _arg1;
}
public function set pennyUniform(_arg1:String):void{
_vo.pennyUniform = _arg1;
}
public function get stars():int{
return (_vo.stars);
}
public function set curtainsDecoration(_arg1:int):void{
_vo.curtainsDecoration = _arg1;
}
public function set roomTheme(_arg1:String):void{
_vo.roomTheme = _arg1;
}
public function get maleHats():Array{
var _local1:XML = Managers.configManager.getRoomThemeXML(roomTheme);
return (_local1.maleHats.toString().split(","));
}
public function get defaultComicPopupHash():Object{
var _local1:Object = {};
_local1[ComicPopup.FIRST_STAR] = true;
_local1[ComicPopup.USE_CATALOG_HINT] = true;
_local1[ComicPopup.HIRE_CHEF_HINT] = true;
return (_local1);
}
public function get chefCookingTime():int{
var _local1:XML = Managers.configManager.getUpgradeXML("chefs", chefUpgrade);
return (_local1.cookingTime);
}
public function get dayInfo():DayInfo{
var _local1:String = ((stage + "_") + day);
var _local2:DayInfo = _dayInfoCache[_local1];
if (!_local2){
_local2 = new DayInfo(Managers.configManager.getDayXML(stage, day));
_dayInfoCache[_local1] = _local2;
};
return (_local2);
}
public function get femaleClothes():Array{
var _local1:XML = Managers.configManager.getRoomThemeXML(roomTheme);
return (_local1.femaleClothes.toString().split(","));
}
public function set chefUpgrade(_arg1:int):void{
_vo.chefUpgrade = _arg1;
}
public function get tableUpgrade():int{
return (_vo.tableUpgrade);
}
public function willShowComicPopup(_arg1:String):Boolean{
if (_comicPopupHash[_arg1] === true){
_comicPopupHash[_arg1] = false;
Managers.soManager.setValue(SOValues.COMIC_POPUP_HASH, _comicPopupHash);
return (true);
};
return (false);
}
public function get pennyUniform():String{
if (roomTheme == RoomThemes.ECO){
return (Uniforms.ECO);
};
return (_vo.pennyUniform);
}
public function set clocksDecoration(_arg1:int):void{
_vo.clocksDecoration = _arg1;
}
public function set earned(_arg1:int):void{
_earned = _arg1;
}
public function get chefUpgrade():int{
return (_vo.chefUpgrade);
}
public function get earned():int{
return (_earned);
}
public function set bank(_arg1:int):void{
_vo.bank = _arg1;
}
public function get maleClothes():Array{
var _local1:XML = Managers.configManager.getRoomThemeXML(roomTheme);
return (_local1.maleClothes.toString().split(","));
}
public function set stage(_arg1:int):void{
_vo.stage = _arg1;
}
public function get stage():int{
return (_vo.stage);
}
public function set tableClothDecoration(_arg1:int):void{
_vo.tableClothDecoration = _arg1;
}
}
}//package pdiner2.managers
Section 276
//ComicPopup (pdiner2.map.ComicPopup)
package pdiner2.map {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.common.*;
import flash.text.*;
import com.bigwigmedia.events.*;
import flash.filters.*;
import com.bigwigmedia.tweens.*;
import com.bigwigmedia.ui.containers.*;
import com.bigwigmedia.application.*;
public class ComicPopup extends LayoutContainer {
private var _currentPage:int;// = 0
private var _pagesInfo:Array;
private var _textSprite:Sprite;
private var _pageSprite:Sprite;
private var _continueBtn:LabelButton;
private var _fadeOut:Boolean;
private var _tween:ITween;
private var _totalPages:int;
public static const NEW_GAME:String = "NEW_GAME";
public static const HIRE_CHEF_HINT:String = "HIRE_CHEF_HINT";
public static const FIRST_STAR:String = "FIRST_STAR";
public static const NEW_TERRITORY_1:String = "NEW_TERRITORY_1";
public static const NEW_TERRITORY_2:String = "NEW_TERRITORY_2";
public static const GAME_WIN:String = "GAME_WIN";
public static const BUY_CHEF_1:String = "BUY_CHEF_1";
public static const BUY_CHEF_2:String = "BUY_CHEF_2";
public static const BUY_CHEF_3:String = "BUY_CHEF_3";
public static const USE_CATALOG_HINT:String = "USE_CATALOG_HINT";
public static const NEW_TERRITORY_3:String = "NEW_TERRITORY_3";
public static const FADE_DURATION:int = 12;
private static var _configXML:XML = <config>
<popup type="NEW_GAME" fadeIn="false" fadeOut="true">
<page pageSprite="assets.ComicPage_0" continueButton="Continue">
<text>The last time we saw Penny she'd earned enough money for her trip back home. Now, after a long sea voyage, she's finally back!</text>
</page>
<page pageSprite="assets.ComicPage_1" continueButton="Continue">
<text>While she was away the standard of food got really bad... but ever-industrious Penny sees this as an opportunity!</text>
</page>
<page pageSprite="assets.ComicPage_2" continueButton="Continue">
<text>She decides to start her own restaurant chain. But she could sure use a little help... you up for it?</text>
</page>
</popup>
<popup type="NEW_TERRITORY_1" fadeIn="false" fadeOut="true">
<page pageSprite="assets.ComicPage_14" continueButton="Continue">
<text>OK good work! But there are more challenges ahead. So lets move on and take the next territory!</text>
</page>
<page pageSprite="assets.ComicPage_4" continueButton="Continue">
<text>Come on!! Let's help Penny take her restaurant chain across Antarctica!</text>
</page>
<page pageSprite="assets.ComicPage_10" continueButton="Continue">
<text>Here we go... it's the first stop on our tour of Antarctica!</text>
</page>
</popup>
<popup type="NEW_TERRITORY_2" fadeIn="false" fadeOut="true">
<page pageSprite="assets.ComicPage_9" continueButton="Continue">
<text>Next stop on the map and everyone seems friendly enough. Hope they like Penny's cooking!</text>
</page>
</popup>
<popup type="NEW_TERRITORY_3" fadeIn="false" fadeOut="true">
<page pageSprite="assets.ComicPage_8" continueButton="Continue">
<text>The last stop on our Antarctic journey! Penny's so excited!!!</text>
</page>
</popup>
<popup type="GAME_WIN" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_11" continueButton="Continue">
<text>And the award for the most popular restaurant in Antarctica goes to..... Penny!! (We couldn't have done it without you!)</text>
</page>
<page pageSprite="assets.ComicPage_12">
<text></text>
</page>
</popup>
<popup type="FIRST_STAR" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_3" continueButton="Close">
<text>Great news! The restaurant is a hit!!!</text>
</page>
</popup>
<popup type="BUY_CHEF_1" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_5" continueButton="Close">
<text>Nice!! Hiring Chef Pete will add more yummy dishes to the menu!</text>
</page>
</popup>
<popup type="BUY_CHEF_2" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_6" continueButton="Close">
<text>Good call! Chef Alby is famous for his seafood specials and his quick cooking!</text>
</page>
</popup>
<popup type="BUY_CHEF_3" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_7" continueButton="Close">
<text>Awesome! Chef Sully's speed in the kitchen is legendary! And so is his delicious menu!</text>
</page>
</popup>
<popup type="HIRE_CHEF_HINT" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_13" continueButton="Close">
<text>We need new dishes to excite our customers! Maybe we should hire a new chef!</text>
</page>
</popup>
<popup type="USE_CATALOG_HINT" fadeIn="false" fadeOut="false">
<page pageSprite="assets.ComicPage_15" continueButton="Close">
<text>Excellent, now we can afford an upgrade! Must check out that catalog...</text>
</page>
</popup>
</config>
;
public function ComicPopup(_arg1:String){
var xml:XML;
var pageXML:XML;
var pageInfo:Object;
var type = _arg1;
_pagesInfo = [];
super();
setSize(640, 480);
xml = _configXML.popup.(@type == type)[0];
for each (pageXML in xml.page) {
pageInfo = {sprite:String(pageXML.@pageSprite)};
if (pageXML.text.toString() != ""){
pageInfo.text = pageXML.text.toString();
};
if (pageXML.hasOwnProperty("@continueButton")){
pageInfo.continueButton = pageXML.@continueButton;
};
_pagesInfo.push(pageInfo);
};
_totalPages = xml.page.length();
_fadeOut = (xml.@fadeOut == "true");
_pageSprite = new Sprite();
addChild(_pageSprite);
_textSprite = new Sprite();
_textSprite.filters = [new GlowFilter(2900549, 1, 4, 4, 5)];
addChild(_textSprite);
_continueBtn = new LabelButton();
_continueBtn.beacon = true;
addChildToLayout(_continueBtn, {right:10, bottom:10});
if (xml.@fadeIn == "true"){
_continueBtn.visible = false;
this.alpha = 0;
_tween = new PropertyTween(this, "alpha", 0, 1, FADE_DURATION);
_tween.addEventListener(TweenEvent.COMPLETE, onFadeInCompleteHandler);
_tween.playAuto();
};
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
showCurrentPage();
}
private function showCurrentPage():void{
var _local2:TextField;
if (_pageSprite.numChildren != 0){
_pageSprite.removeChildAt(0);
};
_textSprite.graphics.clear();
if (_textSprite.numChildren != 0){
_textSprite.removeChildAt(0);
};
var _local1:Class = ApplicationGlobals.application.getClassByName(_pagesInfo[_currentPage].sprite);
_pageSprite.addChild(new (_local1));
if (_pagesInfo[_currentPage].text !== undefined){
_local2 = new TextField();
_local2.x = 12;
_local2.y = 12;
_local2.width = (((640 - 12) - 12) - 4);
_local2.height = 200;
_local2.selectable = false;
_local2.embedFonts = true;
_local2.multiline = true;
_local2.wordWrap = true;
_local2.defaultTextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_2"), 16, 0, false, false, false, null, null, TextFormatAlign.LEFT);
_local2.text = _pagesInfo[_currentPage].text;
_textSprite.addChild(_local2);
_textSprite.graphics.beginFill(0xFFFFFF);
_textSprite.graphics.drawRoundRect((_local2.x - 6), (_local2.y - 6), (_local2.width + 16), (_local2.textHeight + 16), 12);
_textSprite.graphics.endFill();
};
if (_pagesInfo[_currentPage].continueButton !== undefined){
_continueBtn.label = _pagesInfo[_currentPage].continueButton;
_continueBtn.visible = true;
} else {
_continueBtn.visible = false;
};
}
private function onFadeOutCompleteHandler(_arg1:TweenEvent):void{
_tween.removeEventListener(TweenEvent.COMPLETE, onFadeOutCompleteHandler);
_tween.dispose();
_tween = null;
dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true));
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
if (_arg1.target == _continueBtn){
_currentPage++;
if (_currentPage == _totalPages){
if (_fadeOut){
startFadeOut();
} else {
dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true));
};
} else {
showCurrentPage();
};
dispatchEvent(new PopupEvent(PopupEvent.CONTINUE, true));
};
}
private function onFadeInCompleteHandler(_arg1:TweenEvent):void{
_tween.removeEventListener(TweenEvent.COMPLETE, onFadeInCompleteHandler);
_tween.dispose();
_tween = null;
if (_pagesInfo[_currentPage].continueButton !== undefined){
_continueBtn.label = _pagesInfo[_currentPage].continueButton;
_continueBtn.visible = true;
};
}
override public function dispose():void{
if (_tween){
_tween.dispose();
};
super.dispose();
}
protected function startFadeOut():void{
if (_tween){
_tween.removeEventListener(TweenEvent.COMPLETE, onFadeInCompleteHandler);
_tween.dispose();
};
_continueBtn.visible = false;
_tween = new PropertyTween(this, "alpha", this.alpha, 0, FADE_DURATION);
_tween.addEventListener(TweenEvent.COMPLETE, onFadeOutCompleteHandler);
_tween.playAuto();
}
}
}//package pdiner2.map
Section 277
//MapController (pdiner2.map.MapController)
package pdiner2.map {
import com.bigwigmedia.mvc.events.*;
import flash.display.*;
import flash.events.*;
import com.bigwigmedia.mvc.*;
import pdiner2.core.*;
public class MapController extends EventDispatcher implements IController {
private var _view:MapView;
public function MapController(){
_view = new MapView();
_view.addEventListener(Event.COMPLETE, onViewCompleteHandler);
}
public function get view():DisplayObject{
return (_view);
}
private function onViewCompleteHandler(_arg1:Event):void{
dispatchEvent(new ControllerEvent(ControllerEvent.COMPLETE, MainSignal.START));
}
public function dispose():void{
_view.removeEventListener(Event.COMPLETE, onViewCompleteHandler);
_view.dispose();
}
}
}//package pdiner2.map
Section 278
//MapView (pdiner2.map.MapView)
package pdiner2.map {
import flash.display.*;
import flash.events.*;
import pdiner2.managers.*;
import com.bigwigmedia.ui.*;
import pdiner2.common.*;
import assets.*;
import com.bigwigmedia.ui.containers.*;
public class MapView extends LayoutContainer {
private var _popup:AbstractComponent;
private var _2dplayBtn:IconicButton;
private var _startBtn:LabelButton;
public function MapView(){
var _local4:MovieClip;
super();
var _local1:Sprite = Sprite(addChild(new MapBack()));
this.maxWidth = 640;
this.maxHeight = 480;
var _local2:int = Managers.progressManager.stage;
var _local3:int;
while (_local3 < 4) {
_local4 = MovieClip(_local1.getChildByName(("icon_stage_" + _local3)));
_local4.gotoAndStop(((_local2 == _local3)) ? 3 : ((_local2 < _local3)) ? 2 : 1);
_local3++;
};
_2dplayBtn = new IconicButton(TwoDPlayButtonIcon);
addChildToLayout(_2dplayBtn, {top:10, left:10});
_startBtn = new LabelButton("Start");
_startBtn.beacon = true;
addChildToLayout(_startBtn, {right:10, bottom:10});
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
addEventListener(PopupEvent.CLOSE, onPopupCloseHandler);
if (Managers.progressManager.daysPlayed == 0){
showPopup(ComicPopup.NEW_GAME);
} else {
if ((((Managers.progressManager.stage == 1)) && ((Managers.progressManager.day == 0)))){
showPopup(ComicPopup.NEW_TERRITORY_1);
} else {
if ((((Managers.progressManager.stage == 2)) && ((Managers.progressManager.day == 0)))){
showPopup(ComicPopup.NEW_TERRITORY_2);
} else {
if ((((Managers.progressManager.stage == 3)) && ((Managers.progressManager.day == 0)))){
showPopup(ComicPopup.NEW_TERRITORY_3);
};
};
};
};
}
private function removePopup():void{
if (_popup){
removeChild(_popup);
_popup.dispose();
_popup = null;
};
}
private function onPopupCloseHandler(_arg1:PopupEvent):void{
removePopup();
}
private function onMouseClickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case _startBtn:
dispatchEvent(new Event(Event.COMPLETE));
break;
case _2dplayBtn:
Managers.urlCaller.mainLink();
break;
};
}
private function showPopup(_arg1:String):void{
_popup = new ComicPopup(_arg1);
addChild(_popup);
}
override public function dispose():void{
removePopup();
super.dispose();
}
}
}//package pdiner2.map
Section 279
//Main (pdiner2.Main)
package pdiner2 {
import flash.display.*;
import com.bigwigmedia.application.*;
import com.bigwigmedia.preloaders.*;
import com.bigwigmedia.events.*;
import com.bigwigmedia.ui.*;
import com.bigwigmedia.mvc.*;
public class Main extends AbstractApplication_2DPLay {
private var _mochiWidgetHolder:MovieClip;
private var _mochiAdLoader:MovieClip;
public static const VERSION:String = "0.9.5.1083";
public function Main(){
super("Penguin Diner 2", "1746", VERSION, "com.bigwigmedia.penguin_diner_2_v.0.1.0.768");
addEventListener(ApplicationEvent.INIT, onAppInitHandler);
addEventListener(ApplicationEvent.READY, onAppReadyHandler);
}
private function onAppReadyHandler(_arg1:ApplicationEvent):void{
fillBackground();
removeMask();
createMask();
removeChild(_preloader);
_preloader = null;
removeEventListener(ApplicationEvent.INIT, onAppInitHandler);
removeEventListener(ApplicationEvent.READY, onAppReadyHandler);
Console.initialize([67, 79, 78, 83, 79, 76, 69]);
var _local2:Class = getClassByName("pdiner2.core.MainController");
var _local3:IController = new (_local2);
createMainView(_local3.view);
}
private function adFinishedCallback():void{
startPreloading();
}
public function get mochiWidgetHolder():MovieClip{
return (_mochiWidgetHolder);
}
private function onAppInitHandler(_arg1:ApplicationEvent):void{
this.contextMenu = ContextMenu_2DPlay.getMenu();
fillBackground(0xFFFFFF);
createMask(0xFFFFFF);
_mochiAdLoader = new MovieClip();
addChild(_mochiAdLoader);
_mochiWidgetHolder = new MovieClip();
_mochiWidgetHolder.visible = false;
addChild(_mochiWidgetHolder);
sortChildren();
startPreloading(new Preloader_2DPlay(true));
}
override protected function get childrenSortList():Array{
var _local1:Array = [_background, _mainView, _mochiWidgetHolder, _mochiAdLoader, _preloader, _transition, _mask, _cursorHolder];
return (_local1);
}
}
}//package pdiner2
Section 280
//hero_head_aside_26 (penny_fla.hero_head_aside_26)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_aside_26 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 281
//hero_head_aside2_22 (penny_fla.hero_head_aside2_22)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_aside2_22 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 282
//hero_head_asidedress4_37 (penny_fla.hero_head_asidedress4_37)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_asidedress4_37 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 283
//hero_head_asidedress6_50 (penny_fla.hero_head_asidedress6_50)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_asidedress6_50 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 284
//hero_head_asidedress7_59 (penny_fla.hero_head_asidedress7_59)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_asidedress7_59 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 285
//hero_head_dress8_63 (penny_fla.hero_head_dress8_63)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_dress8_63 extends MovieClip {
public var eyes_1:penny_eyes_side;
}
}//package penny_fla
Section 286
//hero_head_forw_27 (penny_fla.hero_head_forw_27)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_forw_27 extends MovieClip {
public var eyes_2:penny_eyes_down;
}
}//package penny_fla
Section 287
//hero_head_forwdress4_39 (penny_fla.hero_head_forwdress4_39)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_forwdress4_39 extends MovieClip {
public var eyes_2:penny_eyes_down;
}
}//package penny_fla
Section 288
//hero_head_forwdress6_52 (penny_fla.hero_head_forwdress6_52)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_forwdress6_52 extends MovieClip {
public var eyes_2:penny_eyes_down;
}
}//package penny_fla
Section 289
//hero_head_forwdress7_61 (penny_fla.hero_head_forwdress7_61)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_forwdress7_61 extends MovieClip {
public var eyes_2:penny_eyes_down;
}
}//package penny_fla
Section 290
//hero_head_forwdress8_64 (penny_fla.hero_head_forwdress8_64)
package penny_fla {
import flash.display.*;
public dynamic class hero_head_forwdress8_64 extends MovieClip {
public var eyes_2:penny_eyes_down;
}
}//package penny_fla
Section 291
//logo_2 (Preloader_2DPlay_fla.logo_2)
package Preloader_2DPlay_fla {
import flash.display.*;
public dynamic class logo_2 extends MovieClip {
public var animation:MovieClip;
public var progressBar:MovieClip;
}
}//package Preloader_2DPlay_fla
Section 292
//preloader_progress_bar_4 (Preloader_2DPlay_fla.preloader_progress_bar_4)
package Preloader_2DPlay_fla {
import flash.display.*;
public dynamic class preloader_progress_bar_4 extends MovieClip {
public var progressBarMask:MovieClip;
}
}//package Preloader_2DPlay_fla
Section 293
//Composite (Singularity.Geom.Composite)
package Singularity.Geom {
public class Composite {
protected var __invalidate:Boolean;// = true
public function getX(_arg1:Number):Number{
throw (new Error("Composite::getX() must be overriden"));
}
public function addControlPoint(_arg1:Number, _arg2:Number):void{
throw (new Error("Composite::addControlPoint() must be overriden"));
}
public function getY(_arg1:Number):Number{
throw (new Error("Composite::getY() must be overriden"));
}
}
}//package Singularity.Geom
Section 294
//PSpline3 (Singularity.Geom.PSpline3)
package Singularity.Geom {
public class PSpline3 extends Composite {
private var __d:Array;
private var __ySpline3:Spline3;
private var __totalDist:Number;
private var __knots:Number;// = 0
private var __xSpline3:Spline3;
private var __x:Array;
private var __y:Array;
private var __t:Array;
public function PSpline3(){
__t = [];
__x = [];
__y = [];
__d = [];
__xSpline3 = new Spline3();
__ySpline3 = new Spline3();
super();
}
public function get chordLength():Number{
if (__invalidate){
__computeKnots();
};
return (__totalDist);
}
override public function getY(_arg1:Number):Number{
if (__knots == 0){
return (NaN);
};
if (__knots == 1){
return (__y[0]);
};
if (__invalidate){
__computeKnots();
};
return (__ySpline3.eval(_arg1));
}
override public function addControlPoint(_arg1:Number, _arg2:Number):void{
if (isNaN(_arg1)){
throw (new ArgumentError(("invalid x-coordinate at knot: " + (__knots + 1))));
};
if (isNaN(_arg2)){
throw (new ArgumentError(("invalid y-coordinate at knot: " + (__knots + 1))));
};
__invalidate = true;
__x.push(_arg1);
__y.push(_arg2);
__knots++;
}
private function __computeKnots():void{
var _local3:Number;
var _local4:Number;
__totalDist = 0;
__d[0] = 0;
__t[0] = 0;
var _local1 = 1;
while (_local1 < __knots) {
_local3 = (__x[_local1] - __x[(_local1 - 1)]);
_local4 = (__y[_local1] - __y[(_local1 - 1)]);
__d[_local1] = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
__totalDist = (__totalDist + __d[_local1]);
_local1++;
};
__xSpline3.deleteAllKnots();
__ySpline3.deleteAllKnots();
__xSpline3.addControlPoint(0, __x[0]);
__ySpline3.addControlPoint(0, __y[0]);
var _local2:Number = 0;
_local1 = 1;
while (_local1 < __knots) {
_local2 = (_local2 + __d[_local1]);
__t[_local1] = (_local2 / __totalDist);
__xSpline3.addControlPoint(__t[_local1], __x[_local1]);
__ySpline3.addControlPoint(__t[_local1], __y[_local1]);
_local1++;
};
__invalidate = false;
}
override public function getX(_arg1:Number):Number{
if (__knots == 0){
return (NaN);
};
if (__knots == 1){
return (__x[0]);
};
if (__invalidate){
__computeKnots();
};
return (__xSpline3.eval(_arg1));
}
}
}//package Singularity.Geom
Section 295
//Spline3 (Singularity.Geom.Spline3)
package Singularity.Geom {
public class Spline3 extends Composite {
private var __b:Array;
private var __h:Array;
private var __hInv:Array;
private var __knots:Number;// = 0
private var __t:Array;
private var __u:Array;
private var __v:Array;
private var __delta:Number;// = 0
private var __z:Array;
private var __y:Array;
public function Spline3(){
__t = [];
__y = [];
__u = [];
__v = [];
__h = [];
__b = [];
__z = [];
__hInv = [];
super();
}
private function __computeZ():void{
var _local1:int;
while (_local1 < (__knots - 1)) {
__h[_local1] = (__t[(_local1 + 1)] - __t[_local1]);
__hInv[_local1] = (1 / __h[_local1]);
__b[_local1] = ((__y[(_local1 + 1)] - __y[_local1]) * __hInv[_local1]);
_local1++;
};
__u[1] = (2 * (__h[0] + __h[1]));
__v[1] = (6 * (__b[1] - __b[0]));
_local1 = 2;
while (_local1 < (__knots - 1)) {
__u[_local1] = ((2 * (__h[_local1] + __h[(_local1 - 1)])) - ((__h[(_local1 - 1)] * __h[(_local1 - 1)]) / __u[(_local1 - 1)]));
__v[_local1] = ((6 * (__b[_local1] - __b[(_local1 - 1)])) - ((__h[(_local1 - 1)] * __v[(_local1 - 1)]) / __u[(_local1 - 1)]));
_local1++;
};
__z[(__knots - 1)] = 0;
_local1 = (__knots - 2);
while (_local1 >= 1) {
__z[_local1] = ((__v[_local1] - (__h[_local1] * __z[(_local1 + 1)])) / __u[_local1]);
_local1--;
};
__z[0] = 0;
__invalidate = false;
}
private function __insert(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:int = (__knots - 1);
while (_local4 >= _arg3) {
__t[(_local4 + 1)] = __t[_local4];
__y[(_local4 + 1)] = __y[_local4];
_local4--;
};
__t[_arg3] = _arg1;
__y[_arg3] = _arg2;
__knots++;
}
public function deleteAllKnots():void{
__t.splice(0);
__y.splice(0);
__knots = 0;
__invalidate = true;
}
public function eval(_arg1:Number):Number{
var _local2:uint;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (__knots == 0){
return (NaN);
};
if (__knots == 1){
return (__y[0]);
};
if (__invalidate){
__computeZ();
};
_local2 = 0;
__delta = (_arg1 - __t[0]);
_local3 = (__knots - 2);
while (_local3 >= 0) {
if (_arg1 >= __t[_local3]){
__delta = (_arg1 - __t[_local3]);
_local2 = _local3;
break;
};
_local3--;
};
_local4 = (((__y[(_local2 + 1)] - __y[_local2]) * __hInv[_local2]) - ((__h[_local2] * (__z[(_local2 + 1)] + (2 * __z[_local2]))) * 0.166666666666667));
_local5 = ((0.5 * __z[_local2]) + (((__delta * (__z[(_local2 + 1)] - __z[_local2])) * 0.166666666666667) * __hInv[_local2]));
_local6 = (_local4 + (__delta * _local5));
_local7 = (__y[_local2] + (__delta * _local6));
return (_local7);
}
override public function addControlPoint(_arg1:Number, _arg2:Number):void{
var _local3:int;
if (isNaN(_arg1)){
throw (new ArgumentError(("invalid x-coordinate at knot: " + __t.length)));
};
if (isNaN(_arg2)){
throw (new ArgumentError(("invalid y-coordinate at knot: " + __t.length)));
};
__invalidate = true;
if (__t.length == 0){
__t.push(_arg1);
__y.push(_arg2);
__knots++;
} else {
if (_arg1 > __t[(__knots - 1)]){
__t.push(_arg1);
__y.push(_arg2);
__knots++;
} else {
if (_arg1 < __t[0]){
__insert(_arg1, _arg2, 0);
} else {
if (__knots > 1){
_local3 = 0;
while (_local3 < (__knots - 1)) {
if ((((_arg1 > __t[_local3])) && ((_arg1 < __t[(_local3 + 1)])))){
__insert(_arg1, _arg2, (_local3 + 1));
};
_local3++;
};
};
};
};
};
}
}
}//package Singularity.Geom
Section 296
//bg_wind3_wav (bg_wind3_wav)
package {
import flash.media.*;
public dynamic class bg_wind3_wav extends Sound {
}
}//package
Section 297
//button_click_sfx (button_click_sfx)
package {
import flash.media.*;
public dynamic class button_click_sfx extends Sound {
}
}//package
Section 298
//button_rollover_sfx (button_rollover_sfx)
package {
import flash.media.*;
public dynamic class button_rollover_sfx extends Sound {
}
}//package
Section 299
//cancel_sfx (cancel_sfx)
package {
import flash.media.*;
public dynamic class cancel_sfx extends Sound {
}
}//package
Section 300
//chef_1 (chef_1)
package {
import pdiner2.game.entityViews.*;
public dynamic class chef_1 extends EntityViewAnimationClient {
}
}//package
Section 301
//chef_2 (chef_2)
package {
import pdiner2.game.entityViews.*;
public dynamic class chef_2 extends EntityViewAnimationClient {
}
}//package
Section 302
//chef_3 (chef_3)
package {
import pdiner2.game.entityViews.*;
public dynamic class chef_3 extends EntityViewAnimationClient {
}
}//package
Section 303
//click_game_object_sfx (click_game_object_sfx)
package {
import flash.media.*;
public dynamic class click_game_object_sfx extends Sound {
}
}//package
Section 304
//click_penguin_sfx (click_penguin_sfx)
package {
import flash.media.*;
public dynamic class click_penguin_sfx extends Sound {
}
}//package
Section 305
//close_sign_fall_sfx (close_sign_fall_sfx)
package {
import flash.media.*;
public dynamic class close_sign_fall_sfx extends Sound {
}
}//package
Section 306
//cooksfx_01_wav (cooksfx_01_wav)
package {
import flash.media.*;
public dynamic class cooksfx_01_wav extends Sound {
}
}//package
Section 307
//cooksfx_02_wav (cooksfx_02_wav)
package {
import flash.media.*;
public dynamic class cooksfx_02_wav extends Sound {
}
}//package
Section 308
//cooksfx_03_wav (cooksfx_03_wav)
package {
import flash.media.*;
public dynamic class cooksfx_03_wav extends Sound {
}
}//package
Section 309
//crowd_clap_sfx (crowd_clap_sfx)
package {
import flash.media.*;
public dynamic class crowd_clap_sfx extends Sound {
}
}//package
Section 310
//curtain_down_sfx (curtain_down_sfx)
package {
import flash.media.*;
public dynamic class curtain_down_sfx extends Sound {
}
}//package
Section 311
//curtain_up_sfx (curtain_up_sfx)
package {
import flash.media.*;
public dynamic class curtain_up_sfx extends Sound {
}
}//package
Section 312
//ent_jugglingseal2_sfx (ent_jugglingseal2_sfx)
package {
import flash.media.*;
public dynamic class ent_jugglingseal2_sfx extends Sound {
}
}//package
Section 313
//ent_radio3_sfx (ent_radio3_sfx)
package {
import flash.media.*;
public dynamic class ent_radio3_sfx extends Sound {
}
}//package
Section 314
//ent_tv3_sfx (ent_tv3_sfx)
package {
import flash.media.*;
public dynamic class ent_tv3_sfx extends Sound {
}
}//package
Section 315
//eyes_normal_state_female (eyes_normal_state_female)
package {
import pdiner2.game.entityViews.*;
public dynamic class eyes_normal_state_female extends EntityViewAnimationClient {
}
}//package
Section 316
//eyes_normal_state_male (eyes_normal_state_male)
package {
import pdiner2.game.entityViews.*;
public dynamic class eyes_normal_state_male extends EntityViewAnimationClient {
}
}//package
Section 317
//Font_1 (Font_1)
package {
import flash.text.*;
public dynamic class Font_1 extends Font {
}
}//package
Section 318
//Font_2 (Font_2)
package {
import flash.text.*;
public dynamic class Font_2 extends Font {
}
}//package
Section 319
//food_give_sfx (food_give_sfx)
package {
import flash.media.*;
public dynamic class food_give_sfx extends Sound {
}
}//package
Section 320
//food_pickup_sfx (food_pickup_sfx)
package {
import flash.media.*;
public dynamic class food_pickup_sfx extends Sound {
}
}//package
Section 321
//food_ready_sfx (food_ready_sfx)
package {
import flash.media.*;
public dynamic class food_ready_sfx extends Sound {
}
}//package
Section 322
//guest_eating (guest_eating)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_eating extends EntityViewAnimationClient {
}
}//package
Section 323
//guest_mouth_eating (guest_mouth_eating)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_mouth_eating extends EntityViewAnimationClient {
}
}//package
Section 324
//guest_reading_menu (guest_reading_menu)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_reading_menu extends EntityViewAnimationClient {
}
}//package
Section 325
//guest_stand_up (guest_stand_up)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_stand_up extends EntityViewAnimationClient {
}
}//package
Section 326
//guest_waiting (guest_waiting)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_waiting extends EntityViewAnimationClient {
}
}//package
Section 327
//guest_waiting_food (guest_waiting_food)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_waiting_food extends EntityViewAnimationClient {
}
}//package
Section 328
//guest_waiting_water (guest_waiting_water)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_waiting_water extends EntityViewAnimationClient {
}
}//package
Section 329
//guest_walk_down (guest_walk_down)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_walk_down extends EntityViewAnimationClient {
}
}//package
Section 330
//guest_walk_side (guest_walk_side)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_walk_side extends EntityViewAnimationClient {
}
}//package
Section 331
//guest_walk_up (guest_walk_up)
package {
import pdiner2.game.entityViews.*;
public dynamic class guest_walk_up extends EntityViewAnimationClient {
}
}//package
Section 332
//hello_f2_sfx (hello_f2_sfx)
package {
import flash.media.*;
public dynamic class hello_f2_sfx extends Sound {
}
}//package
Section 333
//hello_sfx (hello_sfx)
package {
import flash.media.*;
public dynamic class hello_sfx extends Sound {
}
}//package
Section 334
//IconMochiCoin (IconMochiCoin)
package {
import flash.display.*;
public dynamic class IconMochiCoin extends Sprite {
}
}//package
Section 335
//IconStar (IconStar)
package {
import flash.display.*;
public dynamic class IconStar extends Sprite {
}
}//package
Section 336
//message_popup_sfx (message_popup_sfx)
package {
import flash.media.*;
public dynamic class message_popup_sfx extends Sound {
}
}//package
Section 337
//money_pickup_sfx (money_pickup_sfx)
package {
import flash.media.*;
public dynamic class money_pickup_sfx extends Sound {
}
}//package
Section 338
//peng_love2_wav (peng_love2_wav)
package {
import flash.media.*;
public dynamic class peng_love2_wav extends Sound {
}
}//package
Section 339
//penguin_read_menu_sfx (penguin_read_menu_sfx)
package {
import flash.media.*;
public dynamic class penguin_read_menu_sfx extends Sound {
}
}//package
Section 340
//penny_eyes_down (penny_eyes_down)
package {
import pdiner2.game.entityViews.*;
public dynamic class penny_eyes_down extends EntityViewAnimationClient {
}
}//package
Section 341
//penny_eyes_side (penny_eyes_side)
package {
import pdiner2.game.entityViews.*;
public dynamic class penny_eyes_side extends EntityViewAnimationClient {
}
}//package
Section 342
//pop_sfx (pop_sfx)
package {
import flash.media.*;
public dynamic class pop_sfx extends Sound {
}
}//package
Section 343
//skate_1skate (skate_1skate)
package {
import pdiner2.game.entityViews.*;
public dynamic class skate_1skate extends EntityViewAnimationClient {
}
}//package
Section 344
//skate_1skate_2 (skate_1skate_2)
package {
import pdiner2.game.entityViews.*;
public dynamic class skate_1skate_2 extends EntityViewAnimationClient {
}
}//package
Section 345
//skate_1skatefront (skate_1skatefront)
package {
import pdiner2.game.entityViews.*;
public dynamic class skate_1skatefront extends EntityViewAnimationClient {
}
}//package
Section 346
//trashcan_sfx (trashcan_sfx)
package {
import flash.media.*;
public dynamic class trashcan_sfx extends Sound {
}
}//package
Section 347
//upgrade_buy_sfx (upgrade_buy_sfx)
package {
import flash.media.*;
public dynamic class upgrade_buy_sfx extends Sound {
}
}//package
Section 348
//walk_ice_02_sfx (walk_ice_02_sfx)
package {
import flash.media.*;
public dynamic class walk_ice_02_sfx extends Sound {
}
}//package
Section 349
//walk_ice_03_sfx (walk_ice_03_sfx)
package {
import flash.media.*;
public dynamic class walk_ice_03_sfx extends Sound {
}
}//package