Section 1
//ButtonArrows (classes.common.ButtonArrows)
package classes.common {
import flash.display.*;
import flash.events.*;
public class ButtonArrows extends MovieClip {
public var left:SimpleButton;
public var right:SimpleButton;
var _right:SimpleButton;
var _left:SimpleButton;
public function ButtonArrows(){
super();
try {
_left = this.left;
} catch(e:Error) {
trace("ButtonArrows::ButtonArrows: Bad left button!");
return;
};
try {
_right = this.right;
} catch(e:Error) {
trace("ButtonArrows::ButtonArrows: Bad right button!");
return;
};
_left.addEventListener(MouseEvent.CLICK, on_left);
_right.addEventListener(MouseEvent.CLICK, on_right);
_left.addEventListener(MouseEvent.MOUSE_OVER, on_over);
_right.addEventListener(MouseEvent.MOUSE_OVER, on_over);
}
protected function on_over(_arg1:MouseEvent):void{
parent.dispatchEvent(new MouseEvent("on_over"));
}
protected function on_left(_arg1:MouseEvent):void{
parent.dispatchEvent(new Event("on_left"));
}
protected function on_right(_arg1:MouseEvent):void{
parent.dispatchEvent(new Event("on_right"));
}
}
}//package classes.common
Section 2
//ButtonsBar (classes.common.ButtonsBar)
package classes.common {
import flash.display.*;
import flash.events.*;
public class ButtonsBar extends MovieClip {
public function ButtonsBar(){
this.stop();
init();
}
protected function on_rightClothes(_arg1:Event):void{
}
public function init():void{
}
public function reset():void{
}
protected function addButton(_arg1:DisplayObject, _arg2:Function, _arg3:Boolean=false, _arg4:String="click"):void{
var subFunc:Function;
var buttObj = _arg1;
var eventFunc = _arg2;
var silent = _arg3;
var event = _arg4;
subFunc = function (_arg1:MouseEvent){
if (((!(silent)) && (root.game.sounds))){
root.game.sounds.playSound("push");
};
eventFunc(_arg1);
};
if (!buttObj.hasEventListener(event)){
buttObj.addEventListener(event, subFunc);
};
if (!buttObj.hasEventListener(MouseEvent.MOUSE_OVER)){
buttObj.addEventListener(MouseEvent.MOUSE_OVER, on_mouseOver);
};
}
protected function addButtonArrows(_arg1:DisplayObject):void{
if (!_arg1.hasEventListener("on_left")){
_arg1.addEventListener("on_left", on_leftClothes);
};
if (!_arg1.hasEventListener("on_right")){
_arg1.addEventListener("on_right", on_rightClothes);
};
if (!_arg1.hasEventListener("on_over")){
_arg1.addEventListener("on_over", on_mouseOver);
};
}
protected function on_mouseOver(_arg1:MouseEvent):void{
if (root.game.sounds){
root.game.sounds.playSound("over");
};
}
protected function on_leftClothes(_arg1:Event):void{
}
}
}//package classes.common
Section 3
//Checkbox (classes.common.Checkbox)
package classes.common {
import flash.display.*;
import flash.events.*;
public class Checkbox extends MovieClip {
private var _checked:Boolean;// = false
private var group:String;// = "STANDALONE"
public static var groups:Object = new Object();
public static var MOUSE_CLICK:String = "checkbox_clicked";
public function Checkbox(){
group = "STANDALONE";
_checked = false;
super();
gotoAndStop("Not_selected");
this.addEventListener(MouseEvent.CLICK, on_click);
}
public function check(_arg1:Boolean=true):void{
_checked = _arg1;
if (_checked){
gotoAndStop("Selected");
} else {
gotoAndStop("Not_selected");
};
}
public function pushIntoGroup(_arg1:String):void{
if (!groups.hasOwnProperty(_arg1)){
groups[_arg1] = new Array();
};
groups[_arg1].push(this);
group = _arg1;
}
public function toggle():Boolean{
var _local1:*;
if (group == "STANDALONE"){
_checked = !(_checked);
if (_checked){
gotoAndStop("Selected");
} else {
gotoAndStop("Not_selected");
};
} else {
if (_checked){
return;
};
for each (_local1 in groups[group]) {
if (((!((_local1 == this))) && (_local1.get_state()))){
_local1.check(false);
};
};
this.check();
};
return (_checked);
}
private function on_click(_arg1:MouseEvent):void{
this.toggle();
this.dispatchEvent(new Event(MOUSE_CLICK));
}
public function get_state():Boolean{
return (_checked);
}
}
}//package classes.common
Section 4
//Digit (classes.common.Digit)
package classes.common {
import flash.display.*;
import classes.main.*;
public class Digit extends MovieClip {
public function Digit(){
stop();
}
public function get_number():int{
return ((currentFrame - 1));
}
public function set_random_number():int{
gotoAndStop(Usefull.randRange(1, totalFrames));
return ((currentFrame - 1));
}
public function set_number(_arg1:int):void{
if ((((_arg1 < 0)) || ((_arg1 > 9)))){
trace(("Digit::set_number::bad number: " + _arg1));
return;
};
gotoAndStop((_arg1 + 1));
}
}
}//package classes.common
Section 5
//OnTimer (classes.common.OnTimer)
package classes.common {
import flash.display.*;
import classes.main.*;
import flash.events.*;
import flash.utils.*;
public class OnTimer extends MovieClip {
private var minTime:Number;// = 0.5
private var timer:Timer;
private var maxTime:Number;// = 4
public function OnTimer(){
minTime = 0.5;
maxTime = 4;
super();
if (this.totalFrames > 1){
this.stop();
initTimer();
} else {
Usefull.trace_debug(("onTimer:: totalFrames = 1, object: " + name));
};
}
public function initTimer():void{
timer = new Timer((1000 * Usefull.randRange(minTime, maxTime)), 1);
if (!timer.hasEventListener(TimerEvent.TIMER_COMPLETE)){
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimer);
};
timer.start();
}
public function reset():void{
this.gotoAndStop(1);
}
protected function onTimer(_arg1:TimerEvent):void{
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, onFrame);
};
this.play();
}
protected function onFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onFrame);
};
reset();
initTimer();
};
}
public function set_timeRange(_arg1:Number, _arg2:Number):void{
minTime = _arg1;
maxTime = _arg2;
}
}
}//package classes.common
Section 6
//OnTimerLabels (classes.common.OnTimerLabels)
package classes.common {
import classes.main.*;
import flash.events.*;
public class OnTimerLabels extends OnTimer {
private var _entIndex:int;// = 0
protected var _firstMove:int;// = 1
private var _entLabelName:String;// = "Stay"
protected var _lastMove:int;// = 4
public function OnTimerLabels(){
_entIndex = 0;
_entLabelName = "Stay";
_firstMove = 1;
_lastMove = 4;
super();
}
override protected function onTimer(_arg1:TimerEvent):void{
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, onFrame);
};
_entIndex = Usefull.randRange(_firstMove, _lastMove);
_entLabelName = ("Move_" + _entIndex);
this.gotoAndPlay(_entLabelName);
}
override protected function onFrame(_arg1:Event):void{
if (((((!((currentFrame == 1))) && (currentLabel))) && (!((currentLabel == _entLabelName))))){
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onFrame);
};
gotoAndStop("Stay");
initTimer();
};
}
}
}//package classes.common
Section 7
//Sequence (classes.common.Sequence)
package classes.common {
import flash.display.*;
import classes.main.*;
public class Sequence extends MovieClip {
private var initFrame:int;
public function Sequence(_arg1:int=1){
if (totalFrames == 1){
Usefull.trace_debug(("WARNING: Sequence with one frame!!! Object: " + name));
};
initFrame = _arg1;
reset();
}
public function switchToNext():Boolean{
var _local1:int;
_local1 = 1;
if (currentFrame < totalFrames){
_local1 = (currentFrame + 1);
};
gotoAndStop(_local1);
return (((_local1 == initFrame)) ? true : false);
}
public function reset(_arg1:Boolean=false):void{
var _local2:*;
_local2 = (_arg1) ? totalFrames : initFrame;
gotoAndStop(_local2);
}
public function switchToLabel(_arg1:String):void{
var _local2:FrameLabel;
for each (_local2 in this.currentLabels) {
if (_local2.name == _arg1){
this.gotoAndStop(_arg1);
return;
};
};
Usefull.trace_debug(((("Sequnce::switchToLabel:: bad tab name: " + _arg1) + ", object: ") + name));
}
public function random(_arg1:int=1, _arg2:int=-1):void{
if (_arg2 == -1){
_arg2 = totalFrames;
};
gotoAndStop(Usefull.randRange(_arg1, _arg2));
}
public function switchToPrevious():Boolean{
var _local1:int;
_local1 = totalFrames;
if (currentFrame > 1){
_local1 = (currentFrame - 1);
};
gotoAndStop(_local1);
return (((_local1 == totalFrames)) ? true : false);
}
}
}//package classes.common
Section 8
//SequenceItem (classes.common.SequenceItem)
package classes.common {
import flash.events.*;
public class SequenceItem extends Sequence {
public function SequenceItem(){
initFrame = totalFrames;
super(initFrame);
this.buttonMode = true;
addEventListener(MouseEvent.CLICK, on_click);
}
private function on_click(_arg1:MouseEvent):void{
if (root.game.sounds){
root.game.sounds.playSound("push");
};
this.reset();
}
override public function random(_arg1:int=1, _arg2:int=-1):void{
super.random(0, (totalFrames - 1));
}
}
}//package classes.common
Section 9
//SequenceSet (classes.common.SequenceSet)
package classes.common {
import flash.display.*;
import classes.main.*;
public class SequenceSet {
private var sequentialMode:Boolean;
public var totalFrames:int;// = 0
protected var initLastFrame:Boolean;
protected var set:Array;
private var mode:Boolean;// = false
private var currentSet:int;// = 0
public function SequenceSet(_arg1:Array, _arg2:Boolean=false, _arg3:Boolean=false){
var _local4:Boolean;
var _local5:Sequence;
set = new Array();
mode = false;
totalFrames = 0;
currentSet = 0;
super();
totalFrames = 0;
sequentialMode = _arg2;
initLastFrame = _arg3;
_local4 = false;
for each (_local5 in _arg1) {
set.push(_local5);
if (sequentialMode){
totalFrames = (totalFrames + _local5.totalFrames);
if (!_local4){
_local4 = true;
_local5.visible = true;
} else {
_local5.visible = false;
};
} else {
if (((!((totalFrames == 0))) && (!((_local5.totalFrames == _local5.totalFrames))))){
Usefull.trace_debug("SequenceSet:: Sequences with different totalFrames parameter!");
} else {
totalFrames = _local5.totalFrames;
};
};
};
if (initLastFrame){
reset();
};
}
public function switchToIndex(_arg1:int):void{
var _local2:int;
var _local3:Boolean;
var _local4:Sequence;
var _local5:Sequence;
if (sequentialMode){
if (_arg1 > totalFrames){
trace("SequenceSet::switchToIndex: bad index: ", _arg1);
_arg1 = (_arg1 - totalFrames);
};
_local2 = 0;
_local3 = false;
for each (_local4 in set) {
if (((!(_local3)) && ((_local4.totalFrames >= _arg1)))){
currentSet = _local2;
_local3 = true;
_local4.visible = true;
_local4.gotoAndStop(_arg1);
} else {
_local4.visible = false;
};
if (!_local3){
_arg1 = (_arg1 - _local4.totalFrames);
_local2++;
};
};
} else {
for each (_local5 in set) {
_local5.gotoAndStop(_arg1);
};
};
}
public function hide():void{
var _local1:Sequence;
for each (_local1 in set) {
_local1.visible = false;
};
}
public function reset():void{
var _local1:Sequence;
var _local2:int;
var _local3:int;
_local2 = (initLastFrame) ? (set.length - 1) : 0;
_local3 = 0;
while (_local3 < set.length) {
_local1 = set[_local3];
if (sequentialMode){
if (_local3 == _local2){
currentSet = _local2;
_local1.visible = true;
} else {
_local1.visible = false;
};
};
_local1.reset(initLastFrame);
_local3++;
};
}
public function random(_arg1:int=1, _arg2:int=-1):void{
if (_arg2 == -1){
_arg2 = totalFrames;
};
switchToIndex(Usefull.randRange(_arg1, _arg2));
}
private function switchToPreviousSet():Boolean{
var _local1:Boolean;
_local1 = false;
set[currentSet].visible = false;
set[currentSet].reset();
currentSet = (currentSet - 1);
if (currentSet == -1){
currentSet = (set.length - 1);
_local1 = true;
};
set[currentSet].visible = true;
set[currentSet].reset();
set[currentSet].switchToPrevious();
return (_local1);
}
private function switchToNextSet():Boolean{
var _local1:Boolean;
_local1 = false;
set[currentSet].visible = false;
set[currentSet].reset();
currentSet = (currentSet + 1);
if (currentSet == set.length){
currentSet = 0;
_local1 = true;
};
set[currentSet].visible = true;
set[currentSet].reset();
return (_local1);
}
public function switchToLabel(_arg1:String):void{
var _local2:int;
var _local3:Boolean;
var _local4:Array;
var _local5:Sequence;
var _local6:FrameLabel;
var _local7:Sequence;
if (sequentialMode){
_local2 = 0;
for each (_local5 in set) {
_local3 = false;
_local4 = _local5.currentLabels;
for each (_local6 in _local4) {
if (_arg1 == _local6.name){
_local3 = true;
};
};
if (_local3){
currentSet = _local2;
_local5.visible = true;
_local5.gotoAndStop(_arg1);
} else {
_local5.visible = false;
};
_local2++;
};
} else {
for each (_local7 in set) {
_local7.gotoAndStop(_arg1);
};
};
}
public function switchToPrevious():Boolean{
var _local1:Sequence;
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
while (_local3 < set.length) {
if (((sequentialMode) && (!((currentSet == _local3))))){
} else {
_local1 = set[_local3];
_local2 = _local1.switchToPrevious();
if (((sequentialMode) && (_local2))){
return (switchToPreviousSet());
};
};
_local3++;
};
}
public function switchToNext():Boolean{
var _local1:Sequence;
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
while (_local3 < set.length) {
if (((sequentialMode) && (!((currentSet == _local3))))){
} else {
_local1 = set[_local3];
_local2 = _local1.switchToNext();
if (((sequentialMode) && (_local2))){
return (switchToNextSet());
};
};
_local3++;
};
}
public function get currentFrame():int{
var _local1:int;
var _local2:MovieClip;
var _local3:int;
if (sequentialMode){
_local1 = 0;
for (_local3 in set) {
_local2 = set[_local3];
if (_local2 == set[currentSet]){
_local1 = (_local1 + _local2.currentFrame);
} else {
_local1 = (_local1 + _local2.totalFrames);
};
};
return (_local1);
//unresolved jump
};
return (set[currentSet].currentFrame);
}
public function getCurrentLabel():String{
return (set[currentSet].currentLabel);
}
}
}//package classes.common
Section 10
//SequenceSetItem (classes.common.SequenceSetItem)
package classes.common {
import flash.display.*;
import flash.events.*;
public class SequenceSetItem extends SequenceSet {
public function SequenceSetItem(_arg1:Array, _arg2:Boolean){
var _local3:MovieClip;
super(_arg1, _arg2, true);
for each (_local3 in this.set) {
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.CLICK, on_click);
};
}
override public function random(_arg1:int=1, _arg2:int=-1):void{
super.random(1, (totalFrames - 1));
}
private function on_click(_arg1:MouseEvent):void{
if (_arg1.target.root.game.sounds){
_arg1.target.root.game.sounds.playSound("push");
};
this.reset();
}
}
}//package classes.common
Section 11
//SimpleTimer (classes.common.SimpleTimer)
package classes.common {
import flash.events.*;
import flash.utils.*;
public class SimpleTimer {
private var timer:Timer;
private var action:Function;
public function SimpleTimer(_arg1:int, _arg2:Function){
action = _arg2;
timer = new Timer((1000 * _arg1), 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimer);
timer.start();
}
private function onTimer(_arg1:TimerEvent):void{
action();
}
}
}//package classes.common
Section 12
//Avatar (classes.main.avatar.Avatar)
package classes.main.avatar {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.adobe.images.*;
import flash.geom.*;
public class Avatar extends MovieClip {
public var png_image_data:ByteArray;
public function Avatar(){
visible = false;
}
public function make_shot(_arg1:Boolean):BitmapData{
var _local2:BitmapData;
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Point;
root.game.hide_hitch();
if (_arg1){
root.game.hide_backs();
};
_local2 = new BitmapData(root.width, root.height, true, 0);
_local2.draw(root);
root.game.hide_hitch(false);
if (_arg1){
root.game.hide_backs(false);
};
_local3 = new BitmapData(this.width, this.height);
_local4 = new Rectangle(this.x, this.y, this.width, this.height);
_local5 = new Point(0, 0);
_local3.copyPixels(_local2, _local4, _local5);
png_image_data = PNGEncoder2.encode(_local3);
return (_local3);
}
}
}//package classes.main.avatar
Section 13
//Captcha (classes.main.avatar.Captcha)
package classes.main.avatar {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import classes.common.*;
import flash.text.*;
public class Captcha extends MovieClip {
private var _length:int;
public var inputDigits:TextField;
private var _inputColor:uint;
private var _flashTime:Number;
private var _timer:Timer;
public var digit3:Digit;
public var digit2:Digit;
public var digit1:Digit;
public var digit4:Digit;
private var _flash_inputColor:uint;
public function Captcha(){
stop();
digit1.set_random_number();
digit2.set_random_number();
digit3.set_random_number();
digit4.set_random_number();
_length = 4;
_inputColor = this.inputDigits.textColor;
_flash_inputColor = 0xCC0000;
_flashTime = 0.2;
_timer = new Timer((1000 * _flashTime), 4);
_timer.addEventListener(TimerEvent.TIMER, on_timer);
}
public function check():Boolean{
var _local1:String;
var _local2:Digit;
var _local3:int;
_local1 = this.inputDigits.text;
if (_local1.length != this._length){
flash();
return (false);
};
_local3 = 1;
while (_local3 < (_local1.length + 1)) {
_local2 = this.getChildByName(("digit" + _local3));
if (_local2.get_number() != int(_local1.charAt((_local1.length - _local3)))){
flash();
return (false);
};
_local3++;
};
return (true);
}
private function on_timer(_arg1:TimerEvent):void{
if (this.inputDigits.textColor == _flash_inputColor){
this.inputDigits.textColor = _inputColor;
} else {
this.inputDigits.textColor = _flash_inputColor;
};
}
private function flash():void{
_timer.reset();
_timer.start();
}
}
}//package classes.main.avatar
Section 14
//Checkbox1 (classes.main.avatar.Checkbox1)
package classes.main.avatar {
import classes.common.*;
public class Checkbox1 extends Checkbox {
}
}//package classes.main.avatar
Section 15
//Checkbox2 (classes.main.avatar.Checkbox2)
package classes.main.avatar {
import classes.common.*;
public class Checkbox2 extends Checkbox {
}
}//package classes.main.avatar
Section 16
//Mail_input (classes.main.avatar.Mail_input)
package classes.main.avatar {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class Mail_input extends MovieClip {
public var inputField:TextField;
private var _inputColor:uint;
private var _flashTime:Number;
private var _timer:Timer;
private var _flash_inputColor:uint;
public function Mail_input(){
_inputColor = this.inputField.textColor;
_flash_inputColor = 0xCC0000;
_flashTime = 0.2;
_timer = new Timer((1000 * _flashTime), 4);
_timer.addEventListener(TimerEvent.TIMER, on_timer);
}
public function check():Boolean{
var _local1:String;
_local1 = this.inputField.text;
if (!validateEmail(_local1)){
flash();
return (false);
};
return (true);
}
private function validateEmail(_arg1:String):Boolean{
var _local2:RegExp;
var _local3:Object;
_local2 = /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/;
_local3 = _local2.exec(_arg1);
if (_local3 == null){
return (false);
};
return (true);
}
public function get_text():String{
return (this.inputField.text);
}
private function on_timer(_arg1:TimerEvent):void{
if (this.inputField.textColor == _flash_inputColor){
this.inputField.textColor = _inputColor;
} else {
this.inputField.textColor = _flash_inputColor;
};
}
private function flash():void{
_timer.reset();
_timer.start();
}
}
}//package classes.main.avatar
Section 17
//Popup (classes.main.avatar.Popup)
package classes.main.avatar {
import flash.display.*;
import classes.main.*;
import flash.events.*;
import classes.common.*;
import classes.*;
import flash.net.*;
import flash.text.*;
public class Popup extends MovieClip {
public var buttonMail:SimpleButton;
public var checkBack:Checkbox2;
public var checkSize2:Checkbox1;
public var checkSize3:Checkbox1;
private var _lastCheckBox:String;
private var _withoutBack_flag:Boolean;// = false
private var _avatar_index:int;
private var _avaPicture:Shape;// = null
public var mail_input:Mail_input;
public var checkSize1:Checkbox1;
public var captcha:Captcha;
public var preview:MovieClip;
public var buttonClose:SimpleButton;
private static var _EVENT1:String = "is_loaded";
public function Popup(){
_avaPicture = null;
_withoutBack_flag = false;
super();
addFrameScript(0, frame1);
addEventListener(_EVENT1, eventHandler);
}
private function send_mail(_arg1:String):void{
var _local2:String;
var _local3:URLRequest;
_local2 = (Options.SERVER_URL + Options.SCRIPT_NAME);
_local2 = (_local2 + ("?email=" + _arg1));
_local2 = (_local2 + ("&gname=" + Options.MAIL_GAME_NAME));
_local3 = new URLRequest(_local2);
_local3.data = root.game.get_avatarPng();
_local3.method = URLRequestMethod.POST;
_local3.contentType = "application/octet-stream";
if (Options.TEST_SCRIPT){
navigateToURL(_local3, "_blank");
} else {
sendToURL(_local3);
};
}
private function on_mail(_arg1:MouseEvent):void{
if (!this.mail_input.check()){
if (root.sounds){
root.sounds.playSound("bad");
};
return;
};
if (!this.captcha.check()){
if (root.sounds){
root.sounds.playSound("bad");
};
return;
};
send_mail(this.mail_input.get_text());
on_close(null);
}
function removeListeners():void{
if (hasEventListener(_EVENT1)){
removeEventListener(_EVENT1, eventHandler);
};
}
function eventHandler(_arg1:Event):void{
if (!root){
return;
};
initButtons();
_avatar_index = 1;
this.visible = false;
}
function frame1(){
dispatchEvent(new Event("is_loaded"));
}
function addButton(_arg1:DisplayObject, _arg2:Function):void{
var subFunc:Function;
var buttObj = _arg1;
var eventFunc = _arg2;
subFunc = function (_arg1:MouseEvent){
if (root.sounds){
root.sounds.playSound("push");
};
eventFunc(_arg1);
};
if (!buttObj.hasEventListener(MouseEvent.CLICK)){
buttObj.addEventListener(MouseEvent.CLICK, subFunc);
};
if (!buttObj.hasEventListener(MouseEvent.MOUSE_OVER)){
buttObj.addEventListener(MouseEvent.MOUSE_OVER, on_mouseOver);
};
}
function initButtons():void{
try {
addButton(buttonClose, on_close);
addButton(buttonMail, on_mail);
checkSize1.pushIntoGroup("SIZE");
checkSize2.pushIntoGroup("SIZE");
checkSize3.pushIntoGroup("SIZE");
checkSize1.addEventListener(Checkbox.MOUSE_CLICK, on_checkboxClicked);
checkSize2.addEventListener(Checkbox.MOUSE_CLICK, on_checkboxClicked);
checkSize3.addEventListener(Checkbox.MOUSE_CLICK, on_checkboxClicked);
checkSize1.toggle();
_lastCheckBox = "checkSize1";
checkBack.addEventListener(Checkbox.MOUSE_CLICK, on_checkBack);
removeListeners();
} catch(e:Error) {
trace(e);
trace("Object does not exist!");
};
}
private function on_close(_arg1:MouseEvent):void{
this.visible = false;
}
private function make_preview(_arg1:BitmapData):void{
var _local2:Shape;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = new Shape();
_local2.graphics.beginBitmapFill(_arg1);
_local2.graphics.drawRect(0, 0, _arg1.width, _arg1.height);
_local2.graphics.endFill();
if (_avaPicture){
preview.removeChild(_avaPicture);
};
_local3 = 1;
_local4 = 1;
_local5 = 1;
_local3 = (preview.width / _local2.width);
_local4 = (preview.height / _local2.height);
if (_local3 < _local4){
_local5 = _local3;
} else {
_local5 = _local4;
};
_local2.width = (_local2.width * _local5);
_local2.height = (_local2.height * _local5);
_avaPicture = _local2;
preview.addChild(_local2);
_local2.x = ((preview.width - _local2.width) / 2);
_local2.y = ((preview.height - _local2.height) / 2);
preview.back.visible = false;
}
private function on_checkboxClicked(_arg1:Event):void{
var _local2:BitmapData;
if (_arg1.target.name == _lastCheckBox){
return;
};
if (root.sounds){
root.sounds.playSound("push");
};
this.visible = false;
_avatar_index = _arg1.target.name.charAt((_arg1.target.name.length - 1));
_local2 = root.game.get_avatarBmp(_withoutBack_flag, _avatar_index);
this.visible = true;
make_preview(_local2);
_lastCheckBox = _arg1.target.name;
}
private function on_checkBack(_arg1:Event):void{
if (root.sounds){
root.sounds.playSound("push");
};
_withoutBack_flag = _arg1.target.get_state();
update_avatar();
}
public function update_avatar():void{
var _local1:BitmapData;
this.visible = false;
_local1 = root.game.get_avatarBmp(_withoutBack_flag, _avatar_index);
this.visible = true;
make_preview(_local1);
}
function on_mouseOver(_arg1:MouseEvent):void{
if (root.sounds){
root.sounds.playSound("over");
};
}
public function show():void{
update_avatar();
this.visible = true;
}
}
}//package classes.main.avatar
Section 18
//Suit_generator (classes.main.suits.Suit_generator)
package classes.main.suits {
import classes.main.*;
import classes.*;
public class Suit_generator {
var mandatoryClothes2:Array;
var exceptions:Array;
var mandatoryClothes:Array;
public function Suit_generator(){
var _local1:Array;
var _local2:String;
mandatoryClothes = Options.SUITS_MANDATORY;
mandatoryClothes2 = new Array();
exceptions = Options.SUITS_EXCEPTIONS;
super();
for each (_local1 in mandatoryClothes) {
for each (_local2 in _local1) {
if (mandatoryClothes2.indexOf(_local2) == -1){
mandatoryClothes2.push(_local2);
};
};
};
}
function addToNewSet(_arg1:String, _arg2:Array, _arg3:Object):Array{
var _local4:Boolean;
var _local5:String;
_local4 = true;
for each (_local5 in _arg2) {
if (((_arg3.hasOwnProperty(_local5)) && (!((_arg3[_local5].indexOf(_arg1) == -1))))){
_local4 = false;
};
};
if (_local4){
_arg2.push(_arg1);
};
return (_arg2);
}
public function generate_suitSet(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:String;
var _local5:String;
_local2 = new Array();
for each (_local3 in mandatoryClothes) {
if (_local3.length > 0){
_local5 = _local3[Usefull.randRange(0, (_local3.length - 1))];
_local2 = addToNewSet(_local5, _local2, _arg1);
};
};
for each (_local4 in Options.OBJECT_NAMES) {
if ((((((mandatoryClothes2.indexOf(_local4) == -1)) && ((Usefull.randRange(0, 1) == 1)))) && ((exceptions.indexOf(_local4) == -1)))){
addToNewSet(_local4, _local2, _arg1);
};
};
return (_local2);
}
}
}//package classes.main.suits
Section 19
//ClothesButtons (classes.main.ClothesButtons)
package classes.main {
import flash.display.*;
import flash.events.*;
import classes.common.*;
public class ClothesButtons extends ButtonsBar {
public var button_hat:MovieClip;
public var button_glasses:MovieClip;
public var button_accessory:MovieClip;
public var button_wig:MovieClip;
public var button_shoes:MovieClip;
public var button_tights:MovieClip;
public var button_skirt:MovieClip;
public var button_top:MovieClip;
override public function init():void{
var _local1:DisplayObject;
var _local2:int;
_local2 = 0;
while (_local2 < numChildren) {
_local1 = this.getChildAt(_local2);
if (_local1.name.indexOf("button") != -1){
addButtonArrows(_local1);
};
_local2++;
};
}
protected function on_buttonClothe(_arg1:MouseEvent):void{
var _local2:String;
_local2 = _arg1.target.name.slice("button_".length);
root.game.switchClothe(_local2);
}
override protected function on_leftClothes(_arg1:Event):void{
var _local2:String;
if (root.game.sounds){
root.game.sounds.playSound("push");
};
_local2 = _arg1.target.name.slice("button_".length);
root.game.switchClothe(_local2, true);
}
override protected function on_rightClothes(_arg1:Event):void{
var _local2:String;
if (root.game.sounds){
root.game.sounds.playSound("push");
};
_local2 = _arg1.target.name.slice("button_".length);
root.game.switchClothe(_local2, false);
}
}
}//package classes.main
Section 20
//Game (classes.main.Game)
package classes.main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import classes.common.*;
import classes.main.suits.*;
import classes.main.avatar.*;
import classes.*;
public class Game {
public var _root:DisplayObjectContainer;
public var wallpaper:Sequence;
public var sounds:Sounds;
public var objects:Object;
public var suit_generator:Suit_generator;
private var _avatar_popup:Popup;
public var objectsIntact:Boolean;
public function Game(_arg1:DisplayObjectContainer, _arg2:Sounds=null){
objects = new Object();
super();
_root = _arg1;
if (_arg2){
sounds = _arg2;
} else {
sounds = new Sounds();
};
_root.sounds = sounds;
if (_root.hasOwnProperty("Avatar_popup")){
_avatar_popup = _root.getChildByName("Avatar_popup");
};
init(_root);
suit_generator = new Suit_generator();
randomClothe();
if (_root.hasOwnProperty("tempObjects")){
_root.removeChild(_root.tempObjects);
};
}
public function get_avatarBmp(_arg1:Boolean=false, _arg2:int=1):BitmapData{
avatar = _root.getChildByName(("avatar" + _arg2));
return (avatar.make_shot(_arg1));
}
public function popup_avatar():void{
if (_avatar_popup){
_avatar_popup.show();
};
}
public function traceObjects(_arg1:DisplayObjectContainer=null, _arg2:String=""):void{
var _local3:*;
var _local4:uint;
if (_arg1 == null){
_arg1 = _root;
};
_local4 = 0;
while (_local4 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local4);
if (_local3 == null){
trace("child is null!!!");
return;
};
trace(_arg2, _local3, _local3.name);
if ((_arg1.getChildAt(_local4) is DisplayObjectContainer)){
traceObjects(DisplayObjectContainer(_local3), (_arg2 + " "));
};
_local4++;
};
}
public function showAuthors():void{
if (sounds){
sounds.playSound("authors");
};
_root.authors.y = (_root._stage_height / 2);
_root.authors.play();
_root.authors.stage.addChild(_root.authors);
}
function init(_arg1:DisplayObjectContainer):void{
var _local2:*;
var _local3:String;
var _local4:uint;
var _local5:String;
var _local6:Array;
var _local7:Array;
var _local8:String;
var _local9:SequenceItem;
var _local10:SequenceSetItem;
_local4 = 0;
while (_local4 < _arg1.numChildren) {
_local2 = _arg1.getChildAt(_local4);
_local3 = _local2.name.toLowerCase();
if (Options.OBJECT_NAMES.indexOf(_local3) != -1){
objects[_local3] = _local2;
};
_local4++;
};
for each (_local5 in Options.OBJECT_NAMES) {
if (Options.COMPLEX_OBJECTS.hasOwnProperty(_local5)){
_local6 = Options.COMPLEX_OBJECTS[_local5];
_local7 = new Array();
for each (_local8 in _local6) {
_local9 = _arg1.getChildByName(_local8);
if (_local9){
_local7.push(_local9);
} else {
Usefull.trace_debug(("Error while creating complex object: " + _local5));
Usefull.trace_debug((("---- movieclip " + _local8) + " does not exist!"));
};
};
if (_local7.length > 0){
_local10 = new SequenceSetItem(_local7, true);
objects[_local5] = _local10;
} else {
Usefull.trace_debug((("Complex object: " + _local5) + "was not created!"));
};
};
};
}
public function update_bra():void{
_root.Bra.visible = true;
if (objects["top"].currentFrame != (_root.Top1.totalFrames + _root.Top2.totalFrames)){
_root.Bra.visible = false;
};
}
function reset(_arg1:Boolean=true, _arg2:Boolean=true):void{
var _local3:*;
if (objectsIntact){
if (sounds){
sounds.playSound("push");
};
return;
};
for each (_local3 in objects) {
_local3.reset();
};
objectsIntact = true;
}
public function switchClothe(_arg1:String, _arg2:Boolean=false):void{
var _local3:Boolean;
var _local4:String;
objectsIntact = false;
if (this.objects.hasOwnProperty(_arg1)){
if (!_arg2){
_local3 = !(objects[_arg1].switchToNext());
} else {
_local3 = !(objects[_arg1].switchToPrevious());
};
if (_local3){
if (Options.DRESSUP_TABLE.hasOwnProperty(_arg1)){
for each (_local4 in Options.DRESSUP_TABLE[_arg1]) {
objects[_local4].reset();
};
};
};
} else {
Usefull.trace_debug(("Game::switchObject:: bad clothe type: " + _arg1));
};
}
public function get_avatarPng():ByteArray{
return (avatar.png_image_data);
}
public function hide_backs(_arg1:Boolean=true):void{
if (_root.hasOwnProperty("Wallpaper")){
_root.getChildByName("Wallpaper").visible = !(_arg1);
};
}
function randomClothe():void{
var _local1:Array;
var _local2:String;
reset();
_local1 = suit_generator.generate_suitSet(Options.DRESSUP_TABLE);
for each (_local2 in _local1) {
if (objects.hasOwnProperty(_local2)){
objects[_local2].random();
};
};
objectsIntact = false;
}
function toggleSounds(_arg1:Event):void{
if (!sounds.soundsEnabled){
return;
};
if (_arg1.type == Event.ACTIVATE){
sounds.turnOn();
} else {
sounds.turnOff();
};
}
public function hide_hitch(_arg1:Boolean=true):void{
}
}
}//package classes.main
Section 21
//language (classes.main.language)
package classes.main {
import flash.net.*;
public class language {
public static var localConnection = new LocalConnection();
public static var _languageNum:uint = 0;
public static var _languageBox:Array = new Array();
public static var SpillGroupUrl:Array = new Array();
public static var gamename = "default_name";
public static function get url2():String{
var _local1:int;
_local1 = 0;
while (_local1 < SpillGroupUrl.length) {
if (localConnection.domain == SpillGroupUrl[_local1]){
return (_languageBox[_languageNum].url2);
};
_local1++;
};
return (_languageBox[_languageNum].url2);
}
public static function get language_nr():int{
return (_languageBox[_languageNum].language_nr);
}
public static function get portal():String{
return (_languageBox[_languageNum].portal);
}
public static function set Language(_arg1:Object):void{
var returnDomain:*;
var hostingdomain:String;
var myList:String;
var myArray:Array;
var language1:*;
var language2:*;
var language3:*;
var language4:*;
var language5:*;
var language6:*;
var language7:*;
var language8:*;
var language9:*;
var language10:*;
var language11:*;
var language12:*;
var language13:*;
var language14:*;
var language15:*;
var language16:*;
var language17:*;
var language18:*;
var language19:*;
var domainextention:int;
var domainname:int;
var languageVersion = _arg1;
returnDomain = function (_arg1:String):String{
var _local2:String;
var _local3:uint;
_local2 = new String();
_local3 = 7;
while (_local3 < _arg1.length) {
if (_arg1.charAt(_local3) == "/"){
break;
};
_local2 = (_local2 + _arg1.charAt(_local3));
_local3++;
};
return (_local2);
};
hostingdomain = "";
myList = localConnection.domain;
myArray = myList.split(".");
if (myArray.length <= 3){
domainextention = (myArray.length - 1);
domainname = (myArray.length - 2);
hostingdomain = ((myArray[domainname] + ".") + myArray[domainextention]);
} else {
hostingdomain = localConnection.domain;
};
language1 = new languageItem();
language1.url1 = ((("http://www.girlsgogames.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language1.url2 = ("http://www.girlsgogames.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language1.language_nr = 1;
language1.branding_nr = 29;
language1.portal = "girl";
_languageBox.push(language1);
language2 = new languageItem();
language2.url1 = "http://www.game.com.cn/moregames/";
language2.url2 = "http://www.game.com.cn/moregames/";
language2.language_nr = 2;
language2.branding_nr = 2;
language2.portal = "game_com_cn";
_languageBox.push(language2);
language3 = new languageItem();
language3.url1 = ((("http://www.girlsgogames.nl/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language3.url2 = ("http://www.girlsgogames.nl/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language3.language_nr = 3;
language3.branding_nr = 30;
language3.portal = "girl";
_languageBox.push(language3);
language4 = new languageItem();
language4.url1 = ((("http://www.girlsgogames.fr/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language4.url2 = ("http://www.girlsgogames.fr/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language4.language_nr = 4;
language4.branding_nr = 31;
language4.portal = "girl";
_languageBox.push(language4);
language5 = new languageItem();
language5.url1 = ((("http://www.girlsgogames.de/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language5.url2 = ("http://www.girlsgogames.de/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language5.language_nr = 5;
language5.branding_nr = 32;
language5.portal = "girl";
_languageBox.push(language5);
language6 = new languageItem();
language6.url1 = ((("http://www.girlsgogames.pl/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language6.url2 = ("http://www.girlsgogames.pl/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language6.language_nr = 6;
language6.branding_nr = 33;
language6.portal = "girl";
_languageBox.push(language6);
language7 = new languageItem();
language7.url1 = ((("http://www.girlsgogames.se/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language7.url2 = ("http://www.girlsgogames.se/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language7.language_nr = 7;
language7.branding_nr = 34;
language7.portal = "girl";
_languageBox.push(language7);
language8 = new languageItem();
language8.url1 = ((("http://www.girlsgogames.it/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language8.url2 = ("http://www.girlsgogames.it/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language8.language_nr = 8;
language8.branding_nr = 35;
language8.portal = "girl";
_languageBox.push(language8);
language9 = new languageItem();
language9.url1 = ((("http://www.juegosdechicas.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language9.url2 = ("http://www.juegosdechicas.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language9.language_nr = 9;
language9.branding_nr = 36;
language9.portal = "girl";
_languageBox.push(language9);
language10 = new languageItem();
language10.url1 = ((("http://www.girlsgogames.com.br/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language10.url2 = ("http://www.girlsgogames.com.br/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language10.language_nr = 11;
language10.branding_nr = 38;
language10.portal = "girl";
_languageBox.push(language10);
language11 = new languageItem();
language11.url1 = ((("http://www.games.co.id/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language11.url2 = ("http://www.games.co.id/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language11.language_nr = 13;
language11.branding_nr = 13;
language11.portal = "tweens";
_languageBox.push(language11);
language12 = new languageItem();
language12.url1 = ((("http://www.girlsgogames.ru/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language12.url2 = ("http://www.girlsgogames.ru/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language12.language_nr = 12;
language12.branding_nr = 39;
language12.portal = "girl";
_languageBox.push(language12);
language13 = new languageItem();
language13.url1 = ((("http://www.girlsgogames.co.uk/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language13.url2 = ("http://www.girlsgogames.co.uk/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language13.language_nr = 16;
language13.branding_nr = 37;
language13.portal = "girl";
_languageBox.push(language13);
language14 = new languageItem();
language14.url1 = ((("http://www.girlsgogames.in/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language14.url2 = ("http://www.girlsgogames.in/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language14.language_nr = 16;
language14.branding_nr = 40;
language14.portal = "girl";
_languageBox.push(language14);
language15 = new languageItem();
language15.url1 = ((("http://www.girlsgogamestr.com/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language15.url2 = ("http://www.girlsgogamestr.com/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language15.language_nr = 14;
language15.branding_nr = 41;
language15.portal = "girl";
_languageBox.push(language15);
language16 = new languageItem();
language16.url1 = ((("http://www.game.com.my/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language16.url2 = ("http://www.game.com.my/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language16.language_nr = 15;
language16.branding_nr = 16;
language16.portal = "tweens";
_languageBox.push(language16);
language17 = new languageItem();
language17.url1 = ((("http://www.ojogos.pt/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language17.url2 = ("http://www.ojogos.pt/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language17.language_nr = 10;
language17.branding_nr = 42;
language17.portal = "family";
_languageBox.push(language17);
language18 = new languageItem();
language18.url1 = ((("http://www.egames.jp/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language18.url2 = ("http://www.egames.jp/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language18.language_nr = 17;
language18.branding_nr = 44;
language18.portal = "tweens";
_languageBox.push(language18);
language19 = new languageItem();
language19.url1 = ((("http://www.girlsgogames.es/moregames/?utm_medium=brandedgames_external&utm_campaign=" + gamename) + "&utm_source=") + hostingdomain);
language19.url2 = ("http://www.girlsgogames.es/moregames/?utm_medium=brandedgames_internal&utm_campaign=" + gamename);
language19.language_nr = 9;
language19.branding_nr = 29;
language19.portal = "girl";
_languageBox.push(language19);
SpillGroupUrl.push("localhost");
SpillGroupUrl.push("www8.agame.com");
if ((((((languageVersion is Number)) || ((languageVersion is uint)))) || ((languageVersion is int)))){
_languageNum = (Number(languageVersion) - 1);
};
}
public static function get url1():String{
var _local1:int;
_local1 = 0;
while (_local1 < SpillGroupUrl.length) {
if (localConnection.domain == SpillGroupUrl[_local1]){
return (_languageBox[_languageNum].url2);
};
_local1++;
};
return (_languageBox[_languageNum].url1);
}
public static function get branding_nr():String{
return (_languageBox[_languageNum].branding_nr);
}
}
}//package classes.main
class languageItem {
public var url1:String;
public var url2:String;
public var branding_nr:int;
public var language_nr:int;
public var portal:String;
private function languageItem(){
}
}
Section 22
//Main (classes.main.Main)
package classes.main {
import flash.display.*;
import flash.events.*;
import classes.main.avatar.*;
import classes.*;
import classes.objects.*;
import flash.net.*;
public dynamic class Main extends MovieClip {
public var avatar2:Avatar;
public var avatar3:Avatar;
public var Glasses:Glasses;
public var Tights:Tights;
public var game:Game;
public var sounds:Sounds;
public var authors:MovieClip;
public var Avatar_popup:Popup;
public var hitareaLogo:SimpleButton;
var old_frame:int;// = 0
public var _stage_height:Number;
public var Hat:Hat;
public var logo_mainscreen:MovieClip;
public var _stage_width:Number;
public var Top_1:Top1;
public var Top_2:Top2;
public var Top_3:Top3;
public var loadingComplete:Boolean;// = false
var request:URLRequest;
public var Wig:Wig;
var localConnection:LocalConnection;
public var Shoes:Shoes;
public var hitareaLoader:MovieClip;
public var Skirt_1:Skirt1;
public var Skirt_2:Skirt2;
public var Wallpaper:MovieClip;
public var Accessory:Accessory;
public var avatar1:Avatar;
public function Main(){
var _local1:Sprite;
localConnection = new LocalConnection();
loadingComplete = false;
old_frame = 0;
super();
addFrameScript(1, frame2);
stop();
stage.align = StageAlign.TOP_LEFT;
_stage_width = 700;
_stage_height = 600;
_local1 = new Sprite();
_local1.graphics.beginFill(0xFF0000);
_local1.graphics.drawRect(-1, -2, (_stage_width + 1), (_stage_height + 1));
addChild(_local1);
this.mask = _local1;
init_loader();
}
function updateProgress(_arg1:ProgressEvent):void{
var _local2:int;
var _local3:int;
_local2 = ((_arg1.bytesLoaded * 100) / _arg1.bytesTotal);
_local3 = (10 + ((69 * _local2) / 100));
if ((((introObject.currentFrame >= 9)) && ((old_frame < _local3)))){
introObject.gotoAndStop(_local3);
old_frame = _local3;
};
}
function init_loader():void{
hitareaLoader.addEventListener(MouseEvent.CLICK, onCLick1);
if (language.portal == "family"){
introObject = new intro_1();
};
if (language.portal == "tweens"){
introObject = new intro_2();
};
if (language.portal == "girl"){
introObject = new intro_3();
};
if (language.portal == "game_com_cn"){
introObject = new intro_4();
};
addChild(introObject);
introObject.x = (_stage_width / 2);
introObject.y = (_stage_height / 2);
introObject.play();
addChild(hitareaLoader);
if (loaderInfo.bytesTotal == loaderInfo.bytesLoaded){
on_complete_();
};
loaderInfo.addEventListener(ProgressEvent.PROGRESS, updateProgress);
loaderInfo.addEventListener(Event.COMPLETE, on_completeLoading);
}
function on_sceneGame_loaded(_arg1:Event):void{
stop();
if (hasEventListener("enter_frame")){
removeEventListener("enter_frame", on_sceneGame_loaded);
};
init_game();
}
function on_completeLoading(_arg1:Event):void{
on_complete_();
}
function onCLick1(_arg1:Event):void{
if (language.language_nr == 2){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=logo_intro"));
};
navigateToURL(request, "_blank");
}
function onCLick3(_arg1:Event):void{
if (language.language_nr == 2){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_gameover_moregames"));
};
navigateToURL(request, "_blank");
}
function onCLick4(_arg1:Event):void{
if (language.language_nr == 2){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_highscore_3000games"));
};
navigateToURL(request, "_blank");
}
function frame2(){
dispatchEvent(new Event("enter_frame"));
}
function onCLick2(_arg1:Event):void{
if (language.language_nr == 2){
request = new URLRequest(language.url1);
} else {
request = new URLRequest((language.url1 + "&utm_content=button_mainscreen_moregames"));
};
navigateToURL(request, "_blank");
}
function init_game():void{
try {
hitareaLogo.addEventListener(MouseEvent.CLICK, onCLick2);
} catch(e:Error) {
Usefull.trace_debug("Bad hitareaLogo!");
};
game = new Game(this, sounds);
}
function on_complete_():void{
if (hasEventListener(ProgressEvent.PROGRESS)){
removeEventListener(ProgressEvent.PROGRESS);
};
if (hasEventListener(Event.COMPLETE)){
removeEventListener(Event.COMPLETE, on_completeLoading);
};
loadingComplete = true;
introObject.play();
addEventListener("enter_frame", on_sceneGame_loaded);
}
language.gamename = Options.GAME_NAME;
language.Language = Options.LOCALE_NUMBER;
}
}//package classes.main
Section 23
//OptionsButtons (classes.main.OptionsButtons)
package classes.main {
import flash.display.*;
import flash.events.*;
import classes.common.*;
import classes.*;
import flash.net.*;
public class OptionsButtons extends ButtonsBar {
public var button_avatar:SimpleButton;
public var button_authors:SimpleButton;
public var button_random:SimpleButton;
public var button_sound:MovieClip;
private function on_buttonRandom(_arg1:MouseEvent):void{
if (root.sounds){
root.sounds.playSound("random");
};
root.game.randomClothe();
}
override public function init():void{
var _local1:DisplayObject;
var _local2:int;
_local2 = 0;
while (_local2 < numChildren) {
_local1 = this.getChildAt(_local2);
if (_local1.name.indexOf("button") != -1){
switch (_local1.name){
case "button_sound":
addButton(_local1, on_buttonSound);
new SimpleTimer(0, updateSoundButton);
break;
case "button_reset":
addButton(_local1, on_buttonReset, true);
break;
case "button_authors":
addButton(_local1, on_buttonAuthors, true);
break;
case "buttonOthergame_1":
case "buttonOthergame_2":
addButton(_local1, on_buttonOthergame);
break;
case "button_avatar":
addButton(_local1, on_buttonAvatar);
break;
case "button_random":
addButton(_local1, on_buttonRandom, true);
break;
default:
Usefull.trace_debug(("OptionsButtons::init: Unknown button: " + _local1.name));
};
};
_local2++;
};
}
private function on_buttonAuthors(_arg1:MouseEvent):void{
root.game.showAuthors();
}
override public function reset():void{
}
private function on_buttonOthergame(_arg1:MouseEvent):void{
var _local2:String;
var _local3:String;
var _local4:URLRequest;
_local2 = _arg1.target.name.charAt((_arg1.target.name.length - 1));
_local3 = Options.OTHERGAME_SCRIPT_LOCATION;
_local3 = (_local3 + ("?locale=" + Options.LOCALE_NUMBER));
_local3 = (_local3 + ("&game=" + _local2));
_local4 = new URLRequest(_local3);
navigateToURL(_local4, "_blank");
}
private function updateSoundButton():void{
if (((root.game) && (root.game.sounds))){
if (root.game.sounds.soundsEnabled){
button_sound.gotoAndStop("On");
} else {
button_sound.gotoAndStop("Off");
};
} else {
button_sound.gotoAndStop("On");
};
}
private function on_buttonAvatar(_arg1:MouseEvent):void{
root.game.popup_avatar();
}
private function on_buttonSound(_arg1:MouseEvent):void{
if (root.game.sounds){
root.game.sounds.toggleSounds();
};
updateSoundButton();
}
private function on_buttonReset(_arg1:MouseEvent):void{
if (root.game.objectsIntact){
return;
};
root.game.reset();
if (root.game.sounds){
root.game.sounds.playSound("reset");
};
}
}
}//package classes.main
Section 24
//Sounds (classes.main.Sounds)
package classes.main {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import classes.*;
public class Sounds {
var sounds:Object;
var music_pausePosition:int;// = 0
var channels:Object;
var music_startPosition:int;// = 0
public var soundsEnabled:Boolean;// = true
var musicChannel:SoundChannel;
public function Sounds(){
soundsEnabled = true;
sounds = new Object();
channels = new Object();
music_startPosition = 0;
music_pausePosition = 0;
super();
addSound("over", "sound01");
addSound("push", "sound02");
addSound("random", "sound03");
addSound("authors", "sound05");
addSound("bad", "sound06");
setVolume(Options.SOUND_VOLUME, "sound");
addSound("music", "music");
if (sounds.hasOwnProperty("music")){
musicChannel = sounds["music"].play();
musicChannel.addEventListener(Event.SOUND_COMPLETE, on_musicComplete);
setVolume(Options.MUSIC_VOLUME, "music");
};
}
public function turnOn():void{
try {
musicChannel = sounds["music"].play(music_pausePosition);
musicChannel.addEventListener(Event.SOUND_COMPLETE, on_musicComplete);
setVolume(Options.MUSIC_VOLUME, "music");
} catch(e:Error) {
Usefull.trace_debug("Sounds::turnOn:: error!");
};
}
private function setVolume(_arg1:Number, _arg2:String):void{
var _local3:SoundTransform;
var _local4:String;
if (_arg2 == "music"){
_local3 = musicChannel.soundTransform;
_local3.volume = _arg1;
musicChannel.soundTransform = _local3;
} else {
for (_local4 in channels) {
if (_local4.indexOf("music") == -1){
_local3 = channels[_local4].soundTransform;
_local3.volume = _arg1;
channels[_local4].soundTransform = _local3;
};
};
};
}
public function stopSound(_arg1:String):void{
if (((soundsEnabled) && (channels[_arg1]))){
channels[_arg1].stop();
};
}
function addSound(_arg1:String, _arg2:String):void{
var transform:SoundTransform;
var ClassReference:Class;
var soundName = _arg1;
var iSoundclassName = _arg2;
try {
ClassReference = (getDefinitionByName(iSoundclassName) as Class);
sounds[soundName] = new (ClassReference);
} catch(e:Error) {
Usefull.trace_debug(("Sounds::addSound:: added empty sound: " + soundName));
return;
};
transform = new SoundTransform(0);
channels[soundName] = sounds[soundName].play(0, 0, transform);
channels[soundName].stop();
}
public function turnOff():void{
try {
music_pausePosition = musicChannel.position;
musicChannel.stop();
musicChannel = null;
} catch(e:Error) {
Usefull.trace_debug("Sounds::turnOff:: error!");
};
}
private function on_musicComplete(_arg1:Event){
musicChannel = sounds["music"].play(music_startPosition);
musicChannel.addEventListener(Event.SOUND_COMPLETE, on_musicComplete);
setVolume(Options.MUSIC_VOLUME, "music");
}
public function toggleSounds():void{
soundsEnabled = !(soundsEnabled);
if (!soundsEnabled){
turnOff();
} else {
turnOn();
};
}
public function playSound(_arg1:String, _arg2:Number=0, _arg3:int=0):void{
if (!soundsEnabled){
return;
};
if (channels.hasOwnProperty(_arg1)){
channels[_arg1] = sounds[_arg1].play(_arg2, _arg3, channels[_arg1].soundTransform);
} else {
trace(("Sounds::playSound:: Bad sound name: " + _arg1));
};
}
}
}//package classes.main
Section 25
//Usefull (classes.main.Usefull)
package classes.main {
import classes.*;
public class Usefull {
public static function randRange(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public static function trace_debug(_arg1:String):void{
if (Options.DEBUG){
trace(_arg1);
};
}
}
}//package classes.main
Section 26
//Accessory (classes.objects.Accessory)
package classes.objects {
import classes.common.*;
public class Accessory extends SequenceItem {
}
}//package classes.objects
Section 27
//Eyes (classes.objects.Eyes)
package classes.objects {
import classes.common.*;
public class Eyes extends OnTimerLabels {
}
}//package classes.objects
Section 28
//Glasses (classes.objects.Glasses)
package classes.objects {
import classes.common.*;
public class Glasses extends SequenceItem {
}
}//package classes.objects
Section 29
//Hat (classes.objects.Hat)
package classes.objects {
import classes.common.*;
public class Hat extends SequenceItem {
}
}//package classes.objects
Section 30
//Mouth (classes.objects.Mouth)
package classes.objects {
import classes.common.*;
public class Mouth extends OnTimer {
public function Mouth(){
addFrameScript(0, frame1);
set_timeRange(2, 6);
}
function frame1(){
}
}
}//package classes.objects
Section 31
//Shoes (classes.objects.Shoes)
package classes.objects {
import classes.common.*;
public class Shoes extends SequenceItem {
}
}//package classes.objects
Section 32
//Skirt1 (classes.objects.Skirt1)
package classes.objects {
import classes.common.*;
public class Skirt1 extends SequenceItem {
}
}//package classes.objects
Section 33
//Skirt2 (classes.objects.Skirt2)
package classes.objects {
import classes.common.*;
public class Skirt2 extends SequenceItem {
}
}//package classes.objects
Section 34
//Star (classes.objects.Star)
package classes.objects {
import classes.common.*;
public class Star extends OnTimer {
public function Star(){
set_timeRange(2, 6);
}
}
}//package classes.objects
Section 35
//Tights (classes.objects.Tights)
package classes.objects {
import classes.common.*;
public class Tights extends SequenceItem {
}
}//package classes.objects
Section 36
//Top1 (classes.objects.Top1)
package classes.objects {
import classes.common.*;
public class Top1 extends SequenceItem {
}
}//package classes.objects
Section 37
//Top2 (classes.objects.Top2)
package classes.objects {
import classes.common.*;
public class Top2 extends SequenceItem {
}
}//package classes.objects
Section 38
//Top3 (classes.objects.Top3)
package classes.objects {
import classes.common.*;
public class Top3 extends SequenceItem {
}
}//package classes.objects
Section 39
//Wig (classes.objects.Wig)
package classes.objects {
import classes.common.*;
public class Wig extends Sequence {
}
}//package classes.objects
Section 40
//Options (classes.Options)
package classes {
public class Options {
public static const DEBUG:Boolean = true;
public static var COMPLEX_OBJECTS:Object = {skirt:new Array("Skirt_1", "Skirt_2"), top:new Array("Top_1", "Top_2", "Top_3")};
public static var LOCALE_NUMBER:int = 1;
public static var SERVER_URL:String = "http://www.trickster-games.com/avatar_mailer/";
public static var MUSIC_VOLUME:Number = 0.5;
public static var TEST_SCRIPT:Boolean = false;
public static var SUITS_MANDATORY:Array = new Array(new Array("wig"), new Array("tights"), new Array("shoes"), new Array("hat"), new Array("top"), new Array("skirt"), new Array("accessory"));
public static var DRESSUP_TABLE:Object = {};
public static var VK_GROUP_LINK:Boolean = false;
public static var OBJECT_NAMES:Array = new Array("glasses", "wig", "tights", "shoes", "hat", "accessory", "top", "skirt");
public static var SOUND_VOLUME:Number = 1;
public static var MAIL_GAME_NAME:String = "Pop-Star Dress Up";
public static var GAME_NAME:String = "pop_star_dress_up";
public static var SUITS_EXCEPTIONS:Array = new Array();
public static var SCRIPT_NAME:String = "index.php";
}
}//package classes
Section 41
//PNGEncoder2 (com.adobe.images.PNGEncoder2)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder2 {
private static var crcTableComputed:Boolean = false;
private static var crcTable:Array;
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray){
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:int;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local7 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local7 & 1)){
_local7 = uint((uint(3988292384) ^ uint((_local7 >>> 1))));
} else {
_local7 = uint((_local7 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local7;
_local9++;
};
};
_local4 = 0;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
_local5 = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
_local6 = _arg1.position;
_arg1.position = _local5;
_local7 = 4294967295;
_local8 = 0;
while (_local8 < (_local6 - _local5)) {
_local7 = uint((crcTable[((_local7 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local7 >>> 8))));
_local8++;
};
_local7 = uint((_local7 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local7);
}
public static function encode(_arg1:BitmapData):ByteArray{
var _local2:ByteArray;
var _local3:ByteArray;
var _local4:ByteArray;
var _local5:int;
var _local6:uint;
var _local7:int;
_local2 = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
_local3 = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
_local4 = new ByteArray();
_local5 = 0;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
}
}//package com.adobe.images
Section 42
//authors_90 (pop_star_dress_up_girlsgogames_com_fla.authors_90)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class authors_90 extends MovieClip {
public function authors_90(){
addFrameScript(0, frame1, 103, frame104);
}
function frame1(){
stop();
}
function frame104(){
this.y = -1000;
}
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 43
//branding_aligned_center_41 (pop_star_dress_up_girlsgogames_com_fla.branding_aligned_center_41)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
import classes.main.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class branding_aligned_center_41 extends MovieClip {
public function branding_aligned_center_41(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(language.branding_nr);
}
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 44
//branding_aligned_center_94 (pop_star_dress_up_girlsgogames_com_fla.branding_aligned_center_94)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
import classes.main.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class branding_aligned_center_94 extends MovieClip {
public function branding_aligned_center_94(){
addFrameScript(0, frame1);
}
function frame1(){
try {
gotoAndStop(language.branding_nr);
} catch(e:Error) {
};
}
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 45
//intro_hitarea_1 (pop_star_dress_up_girlsgogames_com_fla.intro_hitarea_1)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class intro_hitarea_1 extends MovieClip {
public var button_intro:SimpleButton;
public function intro_hitarea_1(){
addFrameScript(89, frame90);
}
function frame90(){
stop();
}
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 46
//moreGames_text_77 (pop_star_dress_up_girlsgogames_com_fla.moreGames_text_77)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
import classes.main.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class moreGames_text_77 extends MovieClip {
public function moreGames_text_77(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(language.language_nr);
}
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 47
//preview_mc_88 (pop_star_dress_up_girlsgogames_com_fla.preview_mc_88)
package pop_star_dress_up_girlsgogames_com_fla {
import flash.display.*;
public dynamic class preview_mc_88 extends MovieClip {
public var back:MovieClip;
}
}//package pop_star_dress_up_girlsgogames_com_fla
Section 48
//intro_1 (intro_1)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class intro_1 extends MovieClip {
public function intro_1(){
addFrameScript(8, frame9, 90, frame91);
}
function frame91(){
stop();
root.gotoAndStop(2);
root.removeChild(this);
}
function frame9(){
if (!root.loadingComplete){
stop();
};
}
}
}//package
Section 49
//intro_2 (intro_2)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class intro_2 extends MovieClip {
public function intro_2(){
addFrameScript(8, frame9, 88, frame89);
}
function frame89(){
stop();
root.gotoAndStop(2);
root.removeChild(this);
}
function frame9(){
if (!root.loadingComplete){
stop();
};
}
}
}//package
Section 50
//intro_3 (intro_3)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class intro_3 extends MovieClip {
public function intro_3(){
addFrameScript(8, frame9, 88, frame89);
}
function frame89(){
stop();
root.gotoAndStop(2);
root.removeChild(this);
}
function frame9(){
if (!root.loadingComplete){
stop();
};
}
}
}//package
Section 51
//intro_4 (intro_4)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class intro_4 extends MovieClip {
public function intro_4(){
addFrameScript(8, frame9, 88, frame89);
}
function frame89(){
stop();
root.gotoAndStop(2);
root.removeChild(this);
}
function frame9(){
if (!root.loadingComplete){
stop();
};
}
}
}//package
Section 52
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 53
//sound01 (sound01)
package {
import flash.media.*;
public dynamic class sound01 extends Sound {
}
}//package
Section 54
//sound02 (sound02)
package {
import flash.media.*;
public dynamic class sound02 extends Sound {
}
}//package
Section 55
//sound03 (sound03)
package {
import flash.media.*;
public dynamic class sound03 extends Sound {
}
}//package
Section 56
//sound05 (sound05)
package {
import flash.media.*;
public dynamic class sound05 extends Sound {
}
}//package
Section 57
//sound06 (sound06)
package {
import flash.media.*;
public dynamic class sound06 extends Sound {
}
}//package