Section 1
//04564654148_56 (07e_fla.04564654148_56)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class 04564654148_56 extends MovieClip {
public function 04564654148_56(){
addFrameScript(0, frame1, 1, frame2, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
stop();
alpha = 1;
visible = false;
}
function frame2(){
alpha = 1;
visible = true;
}
public function SHOW(){
play();
root["mc_Sounds"].PLAY("pencil");
}
}
}//package 07e_fla
Section 2
//bbox_55 (07e_fla.bbox_55)
package 07e_fla {
import flash.display.*;
public dynamic class bbox_55 extends MovieClip {
public function bbox_55(){
addFrameScript(0, frame1);
}
function frame1(){
alpha = 0;
}
}
}//package 07e_fla
Section 3
//cont_continue_85 (07e_fla.cont_continue_85)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class cont_continue_85 extends MovieClip {
public var i_scoreNow:uint;
public var txt_score:TextField;
public var btn_continue:SimpleButton;
public var scoreNow:int;
public var i_score:uint;
public var i_timeStart;
public var i_timeUsed;
public var i_timeHold:uint;
public var tm_id:int;
public var i_timeAdd:uint;
public var i_scoreAdd:uint;
public var f_timePsb;
public function cont_continue_85(){
addFrameScript(0, frame1, 1, frame2, 49, frame50);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function SET_PROPS(_arg1:uint=0, _arg2:uint=3000):void{
trace(("SET_PROPS: " + _arg1));
i_score = _arg1;
i_timeHold = _arg2;
}
function frame1(){
i_score = 1000;
i_scoreAdd = 33;
i_timeHold = 3000;
i_timeAdd = 30;
}
public function OnSetScore():void{
tm_id = setTimeout(OnSetScore, i_timeAdd);
i_scoreNow = (i_scoreNow + i_scoreAdd);
if (i_scoreNow < i_score){
txt_score.text = i_scoreNow.toString();
root["mc_Sounds"].PLAY("score");
} else {
clearTimeout(tm_id);
setTimeout(OnScore, 500);
txt_score.text = i_score.toString();
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnContinue(_arg1=null):void{
setTimeout(HIDE, 100);
setTimeout(parent["PLAY_CONTINUE"], (100 + 500));
}
public function OnScore():void{
trace("OnScore");
btn_continue.visible = true;
root["mc_Sounds"].PLAY("appear");
}
function frame50(){
stop();
btn_continue.visible = false;
btn_continue.addEventListener(MouseEvent.CLICK, OnContinue);
i_scoreNow = 0;
OnSetScore();
}
function frame2(){
if (root["STATE"] == "TRY_AGAIN"){
var _local1 = root;
_local1["gotoAndPlay"]("try_again");
stop();
} else {
if (root["STATE"] == "CONTINUE"){
_local1 = root;
_local1["stop"]();
trace("!!!!Continue MC");
scoreNow = 0;
i_timeStart = root["i_timeStart"];
f_timePsb = root["f_timePsb"];
i_timeUsed = root["i_timeUsed"];
i_timeUsed = (getTimer() - i_timeStart);
if (f_timePsb < 1){
f_timePsb = (1 / f_timePsb);
scoreNow = (i_timeUsed / 100);
} else {
scoreNow = ((f_timePsb - i_timeUsed) / 100);
};
if (scoreNow <= 0){
scoreNow = 7;
};
root["SCORE"] = (root["SCORE"] + scoreNow);
SET_PROPS(scoreNow);
} else {
_local1 = root;
_local1["ERROR"]();
stop();
};
};
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 4
//container_1_5_45 (07e_fla.container_1_5_45)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class container_1_5_45 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function container_1_5_45(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 5
//containercopy_39 (07e_fla.containercopy_39)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class containercopy_39 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function containercopy_39(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 6
//containercopy3_69 (07e_fla.containercopy3_69)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class containercopy3_69 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function containercopy3_69(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 7
//containercopy4_22 (07e_fla.containercopy4_22)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class containercopy4_22 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function containercopy4_22(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 8
//containercopy5_41 (07e_fla.containercopy5_41)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class containercopy5_41 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function containercopy5_41(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 9
//containercopy6_43 (07e_fla.containercopy6_43)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class containercopy6_43 extends MovieClip {
public var counter:int;
public var arr_Objects:Array;
public var b_LastHit:Boolean;
public var squareIdeal:Number;
public var sliceLimit:uint;
public var rc_BoundsIdeal:Rectangle;
public var arr_Bounds:Array;
public function containercopy6_43(){
addFrameScript(0, frame1);
}
public function ExcludeHits(_arg1:Array, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Rectangle;
var _local10:Point;
_local3 = false;
if (((!((_arg1 == null))) && (((b_LastHit) || (_arg2))))){
_local4 = -1;
_local5 = _arg1.length;
while (++_local4 < _local5) {
_local6 = 0;
_local7 = -1;
while (++_local7 < _local5) {
_local8 = -1;
while (((((!((_local4 == _local7))) && (_arg1[_local4].hitTestObject(_arg1[_local7])))) && (((_local8 + 1) < 100)))) {
_local3 = true;
_local9 = _arg1[_local4].getBounds(_arg1[_local4].parent);
_local9 = _local9.intersection(_arg1[_local7].getBounds(_arg1[_local7].parent));
_local10 = new Point();
_local10.x = (_arg1[_local4].x - _arg1[_local7].x);
_local10.y = (_arg1[_local4].y - _arg1[_local7].y);
_local10.normalize(1);
++_local6;
if ((_local6 % 4) == 0){
_arg1[_local7].x = (_arg1[_local7].x - (_local10.x * 3));
} else {
++_local6;
if ((_local6 % 3) == 0){
_arg1[_local7].y = (_arg1[_local7].y - (_local10.y * 3));
} else {
++_local6;
if ((_local6 % 2) == 0){
_arg1[_local4].x = (_arg1[_local4].x + (_local10.x * 3));
} else {
_arg1[_local4].y = (_arg1[_local4].y + (_local10.y * 3));
};
};
};
};
};
};
};
b_LastHit = _local3;
return (_local3);
}
public function Init(){
var rc_Bounds:Rectangle;
var square:Number;
var squareRatio:Number;
var sliceRatio:Number;
var i:int;
var l:int;
stage.addEventListener(Event.ENTER_FRAME, OEF);
arr_Objects = new Array();
arr_Bounds = new Array();
b_LastHit = true;
i = -1;
l = 1000;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects.push(getChildAt(i));
rc_Bounds = getChildAt(i).getBounds(this);
square = (rc_Bounds.width * rc_Bounds.height);
squareRatio = (square / squareIdeal);
if ((((squareRatio > 0.66)) && ((squareRatio < 2.25)))){
arr_Bounds.push(squareRatio);
};
} catch(e) {
break;
};
};
squareRatio = (arr_Bounds.length / arr_Objects.length);
sliceRatio = (arr_Bounds.length / ((sliceLimit <= 1)) ? 2 : sliceLimit);
var _local2 = parent;
_local2["setRatios"](squareRatio, sliceRatio);
}
public function OEF(_arg1=null):void{
counter++;
if (!ExcludeHits(arr_Objects)){
stage.removeEventListener(Event.ENTER_FRAME, OEF);
};
}
function frame1(){
counter = -1;
b_LastHit = true;
}
public function DestroyAll(){
var i:int;
var l:int;
i = -1;
l = arr_Objects.length;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Objects[i].Destroy();
} catch(e) {
trace("DestroyAll() -> some errors occured");
};
};
}
public function Init_Main(){
var arr_Finded:Array;
var i:int;
var l:int;
var rc_tmp:Rectangle;
counter = -1;
b_LastHit = true;
rc_BoundsIdeal = parent["mc_ideal"].getBounds(parent);
squareIdeal = (rc_BoundsIdeal.width * rc_BoundsIdeal.height);
sliceLimit = 0;
arr_Finded = new Array();
i = -1;
l = 32;
while ((i = (i + 1)), (i + 1) < l) {
try {
arr_Finded.push(new BitmapSlice(getChildAt(i)));
rc_tmp = getChildAt(i).getBounds(this);
sliceLimit = (sliceLimit + int((((0.5 * rc_tmp.width) * rc_tmp.height) / squareIdeal)));
} catch(e) {
break;
};
};
i = arr_Finded.length;
while ((i = (i - 1)), (i - 1) > -1) {
removeChildAt(i);
};
i = -1;
l = arr_Finded.length;
while ((i = (i + 1)), (i + 1) < l) {
addChild(arr_Finded[i]);
};
trace(("sliceLimit: " + sliceLimit));
}
}
}//package 07e_fla
Section 10
//continue_Symbol1_87 (07e_fla.continue_Symbol1_87)
package 07e_fla {
import flash.display.*;
public dynamic class continue_Symbol1_87 extends MovieClip {
public function continue_Symbol1_87(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package 07e_fla
Section 11
//fail_Symbol1_89 (07e_fla.fail_Symbol1_89)
package 07e_fla {
import flash.display.*;
public dynamic class fail_Symbol1_89 extends MovieClip {
public function fail_Symbol1_89(){
addFrameScript(149, frame150);
}
function frame150(){
stop();
}
}
}//package 07e_fla
Section 12
//fail_Symbol5_92 (07e_fla.fail_Symbol5_92)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class fail_Symbol5_92 extends MovieClip {
public var btn_:SimpleButton;
public function fail_Symbol5_92(){
addFrameScript(0, frame1);
}
function frame1(){
btn_.addEventListener(MouseEvent.CLICK, function (_arg1){
navigateToURL(new URLRequest("http://games2girls.com"), "_self");
});
}
}
}//package 07e_fla
Section 13
//fail_Symbol7_90 (07e_fla.fail_Symbol7_90)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class fail_Symbol7_90 extends MovieClip {
public var btn_:SimpleButton;
public function fail_Symbol7_90(){
addFrameScript(0, frame1);
}
function frame1(){
btn_.addEventListener(MouseEvent.CLICK, function (_arg1){
var _local2 = root;
_local2["gotoAndPlay"]("menu");
});
}
}
}//package 07e_fla
Section 14
//hidden_hints_31 (07e_fla.hidden_hints_31)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import lib_Tools.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class hidden_hints_31 extends MovieClip {
public var i_W:uint;
public var i_X:int;
public var i_dW:uint;
public var i_Y:int;
public var i_dH:uint;
public var mc_hint_line:hidden_hints_line;
public var l1:int;
public var l2:int;
public var tm_id;
public var rc_Bounds_I:Rectangle;
public var rc_Bounds_S:Rectangle;
public var mc_dup;
public var i1:int;
public var i2:int;
public var i_H:uint;
public function hidden_hints_31(){
addFrameScript(0, frame1);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function TOGGLE(){
if (visible){
HIDE();
} else {
SHOW();
};
}
function frame1(){
if (((parent["mc_slicer"]) && (parent["mc_ideal"]))){
rc_Bounds_S = parent["mc_slicer"].getBounds(parent);
rc_Bounds_I = parent["mc_ideal"].getBounds(parent);
i_X = rc_Bounds_S.x;
i_Y = rc_Bounds_S.y;
i_W = rc_Bounds_I.width;
i_H = rc_Bounds_I.height;
i_dW = (rc_Bounds_S.width / i_W);
i_dH = (rc_Bounds_S.height / i_H);
i1 = 0;
l1 = i_dW;
while (++i1 < l1) {
mc_dup = MovieClipTools.DuplicateMovieClip(mc_hint_line, this);
mc_dup.x = (i_X + (i_W * i1));
mc_dup.y = i_Y;
mc_dup.width = rc_Bounds_S.height;
mc_dup.rotation = 90;
};
i2 = 0;
l2 = i_dH;
while (++i2 < l2) {
mc_dup = MovieClipTools.DuplicateMovieClip(mc_hint_line, this);
mc_dup.x = i_X;
mc_dup.y = (i_Y + (i_H * i2));
mc_dup.width = rc_Bounds_S.width;
mc_dup.rotation = 0;
};
};
alpha = 0;
visible = false;
if (!parent["mc_lineIdeal"]){
if (parent.name.indexOf("1_1") > -1){
} else {
setTimeout(SHOW, 500);
setTimeout(HIDE, 4500);
};
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
clearTimeout(tm_id);
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
tm_id = setTimeout(HIDE, 5000);
}
}
}//package 07e_fla
Section 15
//hint_01_57 (07e_fla.hint_01_57)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public dynamic class hint_01_57 extends MovieClip {
public var btn_hide:SimpleButton;
public var tm_id;
public function hint_01_57(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1=null){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function TOGGLE(_arg1=null){
if (visible){
HIDE();
} else {
SHOW();
};
}
function frame1(){
btn_hide.addEventListener(MouseEvent.CLICK, HIDE);
alpha = 0;
visible = false;
tm_id = -2;
setTimeout(SHOW, 0);
setTimeout(HIDE, 10000);
}
public function HIDE(_arg1=null){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
clearTimeout(tm_id);
tm_id = -2;
}
public function OEF_H(_arg1=null){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(_arg1=null){
if (tm_id == -2){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
tm_id = setTimeout(HIDE, 4000);
};
}
}
}//package 07e_fla
Section 16
//hint_01copy_34 (07e_fla.hint_01copy_34)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class hint_01copy_34 extends MovieClip {
public var mc_hint_line:hidden_hints_line;
public var id_h:int;
public var btn_hide:SimpleButton;
public var id_s:int;
public var mc_knife:MovieClip;
public function hint_01copy_34(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1=null){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function TOGGLE(_arg1=null){
if (visible){
HIDE();
} else {
SHOW();
};
}
function frame1(){
btn_hide.addEventListener(MouseEvent.CLICK, HIDE);
alpha = 0;
visible = false;
id_s = setTimeout(SHOW, 0);
id_h = setTimeout(HIDE, 30000);
}
public function HIDE(_arg1=null){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
parent["mc_hint"].SHOW();
clearTimeout(id_s);
clearTimeout(id_h);
}
public function OEF_H(_arg1=null){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(_arg1=null){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 17
//hint_02_66 (07e_fla.hint_02_66)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public dynamic class hint_02_66 extends MovieClip {
public var btn_hide:SimpleButton;
public var tm_id;
public function hint_02_66(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1=null){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function TOGGLE(_arg1=null){
if (visible){
HIDE();
} else {
SHOW();
};
}
function frame1(){
btn_hide.addEventListener(MouseEvent.CLICK, HIDE);
alpha = 0;
visible = false;
tm_id = -2;
setTimeout(SHOW, 0);
setTimeout(HIDE, 10000);
}
public function HIDE(_arg1=null){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
clearTimeout(tm_id);
tm_id = -2;
}
public function OEF_H(_arg1=null){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(_arg1=null){
if (tm_id == -2){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
tm_id = setTimeout(HIDE, 4000);
};
}
}
}//package 07e_fla
Section 18
//hint_03_78 (07e_fla.hint_03_78)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public dynamic class hint_03_78 extends MovieClip {
public var btn_hide:SimpleButton;
public var tm_id;
public function hint_03_78(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1=null){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function TOGGLE(_arg1=null){
if (visible){
HIDE();
} else {
SHOW();
};
}
function frame1(){
btn_hide.addEventListener(MouseEvent.CLICK, HIDE);
alpha = 0;
visible = false;
tm_id = -2;
setTimeout(SHOW, 0);
setTimeout(HIDE, 10000);
}
public function HIDE(_arg1=null){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
clearTimeout(tm_id);
tm_id = -2;
}
public function OEF_H(_arg1=null){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(_arg1=null){
if (tm_id == -2){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
tm_id = setTimeout(HIDE, 4000);
};
}
}
}//package 07e_fla
Section 19
//knife_25 (07e_fla.knife_25)
package 07e_fla {
import flash.display.*;
public dynamic class knife_25 extends MovieClip {
public var mc_blade:MovieClip;
public var mc_hand:MovieClip;
}
}//package 07e_fla
Section 20
//knifecopy_36 (07e_fla.knifecopy_36)
package 07e_fla {
import flash.display.*;
public dynamic class knifecopy_36 extends MovieClip {
public var mc_blade:MovieClip;
public var mc_hand:MovieClip;
}
}//package 07e_fla
Section 21
//MainTimeline (07e_fla.MainTimeline)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
import flash.net.*;
public dynamic class MainTimeline extends MovieClip {
public var mc_Sounds:MovieClip;
public var STATE:String;
public var SCORE:uint;
public var btn_OK:SimpleButton;
public var stage_1_1:MovieClip;
public var Tryings:int;
public var mc_tryagain:MovieClip;
public var btn_3:SimpleButton;
public var item:ContextMenuItem;
public var btn_1:SimpleButton;
public var btn_2:SimpleButton;
public var mc_wins:MovieClip;
public var mc_continue:MovieClip;
public var StageType:int;
public var i_timeUsed:int;
public var i_timeStart:int;
public var Level:int;
public var mc_halo_1:MovieClip;
public var mc_halo_3:MovieClip;
public var txt_percents:TextField;
public var mc_halo_2:MovieClip;
public var f_timePsb:Number;
public var my_cm:ContextMenu;
public function MainTimeline(){
addFrameScript(0, frame1, 8, frame9, 14, frame15, 21, frame22, 24, frame25, 33, frame34, 49, frame50, 63, frame64, 78, frame79, 93, frame94, 108, frame109, 123, frame124, 143, frame144, 157, frame158, 172, frame173, 187, frame188, 213, frame214, 228, frame229, 243, frame244, 258, frame259, 273, frame274, 288, frame289, 303, frame304, 339, frame340, 354, frame355, 369, frame370, 384, frame385, 396, frame397, 398, frame399);
}
function frame397(){
var _local1 = mc_wins;
_local1["SET_PROPS"](SCORE);
}
function frame399(){
gotoAndStop((currentFrame - 1));
}
function frame158(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame274(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
public function OnProgress_Root(_arg1:ProgressEvent){
var _local2:int;
_local2 = ((100 * _arg1.bytesLoaded) / _arg1.bytesTotal);
txt_percents.text = (_local2 + "%");
}
function frame289(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame15(){
if (STATE != "ERROR"){
gotoAndPlay("menu");
};
}
function frame173(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame1(){
item = new ContextMenuItem("More games ...");
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onClickMenu);
my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
my_cm.customItems.push(item);
contextMenu = my_cm;
STATE = "TRY_AGAIN | CONTINUE | WINS | FAIL";
stop();
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, OnProgress_Root);
root.loaderInfo.addEventListener(Event.COMPLETE, OnComplete_Root);
}
function frame22(){
gotoAndStop((currentFrame - 1));
}
function frame9(){
gotoAndStop((currentFrame - 1));
}
function frame25(){
StageType = 1;
Level = 1;
Tryings = 3;
i_timeStart = getTimer();
i_timeUsed = getTimer();
f_timePsb = 1000;
SCORE = 1000;
}
function frame188(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
public function OnComplete_Root(_arg1:Event){
gotoAndPlay("menu");
}
function frame34(){
gotoAndStop((currentFrame - 1));
btn_1.addEventListener(MouseEvent.CLICK, function (_arg1=null){
StageType = 1;
gotoAndPlay("stage_1_1");
});
btn_1.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_1;
_local3["SHOW"]();
} catch(e) {
};
});
btn_1.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_1;
_local3["HIDE"]();
} catch(e) {
};
});
btn_2.addEventListener(MouseEvent.CLICK, function (_arg1=null){
StageType = 2;
gotoAndPlay("stage_2_1");
});
btn_2.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_2;
_local3["SHOW"]();
} catch(e) {
};
});
btn_2.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_2;
_local3["HIDE"]();
} catch(e) {
};
});
btn_3.addEventListener(MouseEvent.CLICK, function (_arg1=null){
StageType = 3;
gotoAndPlay("stage_3_1");
});
btn_3.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_3;
_local3["SHOW"]();
} catch(e) {
};
});
btn_3.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1=null){
var e = _arg1;
try {
var _local3 = mc_halo_3;
_local3["HIDE"]();
} catch(e) {
};
});
}
public function CONTINUE(){
trace("root.CONTINUE()");
Level++;
STATE = "CONTINUE";
gotoAndPlay("continue");
}
function frame50(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame304(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame64(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame79(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
public function PLAY_TRYAGAIN(){
gotoAndPlay(((("stage_" + StageType) + "_") + Level));
}
function frame94(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame214(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
public function PLAY_CONTINUE(){
var _local1:String;
_local1 = ((("stage_" + StageType) + "_") + Level);
if (((((!((_local1 == "stage_1_7"))) && (!((_local1 == "stage_2_5"))))) && (!((_local1 == "stage_3_8"))))){
gotoAndPlay(_local1);
} else {
STATE = "WINS";
gotoAndPlay("game_wins");
};
}
function frame340(){
gotoAndStop((currentFrame - 1));
}
function frame109(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame229(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame355(){
gotoAndStop((currentFrame - 1));
}
public function TRY_AGAIN(){
trace("root.TRY_AGAIN()");
if (--Tryings < 0){
STATE = "FAIL";
gotoAndPlay("game_fail");
} else {
STATE = "TRY_AGAIN";
gotoAndPlay("try_again");
};
}
function frame124(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame244(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame259(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
function frame370(){
gotoAndStop((currentFrame - 1));
}
function frame385(){
gotoAndStop((currentFrame - 1));
}
function frame144(){
gotoAndStop((currentFrame - 1));
i_timeStart = getTimer();
}
public function onClickMenu(_arg1=null){
navigateToURL(new URLRequest("http://games2girls.com"), "_blank");
}
public function ERROR(){
STATE = "ERROR";
gotoAndPlay("error");
}
}
}//package 07e_fla
Section 22
//mc_btn_g2g_5 (07e_fla.mc_btn_g2g_5)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class mc_btn_g2g_5 extends MovieClip {
public var btn_g2g:SimpleButton;
public function mc_btn_g2g_5(){
addFrameScript(0, frame1);
}
function frame1(){
btn_g2g.addEventListener(MouseEvent.CLICK, function (_arg1){
navigateToURL(new URLRequest("http://games2girls.com"), "_blank");
});
}
}
}//package 07e_fla
Section 23
//mc_btn_gf_2 (07e_fla.mc_btn_gf_2)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class mc_btn_gf_2 extends MovieClip {
public var btn_gf:SimpleButton;
public function mc_btn_gf_2(){
addFrameScript(0, frame1);
}
function frame1(){
btn_gf.addEventListener(MouseEvent.CLICK, function (_arg1){
navigateToURL(new URLRequest("http://gentleflash.net/portfolio.php?id=salad_day&type=game"), "_blank");
});
}
}
}//package 07e_fla
Section 24
//mc_lineIdealcopy_70 (07e_fla.mc_lineIdealcopy_70)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public dynamic class mc_lineIdealcopy_70 extends MovieClip {
public function mc_lineIdealcopy_70(){
addFrameScript(0, frame1, 12, frame13);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
alpha = 0;
visible = false;
setTimeout(SHOW, 500);
}
function frame13(){
gotoAndPlay(2);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
setTimeout(HIDE, 1000);
}
}
}//package 07e_fla
Section 25
//stage_1_1_18 (07e_fla.stage_1_1_18)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_1_18 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_hint_big:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_1_1_18(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 120000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 26
//stage_1_2_38 (07e_fla.stage_1_2_38)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_2_38 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_1_2_38(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 100000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 27
//stage_1_3_40 (07e_fla.stage_1_3_40)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_3_40 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_1_3_40(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 90000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 28
//stage_1_4_42 (07e_fla.stage_1_4_42)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_4_42 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_1_4_42(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 80000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 29
//stage_1_5_44 (07e_fla.stage_1_5_44)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_5_44 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_1_5_44(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 60000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 30
//stage_1_6_46 (07e_fla.stage_1_6_46)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_1_6_46 extends MovieClip {
public var tmp_01:int;
public var tmp_03:int;
public var tmp_04:int;
public var tmp_02:int;
public var mc_cucum_1:MovieClip;
public var mc_cucum_3:MovieClip;
public var mc_cucum_4:MovieClip;
public var mc_cucum_5:MovieClip;
public var mc_cucum_2:MovieClip;
public var i:int;
public var l:uint;
public var btn_hint:SimpleButton;
public var mc_check_tomatos:MovieClip;
public var mc_zelen_2:MovieClip;
public var mc_salad:MovieClip;
public var mc_zelen_1:MovieClip;
public var mc_check_onion:MovieClip;
public var mc_check_cucumbers:MovieClip;
public var mc_bbox_s:MovieClip;
public var mc_lime:MovieClip;
public var i_time:uint;
public var mc_check_lime:MovieClip;
public var mc_check_greens:MovieClip;
public var myTimer:CountdownTimer;
public var mc_bbox:MovieClip;
public var arr_DNDColl:Array;
public var mc_check_salad:MovieClip;
public var mc_hint:MovieClip;
public var mc_tomato_1:MovieClip;
public var mc_tomato_4:MovieClip;
public var mc_tomato_2:MovieClip;
public var mc_tomato_3:MovieClip;
public var mc_time:MovieClip;
public var mc_onion:MovieClip;
public function stage_1_6_46(){
addFrameScript(0, frame1, 37, frame38);
}
public function OnPosition(_arg1:String):void{
if (_arg1 == "mc_onion"){
mc_check_onion.SHOW();
};
if (_arg1 == "mc_lime"){
mc_check_lime.SHOW();
};
if (_arg1 == "mc_salad"){
mc_check_salad.SHOW();
};
if ((((_arg1 == "mc_cucum")) && ((++tmp_01 >= 5)))){
mc_check_cucumbers.SHOW();
};
if ((((_arg1 == "mc_tomato")) && ((++tmp_02 >= 4)))){
mc_check_tomatos.SHOW();
};
if ((((_arg1 == "mc_zelen")) && ((++tmp_03 >= 2)))){
mc_check_greens.SHOW();
myTimer.onFinish(true);
};
}
public function CheckSalad():Boolean{
return (true);
}
function frame1(){
i_time = 70000;
alpha = 0;
visible = false;
SHOW();
}
public function CheckCucum():Boolean{
return (((mc_check_salad.visible) && (mc_check_tomatos.visible)));
}
function frame38(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
btn_hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
mc_hint.SHOW();
});
mc_time.SHOW();
root["i_timeStart"] = getTimer();
root["f_timePsb"] = (1 / i_time);
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (_arg1:Boolean=false){
myTimer.Destroy();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
setTimeout(HIDE, 1500);
if (_arg1){
setTimeout(root["CONTINUE"], 3000);
} else {
setTimeout(root["TRY_AGAIN"], 3000);
};
i = -1;
l = arr_DNDColl.length;
while (++i < l) {
arr_DNDColl[i].Destroy();
arr_DNDColl[i] = null;
};
arr_DNDColl = new Array();
myTimer.onFinish = null;
};
tmp_01 = 0;
tmp_02 = 0;
tmp_03 = 0;
tmp_04 = 0;
arr_DNDColl = new Array();
arr_DNDColl.push(new DnDSprite(mc_tomato_1, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_2, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_3, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_4, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_zelen_1, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_zelen_2, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_salad, mc_bbox_s, {scaleX:1, scaleY:1}, OnPosition, "mc_salad", CheckSalad));
arr_DNDColl.push(new DnDSprite(mc_cucum_1, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_2, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_3, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_4, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_5, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_lime, mc_bbox, null, OnPosition, "mc_lime", CheckLime));
arr_DNDColl.push(new DnDSprite(mc_onion, mc_bbox, null, OnPosition, "mc_onion", CheckOnion));
}
public function CheckLime():Boolean{
return (((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible)));
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckZelen():Boolean{
return (((((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible))) && (mc_check_lime.visible)));
}
public function CheckTomato():Boolean{
return (mc_check_salad.visible);
}
public function OEF(_arg1=null){
if (mc_hint.alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
myTimer.Stop();
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function CheckOnion():Boolean{
return (((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible)));
}
}
}//package 07e_fla
Section 31
//stage_2_1_58 (07e_fla.stage_2_1_58)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_2_1_58 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_hint_big:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_2_1_58(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 180000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 32
//stage_2_2_59 (07e_fla.stage_2_2_59)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_2_2_59 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_2_2_59(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 100000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 33
//stage_2_3_60 (07e_fla.stage_2_3_60)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_2_3_60 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_2_3_60(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 90000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 34
//stage_2_4_61 (07e_fla.stage_2_4_61)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_2_4_61 extends MovieClip {
public var tmp_01:int;
public var tmp_03:int;
public var tmp_04:int;
public var tmp_02:int;
public var i:int;
public var l:uint;
public var btn_hint:SimpleButton;
public var mc_check_tomatos:MovieClip;
public var mc_zelen_2:MovieClip;
public var mc_salad:MovieClip;
public var mc_zelen_1:MovieClip;
public var mc_bbox_s:MovieClip;
public var mc_cucum:MovieClip;
public var mc_check_cucumbers:MovieClip;
public var mc_lime:MovieClip;
public var i_time:uint;
public var mc_check_greens:MovieClip;
public var myTimer:CountdownTimer;
public var mc_bbox:MovieClip;
public var arr_DNDColl:Array;
public var mc_check_salad:MovieClip;
public var mc_check_peppers:MovieClip;
public var mc_hint:MovieClip;
public var mc_tomato_1:MovieClip;
public var mc_tomato_4:MovieClip;
public var mc_tomato_2:MovieClip;
public var mc_tomato_3:MovieClip;
public var mc_time:MovieClip;
public var mc_pepper_1:MovieClip;
public var mc_pepper_3:MovieClip;
public var mc_rice:MovieClip;
public var mc_pepper_2:MovieClip;
public var mc_pepper_4:MovieClip;
public var mc_cucumber:MovieClip;
public var mc_check_rice:MovieClip;
public function stage_2_4_61(){
addFrameScript(0, frame1, 37, frame38);
}
public function OnPosition(_arg1:String):void{
if (_arg1 == "mc_rice"){
mc_check_rice.SHOW();
};
if (_arg1 == "mc_salad"){
mc_check_salad.SHOW();
};
if (_arg1 == "mc_cucum"){
mc_check_cucumbers.SHOW();
};
if ((((_arg1 == "mc_pepper")) && ((++tmp_01 >= 4)))){
mc_check_peppers.SHOW();
};
if ((((_arg1 == "mc_tomato")) && ((++tmp_02 >= 4)))){
mc_check_tomatos.SHOW();
};
if ((((_arg1 == "mc_zelen")) && ((++tmp_03 >= 2)))){
mc_check_greens.SHOW();
myTimer.onFinish(true);
};
}
function frame1(){
i_time = 70000;
alpha = 0;
visible = false;
SHOW();
}
public function CheckSalad():Boolean{
return (true);
}
public function CheckCucum():Boolean{
return (((mc_check_salad.visible) && (mc_check_rice.visible)));
}
function frame38(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
btn_hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
mc_hint.SHOW();
});
root["i_timeStart"] = getTimer();
root["f_timePsb"] = (1 / i_time);
mc_time.SHOW();
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (_arg1:Boolean=false){
myTimer.Destroy();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
setTimeout(HIDE, 1500);
if (_arg1){
setTimeout(root["CONTINUE"], 3000);
} else {
setTimeout(root["TRY_AGAIN"], 3000);
};
i = -1;
l = arr_DNDColl.length;
while (++i < l) {
arr_DNDColl[i].Destroy();
arr_DNDColl[i] = null;
};
arr_DNDColl = new Array();
myTimer.onFinish = null;
};
tmp_01 = 0;
tmp_02 = 0;
tmp_03 = 0;
tmp_04 = 0;
arr_DNDColl = new Array();
arr_DNDColl.push(new DnDSprite(mc_tomato_1, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_2, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_3, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_4, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_pepper_1, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_pepper_2, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_pepper_3, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_pepper_4, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_zelen_1, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_zelen_2, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_cucum, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_salad, mc_bbox_s, {scaleX:1, scaleY:1}, OnPosition, "mc_salad", CheckSalad));
arr_DNDColl.push(new DnDSprite(mc_rice, mc_bbox, {scaleX:1, scaleY:1}, OnPosition, "mc_rice", CheckRice));
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckZelen():Boolean{
return (((((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_rice.visible))) && (mc_check_peppers.visible)));
}
public function CheckTomato():Boolean{
return (((((mc_check_salad.visible) && (mc_check_rice.visible))) && (mc_check_cucumbers.visible)));
}
public function CheckPepper():Boolean{
return (((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_rice.visible)));
}
public function OEF(_arg1=null){
if (mc_hint.alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
myTimer.Stop();
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function CheckRice():Boolean{
return (mc_check_salad.visible);
}
}
}//package 07e_fla
Section 35
//stage_3_1_67 (07e_fla.stage_3_1_67)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_1_67 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_hint_big:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_1_67(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 180000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 36
//stage_3_2_68 (07e_fla.stage_3_2_68)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_2_68 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var mc_lineIdeal:MovieClip;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var btn_End:SimpleButton;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_2_68(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 30000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 37
//stage_3_3_71 (07e_fla.stage_3_3_71)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_3_71 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var mc_lineIdeal:MovieClip;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var btn_End:SimpleButton;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_3_71(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 30000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 38
//stage_3_4_72 (07e_fla.stage_3_4_72)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_4_72 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_4_72(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 60000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 39
//stage_3_5_73 (07e_fla.stage_3_5_73)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_5_73 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_5_73(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 70000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 40
//stage_3_6_74 (07e_fla.stage_3_6_74)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_6_74 extends MovieClip {
public var myTimer:CountdownTimer;
public var p_First:Point;
public var mc_left:MovieClip;
public var mc_hand_OK:MovieClip;
public var i_time:uint;
public var mc_top:MovieClip;
public var mc_bottom:MovieClip;
public var totalRatio:Number;
public var mc_right:MovieClip;
public var p_Second:Point;
public var mc_hint_sample:MovieClip;
public var btn_End:SimpleButton;
public var mc_LnId;
public var mc_ideal:MovieClip;
public var b_CheckIt:Boolean;
public var mc_hint:MovieClip;
public var sliceRatio:Number;
public var _frame:uint;
public var btn_Hint:SimpleButton;
public var mc_indicator_tt:MovieClip;
public var mc_knife:MovieClip;
public var mc_time:MovieClip;
public var b_NoLooseAble:Boolean;
public var mc_slicer:MovieClip;
public var squareRatio:Number;
public function stage_3_6_74(){
addFrameScript(0, frame1, 29, frame30);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckRatio(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Array;
var _local9:Rectangle;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:int;
if (((b_CheckIt) && (this["mc_lineIdeal"]))){
b_CheckIt = false;
if (mc_slicer.arr_Objects.length > 1){
_local1 = this["mc_lineIdeal"].localToGlobal(new Point(0, 0));
_local2 = this["mc_lineIdeal"].localToGlobal(new Point(100, 0));
_local3 = this.localToGlobal(p_First);
_local4 = this.localToGlobal(p_Second);
_local5 = new Point((_local2.x - _local1.x), (_local2.y - _local1.y));
_local5.normalize(1);
_local6 = new Point((_local4.x - _local3.x), (_local4.y - _local3.y));
_local6.normalize(1);
_local7 = (((_local5.x * _local6.x) + (_local5.y * _local6.y)) / Math.sqrt((((_local5.x * _local5.x) + (_local5.y * _local5.y)) * ((_local6.x * _local6.x) + (_local6.y * _local6.y)))));
if (Math.abs(_local7) < 0.92){
OnRatio(false);
} else {
_local8 = new Array();
_local11 = -1;
_local12 = mc_slicer.arr_Objects.length;
while (++_local11 < _local12) {
_local9 = mc_slicer.arr_Objects[_local11].getBounds(mc_slicer);
_local8[_local11] = (_local9.width * _local9.height);
};
_local13 = true;
_local11 = -1;
_local12 = _local8.length;
while (++_local11 < _local12) {
_local14 = -1;
while (++_local14 < _local12) {
_local10 = (((_local8[_local11] / _local8[_local14]) > 1)) ? (_local8[_local14] / _local8[_local11]) : (_local8[_local11] / _local8[_local14]);
if (_local10 < 0.75){
trace("ratio too low");
_local13 = false;
break;
};
};
};
if (_local13){
OnRatio(true);
} else {
OnRatio(false);
};
};
};
};
}
public function OEF(_arg1=null){
if (++_frame >= 30){
_frame = 0;
if (((((((mc_slicer.hitTestObject(mc_top)) || (mc_slicer.hitTestObject(mc_bottom)))) || (mc_slicer.hitTestObject(mc_left)))) || (mc_slicer.hitTestObject(mc_right)))){
myTimer.onFinish();
};
};
if (this["mc_hint_big"]){
mc_slicer.alpha = (1 - this["mc_hint_big"].alpha);
if (this["mc_hint_big"].alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
if (myTimer.isWork){
myTimer.Stop();
};
};
};
CheckRatio();
}
public function OnRatio(_arg1:Boolean){
var tmp_0:CountdownTimer;
var in_bool = _arg1;
HIDE();
if (in_bool){
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["CONTINUE"]();
};
} else {
tmp_0 = new CountdownTimer(null, 500);
tmp_0.onFinish = function (){
Destroy();
var _local1 = root;
_local1["TRY_AGAIN"]();
};
};
}
public function OnMouseMoveR(_arg1=null):void{
var _local2:Point;
var _local3:Number;
var _local4:Number;
p_Second = new Point(mouseX, mouseY);
_local2 = new Point((p_Second.x - p_First.x), (p_Second.y - p_First.y));
_local3 = Math.sqrt(((_local2.x * _local2.x) + (_local2.y * _local2.y)));
_local2.normalize(1);
_local4 = ((((_local2.y < 0)) && ((_local2.x > 0)))) ? ((2 * Math.PI) + Math.asin(_local2.y)) : ((_local2.x < 0)) ? (Math.PI - Math.asin(_local2.y)) : Math.asin(_local2.y);
_local4 = (_local4 * (180 / Math.PI));
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = _local3;
mc_knife["mc_hand"].x = _local3;
mc_knife.rotation = _local4;
}
function frame1(){
i_time = 60000;
alpha = 0;
visible = false;
SHOW();
}
public function OnMouseUp(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
if (this["mc_lineIdeal"]){
b_CheckIt = true;
};
if (this["mc_hint_big"]){
if (this["mc_hint_big"].alpha <= 0){
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
} else {
root["mc_Sounds"].PLAY(("knife_" + int((1.5 + Math.random()))));
};
}
function frame30(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
mc_LnId = this["mc_lineIdeal"];
if (mc_LnId){
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
mc_LnId.SHOW();
});
} else {
btn_Hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1){
var _local2 = mc_hint;
_local2["TOGGLE"]();
});
};
btn_End.addEventListener(MouseEvent.CLICK, function (_arg1){
myTimer.onFinish();
});
btn_End.visible = false;
b_NoLooseAble = false;
squareRatio = 0;
sliceRatio = 0;
totalRatio = 0;
b_CheckIt = false;
_frame = 0;
var _local2 = mc_slicer;
_local2["Init_Main"]();
_local2 = mc_slicer;
_local2["Init"]();
mc_time.SHOW();
mc_knife.x = 300;
mc_knife.y = 200;
mc_knife.rotation = 90;
root["i_timeStart"] = getTimer();
root["f_timePsb"] = i_time;
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (){
trace(("onFinish: " + getTimer()));
var _local1 = mc_slicer;
_local1["DestroyAll"]();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
if (((b_NoLooseAble) || ((((totalRatio >= 1)) && ((myTimer.getTime() > 0)))))){
trace("You wins");
_local1 = root;
_local1["CONTINUE"]();
} else {
trace("You looses");
HIDE();
setTimeout(root["TRY_AGAIN"], 1000);
};
myTimer.Destroy();
myTimer.onFinish = null;
};
}
public function OnMouseDown(_arg1=null){
stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
p_First = new Point(mouseX, mouseY);
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnMouseMoveM(_arg1=null):void{
mc_knife.x = mouseX;
mc_knife.y = mouseY;
mc_knife.rotation = 0;
mc_knife["mc_blade"].width = 150;
mc_knife["mc_hand"].x = 150;
mc_knife.rotation = 45;
}
public function setRatios(_arg1:Number, _arg2:Number){
squareRatio = _arg1;
sliceRatio = _arg2;
totalRatio = ((squareRatio * sliceRatio) / 0.8);
if (mc_indicator_tt.currentFrame > (int((100 * totalRatio)) + 1)){
root["mc_Sounds"].PLAY("negativy");
} else {
root["mc_Sounds"].PLAY("positivy");
};
mc_indicator_tt.gotoAndStop((int((100 * totalRatio)) + 1));
if (totalRatio >= 1){
if (!btn_End.visible){
mc_slicer.alpha = 0.9;
btn_End.visible = true;
mc_hand_OK.play();
root["mc_Sounds"].PLAY("end_of_level");
setTimeout(HIDE, 1000);
setTimeout(myTimer.onFinish, 2300);
};
};
}
public function OnClick(_arg1=null){
}
public function Destroy():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveM);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMoveR);
var _local1 = mc_slicer;
_local1["DestroyAll"]();
myTimer.Destroy();
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 41
//stage_3_7_75 (07e_fla.stage_3_7_75)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stage_3_7_75 extends MovieClip {
public var tmp_01:int;
public var tmp_03:int;
public var tmp_04:int;
public var tmp_02:int;
public var mc_cucum_1:MovieClip;
public var mc_cucum_3:MovieClip;
public var mc_cucum_4:MovieClip;
public var mc_cucum_5:MovieClip;
public var mc_cucum_2:MovieClip;
public var i:int;
public var l:uint;
public var btn_hint:SimpleButton;
public var mc_check_tomatos:MovieClip;
public var mc_zelen_2:MovieClip;
public var mc_salad:MovieClip;
public var mc_zelen_1:MovieClip;
public var mc_check_onion:MovieClip;
public var mc_check_cucumbers:MovieClip;
public var mc_bbox_s:MovieClip;
public var mc_check_olive:MovieClip;
public var mc_lime:MovieClip;
public var i_time:uint;
public var mc_check_lime:MovieClip;
public var mc_check_greens:MovieClip;
public var myTimer:CountdownTimer;
public var mc_bbox:MovieClip;
public var arr_DNDColl:Array;
public var mc_check_salad:MovieClip;
public var mc_check_peppers:MovieClip;
public var mc_hint:MovieClip;
public var mc_tomato_1:MovieClip;
public var mc_tomato_2:MovieClip;
public var mc_time:MovieClip;
public var mc_pepper_1:MovieClip;
public var mc_pepper_2:MovieClip;
public var mc_onion:MovieClip;
public var mc_olive:MovieClip;
public function stage_3_7_75(){
addFrameScript(0, frame1, 37, frame38);
}
public function OnPosition(_arg1:String):void{
if (_arg1 == "mc_onion"){
mc_check_onion.SHOW();
};
if (_arg1 == "mc_lime"){
mc_check_lime.SHOW();
};
if (_arg1 == "mc_olive"){
mc_check_olive.SHOW();
};
if (_arg1 == "mc_salad"){
mc_check_salad.SHOW();
};
if ((((_arg1 == "mc_cucum")) && ((++tmp_01 >= 5)))){
mc_check_cucumbers.SHOW();
};
if ((((_arg1 == "mc_tomato")) && ((++tmp_02 >= 2)))){
mc_check_tomatos.SHOW();
};
if ((((_arg1 == "mc_pepper")) && ((++tmp_04 >= 2)))){
mc_check_peppers.SHOW();
};
if ((((_arg1 == "mc_zelen")) && ((++tmp_03 >= 2)))){
mc_check_greens.SHOW();
myTimer.onFinish(true);
};
}
function frame1(){
i_time = 70000;
alpha = 0;
visible = false;
SHOW();
}
public function CheckSalad():Boolean{
return (true);
}
public function CheckCucum():Boolean{
return (((mc_check_salad.visible) && (mc_check_tomatos.visible)));
}
function frame38(){
stop();
stage.addEventListener(Event.ENTER_FRAME, OEF);
btn_hint.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1=null){
mc_hint.SHOW();
});
root["i_timeStart"] = getTimer();
root["f_timePsb"] = (1 / i_time);
mc_time.SHOW();
myTimer = new CountdownTimer(mc_time, i_time);
myTimer.onFinish = function (_arg1:Boolean=false){
myTimer.Destroy();
stage.removeEventListener(Event.ENTER_FRAME, OEF);
setTimeout(HIDE, 1500);
if (_arg1){
setTimeout(root["CONTINUE"], 3000);
} else {
setTimeout(root["TRY_AGAIN"], 3000);
};
i = -1;
l = arr_DNDColl.length;
while (++i < l) {
arr_DNDColl[i].Destroy();
arr_DNDColl[i] = null;
};
arr_DNDColl = new Array();
myTimer.onFinish = null;
};
tmp_01 = 0;
tmp_02 = 0;
tmp_03 = 0;
tmp_04 = 0;
arr_DNDColl = new Array();
arr_DNDColl.push(new DnDSprite(mc_tomato_1, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_tomato_2, mc_bbox, null, OnPosition, "mc_tomato", CheckTomato));
arr_DNDColl.push(new DnDSprite(mc_zelen_1, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_zelen_2, mc_bbox, null, OnPosition, "mc_zelen", CheckZelen));
arr_DNDColl.push(new DnDSprite(mc_pepper_1, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_pepper_2, mc_bbox, null, OnPosition, "mc_pepper", CheckPepper));
arr_DNDColl.push(new DnDSprite(mc_cucum_1, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_2, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_3, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_4, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_cucum_5, mc_bbox, null, OnPosition, "mc_cucum", CheckCucum));
arr_DNDColl.push(new DnDSprite(mc_lime, mc_bbox, null, OnPosition, "mc_lime", CheckLime));
arr_DNDColl.push(new DnDSprite(mc_onion, mc_bbox, null, OnPosition, "mc_onion", CheckOnion));
arr_DNDColl.push(new DnDSprite(mc_olive, mc_bbox, null, OnPosition, "mc_olive", CheckOlive));
arr_DNDColl.push(new DnDSprite(mc_salad, mc_bbox_s, {scaleX:1, scaleY:1}, OnPosition, "mc_salad", CheckSalad));
}
public function CheckLime():Boolean{
return (((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible)));
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
public function CheckZelen():Boolean{
return (((((((((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible))) && (mc_check_lime.visible))) && (mc_check_peppers.visible))) && (mc_check_olive.visible)));
}
public function CheckTomato():Boolean{
return (mc_check_salad.visible);
}
public function CheckPepper():Boolean{
return (((((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible))) && (mc_check_lime.visible)));
}
public function OEF(_arg1=null){
if (mc_hint.alpha <= 0){
if (!myTimer.isWork){
myTimer.Start();
};
} else {
myTimer.Stop();
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function CheckOnion():Boolean{
return (((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible)));
}
public function CheckOlive():Boolean{
return (((((((((((mc_check_salad.visible) && (mc_check_tomatos.visible))) && (mc_check_cucumbers.visible))) && (mc_check_onion.visible))) && (mc_check_lime.visible))) && (mc_check_peppers.visible)));
}
}
}//package 07e_fla
Section 42
//Symbol12_12 (07e_fla.Symbol12_12)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol12_12 extends MovieClip {
public function Symbol12_12(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
alpha = 0;
visible = false;
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 43
//Symbol12copy_23 (07e_fla.Symbol12copy_23)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Symbol12copy_23 extends MovieClip {
public var txt_sec:TextField;
public var txt_min:TextField;
public function Symbol12copy_23(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function SET_TIME(_arg1, _arg2, _arg3):void{
if (_arg1 < 10){
_arg1 = ("0" + _arg1);
};
if (_arg2 < 10){
_arg2 = ("0" + _arg2);
};
if (_arg3 < 10){
_arg3 = ("0" + _arg3);
};
_arg1 = (_arg1 + "");
_arg2 = (_arg2 + "");
_arg3 = (_arg3 + "");
alpha = 1;
if ((((_arg1 == "00")) && ((int(_arg2) < 10)))){
alpha = (0.2 + Math.random());
if (txt_sec.text != _arg2){
root["mc_Sounds"].PLAY("second_alarm");
};
};
if (txt_sec.text != _arg2){
if ((((((_arg1 == "00")) && ((int(_arg2) < 10)))) && ((int(_arg2) > 0)))){
} else {
root["mc_Sounds"].PLAY("second");
};
};
txt_min.text = _arg1;
txt_sec.text = _arg2;
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 44
//Symbol13_13 (07e_fla.Symbol13_13)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol13_13 extends MovieClip {
public function Symbol13_13(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
alpha = 0;
visible = false;
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 45
//Symbol14_14 (07e_fla.Symbol14_14)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol14_14 extends MovieClip {
public function Symbol14_14(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
alpha = 0;
visible = false;
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 46
//Symbol18_21 (07e_fla.Symbol18_21)
package 07e_fla {
import flash.display.*;
public dynamic class Symbol18_21 extends MovieClip {
public function Symbol18_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package 07e_fla
Section 47
//Symbol19_24 (07e_fla.Symbol19_24)
package 07e_fla {
import flash.display.*;
public dynamic class Symbol19_24 extends MovieClip {
public function Symbol19_24(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package 07e_fla
Section 48
//Symbol2_33 (07e_fla.Symbol2_33)
package 07e_fla {
import flash.display.*;
public dynamic class Symbol2_33 extends MovieClip {
public function Symbol2_33(){
addFrameScript(0, frame1);
}
function frame1(){
alpha = 0;
visible = false;
}
}
}//package 07e_fla
Section 49
//Symbol21_7 (07e_fla.Symbol21_7)
package 07e_fla {
import flash.display.*;
public dynamic class Symbol21_7 extends MovieClip {
public function Symbol21_7(){
addFrameScript(0, frame1, 4, frame5, 24, frame25, 44, frame45, 64, frame65, 84, frame85, 104, frame105, 124, frame125, 144, frame145, 164, frame165);
}
function frame65(){
gotoAndStop(2);
}
function frame165(){
gotoAndStop(2);
}
function frame85(){
gotoAndStop(2);
}
public function PLAY(_arg1:String):void{
gotoAndStop(2);
gotoAndPlay(_arg1.toLowerCase());
gotoAndStop(2);
}
function frame105(){
gotoAndStop(2);
}
function frame1(){
}
function frame25(){
gotoAndStop(2);
}
function frame5(){
gotoAndStop(2);
}
function frame125(){
gotoAndStop(2);
}
function frame45(){
gotoAndStop(2);
}
function frame145(){
gotoAndStop(2);
}
}
}//package 07e_fla
Section 50
//Symbol5_30 (07e_fla.Symbol5_30)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Symbol5_30 extends MovieClip {
public function Symbol5_30(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(MouseEvent.MOUSE_OVER, OnMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, OnMouseOut);
}
public function OnMouseOut(_arg1=null){
parent["mc_hint_sample"].HIDE();
}
public function OnMouseOver(_arg1=null){
parent["mc_hint_sample"].SHOW();
}
}
}//package 07e_fla
Section 51
//Symbol9_29 (07e_fla.Symbol9_29)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol9_29 extends MovieClip {
public function Symbol9_29(){
addFrameScript(0, frame1);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.2);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame1(){
alpha = 0;
visible = false;
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 52
//tryagain_Symbol1_79 (07e_fla.tryagain_Symbol1_79)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class tryagain_Symbol1_79 extends MovieClip {
public var i_scoreNow:uint;
public var txt_score:TextField;
public var btn_continue:SimpleButton;
public var i_score:uint;
public var i_timeHold:uint;
public var tm_id:int;
public var i_timeAdd:uint;
public var i_scoreAdd:uint;
public function tryagain_Symbol1_79(){
addFrameScript(0, frame1, 1, frame2, 74, frame75);
}
public function OEF_S(_arg1){
visible = true;
if (alpha < 1){
alpha = (alpha + 0.07);
} else {
removeEventListener(Event.ENTER_FRAME, OEF_S);
};
}
function frame75(){
stop();
btn_continue.visible = false;
btn_continue.addEventListener(MouseEvent.CLICK, OnContinue);
i_scoreNow = 0;
OnSetScore();
}
public function SET_PROPS(_arg1:uint=0):void{
i_score = _arg1;
}
function frame1(){
i_score = 4;
i_scoreAdd = 1;
i_timeHold = 3000;
i_timeAdd = 222;
}
public function OnSetScore():void{
tm_id = setTimeout(OnSetScore, i_timeAdd);
i_scoreNow = (i_scoreNow + i_scoreAdd);
if (i_scoreNow <= i_score){
txt_score.text = i_scoreNow.toString();
root["mc_Sounds"].PLAY("score");
} else {
clearTimeout(tm_id);
setTimeout(OnScore, 500);
txt_score.text = i_score.toString();
};
}
function frame2(){
trace("!!!! TRY AGAIN MC");
if (root["STATE"] == "TRY_AGAIN"){
var _local1 = root;
_local1["stop"]();
SET_PROPS((root["Tryings"] + 1));
} else {
if (root["STATE"] == "CONTINUE"){
_local1 = root;
_local1["gotoAndPlay"]("continue");
stop();
} else {
_local1 = root;
_local1["ERROR"]();
stop();
};
};
}
public function HIDE(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_H);
}
public function OnContinue(_arg1=null):void{
setTimeout(HIDE, 100);
setTimeout(parent["PLAY_TRYAGAIN"], (100 + 500));
}
public function OnScore():void{
trace("OnScore");
btn_continue.visible = true;
root["mc_Sounds"].PLAY("appear");
}
public function OEF_H(_arg1){
if (alpha > 0){
alpha = (alpha - 0.07);
} else {
visible = false;
removeEventListener(Event.ENTER_FRAME, OEF_H);
};
}
public function SHOW(){
removeEventListener(Event.ENTER_FRAME, OEF_H);
removeEventListener(Event.ENTER_FRAME, OEF_S);
addEventListener(Event.ENTER_FRAME, OEF_S);
}
}
}//package 07e_fla
Section 53
//wins_Symbol1_94 (07e_fla.wins_Symbol1_94)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class wins_Symbol1_94 extends MovieClip {
public var i_scoreNow:uint;
public var txt_score:TextField;
public var i_score:uint;
public var i_timeHold:uint;
public var tm_id:int;
public var i_timeAdd:uint;
public var i_scoreAdd:uint;
public function wins_Symbol1_94(){
addFrameScript(0, frame1, 83, frame84);
}
public function SET_PROPS(_arg1:uint=0):void{
i_score = _arg1;
}
function frame84(){
stop();
i_scoreNow = 0;
OnSetScore();
}
function frame1(){
i_score = 1000;
i_scoreAdd = 33;
i_timeHold = 3000;
i_timeAdd = 30;
}
public function OnSetScore():void{
tm_id = setTimeout(OnSetScore, i_timeAdd);
i_scoreNow = (i_scoreNow + i_scoreAdd);
if (i_scoreNow <= i_score){
txt_score.text = i_scoreNow.toString();
root["mc_Sounds"].PLAY("score");
} else {
clearTimeout(tm_id);
setTimeout(OnScore, 500);
txt_score.text = i_score.toString();
root["mc_Sounds"].PLAY("money");
};
}
public function OnScore():void{
trace("OnScore");
}
}
}//package 07e_fla
Section 54
//wins_Symbol11_10 (07e_fla.wins_Symbol11_10)
package 07e_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class wins_Symbol11_10 extends MovieClip {
public var btn_:SimpleButton;
public function wins_Symbol11_10(){
addFrameScript(0, frame1);
}
function frame1(){
btn_.addEventListener(MouseEvent.CLICK, function (_arg1){
navigateToURL(new URLRequest("http://games2girls.com"), "_self");
});
}
}
}//package 07e_fla
Section 55
//wins_Symbol9_8 (07e_fla.wins_Symbol9_8)
package 07e_fla {
import flash.display.*;
import flash.events.*;
public dynamic class wins_Symbol9_8 extends MovieClip {
public var btn_:SimpleButton;
public function wins_Symbol9_8(){
addFrameScript(0, frame1);
}
function frame1(){
btn_.addEventListener(MouseEvent.CLICK, function (_arg1){
var _local2 = root;
_local2["gotoAndPlay"]("menu");
});
}
}
}//package 07e_fla
Section 56
//png (cucumber_.png)
package cucumber_ {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package cucumber_
Section 57
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 58
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 59
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 60
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 61
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 62
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 63
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 64
//TextArea (fl.controls.TextArea)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
import flash.system.*;
public class TextArea extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _verticalScrollBar:UIScrollBar;
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _horizontalScrollBar:UIScrollBar;
protected var _horizontalScrollPolicy:String;// = "auto"
protected var _editable:Boolean;// = true
protected var textHasChanged:Boolean;// = false
public var textField:TextField;
protected var _wordWrap:Boolean;// = true
protected var _verticalScrollPolicy:String;// = "auto"
protected static const SCROLL_BAR_STYLES:Object = {downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {upSkin:"TextArea_upSkin", disabledSkin:"TextArea_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextArea(){
_editable = true;
_wordWrap = true;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
_html = false;
textHasChanged = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((!(enabled)) || (!(_verticalScrollBar.visible)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * _verticalScrollBar.lineScrollSize));
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, (_arg1.delta * _verticalScrollBar.lineScrollSize), _verticalScrollBar.scrollPosition));
}
public function get verticalScrollPosition():Number{
return (textField.scrollV);
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
textField.scrollV = _arg1;
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
return;
};
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (_editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
textField.wordWrap = _wordWrap;
textField.multiline = true;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
setIMEMode(true);
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (_local2){
if (editable){
_local2.showFocusIndicator = true;
};
_local2.defaultButtonEnabled = false;
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get wordWrap():Boolean{
return (_wordWrap);
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function get horizontalScrollBar():UIScrollBar{
return (_horizontalScrollBar);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseChildren = enabled;
invalidate(InvalidationType.STATE);
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():Number{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
invalidate(InvalidationType.DATA);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function get maxVerticalScrollPosition():int{
return (textField.maxScrollV);
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
textField.scrollH = _arg1;
}
public function get textHeight():Number{
drawNow();
return (textField.textHeight);
}
public function get textWidth():Number{
drawNow();
return (textField.textWidth);
}
public function get restrict():String{
return (textField.restrict);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
invalidate(InvalidationType.STATE);
}
protected function updateScrollBars(){
_horizontalScrollBar.update();
_verticalScrollBar.update();
_verticalScrollBar.enabled = enabled;
_horizontalScrollBar.enabled = enabled;
_horizontalScrollBar.drawNow();
_verticalScrollBar.drawNow();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():Number{
return (textField.text.length);
}
public function set wordWrap(_arg1:Boolean):void{
_wordWrap = _arg1;
invalidate(InvalidationType.STATE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (IME.conversionMode);
}
protected function handleScroll(_arg1:ScrollEvent):void{
dispatchEvent(_arg1);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
_local2 = focusManager;
if (_local2){
_local2.defaultButtonEnabled = true;
};
setSelection(0, 0);
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
protected function delayedLayoutUpdate(_arg1:Event):void{
if (textHasChanged){
textHasChanged = false;
drawLayout();
return;
};
removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate);
}
public function set htmlText(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
return;
};
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
public function get text():String{
return (textField.text);
}
public function get verticalScrollBar():UIScrollBar{
return (_verticalScrollBar);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STATE)){
updateTextFieldType();
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFont();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
_verticalScrollBar = new UIScrollBar();
_verticalScrollBar.name = "V";
_verticalScrollBar.visible = false;
_verticalScrollBar.focusEnabled = false;
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_verticalScrollBar);
_horizontalScrollBar = new UIScrollBar();
_horizontalScrollBar.name = "H";
_horizontalScrollBar.visible = false;
_horizontalScrollBar.focusEnabled = false;
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_horizontalScrollBar);
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
_horizontalScrollBar.scrollTarget = textField;
_verticalScrollBar.scrollTarget = textField;
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function setTextSize(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
_local4 = (_arg1 - (_arg3 * 2));
_local5 = (_arg2 - (_arg3 * 2));
if (_local4 != textField.width){
textField.width = _local4;
};
if (_local5 != textField.height){
textField.height = _local5;
};
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
invalidate(InvalidationType.DATA);
}
protected function needVScroll():Boolean{
if (_verticalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_verticalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollV > 1));
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
public function get htmlText():String{
return (textField.htmlText);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background != null){
addChildAt(background, 0);
};
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
var _local5:Boolean;
_local1 = Number(getStyleValue("textPadding"));
textField.x = (textField.y = _local1);
background.width = width;
background.height = height;
_local2 = height;
_local3 = needVScroll();
_local4 = (width - (_local3) ? _verticalScrollBar.width : 0);
_local5 = needHScroll();
if (_local5){
_local2 = (_local2 - _horizontalScrollBar.height);
};
setTextSize(_local4, _local2, _local1);
if (((((_local5) && (!(_local3)))) && (needVScroll()))){
_local3 = true;
_local4 = (_local4 - _verticalScrollBar.width);
setTextSize(_local4, _local2, _local1);
};
if (_local3){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = (width - _verticalScrollBar.width);
_verticalScrollBar.height = _local2;
_verticalScrollBar.visible = true;
_verticalScrollBar.enabled = enabled;
} else {
_verticalScrollBar.visible = false;
};
if (_local5){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.y = (height - _horizontalScrollBar.height);
_horizontalScrollBar.width = _local4;
_horizontalScrollBar.visible = true;
_horizontalScrollBar.enabled = enabled;
} else {
_horizontalScrollBar.visible = false;
};
updateScrollBars();
addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true);
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function needHScroll():Boolean{
if (_horizontalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_horizontalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollH > 0));
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
invalidate(InvalidationType.DATA);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 65
//TextInput (fl.controls.TextInput)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 66
//UIScrollBar (fl.controls.UIScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import flash.text.*;
import fl.events.*;
public class UIScrollBar extends ScrollBar {
protected var inScroll:Boolean;// = false
protected var _scrollTarget:TextField;
protected var inEdit:Boolean;// = false
private static var defaultStyles:Object = {};
public function UIScrollBar(){
inEdit = false;
inScroll = false;
super();
}
protected function handleTargetScroll(_arg1:Event):void{
if (inDrag){
return;
};
if (!enabled){
return;
};
inEdit = true;
updateScrollTargetProperties();
scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
inEdit = false;
}
override public function set minScrollPosition(_arg1:Number):void{
super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1;
}
override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
super.setScrollPosition(_arg1, _arg2);
if (!_scrollTarget){
inScroll = false;
return;
};
updateTargetScroll();
}
override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
var _local5:Number;
var _local6:Number;
_local5 = _arg3;
_local6 = ((_arg2)<0) ? 0 : _arg2;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5;
} else {
_local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5;
};
};
super.setScrollProperties(_arg1, _local6, _local5, _arg4);
}
public function get scrollTargetName():String{
return (_scrollTarget.name);
}
public function get scrollTarget():TextField{
return (_scrollTarget);
}
protected function updateScrollTargetProperties():void{
var _local1:Boolean;
var _local2:Number;
if (_scrollTarget == null){
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize);
scrollPosition = 0;
} else {
_local1 = (direction == ScrollBarDirection.HORIZONTAL);
_local2 = (_local1) ? _scrollTarget.width : 10;
setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize);
scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
};
}
public function update():void{
inEdit = true;
updateScrollTargetProperties();
inEdit = false;
}
public function set scrollTargetName(_arg1:String):void{
var target = _arg1;
try {
scrollTarget = (parent.getChildByName(target) as TextField);
} catch(error:Error) {
throw (new Error("ScrollTarget not found, or is not a TextField"));
};
}
override public function set direction(_arg1:String):void{
if (isLivePreview){
return;
};
super.direction = _arg1;
updateScrollTargetProperties();
}
protected function handleTargetChange(_arg1:Event):void{
inEdit = true;
setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true);
updateScrollTargetProperties();
inEdit = false;
}
override public function set maxScrollPosition(_arg1:Number):void{
var _local2:Number;
_local2 = _arg1;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2;
} else {
_local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2;
};
};
super.maxScrollPosition = _local2;
}
protected function updateTargetScroll(_arg1:ScrollEvent=null):void{
if (inEdit){
return;
};
if (direction == ScrollBarDirection.HORIZONTAL){
_scrollTarget.scrollH = scrollPosition;
} else {
_scrollTarget.scrollV = scrollPosition;
};
}
override protected function draw():void{
if (isInvalid(InvalidationType.DATA)){
updateScrollTargetProperties();
};
super.draw();
}
public function set scrollTarget(_arg1:TextField):void{
if (_scrollTarget != null){
_scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false);
_scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false);
_scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false);
removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false);
};
_scrollTarget = _arg1;
if (_scrollTarget != null){
_scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true);
addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true);
};
invalidate(InvalidationType.DATA);
}
override public function get direction():String{
return (super.direction);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 67
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 68
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 69
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 70
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 71
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 72
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 73
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 74
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 75
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 76
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 77
//MatrixTransformer (fl.motion.MatrixTransformer)
package fl.motion {
import flash.geom.*;
public class MatrixTransformer {
public static function getSkewY(_arg1:Matrix):Number{
return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI)));
}
public static function getScaleX(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))));
}
public static function getScaleY(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))));
}
public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
_local3 = getScaleY(_arg1);
_arg1.c = (-(_local3) * Math.sin(_arg2));
_arg1.d = (_local3 * Math.cos(_arg2));
}
public static function setRotation(_arg1:Matrix, _arg2:Number):void{
setRotationRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point;
_local5 = new Point(_arg2, _arg3);
_local5 = _arg1.transformPoint(_local5);
_arg1.tx = (_arg1.tx - _local5.x);
_arg1.ty = (_arg1.ty - _local5.y);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _local5.x);
_arg1.ty = (_arg1.ty + _local5.y);
}
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{
setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{
setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setScaleX(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = getScaleX(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.a = (_arg1.a * _local4);
_arg1.b = (_arg1.b * _local4);
} else {
_local5 = getSkewYRadians(_arg1);
_arg1.a = (Math.cos(_local5) * _arg2);
_arg1.b = (Math.sin(_local5) * _arg2);
};
}
public static function setScaleY(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = getScaleY(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.c = (_arg1.c * _local4);
_arg1.d = (_arg1.d * _local4);
} else {
_local5 = getSkewXRadians(_arg1);
_arg1.c = (-(Math.sin(_local5)) * _arg2);
_arg1.d = (Math.cos(_local5) * _arg2);
};
}
public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
_local3 = getRotationRadians(_arg1);
_local4 = getSkewXRadians(_arg1);
setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3));
setSkewYRadians(_arg1, _arg2);
}
public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
_local3 = getScaleX(_arg1);
_arg1.a = (_local3 * Math.cos(_arg2));
_arg1.b = (_local3 * Math.sin(_arg2));
}
public static function getSkewX(_arg1:Matrix):Number{
return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI)));
}
public static function getSkewYRadians(_arg1:Matrix):Number{
return (Math.atan2(_arg1.b, _arg1.a));
}
public static function getSkewXRadians(_arg1:Matrix):Number{
return (Math.atan2(-(_arg1.c), _arg1.d));
}
public static function getRotation(_arg1:Matrix):Number{
return ((getRotationRadians(_arg1) * (180 / Math.PI)));
}
public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.tx = (_arg1.tx - _arg2);
_arg1.ty = (_arg1.ty - _arg3);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _arg2);
_arg1.ty = (_arg1.ty + _arg3);
}
public static function getRotationRadians(_arg1:Matrix):Number{
return (getSkewYRadians(_arg1));
}
public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{
var _local4:Point;
var _local5:Number;
var _local6:Number;
_local4 = _arg1.transformPoint(_arg2);
_local5 = (_arg3.x - _local4.x);
_local6 = (_arg3.y - _local4.y);
_arg1.tx = (_arg1.tx + _local5);
_arg1.ty = (_arg1.ty + _local6);
}
}
}//package fl.motion
Section 78
//MovieClipTools (lib_Tools.MovieClipTools)
package lib_Tools {
import flash.display.*;
public class MovieClipTools {
public static function RemoveMovieClip(_arg1:DisplayObject, _arg2:Object):void{
_arg2.removeChild(_arg1);
}
public static function DuplicateMovieClip(_arg1:DisplayObject, _arg2:Object, _arg3:Boolean=true):DisplayObject{
var _local4:Object;
var _local5:DisplayObject;
_local4 = _arg2[_arg1.name].constructor;
_local5 = new (_local4);
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.scaleX = _arg1.scaleX;
_local5.scaleY = _arg1.scaleY;
_local5.rotation = _arg1.rotation;
if (_arg3){
_arg2.addChild(_local5);
};
return (_local5);
}
}
}//package lib_Tools
Section 79
//png (lime.png)
package lime {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package lime
Section 80
//png (onion.png)
package onion {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package onion
Section 81
//png (pepper.png)
package pepper {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package pepper
Section 82
//Console (pk_tools.Console)
package pk_tools {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Console extends MovieClip {
public var txt_Input:TextInput;
private var obj_Resize:Object;
private var b_FadeOut:Boolean;// = false
private var b_FadeIn:Boolean;// = false
public var btn_ShowAll:Button;
public var btn_ResizeDown:SimpleButton;
private var LastState:Object;
private var arr_Messages:Array;
public var mc_bg:MovieClip;
public var btn_OK:Button;
private var i_MsgNomber:int;
private var arr_Commands:Array;
public var txt_Output:TextArea;
public static var ConsoleMc:Object;
public function Console():void{
b_FadeIn = false;
b_FadeOut = false;
super();
ConsoleMc = this;
Init();
__setProp_btn_OK_Console_Layer1_1();
__setProp_btn_ShowAll_Console_Layer1_1();
__setProp_txt_Output_Console_Layer1_1();
}
private function InitCommands():void{
arr_Commands = new Array();
AddCommand("commands", PrintAllCommands);
AddCommand("clear", Clear);
}
private function ResizeConsole(_arg1:Number, _arg2:Number, _arg3:Boolean=false):void{
if (stage.stageWidth > 220){
mc_bg.width = (mc_bg.width + _arg1);
txt_Input.width = (txt_Input.width + _arg1);
txt_Output.width = (txt_Output.width + _arg1);
btn_ResizeDown.width = (btn_ResizeDown.width + _arg1);
btn_ShowAll.x = (btn_ShowAll.x + _arg1);
btn_OK.x = (btn_OK.x + _arg1);
};
if ((mc_bg.height + _arg2) > 100){
txt_Output.height = (txt_Output.height + _arg2);
mc_bg.height = (mc_bg.height + _arg2);
btn_OK.y = (btn_OK.y + _arg2);
txt_Input.y = (txt_Input.y + _arg2);
btn_ShowAll.y = (btn_ShowAll.y + _arg2);
btn_ResizeDown.y = (btn_ResizeDown.y + _arg2);
};
if (_arg3){
x = (x - (_arg1 / 2));
y = (y - (_arg2 / 2));
};
}
private function FadeOut():void{
if (alpha > 0){
alpha = (alpha - 0.1);
} else {
visible = false;
b_FadeOut = false;
};
}
private function OnOK(_arg1):void{
var keyCode:int;
var cmd:String;
var e = _arg1;
keyCode = -1;
try {
keyCode = e.keyCode;
} catch(err) {
keyCode = 13;
};
if (keyCode == 13){
cmd = txt_Input.text;
txt_Input.text = "";
if (cmd != ""){
ExecuteCommand(cmd);
};
};
}
public function Show(_arg1:Boolean=true):void{
if (_arg1){
b_FadeIn = true;
b_FadeOut = false;
} else {
visible = true;
alpha = 1;
};
ShowLastMessages();
}
private function Clear():void{
arr_Messages = new Array();
txt_Output.htmlText = "";
Print("All messages has been deleted");
}
public function Init():void{
var _local1:TextFormat;
InitCommands();
arr_Messages = new Array();
i_MsgNomber = 0;
obj_Resize = new Object();
obj_Resize.StageX = stage.stageWidth;
obj_Resize.StageY = stage.stageHeight;
ResizeConsole(0, 0);
LastState = new Object();
LastState["i_Counter"] = 0;
LastState["b_ReplaceLastMsg"] = false;
_local1 = new TextFormat();
_local1.align = TextFormatAlign.LEFT;
_local1.bold = false;
_local1.color = 0;
_local1.font = "Lucida Console";
_local1.size = 11;
txt_Output.setStyle("textFormat", _local1);
txt_Output.wordWrap = true;
txt_Output.htmlText = "";
txt_Input.setStyle("textFormat", _local1);
txt_Input.text = "";
alpha = 0;
visible = false;
blendMode = BlendMode.LAYER;
addEventListener(Event.ENTER_FRAME, OnEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, OnKeyPress);
btn_OK.addEventListener(MouseEvent.CLICK, OnOK);
txt_Input.addEventListener(KeyboardEvent.KEY_DOWN, OnOK);
btn_ShowAll.addEventListener(MouseEvent.CLICK, OnShowAll);
stage.addEventListener(Event.RESIZE, Stage_RESIZE);
stage.addEventListener(MouseEvent.MOUSE_MOVE, Resize_MOVE);
stage.addEventListener(MouseEvent.MOUSE_UP, Resize_UP);
btn_ResizeDown.addEventListener(MouseEvent.MOUSE_DOWN, ResizeDown_DOWN);
ResizeConsole((obj_Resize.StageX - 550), 0);
Print("Console v1.2 wellcome you");
Print("");
}
private function Stage_RESIZE(_arg1:Event):void{
ResizeConsole((stage.stageWidth - obj_Resize.StageX), (stage.stageHeight - obj_Resize.StageY), true);
obj_Resize.StageX = stage.stageWidth;
obj_Resize.StageY = stage.stageHeight;
}
private function OnKeyPress(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 192){
if (visible){
txt_Input.text = "";
Hide();
} else {
txt_Input.text = "";
Show();
};
};
}
private function ExecuteCommand(_arg1:String):void{
var arr_cmd:Array;
var arr_args:Array;
var str_args:String;
var i_Finded:int;
var i:int;
var l:int;
var e_Err:Object;
var r_Value:String;
var i_cmd = _arg1;
arr_cmd = ParserCmd(i_cmd);
str_args = "";
i_Finded = -1;
i = -1;
l = arr_Commands.length;
while ((i = (i + 1)), (i + 1) < l) {
if (arr_cmd[0] == arr_Commands[i].CmdName){
i_Finded = i;
break;
};
};
arr_args = arr_cmd.slice(1);
i = -1;
l = arr_args.length;
while ((i = (i + 1)), (i + 1) < l) {
if (arr_args[i].indexOf(" ") > -1){
arr_args[i] = (("\"" + arr_args[i]) + "\"");
};
};
str_args = arr_args.join(", ");
if (i_Finded != -1){
Print((((("<font color='#0000FF'>" + arr_cmd[0]) + "</font> ( <font color='#CC5500'>") + str_args) + "</font> )"));
e_Err = null;
r_Value = "";
i = i_Finded;
if ((arr_Commands[i].CmdFunction is Function)){
switch (arr_cmd.length){
case 1:
try {
r_Value = arr_Commands[i].CmdFunction();
} catch(err) {
e_Err = err;
};
break;
case 2:
try {
r_Value = arr_Commands[i].CmdFunction(arr_cmd[1]);
} catch(err) {
e_Err = err;
};
break;
case 3:
try {
r_Value = arr_Commands[i].CmdFunction(arr_cmd[1], arr_cmd[2]);
} catch(err) {
e_Err = err;
};
break;
case 4:
try {
r_Value = arr_Commands[i].CmdFunction(arr_cmd[1], arr_cmd[2], arr_cmd[3]);
} catch(err) {
e_Err = err;
};
break;
case 5:
try {
r_Value = arr_Commands[i].CmdFunction(arr_cmd[1], arr_cmd[2], arr_cmd[3], arr_cmd[4]);
} catch(err) {
e_Err = err;
};
break;
case 6:
try {
r_Value = arr_Commands[i].CmdFunction(arr_cmd[1], arr_cmd[2], arr_cmd[3], arr_cmd[4], arr_cmd[5]);
} catch(err) {
e_Err = err;
};
break;
default:
break;
};
} else {
try {
r_Value = arr_Commands[i].CmdFunction;
} catch(err) {
e_Err = err;
};
};
if (e_Err != null){
Print((("<font color='#FF0000'>" + e_Err.toString()) + "</font>"));
} else {
if (((!((r_Value == null))) && (!((r_Value == ""))))){
Print((("<font color='#6600FF'>Retuned value: </font><font color='#008800'>" + r_Value) + "</font>"));
};
};
} else {
Print((((("<font color='#FF4400'>Unknow Command: </font>" + arr_cmd[0]) + " ( ") + str_args) + " )"));
};
}
public function GetLastMessages(_arg1:int):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = "";
_local3 = arr_Messages.length;
if (_arg1 == -1){
_local4 = 0;
} else {
_local4 = (((_local3 - _arg1) > 0)) ? (_local3 - _arg1) : 0;
};
while (--_local3 >= _local4) {
_local2 = (arr_Messages[_local3] + _local2);
};
return (_local2);
}
public function Hide(_arg1:Boolean=true):void{
if (_arg1){
b_FadeIn = false;
b_FadeOut = true;
} else {
visible = false;
alpha = 0;
};
}
private function Resize_MOVE(_arg1:MouseEvent):void{
if (((visible) && (obj_Resize.ComputeY))){
obj_Resize.dY = (_arg1.stageY - obj_Resize.stY);
ResizeConsole(0, obj_Resize.dY);
obj_Resize.stY = _arg1.stageY;
};
}
function __setProp_txt_Output_Console_Layer1_1(){
try {
txt_Output["componentInspectorSetting"] = true;
} catch(e:Error) {
};
txt_Output.condenseWhite = false;
txt_Output.editable = false;
txt_Output.enabled = true;
txt_Output.horizontalScrollPolicy = "off";
txt_Output.htmlText = "";
txt_Output.maxChars = 0;
txt_Output.restrict = "";
txt_Output.text = "qwertyuioop[]asdfghjkl;'zxcvbnm,./1234567890-=\\`~!@#$%^&*()_+|QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?";
txt_Output.verticalScrollPolicy = "auto";
txt_Output.visible = true;
txt_Output.wordWrap = true;
try {
txt_Output["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function PrintAllCommands():void{
var _local1:int;
var _local2:int;
Print("<font color='#CCCCCC'>**************</font>");
Print("<font color='#9900FF'>Commands: </font>");
arr_Commands.sortOn("CmdName", Array.CASEINSENSITIVE);
_local1 = -1;
_local2 = arr_Commands.length;
while (++_local1 < _local2) {
Print((" " + arr_Commands[_local1].CmdName));
};
Print("<font color='#CCCCCC'>**************</font>");
}
public function AddCommand(_arg1:String, _arg2):void{
arr_Commands.push({CmdName:_arg1, CmdFunction:_arg2});
}
private function ParserCmd(_arg1:String):Array{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:String;
var _local6:String;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:String;
var _local11:String;
_local4 = _arg1.split("\"");
_local5 = "$@$_";
_local6 = "";
_local7 = -1;
_local8 = _local4.length;
while (++_local7 < _local8) {
if ((_local7 % 2) == 1){
_local6 = (_local6 + (_local5 + _local7));
} else {
while (_local4[_local7].indexOf(" ") > -1) {
_local9 = _local4[_local7].indexOf(" ");
_local10 = _local4[_local7].slice(0, _local9);
_local11 = _local4[_local7].slice((_local9 + 1), _local4[_local7].length);
_local4[_local7] = (_local10 + _local11);
};
if (_local7 > 0){
if (_local4[_local7].charAt(0) != " "){
_local4[_local7] = (" " + _local4[_local7]);
};
};
if (_local7 < (_local8 - 1)){
if (_local4[_local7].charAt((_local4[_local7].length - 1)) != " "){
_local4[_local7] = (_local4[_local7] + " ");
};
};
if (_local7 == 0){
while (_local4[_local7].charAt(0) == " ") {
_local4[_local7] = _local4[_local7].slice(1, _local4[_local7].length);
};
} else {
if (_local7 == (_local8 - 1)){
while (_local4[_local7].charAt((_local4[_local7].length - 1)) == " ") {
_local4[_local7] = _local4[_local7].slice(0, (_local4[_local7].length - 1));
};
};
};
_local6 = (_local6 + _local4[_local7]);
};
};
_local2 = new Array();
_local3 = _local6.split(" ");
_local7 = -1;
_local8 = _local3.length;
while (++_local7 < _local8) {
if (_local3[_local7].indexOf(_local5) > -1){
_local3[_local7] = _local4[int(_local3[_local7].slice(4))];
};
if (_local3[_local7] != ""){
_local2.push(_local3[_local7]);
};
};
return (_local2);
}
public function Print(_arg1, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:String;
var _local5:Date;
var _local6:String;
_local4 = _arg1.toString();
if (!visible){
i_MsgNomber = 0;
};
if (_arg2){
_local5 = new Date();
_local6 = _local5.toTimeString();
_local6 = _local6.substring(0, 8);
_local6 = ((((("<font color='#008888'>[" + _local6) + "][") + arr_Messages.length) + "] </font>") + _local4);
_local4 = _local6;
} else {
};
if (((_arg3) && ((LastState["b_ReplaceLastMsg"] == _arg3)))){
var _local7 = LastState;
var _local8 = "i_Counter";
var _local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
_local4 = (_local4 + ((" <font color='#CC66FF'>[" + LastState["i_Counter"]) + "]</font><br>"));
arr_Messages[(arr_Messages.length - 1)] = _local4;
if (visible){
ShowLastMessages((i_MsgNomber + 32));
};
} else {
_local4 = (_local4 + "<br>");
arr_Messages.push(_local4);
if (visible){
i_MsgNomber++;
txt_Output.htmlText = (txt_Output.htmlText + _local4);
txt_Output.alwaysShowSelection = true;
txt_Output.setSelection((txt_Output.htmlText.length - 2), (txt_Output.htmlText.length - 1));
};
LastState["i_Counter"] = 0;
};
LastState["b_ReplaceLastMsg"] = _arg3;
}
function __setProp_btn_OK_Console_Layer1_1(){
try {
btn_OK["componentInspectorSetting"] = true;
} catch(e:Error) {
};
btn_OK.emphasized = false;
btn_OK.enabled = true;
btn_OK.label = "OK";
btn_OK.labelPlacement = "right";
btn_OK.selected = false;
btn_OK.toggle = false;
btn_OK.visible = true;
try {
btn_OK["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function ResizeDown_DOWN(_arg1:MouseEvent):void{
if (visible){
obj_Resize.ComputeY = true;
obj_Resize.stY = _arg1.stageY;
};
}
public function ShowLastMessages(_arg1:int=32):void{
txt_Output.htmlText = GetLastMessages(_arg1);
txt_Output.alwaysShowSelection = true;
txt_Output.setSelection((txt_Output.htmlText.length - 2), (txt_Output.htmlText.length - 1));
}
private function OnEnterFrame(_arg1:Event):void{
if (parent.numChildren > (parent.getChildIndex(this) + 1)){
parent.addChildAt(this, (parent.getChildIndex(this) + 1));
};
if (b_FadeIn){
FadeIn();
};
if (b_FadeOut){
FadeOut();
};
}
private function FadeIn():void{
if (alpha < 1){
visible = true;
alpha = (alpha + 0.08);
} else {
b_FadeIn = false;
};
}
private function Resize_UP(_arg1:MouseEvent):void{
if (visible){
obj_Resize.ComputeX = false;
obj_Resize.ComputeY = false;
};
}
private function OnShowAll(_arg1:MouseEvent):void{
ShowLastMessages(-1);
}
function __setProp_btn_ShowAll_Console_Layer1_1(){
try {
btn_ShowAll["componentInspectorSetting"] = true;
} catch(e:Error) {
};
btn_ShowAll.emphasized = false;
btn_ShowAll.enabled = true;
btn_ShowAll.label = "Show all messages";
btn_ShowAll.labelPlacement = "right";
btn_ShowAll.selected = false;
btn_ShowAll.toggle = false;
btn_ShowAll.visible = true;
try {
btn_ShowAll["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public static function EXECUTE_COMMAND(_arg1:String):void{
ConsoleMc.ExecuteCommand(_arg1);
}
public static function SHOW_LAST_MESSAGES(_arg1:int=32):void{
ConsoleMc.ShowLastMessages(_arg1);
}
public static function ADD_COMMAND(_arg1:String, _arg2:Function):void{
ConsoleMc.AddCommand(_arg1, _arg2);
}
public static function PRINT_ALL_COMMANDS():void{
ConsoleMc.PrintAllCommands();
}
public static function HIDE(_arg1:Boolean=true):void{
ConsoleMc.Hide(_arg1);
}
public static function GET_LAST_MESSAGES(_arg1:int):String{
return (ConsoleMc.GetLastMessages(_arg1));
}
public static function PRINT(_arg1, _arg2:String=null, _arg3:Boolean=true, _arg4:Boolean=false):void{
if (_arg2 != null){
if ((((_arg2.length == 7)) && ((_arg2.indexOf("#") > -1)))){
_arg1 = (((("<font color=\"" + _arg2) + "\">") + _arg1) + "</font>");
};
};
ConsoleMc.Print(_arg1, _arg3, _arg4);
}
public static function SHOW(_arg1:Boolean=true):void{
ConsoleMc.Show(_arg1);
}
}
}//package pk_tools
class loc_Math {
private function loc_Math(){
}
public static function Add(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + _arg2));
}
public static function Divide(_arg1:Number, _arg2:Number):Number{
return ((_arg1 / _arg2));
}
public static function Substract(_arg1:Number, _arg2:Number):Number{
return ((_arg1 - _arg2));
}
public static function Multiply(_arg1:Number, _arg2:Number):Number{
return ((_arg1 * _arg2));
}
}
Section 83
//SliderEase (pk_tools.SliderEase)
package pk_tools {
public class SliderEase {
public var DELAY:int;
public var ITERATOR:Number;// = 1.5
public var POS:Object;
public var TICKS:int;
public var COMPLETE:Boolean;
public static var METHOD = {LINEAR:0, EASE_IN:1, EASE_OUT:2, EASE_IN_OUT:3};
public function SliderEase(_arg1:Number, _arg2:Number, _arg3:Number=100, _arg4:Number=0, _arg5:int=3){
ITERATOR = 1.5;
super();
COMPLETE = false;
TICKS = int(_arg3);
DELAY = int(_arg4);
POS = new Object();
POS.a = _arg1;
POS.b = _arg2;
POS.c = POS.s;
POS.d = (POS.b - POS.a);
POS.p = 0;
POS.u = 0;
POS.m = (100 / TICKS);
POS.n = 0;
POS.t = _arg5;
}
public function GetNextValue():Number{
if (++POS.u > DELAY){
POS.p = (POS.p + (0.01 * POS.m));
POS.p = ((POS.p)>1) ? 1 : POS.p;
if (POS.p == 1){
COMPLETE = true;
};
if (POS.t == METHOD.LINEAR){
POS.n = POS.p;
} else {
if (POS.t == METHOD.EASE_IN){
POS.n = Math.pow(POS.p, ITERATOR);
} else {
if (POS.t == METHOD.EASE_OUT){
POS.n = (1 - Math.pow((1 - POS.p), ITERATOR));
} else {
if (POS.t == METHOD.EASE_IN_OUT){
if (POS.p < 0.5){
POS.n = (0.5 * Math.pow((2 * POS.p), ITERATOR));
} else {
POS.n = (0.5 + (0.5 * (1 - Math.pow((2 * (1 - POS.p)), ITERATOR))));
};
};
};
};
};
};
POS.c = (POS.a + (POS.d * POS.n));
POS.c = (Math.round((POS.c * Math.pow(10, 12))) / Math.pow(10, 12));
return (Number(POS.c));
}
}
}//package pk_tools
Section 84
//SliderEase_Sprite (pk_tools.SliderEase_Sprite)
package pk_tools {
import flash.display.*;
import flash.events.*;
public class SliderEase_Sprite {
private var loc_slider:SliderEase;
private var loc_sprite:Sprite;
public var OnComplete:Function;// = null
private var loc_type:String;
private var f_value:Number;
public function SliderEase_Sprite(_arg1:SliderEase, _arg2:Sprite, _arg3:String="alpha", _arg4:Function=null){
OnComplete = null;
super();
loc_type = _arg3;
loc_slider = _arg1;
loc_sprite = _arg2;
loc_sprite.addEventListener(Event.ENTER_FRAME, OEF);
OnComplete = _arg4;
}
public function Destroy():void{
loc_sprite.removeEventListener(Event.ENTER_FRAME, OEF);
}
private function OEF(_arg1=null):void{
f_value = loc_slider.GetNextValue();
if (loc_type == "alpha"){
loc_sprite.alpha = f_value;
} else {
if (loc_type == "x"){
loc_sprite.x = f_value;
} else {
if (loc_type == "y"){
loc_sprite.y = f_value;
} else {
if (loc_type == "scaleX"){
loc_sprite.scaleX = f_value;
} else {
if (loc_type == "scaleY"){
loc_sprite.scaleY = f_value;
} else {
if (loc_type == "rotation"){
loc_sprite.rotation = f_value;
};
};
};
};
};
};
if (loc_slider.COMPLETE){
Destroy();
if (OnComplete != null){
OnComplete();
};
};
}
}
}//package pk_tools
Section 85
//png (tomato_.png)
package tomato_ {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package tomato_
Section 86
//BitmapSlice (BitmapSlice)
package {
import flash.display.*;
import flash.events.*;
import pk_tools.*;
import flash.geom.*;
import fl.motion.*;
public class BitmapSlice extends Bitmap {
private var p_First:Point;
private var spdX:Number;// = 0
private var spdY:Number;// = 0
private var spdR:Number;// = 0
private var p_Second:Point;
public function BitmapSlice(_arg1=null){
spdX = 0;
spdY = 0;
spdR = 0;
super();
if (((_arg1) && ((_arg1 is BitmapData)))){
bitmapData = _arg1;
} else {
if (((_arg1) && ((_arg1 is Bitmap)))){
bitmapData = _arg1.bitmapData;
transform.matrix = _arg1.transform.matrix;
};
};
spdX = (0.5 * (0.5 - Math.random()));
spdY = (0.5 * (0.5 - Math.random()));
spdR = (0 * (0.5 - Math.random()));
addEventListener(Event.ADDED, onAdd);
addEventListener(Event.REMOVED, onRemove);
}
private function Erase2(_arg1:BitmapData, _arg2:BitmapData):BitmapData{
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:BitmapData;
_local3 = _arg1.clone();
_local3.copyChannel(_local3, _local3.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.RED);
_local4 = _arg2.clone();
_local4.merge(_local3, _local3.rect, new Point(), 0xFF, 0xFF, 0xFF, 0);
_local5 = _arg1.clone();
_local5.copyChannel(_local4, _local4.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
return (_local5);
}
public function Destroy():void{
bitmapData.dispose();
parent.stage.removeEventListener(Event.ENTER_FRAME, OEF);
parent.stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
parent.stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
parent.removeChild(this);
}
private function OEF(_arg1=null):void{
}
private function OnMouseDown(_arg1=null){
if (parent["alpha"] >= 1){
p_First = new Point(parent.mouseX, parent.mouseY);
};
}
private function OnMouseUp(_arg1=null){
var _local2:Rectangle;
var _local3:Rectangle;
var _local4:Array;
var _local5:Function;
if (parent["alpha"] >= 1){
p_Second = new Point(parent.mouseX, parent.mouseY);
if (((!((p_First.x == p_Second.x))) || (!((p_First.y == p_Second.y))))){
if (p_First.y == p_Second.y){
p_Second.y = (p_Second.y + 1);
};
if (p_First.x == p_Second.x){
p_Second.x = (p_Second.x + 1);
};
_local2 = getBounds(parent);
_local3 = new Rectangle(Math.min(p_First.x, p_Second.x), Math.min(p_First.y, p_Second.y), Math.abs((p_First.x - p_Second.x)), Math.abs((p_First.y - p_Second.y)));
if (_local3.height == 0){
_local3.height = 1;
};
if (((((_local2.intersects(_local3)) || (_local2.containsRect(_local3)))) || (_local3.containsRect(_local2)))){
_local4 = CreateSliceAsBitmap(this, p_First, p_Second);
if (((!((_local4[0] == null))) && (!((_local4[1] == null))))){
_local5 = parent["Init"];
parent.addChild(new BitmapSlice(_local4[0]));
parent.addChild(new BitmapSlice(_local4[1]));
parent.removeChild(this);
_local5();
};
};
};
};
}
private function DrawSliceLine(_arg1:Point, _arg2:Point, _arg3:int=-1):Shape{
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:*;
var _local9:Number;
var _local10:Point;
var _local11:Shape;
_local4 = new Point(_arg1.x, _arg1.y);
_local5 = new Point(_arg2.x, _arg2.y);
_local9 = (_arg3 * 10000);
_local10 = new Point((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
_local10.normalize(1);
_local4.x = (_local4.x + ((0.25 * _local9) * _local10.x));
_local4.y = (_local4.y + ((0.25 * _local9) * _local10.y));
_local5.x = (_local5.x - ((0.25 * _local9) * _local10.x));
_local5.y = (_local5.y - ((0.25 * _local9) * _local10.y));
_local8 = _local10.x;
_local10.x = -(_local10.y);
_local10.y = _local8;
_local6 = new Point((_local5.x + (_local9 * _local10.x)), (_local5.y + (_local9 * _local10.y)));
_local7 = new Point((_local4.x + (_local9 * _local10.x)), (_local4.y + (_local9 * _local10.y)));
_local11 = new Shape();
_local11.graphics.clear();
_local11.graphics.beginFill(0xFF00FF, 1);
_local11.graphics.moveTo(_local4.x, _local4.y);
_local11.graphics.lineTo(_local5.x, _local5.y);
_local11.graphics.lineTo(_local6.x, _local6.y);
_local11.graphics.lineTo(_local7.x, _local7.y);
_local11.graphics.lineTo(_local4.x, _local4.y);
_local11.graphics.endFill();
_local11.x = 0;
_local11.y = 0;
return (_local11);
}
private function onAdd(_arg1=null):void{
var _local2:Rectangle;
if (bitmapData != null){
_local2 = bitmapData.getColorBoundsRect(4278190080, 0, false);
if (((!((_local2.height == 0))) && (!((_local2.width == 0))))){
parent.stage.addEventListener(Event.ENTER_FRAME, OEF);
parent.stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
parent.stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
} else {
bitmapData.dispose();
parent.removeChild(this);
};
} else {
parent.removeChild(this);
};
}
private function Erase(_arg1:BitmapData, _arg2:BitmapData):BitmapData{
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:uint;
var _local6:uint;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
_local3 = _arg1.clone();
_local4 = _arg2.clone();
_local10 = -1;
_local11 = _local3.width;
while (++_local10 < _local11) {
_local12 = -1;
_local13 = _local3.height;
while (++_local12 < _local13) {
_local5 = _local3.getPixel32(_local10, _local12);
_local6 = _local4.getPixel32(_local10, _local12);
_local7 = (_local5 / 16777216);
_local8 = (_local6 / 16777216);
_local9 = ((_local7 * _local8) / 0xFF);
_local3.setPixel32(_local10, _local12, ((((_local9 << 24) | (((_local5 >> 16) & 0xFF) << 16)) | (((_local5 >> 8) & 0xFF) << 8)) | (_local5 & 0xFF)));
};
};
return (_local3);
}
private function onRemove(_arg1=null):void{
parent.stage.removeEventListener(Event.ENTER_FRAME, OEF);
parent.stage.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
parent.stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
bitmapData.dispose();
}
private function OnMouseMove(_arg1=null):void{
}
private function Erase3(_arg1:BitmapData, _arg2:BitmapData):BitmapData{
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:BitmapData;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local3.copyChannel(_arg1, _arg1.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
_local3.copyChannel(_arg2, _arg2.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.RED);
_local4 = new BitmapData(_arg1.width, _arg1.height, true, 4278190080);
_local4.draw(_local3, null, null, null, null, false);
_local5 = _arg1.clone();
_local5.copyChannel(_local4, _local4.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
_local3.dispose();
_local4.dispose();
return (_local5);
}
private function CreateSliceAsBitmap(_arg1:Bitmap, _arg2:Point, _arg3:Point):Array{
var mat2:Matrix;
var mat:Matrix;
var p_Trans:Point;
var bd_Main:BitmapData;
var sh_Mask_01:Shape;
var sh_Mask_02:Shape;
var bd_Mask_01:BitmapData;
var bd_Mask_02:BitmapData;
var alphaBounds_01:Rectangle;
var alphaBounds_02:Rectangle;
var bd_Mask_01_1:BitmapData;
var bd_Mask_02_1:BitmapData;
var mat_1:Matrix;
var mat_2:Matrix;
var bt_SliceOut_01:Bitmap;
var bt_SliceOut_02:Bitmap;
var in_Bitmap = _arg1;
var in_P0 = _arg2;
var in_P1 = _arg3;
try {
mat2 = in_Bitmap.transform.matrix.clone();
mat = in_Bitmap.transform.matrix.clone();
mat.rotate((-2 * MatrixTransformer.getRotationRadians(mat2)));
mat.tx = -(mat.tx);
mat.ty = -(mat.ty);
MatrixTransformer.setScaleX(mat, (1 / MatrixTransformer.getScaleX(mat2)));
MatrixTransformer.setScaleY(mat, (1 / MatrixTransformer.getScaleY(mat2)));
p_Trans = new Point(mat2.tx, mat2.ty);
p_Trans = mat.deltaTransformPoint(p_Trans);
mat.tx = -(p_Trans.x);
mat.ty = -(p_Trans.y);
bd_Main = in_Bitmap.bitmapData;
sh_Mask_01 = DrawSliceLine(in_P0, in_P1, -1);
sh_Mask_02 = DrawSliceLine(in_P0, in_P1, 1);
bd_Mask_01 = new BitmapData(bd_Main.width, bd_Main.height, true, 0);
bd_Mask_01.draw(sh_Mask_01, mat, null, null, null, true);
bd_Mask_02 = new BitmapData(bd_Main.width, bd_Main.height, true, 0);
bd_Mask_02.draw(sh_Mask_02, mat, null, null, null, true);
alphaBounds_01 = bd_Mask_02.getColorBoundsRect(4278190080, 0, true);
alphaBounds_02 = bd_Mask_01.getColorBoundsRect(4278190080, 0, true);
if ((((((((alphaBounds_01.height == 0)) || ((alphaBounds_01.width == 0)))) || ((alphaBounds_02.height == 0)))) || ((alphaBounds_02.width == 0)))){
bd_Mask_01.dispose();
bd_Mask_02.dispose();
return ([null, null]);
} else {
bd_Mask_01 = Erase3(bd_Main, bd_Mask_01);
bd_Mask_02 = Erase3(bd_Main, bd_Mask_02);
bd_Mask_01_1 = new BitmapData(alphaBounds_01.width, alphaBounds_01.height, true, 0);
bd_Mask_01_1.copyPixels(bd_Mask_01, alphaBounds_01, new Point());
bd_Mask_02_1 = new BitmapData(alphaBounds_02.width, alphaBounds_02.height, true, 0);
bd_Mask_02_1.copyPixels(bd_Mask_02, alphaBounds_02, new Point());
mat = in_Bitmap.transform.matrix;
mat_1 = new Matrix();
mat_1.translate(alphaBounds_01.x, alphaBounds_01.y);
mat_1.concat(mat);
mat_2 = new Matrix();
mat_2.translate(alphaBounds_02.x, alphaBounds_02.y);
mat_2.concat(mat);
bt_SliceOut_01 = new Bitmap();
bt_SliceOut_01.bitmapData = bd_Mask_01_1;
bt_SliceOut_01.transform.matrix = mat_1;
bt_SliceOut_01.smoothing = true;
bt_SliceOut_02 = new Bitmap();
bt_SliceOut_02.bitmapData = bd_Mask_02_1;
bt_SliceOut_02.transform.matrix = mat_2;
bt_SliceOut_02.smoothing = true;
bd_Mask_01.dispose();
bd_Mask_02.dispose();
return ([bt_SliceOut_01, bt_SliceOut_02]);
};
} catch(e) {
trace("Some errors ocurred");
};
return ([null, null]);
}
}
}//package
Section 87
//Button_disabledSkin (Button_disabledSkin)
package {
import flash.display.*;
public dynamic class Button_disabledSkin extends MovieClip {
}
}//package
Section 88
//Button_downSkin (Button_downSkin)
package {
import flash.display.*;
public dynamic class Button_downSkin extends MovieClip {
}
}//package
Section 89
//Button_emphasizedSkin (Button_emphasizedSkin)
package {
import flash.display.*;
public dynamic class Button_emphasizedSkin extends MovieClip {
}
}//package
Section 90
//Button_overSkin (Button_overSkin)
package {
import flash.display.*;
public dynamic class Button_overSkin extends MovieClip {
}
}//package
Section 91
//Button_selectedDisabledSkin (Button_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDisabledSkin extends MovieClip {
}
}//package
Section 92
//Button_selectedDownSkin (Button_selectedDownSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDownSkin extends MovieClip {
}
}//package
Section 93
//Button_selectedOverSkin (Button_selectedOverSkin)
package {
import flash.display.*;
public dynamic class Button_selectedOverSkin extends MovieClip {
}
}//package
Section 94
//Button_selectedUpSkin (Button_selectedUpSkin)
package {
import flash.display.*;
public dynamic class Button_selectedUpSkin extends MovieClip {
}
}//package
Section 95
//Button_upSkin (Button_upSkin)
package {
import flash.display.*;
public dynamic class Button_upSkin extends MovieClip {
}
}//package
Section 96
//CountdownTimer (CountdownTimer)
package {
import flash.display.*;
import flash.utils.*;
public class CountdownTimer {
public var onStart:Function;// = null
public var onStop:Function;// = null
private var i_milisec:int;
public var onFinish:Function;// = null
private var i_tm:int;
public var onPause:Function;// = null
public var isWork:Boolean;// = false
public var mc_Renderer:Sprite;
private var i_delay:int;// = 250
public var onReset:Function;// = null
private var obj_Add:Object;
public function CountdownTimer(_arg1:Sprite=null, _arg2:uint=0){
onReset = null;
onFinish = null;
onStart = null;
onStop = null;
onPause = null;
isWork = false;
i_delay = 250;
super();
if (_arg1 != null){
mc_Renderer = _arg1;
};
DefineAdder();
Reset(_arg2);
}
public function AddMiliseconds(_arg1:int=0, _arg2:int=0, _arg3:int=10):void{
if (_arg2 > 0){
DefineAdder(_arg1, _arg2, _arg3);
} else {
i_milisec = (i_milisec + _arg1);
if (i_milisec <= 0){
Stop();
if (onFinish != null){
onFinish();
};
};
ComputeAdder(_arg1);
OnTimeCompute();
};
}
public function getTime():int{
return (i_milisec);
}
private function DefineAdder(_arg1:int=0, _arg2:int=10, _arg3:int=10):void{
if (obj_Add != null){
clearInterval(obj_Add.tm);
};
obj_Add = new Object();
obj_Add.tm = -1;
obj_Add.timeToAdd = 0;
obj_Add.multiplier = 1;
if (_arg1 != 0){
obj_Add.timeToAdd = Math.abs(_arg1);
obj_Add.multiplier = (_arg1 / obj_Add.timeToAdd);
obj_Add.tm = setInterval(AddMiliseconds, _arg2, (_arg3 * obj_Add.multiplier));
};
}
public function Start():void{
Stop();
i_tm = setInterval(OnInterval, i_delay);
isWork = true;
if (onStart != null){
onStart();
};
}
public function Destroy():void{
DefineAdder();
Reset();
onReset = null;
onFinish = null;
onStart = null;
onStop = null;
onPause = null;
isWork = false;
}
public function Pause():void{
if (isWork){
Stop();
} else {
Start();
};
if (onPause != null){
onPause();
};
}
public function Stop():void{
clearInterval(i_tm);
isWork = false;
if (onStop != null){
onStop();
};
}
private function OnTimeCompute():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = int((i_milisec / 10));
_local2 = int((_local1 / 100));
_local3 = int((_local2 / 60));
_local2 = (_local2 - (_local3 * 60));
_local1 = (_local1 - ((_local3 * 6000) + (_local2 * 100)));
if (mc_Renderer != null){
var _local4 = mc_Renderer;
_local4["SET_TIME"](_local3, _local2, _local1);
};
}
public function Reset(_arg1:int=0):void{
Stop();
i_milisec = _arg1;
if (i_milisec > 0){
Start();
};
if (onReset != null){
onReset();
};
}
private function ComputeAdder(_arg1:int=0):void{
obj_Add.timeToAdd = (obj_Add.timeToAdd - Math.abs(_arg1));
if (obj_Add.timeToAdd <= 0){
clearInterval(obj_Add.tm);
};
}
private function OnInterval():void{
AddMiliseconds(-(i_delay));
}
}
}//package
Section 97
//DnDSprite (DnDSprite)
package {
import flash.display.*;
import flash.events.*;
import pk_tools.*;
import flash.utils.*;
public class DnDSprite {
private var _bbox:Sprite;
private var DRAG_ON:Boolean;// = false
private var _depend:Function;
private var LOCKED:Boolean;// = false
private var OnPosition:Function;// = null
private var _props_0:Object;
private var _start:Object;
private var _props_1:Object;
private var OnPos_arg;// = null
private var b_OnPos:Boolean;// = false
private var _this:Sprite;
public function DnDSprite(_arg1:Sprite, _arg2:Sprite, _arg3:Object=null, _arg4:Function=null, _arg5=null, _arg6:Function=null){
var in_sprite = _arg1;
var in_bbox = _arg2;
var in_props = _arg3;
var in_OnPosition = _arg4;
var in_arg = _arg5;
var in_depend = _arg6;
LOCKED = false;
DRAG_ON = false;
OnPosition = null;
OnPos_arg = null;
b_OnPos = false;
super();
_bbox = in_bbox;
_this = in_sprite;
_this.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
OnPosition = in_OnPosition;
OnPos_arg = in_arg;
_props_0 = null;
_props_1 = in_props;
_depend = in_depend;
if (_props_1 != null){
_props_0 = new Object();
_props_0.x = _this.x;
_props_0.y = _this.y;
_props_0.alpha = _this.alpha;
_props_0.scaleX = _this.scaleX;
_props_0.scaleY = _this.scaleY;
_props_0.rotation = _this.rotation;
_props_0.LOCKED = false;
_props_0.sliders = new Array();
_props_0.HT_now = _this.hitTestObject(_bbox);
_props_0.HT_last = _props_0.HT_now;
_props_0.Lock = function (){
_props_0.LOCKED = true;
};
_props_0.Unlock = function (){
_props_0.LOCKED = false;
};
_props_0.StopAll = function (){
var _local1:int;
var _local2:int;
_props_0.Unlock();
_props_0.HT_now = _this.hitTestObject(_bbox);
_props_0.HT_last = _props_0.HT_now;
_local1 = -1;
_local2 = _props_0.sliders.length;
while (++_local1 < _local2) {
_props_0.sliders[_local1].Destory();
};
};
};
}
private function Lock():void{
LOCKED = true;
}
public function Destroy():void{
_this.removeEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
_this.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
_this.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
_this.stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
_this = null;
}
private function OnMouseMove(_arg1:MouseEvent=null):void{
var _local2:uint;
if (_props_0 != null){
_props_0.HT_last = _props_0.HT_now;
_props_0.HT_now = _this.hitTestObject(_bbox);
if (_props_0.HT_now != _props_0.HT_last){
trace("CHANGE!");
_props_0.StopAll();
_local2 = 15;
if (_props_0.HT_now){
if (((!((_props_1.alpha == null))) && (!((_props_1.alpha == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.alpha, _props_1.alpha, _local2), _this, "alpha");
};
if (((!((_props_1.scaleX == null))) && (!((_props_1.scaleX == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.scaleX, _props_1.scaleX, _local2), _this, "scaleX");
};
if (((!((_props_1.scaleY == null))) && (!((_props_1.scaleY == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.scaleY, _props_1.scaleY, _local2), _this, "scaleY");
};
if (((!((_props_1.rotation == null))) && (!((_props_1.rotation == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.rotation, _props_1.rotation, _local2), _this, "rotation");
};
} else {
if (((!((_props_1.alpha == null))) && (!((_props_1.alpha == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.alpha, _props_0.alpha, _local2), _this, "alpha");
};
if (((!((_props_1.scaleX == null))) && (!((_props_1.scaleX == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.scaleX, _props_0.scaleX, _local2), _this, "scaleX");
};
if (((!((_props_1.scaleY == null))) && (!((_props_1.scaleY == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.scaleY, _props_0.scaleY, _local2), _this, "scaleY");
};
if (((!((_props_1.rotation == null))) && (!((_props_1.rotation == undefined))))){
new SliderEase_Sprite(new SliderEase(_this.rotation, _props_0.rotation, _local2), _this, "rotation");
};
};
};
};
}
private function OnMouseUp(_arg1=null):void{
var _local2:uint;
if (DRAG_ON){
DRAG_ON = false;
_this.removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
_this.stopDrag();
if ((((_arg1 == "NATIVE")) || (!(_this.hitTestObject(_bbox))))){
if (_props_0 != null){
_props_0.StopAll();
};
Lock();
_local2 = 15;
new SliderEase_Sprite(new SliderEase(_this.x, _start.x, _local2), _this, "x", Unlock);
new SliderEase_Sprite(new SliderEase(_this.y, _start.y, _local2), _this, "y", Unlock);
new SliderEase_Sprite(new SliderEase(_this.alpha, _start.alpha, _local2), _this, "alpha", Unlock);
new SliderEase_Sprite(new SliderEase(_this.scaleX, _start.scaleX, _local2), _this, "scaleX", Unlock);
new SliderEase_Sprite(new SliderEase(_this.scaleY, _start.scaleY, _local2), _this, "scaleY", Unlock);
new SliderEase_Sprite(new SliderEase(_this.rotation, _start.rotation, _local2), _this, "rotation", Unlock);
} else {
if (((!(b_OnPos)) && (!((OnPosition == null))))){
b_OnPos = true;
if (OnPos_arg != null){
OnPosition(OnPos_arg);
} else {
OnPosition();
};
};
};
};
}
private function Unlock():void{
LOCKED = false;
}
private function OnMouseDown(_arg1=null):void{
_this.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
_this.stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
if (!LOCKED){
DRAG_ON = true;
if (_props_0 != null){
_props_0.StopAll();
};
_this.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
_this.startDrag();
_start = new Object();
_start.x = _this.x;
_start.y = _this.y;
_start.alpha = _this.alpha;
_start.scaleX = _this.scaleX;
_start.scaleY = _this.scaleY;
_start.rotation = _this.rotation;
};
if (!_depend()){
setTimeout(OnMouseUp, 100, "NATIVE");
_this.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
_this.stage.removeEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
};
}
}
}//package
Section 98
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 99
//hidden_hints_line (hidden_hints_line)
package {
import flash.display.*;
public dynamic class hidden_hints_line extends MovieClip {
}
}//package
Section 100
//mc_drop (mc_drop)
package {
import flash.display.*;
public dynamic class mc_drop extends MovieClip {
public function mc_drop(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 101
//pencil_4 (pencil_4)
package {
import flash.media.*;
public dynamic class pencil_4 extends Sound {
}
}//package
Section 102
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 103
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 104
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 105
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 106
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 107
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 108
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 109
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 110
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 111
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 112
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 113
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 114
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 115
//TextArea_disabledSkin (TextArea_disabledSkin)
package {
import flash.display.*;
public dynamic class TextArea_disabledSkin extends MovieClip {
}
}//package
Section 116
//TextArea_upSkin (TextArea_upSkin)
package {
import flash.display.*;
public dynamic class TextArea_upSkin extends MovieClip {
}
}//package
Section 117
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 118
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package