Section 1
//Color (fl.motion.Color)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 2
//ElectricityLines_21 (PiecesFinal_fla.ElectricityLines_21)
package PiecesFinal_fla {
import flash.display.*;
public dynamic class ElectricityLines_21 extends MovieClip {
public function ElectricityLines_21(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndPlay(Math.ceil((Math.random() * 5)));
}
}
}//package PiecesFinal_fla
Section 3
//FireOrb_17 (PiecesFinal_fla.FireOrb_17)
package PiecesFinal_fla {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class FireOrb_17 extends MovieClip {
public var explode:Boolean;
public function FireOrb_17(){
addFrameScript(0, frame1, 59, frame60, 60, frame61, 83, frame84);
}
function frame84(){
stop();
}
function frame1(){
explode = false;
}
function frame61(){
MovieClip(root).playSound(new Whoosh(), new SoundChannel());
}
function frame60(){
if (explode == true){
gotoAndPlay("explode");
} else {
gotoAndPlay(1);
};
}
}
}//package PiecesFinal_fla
Section 4
//Timeline_1 (PiecesFinal_fla.Timeline_1)
package PiecesFinal_fla {
import flash.display.*;
public dynamic class Timeline_1 extends MovieClip {
public var bar:MovieClip;
public var percent;
public var bytesLoaded:int;
public var bytesTotal:int;
public function Timeline_1(){
addFrameScript(0, frame1, 1, frame2, 74, frame75);
}
function frame75(){
MovieClip(root).play();
}
function frame1(){
MovieClip(root).stop();
bytesLoaded = this.root.loaderInfo.bytesLoaded;
bytesTotal = this.root.loaderInfo.bytesTotal;
if (percent == undefined){
percent = 0;
};
percent = (percent - ((percent - ((bytesLoaded / bytesTotal) * 100)) * 0.25));
if (!(percent > 99)){
bar.scaleY = (int(percent) / 100);
} else {
gotoAndPlay("LOADED");
};
}
function frame2(){
gotoAndPlay(1);
}
}
}//package PiecesFinal_fla
Section 5
//WhiteFlash_15 (PiecesFinal_fla.WhiteFlash_15)
package PiecesFinal_fla {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WhiteFlash_15 extends MovieClip {
public function WhiteFlash_15(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
MovieClip(root).cleanUpJigsaw();
}
function frame1(){
stop();
}
}
}//package PiecesFinal_fla
Section 6
//WhiteProgressBar_20 (PiecesFinal_fla.WhiteProgressBar_20)
package PiecesFinal_fla {
import flash.display.*;
public dynamic class WhiteProgressBar_20 extends MovieClip {
public function WhiteProgressBar_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PiecesFinal_fla
Section 7
//AlienVibe (AlienVibe)
package {
import flash.display.*;
public dynamic class AlienVibe extends BitmapData {
public function AlienVibe(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 8
//BasicButton (BasicButton)
package {
import flash.display.*;
public dynamic class BasicButton extends SimpleButton {
}
}//package
Section 9
//Beep (Beep)
package {
import flash.media.*;
public dynamic class Beep extends Sound {
}
}//package
Section 10
//BigBlue (BigBlue)
package {
import flash.display.*;
public dynamic class BigBlue extends BitmapData {
public function BigBlue(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 11
//Bittbox (Bittbox)
package {
import flash.display.*;
public dynamic class Bittbox extends BitmapData {
public function Bittbox(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 12
//Corner (Corner)
package {
import flash.display.*;
public dynamic class Corner extends MovieClip {
}
}//package
Section 13
//FlyingPig (FlyingPig)
package {
import flash.display.*;
public dynamic class FlyingPig extends BitmapData {
public function FlyingPig(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 14
//Gir (Gir)
package {
import flash.display.*;
public dynamic class Gir extends BitmapData {
public function Gir(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 15
//GlowHeart (GlowHeart)
package {
import flash.display.*;
public dynamic class GlowHeart extends BitmapData {
public function GlowHeart(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//Kitty (Kitty)
package {
import flash.display.*;
public dynamic class Kitty extends BitmapData {
public function Kitty(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//MessageAnimation (MessageAnimation)
package {
import flash.display.*;
public dynamic class MessageAnimation extends MovieClip {
public function MessageAnimation(){
addFrameScript(461, frame462);
}
function frame462(){
stop();
}
}
}//package
Section 18
//Music (Music)
package {
import flash.media.*;
public dynamic class Music extends Sound {
}
}//package
Section 19
//PiecesFinal (PiecesFinal)
package {
import fl.motion.*;
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.filters.*;
public class PiecesFinal extends MovieClip {
public var timeBar:MovieClip;
public var message:MessageAnimation;
public var imagesCopy:Array;
var beep:Beep;
public var startButton:BasicButton;
var numPiecesVert:int;
public var percent:Number;
var startTime:int;
var otherPieces:Sprite;
var images:Array;
public var levelRate:Number;
public var r:int;
var timeInterval:int;
var killMessage:Boolean;
public var fireOrbs:MovieClip;
public var levelText:TextField;
var levelComplete:Whoosh;
public var playAgainButton:BasicButton;
var selectedFilters:Array;
public var shuffledImages:Array;
var bgMusic:Music;
var puzzleObjects:Array;
var soundChannel:SoundChannel;
var barColor:Color;
var numPiecesHoriz:int;
public var position:Number;
var pieceFilters:Array;
var tintColor:uint;// = 0xFFFFFF
public var thisSoundTransform:SoundTransform;
var pieceWidth:Number;
var shuffleRate:uint;// = 20000
public var startImages:Array;
var pieceHeight:Number;
var musicSoundChannel:SoundChannel;
var selectedPieces:Sprite;
public var timeLeftText:TextField;
var shuffleTimer:Timer;
var beingDragged:Array;
public var levelObject:Object;
public var flash:MovieClip;
public var replayButton:BasicButton;
public function PiecesFinal(){
images = [new Gir(320, 480), new BigBlue(320, 480), new Bittbox(320, 480), new Kitty(320, 480), new Sailboat(320, 480), new AlienVibe(320, 480), new Turtle(320, 480), new FlyingPig(320, 480), new GlowHeart(320, 480), new Shark(320, 480), new Watermelon(320, 480), new YinYangRed(320, 480)];
beingDragged = new Array();
shuffleRate = 20000;
tintColor = 0xFFFFFF;
soundChannel = new SoundChannel();
musicSoundChannel = new SoundChannel();
levelComplete = new Whoosh();
bgMusic = new Music();
beep = new Beep();
super();
addFrameScript(1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
private function setUpBitmap(_arg1:BitmapData):void{
var _local2:Bitmap;
_local2 = new Bitmap(_arg1);
pieceWidth = (Math.floor(((_local2.width / numPiecesHoriz) / 10)) * 10);
pieceHeight = (Math.floor(((_local2.height / numPiecesVert) / 10)) * 10);
_arg1 = _local2.bitmapData;
makePuzzlePieces(_arg1);
addEventListener(Event.ENTER_FRAME, movePieces);
stage.addEventListener(MouseEvent.MOUSE_UP, liftMouseUp);
}
public function stopSound(_arg1){
if (_arg1 != null){
_arg1.stop();
};
}
private function makePuzzlePieces(_arg1:BitmapData){
var _local2:uint;
var _local3:uint;
var _local4:Bitmap;
var _local5:Sprite;
var _local6:Object;
puzzleObjects = new Array();
_local2 = 0;
while (_local2 < numPiecesHoriz) {
_local3 = 0;
while (_local3 < numPiecesVert) {
_local4 = new Bitmap(new BitmapData(pieceWidth, pieceHeight));
_local4.bitmapData.copyPixels(_arg1, new Rectangle((_local2 * pieceWidth), (_local3 * pieceHeight), pieceWidth, pieceHeight), new Point(0, 0));
_local5 = new Sprite();
_local5.filters = pieceFilters;
_local5.addChild(_local4);
otherPieces.addChild(_local5);
_local6 = new Object();
_local6.loc = new Point(_local2, _local3);
_local6.dragOffset = null;
_local6.piece = _local5;
_local5.addEventListener(MouseEvent.MOUSE_DOWN, clickPuzzlePiece);
_local5.addEventListener(MouseEvent.MOUSE_UP, liftMouseUp);
puzzleObjects.push(_local6);
_local3++;
};
_local2++;
};
drawPieceCorners();
shufflePieces(null);
addEventListener(Event.ENTER_FRAME, calculateTime);
}
public function playSound(_arg1:Object, _arg2, _arg3:Number=1){
var _local4:SoundTransform;
if (_arg2 != null){
_arg2 = _arg1.play();
_local4 = new SoundTransform();
_local4.volume = _arg3;
_arg2.soundTransform = _local4;
};
}
function frame2(){
stop();
position = musicSoundChannel.position;
musicSoundChannel.stop();
musicSoundChannel = bgMusic.play(position, 9999);
thisSoundTransform = new SoundTransform();
thisSoundTransform.volume = 0.7;
musicSoundChannel.soundTransform = thisSoundTransform;
startButton.addEventListener(MouseEvent.CLICK, clickStart);
imagesCopy = images;
startImages = imagesCopy.concat();
shuffledImages = new Array();
while (startImages.length > 0) {
r = Math.floor((Math.random() * startImages.length));
shuffledImages.push(startImages[r]);
startImages.splice(r, 1);
};
levelObject = new Object();
levelRate = 0.6;
levelObject.level = 1;
levelObject.image = shuffledImages[(levelObject.level - 1)];
levelObject.numX = 2;
levelObject.numY = 2;
}
function frame3(){
startJigsawPuzzle(levelObject.image, levelObject.numX, levelObject.numY);
levelText.text = levelObject.level;
fireOrbs.gotoAndPlay(1);
flash.mouseEnabled = false;
flash.mouseChildren = false;
message.mouseEnabled = false;
message.mouseChildren = false;
}
function frame4(){
killMessage = true;
fireOrbs.explode = true;
playAgainButton.addEventListener(MouseEvent.CLICK, clickPlayAgain);
levelObject.level++;
if (levelObject.level > shuffledImages.length){
gotoAndStop("gamewon");
};
levelObject.image = shuffledImages[(levelObject.level - 1)];
levelObject.numX = (levelObject.numX + levelRate);
levelObject.numY = (levelObject.numY + levelRate);
((2 + 0.6) + 0.55);
if (levelRate > 0.25){
levelRate = (levelRate - 0.05);
};
}
function frame5(){
replayButton.addEventListener(MouseEvent.CLICK, clickReplay);
}
public function movePieces(_arg1:Event){
var _local2:*;
for (_local2 in beingDragged) {
beingDragged[_local2].piece.x = (mouseX + beingDragged[_local2].dragOffset.x);
beingDragged[_local2].piece.y = (mouseY + beingDragged[_local2].dragOffset.y);
};
}
public function animatePiece(_arg1:Event){
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Object;
for (_local2 in puzzleObjects) {
if (puzzleObjects[_local2].piece == _arg1.currentTarget){
_local6 = puzzleObjects[_local2];
};
};
_local3 = (_local6.targetX - _local6.piece.x);
_local4 = (_local6.targetY - _local6.piece.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 < 1){
_local6.piece.x = _local6.targetX;
_local6.piece.y = _local6.targetY;
_local6.piece.filters = pieceFilters;
_local6.piece.removeEventListener(Event.ENTER_FRAME, animatePiece);
_local6.piece.addEventListener(MouseEvent.MOUSE_DOWN, clickPuzzlePiece);
} else {
_local6.piece.x = (_local6.piece.x + (_local3 * 0.1));
_local6.piece.y = (_local6.piece.y + (_local4 * 0.1));
};
}
public function liftMouseUp(_arg1:MouseEvent){
var _local2:Point;
var _local3:*;
var _local4:*;
lockPiecesToGrid();
_local2 = new Point(_arg1.stageX, _arg1.stageY);
for (_local3 in puzzleObjects) {
if (puzzleObjects[_local3].piece == _arg1.currentTarget){
findLockedPieces(_local3, _local2);
break;
};
};
for (_local4 in beingDragged) {
otherPieces.addChild(beingDragged[_local4].piece);
};
beingDragged = new Array();
selectedPieces.filters = null;
if (puzzleTogether()){
setChildIndex(flash, (numChildren - 1));
flash.play();
};
}
public function puzzleTogether():Boolean{
var _local1:uint;
var _local2:int;
var _local3:int;
_local1 = 1;
while (_local1 < puzzleObjects.length) {
_local2 = (puzzleObjects[_local1].loc.x - puzzleObjects[0].loc.x);
_local3 = (puzzleObjects[_local1].loc.y - puzzleObjects[0].loc.y);
if (puzzleObjects[_local1].piece.x != (puzzleObjects[0].piece.x + (pieceWidth * _local2))){
return (false);
};
if (puzzleObjects[_local1].piece.y != (puzzleObjects[0].piece.y + (pieceHeight * _local3))){
return (false);
};
_local1++;
};
return (true);
}
public function clickPuzzlePiece(_arg1:MouseEvent){
var _local2:Point;
var _local3:*;
playSound(beep, soundChannel, 0.3);
_local2 = new Point(_arg1.stageX, _arg1.stageY);
beingDragged = new Array();
for (_local3 in puzzleObjects) {
if (puzzleObjects[_local3].piece == _arg1.currentTarget){
beingDragged.push(puzzleObjects[_local3]);
puzzleObjects[_local3].dragOffset = new Point((puzzleObjects[_local3].piece.x - _local2.x), (puzzleObjects[_local3].piece.y - _local2.y));
selectedPieces.addChild(puzzleObjects[_local3].piece);
findLockedPieces(_local3, _local2);
break;
};
};
}
public function lockPiecesToGrid(){
var _local1:*;
for (_local1 in puzzleObjects) {
puzzleObjects[_local1].piece.x = (10 * Math.round((puzzleObjects[_local1].piece.x / 10)));
puzzleObjects[_local1].piece.y = (10 * Math.round((puzzleObjects[_local1].piece.y / 10)));
};
}
public function startJigsawPuzzle(_arg1, _arg2:Number=2, _arg3=2){
var _local4:BlurFilter;
var _local5:GlowFilter;
numPiecesHoriz = _arg2;
numPiecesVert = _arg3;
otherPieces = new Sprite();
selectedPieces = new Sprite();
addChild(otherPieces);
addChild(selectedPieces);
setUpBitmap(_arg1);
_local4 = new BlurFilter(2, 2, 1);
_local5 = new GlowFilter(3407871, 1, 10, 10, 2);
pieceFilters = [_local5];
selectedFilters = [new GlowFilter(0xFFCC00, 1, 20, 20, 2), _local4];
barColor = new Color();
setChildIndex(message, (numChildren - 1));
if (killMessage == true){
removeChild(message);
};
}
public function isConnected(_arg1:Object):Boolean{
var _local2:*;
var _local3:int;
var _local4:int;
for (_local2 in beingDragged) {
_local3 = Math.abs((_arg1.loc.x - beingDragged[_local2].loc.x));
_local4 = Math.abs((_arg1.loc.y - beingDragged[_local2].loc.y));
if ((((_local3 == 1)) && ((_local4 == 0)))){
return (true);
};
if ((((_local3 == 0)) && ((_local4 == 1)))){
return (true);
};
};
return (false);
}
public function findLockedPieces(_arg1:uint, _arg2:Point){
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local3 = new Array();
for (_local4 in puzzleObjects) {
if (_local4 == _arg1){
} else {
_local3.push({dist:Point.distance(puzzleObjects[_arg1].loc, puzzleObjects[_local4].loc), num:_local4});
};
};
_local3.sortOn("dist", Array.DESCENDING);
do {
_local5 = false;
_local4 = (_local3.length - 1);
while (_local4 >= 0) {
_local6 = _local3[_local4].num;
_local7 = (puzzleObjects[_local6].loc.x - puzzleObjects[_arg1].loc.x);
_local8 = (puzzleObjects[_local6].loc.y - puzzleObjects[_arg1].loc.y);
if (puzzleObjects[_local6].piece.x == (puzzleObjects[_arg1].piece.x + (pieceWidth * _local7))){
if (puzzleObjects[_local6].piece.y == (puzzleObjects[_arg1].piece.y + (pieceHeight * _local8))){
if (isConnected(puzzleObjects[_local6])){
beingDragged.push(puzzleObjects[_local6]);
puzzleObjects[_local6].dragOffset = new Point((puzzleObjects[_local6].piece.x - _arg2.x), (puzzleObjects[_local6].piece.y - _arg2.y));
for (_local9 in beingDragged) {
beingDragged[_local9].piece.filters = null;
};
selectedPieces.addChild(puzzleObjects[_local6].piece);
if (beingDragged.length > 1){
selectedPieces.filters = selectedFilters;
};
_local5 = true;
_local3.splice(_local4, 1);
};
};
};
_local4--;
};
} while (_local5);
}
public function calculateTime(_arg1:Event){
var _local2:int;
var _local3:int;
if (startTime == 0){
startTime = ((5000 + (levelObject.level * 10000)) + getTimer());
};
timeInterval = (5000 + (levelObject.level * 10000));
_local2 = (startTime - getTimer());
_local3 = Math.floor((_local2 / 1000));
if (_local2 >= 1000){
timeLeftText.text = ((String(_local3) + ".") + String(_local2).substr(String(_local3).length, 2));
} else {
timeLeftText.text = ("." + String(_local2).substr(0, 2));
};
timeBar.scaleX = (_local2 / timeInterval);
timeLeftText.x = (timeBar.x + (timeBar.width / 2));
percent = Math.abs(((_local2 / timeInterval) - 1));
barColor.setTint(tintColor, percent);
timeBar.transform.colorTransform = barColor;
if (_local2 <= 50){
shufflePieces(null);
startTime = (startTime + timeInterval);
timeBar.scaleX = 1;
timeLeftText.text = "";
};
}
public function drawPieceCorners(){
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Corner;
_local1 = new Array();
_local2 = 0;
while (_local2 < 4) {
_local5 = new Corner();
_local1.push(_local5);
_local2++;
};
puzzleObjects[0].piece.addChild(_local1[0]);
_local3 = ((numPiecesVert * numPiecesHoriz) - numPiecesVert);
puzzleObjects[_local3].piece.addChild(_local1[1]);
_local1[1].scaleX = -1;
_local1[1].x = pieceWidth;
puzzleObjects[(numPiecesVert - 1)].piece.addChild(_local1[2]);
_local1[2].scaleY = -1;
_local1[2].y = pieceHeight;
_local4 = ((numPiecesVert * numPiecesHoriz) - 1);
puzzleObjects[_local4].piece.addChild(_local1[3]);
_local1[3].scaleX = -1;
_local1[3].scaleY = -1;
_local1[3].x = pieceWidth;
_local1[3].y = pieceHeight;
}
public function clickReplay(_arg1:MouseEvent){
gotoAndStop("intro");
}
public function shufflePieces(_arg1:TimerEvent){
var _local2:Boolean;
var _local3:*;
var _local4:*;
var _local5:Sprite;
_local2 = false;
for (_local3 in puzzleObjects) {
for (_local4 in beingDragged) {
if (puzzleObjects[_local3] == beingDragged[_local4]){
_local2 = true;
};
};
if (_local2 == true){
_local2 = false;
} else {
_local5 = puzzleObjects[_local3].piece;
puzzleObjects[_local3].targetX = (Math.floor(((Math.random() * 700) / 10)) * 10);
puzzleObjects[_local3].targetY = (Math.floor(((Math.random() * 550) / 10)) * 10);
_local5.filters = _local5.filters.concat(new BlurFilter(8, 8, 1));
_local5.addEventListener(Event.ENTER_FRAME, animatePiece);
_local5.removeEventListener(MouseEvent.MOUSE_DOWN, clickPuzzlePiece);
};
};
}
public function clickStart(_arg1:MouseEvent){
gotoAndStop("play");
}
public function cleanUpJigsaw(){
removeChild(selectedPieces);
removeChild(otherPieces);
selectedPieces = null;
otherPieces = null;
puzzleObjects = null;
beingDragged = null;
removeEventListener(Event.ENTER_FRAME, movePieces);
removeEventListener(Event.ENTER_FRAME, calculateTime);
stage.removeEventListener(MouseEvent.MOUSE_UP, liftMouseUp);
startTime = 0;
gotoAndStop("gameover");
}
public function clickPlayAgain(_arg1:MouseEvent){
gotoAndStop("play");
}
}
}//package
Section 20
//Sailboat (Sailboat)
package {
import flash.display.*;
public dynamic class Sailboat extends BitmapData {
public function Sailboat(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 21
//Shark (Shark)
package {
import flash.display.*;
public dynamic class Shark extends BitmapData {
public function Shark(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//Turtle (Turtle)
package {
import flash.display.*;
public dynamic class Turtle extends BitmapData {
public function Turtle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//Watermelon (Watermelon)
package {
import flash.display.*;
public dynamic class Watermelon extends BitmapData {
public function Watermelon(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 24
//Whoosh (Whoosh)
package {
import flash.media.*;
public dynamic class Whoosh extends Sound {
}
}//package
Section 25
//YinYangRed (YinYangRed)
package {
import flash.display.*;
public dynamic class YinYangRed extends BitmapData {
public function YinYangRed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package