class someFrogs.Puzzles.JigsawPuzzle extends mx.core.UIComponent
{
static var symbolName = "JigsawPuzzle";
static var symbolOwner = someFrogs.Puzzles.JigsawPuzzle;
var className = "JigsawPuzzle";
var version = "2.2.0.C";
var _puzzleRezH = 2;
var _puzzleRezV = 2;
var autoStart = true;
var enableRotation = true;
var _blinkCount = 5;
var _puzzleDone = false;
var edgesMixed = [[[0,0],[100,0]],[[0,0],[30,0],[40,-16,30,-16],[50,0,50,-16],[50,16],[70,16],[70,0],[100,0]],[[0,0],[30,0],[40,-16,30,-16],[50,0,50,-16],[65,16],[80,0],[100,0]],[[0,0],[30,0],[30,-16],[50,-16],[50,0],[65,16],[80,0],[100,0]],[[0,0],[30,0],[30,-16],[50,-16],[50,0],[60,16,50,16],[70,0,70,16],[100,0]],[[0,0],[20,0],[35,-16],[50,0],[50,16],[70,16],[70,0],[100,0]],[[0,0],[20,0],[35,-16],[50,0],[60,16,50,16],[70,0,70,16],[100,0]],[[0,0],[30,0],[40,16,30,16],[50,0,50,16],[50,-16],[70,-16],[70,0],[100,0]],[[0,0],[30,0],[40,16,30,16],[50,0,50,16],[50,0],[50,0],[65,-16],[80,0],[100,0]],[[0,0],[30,0],[30,16],[50,16],[50,0],[65,-16],[80,0],[100,0]],[[0,0],[30,0],[30,16],[50,16],[50,0],[60,-16,50,-16],[70,0,70,-16],[100,0]],[[0,0],[20,0],[35,16],[50,0],[50,-16],[70,-16],[70,0],[100,0]],[[0,0],[20,0],[35,16],[50,0],[60,-16,50,-16],[70,0,70,-16],[100,0]]];
var edgesSquare = [[[0,0],[100,0]],[[0,0],[20,0],[20,-16],[40,-16],[40,0],[60,0],[60,16],[80,16],[80,0],[100,0]],[[0,0],[30,0],[30,-16],[50,-16],[50,0],[50,16],[70,16],[70,0],[100,0]],[[0,0],[30,0],[30,-16],[50,-16],[50,0],[60,0],[60,16],[80,16],[80,0],[100,0]],[[0,0],[20,0],[20,16],[40,16],[40,0],[60,0],[60,-16],[80,-16],[80,0],[100,0]],[[0,0],[30,0],[30,16],[50,16],[50,0],[50,-16],[70,-16],[70,0],[100,0]],[[0,0],[30,0],[30,16],[50,16],[50,0],[60,0],[60,-16],[80,-16],[80,0],[100,0]]];
var edgesTriangle = [[[0,0],[100,0]],[[0,0],[10,0],[25,-16],[40,0],[60,0],[75,16],[90,0],[100,0]],[[0,0],[15,0],[30,-16],[45,0],[55,0],[70,16],[85,0],[100,0]],[[0,0],[20,0],[35,-16],[50,0],[65,16],[80,0],[100,0]],[[0,0],[10,0],[25,16],[40,0],[60,0],[75,-16],[90,0],[100,0]],[[0,0],[15,0],[30,16],[45,0],[55,0],[70,-16],[85,0],[100,0]],[[0,0],[20,0],[35,16],[50,0],[65,-16],[80,0],[100,0]]];
var edgesOval = [[[0,0],[100,0]],[[0,0],[15,0],[25,-16,15,-16],[35,0,35,-16],[65,0],[75,16,65,16],[85,0,85,16],[100,0]],[[0,0],[25,0],[35,-16,25,-16],[45,0,45,-16],[55,0],[65,16,55,16],[75,0,75,16],[100,0]],[[0,0],[30,0],[40,-16,30,-16],[50,0,50,-16],[60,16,50,16],[70,0,70,16],[100,0]],[[0,0],[15,0],[25,16,15,16],[35,0,35,16],[65,0],[75,-16,65,-16],[85,0,85,-16],[100,0]],[[0,0],[25,0],[35,16,25,16],[45,0,45,16],[55,0],[65,-16,55,-16],[75,0,75,-16],[100,0]],[[0,0],[30,0],[40,16,30,16],[50,0,50,16],[60,-16,50,-16],[70,0,70,-16],[100,0]]];
var edgesClassic = [[[0,0],[100,0]],[[0,0],[32,0,42,16],[40,-16,12,-16],[48,0,60,-16],[100,0,40,16],[100,0]],[[0,0],[32,0,42,16],[40,-16,20,-16],[48,0,68,-16],[100,0,40,16],[100,0]],[[0,0],[42,0,52,16],[50,-16,30,-16],[58,0,78,-16],[100,0,48,16],[100,0]],[[0,0],[42,0,52,16],[50,-16,20,-16],[58,0,68,-16],[100,0,48,16],[100,0]],[[0,0],[52,0,60,16],[60,-16,30,-16],[68,0,80,-16],[100,0,60,16],[100,0]],[[0,0],[52,0,60,16],[60,-16,28,-16],[68,0,74,-16],[100,0,60,16],[100,0]]];
var useSignature = false;
var listeners_on = false;
var top_depth = 10000;
var stage_width = 100;
var stage_height = 100;
var dragArea = {l:2,t:2,r:98,b:98};
var pic_width = 50;
var pic_height = 50;
var childs_arr = [[]];
var childs_count = 0;
function JigsawPuzzle()
{
super();
if(this.autoStart)
{
this.start();
}
}
function set picLinkage(picL)
{
this._picLinkage = picL;
}
function get picLinkage()
{
return this._picLinkage;
}
function set puzzleRezH(rn)
{
this._puzzleRezH = Math.max(Math.floor(rn),2);
this._puzzleRezH = Math.min(this._puzzleRezH,12);
}
function get puzzleRezH()
{
return this._puzzleRezH;
}
function set puzzleRezV(rn)
{
this._puzzleRezV = Math.max(Math.floor(rn),2);
this._puzzleRezV = Math.min(this._puzzleRezV,12);
}
function get puzzleRezV()
{
return this._puzzleRezV;
}
function set shapeStyle(shSt)
{
this._shapeStyle = shSt;
}
function get shapeStyle()
{
return this._shapeStyle;
}
function set matchBlinkCount(bn)
{
if(bn > 50)
{
bn = 50;
}
if(bn < 0)
{
bn = 0;
}
this._blinkCount = bn;
}
function get matchBlinkCount()
{
return this._blinkCount;
}
function get puzzleDone()
{
return this._puzzleDone;
}
function set edgesArr(eArr)
{
this._edgesArr = eArr;
}
function get edgesArr()
{
return this._edgesArr;
}
function startPuzzle(picLn, hr, vr, eRot, shSt)
{
if(this.keyListener != undefined)
{
Key.removeListener(this.keyListener);
Mouse.removeListener(this.keyListener);
}
this.listeners_on = false;
if(picLn != undefined)
{
this.__set__picLinkage(picLn);
}
if(hr != undefined)
{
this.__set__puzzleRezH(hr);
}
if(vr != undefined)
{
this.__set__puzzleRezV(vr);
}
if(eRot != undefined)
{
this.enableRotation = eRot;
}
if(shSt != undefined)
{
this.__set__shapeStyle(shSt);
}
this.clear_stage();
this.init_picture();
}
function start()
{
this.clear_stage();
this.init_picture();
}
function showHint(n)
{
if(n == undefined)
{
n = 5;
}
if(n > 50)
{
n = 50;
}
var _loc4_ = this.getInstanceAtDepth(this.top_depth);