home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-09-27 | 39.2 KB | 1,305 lines |
- GS_Intro = new Object();
- GS_Intro.enter = function()
- {
- mLog("entering GS_Intro");
- stop();
- };
- GS_Intro.exit = function()
- {
- mLog("exiting GS_Intro");
- };
- GS_Intro.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnStop) ? false : _loc0_ == _loc1_)
- {
- play();
- }
- };
- GS_CharacterSelect1 = new Object();
- GS_CharacterSelect1.enter = function()
- {
- mLog("entering GS_CharacterSelect1");
- init();
- this.isRollOverOk = false;
- allGoTo("button_1");
- playSoundClip("s1_intro",false);
- iDelayer.addDelayedEvent(90,OnPlaySound,"s2_intro");
- iDelayer.addDelayedEvent(150,OnTimeOut);
- };
- GS_CharacterSelect1.exit = function()
- {
- mLog("exiting GS_CharacterSelect1");
- playSoundClip("s3_intro");
- iDelayer.removeEvent(OnPlaySound);
- };
- GS_CharacterSelect1.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCharacterSelect) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCharacterRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnAudioTimeout) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- this.isRollOverOk = true;
- }
- }
- else
- {
- playSoundClip(obj);
- if(obj eq "s2_intro")
- {
- iDelayer.addDelayedEvent(900,OnPlaySound,"s2_intro");
- }
- }
- }
- else
- {
- this.isRollOverOk = true;
- }
- }
- else if(this.isRollOverOk)
- {
- if(obj.myIndex == BORIS_INDEX)
- {
- playSoundClip("sBoris");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == MIFFY_INDEX)
- {
- playSoundClip("sMiffy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == POPPY_INDEX)
- {
- playSoundClip("sPoppy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == SNUFFY_INDEX)
- {
- playSoundClip("sSnuffy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- }
- }
- else
- {
- mLog("selecting Character = " + obj);
- selectCharacter(obj);
- switchState(GS_CharacterSelect2);
- }
- };
- GS_CharacterSelect2 = new Object();
- GS_CharacterSelect2.enter = function()
- {
- mLog("entering GS_CharacterSelect2");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(20,OnPlaySound,"s4_intro");
- iDelayer.addDelayedEvent(95,OnAudioTimeOut);
- };
- GS_CharacterSelect2.exit = function()
- {
- mLog("exiting GS_CharacterSelect2");
- iDelayer.removeEvent(OnPlaySound);
- playSoundClip("s5_intro");
- };
- GS_CharacterSelect2.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCharacterSelect) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCharacterRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnAudioTimeout) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_))
- {
- mLog("unkown event " + event);
- }
- }
- else
- {
- this.isRollOverOk = true;
- }
- }
- else if(this.isRollOverOk)
- {
- if(obj.myIndex == BORIS_INDEX)
- {
- playSoundClip("sBoris");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == MIFFY_INDEX)
- {
- playSoundClip("sMiffy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == POPPY_INDEX)
- {
- playSoundClip("sPoppy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- else if(obj.myIndex == SNUFFY_INDEX)
- {
- playSoundClip("sSnuffy");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- }
- }
- else
- {
- playSoundClip(obj);
- if(obj eq "s4_intro")
- {
- iDelayer.addDelayedEvent(900,OnPlaySound,"s4_intro");
- }
- }
- }
- else
- {
- mLog("selecting Character = " + obj);
- selectCharacter(obj);
- switchState(GS_Transition1);
- }
- };
- GS_Transition1 = new Object();
- GS_Transition1.enter = function()
- {
- mLog("entering GS_Transition1");
- this.hasAnimated = false;
- };
- GS_Transition1.exit = function()
- {
- mLog("exiting GS_Transition1");
- };
- GS_Transition1.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnStop) ? false : _loc0_ == _loc1_)
- {
- if(this.hasAnimated == false)
- {
- this.animate();
- }
- gotoAndPlay(96);
- }
- };
- GS_Transition1.animate = function()
- {
- this.hasAnimated = true;
- swapForStatic(SelectedCharacters[0]);
- swapForStatic(SelectedCharacters[1]);
- var tween1 = new Object();
- var tween2 = new Object();
- tween1.mc = SelectedCharacters[0];
- tween1.x = 265;
- tween1.y = 147;
- tween1.scale = 125;
- tween1.frames = 18;
- tween1.delay = 5;
- tween2.mc = SelectedCharacters[1];
- tween2.x = 512.3;
- tween2.y = 147;
- tween2.scale = 125;
- tween2.frames = 18;
- tween2.delay = 5;
- iTween.addTween(tween1);
- iTween.addTween(tween2);
- var i = 0;
- while(i < AllCharacters.length)
- {
- var mc = AllCharacters[i];
- if(mc != SelectedCharacters[0] && mc != SelectedCharacters[1])
- {
- mc.gotoAndPlay("popOff");
- }
- i++;
- }
- };
- GS_DisplayItems = new Object();
- GS_DisplayItems.enter = function()
- {
- mLog("entering GS_DisplayItems");
- playSoundClip("sTrillUpShort",false);
- if(CurrentRound == undefined)
- {
- CurrentRound = 1;
- }
- else
- {
- CurrentRound++;
- }
- this.displayItems();
- };
- GS_DisplayItems.exit = function()
- {
- mLog("exiting GS_DisplayItems");
- };
- GS_DisplayItems.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnDisplayItem) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnSwitchState) ? false : _loc0_ == _loc1_)
- {
- switchState(GS_AskIfSame);
- }
- }
- else
- {
- mLog("timeout");
- }
- }
- else
- {
- obj.gotoAndPlay("PopOn");
- }
- };
- ItemMax = 5;
- ItemMin = 1;
- YStart = 208;
- YIncrement = 45;
- XLeftStart = 358;
- XRightStart = 420;
- FrameIncrement = 3;
- FramesBetween = 5;
- FramesTillStart = 0;
- GS_DisplayItems.displayItems = function()
- {
- if(LeftItems == undefined)
- {
- LeftItems = new Array();
- }
- else
- {
- while(0 < LeftItems.length)
- {
- var mc = LeftItems.pop();
- mc.removeMovieClip();
- }
- }
- if(RightItems == undefined)
- {
- RightItems = new Array();
- }
- else
- {
- while(0 < RightItems.length)
- {
- var mc = RightItems.pop();
- mc.removeMovieClip();
- }
- }
- libItem = "lItem" + SelectedItem;
- var multiplier = ItemMax - ItemMin + 1;
- if(currentRound == 1)
- {
- var leftCount = ItemMin + Math.floor(Math.random() * multiplier);
- var rightCount = ItemMin + Math.floor(Math.random() * multiplier);
- if(rightCount < leftCount)
- {
- isLeftMaster = true;
- masterCount = leftCount;
- }
- else
- {
- isLeftMaster = false;
- masterCount = rightCount;
- }
- }
- else if(currentRound >= 3)
- {
- leftCount = masterCount;
- rightCount = masterCount;
- }
- else if(isLeftMaster)
- {
- leftCount = masterCount;
- rightCount = ItemMin + Math.floor(Math.random() * multiplier);
- }
- else
- {
- leftCount = ItemMin + Math.floor(Math.random() * multiplier);
- rightCount = masterCount;
- }
- mLog("CurrentRound = " + CurrentRound);
- this.placeItems(LeftItems,leftCount,XLeftStart,libItem);
- this.placeItems(RightItems,rightCount,XRightStart,libItem);
- var i = 0;
- while(i < LeftItems.length)
- {
- var delay = i * FrameIncrement + 1;
- iDelayer.addDelayedEvent(delay,onDisplayItem,LeftItems[i]);
- i++;
- }
- var i = 0;
- while(i < RightItems.length)
- {
- var delay = (i + LeftItems.length) * FrameIncrement + FramesBetween + 1;
- iDelayer.addDelayedEvent(delay,onDisplayItem,RightItems[i]);
- i++;
- }
- var numItemsCreated = LeftItems.length + RightItems.length;
- var delay = numItemsCreated * FrameIncrement + FramesBetween + FramesTillStart;
- iDelayer.addDelayedEvent(delay,OnSwitchState);
- };
- GS_DisplayItems.placeItems = function(itemArray, numItems, xStart, libItem)
- {
- var yLast = YStart;
- while(0 < numItems)
- {
- var mc = attachMC(libItem);
- mc._x = xStart;
- mc._y = yLast;
- itemArray.push(mc);
- yLast -= YIncrement;
- numItems--;
- }
- };
- GS_AskIfSame = new Object();
- GS_AskIfSame.enter = function()
- {
- mLog("enetering GS_AskIfSame");
- this.SentanceParts = new Array();
- if(CurrentRound == 1)
- {
- this.SentanceParts.push(eval("iS1a" + SelectedCharacterNames[0] + SelectedCharacterNames[1]));
- this.SentanceParts.push(eval("iS1b" + SelectedItem));
- eventNotify(OnSoundStop);
- }
- else
- {
- playSoundClip("s1d");
- iDelayer.addDelayedEvent(50,OnSoundStop);
- }
- };
- GS_AskIfSame.exit = function()
- {
- };
- GS_AskIfSame.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSwitchState) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- mLog("timeout");
- }
- }
- else
- {
- switchState(obj);
- }
- }
- else if(0 < this.SentanceParts.length)
- {
- var snd = this.SentanceParts.shift();
- snd.play();
- this.currentPlay = snd;
- }
- else if(LeftItems.length == RightItems.length)
- {
- iDelayer.addDelayedEvent(20,OnSwitchState,GS_GamePlaySame);
- }
- else
- {
- iDelayer.addDelayedEvent(20,OnSwitchState,GS_GamePlayDiff);
- }
- };
- GS_GamePlayDiff = new Object();
- GS_GamePlayDiff.enter = function()
- {
- mLog("entering GS_GamePlayDiff");
- this.isRollOverOk = false;
- this.startSpeaking();
- gotoAndPlay(186);
- };
- GS_GamePlayDiff.startSpeaking = function()
- {
- this.SentanceParts = new Array();
- playSoundClip("s2a");
- iDelayer.addDelayedEvent(110,OnPlaySound,"s2b");
- iDelayer.addDelayedEvent(250,OnTimeOut);
- };
- GS_GamePlayDiff.exit = function()
- {
- mLog("exiting GS_GamePlayDiff");
- };
- GS_GamePlayDiff.instructAgain = function()
- {
- this.startSpeaking();
- };
- GS_GamePlayDiff.eventNotify = function(event, obj)
- {
- mLog("event = " + event);
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedPush) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenPush) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- this.isRollOverOk = true;
- }
- }
- else
- {
- mLog("OnGreenPush");
- stopAllSounds();
- playSoundClip("sAreYouSure");
- iDelayer.removeEvent(OnPlaySound);
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(100,OnTimeOut);
- }
- }
- else
- {
- stopAllSounds();
- playSoundClip("sNotTheSame");
- iDelayer.removeEvent(OnPlaySound);
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- switchState(GS_WhoHasMore);
- }
- }
- else if(this.isRollOverOk)
- {
- stopAllSounds();
- playSoundClip("sGreenRoll");
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(40,OnTimeOut);
- }
- }
- else if(this.isRollOverOk)
- {
- stopAllSounds();
- playSoundClip("sRedRoll");
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(40,OnTimeOut);
- }
- }
- else
- {
- playSoundClip(obj);
- }
- }
- else
- {
- mLog("OnSoundStop");
- }
- };
- GS_WhoHasMore = new Object();
- GS_WhoHasMore.enter = function()
- {
- mLog("entering GS_WhoHasMore");
- this.isButtonsActive = false;
- this.isRollOverOk = false;
- this.isRoundOver = false;
- gotoAndPlay(196);
- iDelayer.addDelayedEvent(110,OnPlaySound);
- };
- GS_WhoHasMore.startSpeaking = function()
- {
- mLog("startSpeaking");
- this.SentanceParts = new Array();
- this.SentanceParts.push(iS3b);
- eventNotify(OnSoundStop);
- };
- GS_WhoHasMore.correctResponse = function(selectedindex)
- {
- swapForStatic2(SelectedCharacters[0].myIndex);
- swapForStatic2(SelectedCharacters[1].myIndex);
- while(0 < this.SentanceParts.length)
- {
- mLog("clearing sentance");
- this.SentanceParts.pop();
- }
- this.currentPlay.gotoAndStop(1);
- stopAllSounds();
- this.SentanceParts.push(iS4a);
- this.SentanceParts.push(eval("iS4b" + SelectedCharacterNames[selectedindex]));
- var otherIndex = Math.abs(selectedIndex - 1);
- this.SentanceParts.push(eval("iS4c" + SelectedCharacterNames[otherIndex]));
- this.SentanceParts.push(iS4d);
- eventNotify(OnSoundStop);
- this.isRoundOver = true;
- };
- GS_WhoHasMore.exit = function()
- {
- mLog("exiting GS_WhoHasMore");
- while(0 < LeftItems.length)
- {
- mLog("deleting leftItem");
- var mc = LeftItems.pop();
- mc.removeMovieClip();
- }
- while(0 < RightItems.length)
- {
- mLog("deleting RightItem");
- var mc = RightItems.pop();
- mc.removeMovieClip();
- }
- };
- GS_WhoHasMore.displayButtons = function()
- {
- if(this.isButtonsActive == false)
- {
- iDelayer.addDelayedEvent(1,OnButtonTrans,SelectedCharacters[0]);
- iDelayer.addDelayedEvent(8,OnButtonTrans,SelectedCharacters[1]);
- this.isButtonsActive = true;
- }
- };
- GS_WhoHasMore.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCharacterSelect) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnButtonTrans) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- mLog("timeout");
- }
- }
- else
- {
- swapForButton(obj.myIndex);
- }
- }
- else if(obj.myIndex == SelectedCharacters[0].myIndex && RightItems.length < LeftItems.length)
- {
- this.correctResponse(0);
- }
- else if(obj.myIndex == SelectedCharacters[1].myIndex && LeftItems.length < RightItems.length)
- {
- this.correctResponse(1);
- }
- else
- {
- playSoundClip("sAreYouSure");
- }
- }
- else
- {
- mLog("OnPlaySound");
- this.startSpeaking();
- }
- }
- else if(0 < this.SentanceParts.length)
- {
- var snd = this.SentanceParts.shift();
- snd.play();
- this.currentPlay = snd;
- }
- else if(this.isRoundOver)
- {
- mLog("switching State");
- switchState(GS_DisplayItems);
- }
- else
- {
- this.isRollOverOk = true;
- this.displayButtons();
- }
- };
- GS_GamePlaySame = new Object();
- GS_GamePlaySame.enter = function()
- {
- mLog("entering GS_GamePlaySame");
- this.isRollOverOk = false;
- this.startSpeaking();
- gotoAndPlay(186);
- };
- GS_GamePlaySame.startSpeaking = function()
- {
- this.SentanceParts = new Array();
- playSoundClip("s2a");
- iDelayer.addDelayedEvent(140,OnPlaySound,"s2b");
- iDelayer.addDelayedEvent(250,OnTimeOut);
- };
- GS_GamePlaySame.exit = function()
- {
- mLog("exiting GS_GamePlaySame");
- };
- GS_GamePlaySame.instructAgain = function()
- {
- this.startSpeaking();
- };
- GS_GamePlaySame.eventNotify = function(event, obj)
- {
- mLog("event = " + event);
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedPush) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenPush) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnDoJig) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSwitchState) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- this.isRollOverOk = true;
- }
- }
- else
- {
- switchState(GS_CountOffLeft);
- }
- }
- else
- {
- SelectedCharacters[0].gotoAndPlay("dance");
- SelectedCharacters[1].gotoAndPlay("dance");
- }
- }
- else
- {
- iDelayer.removeEvent(OnPlaySound);
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- playSoundClip("sTheSameResponse");
- iDelayer.addDelayedEvent(80,OnPlaySound,"sWeHaveTheSame");
- iDelayer.addDelayedEvent(130,OnPlaySound,"sWeHaveTheSame");
- iDelayer.addDelayedEvent(75,OnDoJig);
- iDelayer.addDelayedEvent(130,OnDoJig);
- gotoAndPlay(207);
- iDelayer.addDelayedEvent(180,OnSwitchState);
- }
- }
- else
- {
- playSoundClip("sAreYouSure");
- iDelayer.removeEvent(OnPlaySound);
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(100,OnTimeOut);
- }
- }
- else if(this.isRollOverOk)
- {
- playSoundClip("sGreenRoll");
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(40,OnTimeOut);
- }
- }
- else if(this.isRollOverOk)
- {
- playSoundClip("sRedRoll");
- iDelayer.removeEvent(OnTimeOut);
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(40,OnTimeOut);
- }
- }
- else
- {
- playSoundClip(obj);
- }
- }
- else
- {
- mLog("OnSoundStop");
- }
- };
- GS_CountOffLeft = new Object();
- GS_CountOffLeft.enter = function()
- {
- mLog("entering GS_CountOffLeft");
- this.isCountOffStarted = false;
- this.isCountOffOver = false;
- var snd = eval("is5a" + SelectedCharacterNames[0]);
- snd.play();
- iDelayer.addDelayedEvent(20,OnTransition1);
- gotoAndPlay(207);
- };
- GS_CountOffLeft.exit = function()
- {
- mLog("exiting GS_CountOffLeft");
- };
- GS_CountOffLeft.transition = function()
- {
- var tween1 = new Object();
- tween1.mc = SelectedCharacters[0];
- tween1.scale = 140;
- tween1.frames = 9;
- iTween.addTween(tween1);
- var tween2 = new Object();
- tween2.mc = SelectedCharacters[1];
- tween2.scale = 100;
- tween2.frames = 9;
- iTween.addTween(tween2);
- SelectedCharacters[1].gotoAndPlay("static");
- var i = 0;
- while(i < RightItems.length)
- {
- var tween = new Object();
- tween.mc = RightItems[i];
- tween.alpha = 33;
- tween.delay = 3;
- tween.frames = 6;
- iTween.addTween(tween);
- i++;
- }
- var i = 0;
- while(i < LeftItems.length)
- {
- var tween = new Object();
- tween.mc = LeftItems[i];
- tween.alpha = 100;
- tween.delay = 3;
- tween.frames = 6;
- iTween.addTween(tween);
- i++;
- }
- iDelayer.addDelayedEvent(9,OnTransition2);
- };
- GS_CountOffLeft.beginCountOff = function()
- {
- this.initalDelay = 2;
- this.framesBetween = 28;
- var i = 1;
- while(LeftItems.length >= i)
- {
- var delay = this.initalDelay + this.framesBetween * i;
- var j = LeftItems.length - i;
- iDelayer.addDelayedEvent(delay,OnCountOff,LeftItems[j]);
- i++;
- }
- this.isCountOffStarted = true;
- this.numCounted = 0;
- };
- GS_CountOffLeft.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSwitchState) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCountOff) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTransition1) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTransition2) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- mLog("timeout");
- }
- }
- else
- {
- SelectedCharacters[0].gotoAndPlay("active");
- }
- }
- else
- {
- this.transition();
- }
- }
- else
- {
- obj.gotoAndPlay("count");
- this.numCounted = this.numCounted + 1;
- var i = LeftItems.length - this.numCounted;
- var j = i + 1;
- if(j < LeftItems.length)
- {
- LeftItems[j].swapDepths(LeftItems[i]);
- }
- var snd = eval("iNumber" + this.numCounted);
- snd.play();
- if(this.numCounted >= LeftItems.length)
- {
- this.SentanceParts = new Array();
- if(this.numCounted == 1)
- {
- var sndName = "i" + SelectedItem + "Sound";
- }
- else
- {
- var sndName = "i" + SelectedItem + "sSound";
- }
- this.SentanceParts.push(eval(sndName));
- mLog("adding sound " + sndName);
- }
- }
- }
- else
- {
- switchState(GS_CountOffRight);
- }
- }
- else if(this.isCountOffOver)
- {
- iDelayer.addDelayedEvent(10,OnSwitchState);
- }
- else if(this.isCountOffStarted == false)
- {
- this.beginCountOff();
- }
- else if(0 < this.SentanceParts.length)
- {
- var snd = this.SentanceParts.shift();
- snd.play();
- mLog("playing sound " + snd);
- this.isCountOffOver = true;
- }
- else
- {
- mLog("OnSoundStop and I don\'t know what to do");
- }
- };
- GS_CountOffRight = new Object();
- GS_CountOffRight.enter = function()
- {
- mLog("entering GS_CountOffRight");
- this.isCountOffStarted = false;
- this.isCountOffOver = false;
- var snd = eval("iS5a" + SelectedCharacterNames[1]);
- snd.play();
- iDelayer.addDelayedEvent(20,OnTransition1);
- };
- GS_CountOffRight.transition = function()
- {
- var tween1 = new Object();
- tween1.mc = SelectedCharacters[1];
- tween1.scale = 125;
- tween1.frames = 9;
- iTween.addTween(tween1);
- var tween2 = new Object();
- tween2.mc = SelectedCharacters[0];
- tween2.scale = 125;
- tween2.frames = 9;
- iTween.addTween(tween2);
- SelectedCharacters[0].gotoAndPlay("static");
- var i = 0;
- while(i < LeftItems.length)
- {
- var tween = new Object();
- tween.mc = LeftItems[i];
- tween.alpha = 33;
- tween.delay = 3;
- tween.frames = 6;
- iTween.addTween(tween);
- i++;
- }
- var i = 0;
- while(i < RightItems.length)
- {
- var tween = new Object();
- tween.mc = RightItems[i];
- tween.alpha = 100;
- tween.delay = 3;
- tween.frames = 6;
- iTween.addTween(tween);
- i++;
- }
- iDelayer.addDelayedEvent(9,OnTransition2);
- };
- GS_CountOffRight.exit = function()
- {
- mLog("exiting GS_CountOffRight");
- };
- GS_CountOffRight.beginCountOff = function()
- {
- this.initalDelay = 2;
- this.framesBetween = 28;
- var i = 1;
- while(RightItems.length >= i)
- {
- var delay = this.initalDelay + this.framesBetween * i;
- var j = RightItems.length - i;
- iDelayer.addDelayedEvent(delay,OnCountOff,RightItems[j]);
- i++;
- }
- this.isCountOffStarted = true;
- this.numCounted = 0;
- };
- GS_CountOffRight.endPayOff = function()
- {
- var tween1 = new Object();
- tween1.mc = SelectedCharacters[1];
- tween1.scale = 140;
- tween1.frames = 9;
- iTween.addTween(tween1);
- var tween2 = new Object();
- tween2.mc = SelectedCharacters[0];
- tween2.scale = 140;
- tween2.frames = 9;
- iTween.addTween(tween2);
- SelectedCharacters[0].gotoAndPlay("static");
- SelectedCharacters[1].gotoAndPlay("static");
- var i = 0;
- while(i < LeftItems.length)
- {
- var tween = new Object();
- tween.mc = LeftItems[i];
- tween.alpha = 100;
- tween.frames = 6;
- tween.delay = 3;
- iTween.addTween(tween);
- i++;
- }
- var i = 0;
- while(i < RightItems.length)
- {
- var tween = new Object();
- tween.mc = RightItems[i];
- tween.alpha = 100;
- tween.frames = 6;
- tween.delay = 3;
- iTween.addTween(tween);
- i++;
- }
- iDelayer.addDelayedEvent(29,OnSwitchState);
- };
- GS_CountOffRight.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSwitchState) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCountOff) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTransition1) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTransition2) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_)
- {
- mLog("timeout");
- }
- }
- else
- {
- mLog("OnTransition2");
- SelectedCharacters[1].gotoAndPlay("active");
- }
- }
- else
- {
- this.transition();
- }
- }
- else
- {
- obj.gotoAndPlay("count");
- this.numCounted = this.numCounted + 1;
- var i = LeftItems.length - this.numCounted;
- var j = i + 1;
- if(j < RightItems.length)
- {
- RightItems[j].swapDepths(RightItems[i]);
- }
- var snd = eval("iNumber" + this.numCounted);
- snd.play();
- if(this.numCounted >= RightItems.length)
- {
- this.SentanceParts = new Array();
- if(this.numCounted == 1)
- {
- var sndName = "i" + SelectedItem + "Sound";
- }
- else
- {
- var sndName = "i" + SelectedItem + "sSound";
- }
- this.SentanceParts.push(eval(sndName));
- }
- }
- }
- else
- {
- switchState(GS_PlayAgain);
- }
- }
- else if(this.isCountOffOver)
- {
- this.endPayOff();
- }
- else if(this.isCountOffStarted == false)
- {
- this.beginCountOff();
- }
- else if(0 < this.SentanceParts.length)
- {
- var snd = this.SentanceParts.shift();
- snd.play();
- this.isCountOffOver = true;
- }
- else
- {
- mLog("OnSoundStop and I don\'t know what to do");
- }
- };
- GS_PlayAgain = new Object();
- GS_PlayAgain.enter = function()
- {
- mLog("entering GS_PlayAgain");
- this.isRollOverOk = false;
- this.startSpeaking();
- gotoAndPlay(233);
- this.animate();
- };
- GS_PlayAgain.exit = function()
- {
- mLog("exiting GS_PlayAgain");
- iDelayer.removeEvent(OnPlaySound);
- };
- GS_PlayAgain.startSpeaking = function()
- {
- this.SentanceParts = new Array();
- this.SentanceParts.push(iS10a);
- this.SentanceParts.push(iS10b);
- this.SentanceParts.push(iS10c);
- eventNotify(OnSoundStop);
- };
- GS_PlayAgain.instructAgain = function()
- {
- this.SentanceParts.push(iS10b);
- this.SentanceParts.push(iS10c);
- eventNotify(OnSoundStop);
- };
- GS_PlayAgain.animate = function()
- {
- var tween1 = new Object();
- tween1.x = 260.1;
- tween1.y = 165.8;
- tween1.scale = 140;
- tween1.frames = 8;
- tween1.mc = SelectedCharacters[0];
- iTween.addTween(tween1);
- var tween2 = new Object();
- tween2.y = 300;
- tween2.frames = 18;
- tween2.mc = SelectedCharacters[1];
- iTween.addTween(tween2);
- var i = 0;
- while(i < LeftItems.length)
- {
- var tweenItem = new Object();
- tweenItem.alpha = 0;
- tweenItem.frames = 8;
- tweenItem.delay = 4;
- tweenItem.mc = LeftItems[i];
- iTween.addTween(tweenItem);
- i++;
- }
- var i = 0;
- while(i < RightItems.length)
- {
- var tweenItem = new Object();
- tweenItem.alpha = 0;
- tweenItem.frames = 8;
- tweenItem.delay = 4;
- tweenItem.mc = RightItems[i];
- iTween.addTween(tweenItem);
- i++;
- }
- };
- GS_PlayAgain.eventNotify = function(event, obj)
- {
- var _loc1_ = null;
- var _loc0_ = null;
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnCountOff) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTransition2) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnSoundStop) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnPlaySound) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnAnimate) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenPush) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedPush) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnGreenRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnRedRoll) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnBackToStart) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnAudioTimeout) ? false : _loc0_ == _loc1_))
- {
- if(!(typeof (_loc0_ = event) != typeof (_loc1_ = OnTimeOut) ? false : _loc0_ == _loc1_))
- {
- if(typeof (_loc0_ = event) != typeof (_loc1_ = OnEnd) ? false : _loc0_ == _loc1_)
- {
- if(this.isPlayAgain)
- {
- gotoAndPlay(49);
- }
- else
- {
- getURL(gQuitUrl,"");
- stop();
- }
- SelectedCharacters[0].removeMovieClip();
- SelectedCharacters[1].removeMovieClip();
- while(0 < LeftItems.length)
- {
- var item = LeftItems.pop();
- item.removeMovieClip();
- }
- while(0 < RightItems.length)
- {
- var item = RightItems.pop();
- item.removeMovieClip();
- }
- }
- }
- else
- {
- mLog("timeout");
- }
- }
- else
- {
- this.isRollOverOk = true;
- }
- }
- else
- {
- gotoAndPlay(262);
- }
- }
- else if(this.isRollOverOk)
- {
- playSoundClip("sDone");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- }
- else if(this.isRollOverOk)
- {
- playSoundClip("sPlayAgain");
- this.isRollOverOk = false;
- iDelayer.addDelayedEvent(12,OnAudioTimeout);
- }
- }
- else
- {
- iDelayer.removeEvent(OnPlaySound);
- playSoundClip("sLater");
- var tween1 = new Object();
- tween1.frames = 10;
- tween1.y = 295;
- tween1.mc = SelectedCharacters[0];
- iTween.addTween(tween1);
- this.isPlayAgain = false;
- iDelayer.addDelayedEvent(45,OnBackToStart);
- while(0 < this.SentanceParts.length)
- {
- this.SentanceParts.pop();
- }
- iDelayer.removeEvent(OnTransiton2);
- }
- }
- else
- {
- stopAllSounds();
- playSoundClip("sGreat");
- var tween1 = new Object();
- tween1.frames = 10;
- tween1.y = 295;
- tween1.mc = SelectedCharacters[0];
- iTween.addTween(tween1);
- this.isPlayAgain = true;
- gotoAndPlay(262);
- while(0 < this.SentanceParts.length)
- {
- this.SentanceParts.pop();
- }
- iDelayer.removeEvent(OnTransiton2);
- }
- }
- else
- {
- this.animate();
- }
- }
- else
- {
- this.instructAgain();
- }
- }
- else if(0 < this.SentanceParts.length)
- {
- var snd = this.SentanceParts.shift();
- mLog("playing " + snd._name);
- snd.play();
- }
- else
- {
- this.isRollOverOk = true;
- }
- }
- else
- {
- this.startSpeaking();
- gotoAndPlay(1);
- }
- }
- else
- {
- obj.removeMovieClip();
- }
- };
-