Section 1
//MD5 (CMG_AS3.MD5)
package CMG_AS3 {
public class MD5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
_local3 = 1732584193;
_local4 = -271733879;
_local5 = -1732584194;
_local6 = 271733878;
_local7 = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array((_arg1.length >> 2));
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = 0;
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1.length * 8)) {
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | ((_arg1.charCodeAt((_local3 / 8)) & 0xFF) << (_local3 % 32)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local2 = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
_local3 = "";
_local5 = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local3 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = "";
_local3 = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:String;
_local3 = _arg2.length;
_local4 = [];
_local9 = new Array((_arg1.length / 2));
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
_local10 = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package CMG_AS3
Section 2
//ScoreSubmitter (CMG_AS3.ScoreSubmitter)
package CMG_AS3 {
import flash.events.*;
import flash.net.*;
public class ScoreSubmitter extends EventDispatcher {
private var m_UrlLoader:URLLoader;// = null
public static const RETURNCODE_SUCCESS = 1;
public static const RETURNCODE_REJECTED = 2;
public static const RETURNCODE_INTERNALERROR = 5;
public static const URL_SUBMITSCORE = "http://scores.crazymonkeygames.com/hs/regscores2.php";
public static const URL_UPDATEGAME = "http://scores.crazymonkeygames.com/hs/pleaseupdate.php";
public static const SCORE_RESPONSE:String = "score_response";
public static const RETURNCODE_WORKING = 0;
public static const RETURNCODE_WRONGVERSION = 3;
public static const URL_VIEWSCORES = "http://scores.crazymonkeygames.com/hs/listscores.php";
public static const RETURNCODE_NETWORKERROR = 4;
public static var gameVersion:String = "";
public static var gameValidationCode:String = "";
public static var gameId:uint = 0;
public function ScoreSubmitter(){
m_UrlLoader = null;
super();
}
private function onIoError(_arg1:Event){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_NETWORKERROR));
}
public function submitScore(_arg1:String, _arg2, _arg3:String=null):void{
var _local4:*;
var _local5:URLRequest;
_arg1 = Utilities.trim(_arg1);
gameVersion = Utilities.trim(gameVersion);
if (_arg3 == null){
_arg3 = "";
} else {
_arg3 = Utilities.trim(_arg3);
};
gameValidationCode = Utilities.trim(gameValidationCode);
if ((((((gameId < 1)) || ((gameVersion == "")))) || ((gameValidationCode == "")))){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
return;
};
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WORKING));
_local4 = new URLVariables();
_local4.name = _arg1;
_local4.score = _arg2;
_local4.gameId = gameId;
_local4.gameVersion = gameVersion;
_local4.special = _arg3;
_local4.key = MD5.encrypt(((((((((_arg1 + "|") + _arg2) + "|") + gameId) + "|") + _arg3) + "|") + gameValidationCode));
_local5 = new URLRequest(URL_SUBMITSCORE);
_local5.method = URLRequestMethod.POST;
_local5.data = _local4;
m_UrlLoader = new URLLoader();
m_UrlLoader.addEventListener("complete", onComplete);
m_UrlLoader.addEventListener("ioError", onIoError);
m_UrlLoader.load(_local5);
}
private function onComplete(_arg1:Event):void{
var _local2:URLVariables;
var _local3:*;
_local2 = new URLVariables(m_UrlLoader.data.replace("&", ""));
_local3 = Utilities.trim(_local2.ok);
if (_local3 == 1){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_SUCCESS));
} else {
if (_local3 == 0){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
} else {
if (_local3 == 2){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WRONGVERSION));
} else {
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_INTERNALERROR));
};
};
};
}
public static function loadHighScorePage():void{
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
public static function loadUpdatePage(){
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
}
}//package CMG_AS3
Section 3
//ServerResponseEvent (CMG_AS3.ServerResponseEvent)
package CMG_AS3 {
import flash.events.*;
public class ServerResponseEvent extends Event {
public var returnCode:uint;
public function ServerResponseEvent(_arg1:String, _arg2:uint){
super(_arg1, false, false);
returnCode = _arg2;
}
}
}//package CMG_AS3
Section 4
//Utilities (CMG_AS3.Utilities)
package CMG_AS3 {
import flash.net.*;
import flash.external.*;
import flash.system.*;
public class Utilities {
public static function trim(_arg1:String):String{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_arg1.charCodeAt(_local2) < 33) {
_local2++;
};
_local3 = (_arg1.length - 1);
while (_arg1.charCodeAt(_local3) < 33) {
_local3--;
};
return (_arg1.substring(_local2, (_local3 + 1)));
}
public static function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
}
}//package CMG_AS3
Section 5
//Cell (com.joelesler.rainwords.Cell)
package com.joelesler.rainwords {
import flash.events.*;
public class Cell extends EventDispatcher {
private var _letter:String;
private var _row:int;
private var _isOpen:Boolean;
private var _column:int;
public function Cell(_arg1:int, _arg2:int, _arg3:Boolean){
_row = _arg1;
_column = _arg2;
_isOpen = _arg3;
}
public function getColumn():int{
return (_column);
}
public function getLetter():String{
return (_letter);
}
public function isOpen():Boolean{
return (_isOpen);
}
public function getRow():int{
return (_row);
}
public function setLetter(_arg1:String):void{
_letter = _arg1;
dispatchEvent(new Event(Event.CHANGE));
}
}
}//package com.joelesler.rainwords
Section 6
//CellView (com.joelesler.rainwords.CellView)
package com.joelesler.rainwords {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CellView extends Sprite {
private var _source:Cell;
private var _letter:TextField;
private var _graphic:CellViewGraphic;
private static var _letterColour:int = 0x222222;
private static var _letterFormat:TextFormat;
private static var _letterFont:String = "Arial";
private static var _letterSize:int = 18;
public function CellView(_arg1:Cell){
_graphic = new CellViewGraphic();
_letter = new TextField();
super();
_source = _arg1;
_source.addEventListener(Event.CHANGE, sourceChangeListener);
addChild(_graphic);
_graphic.stop();
_letter.text = _source.getLetter();
_letter.x = 0;
_letter.y = 1;
_letter.width = width;
_letter.height = (height - 1);
_letter.borderColor = 0xFF0000;
_letter.mouseEnabled = false;
addChild(_letter);
}
public function getSource():Cell{
return (_source);
}
public function position():void{
x = (_source.getColumn() * (width - 1));
y = (_source.getRow() * (height - 1));
}
private function sourceChangeListener(_arg1:Event):void{
_letter.text = _source.getLetter().toUpperCase();
_letter.setTextFormat(getLetterFormat());
}
private function getLetterFormat():TextFormat{
if (_letterFormat == null){
_letterFormat = new TextFormat();
_letterFormat.font = _letterFont;
_letterFormat.size = _letterSize;
_letterFormat.color = _letterColour;
_letterFormat.align = TextFormatAlign.CENTER;
};
return (_letterFormat);
}
public function setHighlight(_arg1:String):void{
if (_arg1 == "normal"){
_graphic.gotoAndStop("normal");
} else {
if (_arg1 == "blue"){
_graphic.gotoAndStop("blue");
} else {
if (_arg1 == "red"){
_graphic.gotoAndStop("red");
} else {
if (_arg1 == "green"){
_graphic.gotoAndStop("green");
};
};
};
};
}
}
}//package com.joelesler.rainwords
Section 7
//Clue (com.joelesler.rainwords.Clue)
package com.joelesler.rainwords {
import flash.display.*;
public class Clue extends Sprite {
var _word:String;
private var _yVelocity:Number;// = 0
public function Clue(){
_yVelocity = 0;
super();
}
public function updatePosition(_arg1:Number):void{
y = (y + (_yVelocity * _arg1));
}
public function setYVelocity(_arg1:Number):void{
_yVelocity = _arg1;
}
public function getWord():String{
return (_word);
}
public function setWord(_arg1:String):void{
_word = _arg1;
}
}
}//package com.joelesler.rainwords
Section 8
//ClueFactory (com.joelesler.rainwords.ClueFactory)
package com.joelesler.rainwords {
public class ClueFactory {
private var _clueCache:Array;
private static var _instance:ClueFactory;
public function ClueFactory(){
_clueCache = new Array();
super();
populateClueCache();
}
public function getClue(_arg1:String):Clue{
var _local2:Clue;
_local2 = _clueCache[_arg1];
if (_local2 == null){
return (null);
};
_local2.setWord(_arg1);
return (_local2);
}
private function populateClueCache():void{
_clueCache["mug"] = new MugClue();
_clueCache["pencil"] = new PencilClue();
_clueCache["book"] = new BookClue();
_clueCache["screw"] = new ScrewClue();
_clueCache["shoe"] = new ShoeClue();
_clueCache["glasses"] = new GlassesClue();
_clueCache["torch"] = new TorchClue();
_clueCache["fire"] = new FireClue();
_clueCache["toothbrush"] = new ToothbrushClue();
_clueCache["battery"] = new BatteryClue();
_clueCache["ruler"] = new RulerClue();
_clueCache["wrench"] = new WrenchClue();
_clueCache["surfboard"] = new SurfboardClue();
_clueCache["telescope"] = new TelescopeClue();
_clueCache["wool"] = new WoolClue();
_clueCache["box"] = new BoxClue();
_clueCache["car"] = new CarClue();
_clueCache["horseshoe"] = new HorseshoeClue();
_clueCache["nail"] = new NailClue();
_clueCache["knife"] = new KnifeClue();
_clueCache["fork"] = new ForkClue();
_clueCache["spoon"] = new SpoonClue();
_clueCache["bicycle"] = new BicycleClue();
_clueCache["tree"] = new TreeClue();
_clueCache["leaf"] = new LeafClue();
_clueCache["clock"] = new ClockClue();
_clueCache["moon"] = new MoonClue();
_clueCache["sun"] = new SunClue();
_clueCache["house"] = new HouseClue();
_clueCache["boat"] = new BoatClue();
_clueCache["cloud"] = new CloudClue();
_clueCache["sock"] = new SockClue();
_clueCache["paintbrush"] = new PaintbrushClue();
_clueCache["telephone"] = new TelephoneClue();
_clueCache["couch"] = new CouchClue();
_clueCache["chair"] = new ChairClue();
_clueCache["door"] = new DoorClue();
_clueCache["flower"] = new FlowerClue();
_clueCache["padlock"] = new PadlockClue();
_clueCache["key"] = new KeyClue();
_clueCache["saucepan"] = new SaucepanClue();
_clueCache["axe"] = new AxeClue();
_clueCache["ladder"] = new LadderClue();
_clueCache["rake"] = new RakeClue();
_clueCache["mushroom"] = new MushroomClue();
_clueCache["feather"] = new FeatherClue();
_clueCache["satellite"] = new SatelliteClue();
_clueCache["rainbow"] = new RainbowClue();
_clueCache["lightbulb"] = new LightbulbClue();
_clueCache["skateboard"] = new SkateboardClue();
_clueCache["eye"] = new EyeClue();
_clueCache["lamp"] = new LampClue();
_clueCache["hat"] = new HatClue();
_clueCache["ball"] = new BallClue();
_clueCache["television"] = new TelevisionClue();
_clueCache["camera"] = new CameraClue();
_clueCache["cactus"] = new CactusClue();
_clueCache["balloon"] = new BalloonClue();
_clueCache["hammer"] = new HammerClue();
_clueCache["magnet"] = new MagnetClue();
_clueCache["snowflake"] = new SnowflakeClue();
_clueCache["scalpel"] = new ScalpelClue();
_clueCache["skull"] = new SkullClue();
_clueCache["umbrella"] = new UmbrellaClue();
_clueCache["brick"] = new BrickClue();
_clueCache["compass"] = new CompassClue();
_clueCache["match"] = new MatchClue();
_clueCache["quaver"] = new QuaverClue();
_clueCache["racquet"] = new RacquetClue();
_clueCache["corkscrew"] = new CorkscrewClue();
_clueCache["barrel"] = new BarrelClue();
_clueCache["paperclip"] = new PaperclipClue();
_clueCache["broom"] = new BroomClue();
_clueCache["crowbar"] = new CrowbarClue();
_clueCache["bone"] = new BoneClue();
_clueCache["headphones"] = new HeadphonesClue();
_clueCache["cassette"] = new CassetteClue();
_clueCache["amp"] = new AmpClue();
_clueCache["sword"] = new SwordClue();
_clueCache["log"] = new LogClue();
_clueCache["plane"] = new PlaneClue();
_clueCache["flag"] = new FlagClue();
_clueCache["comb"] = new CombClue();
_clueCache["razor"] = new RazorClue();
_clueCache["anchor"] = new AnchorClue();
_clueCache["canoe"] = new CanoeClue();
_clueCache["tyre"] = new TyreClue();
_clueCache["heart"] = new HeartClue();
_clueCache["diamond"] = new DiamondClue();
_clueCache["bucket"] = new BucketClue();
_clueCache["mail"] = new MailClue();
_clueCache["ladder"] = new LadderClue();
_clueCache["bell"] = new BellClue();
_clueCache["watch"] = new WatchClue();
_clueCache["cigarette"] = new CigaretteClue();
_clueCache["syringe"] = new SyringeClue();
_clueCache["banana"] = new BananaClue();
_clueCache["apple"] = new AppleClue();
_clueCache["cherries"] = new CherriesClue();
_clueCache["milk"] = new MilkClue();
_clueCache["cake"] = new CakeClue();
_clueCache["bread"] = new BreadClue();
_clueCache["bacon"] = new BaconClue();
_clueCache["watermelon"] = new WatermelonClue();
_clueCache["pumpkin"] = new PumpkinClue();
_clueCache["egg"] = new EggClue();
_clueCache["cheese"] = new CheeseClue();
_clueCache["carrot"] = new CarrotClue();
_clueCache["peanut"] = new PeanutClue();
_clueCache["lemon"] = new LemonClue();
_clueCache["lime"] = new LimeClue();
_clueCache["pineapple"] = new PineappleClue();
_clueCache["strawberry"] = new StrawberryClue();
_clueCache["muffin"] = new MuffinClue();
_clueCache["pear"] = new PearClue();
_clueCache["celery"] = new CeleryClue();
_clueCache["guitar"] = new GuitarClue();
_clueCache["drum"] = new DrumClue();
_clueCache["trumpet"] = new TrumpetClue();
_clueCache["saxophone"] = new SaxophoneClue();
_clueCache["violin"] = new ViolinClue();
_clueCache["piano"] = new PianoClue();
_clueCache["square"] = new SquareClue();
_clueCache["triangle"] = new TriangleClue();
_clueCache["circle"] = new CircleClue();
_clueCache["pentagon"] = new PentagonClue();
_clueCache["hexagon"] = new HexagonClue();
_clueCache["octagon"] = new OctagonClue();
_clueCache["cube"] = new CubeClue();
_clueCache["icosahedron"] = new IcosahedronClue();
_clueCache["tetrahedron"] = new TetrahedronClue();
_clueCache["dodecahedron"] = new DodecahedronClue();
_clueCache["puppy"] = new PuppyClue();
_clueCache["kitten"] = new KittenClue();
_clueCache["monkey"] = new MonkeyClue();
_clueCache["snake"] = new SnakeClue();
_clueCache["snail"] = new SnailClue();
_clueCache["butterfly"] = new ButterflyClue();
_clueCache["frog"] = new FrogClue();
_clueCache["sheep"] = new SheepClue();
_clueCache["owl"] = new OwlClue();
_clueCache["lion"] = new LionClue();
_clueCache["ant"] = new AntClue();
_clueCache["tiger"] = new TigerClue();
_clueCache["penguin"] = new PenguinClue();
_clueCache["fox"] = new FoxClue();
_clueCache["elephant"] = new ElephantClue();
_clueCache["panda"] = new PandaClue();
_clueCache["bee"] = new BeeClue();
_clueCache["fish"] = new FishClue();
_clueCache["duck"] = new DuckClue();
_clueCache["rabbit"] = new RabbitClue();
_clueCache["pig"] = new PigClue();
_clueCache["echidna"] = new EchidnaClue();
_clueCache["platypus"] = new PlatypusClue();
_clueCache["mouse"] = new MouseClue();
_clueCache["down"] = new DownClue();
_clueCache["left"] = new LeftClue();
_clueCache["right"] = new RightClue();
_clueCache["north"] = new NorthClue();
_clueCache["south"] = new SouthClue();
_clueCache["east"] = new EastClue();
_clueCache["west"] = new WestClue();
_clueCache["zero"] = new ZeroClue();
_clueCache["one"] = new OneClue();
_clueCache["two"] = new TwoClue();
_clueCache["three"] = new ThreeClue();
_clueCache["four"] = new FourClue();
_clueCache["five"] = new FiveClue();
_clueCache["six"] = new SixClue();
_clueCache["seven"] = new SevenClue();
_clueCache["eight"] = new EightClue();
_clueCache["nine"] = new NineClue();
_clueCache["australia"] = new AustraliaClue();
_clueCache["canada"] = new CanadaClue();
_clueCache["britain"] = new BritainClue();
_clueCache["ireland"] = new IrelandClue();
_clueCache["greenland"] = new GreenlandClue();
_clueCache["antarctica"] = new AntarcticaClue();
_clueCache["africa"] = new AfricaClue();
_clueCache["blue"] = new BlueClue();
_clueCache["yellow"] = new YellowClue();
_clueCache["red"] = new RedClue();
_clueCache["green"] = new GreenClue();
_clueCache["orange"] = new OrangeClue();
_clueCache["purple"] = new PurpleClue();
}
public static function getInstance():ClueFactory{
if (!_instance){
ClueFactory._instance = new (ClueFactory);
};
return (ClueFactory._instance);
}
}
}//package com.joelesler.rainwords
Section 9
//ConstructionCell (com.joelesler.rainwords.ConstructionCell)
package com.joelesler.rainwords {
public class ConstructionCell {
private var _insertionStatus:int;// = 0
private var _letter:String;
private var _fillStatus:int;// = 2
private var _column:int;
private var _row:int;
public static const ALLOW_HORIZONTAL:int = 2;
public static const ALLOW_VERTICAL:int = 3;
public static const LETTER_VERTICAL:int = 1;
public static const LETTER_NONE:int = 2;
public static const LETTER_BOTH:int = 3;
public static const ALLOW_NONE:int = 1;
public static const ALLOW_BOTH:int = 0;
public static const LETTER_HORIZONTAL:int = 0;
public function ConstructionCell(_arg1:int, _arg2:int){
_insertionStatus = ALLOW_BOTH;
_fillStatus = LETTER_NONE;
super();
_row = _arg1;
_column = _arg2;
}
public function isEmpty():Boolean{
return ((_fillStatus == LETTER_NONE));
}
public function getRow():int{
return (_row);
}
public function getColumn():int{
return (_column);
}
public function getInsertionStatus():int{
return (_insertionStatus);
}
public function setLetter(_arg1:String):void{
_letter = _arg1;
}
public function getFillStatus():int{
return (_fillStatus);
}
public function getLetter():String{
return (_letter);
}
public function setFillStatus(_arg1:int):void{
if ((((_arg1 == LETTER_HORIZONTAL)) && ((_fillStatus == LETTER_VERTICAL)))){
_fillStatus = LETTER_BOTH;
} else {
if ((((_arg1 == LETTER_VERTICAL)) && ((_fillStatus == LETTER_HORIZONTAL)))){
_fillStatus = LETTER_BOTH;
} else {
_fillStatus = _arg1;
};
};
}
public function setInsertionStatus(_arg1:int, _arg2:Boolean=false):void{
if (_arg2){
_insertionStatus = _arg1;
} else {
if (_insertionStatus != ALLOW_NONE){
if ((((_insertionStatus == ALLOW_HORIZONTAL)) && ((_arg1 == ALLOW_VERTICAL)))){
_insertionStatus = ALLOW_NONE;
} else {
if ((((_insertionStatus == ALLOW_VERTICAL)) && ((_arg1 == ALLOW_HORIZONTAL)))){
_insertionStatus = ALLOW_NONE;
} else {
_insertionStatus = _arg1;
};
};
};
};
}
}
}//package com.joelesler.rainwords
Section 10
//ConstructionPuzzle (com.joelesler.rainwords.ConstructionPuzzle)
package com.joelesler.rainwords {
public class ConstructionPuzzle {
private var _cells:Array;
private var _gridWidth:int;
private var _words:Array;
private var _gridHeight:int;
private var _wordSpaces:Array;
public static const ORIENTATION_HORIZONTAL:int = 0;
public static const ORIENTATION_VERTICAL:int = 1;
public function ConstructionPuzzle(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
var _local5:ConstructionCell;
_cells = new Array();
_words = new Array();
_wordSpaces = new Array();
super();
_gridWidth = _arg1;
_gridHeight = _arg2;
_local3 = 0;
while (_local3 < _gridHeight) {
_local4 = 0;
while (_local4 < _gridWidth) {
_local5 = new ConstructionCell(_local3, _local4);
_cells.push(_local5);
_local4++;
};
_local3++;
};
}
public function getWord(_arg1:int):String{
return (_words[_arg1]);
}
public function getGridHeight():int{
return (_gridHeight);
}
public function containsWord(_arg1:String):Boolean{
var _local2:*;
var _local3:int;
_local2 = _words.length;
_local3 = 0;
while (_local3 < _local2) {
if (_arg1 == _words[_local3]){
return (true);
};
_local3++;
};
return (false);
}
public function getWordSpaceCount():int{
return (_wordSpaces.length);
}
public function isInsertionValid(_arg1:String, _arg2:int, _arg3:int, _arg4:int):Boolean{
var _local5:int;
var _local6:ConstructionCell;
var _local7:Boolean;
if ((((_arg2 < 0)) || ((_arg2 >= _gridHeight)))){
return (false);
};
if ((((_arg3 < 0)) || ((_arg3 >= _gridWidth)))){
return (false);
};
_local7 = false;
if (_arg4 == ORIENTATION_HORIZONTAL){
if ((_arg3 + _arg1.length) > _gridWidth){
return (false);
};
_local6 = getCell(_arg2, (_arg3 - 1));
if (_local6){
if (_local6.isEmpty() == false){
return (false);
};
};
_local6 = getCell(_arg2, (_arg3 + _arg1.length));
if (_local6){
if (_local6.isEmpty() == false){
return (false);
};
};
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = getCell(_arg2, (_arg3 + _local5));
if (_local6.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
return (false);
};
if (_local6.getInsertionStatus() == ConstructionCell.ALLOW_VERTICAL){
return (false);
};
if (((!(_local6.isEmpty())) && (!((_local6.getLetter() == _arg1.charAt(_local5)))))){
return (false);
};
if (_local6.getFillStatus() == ConstructionCell.LETTER_VERTICAL){
_local7 = true;
};
_local5++;
};
} else {
if ((_arg2 + _arg1.length) > _gridHeight){
return (false);
};
_local6 = getCell((_arg2 - 1), _arg3);
if (_local6){
if (_local6.isEmpty() == false){
return (false);
};
};
_local6 = getCell((_arg2 + _arg1.length), _arg3);
if (_local6){
if (_local6.isEmpty() == false){
return (false);
};
};
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = getCell((_arg2 + _local5), _arg3);
if (_local6.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
return (false);
};
if (_local6.getInsertionStatus() == ConstructionCell.ALLOW_HORIZONTAL){
return (false);
};
if (((!(_local6.isEmpty())) && (!((_local6.getLetter() == _arg1.charAt(_local5)))))){
return (false);
};
if (_local6.getFillStatus() == ConstructionCell.LETTER_HORIZONTAL){
_local7 = true;
};
_local5++;
};
};
return (_local7);
}
public function getCell(_arg1:int, _arg2:int):ConstructionCell{
if ((((_arg1 < 0)) || ((_arg1 >= _gridHeight)))){
return (null);
};
if ((((_arg2 < 0)) || ((_arg2 >= _gridWidth)))){
return (null);
};
return (_cells[((_arg1 * _gridWidth) + _arg2)]);
}
public function insertWord(_arg1:String, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:ConstructionCell;
var _local6:WordSpace;
var _local7:int;
var _local8:int;
if ((((_arg2 < 0)) || ((_arg2 >= _gridHeight)))){
return;
};
if ((((_arg3 < 0)) || ((_arg3 >= _gridWidth)))){
return;
};
if (_arg4 == ORIENTATION_HORIZONTAL){
if ((_arg3 + _arg1.length) > _gridWidth){
return;
};
_local7 = 0;
while (_local7 < _arg1.length) {
_local5 = getCell(_arg2, (_arg3 + _local7));
_local5.setLetter(_arg1.charAt(_local7));
_local5.setFillStatus(ConstructionCell.LETTER_HORIZONTAL);
_local5.setInsertionStatus(ConstructionCell.ALLOW_VERTICAL, true);
_local5 = getCell((_arg2 - 1), (_arg3 + _local7));
if (_local5){
if (_local5.isEmpty()){
_local5.setInsertionStatus(ConstructionCell.ALLOW_VERTICAL);
};
};
_local5 = getCell((_arg2 + 1), (_arg3 + _local7));
if (_local5){
if (_local5.isEmpty()){
_local5.setInsertionStatus(ConstructionCell.ALLOW_VERTICAL);
};
};
_local7++;
};
_local5 = getCell(_arg2, (_arg3 - 1));
if (_local5){
_local5.setInsertionStatus(ConstructionCell.ALLOW_NONE);
};
_local5 = getCell(_arg2, (_arg3 + _arg1.length));
if (_local5){
_local5.setInsertionStatus(ConstructionCell.ALLOW_NONE);
};
_local6 = new WordSpace(_arg2, _arg3, _arg1.length, true);
} else {
if ((_arg2 + _arg1.length) > _gridHeight){
return;
};
_local8 = 0;
while (_local8 < _arg1.length) {
_local5 = getCell((_arg2 + _local8), _arg3);
_local5.setLetter(_arg1.charAt(_local8));
_local5.setFillStatus(ConstructionCell.LETTER_VERTICAL);
_local5.setInsertionStatus(ConstructionCell.ALLOW_HORIZONTAL, true);
_local5 = getCell((_arg2 + _local8), (_arg3 - 1));
if (_local5){
if (_local5.isEmpty()){
_local5.setInsertionStatus(ConstructionCell.ALLOW_HORIZONTAL);
};
};
_local5 = getCell((_arg2 + _local8), (_arg3 + 1));
if (_local5){
if (_local5.isEmpty()){
_local5.setInsertionStatus(ConstructionCell.ALLOW_HORIZONTAL);
};
};
_local8++;
};
_local5 = getCell((_arg2 - 1), _arg3);
if (_local5){
_local5.setInsertionStatus(ConstructionCell.ALLOW_NONE);
};
_local5 = getCell((_arg2 + _arg1.length), _arg3);
if (_local5){
_local5.setInsertionStatus(ConstructionCell.ALLOW_NONE);
};
_local6 = new WordSpace(_arg2, _arg3, _arg1.length, false);
};
_words.push(_arg1);
_wordSpaces.push(_local6);
}
public function getWordSpace(_arg1:int):WordSpace{
return (_wordSpaces[_arg1]);
}
public function getFillFactor():Number{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 0;
_local2 = _cells.length;
_local3 = 0;
while (_local3 < _local2) {
if (!_cells[_local3].isEmpty()){
_local1++;
};
_local3++;
};
return ((_local1 / _local2));
}
public function getWordCount():int{
return (_words.length);
}
public function getGridWidth():int{
return (_gridWidth);
}
public function debugDraw():void{
var _local1:*;
var _local2:String;
var _local3:*;
var _local4:ConstructionCell;
var _local5:String;
var _local6:int;
_local1 = 0;
while (_local1 < _gridHeight) {
_local2 = "";
_local3 = 0;
while (_local3 < _gridWidth) {
_local4 = getCell(_local1, _local3);
_local5 = _local4.getLetter();
if (!_local5){
_local6 = _local4.getInsertionStatus();
if (_local6 == ConstructionCell.ALLOW_BOTH){
_local5 = ".";
} else {
if (_local6 == ConstructionCell.ALLOW_HORIZONTAL){
_local5 = "-";
} else {
if (_local6 == ConstructionCell.ALLOW_VERTICAL){
_local5 = "|";
} else {
_local5 = "*";
};
};
};
};
_local2 = (_local2 + _local5);
_local2 = (_local2 + " ");
_local3++;
};
_local1++;
};
}
}
}//package com.joelesler.rainwords
Section 11
//Game (com.joelesler.rainwords.Game)
package com.joelesler.rainwords {
import flash.events.*;
import CMG_AS3.*;
import flash.text.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.net.*;
import flash.utils.*;
import flash.display.*;
public class Game extends Sprite {
private var _puzzleSize:String;
private var _wordFrame:WordFrame;
private var _now:int;
private var _submitTimeButton:SubmitTimeButton;
private var _mainMenuButton:MainMenuButton;
private var _winMessage:WinMessage;
private var _clueTextFormat:TextFormat;
private var _clueFactory:ClueFactory;
private var _generator:PuzzleGenerator;
private var _puzzle:Puzzle;
private var _heldClueAlpha;// = 0.5
private var _clueAreaWidth:Number;// = 210
private var _tweens:Array;
private var _clueMinVelocity:Number;// = 10
private var _playAgainButton:PlayAgainButton;
private var _moreGamesButton:MoreGames2Button;
private var _clueMaxVelocity:Number;// = 20
private var _minutes:int;
private var _puzzleView:PuzzleView;
private var _seconds:int;
private var _isPuzzleComplete:Boolean;
private var _clueAreaHeight:Number;// = 525
private var _background:Background;
private var _startTime:int;
private var _clues:Array;
private var _clueText:TextField;
private var _statusFrame:StatusFrame;
private var _heldClue:Clue;
private var _cellCursor:CellCursor;
private var _puzzleSolution:Puzzle;
public static const WIN:String = "Win";
public static const QUIT:String = "Quit";
private static var _instance:Game;
public function Game(){
_clueAreaWidth = 210;
_clueAreaHeight = 525;
_clueMinVelocity = 10;
_clueMaxVelocity = 20;
_heldClueAlpha = 0.5;
_background = new Background();
_cellCursor = new CellCursor();
_clueText = new TextField();
_clueTextFormat = new TextFormat();
_wordFrame = new WordFrame();
_mainMenuButton = new MainMenuButton();
_winMessage = new WinMessage();
_submitTimeButton = new SubmitTimeButton();
_playAgainButton = new PlayAgainButton();
_moreGamesButton = new MoreGames2Button();
_statusFrame = new StatusFrame();
super();
_generator = PuzzleGenerator.getInstance();
_generator.setVocabulary(Vocabulary.getInstance());
_clueFactory = ClueFactory.getInstance();
_now = getTimer();
addChild(_background);
_background.gotoAndStop(Random.getInt(1, _background.totalFrames));
_cellCursor.mouseEnabled = false;
addChild(_wordFrame);
_wordFrame.mouseEnabled = false;
addChild(_mainMenuButton);
_mainMenuButton.addEventListener(MouseEvent.CLICK, mainMenuButtonClickListener);
addChild(_clueText);
_clueText.mouseEnabled = false;
_clueTextFormat.font = "Arial";
_clueTextFormat.size = 18;
_clueTextFormat.color = 0xEEEEEE;
_clueTextFormat.align = TextFormatAlign.CENTER;
_submitTimeButton.addEventListener(MouseEvent.CLICK, submitTimeButtonClickListener);
_playAgainButton.addEventListener(MouseEvent.CLICK, playAgainButtonClickListener);
_moreGamesButton.addEventListener(MouseEvent.CLICK, moreGamesButtonClickListener);
addEventListener(Event.ADDED_TO_STAGE, addedToStageListener);
addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageListener);
addEventListener(MouseEvent.MOUSE_UP, mouseUpListener);
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveListener);
addEventListener(Game.WIN, gameWinListener);
_tweens = new Array();
}
private function updateCellCursor(_arg1:CellView):void{
var _local2:Array;
var _local3:int;
var _local4:WordSpace;
var _local5:CellView;
var _local6:CellView;
_local2 = _puzzle.getWordSpacesContainingCell(_arg1.getSource());
if (_heldClue){
_local3 = (_local2.length - 1);
while (_local3 >= 0) {
if (_local2[_local3].getLength() != _heldClue.getWord().length){
_local2.splice(_local3, 1);
} else {
if (_puzzle.isWordSpaceFilled(_local2[_local3])){
_local2.splice(_local3, 1);
};
};
_local3--;
};
if (_local2.length == 0){
return;
};
_local4 = _local2[0];
_local5 = _puzzleView.getCellView(_local4.getRow(), _local4.getColumn());
if (_local4.isHorizontal()){
_local6 = _puzzleView.getCellView(_local4.getRow(), ((_local4.getColumn() + _local4.getLength()) - 1));
} else {
_local6 = _puzzleView.getCellView(((_local4.getRow() + _local4.getLength()) - 1), _local4.getColumn());
};
_cellCursor.x = _local5.x;
_cellCursor.y = _local5.y;
if (_local4.isHorizontal()){
_cellCursor.width = ((_local6.x - _local5.x) + _local6.width);
_cellCursor.height = _local5.height;
} else {
_cellCursor.width = _local5.width;
_cellCursor.height = ((_local6.y - _local5.y) + _local6.height);
};
_puzzleView.addChild(_cellCursor);
} else {
_local3 = (_local2.length - 1);
while (_local3 >= 0) {
if (_puzzle.isWordSpaceFilled(_local2[_local3]) == false){
_local2.splice(_local3, 1);
};
_local3--;
};
if (_local2.length == 0){
return;
};
_local4 = _local2[0];
_local5 = _puzzleView.getCellView(_local4.getRow(), _local4.getColumn());
if (_local4.isHorizontal()){
_local6 = _puzzleView.getCellView(_local4.getRow(), ((_local4.getColumn() + _local4.getLength()) - 1));
} else {
_local6 = _puzzleView.getCellView(((_local4.getRow() + _local4.getLength()) - 1), _local4.getColumn());
};
_cellCursor.x = _local5.x;
_cellCursor.y = _local5.y;
if (_local4.isHorizontal()){
_cellCursor.width = ((_local6.x - _local5.x) + _local6.width);
_cellCursor.height = _local5.height;
} else {
_cellCursor.width = _local5.width;
_cellCursor.height = ((_local6.y - _local5.y) + _local6.height);
};
_puzzleView.addChild(_cellCursor);
};
}
private function addedToStageListener(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameListener);
positionChildren();
}
private function getClueByWord(_arg1:String):Clue{
var _local2:int;
var _local3:int;
_local2 = _clues.length;
_local3 = 0;
while (_local3 < _local2) {
if (_clues[_local3].getWord() == _arg1){
return (_clues[_local3]);
};
_local3++;
};
return (null);
}
private function clueMouseDownListener(_arg1:MouseEvent):void{
if (!_isPuzzleComplete){
pickUpClue(Clue(_arg1.target));
};
}
public function createNew(_arg1:String):void{
var _local2:CellView;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Clue;
var _local7:int;
var _local8:int;
var _local9:int;
this.clear();
if (this.contains(_winMessage)){
removeChild(_winMessage);
};
if (this.contains(_playAgainButton)){
removeChild(_playAgainButton);
};
if (this.contains(_submitTimeButton)){
removeChild(_submitTimeButton);
};
if (this.contains(_moreGamesButton)){
removeChild(_moreGamesButton);
};
if (this.contains(_statusFrame)){
removeChild(_statusFrame);
};
if (_arg1 == "small"){
_puzzleSolution = _generator.generatePuzzle(10, 10);
} else {
if (_arg1 == "medium"){
_puzzleSolution = _generator.generatePuzzle(15, 15);
} else {
if (_arg1 == "large"){
_puzzleSolution = _generator.generatePuzzle(20, 20);
} else {
return;
};
};
};
_puzzleSize = _arg1;
_isPuzzleComplete = false;
_puzzleSolution.debugDraw();
_puzzle = new Puzzle();
_puzzle.copy(_puzzleSolution);
_puzzle.clearLetters();
_puzzleView = new PuzzleView();
_puzzleView.setSource(_puzzle);
_puzzleView.addEventListener(MouseEvent.MOUSE_OUT, puzzleViewMouseOutListener);
addChild(_puzzleView);
_local3 = _puzzle.getGridHeight();
_local4 = _puzzle.getGridWidth();
_local5 = 0;
while (_local5 < _local3) {
_local9 = 0;
while (_local9 < _local4) {
_local2 = _puzzleView.getCellView(_local5, _local9);
if (_local2){
_local2.addEventListener(MouseEvent.MOUSE_OVER, cellViewMouseOverListener);
_local2.addEventListener(MouseEvent.MOUSE_UP, cellViewMouseUpListener);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, cellViewMouseDownListener);
};
_local9++;
};
_local5++;
};
_clues = new Array();
_local7 = _puzzle.getWordCount();
_local8 = 0;
while (_local8 < _local7) {
_local6 = _clueFactory.getClue(_puzzle.getWord(_local8));
if (_local6){
_local6.addEventListener(MouseEvent.MOUSE_DOWN, clueMouseDownListener);
_local6.alpha = 1;
_clues.push(_local6);
addChild(_local6);
};
_local8++;
};
_background.gotoAndStop(Random.getInt(1, _background.totalFrames));
_startTime = getTimer();
}
private function playAgainButtonClickListener(_arg1:MouseEvent):void{
createNew(_puzzleSize);
positionChildren();
}
private function mouseUpListener(_arg1:MouseEvent):void{
if (_heldClue){
dropClue();
};
}
private function submitTimeButtonClickListener(_arg1:MouseEvent):void{
var _local2:ScoreSubmitter;
var _local3:String;
removeChild(_submitTimeButton);
if (_puzzleSize == "small"){
ScoreSubmitter.gameId = 374;
ScoreSubmitter.gameValidationCode = "rain28f2a87e0ba0f1d3ba197a97d32d9228";
} else {
if (_puzzleSize == "medium"){
ScoreSubmitter.gameId = 375;
ScoreSubmitter.gameValidationCode = "rain4b194d475e673b40c33180b03282f431";
} else {
if (_puzzleSize == "large"){
ScoreSubmitter.gameId = 376;
ScoreSubmitter.gameValidationCode = "rain6fb3c8db7eb5103d58af16cbb609b321";
};
};
};
ScoreSubmitter.gameVersion = "1.0";
_local2 = new ScoreSubmitter();
_local2.addEventListener(ScoreSubmitter.SCORE_RESPONSE, onScoreResponse);
if (_minutes < 1){
_local3 = "00:";
} else {
if (_minutes < 10){
_local3 = (("0" + _minutes) + ":");
} else {
_local3 = (_minutes + ":");
};
};
if (_seconds < 1){
_local3 = (_local3 + "00");
} else {
if (_seconds < 10){
_local3 = (_local3 + ("0" + _seconds));
} else {
_local3 = (_local3 + _seconds);
};
};
_local2.submitScore(_winMessage.nameInput.text, _local3);
}
private function cellViewMouseOverListener(_arg1:MouseEvent):void{
if (!_isPuzzleComplete){
updateCellCursor(CellView(_arg1.currentTarget));
};
}
private function moreGamesButtonClickListener(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.crazymonkeygames.com"), "_BLANK");
}
private function dropClue():void{
_heldClue.stopDrag();
_heldClue.alpha = 1;
_heldClue.mouseEnabled = true;
_heldClue.setYVelocity(Random.getNumber(_clueMinVelocity, _clueMaxVelocity));
if (_heldClue.x < (_heldClue.width / 2)){
_heldClue.x = (_heldClue.width / 2);
} else {
if (_heldClue.x > (_clueAreaWidth - (_heldClue.width / 2))){
_heldClue.x = Random.getNumber((_heldClue.width / 2), (_clueAreaWidth - (_heldClue.width / 2)));
};
};
_heldClue = null;
_puzzleView.clearHighlight();
if (_puzzleView.contains(_cellCursor)){
_puzzleView.removeChild(_cellCursor);
};
_clueText.text = "";
}
private function enterFrameListener(_arg1:Event):void{
var _local2:Number;
var _local3:int;
var _local4:Clue;
var _local5:int;
_local2 = ((getTimer() - _now) / 1000);
_now = getTimer();
_local3 = _clues.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _clues[_local5];
if (_local4.y > (_clueAreaHeight + (_local4.height / 2))){
_local4.x = Random.getNumber((_local4.width / 2), (_clueAreaWidth - (_local4.width / 2)));
_local4.y = (_local4.height / -2);
_local4.setYVelocity(Random.getNumber(_clueMinVelocity, _clueMaxVelocity));
};
_local4.updatePosition(_local2);
_local5++;
};
}
private function positionChildren():void{
var _local1:int;
var _local2:int;
_local1 = _clues.length;
_local2 = 0;
while (_local2 < _local1) {
_clues[_local2].x = Random.getNumber((_clues[_local2].width / 2), (_clueAreaWidth - (_clues[_local2].width / 2)));
_clues[_local2].y = Random.getNumber((_clues[_local2].height / 2), (_clueAreaHeight - (_clues[_local2].height / 2)));
_clues[_local2].setYVelocity(Random.getNumber(_clueMinVelocity, _clueMaxVelocity));
_local2++;
};
_clueText.width = stage.stageWidth;
_clueText.x = 0;
_clueText.y = 1;
_wordFrame.x = Math.floor((stage.stageWidth / 2));
_wordFrame.y = 0;
_mainMenuButton.x = Math.floor((stage.stageWidth - ((_mainMenuButton.width / 2) + 20)));
_mainMenuButton.y = 0;
_puzzleView.y = Math.floor(((stage.stageHeight - (_puzzle.getGridHeight() * 24)) / 2));
_puzzleView.y = (_puzzleView.y + 11);
_puzzleView.x = (_puzzleView.y + (stage.stageWidth - stage.stageHeight));
_winMessage.x = -(_winMessage.width);
_winMessage.y = 25;
_submitTimeButton.x = -(_submitTimeButton.width);
_submitTimeButton.y = ((_winMessage.y + _winMessage.height) + 20);
_playAgainButton.x = -(_playAgainButton.width);
_playAgainButton.y = ((_submitTimeButton.y + _submitTimeButton.height) + 20);
_moreGamesButton.x = -(_moreGamesButton.width);
_moreGamesButton.y = ((_playAgainButton.y + _playAgainButton.height) + 20);
_statusFrame.x = (stage.stageWidth / 2);
_statusFrame.y = stage.stageHeight;
}
private function puzzleViewMouseOutListener(_arg1:MouseEvent):void{
if (_puzzleView.contains(_cellCursor)){
_puzzleView.removeChild(_cellCursor);
};
}
private function clear():void{
var _local1:CellView;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((_puzzle) && (_puzzleView))){
_local2 = _puzzle.getGridHeight();
_local3 = _puzzle.getGridWidth();
_local4 = 0;
while (_local4 < _local2) {
_local5 = 0;
while (_local5 < _local3) {
_local1 = _puzzleView.getCellView(_local4, _local5);
if (_local1){
_local1.removeEventListener(MouseEvent.MOUSE_OVER, cellViewMouseOverListener);
_local1.removeEventListener(MouseEvent.MOUSE_UP, cellViewMouseUpListener);
_local1.removeEventListener(MouseEvent.MOUSE_DOWN, cellViewMouseDownListener);
};
_local5++;
};
_local4++;
};
};
if (_puzzleView){
_puzzleView.removeEventListener(MouseEvent.MOUSE_OUT, puzzleViewMouseOutListener);
if (this.contains(_puzzleView)){
removeChild(_puzzleView);
};
_puzzleView = null;
};
if (_clues){
_local6 = _clues.length;
_local7 = 0;
while (_local7 < _local6) {
_clues[_local7].removeEventListener(MouseEvent.MOUSE_DOWN, clueMouseDownListener);
if (this.contains(_clues[_local7])){
removeChild(_clues[_local7]);
};
_local7++;
};
_clues = null;
};
_puzzleSolution = null;
_puzzle = null;
_tweens = new Array();
}
private function pickUpClue(_arg1:Clue):void{
var _local2:String;
var _local3:int;
var _local4:WordSpace;
var _local5:*;
var _local6:int;
_arg1.startDrag(true);
_arg1.alpha = _heldClueAlpha;
_arg1.mouseEnabled = false;
_arg1.setYVelocity(0);
setChildIndex(_arg1, (numChildren - 1));
_heldClue = _arg1;
_local2 = _arg1.getWord();
_local3 = _local2.length;
_local5 = _puzzle.getWordSpaceCount();
_local6 = 0;
while (_local6 < _local5) {
_local4 = _puzzle.getWordSpace(_local6);
if ((((_local4.getLength() == _local3)) && ((_puzzle.isWordSpaceFilled(_local4) == false)))){
_puzzleView.highlight(_local4, _local2);
};
_local6++;
};
_clueText.text = _arg1.getWord().toUpperCase();
_clueText.setTextFormat(_clueTextFormat);
}
private function cellViewMouseDownListener(_arg1:MouseEvent):void{
if (!_isPuzzleComplete){
if (!_heldClue){
pickUpWord(CellView(_arg1.currentTarget));
};
};
}
private function mainMenuButtonClickListener(_arg1:MouseEvent):void{
dispatchEvent(new Event(Game.QUIT));
}
private function dropClueOnCellView(_arg1:CellView):void{
var _local2:Array;
var _local3:int;
var _local4:*;
_local2 = _puzzle.getWordSpacesContainingCell(_arg1.getSource());
_local3 = (_local2.length - 1);
for (;_local3 >= 0;_local3--) {
if (_local2[_local3].getLength() != _heldClue.getWord().length){
_local2.splice(_local3, 1);
} else {
if (_puzzle.isWordSpaceFilled(_local2[_local3])){
_local2.splice(_local3, 1);
continue;
};
};
};
if (_local2.length == 0){
dropClue();
return;
};
_local4 = _local2[0];
if (_puzzle.insertWord(_heldClue.getWord(), _local4)){
_heldClue.stopDrag();
_heldClue.mouseEnabled = true;
removeChild(_heldClue);
_heldClue = null;
_puzzleView.clearHighlight();
if (_puzzleView.contains(_cellCursor)){
_puzzleView.removeChild(_cellCursor);
};
if (_puzzle.isFull()){
dispatchEvent(new Event(Game.WIN));
};
} else {
dropClue();
};
_clueText.text = "";
}
private function onScoreResponse(_arg1:ServerResponseEvent):void{
switch (_arg1.returnCode){
case ScoreSubmitter.RETURNCODE_WORKING:
_statusFrame.submissionStatus.text = "Submitting...";
break;
case ScoreSubmitter.RETURNCODE_SUCCESS:
_statusFrame.submissionStatus.text = "Your score has been submitted!";
ScoreSubmitter.loadHighScorePage();
break;
case ScoreSubmitter.RETURNCODE_REJECTED:
_statusFrame.submissionStatus.text = "The server rejected your score!";
break;
case ScoreSubmitter.RETURNCODE_WRONGVERSION:
_statusFrame.submissionStatus.text = "This is the wrong version of the game. Check for the newest version at CrazyMonkeyGames.com";
ScoreSubmitter.loadUpdatePage();
break;
case ScoreSubmitter.RETURNCODE_NETWORKERROR:
_statusFrame.submissionStatus.text = "Your score could not reach the server at this time.";
break;
default:
_statusFrame.submissionStatus.text = ("Unknown error " + _arg1.returnCode);
break;
};
}
private function gameWinListener(_arg1:Event):void{
var _local2:int;
var _local3:Tween;
_isPuzzleComplete = true;
_local2 = ((getTimer() - _startTime) / 1000);
_minutes = Math.floor((_local2 / 60));
_seconds = (_local2 % 60);
addChild(_winMessage);
if (_minutes > 0){
_winMessage.timeTaken.text = (((_minutes + " minutes ") + _seconds) + " seconds");
} else {
_winMessage.timeTaken.text = (_seconds + " seconds");
};
_winMessage.nameInput.text = "player";
_winMessage.nameInput.restrict = "A-Za-z0-9";
_winMessage.nameInput.setSelection(0, _winMessage.nameInput.length);
stage.focus = _winMessage.nameInput;
addChild(_submitTimeButton);
addChild(_playAgainButton);
addChild(_moreGamesButton);
addChild(_statusFrame);
_statusFrame.submissionStatus.text = "";
_local3 = new Tween(_winMessage, "x", Strong.easeOut, _winMessage.x, 0, 1, true);
_tweens.push(_local3);
_local3 = new Tween(_playAgainButton, "x", Strong.easeOut, _playAgainButton.x, 0, 1.4, true);
_tweens.push(_local3);
_local3 = new Tween(_submitTimeButton, "x", Strong.easeOut, _submitTimeButton.x, 0, 1.2, true);
_tweens.push(_local3);
_local3 = new Tween(_moreGamesButton, "x", Strong.easeOut, _moreGamesButton.x, 0, 1.6, true);
_tweens.push(_local3);
}
private function removedFromStageListener(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
}
private function cellViewMouseUpListener(_arg1:MouseEvent):void{
if (_heldClue){
_arg1.stopPropagation();
dropClueOnCellView(CellView(_arg1.currentTarget));
};
}
private function pickUpWord(_arg1:CellView):void{
var _local2:Array;
var _local3:int;
var _local4:WordSpace;
var _local5:int;
var _local6:int;
var _local7:Cell;
var _local8:String;
var _local9:Clue;
var _local10:WordSpace;
_local2 = _puzzle.getWordSpacesContainingCell(_arg1.getSource());
_local3 = (_local2.length - 1);
while (_local3 >= 0) {
if (_puzzle.isWordSpaceFilled(_local2[_local3]) == false){
_local2.splice(_local3, 1);
};
_local3--;
};
if (_local2.length == 0){
return;
};
_local4 = _local2[0];
_local5 = _local4.getRow();
_local6 = _local4.getColumn();
_local8 = "";
_local3 = 0;
while (_local3 < _local4.getLength()) {
if (_local4.isHorizontal()){
_local7 = _puzzle.getCell(_local5, (_local6 + _local3));
} else {
_local7 = _puzzle.getCell((_local5 + _local3), _local6);
};
_local8 = (_local8 + _local7.getLetter());
_local3++;
};
if (_puzzle.containsWord(_local8) == false){
return;
};
_local3 = 0;
while (_local3 < _local4.getLength()) {
if (_local4.isHorizontal()){
_local7 = _puzzle.getCell(_local5, (_local6 + _local3));
} else {
_local7 = _puzzle.getCell((_local5 + _local3), _local6);
};
_local2 = _puzzle.getWordSpacesContainingCell(_local7);
if (_local2.length == 1){
_local7.setLetter("");
} else {
if (_local2[0].isHorizontal() != _local4.isHorizontal()){
_local10 = _local2[0];
} else {
_local10 = _local2[1];
};
if (_puzzle.isWordSpaceFilled(_local10) == false){
_local7.setLetter("");
};
};
_local3++;
};
_local9 = getClueByWord(_local8);
if (_local9 == null){
return;
};
addChild(_local9);
_local9.x = mouseX;
_local9.y = mouseY;
pickUpClue(_local9);
}
private function mouseMoveListener(_arg1:MouseEvent):void{
if (_heldClue){
_arg1.updateAfterEvent();
};
}
public static function getInstance():Game{
if (!_instance){
_instance = new (Game);
};
return (_instance);
}
}
}//package com.joelesler.rainwords
Section 12
//MainMenu (com.joelesler.rainwords.MainMenu)
package com.joelesler.rainwords {
import flash.events.*;
import CMG_AS3.*;
import flash.net.*;
import flash.utils.*;
import flash.display.*;
public class MainMenu extends Sprite {
private var _sizeMessage:ChooseSizeMessage;
private var _now:int;
private var _fastestTimesMediumButton:ScoresButton;
private var _credits:Credits;
private var _gameButtonSpacing:int;// = 25
private var _gameButtons:Array;
private var _title:Title;
private var _moreGamesButton:MoreGamesButton;
private var _fastestTimesSmallButton:ScoresButton;
private var _clueMinVelocity:Number;// = 10
private var _clueMaxVelocity:Number;// = 20
private var _fastestTimesLargeButton:ScoresButton;
private var _background:Background;
private var _clues:Array;
private static var _instance:MainMenu;
public function MainMenu(){
var _local1:int;
var _local2:MenuButton;
_background = new Background();
_clues = new Array();
_clueMinVelocity = 10;
_clueMaxVelocity = 20;
_title = new Title();
_credits = new Credits();
_moreGamesButton = new MoreGamesButton();
_fastestTimesSmallButton = new ScoresButton();
_fastestTimesMediumButton = new ScoresButton();
_fastestTimesLargeButton = new ScoresButton();
_sizeMessage = new ChooseSizeMessage();
_gameButtons = new Array();
_gameButtonSpacing = 25;
super();
addEventListener(Event.ADDED_TO_STAGE, addedToStageListener);
addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageListener);
_now = getTimer();
addChild(_background);
_background.gotoAndStop(1);
createBackgroundClues();
_local1 = 0;
while (_local1 < _clues.length) {
_clues[_local1].alpha = 0.5;
addChild(_clues[_local1]);
_local1++;
};
addChild(_title);
addChild(_credits);
addChild(_moreGamesButton);
_moreGamesButton.addEventListener(MouseEvent.CLICK, moreGamesButtonClickListener);
addChild(_fastestTimesSmallButton);
_fastestTimesSmallButton.addEventListener(MouseEvent.CLICK, fastestTimesSmallButtonClickListener);
addChild(_fastestTimesMediumButton);
_fastestTimesMediumButton.addEventListener(MouseEvent.CLICK, fastestTimesMediumButtonClickListener);
addChild(_fastestTimesLargeButton);
_fastestTimesLargeButton.addEventListener(MouseEvent.CLICK, fastestTimesLargeButtonClickListener);
addChild(_sizeMessage);
_local2 = new SmallGameButton();
_gameButtons.push(_local2);
_local2 = new MediumGameButton();
_gameButtons.push(_local2);
_local2 = new LargeGameButton();
_gameButtons.push(_local2);
_local1 = 0;
while (_local1 < _gameButtons.length) {
_gameButtons[_local1].addEventListener(MouseEvent.CLICK, gameButtonClickListener);
addChild(_gameButtons[_local1]);
_local1++;
};
}
private function moreGamesButtonClickListener(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.crazymonkeygames.com"), "_BLANK");
}
private function fastestTimesMediumButtonClickListener(_arg1:MouseEvent):void{
ScoreSubmitter.gameId = 375;
ScoreSubmitter.gameVersion = "1.0";
ScoreSubmitter.gameValidationCode = "rain4b194d475e673b40c33180b03282f431";
ScoreSubmitter.loadHighScorePage();
}
private function enterFrameListener(_arg1:Event):void{
var _local2:Number;
var _local3:int;
var _local4:Clue;
var _local5:int;
_local2 = ((getTimer() - _now) / 1000);
_now = getTimer();
_local3 = _clues.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _clues[_local5];
if (_local4.y > (stage.stageHeight + (_local4.height / 2))){
_local4.x = Random.getNumber((_local4.width / 2), (stage.stageWidth - (_local4.width / 2)));
_local4.y = (_local4.height / -2);
_local4.setYVelocity(Random.getNumber(_clueMinVelocity, _clueMaxVelocity));
};
_local4.updatePosition(_local2);
_local5++;
};
}
private function fastestTimesSmallButtonClickListener(_arg1:MouseEvent):void{
ScoreSubmitter.gameId = 374;
ScoreSubmitter.gameVersion = "1.0";
ScoreSubmitter.gameValidationCode = "rain28f2a87e0ba0f1d3ba197a97d32d9228";
ScoreSubmitter.loadHighScorePage();
}
private function createBackgroundClues():void{
var _local1:ClueFactory;
var _local2:Clue;
_local1 = ClueFactory.getInstance();
_local2 = _local1.getClue("banana");
_clues.push(_local2);
_local2 = _local1.getClue("kitten");
_clues.push(_local2);
_local2 = _local1.getClue("mug");
_clues.push(_local2);
_local2 = _local1.getClue("pentagon");
_clues.push(_local2);
_local2 = _local1.getClue("rainbow");
_clues.push(_local2);
_local2 = _local1.getClue("sock");
_clues.push(_local2);
_local2 = _local1.getClue("lightbulb");
_clues.push(_local2);
_local2 = _local1.getClue("magnet");
_clues.push(_local2);
_local2 = _local1.getClue("carrot");
_clues.push(_local2);
_local2 = _local1.getClue("strawberry");
_clues.push(_local2);
_local2 = _local1.getClue("guitar");
_clues.push(_local2);
}
private function removedFromStageListener(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
}
private function fastestTimesLargeButtonClickListener(_arg1:MouseEvent):void{
ScoreSubmitter.gameId = 376;
ScoreSubmitter.gameVersion = "1.0";
ScoreSubmitter.gameValidationCode = "rain6fb3c8db7eb5103d58af16cbb609b321";
ScoreSubmitter.loadHighScorePage();
}
private function addedToStageListener(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Clue;
addEventListener(Event.ENTER_FRAME, enterFrameListener);
_title.x = -37;
_title.y = -12;
_credits.x = 500;
_credits.y = 0;
_moreGamesButton.x = stage.stageWidth;
_moreGamesButton.y = 120;
_sizeMessage.x = stage.stageWidth;
_sizeMessage.y = 250;
_local2 = _gameButtons[0].width;
_local3 = _gameButtons.length;
_local4 = ((stage.stageWidth - ((_local3 * _local2) + ((_local3 - 1) * _gameButtonSpacing))) / 2);
_local5 = 0;
while (_local5 < _gameButtons.length) {
_gameButtons[_local5].x = Math.floor((_local4 + (_local5 * (_local2 + _gameButtonSpacing))));
_gameButtons[_local5].y = 310;
_local5++;
};
_fastestTimesSmallButton.x = _gameButtons[0].x;
_fastestTimesSmallButton.y = stage.stageHeight;
_fastestTimesMediumButton.x = _gameButtons[1].x;
_fastestTimesMediumButton.y = stage.stageHeight;
_fastestTimesLargeButton.x = _gameButtons[2].x;
_fastestTimesLargeButton.y = stage.stageHeight;
_local5 = 0;
while (_local5 < _clues.length) {
_local6 = _clues[_local5];
_local6.x = Random.getNumber((_local6.width / 2), (stage.stageWidth - (_local6.width / 2)));
_local6.y = Random.getNumber((_local6.height / 2), (stage.stageHeight - (_local6.height / 2)));
_clues[_local5].setYVelocity(Random.getNumber(_clueMinVelocity, _clueMaxVelocity));
_local5++;
};
}
private function gameButtonClickListener(_arg1:MouseEvent):void{
var _local2:MainMenuEvent;
_local2 = new MainMenuEvent(MainMenuEvent.REQUEST_GAME);
if ((_arg1.target is SmallGameButton)){
_local2.gameSize = "small";
} else {
if ((_arg1.target is MediumGameButton)){
_local2.gameSize = "medium";
} else {
if ((_arg1.target is LargeGameButton)){
_local2.gameSize = "large";
};
};
};
dispatchEvent(_local2);
}
public static function getInstance():MainMenu{
if (!_instance){
_instance = new (MainMenu);
};
return (_instance);
}
}
}//package com.joelesler.rainwords
Section 13
//MainMenuEvent (com.joelesler.rainwords.MainMenuEvent)
package com.joelesler.rainwords {
import flash.events.*;
public class MainMenuEvent extends Event {
public var gameSize:String;
public static const REQUEST_GAME:String = "requestGame";
public function MainMenuEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("MainMenuEvent", "type", "bubbles", "cancelable", "eventPhase", "gameSize"));
}
override public function clone():Event{
var _local1:MainMenuEvent;
_local1 = new MainMenuEvent(type, bubbles, cancelable);
_local1.gameSize = gameSize;
return (_local1);
}
}
}//package com.joelesler.rainwords
Section 14
//MenuButton (com.joelesler.rainwords.MenuButton)
package com.joelesler.rainwords {
import flash.events.*;
import flash.display.*;
public class MenuButton extends MovieClip {
public function MenuButton(){
stop();
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener);
addEventListener(MouseEvent.MOUSE_UP, mouseUpListener);
addEventListener(MouseEvent.MOUSE_OVER, mouseOverListener);
addEventListener(MouseEvent.MOUSE_OUT, mouseOutListener);
}
private function mouseUpListener(_arg1:MouseEvent):void{
gotoAndStop("over");
}
private function mouseOutListener(_arg1:MouseEvent):void{
gotoAndStop("up");
}
private function mouseDownListener(_arg1:MouseEvent):void{
gotoAndStop("down");
}
private function mouseOverListener(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
gotoAndStop("down");
} else {
gotoAndStop("over");
};
}
}
}//package com.joelesler.rainwords
Section 15
//Preloader (com.joelesler.rainwords.Preloader)
package com.joelesler.rainwords {
import flash.text.*;
import flash.display.*;
public class Preloader extends MovieClip {
private var _validDomain:String;// = "joelesler.com"
private var _percentText:TextField;
private var _isLockedToDomain:Boolean;// = false
private var _progressBar:ProgressBar;
public function Preloader(){
_percentText = new TextField();
_progressBar = new ProgressBar();
_isLockedToDomain = false;
_validDomain = "joelesler.com";
super();
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.showDefaultContextMenu = false;
}
}
}//package com.joelesler.rainwords
Section 16
//Puzzle (com.joelesler.rainwords.Puzzle)
package com.joelesler.rainwords {
public class Puzzle {
private var _cells:Array;
private var _gridWidth:int;// = 0
private var _words:Array;
private var _gridHeight:int;// = 0
private var _wordSpaces:Array;
public function Puzzle(){
_gridWidth = 0;
_gridHeight = 0;
super();
}
public function clearLetters():void{
var _local1:int;
var _local2:int;
_local1 = _cells.length;
_local2 = 0;
while (_local2 < _local1) {
if (_cells[_local2].isOpen()){
_cells[_local2].setLetter("");
};
_local2++;
};
}
public function getGridHeight():int{
return (_gridHeight);
}
public function containsWord(_arg1:String):Boolean{
var _local2:int;
var _local3:int;
_local2 = _words.length;
_local3 = 0;
while (_local3 < _local2) {
if (_words[_local3] == _arg1){
return (true);
};
_local3++;
};
return (false);
}
public function getWordSpaceCount():int{
return (_wordSpaces.length);
}
public function isWordSpaceFilled(_arg1:WordSpace):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local3 = _arg1.getLength();
_local4 = _arg1.getRow();
_local5 = _arg1.getColumn();
if (_arg1.isHorizontal()){
_local2 = 0;
while (_local2 < _local3) {
if (getCell(_local4, (_local5 + _local2)).getLetter() == ""){
return (false);
};
_local2++;
};
} else {
_local2 = 0;
while (_local2 < _local3) {
if (getCell((_local4 + _local2), _local5).getLetter() == ""){
return (false);
};
_local2++;
};
};
return (true);
}
public function isFull():Boolean{
var _local1:int;
var _local2:int;
_local1 = _cells.length;
_local2 = 0;
while (_local2 < _local1) {
if (((_cells[_local2].isOpen()) && ((_cells[_local2].getLetter() == "")))){
return (false);
};
_local2++;
};
return (true);
}
public function getCell(_arg1:int, _arg2:int):Cell{
if ((((_arg1 < 0)) || ((_arg1 >= _gridHeight)))){
return (null);
};
if ((((_arg2 < 0)) || ((_arg2 >= _gridWidth)))){
return (null);
};
return (_cells[((_arg1 * _gridWidth) + _arg2)]);
}
public function getWord(_arg1:int):String{
return (_words[_arg1]);
}
public function insertWord(_arg1:String, _arg2:WordSpace):Boolean{
var _local3:int;
var _local4:int;
var _local5:Cell;
var _local6:int;
if (_arg1.length != _arg2.getLength()){
return (false);
};
_local3 = _arg2.getRow();
_local4 = _arg2.getColumn();
_local6 = 0;
while (_local6 < _arg1.length) {
if (_arg2.isHorizontal()){
_local5 = getCell(_local3, (_local4 + _local6));
} else {
_local5 = getCell((_local3 + _local6), _local4);
};
if (((!(_local5)) || ((_local5.isOpen() == false)))){
return (false);
};
if (((!((_local5.getLetter() == ""))) && (!((_local5.getLetter() == _arg1.charAt(_local6)))))){
return (false);
};
_local6++;
};
_local6 = 0;
while (_local6 < _arg1.length) {
if (_arg2.isHorizontal()){
_local5 = getCell(_local3, (_local4 + _local6));
} else {
_local5 = getCell((_local3 + _local6), _local4);
};
_local5.setLetter(_arg1.charAt(_local6));
_local6++;
};
return (true);
}
public function getWordSpace(_arg1:int):WordSpace{
return (_wordSpaces[_arg1]);
}
public function getFillFactor():Number{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 0;
_local2 = _cells.length;
_local3 = 0;
while (_local3 < _local2) {
if (_cells[_local3].getLetter()){
_local1++;
};
_local3++;
};
return ((_local1 / _local2));
}
public function getWordCount():int{
return (_words.length);
}
public function getGridWidth():int{
return (_gridWidth);
}
public function copy(_arg1:Puzzle):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Cell;
_gridWidth = _arg1.getGridWidth();
_gridHeight = _arg1.getGridHeight();
_cells = new Array();
_local2 = 0;
while (_local2 < _gridHeight) {
_local6 = 0;
while (_local6 < _gridWidth) {
_local7 = new Cell(_local2, _local6, _arg1.getCell(_local2, _local6).isOpen());
if (_local7.isOpen()){
_local7.setLetter(_arg1.getCell(_local2, _local6).getLetter());
};
_cells.push(_local7);
_local6++;
};
_local2++;
};
_words = new Array();
_local3 = _arg1.getWordCount();
_local4 = 0;
while (_local4 < _local3) {
_words.push(_arg1.getWord(_local4));
_local4++;
};
_wordSpaces = new Array();
_local5 = _arg1.getWordSpaceCount();
_local4 = 0;
while (_local4 < _local5) {
_wordSpaces.push(_arg1.getWordSpace(_local4));
_local4++;
};
}
public function debugDraw():void{
var _local1:*;
var _local2:String;
var _local3:*;
var _local4:Cell;
var _local5:String;
_local1 = 0;
while (_local1 < _gridHeight) {
_local2 = "";
_local3 = 0;
while (_local3 < _gridWidth) {
_local4 = getCell(_local1, _local3);
_local5 = _local4.getLetter();
if (!_local5){
_local5 = " ";
};
_local2 = (_local2 + _local5);
_local2 = (_local2 + " ");
_local3++;
};
_local1++;
};
}
public function setData(_arg1:ConstructionPuzzle){
var _local2:Cell;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:String;
_gridWidth = _arg1.getGridWidth();
_gridHeight = _arg1.getGridHeight();
_cells = new Array();
_local3 = 0;
while (_local3 < _gridHeight) {
_local7 = 0;
while (_local7 < _gridWidth) {
_local8 = _arg1.getCell(_local3, _local7).getLetter();
if (_local8){
_local2 = new Cell(_local3, _local7, true);
_local2.setLetter(_local8);
} else {
_local2 = new Cell(_local3, _local7, false);
};
_cells.push(_local2);
_local7++;
};
_local3++;
};
_words = new Array();
_local4 = _arg1.getWordCount();
_local5 = 0;
while (_local5 < _local4) {
_words.push(_arg1.getWord(_local5));
_local5++;
};
_wordSpaces = new Array();
_local6 = _arg1.getWordSpaceCount();
_local5 = 0;
while (_local5 < _local6) {
_wordSpaces.push(_arg1.getWordSpace(_local5));
_local5++;
};
}
public function getWordSpacesContainingCell(_arg1:Cell):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Cell;
var _local6:Cell;
var _local7:int;
var _local8:int;
var _local9:Cell;
if (_arg1.isOpen() == false){
return ([]);
};
_local2 = new Array();
_local3 = _arg1.getRow();
_local4 = _arg1.getColumn();
_local5 = getCell(_local3, _local4);
_local7 = (_local4 - 1);
while (_local7 >= 0) {
_local6 = getCell(_local3, _local7);
if (_local6.isOpen() == false){
break;
};
_local5 = _local6;
_local7--;
};
_local8 = 1;
_local7 = (_local5.getColumn() + 1);
while (_local7 < _gridWidth) {
_local9 = getCell(_local3, _local7);
if (_local9.isOpen()){
_local8++;
} else {
break;
};
_local7++;
};
if (_local8 > 1){
_local2.push(new WordSpace(_local5.getRow(), _local5.getColumn(), _local8, true));
};
_local5 = getCell(_local3, _local4);
_local7 = (_local3 - 1);
while (_local7 >= 0) {
_local6 = getCell(_local7, _local4);
if (_local6.isOpen() == false){
break;
};
_local5 = _local6;
_local7--;
};
_local8 = 1;
_local7 = (_local5.getRow() + 1);
while (_local7 < _gridHeight) {
_local9 = getCell(_local7, _local4);
if (_local9.isOpen()){
_local8++;
} else {
break;
};
_local7++;
};
if (_local8 > 1){
_local2.push(new WordSpace(_local5.getRow(), _local5.getColumn(), _local8, false));
};
return (_local2);
}
}
}//package com.joelesler.rainwords
Section 17
//PuzzleGenerator (com.joelesler.rainwords.PuzzleGenerator)
package com.joelesler.rainwords {
import flash.utils.*;
public class PuzzleGenerator {
private var _generationTimeOut:int;// = 3000
private var _vocab:Vocabulary;
private var _timeTaken:int;// = 0
private var _insertionCycles:int;// = 500
private static var _instance:PuzzleGenerator;
public function PuzzleGenerator(){
_insertionCycles = 500;
_generationTimeOut = 3000;
_timeTaken = 0;
super();
}
public function generatePuzzle(_arg1:int, _arg2:int):Puzzle{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:String;
var _local8:ConstructionPuzzle;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Puzzle;
var _local14:int;
var _local15:ConstructionCell;
var _local16:RegExp;
var _local17:Array;
var _local18:String;
var _local19:String;
var _local20:ConstructionCell;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:Boolean;
var _local26:String;
var _local27:int;
var _local28:int;
var _local29:int;
var _local30:int;
var _local31:Array;
var _local32:Array;
var _local33:int;
if (!_vocab){
return (null);
};
_local3 = getTimer();
_local8 = new ConstructionPuzzle(_arg1, _arg2);
_local9 = _arg1;
if (_arg2 < _arg1){
_local9 = _arg2;
};
if (_local9 > _vocab.getMaxWordLength()){
_local9 = _vocab.getMaxWordLength();
};
_local10 = _vocab.getMinWordLength();
_local6 = getCandidates((_local9 - 2), _local9, _local8);
_local7 = _local6[Random.getInt(0, (_local6.length - 1))];
_local11 = Math.floor((_arg2 / 2));
_local4 = Random.getInt((_local11 - 2), (_local11 + 1));
_local5 = Random.getInt(0, (_arg1 - _local7.length));
_local8.insertWord(_local7, _local4, _local5, ConstructionPuzzle.ORIENTATION_HORIZONTAL);
_local12 = 0;
while (_local12 < _insertionCycles) {
_local14 = ConstructionPuzzle.ORIENTATION_HORIZONTAL;
if (Random.getInt(0, 1) == 0){
_local14 = ConstructionPuzzle.ORIENTATION_VERTICAL;
};
_local15 = getRandomIntersectCell(_local8, _local14);
if (_local15 == null){
} else {
_local17 = new Array();
_local18 = "";
_local21 = 1;
_local22 = 0;
_local23 = 0;
if (_local14 == ConstructionPuzzle.ORIENTATION_HORIZONTAL){
_local4 = _local15.getRow();
_local27 = _local15.getColumn();
_local5 = (_local15.getColumn() - 1);
while (_local5 >= 0) {
_local20 = _local8.getCell(_local4, _local5);
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
break;
};
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_VERTICAL){
break;
};
if (_local20.getFillStatus() == ConstructionCell.LETTER_VERTICAL){
_local21++;
};
_local27 = _local5;
_local5--;
};
_local28 = _local15.getColumn();
_local5 = (_local15.getColumn() + 1);
while (_local5 < _arg1) {
_local20 = _local8.getCell(_local4, _local5);
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
break;
};
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_VERTICAL){
break;
};
if (_local20.getFillStatus() == ConstructionCell.LETTER_VERTICAL){
_local21++;
};
_local28 = _local5;
_local5++;
};
_local5 = _local27;
while (_local5 <= _local28) {
_local19 = _local8.getCell(_local4, _local5).getLetter();
if (_local19 == null){
_local23++;
} else {
if (_local23 > 0){
if ((((_local22 == 0)) || ((_local22 >= _local21)))){
_local17.push((("\\w{0," + _local23) + "}"));
} else {
_local17.push((("\\w{" + _local23) + "}"));
};
_local23 = 0;
};
_local17.push(_local19);
_local22++;
};
_local5++;
};
if (_local23 > 0){
if ((((_local22 == 0)) || ((_local22 >= _local21)))){
_local17.push((("\\w{0," + _local23) + "}"));
} else {
_local17.push((("\\w{" + _local23) + "}"));
};
_local23 = 0;
};
_local9 = ((_local28 - _local27) + 1);
if (_local9 > _vocab.getMaxWordLength()){
_local9 = _vocab.getMaxWordLength();
};
} else {
_local5 = _local15.getColumn();
_local29 = _local15.getRow();
_local4 = (_local15.getRow() - 1);
while (_local4 >= 0) {
_local20 = _local8.getCell(_local4, _local5);
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
break;
};
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_HORIZONTAL){
break;
};
if (_local20.getFillStatus() == ConstructionCell.LETTER_HORIZONTAL){
_local21++;
};
_local29 = _local4;
_local4--;
};
_local30 = _local15.getRow();
_local4 = (_local15.getRow() + 1);
while (_local4 < _arg2) {
_local20 = _local8.getCell(_local4, _local5);
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_NONE){
break;
};
if (_local20.getInsertionStatus() == ConstructionCell.ALLOW_HORIZONTAL){
break;
};
if (_local20.getFillStatus() == ConstructionCell.LETTER_HORIZONTAL){
_local21++;
};
_local30 = _local4;
_local4++;
};
_local4 = _local29;
while (_local4 <= _local30) {
_local19 = _local8.getCell(_local4, _local5).getLetter();
if (_local19 == null){
_local23++;
} else {
if (_local23 > 0){
if ((((_local22 == 0)) || ((_local22 >= _local21)))){
_local17.push((("\\w{0," + _local23) + "}"));
} else {
_local17.push((("\\w{" + _local23) + "}"));
};
_local23 = 0;
};
_local17.push(_local19);
_local22++;
};
_local4++;
};
if (_local23 > 0){
if ((((_local22 == 0)) || ((_local22 >= _local21)))){
_local17.push((("\\w{0," + _local23) + "}"));
} else {
_local17.push((("\\w{" + _local23) + "}"));
};
_local23 = 0;
};
_local9 = ((_local30 - _local29) + 1);
if (_local9 > _vocab.getMaxWordLength()){
_local9 = _vocab.getMaxWordLength();
};
};
if (_local9 < 2){
} else {
_local18 = " ";
_local24 = 0;
while (_local24 < _local17.length) {
_local18 = (_local18 + _local17[_local24]);
_local24++;
};
_local18 = (_local18 + " ");
_local16 = new RegExp(_local18, "g");
if (_local8.getWordCount() < 4){
_local10 = (_local9 - 3);
} else {
_local10 = _vocab.getMinWordLength();
};
_local6 = getCandidates(_local10, _local9, _local8, _local16);
if (_local6.length == 0){
_local31 = getSubPatterns(_local17);
_local33 = 0;
while (_local33 < _local31.length) {
_local32 = getCandidates(_local10, _local9, _local8, _local31[_local33]);
_local6 = _local6.concat(_local32);
_local33++;
};
};
if (_local6.length == 0){
} else {
_local7 = _local6[Random.getInt(0, (_local6.length - 1))];
_local25 = false;
if (_local14 == ConstructionPuzzle.ORIENTATION_HORIZONTAL){
_local5 = _local27;
while (_local5 <= _local28) {
if (_local8.isInsertionValid(_local7, _local4, _local5, ConstructionPuzzle.ORIENTATION_HORIZONTAL)){
_local8.insertWord(_local7, _local4, _local5, ConstructionPuzzle.ORIENTATION_HORIZONTAL);
_local25 = true;
break;
};
_local5++;
};
if (!_local25){
_local26 = "Error in PuzzleGenerator:generatePuzzle(), insertion of \"";
_local26 = (_local26 + _local7);
_local26 = (_local26 + (("\" in row " + _local4) + " failed."));
};
} else {
_local4 = _local29;
while (_local4 <= _local30) {
if (_local8.isInsertionValid(_local7, _local4, _local5, ConstructionPuzzle.ORIENTATION_VERTICAL)){
_local8.insertWord(_local7, _local4, _local5, ConstructionPuzzle.ORIENTATION_VERTICAL);
_local25 = true;
break;
};
_local4++;
};
if (!_local25){
_local26 = "Error in PuzzleGenerator:generatePuzzle(), insertion of \"";
_local26 = (_local26 + _local7);
_local26 = (_local26 + (("\" in column " + _local5) + " failed."));
};
};
if ((getTimer() - _local3) > _generationTimeOut){
break;
};
};
};
};
_local12++;
};
_timeTaken = (getTimer() - _local3);
_local13 = new Puzzle();
_local13.setData(_local8);
return (_local13);
}
public function getTimeTaken():int{
return (_timeTaken);
}
private function getCandidates(_arg1:int, _arg2:int, _arg3:ConstructionPuzzle, _arg4:RegExp=null):Array{
var _local5:String;
var _local6:int;
var _local7:Array;
var _local8:int;
if (!_vocab){
return ([]);
};
if (_arg4 == null){
_arg4 = new RegExp(" [a-z]+ ", "g");
};
_local5 = "";
_local6 = _arg2;
while (_local6 >= _arg1) {
_local5 = (_local5 + (_vocab.getWordsByLength(_local6) + " "));
_local6--;
};
_local7 = _local5.match(_arg4);
_local8 = (_local7.length - 1);
while (_local8 >= 0) {
_local7[_local8] = _local7[_local8].substr(1, (_local7[_local8].length - 2));
if (_arg3.containsWord(_local7[_local8])){
_local7.splice(_local8, 1);
};
_local8--;
};
return (_local7);
}
private function getRandomIntersectCell(_arg1:ConstructionPuzzle, _arg2:int):ConstructionCell{
var _local3:int;
var _local4:int;
var _local5:ConstructionCell;
var _local6:Array;
var _local7:int;
var _local8:int;
if (_arg1.getWordCount() == 0){
return (null);
};
_local6 = new Array();
_local7 = _arg1.getGridHeight();
_local8 = _arg1.getGridWidth();
if (_arg2 == ConstructionPuzzle.ORIENTATION_HORIZONTAL){
_local3 = Random.getInt(0, (_local7 - 1));
_local4 = 0;
while (_local4 < _local8) {
_local5 = _arg1.getCell(_local3, _local4);
if (_local5.getFillStatus() == ConstructionCell.LETTER_VERTICAL){
_local6.push(_local5);
};
_local4++;
};
} else {
_local3 = Random.getInt(0, (_local8 - 1));
_local4 = 0;
while (_local4 < _local7) {
_local5 = _arg1.getCell(_local4, _local3);
if (_local5.getFillStatus() == ConstructionCell.LETTER_HORIZONTAL){
_local6.push(_local5);
};
_local4++;
};
};
if (_local6.length == 0){
return (null);
};
return (_local6[Random.getInt(0, (_local6.length - 1))]);
}
private function getSubPatterns(_arg1:Array):Array{
var _local2:Array;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:*;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:String;
var _local16:RegExp;
var _local17:String;
_local2 = new Array();
_local3 = 0;
_local4 = new Array();
_local5 = _arg1.length;
_local6 = 0;
while (_local6 < _local5) {
if (_arg1[_local6].length == 1){
_local3++;
_local4.push(_local6);
};
_local6++;
};
_local6 = (_local3 - 1);
while (_local6 > 0) {
_local7 = 0;
while (_local7 <= (_local3 - _local6)) {
_local9 = (_local4[_local7] - 1);
if (_local9 < 0){
_local9 = 0;
};
_local10 = (_local4[((_local7 + _local6) - 1)] + 1);
if (_local10 >= _local5){
_local10 = (_local5 - 1);
};
_local11 = new Array();
_local8 = _local9;
while (_local8 <= _local10) {
_local11.push(_arg1[_local8]);
_local8++;
};
_local17 = _local11[0];
if (_local17.length > 1){
if ((((_local17.indexOf(",") == -1)) && (!((_local17.indexOf("{") == -1))))){
_local12 = _local17.indexOf("{");
_local13 = _local17.indexOf("}");
_local14 = (int(_local17.substring((_local12 + 1), _local13)) - 1);
if (_local14 == 0){
_local11.shift();
} else {
_local11[0] = (((_local17.substring(0, (_local12 + 1)) + "0,") + _local14.toString()) + _local17.substring(_local13, _local17.length));
};
};
};
_local17 = _local11[(_local11.length - 1)];
if (_local17.length > 1){
if ((((_local17.indexOf(",") == -1)) && (!((_local17.indexOf("{") == -1))))){
_local12 = _local17.indexOf("{");
_local13 = _local17.indexOf("}");
_local14 = (int(_local17.substring((_local12 + 1), _local13)) - 1);
if (_local14 == 0){
_local11.pop();
} else {
_local11[(_local11.length - 1)] = (((_local17.substring(0, (_local12 + 1)) + "0,") + _local14.toString()) + _local17.substring(_local13, _local17.length));
};
};
};
_local15 = " ";
_local8 = 0;
while (_local8 < _local11.length) {
_local15 = (_local15 + _local11[_local8]);
_local8++;
};
_local15 = (_local15 + " ");
_local16 = new RegExp(_local15, "g");
_local2.push(_local16);
_local7++;
};
_local6--;
};
return (_local2);
}
public function setVocabulary(_arg1:Vocabulary):void{
_vocab = _arg1;
}
public static function getInstance():PuzzleGenerator{
if (!_instance){
_instance = new (PuzzleGenerator);
};
return (_instance);
}
}
}//package com.joelesler.rainwords
Section 18
//PuzzleView (com.joelesler.rainwords.PuzzleView)
package com.joelesler.rainwords {
import flash.events.*;
import flash.display.*;
public class PuzzleView extends Sprite {
private var _source:Puzzle;
private var _cellViews:Array;
private function positionGrid():void{
var _local1:int;
var _local2:int;
_local1 = _cellViews.length;
while (_local2 < _local1) {
if (_cellViews[_local2]){
_cellViews[_local2].position();
};
_local2++;
};
}
public function setSource(_arg1:Puzzle):void{
_source = _arg1;
createGrid();
positionGrid();
}
private function createGrid():void{
var _local1:Cell;
var _local2:CellView;
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:*;
_cellViews = new Array();
_local3 = _source.getGridHeight();
_local4 = _source.getGridWidth();
_local5 = 0;
while (_local5 < _local3) {
_local6 = 0;
while (_local6 < _local4) {
_local1 = _source.getCell(_local5, _local6);
if (_local1.isOpen()){
_local2 = new CellView(_local1);
_cellViews.push(_local2);
addChild(_local2);
} else {
_cellViews.push(null);
};
_local6++;
};
_local5++;
};
}
public function getCellView(_arg1:int, _arg2:int):CellView{
if ((((_arg1 < 0)) || ((_arg1 >= _source.getGridHeight())))){
return (null);
};
if ((((_arg2 < 0)) || ((_arg2 >= _source.getGridWidth())))){
return (null);
};
return (_cellViews[((_arg1 * _source.getGridWidth()) + _arg2)]);
}
public function highlight(_arg1:WordSpace, _arg2:String):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:CellView;
var _local7:String;
var _local8:int;
_local3 = _arg1.getLength();
_local4 = _arg1.getRow();
_local5 = _arg1.getColumn();
_local8 = 0;
while (_local8 < _local3) {
if (_arg1.isHorizontal()){
_local6 = getCellView(_local4, (_local5 + _local8));
} else {
_local6 = getCellView((_local4 + _local8), _local5);
};
_local7 = _local6.getSource().getLetter();
if (_local7 == ""){
_local6.setHighlight("blue");
} else {
if (_local7 == _arg2.charAt(_local8)){
_local6.setHighlight("green");
} else {
_local6.setHighlight("red");
};
};
_local8++;
};
}
public function clearHighlight():void{
var _local1:*;
var _local2:int;
_local1 = _cellViews.length;
_local2 = 0;
while (_local2 < _local1) {
if (_cellViews[_local2]){
_cellViews[_local2].setHighlight("normal");
};
_local2++;
};
}
}
}//package com.joelesler.rainwords
Section 19
//RainWords (com.joelesler.rainwords.RainWords)
package com.joelesler.rainwords {
import flash.events.*;
import flash.display.*;
public class RainWords extends Sprite {
private var _mainMenu:MainMenu;
private var _game:Game;
public function RainWords(){
_mainMenu = MainMenu.getInstance();
_game = Game.getInstance();
super();
addChild(_mainMenu);
_mainMenu.addEventListener(MainMenuEvent.REQUEST_GAME, requestGameListener);
_game.addEventListener(Game.QUIT, gameQuitListener);
}
private function requestGameListener(_arg1:MainMenuEvent):void{
_game.createNew(_arg1.gameSize);
removeChild(_mainMenu);
addChild(_game);
}
private function gameQuitListener(_arg1:Event):void{
removeChild(_game);
addChild(_mainMenu);
}
}
}//package com.joelesler.rainwords
Section 20
//Random (com.joelesler.rainwords.Random)
package com.joelesler.rainwords {
public class Random {
public static function getInt(_arg1:int, _arg2:int):int{
if (_arg1 > _arg2){
_arg1 = (_arg1 + _arg2);
_arg2 = (_arg1 - _arg2);
_arg1 = (_arg1 - _arg2);
};
return ((Math.floor((Math.random() * ((_arg2 + 1) - _arg1))) + _arg1));
}
public static function getNumber(_arg1:Number, _arg2:Number):Number{
if (_arg1 > _arg2){
_arg1 = (_arg1 + _arg2);
_arg2 = (_arg1 - _arg2);
_arg1 = (_arg1 - _arg2);
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
}
}//package com.joelesler.rainwords
Section 21
//Vocabulary (com.joelesler.rainwords.Vocabulary)
package com.joelesler.rainwords {
public class Vocabulary {
private var _minWordLength:int;
private var _wordsByLength:Array;
private var _words:Array;
private var _maxWordLength:int;
private static var _instance:Vocabulary;
public function Vocabulary(){
_words = new Array();
_wordsByLength = new Array();
super();
addWordData();
sortWordsByLength();
}
private function sortWordsByLength():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = _words.length;
_local3 = 0;
while (_local3 < _local1) {
_local2 = _words[_local3].length;
if (_local3 == 0){
_minWordLength = _local2;
_maxWordLength = _local2;
};
if (_wordsByLength[_local2] == null){
_wordsByLength[_local2] = ((" " + _words[_local3]) + " ");
if (_local2 < _minWordLength){
_minWordLength = _local2;
};
if (_local2 > _maxWordLength){
_maxWordLength = _local2;
};
} else {
_wordsByLength[_local2] = (_wordsByLength[_local2] + (_words[_local3] + " "));
};
_local3++;
};
}
public function getMinWordLength():int{
return (_minWordLength);
}
public function getWordsByLength(_arg1:int):String{
if (_wordsByLength[_arg1]){
return (_wordsByLength[_arg1]);
};
return ("");
}
public function getWordCount():int{
return (_words.length);
}
private function addWordData():void{
_words.push("mug", "pencil", "book", "screw", "shoe", "glasses", "torch");
_words.push("fire", "toothbrush", "battery", "ruler", "wrench", "surfboard", "telescope", "wool");
_words.push("box", "car", "horseshoe", "nail", "knife", "fork", "spoon");
_words.push("bicycle", "tree", "leaf", "clock", "moon", "sun", "house", "boat");
_words.push("cloud", "sock", "paintbrush", "telephone", "couch", "chair", "door", "flower");
_words.push("padlock", "key", "saucepan", "axe", "ladder", "rake", "mushroom");
_words.push("feather", "satellite", "rainbow", "lightbulb", "skateboard", "eye", "lamp");
_words.push("hat", "ball", "television", "camera", "cactus", "balloon", "hammer");
_words.push("magnet", "snowflake", "scalpel", "skull", "umbrella");
_words.push("brick", "compass", "match", "quaver", "racquet", "corkscrew");
_words.push("barrel", "paperclip", "broom", "crowbar", "bone");
_words.push("headphones", "cassette", "amp", "sword", "log", "plane", "flag");
_words.push("comb", "razor", "anchor", "canoe", "tyre", "heart");
_words.push("diamond", "bucket", "mail", "bell", "watch", "cigarette", "syringe");
_words.push("banana", "apple", "cherries", "milk", "cake", "bread", "bacon", "watermelon", "pumpkin");
_words.push("egg", "cheese", "carrot", "peanut", "lemon", "lime", "pineapple", "strawberry", "muffin");
_words.push("pear", "celery");
_words.push("guitar", "drum", "trumpet", "saxophone", "violin", "piano");
_words.push("square", "triangle", "circle", "pentagon", "hexagon", "octagon", "cube", "icosahedron");
_words.push("tetrahedron", "dodecahedron");
_words.push("puppy", "kitten", "monkey", "snake", "snail", "butterfly", "frog", "sheep", "owl");
_words.push("lion", "ant", "tiger", "penguin", "fox", "elephant", "panda", "bee", "fish", "duck");
_words.push("rabbit", "pig", "echidna", "platypus", "mouse");
_words.push("down", "left", "right", "north", "south", "east", "west");
_words.push("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine");
_words.push("australia", "canada", "britain", "ireland", "greenland", "antarctica", "africa");
_words.push("blue", "yellow", "red", "green", "orange", "purple");
}
public function getMaxWordLength():int{
return (_maxWordLength);
}
public static function getInstance():Vocabulary{
if (!_instance){
Vocabulary._instance = new (Vocabulary);
};
return (Vocabulary._instance);
}
}
}//package com.joelesler.rainwords
Section 22
//WordSpace (com.joelesler.rainwords.WordSpace)
package com.joelesler.rainwords {
public class WordSpace {
private var _length:int;
private var _isHorizontal:Boolean;
private var _column:int;
private var _row:int;
public function WordSpace(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean){
_row = _arg1;
_column = _arg2;
_length = _arg3;
_isHorizontal = _arg4;
}
public function isVertical():Boolean{
return (!(_isHorizontal));
}
public function getRow():int{
return (_row);
}
public function getColumn():int{
return (_column);
}
public function isHorizontal():Boolean{
return (_isHorizontal);
}
public function getLength():int{
return (_length);
}
}
}//package com.joelesler.rainwords
Section 23
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _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) * _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) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 24
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 25
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 26
//CMG_Logo_Animation_1 (rainwords_fla.CMG_Logo_Animation_1)
package rainwords_fla {
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.display.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class CMG_Logo_Animation_1 extends MovieClip {
public var CMG_MonkeyBlink:MovieClip;
public var CMG_HomePageLink:SimpleButton;
public var monkeyBlinkCheckTimer:Timer;
public var CMG_LoadingWidget:MovieClip;
public function CMG_Logo_Animation_1(){
addFrameScript(0, frame1, 80, frame81, 81, frame82);
}
public function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
function frame81(){
stop();
monkeyBlinkCheckTimer.addEventListener(TimerEvent.TIMER, onMonkeyBlinkCheckTimer);
monkeyBlinkCheckTimer.start();
}
function frame82(){
monkeyBlinkCheckTimer.stop();
MovieClip(parent).gotoAndStop(3);
}
public function onMouseUpHandler_CMGHomePageBtn(_arg1:MouseEvent):void{
goToUrl("http://www.crazymonkeygames.com");
}
function frame1(){
MovieClip(parent).stop();
CMG_HomePageLink.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler_CMGHomePageBtn);
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler_CMGLoader);
monkeyBlinkCheckTimer = new Timer(800);
}
public function onEnterFrameHandler_CMGLoader(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = CMG_HomePageLink.stage.loaderInfo.bytesLoaded;
_local3 = CMG_HomePageLink.stage.loaderInfo.bytesTotal;
CMG_LoadingWidget.CMG_LoadingBar.bar.scaleX = (_local2 / _local3);
if (_local2 == _local3){
CMG_LoadingWidget.nextFrame();
removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler_CMGLoader);
};
}
public function onMonkeyBlinkCheckTimer(_arg1:TimerEvent):void{
var _local2:Number;
_local2 = Math.random();
if (_local2 < 0.3){
CMG_MonkeyBlink.play();
};
}
}
}//package rainwords_fla
Section 27
//CMG_monkey_blink_19 (rainwords_fla.CMG_monkey_blink_19)
package rainwords_fla {
import flash.display.*;
public dynamic class CMG_monkey_blink_19 extends MovieClip {
public function CMG_monkey_blink_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package rainwords_fla
Section 28
//load_barMC_12 (rainwords_fla.load_barMC_12)
package rainwords_fla {
import flash.display.*;
public dynamic class load_barMC_12 extends MovieClip {
public var bar:MovieClip;
}
}//package rainwords_fla
Section 29
//Preloader_2 (rainwords_fla.Preloader_2)
package rainwords_fla {
import flash.events.*;
import flash.display.*;
public dynamic class Preloader_2 extends MovieClip {
public var CMG_LoadingBar:MovieClip;
public var play_btn:SimpleButton;
public function Preloader_2(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
play_btn.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler_CMGPlayBtn);
}
public function onMouseUpHandler_CMGPlayBtn(_arg1:MouseEvent):void{
MovieClip(parent).gotoAndStop(82);
}
}
}//package rainwords_fla
Section 30
//AfricaClue (AfricaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AfricaClue extends Clue {
}
}//package
Section 31
//AmpClue (AmpClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AmpClue extends Clue {
}
}//package
Section 32
//AnchorClue (AnchorClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AnchorClue extends Clue {
}
}//package
Section 33
//AntarcticaClue (AntarcticaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AntarcticaClue extends Clue {
}
}//package
Section 34
//AntClue (AntClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AntClue extends Clue {
}
}//package
Section 35
//AppleClue (AppleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AppleClue extends Clue {
}
}//package
Section 36
//AustraliaClue (AustraliaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AustraliaClue extends Clue {
}
}//package
Section 37
//AxeClue (AxeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class AxeClue extends Clue {
}
}//package
Section 38
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package
Section 39
//BaconClue (BaconClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BaconClue extends Clue {
}
}//package
Section 40
//BallClue (BallClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BallClue extends Clue {
}
}//package
Section 41
//BalloonClue (BalloonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BalloonClue extends Clue {
}
}//package
Section 42
//BananaClue (BananaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BananaClue extends Clue {
}
}//package
Section 43
//BarrelClue (BarrelClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BarrelClue extends Clue {
}
}//package
Section 44
//BatteryClue (BatteryClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BatteryClue extends Clue {
}
}//package
Section 45
//BeeClue (BeeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BeeClue extends Clue {
}
}//package
Section 46
//BellClue (BellClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BellClue extends Clue {
}
}//package
Section 47
//BicycleClue (BicycleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BicycleClue extends Clue {
}
}//package
Section 48
//BlueClue (BlueClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BlueClue extends Clue {
}
}//package
Section 49
//BoatClue (BoatClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BoatClue extends Clue {
}
}//package
Section 50
//BoneClue (BoneClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BoneClue extends Clue {
}
}//package
Section 51
//BookClue (BookClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BookClue extends Clue {
}
}//package
Section 52
//BoxClue (BoxClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BoxClue extends Clue {
}
}//package
Section 53
//BreadClue (BreadClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BreadClue extends Clue {
}
}//package
Section 54
//BrickClue (BrickClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BrickClue extends Clue {
}
}//package
Section 55
//BritainClue (BritainClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BritainClue extends Clue {
}
}//package
Section 56
//BroomClue (BroomClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BroomClue extends Clue {
}
}//package
Section 57
//BucketClue (BucketClue)
package {
import com.joelesler.rainwords.*;
public dynamic class BucketClue extends Clue {
}
}//package
Section 58
//ButterflyClue (ButterflyClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ButterflyClue extends Clue {
}
}//package
Section 59
//CactusClue (CactusClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CactusClue extends Clue {
}
}//package
Section 60
//CakeClue (CakeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CakeClue extends Clue {
}
}//package
Section 61
//CameraClue (CameraClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CameraClue extends Clue {
}
}//package
Section 62
//CanadaClue (CanadaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CanadaClue extends Clue {
}
}//package
Section 63
//CanoeClue (CanoeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CanoeClue extends Clue {
}
}//package
Section 64
//CarClue (CarClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CarClue extends Clue {
}
}//package
Section 65
//CarrotClue (CarrotClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CarrotClue extends Clue {
}
}//package
Section 66
//CassetteClue (CassetteClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CassetteClue extends Clue {
}
}//package
Section 67
//CeleryClue (CeleryClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CeleryClue extends Clue {
}
}//package
Section 68
//CellCursor (CellCursor)
package {
import flash.display.*;
public dynamic class CellCursor extends Sprite {
}
}//package
Section 69
//CellViewGraphic (CellViewGraphic)
package {
import flash.display.*;
public dynamic class CellViewGraphic extends MovieClip {
}
}//package
Section 70
//ChairClue (ChairClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ChairClue extends Clue {
}
}//package
Section 71
//CheeseClue (CheeseClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CheeseClue extends Clue {
}
}//package
Section 72
//CherriesClue (CherriesClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CherriesClue extends Clue {
}
}//package
Section 73
//ChooseSizeMessage (ChooseSizeMessage)
package {
import flash.display.*;
public dynamic class ChooseSizeMessage extends Sprite {
}
}//package
Section 74
//CigaretteClue (CigaretteClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CigaretteClue extends Clue {
}
}//package
Section 75
//CircleClue (CircleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CircleClue extends Clue {
}
}//package
Section 76
//ClockClue (ClockClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ClockClue extends Clue {
}
}//package
Section 77
//CloudClue (CloudClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CloudClue extends Clue {
}
}//package
Section 78
//CombClue (CombClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CombClue extends Clue {
}
}//package
Section 79
//CompassClue (CompassClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CompassClue extends Clue {
}
}//package
Section 80
//CorkscrewClue (CorkscrewClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CorkscrewClue extends Clue {
}
}//package
Section 81
//CouchClue (CouchClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CouchClue extends Clue {
}
}//package
Section 82
//Credits (Credits)
package {
import com.joelesler.rainwords.*;
public dynamic class Credits extends MenuButton {
}
}//package
Section 83
//CrowbarClue (CrowbarClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CrowbarClue extends Clue {
}
}//package
Section 84
//CubeClue (CubeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class CubeClue extends Clue {
}
}//package
Section 85
//DiamondClue (DiamondClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DiamondClue extends Clue {
}
}//package
Section 86
//DodecahedronClue (DodecahedronClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DodecahedronClue extends Clue {
}
}//package
Section 87
//DoorClue (DoorClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DoorClue extends Clue {
}
}//package
Section 88
//DownClue (DownClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DownClue extends Clue {
}
}//package
Section 89
//DrumClue (DrumClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DrumClue extends Clue {
}
}//package
Section 90
//DuckClue (DuckClue)
package {
import com.joelesler.rainwords.*;
public dynamic class DuckClue extends Clue {
}
}//package
Section 91
//EastClue (EastClue)
package {
import com.joelesler.rainwords.*;
public dynamic class EastClue extends Clue {
}
}//package
Section 92
//EchidnaClue (EchidnaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class EchidnaClue extends Clue {
}
}//package
Section 93
//EggClue (EggClue)
package {
import com.joelesler.rainwords.*;
public dynamic class EggClue extends Clue {
}
}//package
Section 94
//EightClue (EightClue)
package {
import com.joelesler.rainwords.*;
public dynamic class EightClue extends Clue {
}
}//package
Section 95
//ElephantClue (ElephantClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ElephantClue extends Clue {
}
}//package
Section 96
//EyeClue (EyeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class EyeClue extends Clue {
}
}//package
Section 97
//FeatherClue (FeatherClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FeatherClue extends Clue {
}
}//package
Section 98
//FireClue (FireClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FireClue extends Clue {
}
}//package
Section 99
//FishClue (FishClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FishClue extends Clue {
}
}//package
Section 100
//FiveClue (FiveClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FiveClue extends Clue {
}
}//package
Section 101
//FlagClue (FlagClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FlagClue extends Clue {
}
}//package
Section 102
//FlowerClue (FlowerClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FlowerClue extends Clue {
}
}//package
Section 103
//ForkClue (ForkClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ForkClue extends Clue {
}
}//package
Section 104
//FourClue (FourClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FourClue extends Clue {
}
}//package
Section 105
//FoxClue (FoxClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FoxClue extends Clue {
}
}//package
Section 106
//FrogClue (FrogClue)
package {
import com.joelesler.rainwords.*;
public dynamic class FrogClue extends Clue {
}
}//package
Section 107
//GlassesClue (GlassesClue)
package {
import com.joelesler.rainwords.*;
public dynamic class GlassesClue extends Clue {
}
}//package
Section 108
//GreenClue (GreenClue)
package {
import com.joelesler.rainwords.*;
public dynamic class GreenClue extends Clue {
}
}//package
Section 109
//GreenlandClue (GreenlandClue)
package {
import com.joelesler.rainwords.*;
public dynamic class GreenlandClue extends Clue {
}
}//package
Section 110
//GuitarClue (GuitarClue)
package {
import com.joelesler.rainwords.*;
public dynamic class GuitarClue extends Clue {
}
}//package
Section 111
//HammerClue (HammerClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HammerClue extends Clue {
}
}//package
Section 112
//HatClue (HatClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HatClue extends Clue {
}
}//package
Section 113
//HeadphonesClue (HeadphonesClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HeadphonesClue extends Clue {
}
}//package
Section 114
//HeartClue (HeartClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HeartClue extends Clue {
}
}//package
Section 115
//HexagonClue (HexagonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HexagonClue extends Clue {
}
}//package
Section 116
//HorseshoeClue (HorseshoeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HorseshoeClue extends Clue {
}
}//package
Section 117
//HouseClue (HouseClue)
package {
import com.joelesler.rainwords.*;
public dynamic class HouseClue extends Clue {
}
}//package
Section 118
//IcosahedronClue (IcosahedronClue)
package {
import com.joelesler.rainwords.*;
public dynamic class IcosahedronClue extends Clue {
}
}//package
Section 119
//IrelandClue (IrelandClue)
package {
import com.joelesler.rainwords.*;
public dynamic class IrelandClue extends Clue {
}
}//package
Section 120
//KeyClue (KeyClue)
package {
import com.joelesler.rainwords.*;
public dynamic class KeyClue extends Clue {
}
}//package
Section 121
//KittenClue (KittenClue)
package {
import com.joelesler.rainwords.*;
public dynamic class KittenClue extends Clue {
}
}//package
Section 122
//KnifeClue (KnifeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class KnifeClue extends Clue {
}
}//package
Section 123
//LadderClue (LadderClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LadderClue extends Clue {
}
}//package
Section 124
//LampClue (LampClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LampClue extends Clue {
}
}//package
Section 125
//LargeGameButton (LargeGameButton)
package {
import com.joelesler.rainwords.*;
public dynamic class LargeGameButton extends MenuButton {
}
}//package
Section 126
//LeafClue (LeafClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LeafClue extends Clue {
}
}//package
Section 127
//LeftClue (LeftClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LeftClue extends Clue {
}
}//package
Section 128
//LemonClue (LemonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LemonClue extends Clue {
}
}//package
Section 129
//LightbulbClue (LightbulbClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LightbulbClue extends Clue {
}
}//package
Section 130
//LimeClue (LimeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LimeClue extends Clue {
}
}//package
Section 131
//LionClue (LionClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LionClue extends Clue {
}
}//package
Section 132
//LogClue (LogClue)
package {
import com.joelesler.rainwords.*;
public dynamic class LogClue extends Clue {
}
}//package
Section 133
//MagnetClue (MagnetClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MagnetClue extends Clue {
}
}//package
Section 134
//MailClue (MailClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MailClue extends Clue {
}
}//package
Section 135
//MainMenuButton (MainMenuButton)
package {
import com.joelesler.rainwords.*;
public dynamic class MainMenuButton extends MenuButton {
}
}//package
Section 136
//MatchClue (MatchClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MatchClue extends Clue {
}
}//package
Section 137
//MediumGameButton (MediumGameButton)
package {
import com.joelesler.rainwords.*;
public dynamic class MediumGameButton extends MenuButton {
}
}//package
Section 138
//MilkClue (MilkClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MilkClue extends Clue {
}
}//package
Section 139
//MonkeyClue (MonkeyClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MonkeyClue extends Clue {
}
}//package
Section 140
//MoonClue (MoonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MoonClue extends Clue {
}
}//package
Section 141
//MoreGames2Button (MoreGames2Button)
package {
import com.joelesler.rainwords.*;
public dynamic class MoreGames2Button extends MenuButton {
}
}//package
Section 142
//MoreGamesButton (MoreGamesButton)
package {
import com.joelesler.rainwords.*;
public dynamic class MoreGamesButton extends MenuButton {
}
}//package
Section 143
//MouseClue (MouseClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MouseClue extends Clue {
}
}//package
Section 144
//MuffinClue (MuffinClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MuffinClue extends Clue {
}
}//package
Section 145
//MugClue (MugClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MugClue extends Clue {
}
}//package
Section 146
//MushroomClue (MushroomClue)
package {
import com.joelesler.rainwords.*;
public dynamic class MushroomClue extends Clue {
}
}//package
Section 147
//NailClue (NailClue)
package {
import com.joelesler.rainwords.*;
public dynamic class NailClue extends Clue {
}
}//package
Section 148
//NineClue (NineClue)
package {
import com.joelesler.rainwords.*;
public dynamic class NineClue extends Clue {
}
}//package
Section 149
//NorthClue (NorthClue)
package {
import com.joelesler.rainwords.*;
public dynamic class NorthClue extends Clue {
}
}//package
Section 150
//OctagonClue (OctagonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class OctagonClue extends Clue {
}
}//package
Section 151
//OneClue (OneClue)
package {
import com.joelesler.rainwords.*;
public dynamic class OneClue extends Clue {
}
}//package
Section 152
//OrangeClue (OrangeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class OrangeClue extends Clue {
}
}//package
Section 153
//OwlClue (OwlClue)
package {
import com.joelesler.rainwords.*;
public dynamic class OwlClue extends Clue {
}
}//package
Section 154
//PadlockClue (PadlockClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PadlockClue extends Clue {
}
}//package
Section 155
//PaintbrushClue (PaintbrushClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PaintbrushClue extends Clue {
}
}//package
Section 156
//PandaClue (PandaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PandaClue extends Clue {
}
}//package
Section 157
//PaperclipClue (PaperclipClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PaperclipClue extends Clue {
}
}//package
Section 158
//PeanutClue (PeanutClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PeanutClue extends Clue {
}
}//package
Section 159
//PearClue (PearClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PearClue extends Clue {
}
}//package
Section 160
//PencilClue (PencilClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PencilClue extends Clue {
}
}//package
Section 161
//PenguinClue (PenguinClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PenguinClue extends Clue {
}
}//package
Section 162
//PentagonClue (PentagonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PentagonClue extends Clue {
}
}//package
Section 163
//PianoClue (PianoClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PianoClue extends Clue {
}
}//package
Section 164
//PigClue (PigClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PigClue extends Clue {
}
}//package
Section 165
//PineappleClue (PineappleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PineappleClue extends Clue {
}
}//package
Section 166
//PlaneClue (PlaneClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PlaneClue extends Clue {
}
}//package
Section 167
//PlatypusClue (PlatypusClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PlatypusClue extends Clue {
}
}//package
Section 168
//PlayAgainButton (PlayAgainButton)
package {
import com.joelesler.rainwords.*;
public dynamic class PlayAgainButton extends MenuButton {
}
}//package
Section 169
//ProgressBar (ProgressBar)
package {
import flash.display.*;
public dynamic class ProgressBar extends MovieClip {
}
}//package
Section 170
//PumpkinClue (PumpkinClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PumpkinClue extends Clue {
}
}//package
Section 171
//PuppyClue (PuppyClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PuppyClue extends Clue {
}
}//package
Section 172
//PurpleClue (PurpleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class PurpleClue extends Clue {
}
}//package
Section 173
//QuaverClue (QuaverClue)
package {
import com.joelesler.rainwords.*;
public dynamic class QuaverClue extends Clue {
}
}//package
Section 174
//RabbitClue (RabbitClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RabbitClue extends Clue {
}
}//package
Section 175
//RacquetClue (RacquetClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RacquetClue extends Clue {
}
}//package
Section 176
//RainbowClue (RainbowClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RainbowClue extends Clue {
}
}//package
Section 177
//RakeClue (RakeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RakeClue extends Clue {
}
}//package
Section 178
//RazorClue (RazorClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RazorClue extends Clue {
}
}//package
Section 179
//RedClue (RedClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RedClue extends Clue {
}
}//package
Section 180
//RightClue (RightClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RightClue extends Clue {
}
}//package
Section 181
//RulerClue (RulerClue)
package {
import com.joelesler.rainwords.*;
public dynamic class RulerClue extends Clue {
}
}//package
Section 182
//SatelliteClue (SatelliteClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SatelliteClue extends Clue {
}
}//package
Section 183
//SaucepanClue (SaucepanClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SaucepanClue extends Clue {
}
}//package
Section 184
//SaxophoneClue (SaxophoneClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SaxophoneClue extends Clue {
}
}//package
Section 185
//ScalpelClue (ScalpelClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ScalpelClue extends Clue {
}
}//package
Section 186
//ScoresButton (ScoresButton)
package {
import com.joelesler.rainwords.*;
public dynamic class ScoresButton extends MenuButton {
}
}//package
Section 187
//ScrewClue (ScrewClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ScrewClue extends Clue {
}
}//package
Section 188
//SevenClue (SevenClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SevenClue extends Clue {
}
}//package
Section 189
//SheepClue (SheepClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SheepClue extends Clue {
}
}//package
Section 190
//ShoeClue (ShoeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ShoeClue extends Clue {
}
}//package
Section 191
//SixClue (SixClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SixClue extends Clue {
}
}//package
Section 192
//SkateboardClue (SkateboardClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SkateboardClue extends Clue {
}
}//package
Section 193
//SkullClue (SkullClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SkullClue extends Clue {
}
}//package
Section 194
//SmallGameButton (SmallGameButton)
package {
import com.joelesler.rainwords.*;
public dynamic class SmallGameButton extends MenuButton {
}
}//package
Section 195
//SnailClue (SnailClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SnailClue extends Clue {
}
}//package
Section 196
//SnakeClue (SnakeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SnakeClue extends Clue {
}
}//package
Section 197
//SnowflakeClue (SnowflakeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SnowflakeClue extends Clue {
}
}//package
Section 198
//SockClue (SockClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SockClue extends Clue {
}
}//package
Section 199
//SouthClue (SouthClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SouthClue extends Clue {
}
}//package
Section 200
//SpoonClue (SpoonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SpoonClue extends Clue {
}
}//package
Section 201
//SquareClue (SquareClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SquareClue extends Clue {
}
}//package
Section 202
//StatusFrame (StatusFrame)
package {
import flash.text.*;
import flash.display.*;
public dynamic class StatusFrame extends Sprite {
public var submissionStatus:TextField;
}
}//package
Section 203
//StrawberryClue (StrawberryClue)
package {
import com.joelesler.rainwords.*;
public dynamic class StrawberryClue extends Clue {
}
}//package
Section 204
//SubmitTimeButton (SubmitTimeButton)
package {
import com.joelesler.rainwords.*;
public dynamic class SubmitTimeButton extends MenuButton {
}
}//package
Section 205
//SunClue (SunClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SunClue extends Clue {
}
}//package
Section 206
//SurfboardClue (SurfboardClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SurfboardClue extends Clue {
}
}//package
Section 207
//SwordClue (SwordClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SwordClue extends Clue {
}
}//package
Section 208
//SyringeClue (SyringeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class SyringeClue extends Clue {
}
}//package
Section 209
//TelephoneClue (TelephoneClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TelephoneClue extends Clue {
}
}//package
Section 210
//TelescopeClue (TelescopeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TelescopeClue extends Clue {
}
}//package
Section 211
//TelevisionClue (TelevisionClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TelevisionClue extends Clue {
}
}//package
Section 212
//TetrahedronClue (TetrahedronClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TetrahedronClue extends Clue {
}
}//package
Section 213
//ThreeClue (ThreeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ThreeClue extends Clue {
}
}//package
Section 214
//TigerClue (TigerClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TigerClue extends Clue {
}
}//package
Section 215
//Title (Title)
package {
import flash.display.*;
public dynamic class Title extends Sprite {
}
}//package
Section 216
//ToothbrushClue (ToothbrushClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ToothbrushClue extends Clue {
}
}//package
Section 217
//TorchClue (TorchClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TorchClue extends Clue {
}
}//package
Section 218
//TreeClue (TreeClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TreeClue extends Clue {
}
}//package
Section 219
//TriangleClue (TriangleClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TriangleClue extends Clue {
}
}//package
Section 220
//TrumpetClue (TrumpetClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TrumpetClue extends Clue {
}
}//package
Section 221
//TwoClue (TwoClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TwoClue extends Clue {
}
}//package
Section 222
//TyreClue (TyreClue)
package {
import com.joelesler.rainwords.*;
public dynamic class TyreClue extends Clue {
}
}//package
Section 223
//UmbrellaClue (UmbrellaClue)
package {
import com.joelesler.rainwords.*;
public dynamic class UmbrellaClue extends Clue {
}
}//package
Section 224
//WatchClue (WatchClue)
package {
import com.joelesler.rainwords.*;
public dynamic class WatchClue extends Clue {
}
}//package
Section 225
//WatermelonClue (WatermelonClue)
package {
import com.joelesler.rainwords.*;
public dynamic class WatermelonClue extends Clue {
}
}//package
Section 226
//WestClue (WestClue)
package {
import com.joelesler.rainwords.*;
public dynamic class WestClue extends Clue {
}
}//package
Section 227
//WinMessage (WinMessage)
package {
import flash.text.*;
import flash.display.*;
public dynamic class WinMessage extends Sprite {
public var timeTaken:TextField;
public var nameInput:TextField;
}
}//package
Section 228
//ViolinClue (ViolinClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ViolinClue extends Clue {
}
}//package
Section 229
//WoolClue (WoolClue)
package {
import com.joelesler.rainwords.*;
public dynamic class WoolClue extends Clue {
}
}//package
Section 230
//WordFrame (WordFrame)
package {
import flash.display.*;
public dynamic class WordFrame extends Sprite {
}
}//package
Section 231
//WrenchClue (WrenchClue)
package {
import com.joelesler.rainwords.*;
public dynamic class WrenchClue extends Clue {
}
}//package
Section 232
//YellowClue (YellowClue)
package {
import com.joelesler.rainwords.*;
public dynamic class YellowClue extends Clue {
}
}//package
Section 233
//ZeroClue (ZeroClue)
package {
import com.joelesler.rainwords.*;
public dynamic class ZeroClue extends Clue {
}
}//package