Section 1
//completed_24 (jigsaw_fla.completed_24)
package jigsaw_fla {
import flash.display.*;
public dynamic class completed_24 extends MovieClip {
public function completed_24(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jigsaw_fla
Section 2
//mcGameInfo_40 (jigsaw_fla.mcGameInfo_40)
package jigsaw_fla {
import flash.display.*;
public dynamic class mcGameInfo_40 extends MovieClip {
public function mcGameInfo_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package jigsaw_fla
Section 3
//On_20 (jigsaw_fla.On_20)
package jigsaw_fla {
import flash.display.*;
public dynamic class On_20 extends MovieClip {
public function On_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package jigsaw_fla
Section 4
//ship_31 (jigsaw_fla.ship_31)
package jigsaw_fla {
import flash.display.*;
public dynamic class ship_31 extends MovieClip {
public function ship_31(){
addFrameScript(0, frame1, 47, frame48, 95, frame96, 143, frame144, 191, frame192, 247, frame248, 295, frame296, 343, frame344);
}
function frame48(){
stop();
GameState.gameState = "inGame";
}
function frame296(){
stop();
GameState.gameState = "inGame";
}
function frame144(){
stop();
GameState.gameState = "inGame";
}
function frame344(){
stop();
GameState.gameState = "inGame";
}
function frame248(){
stop();
GameState.gameState = "inGame";
}
function frame96(){
stop();
GameState.gameState = "inGame";
}
function frame1(){
stop();
}
function frame192(){
stop();
GameState.gameState = "inGame";
}
}
}//package jigsaw_fla
Section 5
//worldmap_28 (jigsaw_fla.worldmap_28)
package jigsaw_fla {
import flash.display.*;
public dynamic class worldmap_28 extends MovieClip {
public function worldmap_28(){
addFrameScript(0, frame1, 8, frame9);
}
function frame9(){
stop();
}
function frame1(){
stop();
}
}
}//package jigsaw_fla
Section 6
//BackGroundMusic (BackGroundMusic)
package {
import flash.media.*;
public dynamic class BackGroundMusic extends Sound {
}
}//package
Section 7
//bonus (bonus)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class bonus extends MovieClip {
public var timeLeft_txt:TextField;
public var moregames_btn:SimpleButton;
public var completed_mc:MovieClip;
public var next_btn:SimpleButton;
public var i:int;// = 1
public var scores_txt:TextField;
public var unlockNumber_num:TextField;
public var unlockNumber_txt:TextField;
public function bonus(){
next_btn.addEventListener(MouseEvent.CLICK, next_btnHandler);
addEventListener(Event.ENTER_FRAME, bonusHandler);
moregames_btn.addEventListener(MouseEvent.CLICK, moregamesHandler);
}
public function bonusHandler(_arg1:Event):void{
if (i < 2){
if (completed_mc.currentFrame == 15){
completed_mc.gotoAndPlay(1);
i++;
};
};
if (i >= 2){
removeEventListener(Event.ENTER_FRAME, bonusHandler);
};
}
public function moregamesHandler(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function next_btnHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
this.parent.removeChild(this);
switch ((GameState.mapLocation - 1)){
case 6:
GameState.gameState = "worldMapAgain";
break;
case 9:
GameState.gameState = "worldMapAgain";
break;
case 10:
GameState.gameState = "worldMapAgain";
break;
case 13:
GameState.gameState = "worldMapAgain";
break;
case 17:
GameState.gameState = "worldMapAgain";
break;
case 18:
GameState.gameState = "worldMapAgain";
break;
case 24:
GameState.gameState = "worldMapAgain";
break;
case 30:
GameState.gameState = "worldMapAgain";
break;
default:
GameState.gameState = "next";
break;
};
}
}
}//package
Section 8
//creditsPage (creditsPage)
package {
import flash.events.*;
import flash.display.*;
public class creditsPage extends MovieClip {
public var backToFirstPage_btn:SimpleButton;
public function creditsPage(){
backToFirstPage_btn.addEventListener(MouseEvent.CLICK, backToFirstPageHandler);
}
public function backToFirstPageHandler(_arg1:Event):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "BackToFirstPage";
}
}
}//package
Section 9
//dialogue (dialogue)
package {
import flash.display.*;
import flash.text.*;
public dynamic class dialogue extends MovieClip {
public var dialogue_txt:TextField;
}
}//package
Section 10
//end (end)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class end extends MovieClip {
public var score_txt:TextField;
public var back_btn:SimpleButton;
public function end(){
score_txt.text = String(GameState.scores);
back_btn.addEventListener(MouseEvent.CLICK, backHandler);
}
public function backHandler(_arg1:MouseEvent):void{
GameState.mapLocation = 1;
GameState.dialogueNumber = 1;
GameState.scores = 0;
GameState.unlockNumber = 3;
GameState.gameState = "goBackToFirstPage";
}
}
}//package
Section 11
//firstPage (firstPage)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class firstPage extends MovieClip {
public var moregames_btn:SimpleButton;
public var optionPage_mc:Option;
public var sponsor_btn:SimpleButton;
public var option_btn:SimpleButton;
public var goIntoGame:SimpleButton;
public var credits_btn:SimpleButton;
public function firstPage(){
goIntoGame.addEventListener(MouseEvent.CLICK, goIntoGameHandler);
credits_btn.addEventListener(MouseEvent.CLICK, goIntoCreditesHandler);
option_btn.addEventListener(MouseEvent.CLICK, goIntoOptionsHandler);
moregames_btn.addEventListener(MouseEvent.CLICK, goIntoMoregamesHandler);
sponsor_btn.addEventListener(MouseEvent.CLICK, goIntoSponsorHandler);
}
public function goIntoOptionsHandler(_arg1:Event):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "options";
optionPage_mc = new Option();
addChild(optionPage_mc);
}
public function goIntoMoregamesHandler(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function goIntoGameHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "worldMap";
}
public function goIntoSponsorHandler(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function goIntoCreditesHandler(_arg1:Event):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "credits";
}
}
}//package
Section 12
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
public class Game extends MovieClip {
public var col:uint;
public var back_btn:SimpleButton;
public var txtTileNum:TextField;
public var scene:Sprite;
public var next_btn:SimpleButton;
public var option_btn:SimpleButton;
public var tempScores:Number;
public var btnPlus:SimpleButton;
public var bmpMap:Bitmap;
public var mc:MovieClip;
public var totalTiles:uint;
public var optionPage_mc:Option;
public var bonus_mc:bonus;
public var sponsor_btn:SimpleButton;
public var tileWidth:Number;
public var aTiles:Array;
public var timer:Timer;
public var bmpData:BitmapData;
public var scores_txt:TextField;
public var rectTemp:Rectangle;
public var lineSprite:Sprite;
public var rectCanvas:Rectangle;
public var btnReplay:SimpleButton;
public var btnStart:SimpleButton;
public var timeBar_mc:MovieClip;
public var btnMinus:SimpleButton;
public var tileHeight:Number;
public var mcGameInfo:MovieClip;
public var mapLocationArr:Array;
public var timeLeft:Number;
public var mapLocationInfo:TextField;
public function Game(){
mapLocationArr = [];
aTiles = [];
scene = new Sprite();
lineSprite = new Sprite();
timer = new Timer(500);
optionPage_mc = new Option();
super();
mapLocationArr = ["empty", "A phoenix mural", "Taj Mahal", "Giant Panda ", "Rice", "Great Wall of China", "Sushi", "Kangaroos", "The koala", "Sydney Opera House", "Penguins", "Inca civilization", "Llama", "Toucan", "Flags of the United States", "The Golden Gate Bridge", "Manhattan", "The Statue of Liberty ", "Space", "Elephant", "Zebra and Giraffe", "Sahara Desert", "Pyramid", "Sphinx", "Camel", "Colosseum", "Louvre Museum", "Notre Dame de Paris", "Tower Bridge", "Saint Basil's Cathedral", "Polar bear"];
col = GameState.unlockNumber;
tempScores = 0;
scores_txt.text = GameState.scores.toString();
rectCanvas = new Rectangle(15, 80, 500, 400);
rectTemp = new Rectangle(525, 80, 160, 420);
txtTileNum.text = ((col + "X") + col);
switch (GameState.unlockNumber){
case 3:
timeLeft = 60;
break;
case 4:
timeLeft = 90;
break;
case 5:
timeLeft = 120;
break;
case 6:
timeLeft = 150;
break;
case 7:
timeLeft = 180;
break;
case 8:
timeLeft = 200;
break;
default:
break;
};
timer.addEventListener(TimerEvent.TIMER, timeBarHandler);
mc.stop();
scene = new Sprite();
addChild(scene);
swapChildren(mc, mcGameInfo);
swapChildren(scene, mcGameInfo);
bmpData = new BitmapData(mc.width, mc.height);
mapLocationInfo.text = mapLocationArr[GameState.mapLocation];
mc.gotoAndStop(GameState.mapLocation);
mcGameInfo.gotoAndStop(GameState.mapLocation);
btnReplay.visible = false;
next_btn.mouseEnabled = false;
bmpData.draw(mc, new Matrix());
bmpMap = new Bitmap(bmpData);
bmpMap.x = rectCanvas.x;
bmpMap.y = rectCanvas.y;
scene.addChild(bmpMap);
this.btnStart.addEventListener(MouseEvent.CLICK, btnStart_ClickHandler);
this.btnReplay.addEventListener(MouseEvent.CLICK, btnReplay_ClickHandler);
this.btnPlus.addEventListener(MouseEvent.CLICK, btnPlus_ClickHandler);
this.btnMinus.addEventListener(MouseEvent.CLICK, btnMinus_ClickHandler);
this.back_btn.addEventListener(MouseEvent.CLICK, back_btnHandler);
option_btn.addEventListener(MouseEvent.CLICK, optionHandler);
sponsor_btn.addEventListener(MouseEvent.CLICK, sponsorHandler);
if (GameState.unlockNumber > 3){
btnPlus.visible = true;
btnMinus.visible = true;
} else {
btnPlus.visible = false;
btnMinus.visible = false;
};
}
public function btnStart_ClickHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
tileWidth = (rectCanvas.width / col);
tileHeight = (rectCanvas.height / col);
totalTiles = (col * col);
mc.visible = false;
btnStart.visible = false;
btnReplay.visible = true;
if (GameState.unlockNumber > 3){
btnPlus.visible = true;
btnMinus.visible = true;
} else {
btnPlus.visible = false;
btnMinus.visible = false;
};
initArea();
initTiles();
mcGameInfo.visible = true;
timer.start();
}
private function dragTile(_arg1:MouseEvent):void{
var _local2:Tile = Tile(_arg1.currentTarget);
if (_local2.dragable){
scene.setChildIndex(_local2, (scene.numChildren - 1));
_local2.startDrag();
};
}
public function optionHandler(_arg1:Event):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "options";
optionPage_mc = new Option();
addChild(optionPage_mc);
}
private function btnReplay_ClickHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
timer.stop();
GameState.scores = (GameState.scores - tempScores);
tempScores = 0;
scores_txt.text = GameState.scores.toString();
mc.visible = true;
mc.gotoAndStop(GameState.mapLocation);
removeChild(lineSprite);
bmpData = null;
bmpData = new BitmapData(mc.width, mc.height);
bmpData.draw(mc, new Matrix());
bmpMap.bitmapData.copyPixels(bmpData, new Rectangle(0, 0, rectCanvas.width, rectCanvas.height), new Point(0, 0));
bmpMap.visible = true;
btnStart.visible = true;
btnReplay.visible = false;
if (GameState.unlockNumber > 3){
btnPlus.visible = true;
btnMinus.visible = true;
} else {
btnPlus.visible = false;
btnMinus.visible = false;
};
clearTiles();
}
private function back_btnHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
clearTiles();
GameState.gameState = "worldMapAgain";
}
private function btnMinus_ClickHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.scorect.play();
};
if (col > 3){
col--;
};
txtTileNum.text = ((col + "X") + col);
}
private function initArea():void{
lineSprite = new Sprite();
lineSprite.graphics.lineStyle(1, 9935770, 1);
var _local1:uint;
while (_local1 < (col - 1)) {
lineSprite.graphics.moveTo(rectCanvas.x, (rectCanvas.y + (tileHeight * (_local1 + 1))));
lineSprite.graphics.lineTo((rectCanvas.x + rectCanvas.width), (rectCanvas.y + (tileHeight * (_local1 + 1))));
lineSprite.graphics.moveTo((rectCanvas.x + (tileWidth * (_local1 + 1))), rectCanvas.y);
lineSprite.graphics.lineTo((rectCanvas.x + (tileWidth * (_local1 + 1))), (rectCanvas.y + rectCanvas.height));
_local1++;
};
addChild(lineSprite);
}
private function clearTiles():void{
var _local1:uint;
while (_local1 < aTiles.length) {
scene.removeChild(aTiles[_local1]);
_local1++;
};
aTiles = [];
}
private function stopDragTile(_arg1:MouseEvent):void{
var _local2:Tile = Tile(_arg1.currentTarget);
_local2.stopDrag();
var _local3:Number = ((((_local2.index % col) * tileWidth) + (tileWidth / 2)) + rectCanvas.x);
var _local4:Number = (((Math.floor((_local2.index / col)) * tileHeight) + (tileHeight / 2)) + rectCanvas.y);
var _local5:Point = new Point(_local3, _local4);
var _local6:Point = new Point(_arg1.stageX, _arg1.stageY);
if (Point.distance(_local6, _local5) < (tileWidth / 2)){
if (!_local2.dragable){
return;
};
if (GameState.soundOnOff){
GameSound.scorect.play();
};
tempScores++;
GameState.scores++;
scores_txt.text = GameState.scores.toString();
_local2.dragable = false;
scene.setChildIndex(_local2, 1);
_local2.x = (_local3 - (tileWidth / 2));
_local2.y = (_local4 - (tileHeight / 2));
totalTiles--;
if (totalTiles == 0){
if (GameState.soundOnOff){
GameSound.swin.play();
};
mcGameInfo.visible = true;
mcGameInfo.gotoAndStop(31);
btnStart.visible = false;
btnReplay.visible = false;
next_btn.mouseEnabled = true;
unlockNumberHandler();
totalTiles = (col + col);
};
};
}
public function initTiles():void{
var _local2:uint;
var _local3:Tile;
bmpMap.visible = false;
mcGameInfo.gotoAndStop(GameState.mapLocation);
mapLocationInfo.text = mapLocationArr[GameState.mapLocation];
clearTiles();
var _local1:uint;
while (_local1 < col) {
_local2 = 0;
while (_local2 < col) {
_local3 = new Tile(tileWidth, tileHeight);
_local3.bmpTile.bitmapData.copyPixels(bmpData, new Rectangle((_local2 * tileWidth), (_local1 * tileHeight), tileWidth, tileHeight), new Point(0, 0));
_local3.index = ((_local1 * col) + _local2);
_local3.dragable = true;
_local3.x = (rectTemp.x + ((rectTemp.width - tileWidth) * Math.random()));
_local3.y = (rectTemp.y + ((rectTemp.height - tileHeight) * Math.random()));
_local3.addEventListener(MouseEvent.MOUSE_DOWN, dragTile, false);
_local3.addEventListener(MouseEvent.MOUSE_UP, stopDragTile, false);
aTiles.push(_local3);
scene.addChild(_local3);
_local2++;
};
_local1++;
};
}
private function sponsorHandler(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function btnPlus_ClickHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.scorect.play();
};
if (col < GameState.unlockNumber){
col++;
};
txtTileNum.text = ((col + "X") + col);
}
private function unlockNumberHandler():void{
mcGameInfo.visible = true;
totalTiles = (col + col);
mcGameInfo.gotoAndStop(31);
GameState.mapLocation = (GameState.mapLocation + 1);
if (timeLeft > 0){
GameState.scores = (GameState.scores + Math.floor((timeLeft / 5)));
bonus_mc = new bonus();
addChild(bonus_mc);
bonus_mc.timeLeft_txt.text = timeLeft.toString();
bonus_mc.scores_txt.text = GameState.scores.toString();
timeLeft = 0;
bonus_mc.unlockNumber_txt.visible = false;
bonus_mc.unlockNumber_num.visible = false;
if (col == GameState.unlockNumber){
if ((((((((GameState.mapLocation == 3)) || ((GameState.mapLocation == 10)))) || ((GameState.mapLocation == 12)))) || ((GameState.mapLocation == 26)))){
GameState.unlockNumber++;
col = GameState.unlockNumber;
bonus_mc.unlockNumber_num.text = ((col.toString() + "x") + col.toString());
bonus_mc.unlockNumber_txt.visible = true;
bonus_mc.unlockNumber_num.visible = true;
};
};
} else {
bonus_mc = new bonus();
addChild(bonus_mc);
bonus_mc.timeLeft_txt.text = String(0);
bonus_mc.scores_txt.text = GameState.scores.toString();
timeLeft = 0;
bonus_mc.unlockNumber_txt.visible = false;
bonus_mc.unlockNumber_num.visible = false;
};
}
private function timeBarHandler(_arg1:TimerEvent):void{
timeLeft--;
switch (GameState.unlockNumber){
case 3:
timeBar_mc.width = ((timeLeft / 60) * 404);
break;
case 4:
timeBar_mc.width = ((timeLeft / 90) * 404);
break;
case 5:
timeBar_mc.width = ((timeLeft / 120) * 404);
break;
case 6:
timeBar_mc.width = ((timeLeft / 150) * 404);
break;
case 7:
timeBar_mc.width = ((timeLeft / 180) * 404);
break;
case 8:
timeBar_mc.width = ((timeLeft / 200) * 404);
break;
default:
break;
};
}
}
}//package
Section 13
//GameSound (GameSound)
package {
import flash.media.*;
public class GameSound {
public static const scorect:Sound = new Scorect();
public static const srocket:Sound = new Srocket();
public static const swin:Sound = new Swin();
public static const sbtn:Sound = new Sbtn();
public static const sseaWave:Sound = new SseaWave();
public static const backGroundMusic:Sound = new BackGroundMusic();
}
}//package
Section 14
//GameState (GameState)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
public class GameState extends MovieClip {
public var worldMap:WorldMap;
public var creditsPage_mc:creditsPage;
public var game:Game;
public var firstPage_mc:firstPage;
public var chanMusic:SoundChannel;
public static var scores:Number;
public static var dialogueNumber:Number;
public static var musicOnOff:Boolean;
public static var musicState:Boolean;
public static var unlockNumber:Number;
public static var soundOnOff:Boolean;
public static var mapLocation:Number;
public static var gameState:String;
public function GameState(){
chanMusic = new SoundChannel();
super();
addEventListener(Event.ADDED_TO_STAGE, stageReady);
gameState = new String("firstPage");
mapLocation = 1;
dialogueNumber = 1;
scores = 0;
unlockNumber = 3;
musicOnOff = true;
soundOnOff = true;
musicState = musicOnOff;
}
public function stageReady(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, gameStateHandler);
chanMusic = GameSound.backGroundMusic.play(0, 1000);
}
public function gameStateHandler(_arg1:Event):void{
if (GameState.musicState){
if (GameState.musicOnOff){
} else {
GameState.musicState = false;
chanMusic.stop();
};
} else {
if (GameState.musicOnOff){
GameState.musicState = true;
chanMusic = GameSound.backGroundMusic.play(0, 1000);
};
};
if (gameState == "firstPage"){
gameState = "empty";
firstPage_mc = new firstPage();
addChild(firstPage_mc);
} else {
if (gameState == "worldMap"){
gameState = "empty";
worldMap = new WorldMap();
removeChild(firstPage_mc);
addChild(worldMap);
} else {
if (gameState == "worldMapAgain"){
gameState = "empty";
worldMap = new WorldMap();
removeChild(game);
addChild(worldMap);
} else {
if (gameState == "inGame"){
gameState = "empty";
game = new Game();
removeChild(worldMap);
addChild(game);
} else {
if (gameState == "goBackToFirstPage"){
gameState = "empty";
removeChild(worldMap);
firstPage_mc = new firstPage();
addChild(firstPage_mc);
} else {
if (gameState == "next"){
gameState = "empty";
removeChild(game);
game = new Game();
addChild(game);
} else {
if (gameState == "credits"){
gameState = "empty";
creditsPage_mc = new creditsPage();
addChild(creditsPage_mc);
} else {
if (gameState == "BackToFirstPage"){
gameState = "empty";
removeChild(creditsPage_mc);
};
};
};
};
};
};
};
};
}
}
}//package
Section 15
//Loadertest (Loadertest)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class Loadertest extends MovieClip {
public var preloader_mc:MovieClip;
public var completed:Boolean;// = false
public var shaketime2:int;// = 5
public var play_btn:SimpleButton;
public var slogox:Number;
public var slogoy:Number;
public var shaketemp:int;
public var logo_mc:MovieClip;
public var shaketime1:int;// = 9
public var shaketimer:Timer;
public function Loadertest(){
addFrameScript(5, frame6);
stop();
preloader_mc.visible = false;
preloader_mc.stop();
logo_mc.addEventListener(Event.ENTER_FRAME, animation);
logo_mc.addEventListener(MouseEvent.CLICK, clicklogo);
play_btn.visible = false;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
}
function animation(_arg1:Event):void{
if (logo_mc.currentFrame == 25){
shake1();
};
if (logo_mc.currentFrame == 196){
shake2();
};
if (logo_mc.currentFrame == 280){
logo_mc.gotoAndStop(281);
logo_mc.removeEventListener(Event.ENTER_FRAME, animation);
if (preloader_mc){
preloader_mc.visible = true;
};
if (completed){
gotoAndPlay(2);
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, addgame);
};
};
}
function completeHandler(_arg1:Event):void{
completed = true;
if (logo_mc.currentFrame == 281){
gotoAndPlay(2);
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, addgame);
};
}
function addgame(_arg1:MouseEvent):void{
var _local2:GameState;
if ((((currentFrame == 6)) && ((logo_mc.currentFrame == 281)))){
gotoAndStop(7);
_local2 = new GameState();
addChild(_local2);
};
}
public function startshake2(_arg1:TimerEvent):void{
shaketemp++;
logo_mc.x = (slogox + (getMinusOrPlus() * (30 + Math.random())));
logo_mc.y = (slogoy + (getMinusOrPlus() * (30 + Math.random())));
if (shaketemp == shaketime2){
shaketemp = 0;
logo_mc.x = slogox;
logo_mc.y = slogoy;
shaketimer.stop();
shaketimer.removeEventListener(TimerEvent.TIMER, startshake2);
};
}
public function startshake1(_arg1:TimerEvent):void{
shaketemp++;
logo_mc.x = (slogox + ((getMinusOrPlus() * 40) * Math.random()));
logo_mc.y = (slogoy + ((getMinusOrPlus() * 40) * Math.random()));
if (shaketemp == shaketime1){
shaketemp = 0;
logo_mc.x = slogox;
logo_mc.y = slogoy;
shaketimer.stop();
shaketimer.removeEventListener(TimerEvent.TIMER, startshake1);
};
}
function progressHandler(_arg1:ProgressEvent):void{
var _local2:Number = Math.floor(((100 * _arg1.bytesLoaded) / _arg1.bytesTotal));
preloader_mc.gotoAndStop(_local2);
var _local3:Number = Math.floor(((this.loaderInfo.bytesLoaded * 100) / this.loaderInfo.bytesTotal));
preloader_mc.gotoAndStop(_local3);
}
function frame6(){
stop();
}
public function shake1():void{
shaketemp = 0;
shaketimer = new Timer(33, shaketime1);
shaketimer.addEventListener(TimerEvent.TIMER, startshake1);
shaketimer.start();
slogox = logo_mc.x;
slogoy = logo_mc.y;
}
public function shake2():void{
shaketemp = 0;
shaketimer = new Timer(33, shaketime2);
shaketimer.addEventListener(TimerEvent.TIMER, startshake2);
shaketimer.start();
slogox = logo_mc.x;
slogoy = logo_mc.y;
}
function clicklogo(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function getMinusOrPlus():int{
var _local1:Number = (Math.random() * 2);
if (_local1 < 1){
return (-1);
};
return (1);
}
}
}//package
Section 16
//Option (Option)
package {
import flash.events.*;
import flash.display.*;
public class Option extends MovieClip {
public var back_btn:SimpleButton;
public var sound_mc:MovieClip;
public var music_mc:MovieClip;
public function Option(){
back_btn.addEventListener(MouseEvent.CLICK, backHandler);
music_mc.addEventListener(MouseEvent.CLICK, musicHandler);
music_mc.useHandCursor = true;
sound_mc.addEventListener(MouseEvent.CLICK, soundHandler);
sound_mc.useHandCursor = true;
if (GameState.musicOnOff){
music_mc.gotoAndStop(1);
} else {
music_mc.gotoAndStop(2);
};
if (GameState.soundOnOff){
sound_mc.gotoAndStop(1);
} else {
sound_mc.gotoAndStop(2);
};
}
public function musicHandler(_arg1:MouseEvent):void{
GameState.musicOnOff = !(GameState.musicOnOff);
if (GameState.musicState){
music_mc.gotoAndStop(2);
} else {
music_mc.gotoAndStop(1);
};
}
public function backHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
this.parent.removeChild(this);
}
public function soundHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
sound_mc.gotoAndStop(2);
GameState.soundOnOff = false;
} else {
sound_mc.gotoAndStop(1);
GameState.soundOnOff = true;
};
}
}
}//package
Section 17
//Sbtn (Sbtn)
package {
import flash.media.*;
public dynamic class Sbtn extends Sound {
}
}//package
Section 18
//Scorect (Scorect)
package {
import flash.media.*;
public dynamic class Scorect extends Sound {
}
}//package
Section 19
//Srocket (Srocket)
package {
import flash.media.*;
public dynamic class Srocket extends Sound {
}
}//package
Section 20
//SseaWave (SseaWave)
package {
import flash.media.*;
public dynamic class SseaWave extends Sound {
}
}//package
Section 21
//Swin (Swin)
package {
import flash.media.*;
public dynamic class Swin extends Sound {
}
}//package
Section 22
//Tile (Tile)
package {
import flash.display.*;
public class Tile extends Sprite {
public var index:uint;
public var bmpTile:Bitmap;
public var dragable:Boolean;
public function Tile(_arg1:Number, _arg2:Number):void{
bmpTile = new Bitmap();
bmpTile.bitmapData = new BitmapData(_arg1, _arg2);
this.addChild(bmpTile);
}
}
}//package
Section 23
//WorldMap (WorldMap)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
public class WorldMap extends MovieClip {
public var dialogue12:Array;
public var arrayNumber:uint;
public var dialogue18:Array;
public var dialogue19:Array;
public var nextDialogue_btn:SimpleButton;
public var end_mc:end;
public var worldMap_mc:MovieClip;
public var ship_mc:MovieClip;
public var option_btn:SimpleButton;
public var optionPage_mc:Option;
public var dialogue20:Array;
public var highLight_mc:MovieClip;
public var Go_btn:SimpleButton;
public var dialogueAll:Array;
public var sponsor_btn:SimpleButton;
public var timer:Timer;
public var buttonLife:int;
public var scores_txt:TextField;
public var dialogue1:Array;
public var dialogue2:Array;
public var dialogue3:Array;
public var dialogue4:Array;
public var dialogue5:Array;
public var dialogue6:Array;
public var dialogue7:Array;
public var dialogue8:Array;
public var dialogue9:Array;
public var dialogue_box:dialogue;
public var backToFirstPage_btn:SimpleButton;
public var dialogue10:Array;
public var dialogue11:Array;
public var dialogue13:Array;
public var dialogue14:Array;
public var dialogue15:Array;
public var dialogue16:Array;
public var dialogue17:Array;
public function WorldMap(){
timer = new Timer(200);
dialogue1 = ["Bob: ", "Hi, ", "I'm ", "Bob! ", "I have ", "bought ", "a new ship! ", "Would you ", "like to ", "travel around ", "the world ", "with me?"];
dialogue2 = ["Me: ", "Yes! ", "I'd ", "love to! "];
dialogue3 = ["Bob: ", "Ok! ", "First ", "We need find ", "some food ", "for the trip. ", "(Click Go button ", "to Start)"];
dialogue4 = ["Bob: ", "Great! ", "We'v got", " enough food ", "for our trip. ", "Let's ", "go to Oceania!"];
dialogue5 = ["Me: ", "Ok! ", "Go!", "(Click Go button ", "to Start)"];
dialogue6 = ["Bob: ", "I found ", "a icebreaking tool ", "in Australia ", "which can equip ", "on our ship. "];
dialogue7 = ["Me: ", "That's fantastic! ", "Now, we are able to ", "go to Antarctic! "];
dialogue8 = ["Bob: ", "What's next?"];
dialogue9 = ["Me: ", "South America. ", "I want to explore ", "that mystical continent."];
dialogue10 = ["Bob: ", "Great! ", "The next place ", "will be America."];
dialogue11 = ["Me: ", "Yes, Go!"];
dialogue12 = ["Bob :", "So lucky, ", "We got ", "a chance ", "to go into ", "the space!"];
dialogue13 = ["Me: ", "Great! "];
dialogue14 = ["Bob: ", "Guess, ", "where wil ", "we land?"];
dialogue15 = ["Me: ", "Amazing! ", "It will be Africa! "];
dialogue16 = ["Bob: ", "If we ", "want to ", "continue our trip,", "we need something ", "to help us ", "go across the desert."];
dialogue17 = ["Me: ", "Yes,it is camel! ", "It can help us ", "go across ", "desert."];
dialogue18 = ["Bob: ", "Great! ", "Go to Europe."];
dialogue19 = ["Bob: ", "Fantastic! ", "We have gone around the world!"];
dialogue20 = ["Me: ", "Thank you, Bob. ", "I have learnt ", "a lot in this trip."];
dialogueAll = [dialogue1, dialogue2, dialogue3, dialogue4, dialogue5, dialogue6, dialogue7, dialogue8, dialogue9, dialogue10, dialogue11, dialogue12, dialogue13, dialogue14, dialogue15, dialogue16, dialogue17, dialogue18, dialogue19, dialogue20];
optionPage_mc = new Option();
super();
timer.addEventListener(TimerEvent.TIMER, addTextHandler);
addEventListener(Event.ADDED_TO_STAGE, worldMapReady);
backToFirstPage_btn.addEventListener(MouseEvent.CLICK, backToFirstPageHandler);
Go_btn.addEventListener(MouseEvent.CLICK, goHandler);
nextDialogue_btn.addEventListener(MouseEvent.CLICK, nextDialogueHandler);
option_btn.addEventListener(MouseEvent.CLICK, optionHandler);
sponsor_btn.addEventListener(MouseEvent.CLICK, sponsorHandler);
scores_txt.text = GameState.scores.toString();
nextDialogue_btn.visible = true;
highLight_mc.visible = false;
dialogue_box.dialogue_txt.text = "";
dialogue_box.dialogue_txt.mouseEnabled = false;
arrayNumber = 0;
trace(GameState.mapLocation);
trace(GameState.dialogueNumber);
switch (GameState.mapLocation){
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
worldMap_mc.gotoAndStop(1);
ship_mc.gotoAndStop(1);
GameState.dialogueNumber = 1;
break;
case 7:
case 8:
case 9:
worldMap_mc.gotoAndStop(2);
ship_mc.gotoAndStop(1);
GameState.dialogueNumber = 4;
break;
case 10:
worldMap_mc.gotoAndStop(3);
ship_mc.gotoAndStop(49);
GameState.dialogueNumber = 6;
break;
case 11:
case 12:
case 13:
worldMap_mc.gotoAndStop(4);
ship_mc.gotoAndStop(97);
GameState.dialogueNumber = 8;
break;
case 14:
case 15:
case 16:
case 17:
worldMap_mc.gotoAndStop(5);
ship_mc.gotoAndStop(145);
GameState.dialogueNumber = 10;
break;
case 18:
worldMap_mc.gotoAndStop(6);
ship_mc.gotoAndStop(193);
GameState.dialogueNumber = 12;
break;
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
worldMap_mc.gotoAndStop(6);
ship_mc.gotoAndStop(249);
GameState.dialogueNumber = 14;
break;
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
worldMap_mc.gotoAndStop(7);
ship_mc.gotoAndStop(297);
GameState.dialogueNumber = 17;
break;
case 31:
worldMap_mc.gotoAndStop(8);
GameState.dialogueNumber = 19;
ship_mc.gotoAndStop(345);
Go_btn.mouseEnabled = false;
highLight_mc.visible = false;
end_mc = new end();
addChild(end_mc);
break;
default:
break;
};
}
private function addTextHandler(_arg1:TimerEvent):void{
highLight_mc.visible = false;
if (buttonLife > 0){
if (arrayNumber < dialogueAll[(GameState.dialogueNumber - 1)].length){
dialogue_box.dialogue_txt.text = (dialogue_box.dialogue_txt.text + dialogueAll[(GameState.dialogueNumber - 1)][arrayNumber]);
arrayNumber++;
} else {
arrayNumber = 0;
timer.stop();
GameState.dialogueNumber++;
buttonLife--;
if (buttonLife == 0){
nextDialogue_btn.visible = false;
highLight_mc.visible = true;
highLight_mc.gotoAndPlay(1);
};
};
} else {
nextDialogue_btn.visible = false;
};
}
public function optionHandler(_arg1:Event):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "options";
optionPage_mc = new Option();
addChild(optionPage_mc);
}
private function backToFirstPageHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
GameState.gameState = "goBackToFirstPage";
}
private function sponsorHandler(_arg1:MouseEvent):void{
var _local2 = "http://www.games1.com/?utm_medium=brandedgames_external&utm_campaign=world-jigsaw&utm_source=host&utm_content=ingame";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function goHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
switch ((GameState.mapLocation - 1)){
case 6:
if (GameState.soundOnOff){
GameSound.sseaWave.play();
};
ship_mc.gotoAndPlay(2);
break;
case 9:
if (GameState.soundOnOff){
GameSound.sseaWave.play();
};
ship_mc.gotoAndPlay(49);
break;
case 10:
if (GameState.soundOnOff){
GameSound.sseaWave.play();
};
ship_mc.gotoAndPlay(97);
break;
case 13:
if (GameState.soundOnOff){
GameSound.sseaWave.play();
};
ship_mc.gotoAndPlay(145);
break;
case 17:
if (GameState.soundOnOff){
GameSound.srocket.play();
};
ship_mc.gotoAndPlay(193);
break;
case 18:
if (GameState.soundOnOff){
};
ship_mc.gotoAndPlay(249);
break;
case 24:
if (GameState.soundOnOff){
};
ship_mc.gotoAndPlay(297);
break;
case 30:
if (GameState.soundOnOff){
};
ship_mc.gotoAndPlay(345);
break;
default:
GameState.gameState = "inGame";
break;
};
}
private function nextDialogueHandler(_arg1:MouseEvent):void{
if (GameState.soundOnOff){
GameSound.sbtn.play();
};
dialogue_box.dialogue_txt.text = "";
timer.start();
}
public function worldMapReady(_arg1:Event):void{
if (GameState.dialogueNumber < 4){
buttonLife = 3;
};
if ((((GameState.dialogueNumber > 3)) && ((GameState.dialogueNumber < 14)))){
buttonLife = 2;
};
if ((((GameState.dialogueNumber > 13)) && ((GameState.dialogueNumber < 17)))){
buttonLife = 3;
};
if ((((GameState.dialogueNumber > 16)) && ((GameState.dialogueNumber < 21)))){
buttonLife = 2;
};
timer.start();
}
}
}//package