Section 1
//btn_lvl1_11 (snakewords_fla.btn_lvl1_11)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl1_11 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 2
//btn_lvl10_21 (snakewords_fla.btn_lvl10_21)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl10_21 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 3
//btn_lvl11_22 (snakewords_fla.btn_lvl11_22)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl11_22 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 4
//btn_lvl12_23 (snakewords_fla.btn_lvl12_23)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl12_23 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 5
//btn_lvl13_24 (snakewords_fla.btn_lvl13_24)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl13_24 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 6
//btn_lvl14_25 (snakewords_fla.btn_lvl14_25)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl14_25 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 7
//btn_lvl15_26 (snakewords_fla.btn_lvl15_26)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl15_26 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 8
//btn_lvl16_27 (snakewords_fla.btn_lvl16_27)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl16_27 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 9
//btn_lvl17_28 (snakewords_fla.btn_lvl17_28)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl17_28 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 10
//btn_lvl18_29 (snakewords_fla.btn_lvl18_29)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl18_29 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 11
//btn_lvl2_13 (snakewords_fla.btn_lvl2_13)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl2_13 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 12
//btn_lvl3_14 (snakewords_fla.btn_lvl3_14)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl3_14 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 13
//btn_lvl4_15 (snakewords_fla.btn_lvl4_15)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl4_15 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 14
//btn_lvl5_16 (snakewords_fla.btn_lvl5_16)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl5_16 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 15
//btn_lvl6_17 (snakewords_fla.btn_lvl6_17)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl6_17 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 16
//btn_lvl7_18 (snakewords_fla.btn_lvl7_18)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl7_18 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 17
//btn_lvl8_19 (snakewords_fla.btn_lvl8_19)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl8_19 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 18
//btn_lvl9_20 (snakewords_fla.btn_lvl9_20)
package snakewords_fla {
import flash.display.*;
public dynamic class btn_lvl9_20 extends MovieClip {
public var shade:MovieClip;
}
}//package snakewords_fla
Section 19
//GameLevel1_31 (snakewords_fla.GameLevel1_31)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel1_31 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 20
//GameLevel10_49 (snakewords_fla.GameLevel10_49)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel10_49 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 21
//GameLevel11_50 (snakewords_fla.GameLevel11_50)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel11_50 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 22
//GameLevel12_51 (snakewords_fla.GameLevel12_51)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel12_51 extends MovieClip {
public var letter9:MovieClip;
public var letter20:MovieClip;
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter14:MovieClip;
public var letter15:MovieClip;
public var letter17:MovieClip;
public var letter18:MovieClip;
public var letter19:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter16:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter12:MovieClip;
public var letter13:MovieClip;
public var letter8:MovieClip;
public var letter1:MovieClip;
public var letter11:MovieClip;
}
}//package snakewords_fla
Section 23
//GameLevel13_52 (snakewords_fla.GameLevel13_52)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel13_52 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 24
//GameLevel14_53 (snakewords_fla.GameLevel14_53)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel14_53 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 25
//GameLevel15_54 (snakewords_fla.GameLevel15_54)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel15_54 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter11:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 26
//GameLevel16_55 (snakewords_fla.GameLevel16_55)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel16_55 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 27
//GameLevel17_56 (snakewords_fla.GameLevel17_56)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel17_56 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter14:MovieClip;
public var letter15:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter16:MovieClip;
public var letter9:MovieClip;
public var letter11:MovieClip;
public var letter12:MovieClip;
public var letter13:MovieClip;
public var letter8:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 28
//GameLevel18_57 (snakewords_fla.GameLevel18_57)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel18_57 extends MovieClip {
public var letter9:MovieClip;
public var letter20:MovieClip;
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter14:MovieClip;
public var letter15:MovieClip;
public var letter17:MovieClip;
public var letter18:MovieClip;
public var letter19:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter16:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter12:MovieClip;
public var letter13:MovieClip;
public var letter8:MovieClip;
public var letter1:MovieClip;
public var letter11:MovieClip;
public var letter21:MovieClip;
}
}//package snakewords_fla
Section 29
//GameLevel2_38 (snakewords_fla.GameLevel2_38)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel2_38 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter11:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 30
//GameLevel3_39 (snakewords_fla.GameLevel3_39)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel3_39 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 31
//GameLevel4_40 (snakewords_fla.GameLevel4_40)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel4_40 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 32
//GameLevel5_42 (snakewords_fla.GameLevel5_42)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel5_42 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 33
//GameLevel6_44 (snakewords_fla.GameLevel6_44)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel6_44 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 34
//GameLevel7_46 (snakewords_fla.GameLevel7_46)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel7_46 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 35
//GameLevel8_47 (snakewords_fla.GameLevel8_47)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel8_47 extends MovieClip {
public var snakeHead:MovieClip;
public var letter10:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
public var letter9:MovieClip;
public var letter11:MovieClip;
public var letter8:MovieClip;
}
}//package snakewords_fla
Section 36
//GameLevel9_48 (snakewords_fla.GameLevel9_48)
package snakewords_fla {
import flash.display.*;
public dynamic class GameLevel9_48 extends MovieClip {
public var snakeHead:MovieClip;
public var letter2:MovieClip;
public var letter3:MovieClip;
public var letter4:MovieClip;
public var letter5:MovieClip;
public var letter6:MovieClip;
public var letter7:MovieClip;
public var letter1:MovieClip;
}
}//package snakewords_fla
Section 37
//helpBtn_5 (snakewords_fla.helpBtn_5)
package snakewords_fla {
import flash.display.*;
public dynamic class helpBtn_5 extends MovieClip {
public var info:MovieClip;
}
}//package snakewords_fla
Section 38
//Letters_32 (snakewords_fla.Letters_32)
package snakewords_fla {
import flash.display.*;
public dynamic class Letters_32 extends MovieClip {
public var inSnake:MovieClip;
public var inSolution:MovieClip;
}
}//package snakewords_fla
Section 39
//musicBtn_8 (snakewords_fla.musicBtn_8)
package snakewords_fla {
import flash.display.*;
public dynamic class musicBtn_8 extends MovieClip {
public function musicBtn_8(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package snakewords_fla
Section 40
//BonusHead (BonusHead)
package {
import flash.display.*;
public dynamic class BonusHead extends MovieClip {
}
}//package
Section 41
//BonusMin (BonusMin)
package {
import flash.display.*;
public dynamic class BonusMin extends MovieClip {
}
}//package
Section 42
//BonusSort (BonusSort)
package {
import flash.display.*;
public dynamic class BonusSort extends MovieClip {
}
}//package
Section 43
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local3 = true;
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local4 = true;
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 44
//MusicLoop (MusicLoop)
package {
import flash.media.*;
public dynamic class MusicLoop extends Sound {
}
}//package
Section 45
//SnakeWords (SnakeWords)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.geom.*;
public dynamic class SnakeWords extends MovieClip {
public var btn_lvl01:MovieClip;
public var btn_lvl02:MovieClip;
public var btn_lvl04:MovieClip;
public var btn_lvl05:MovieClip;
public var btn_lvl06:MovieClip;
public var btn_lvl08:MovieClip;
public var btn_lvl03:MovieClip;
public var btn_lvl07:MovieClip;
public var btn_lvl09:MovieClip;
public var btn_lvl10:MovieClip;
public var btn_lvl12:MovieClip;
public var btn_lvl13:MovieClip;
public var btn_lvl14:MovieClip;
public var btn_lvl15:MovieClip;
public var btn_lvl16:MovieClip;
public var btn_lvl17:MovieClip;
public var btn_lvl18:MovieClip;
private var s3:Array;
private var ab:Array;
private var s5:Array;
private var s7:Array;
private var s8:Array;
private var s1:Array;
public var btn_lvl11:MovieClip;
private var c3:Array;
private var c4:Array;
private var c5:Array;
private var c6:Array;
private var c7:Array;
private var c2:Array;
private var s2:Array;
private var s6:Array;
private var t3:String;// = "
The hardest part of this game is
the following rule:
The letters don't have to be picked
up in the right order, as long as
you can read the solution
on the screen.
You'll use all letters in this one."
private var c1:Array;
public var levelInfo:TextField;
private var t5:String;// = "
Another item you haven't
seen before:
Once you pick this item up,
your snake will reverse but
the head will stay put.
The word is a color as well
as chemical element #78."
private var t7:String;// = "
This type of road junction
is quite modern in the US.
A 'modern road junction'."
public var tip_field:TextField;
private var t1:String;// = "
Let's find some words!
This one is easy."
private var t2:String;// = "
This game will get more
difficult, for you don't
have to use all letters..."
private var t8:String;// = "
It seems like you'll have
to get rid of a lot of letters
before you'll find the answer."
private var s4:Array;
private var t4:String;// = "
This item will drop the last letter
so you can pick it up
again later on.
You'll have to find
the word yourself!"
private var c9:Array;
private var t6:String;// = "
Once you go in...
you can't get out.
Unless you're small enough,
or you can use this item."
private var c8:Array;
private var s9:Array;
public var btn_instructions:SimpleButton;
private var openLevels:uint;// = 1
private var solutions:Array;
private var mLoop:MusicLoop;
private var gameMode:String;// = "start"
private var t9:String;// = "
These always crawl up to
places hard to reach.
And so should you!"
private var combination:Array;
private var enterCode:Boolean;// = false
public var btn_back:SimpleButton;
private var fixedObjects:Array;
private var mPlaying:Boolean;// = true
private var mLoopChannel:SoundChannel;
private var cheatCodes:Array;
private var tips:Array;
public var btn_play:SimpleButton;
private var snakeHead:Object;
private var colorInterval:int;// = 750
public var mPlayBtn:MovieClip;
public var helpBtn:MovieClip;
private var solution:Array;
public var level:MovieClip;
private var snakeParts:Array;
private var t14:String;// = "
Lets try google
one more time.
The answer to life,
the universe
and everything."
private var t15:String;// = "
This beautiful creature
is a bird, but can't fly."
private var t16:String;// = "
According to me,
the most beautiful
name in the world."
private var t10:String;// = "
Time to turn it up a notch.
The word is something
typical Brittish."
private var t11:String;// = "
Remember Stunts with Skid ... ?
You might want to
google two words."
private var t12:String;// = "
Come on, sing along!
'So called Mr Rock And Roll
is ... on his own again'"
private var t13:String;// = "
Did you know?
The fear for the number 13 is called
TRISKAIDEKAPHOBIA"
private var playTheMusic;
private var t17:String;// = "
An area of operation or activity."
private var t18:String;// = "
A famous linguist once said
that of all the phrases
in the English language,
of all the endless combinations
of words in all of history,
this combination is
the most beautiful."
public var btn_reset:SimpleButton;
private var currentLevel:uint;
private var snakeTail:Array;
private var combinations:Array;
public var btn_credits:SimpleButton;
private var c10:Array;
private var c11:Array;
private var c13:Array;
private var c17:Array;
private var c18:Array;
private var c14:Array;
private var c15:Array;
private var c16:Array;
private var s10:Array;
private var s11:Array;
private var s13:Array;
private var s14:Array;
private var s15:Array;
private var s17:Array;
private var s18:Array;
private var s12:Array;
private var totalLevels:uint;// = 18
private var otherObjects:Array;
private var c12:Array;
private var s16:Array;
private var mVolume:Number;// = 0.3
private var mOldVol:Number;// = 0
static const gridSize:int = 20;
public function SnakeWords(){
colorInterval = 750;
ab = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
cheatCodes = ["array", "boolean", "class", "datatypes", "embedded", "functions", "garbage", "handling", "inheritance", "just-in-time", "keyboard-input", "listener", "methods", "namespace", "operators", "pre-multiplied", "qualifier"];
c1 = [5, 1, 19, 25];
s1 = [5, 1, 19, 25];
t1 = "\n\n\n Let's find some words!\n\n\t\t This one is easy.";
c2 = [4, 9, 6, 6, 9, 3, 21, 12, 20, 16, 26];
s2 = [4, 9, 6, 6, 9, 3, 21, 12, 20];
t2 = "\n\n\n This game will get more\n\t difficult, for you don't\n\t\t have to use all letters...";
c3 = [12, 5, 20, 20, 5, 18, 19];
s3 = [12, 5, 20, 20, 5, 18, 19];
t3 = "\n The hardest part of this game is\n\t the following rule:\n\n The letters don't have to be picked\n up in the right order, as long as\n you can read the solution\n\t on the screen.\n\n You'll use all letters in this one.";
c4 = [1, 16, 16, 12, 5];
s4 = [1, 16, 16, 12, 5];
t4 = "\n\n This item will drop the last letter\n\t so you can pick it up\n\t\t again later on.\n\n\t You'll have to find\n\t\t the word yourself!";
c5 = [16, 12, 1, 20, 9, 14, 21, 13, 22, 10];
s5 = [16, 12, 1, 20, 9, 14, 21, 13];
t5 = "\n\tAnother item you haven't\n\t\tseen before:\n\n Once you pick this item up,\n\t your snake will reverse but\n\t\t the head will stay put.\n\n\t The word is a color as well\n as chemical element #78.";
c6 = [5, 19, 3, 1, 16, 5];
s6 = [5, 19, 3, 1, 16, 5];
t6 = "\n\n\tOnce you go in...\n\t\t you can't get out.\n\n\n Unless you're small enough,\n\t\tor you can use this item.";
c7 = [18, 15, 21, 14, 4, 1, 2, 15, 21, 20];
s7 = [18, 15, 21, 14, 4, 1, 2, 15, 21, 20];
t7 = "\n\n\t This type of road junction\n\t is quite modern in the US.\n\n\n\t A 'modern road junction'.";
c8 = [1, 14, 20, 1, 1, 1, 1, 1, 1, 1, 1];
s8 = [1, 14, 20];
t8 = "\n\n It seems like you'll have\n\n\t to get rid of a lot of letters\n\n before you'll find the answer.";
c9 = [19, 16, 9, 4, 5, 18, 19];
s9 = [19, 16, 9, 4, 5, 18, 19];
t9 = "\n\n These always crawl up to\n\n\t\t places hard to reach.\n\n\n\t And so should you!";
c10 = [3, 8, 5, 1, 20, 19, 14, 15];
s10 = [20, 5, 1];
t10 = "\n\n\n\t Time to turn it up a notch.\n\n\n\tThe word is something\n\t\t\ttypical Brittish.";
c11 = [22, 9, 3, 9, 15, 21, 19, 24, 24];
s11 = [22, 9, 3, 9, 15, 21, 19];
t11 = "\n\n\n Remember Stunts with Skid ... ?\n\n\n\t\tYou might want to\n\t\t\tgoogle two words.";
c12 = [4, 1, 14, 3, 9, 14, 7, 12, 9, 22, 9, 14, 7, 19, 9, 14, 7, 9, 14, 7];
s12 = [4, 1, 14, 3, 9, 14, 7];
t12 = "\n\n\n Come on, sing along!\n\n\t 'So called Mr Rock And Roll\n\t is ... on his own again'";
c13 = [21, 14, 12, 21, 3, 11, 25];
s13 = [21, 14, 12, 21, 3, 11, 25];
t13 = "\n\n\t Did you know?\n\n The fear for the number 13 is called\n\n\t TRISKAIDEKAPHOBIA";
c14 = [6, 15, 18, 20, 25, 20, 23, 15];
s14 = [6, 15, 18, 20, 25, 20, 23, 15];
t14 = "\n\n\tLets try google\n\t one more time.\n\n\t\tThe answer to life,\n\t\t the universe\n\t\t\tand everything.";
c15 = [16, 5, 14, 7, 21, 9, 14, 4, 21, 3, 11];
s15 = [16, 5, 14, 7, 21, 9, 14];
t15 = "\n\n\n\tThis beautiful creature\n\n\t\t is a bird, but can't fly.";
c16 = [19, 15, 16, 8, 9, 5];
s16 = [19, 15, 16, 8, 9, 5];
t16 = "\n\n\n According to me,\n\n\t the most beautiful\n\n\t\t name in the world.";
c17 = [16, 12, 1, 25, 7, 18, 15, 21, 14, 4, 20, 26, 8, 12, 17, 5];
s17 = [16, 12, 1, 25, 7, 18, 15, 21, 14, 4];
t17 = "\n\n\n\n An area of operation or activity.";
c18 = [3, 5, 12, 12, 1, 18, 4, 15, 15, 18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
s18 = [3, 5, 12, 12, 1, 18, 4, 15, 15, 18];
t18 = "\n\n A famous linguist once said\n that of all the phrases\n\t in the English language,\n of all the endless combinations\n\t of words in all of history,\n this combination is\n\t the most beautiful.";
combinations = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18];
solutions = [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18];
tips = [t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18];
gameMode = "start";
openLevels = 1;
totalLevels = 18;
mLoop = new MusicLoop();
mPlaying = true;
mVolume = 0.3;
mOldVol = 0;
enterCode = false;
playTheMusic = playMusic();
super();
addFrameScript(0, frame1, 1, frame2, 10, frame11, 20, frame21, 30, frame31, 39, frame40, 40, frame41, 41, frame42, 42, frame43, 43, frame44, 44, frame45, 45, frame46, 46, frame47, 47, frame48, 48, frame49, 49, frame50, 50, frame51, 51, frame52, 52, frame53, 53, frame54, 54, frame55, 55, frame56, 56, frame57, 57, frame58);
}
public function fillLevelInfo(){
var _local1:*;
var _local2:uint;
var _local3:*;
_local1 = combination.concat();
_local2 = 0;
while (_local2 < _local1.length) {
_local1[_local2] = (" " + ab[(_local1[_local2] - 1)]);
_local2++;
};
_local1.sort();
if (currentLevel < 9){
_local3 = ("0" + (currentLevel + 1));
} else {
_local3 = ("" + (currentLevel + 1));
};
levelInfo.text = ((("Level " + _local3) + " -") + _local1);
}
function frame2(){
startGame();
stop();
}
public function btnReset(_arg1:MouseEvent):void{
MovieClip(root).gotoAndStop("levelSelect");
}
public function btnInstructions(_arg1:MouseEvent):void{
MovieClip(root).gotoAndStop("instructionScreen");
}
public function addLetter(_arg1){
snakeTail.splice(1, 0, snakeParts[_arg1]);
snakeParts[_arg1].mc.inSnake.visible = true;
snakeParts.splice(_arg1, 1);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"5c79b6582fccacb5", res:"700x400", background:4800267, color:10994976, outline:13494357, no_bg:true});
}
function frame11(){
btn_back.addEventListener(MouseEvent.CLICK, btnBack);
}
public function examineLevel(){
var _local1:int;
var _local2:*;
var _local3:Object;
fixedObjects = new Array();
otherObjects = new Array();
_local1 = 0;
while (_local1 < this.level.numChildren) {
_local2 = this.level.getChildAt(_local1);
if ((_local2 is Wall)){
_local3 = new Object();
_local3.mc = _local2;
fixedObjects.push(_local3);
} else {
if ((((((_local2 is BonusMin)) || ((_local2 is BonusHead)))) || ((_local2 is BonusSort)))){
otherObjects.push(_local2);
};
};
_local1++;
};
}
public function btnCredits(_arg1:MouseEvent):void{
MovieClip(root).gotoAndStop("creditScreen");
}
function frame40(){
stop();
levelSelect(currentLevel);
}
public function checkCombination(){
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (solution.length <= (snakeTail.length - 1)){
_local1 = 0;
while (_local1 < (snakeTail.length - 1)) {
_local2 = snakeTail.concat();
_local2.shift();
if (_local2[_local1].mc.currentFrame == solution[0]){
_local3 = _local2[_local1];
_local4 = new Point(_local2[_local1].mc.x, _local2[_local1].mc.y);
_local5 = solution.concat();
_local5.shift();
_local2.splice(_local1, 1);
_local6 = checkNextLetter(_local5, _local2, _local4, 2);
if (_local6){
_local3.mc.inSolNr = 1;
finishLevel();
break;
};
};
_local1++;
};
};
}
function frame43(){
startLevel(2);
stop();
}
function frame42(){
startLevel(1);
stop();
}
public function keyDownFunction(_arg1:KeyboardEvent){
if (enterCode == true){
if (levelInfo.text == "Enter level code"){
levelInfo.text = "";
levelInfo.appendText(String.fromCharCode(_arg1.charCode));
} else {
levelInfo.appendText(String.fromCharCode(_arg1.charCode));
};
};
if (_arg1.keyCode == 13){
if (enterCode == false){
enterCode = true;
levelInfo.text = "Enter level code";
} else {
checkPassword();
enterCode = false;
};
};
if (gameMode != "play"){
return;
};
if (_arg1.keyCode == 37){
tryMove(-1, 0);
} else {
if (_arg1.keyCode == 39){
tryMove(1, 0);
} else {
if (_arg1.keyCode == 38){
tryMove(0, -1);
} else {
if (_arg1.keyCode == 40){
tryMove(0, 1);
};
};
};
};
}
function frame46(){
startLevel(5);
stop();
}
function frame47(){
startLevel(6);
stop();
}
function frame49(){
startLevel(8);
stop();
}
public function tryMove(_arg1, _arg2){
var _local3:*;
if (!checkWalls(_arg1, _arg2)){
if (!checkTail(_arg1, _arg2)){
_local3 = checkLetters(_arg1, _arg2);
moveSnake(_arg1, _arg2, _local3);
};
};
}
function frame31(){
btn_back.addEventListener(MouseEvent.CLICK, btnBack);
btn_reset.addEventListener(MouseEvent.CLICK, btnReset);
gotoAndPlay("levelSelect");
enableLevelButtons();
}
public function startLevel(_arg1){
currentLevel = _arg1;
combination = combinations[currentLevel];
solution = solutions[currentLevel];
fillLevelInfo();
snakeTail = new Array();
createSnakeHead();
addSnakeParts();
examineLevel();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
tip_field.selectable = false;
tip_field.text = tips[currentLevel];
gameMode = "play";
}
public function finishLevel(){
drawSolution(1);
if ((currentLevel + 1) < totalLevels){
levelInfo.text = ((("Code for level " + (currentLevel + 2)) + ": ") + cheatCodes[currentLevel]);
};
if (openLevels < totalLevels){
openLevels++;
} else {
if ((currentLevel + 1) == totalLevels){
levelInfo.text = "Congratulations, you have finished the game!";
};
};
gameMode = "finished";
snakeTail[0].mc.visible = false;
enableLevelButtons();
}
public function checkNextLetter(_arg1, _arg2, _arg3, _arg4):Boolean{
var _local5:int;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
if (_arg1.length == 0){
return (true);
};
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = new Point(_arg2[_local5].mc.x, _arg2[_local5].mc.y);
if ((((_arg1[0] == _arg2[_local5].mc.currentFrame)) && ((Point.distance(_arg3, _local6) == 20)))){
_local7 = _arg2[_local5];
_local8 = _arg2.concat();
_local8.splice(_local5, 1);
_local9 = _arg1.concat();
_local9.shift();
_local10 = checkNextLetter(_local9, _local8, _local6, (_arg4 + 1));
if (_local10){
_local7.mc.inSolNr = _arg4;
return (true);
};
};
_local5++;
};
return (false);
}
function frame53(){
startLevel(12);
stop();
}
function frame41(){
startLevel(0);
stop();
}
function frame55(){
startLevel(14);
stop();
}
function frame56(){
startLevel(15);
stop();
}
function frame45(){
startLevel(4);
stop();
}
function frame52(){
startLevel(11);
stop();
}
function frame48(){
startLevel(7);
stop();
}
public function enableLevelButtons(){
var _local1:int;
var _local2:*;
var _local3:*;
_local1 = 0;
while (_local1 < openLevels) {
_local2 = _local1;
if (_local1 < 9){
_local2 = ("0" + (_local2 + 1));
} else {
_local2 = (_local2 + 1);
};
if (_local1 >= totalLevels){
break;
};
_local3 = new Object();
_local3.mc = root[("btn_lvl" + _local2)];
_local3.mc.buttonMode = true;
_local3.mc.shade.visible = false;
_local3.mc.addEventListener(MouseEvent.CLICK, jumpToLevel);
_local1++;
};
}
function frame57(){
startLevel(16);
stop();
}
function frame50(){
startLevel(9);
stop();
}
function frame44(){
startLevel(3);
stop();
}
function frame54(){
startLevel(13);
stop();
}
public function drawSolution(_arg1){
var i:uint;
var intID:*;
var colorNext:Function;
var rDepth = _arg1;
i = 0;
while (i < snakeTail.length) {
if (snakeTail[i].mc.inSolNr == rDepth){
colorNext = function (){
clearInterval(intID);
drawSolution((rDepth + 1));
};
snakeTail[i].mc.inSolution.visible = true;
intID = setInterval(colorNext, colorInterval);
};
i = (i + 1);
};
}
function frame51(){
startLevel(10);
stop();
}
function frame58(){
startLevel(17);
stop();
}
public function checkLetters(_arg1, _arg2){
var _local3:int;
_local3 = 0;
while (_local3 < snakeParts.length) {
if (((((snakeParts[_local3].mc.x - (gridSize * _arg1)) == snakeHead.mc.x)) && (((snakeParts[_local3].mc.y - (gridSize * _arg2)) == snakeHead.mc.y)))){
addLetter(_local3);
return (false);
};
_local3++;
};
return (true);
}
function frame21(){
btn_back.addEventListener(MouseEvent.CLICK, btnBack);
}
public function addSnakeParts(){
var _local1:int;
var _local2:*;
snakeParts = new Array();
_local1 = 1;
while (true) {
if (level[("letter" + _local1)] == null){
break;
};
_local2 = new Object();
_local2.mc = level[("letter" + _local1)];
_local2.mc.inSnake.visible = false;
_local2.mc.inSolution.visible = false;
_local2.mc.gotoAndStop(combination[(_local1 - 1)]);
snakeParts.push(_local2);
_local1++;
};
}
public function keyUpFunction(_arg1:KeyboardEvent){
if ((((((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 39)))) || ((_arg1.keyCode == 38)))) || ((_arg1.keyCode == 40)))) && ((gameMode == "play")))){
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
};
}
public function btnBack(_arg1:MouseEvent):void{
currentLevel = 0;
MovieClip(root).gotoAndStop("introScreen");
}
public function closeHelp(_arg1:Event):void{
helpBtn.info.visible = false;
}
public function playMusic():void{
mOldVol = 0;
mLoopChannel = mLoop.play(0, 1000);
mLoopChannel.soundTransform = new SoundTransform(0);
}
public function checkTail(_arg1, _arg2){
var _local3:int;
_local3 = 0;
while (_local3 < (snakeTail.length - 1)) {
if (((((snakeHead.mc.x + (gridSize * _arg1)) == snakeTail[_local3].mc.x)) && (((snakeHead.mc.y + (gridSize * _arg2)) == snakeTail[_local3].mc.y)))){
return (true);
};
_local3++;
};
return (false);
}
public function startGame(){
stage.addEventListener(Event.ENTER_FRAME, onEnterFrameListener);
btn_play.addEventListener(MouseEvent.CLICK, btnPlay);
btn_instructions.addEventListener(MouseEvent.CLICK, btnInstructions);
btn_credits.addEventListener(MouseEvent.CLICK, btnCredits);
mPlayBtn.addEventListener(MouseEvent.CLICK, pM);
helpBtn.addEventListener(MouseEvent.MOUSE_OVER, showHelp);
helpBtn.addEventListener(MouseEvent.MOUSE_OUT, closeHelp);
mPlayBtn.buttonMode = true;
helpBtn.buttonMode = true;
helpBtn.info.visible = false;
}
public function levelSelect(_arg1){
MovieClip(root).gotoAndStop(("level" + (_arg1 + 1)));
}
public function jumpToLevel(_arg1:MouseEvent):void{
var _local2:*;
_local2 = _arg1.target.name.substr(7, 2);
currentLevel = (_local2 - 1);
levelSelect(currentLevel);
}
public function createSnakeHead(){
snakeHead = new Object();
snakeHead.mc = level.snakeHead;
snakeTail.push(snakeHead);
}
public function onEnterFrameListener(_arg1:Event):void{
if ((((mPlaying == true)) && ((mLoopChannel.soundTransform.volume < mVolume)))){
mOldVol = (mOldVol + 0.004);
mLoopChannel.soundTransform = new SoundTransform(mOldVol);
} else {
if ((((mPlaying == false)) && ((mLoopChannel.soundTransform.volume > 0)))){
mOldVol = (mOldVol - 0.008);
mLoopChannel.soundTransform = new SoundTransform(mOldVol);
} else {
if ((((((mPlaying == false)) && ((mLoopChannel.soundTransform.volume <= 0)))) && ((mLoopChannel.soundTransform.volume > -0.2)))){
mLoopChannel.stop();
mLoopChannel.soundTransform = new SoundTransform(-0.3);
};
};
};
}
public function checkWalls(_arg1, _arg2){
var _local3:int;
_local3 = 0;
while (_local3 < fixedObjects.length) {
if (((((snakeHead.mc.x + (gridSize * _arg1)) == fixedObjects[_local3].mc.x)) && (((snakeHead.mc.y + (gridSize * _arg2)) == fixedObjects[_local3].mc.y)))){
return (true);
};
_local3++;
};
return (false);
}
public function showHelp(_arg1:Event):void{
helpBtn.info.visible = true;
}
public function checkPassword(){
var _local1:uint;
_local1 = 0;
while (_local1 < cheatCodes.length) {
if (levelInfo.text == cheatCodes[_local1]){
openLevels = (_local1 + 2);
levelInfo.text = ("Code accepted for level " + openLevels);
enableLevelButtons();
return;
};
_local1++;
};
fillLevelInfo();
if (gameMode == "finished"){
levelInfo.text = ((("Code for level " + (currentLevel + 2)) + ": ") + cheatCodes[currentLevel]);
};
}
public function btnPlay(_arg1:MouseEvent):void{
MovieClip(root).gotoAndStop("playScreen");
}
public function moveSnake(_arg1, _arg2, _arg3){
var _local4:int;
if (_arg3){
snakeHead.mc.x = (snakeHead.mc.x + (gridSize * _arg1));
snakeHead.mc.y = (snakeHead.mc.y + (gridSize * _arg2));
_local4 = (snakeTail.length - 1);
while (_local4 > 0) {
snakeTail[_local4].mc.x = snakeTail[(_local4 - 1)].mc.x;
snakeTail[_local4].mc.y = snakeTail[(_local4 - 1)].mc.y;
_local4--;
};
} else {
snakeHead.mc.x = (snakeHead.mc.x + (gridSize * _arg1));
snakeHead.mc.y = (snakeHead.mc.y + (gridSize * _arg2));
};
checkBonus();
checkCombination();
}
public function checkBonus(){
var _local1:int;
var _local2:*;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local8:Number;
_local1 = 0;
while (_local1 < otherObjects.length) {
if ((((otherObjects[_local1].x == snakeHead.mc.x)) && ((otherObjects[_local1].y == snakeHead.mc.y)))){
_local2 = (snakeTail.length - 1);
if (_local2 > 0){
if ((otherObjects[_local1] is BonusMin)){
snakeTail[_local2].mc.inSnake.visible = false;
snakeParts.push(snakeTail[_local2]);
snakeTail.pop();
} else {
if ((otherObjects[_local1] is BonusHead)){
snakeTail.push(snakeTail.shift());
snakeTail.reverse();
_local3 = 1;
while (_local3 <= Math.floor((snakeTail.length / 2))) {
_local4 = snakeTail[(snakeTail.length - _local3)].mc.x;
_local5 = snakeTail[(snakeTail.length - _local3)].mc.y;
snakeTail[(snakeTail.length - _local3)].mc.x = snakeTail[_local3].mc.x;
snakeTail[(snakeTail.length - _local3)].mc.y = snakeTail[_local3].mc.y;
snakeTail[_local3].mc.x = _local4;
snakeTail[_local3].mc.y = _local5;
_local3++;
};
snakeHead.mc.x = snakeTail[_local2].mc.x;
snakeHead.mc.y = snakeTail[_local2].mc.y;
snakeTail.push(snakeTail.shift());
snakeTail.reverse();
} else {
if ((otherObjects[_local1] is BonusSort)){
snakeTail.push(snakeTail.shift());
snakeTail.reverse();
_local6 = 1;
while (_local6 <= Math.floor((snakeTail.length / 2))) {
_local7 = snakeTail[(snakeTail.length - _local6)].mc.x;
_local8 = snakeTail[(snakeTail.length - _local6)].mc.y;
snakeTail[(snakeTail.length - _local6)].mc.x = snakeTail[_local6].mc.x;
snakeTail[(snakeTail.length - _local6)].mc.y = snakeTail[_local6].mc.y;
snakeTail[_local6].mc.x = _local7;
snakeTail[_local6].mc.y = _local8;
_local6++;
};
};
};
};
level.removeChild(otherObjects[_local1]);
otherObjects.splice(_local1, 1);
};
};
_local1++;
};
}
public function pM(_arg1:Event):void{
if (mPlaying){
mPlayBtn.gotoAndStop(2);
mPlaying = false;
} else {
playMusic();
mPlayBtn.gotoAndStop(1);
mPlaying = true;
};
}
}
}//package
Section 46
//Wall (Wall)
package {
import flash.display.*;
public dynamic class Wall extends MovieClip {
}
}//package