Section 1
//Avatar (classes.common.Avatar)
package classes.common {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
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;
if (_arg1){
root.game.hide_backs();
};
_local2 = new BitmapData(root.width, root.height, false);
_local2.draw(root);
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.common
Section 2
//ButtonArrows (classes.common.ButtonArrows)
package classes.common {
import flash.events.*;
import flash.display.*;
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 3
//ButtonsBar (classes.common.ButtonsBar)
package classes.common {
import flash.events.*;
import flash.display.*;
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 4
//Checkbox (classes.common.Checkbox)
package classes.common {
import flash.events.*;
import flash.display.*;
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 5
//OnTimer (classes.common.OnTimer)
package classes.common {
import flash.events.*;
import flash.display.*;
import classes.main.*;
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 flash.events.*;
import classes.main.*;
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){
trace(name, "WARNING: Sequence with one frame!!!");
};
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():void{
gotoAndStop(initFrame);
}
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{
this.reset();
root.game.check_uderwear();
}
override public function random(_arg1:int=1, _arg2:int=-1):void{
super.random(0, (totalFrames - 1));
}
}
}//package classes.common
Section 9
//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 10
//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 11
//Wardrobe (classes.main.wardrobe.Wardrobe)
package classes.main.wardrobe {
import flash.events.*;
import flash.display.*;
import classes.main.*;
import classes.*;
public class Wardrobe extends MovieClip {
public var shown:Boolean;
private var currentTab:String;
public function Wardrobe(){
shown = true;
this.items.stop();
init();
this.addEventListener("itemsFrame_is_loaded", init_itemButtons);
}
public function init():void{
var _local1:DisplayObject;
var _local2:String;
for each (_local2 in Options.WARDROBE_TAB_NAMES) {
_local1 = this.getChildByName(("button" + _local2));
addTabButton(_local1, on_tabButton);
};
currentTab = Options.WARDROBE_DEFAULT_TAB;
switchToTab(currentTab);
}
private function init_itemButtons(_arg1:Event):void{
var _local2:DisplayObject;
var _local3:uint;
_local3 = 0;
while (_local3 < this.items.numChildren) {
_local2 = this.items.getChildAt(_local3);
if (_local2.name.indexOf("buttonItem") != -1){
addItemButton(_local2, on_itemButton);
};
_local3++;
};
}
public function reset():void{
}
public function switchToTab(_arg1:String):void{
var tabName = _arg1;
try {
this.items.gotoAndStop(tabName);
currentTab = tabName;
} catch(e:Error) {
Usefull.trace_debug(("Wardrobe::switchToTab:: bad tab name: " + tabName));
};
}
private function addTabButton(_arg1:DisplayObject, _arg2:Function):void{
var subFunc:Function;
var buttObj = _arg1;
var eventFunc = _arg2;
subFunc = function (_arg1:MouseEvent){
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);
};
}
private function on_itemButton(_arg1:MouseEvent):void{
var _local2:String;
_local2 = _arg1.target.name.slice("buttonItem_".length);
root.game.switchObject(currentTab, _local2);
}
private function addItemButton(_arg1:DisplayObject, _arg2:Function):void{
var subFunc:Function;
var buttObj = _arg1;
var eventFunc = _arg2;
subFunc = function (_arg1:MouseEvent){
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);
};
}
private function on_mouseOver(_arg1:MouseEvent):void{
}
private function on_tabButton(_arg1:MouseEvent):void{
var _local2:DisplayObject;
var _local3:String;
_local2 = _arg1.target;
if (_local2.name.indexOf("button") == -1){
_local2 = _local2.parent;
};
_local3 = _local2.name.slice("button".length);
if (_local3 != currentTab){
switchToTab(_local3);
};
}
}
}//package classes.main.wardrobe
Section 12
//ClothesButtons (classes.main.ClothesButtons)
package classes.main {
import flash.events.*;
import flash.display.*;
import classes.common.*;
public class ClothesButtons extends ButtonsBar {
public var button_necklace:MovieClip;
public var button_wallpaper:MovieClip;
public var button_accessory:MovieClip;
public var button_wig:MovieClip;
public var button_pants:MovieClip;
public var button_shoes:MovieClip;
public var button_skirt:MovieClip;
public var button_top:MovieClip;
public var button_dress: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);
}
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, true);
}
}
}//package classes.main
Section 13
//Game (classes.main.Game)
package classes.main {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import classes.common.*;
import classes.main.suits.*;
import classes.main.wardrobe.*;
import classes.*;
public class Game {
public var wallpaper:Sequence;
public var sounds:Sounds;
public var objects:Object;
public var avatar:Avatar;
public var suit_generator:Suit_generator;
public var gameStage:DisplayObjectContainer;
public var objectsIntact:Boolean;
public var wardrobe:Wardrobe;
public function Game(_arg1:DisplayObjectContainer, _arg2:Sounds=null){
objects = new Object();
super();
gameStage = _arg1;
if (_arg2){
sounds = _arg2;
} else {
sounds = new Sounds();
};
init();
suit_generator = new Suit_generator();
randomClothe();
if (gameStage.hasOwnProperty("tempObjects")){
gameStage.removeChild(gameStage.tempObjects);
};
}
public function get_avatarBmp(_arg1:Boolean=false, _arg2:int=-1):BitmapData{
if (_arg2 != -1){
avatar = gameStage.getChildByName(("avatar" + _arg2));
};
return (avatar.make_shot(_arg1));
}
public function popup_avatar():void{
var _local1:*;
serialize_clothes();
_local1 = new Popup();
gameStage.addChild(_local1);
}
function init(_arg1:DisplayObjectContainer=null):void{
var _local2:*;
var _local3:String;
var _local4:uint;
if (_arg1 == null){
_arg1 = gameStage;
};
_local4 = 0;
while (_local4 < _arg1.numChildren) {
_local2 = _arg1.getChildAt(_local4);
if (Options.OBJECT_NAMES.indexOf(_local2.name.toLowerCase()) != -1){
_local3 = _local2.name.toLowerCase();
objects[_local3] = _local2;
} else {
if ((_arg1.getChildAt(_local4) is DisplayObjectContainer)){
init(DisplayObjectContainer(_local2));
};
};
_local4++;
};
}
public function check_uderwear():void{
var _local1:String;
var _local2:String;
gameStage.Bra.visible = true;
gameStage.Undershorts.visible = true;
for (_local1 in Options.BRA_TABLE) {
_local2 = objects[_local1].currentLabel;
_local2 = _local2.split("_")[1];
if (Options.BRA_TABLE[_local1].indexOf(_local2) != -1){
gameStage.Bra.visible = false;
break;
};
};
for (_local1 in Options.UNDERSHORTS_TABLE) {
_local2 = objects[_local1].currentLabel;
_local2 = _local2.split("_")[1];
if (Options.UNDERSHORTS_TABLE[_local1].indexOf(_local2) != -1){
gameStage.Undershorts.visible = false;
break;
};
};
}
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 showAuthors():void{
if (sounds){
sounds.playSound("authors");
};
gameStage.authors.y = (gameStage._stage_height / 2);
gameStage.authors.play();
gameStage.authors.stage.addChild(gameStage.authors);
}
public function traceObjects(_arg1:DisplayObjectContainer=null, _arg2:String=""):void{
var _local3:*;
var _local4:uint;
if (_arg1 == null){
_arg1 = gameStage;
};
_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 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: " + clotheType));
};
check_uderwear();
}
public function get_avatarPng():ByteArray{
return (avatar.png_image_data);
}
public function hide_backs(_arg1:Boolean=true):void{
var _local2:Item;
gameStage.wallpaper.visible = !(_arg1);
for each (_local2 in objects) {
if (!_local2.snaped){
_local2.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) {
objects[_local2].random();
};
check_uderwear();
objectsIntact = false;
}
function toggleSounds(_arg1:Event):void{
if (!sounds.soundsEnabled){
return;
};
if (_arg1.type == Event.ACTIVATE){
sounds.turnOn();
} else {
sounds.turnOff();
};
}
}
}//package classes.main
Section 14
//Item (classes.main.Item)
package classes.main {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import classes.*;
public dynamic class Item extends Sprite {
private var pairOffsetY:int;
public var type:String;
var initPosition:Point;
var pairObject:DisplayObject;// = null
var _parent;
var _index:int;
public var inSuit:Boolean;// = false
var childShape:DisplayObject;
var snapDistance:int;
public var snaped:Boolean;
private var pairOffsetX:int;
var fixedIfSnaped:Boolean;
static var incompatibleTypes:Object;
static var offsetX:int;
static var offsetY:int;
static var wearedPosition:Point = new Point(0, 0);
static var game:Game;
public static var selectedItem:Item;
public function Item(_arg1:String, _arg2:DisplayObject, _arg3:Point, _arg4:DisplayObject, _arg5:int, _arg6:String, _arg7:Game){
inSuit = false;
snapDistance = Options.OBJECTS_DISTANCE;
pairObject = null;
super();
name = _arg1;
childShape = _arg2;
initPosition = _arg3;
x = initPosition.x;
y = initPosition.y;
_index = _arg5;
_parent = _arg4;
type = _arg6;
game = _arg7;
snaped = false;
fixedIfSnaped = false;
trackAsBitmap = true;
addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
addEventListener(MouseEvent.MOUSE_UP, stopDragging);
incompatibleTypes = Options.dressupTable;
}
public function fix():void{
if (hasEventListener(MouseEvent.MOUSE_DOWN)){
removeEventListener(MouseEvent.MOUSE_DOWN, startDragging);
};
if (hasEventListener(MouseEvent.MOUSE_UP)){
removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
};
}
public function put_on(_arg1:Boolean=false):void{
var obj:*;
var withAnimation = _arg1;
x = wearedPosition.x;
y = wearedPosition.y;
snaped = true;
try {
_parent.addChildAt(this, _index);
} catch(err:Error) {
_parent.addChild(this);
};
for each (obj in game.objects) {
if (obj == this){
} else {
if (((!(checkCompatiblity(this.type, obj.type))) && (obj.snaped))){
obj.put_off();
};
};
};
show();
}
public function put_off(_arg1:Boolean=true):void{
var toHide = _arg1;
x = initPosition.x;
y = initPosition.y;
snaped = false;
try {
_parent.addChildAt(this, _index);
} catch(err:Error) {
_parent.addChild(this);
};
if (((toHide) && (!(game.isTypeInWardrobe(this.type))))){
hide();
};
}
public function hide():void{
if (((!(snaped)) && (contains(childShape)))){
removeChild(childShape);
put_off(false);
};
}
function dragObject(_arg1:MouseEvent):void{
this.x = (_arg1.stageX - offsetX);
this.y = (_arg1.stageY - offsetY);
if (this.pairObject){
pairObject.x = (this.x + pairOffsetX);
pairObject.y = (this.y + pairOffsetY);
};
}
function checkCompatiblity(_arg1:String, _arg2:String):Boolean{
var _local3:*;
if (_arg1 == _arg2){
return (false);
};
if (incompatibleTypes.hasOwnProperty(_arg1)){
_local3 = incompatibleTypes[_arg1];
if (_local3.indexOf(_arg2) != -1){
return (false);
};
};
return (true);
}
public function fixIfSnaped():void{
fixedIfSnaped = true;
}
public function stopDragging(_arg1:MouseEvent):void{
if (selectedItem != this){
if (((pairObject) && ((pairObject == selectedItem)))){
pairObject.stopDragging(_arg1);
};
return;
};
if (stage.hasEventListener(MouseEvent.MOUSE_MOVE)){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragObject);
};
if (Point.distance(wearedPosition, new Point(this.x, this.y)) <= snapDistance){
put_on();
if (this.pairObject){
pairObject.put_on();
};
} else {
snaped = false;
if (this.pairObject){
pairObject.snaped = false;
};
};
game.checkSuitSet();
selectedItem = null;
}
function startDragging(_arg1:MouseEvent):void{
if (((snaped) && (fixedIfSnaped))){
return;
};
offsetX = (_arg1.stageX - this.x);
offsetY = (_arg1.stageY - this.y);
stage.addChild(this);
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragObject);
game.objectsIntact = false;
selectedItem = this;
if (this.pairObject){
pairOffsetX = (this.x - pairObject.x);
pairOffsetY = (this.y - pairObject.y);
stage.addChild(pairObject);
if (pairObject.type.charAt((pairObject.type.length - 1)) == "b"){
stage.addChild(this);
};
};
}
public function set_snapDistance(_arg1:int):void{
snapDistance = _arg1;
}
public function show():void{
if (numChildren == 0){
addChild(childShape);
};
}
}
}//package classes.main
Section 15
//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 16
//Main (classes.main.Main)
package classes.main {
import flash.events.*;
import flash.display.*;
import classes.*;
import classes.objects.*;
import flash.net.*;
public class Main extends MovieClip {
public var Bra:MovieClip;
public var Skirt:Skirt;
public var Dress:Dress;
public var game:Game;
public var Top:Top;
public var Undershorts:MovieClip;
public var sounds:Sounds;
public var authors:MovieClip;
public var hitareaLogo:SimpleButton;
public var _stage_height:Number;
var old_frame:int;// = 0
public var logo_mainscreen:MovieClip;
public var _stage_width:Number;
public var Necklace:Necklace;
var soundFlag:Boolean;// = false
var request:URLRequest;
var localConnection:LocalConnection;
public var loadingComplete:Boolean;// = false
public var Wig:Wigs0;
public var Pants:Pants;
public var Shoes:Shoes;
var introObject:MovieClip;
public var hitareaLoader:MovieClip;
public var Wallpaper:Wallpaper;
public var Accessory:Accessory;
public function Main(){
localConnection = new LocalConnection();
loadingComplete = false;
old_frame = 0;
soundFlag = false;
super();
addFrameScript(1, frame2);
stop();
stage.align = StageAlign.TOP_LEFT;
_stage_width = 700;
_stage_height = 600;
init_loader();
}
function on_buttonPlay(_arg1:MouseEvent){
play();
}
function onStageButtonUp(_arg1:Event):void{
var _local2:Item;
_local2 = Item.selectedItem;
if (_local2 != null){
_local2.stopDragging(_arg1);
};
}
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 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 on_sceneGame_loaded(_arg1:Event):void{
stop();
if (hasEventListener("enter_frame")){
removeEventListener("enter_frame", on_sceneGame_loaded);
};
init_game();
}
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 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 on_completeLoading(_arg1:Event):void{
on_complete_();
}
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 init_start():void{
try {
hitareaStart.addEventListener(MouseEvent.CLICK, onCLick2);
} catch(e:Error) {
Usefull.trace_debug("Bad hitareaStart or onCLick2");
};
buttonPlay.addEventListener(MouseEvent.CLICK, on_buttonPlay);
addEventListener("SceneGame_loaded", on_sceneGame_loaded);
if (!sounds){
sounds = new Sounds();
};
if (sounds.soundsEnabled){
buttonSound.gotoAndStop("On");
} else {
buttonSound.gotoAndStop("Off");
};
buttonSound.addEventListener(MouseEvent.CLICK, on_sound);
addEventListener(Event.ACTIVATE, toggleStageSounds);
addEventListener(Event.DEACTIVATE, toggleStageSounds);
}
function on_sound(_arg1:MouseEvent){
sounds.toggleSounds();
if (sounds.soundsEnabled){
buttonSound.gotoAndStop("On");
} else {
buttonSound.gotoAndStop("Off");
};
}
function init_game():void{
try {
hitareaLogo.addEventListener(MouseEvent.CLICK, onCLick2);
} catch(e:Error) {
Usefull.trace_debug("Bad hitareaLogo!");
};
game = new Game(this, sounds);
addEventListener(MouseEvent.MOUSE_UP, onStageButtonUp);
}
function on_sceneStart_loaded(_arg1:Event):void{
stop();
removeEventListener("SceneStart_loaded", on_sceneStart_loaded);
init_start();
}
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);
}
function toggleStageSounds(_arg1:Event):void{
if (!sounds.soundsEnabled){
return;
};
if (_arg1.type == Event.ACTIVATE){
if (!soundFlag){
return;
};
sounds.turnOn();
} else {
sounds.turnOff();
soundFlag = true;
};
}
language.gamename = Options.GAME_NAME;
language.Language = Options.LOCALE_NUMBER;
}
}//package classes.main
Section 17
//OptionsButtons (classes.main.OptionsButtons)
package classes.main {
import flash.events.*;
import flash.display.*;
import classes.common.*;
import classes.*;
import flash.net.*;
public class OptionsButtons extends ButtonsBar {
public var buttonAuthors:SimpleButton;
public var buttonSound:MovieClip;
public var buttonOthergame:SimpleButton;
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 "buttonSound":
addButton(_local1, on_buttonSound);
new SimpleTimer(0, updateSoundButton);
break;
case "buttonReset":
addButton(_local1, on_buttonReset, true);
break;
case "buttonAuthors":
addButton(_local1, on_buttonAuthors, true);
break;
case "buttonOthergame":
addButton(_local1, on_buttonOthergame);
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:URLRequest;
_local2 = Options.OTHERGAME_SCRIPT_LOCATION;
_local2 = (_local2 + ("?locale=" + Options.LOCALE_NUMBER));
_local2 = (_local2 + ("&game=" + Options.OTHERGAME_GAME_NAME));
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function updateSoundButton():void{
if (((root.game) && (root.game.sounds))){
if (root.game.sounds.soundsEnabled){
buttonSound.gotoAndStop("On");
} else {
buttonSound.gotoAndStop("Off");
};
} else {
buttonSound.gotoAndStop("On");
};
}
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 18
//Popup (classes.main.Popup)
package classes.main {
import flash.events.*;
import flash.display.*;
import classes.common.*;
import classes.*;
import flash.net.*;
import flash.text.*;
public class Popup extends MovieClip {
private var _avaPicture:Shape;// = null
private var _lastCheckBox:String;
private var _withoutBack_flag:Boolean;// = false
private static var _EVENT1:String = "is_loaded";
public function Popup(){
_avaPicture = null;
_withoutBack_flag = false;
super();
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 + ("&subject=" + Options.MAIL_SUBJECT));
_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()){
root.sounds.playSound("bad");
return;
};
if (!this.captcha.check()){
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();
}
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:int;
var _local3:BitmapData;
if (_arg1.target.name == _lastCheckBox){
return;
};
root.sounds.playSound("push");
this.visible = false;
_local2 = _arg1.target.name.charAt((_arg1.target.name.length - 1));
_local3 = root.game.get_avatarBmp(_withoutBack_flag, _local2);
this.visible = true;
make_preview(_local3);
_lastCheckBox = _arg1.target.name;
}
function addButton(_arg1:DisplayObject, _arg2:Function):void{
var subFunc:Function;
var buttObj = _arg1;
var eventFunc = _arg2;
subFunc = function (_arg1:MouseEvent){
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{
var bmp:BitmapData;
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);
this.visible = false;
bmp = root.game.get_avatarBmp(_withoutBack_flag, 1);
this.visible = true;
make_preview(bmp);
removeListeners();
} catch(e:Error) {
trace(e);
trace("Object does not exist!");
};
}
private function on_close(_arg1:MouseEvent):void{
parent.removeChild(this);
}
private function on_checkBack(_arg1:Event):void{
var _local2:BitmapData;
root.sounds.playSound("push");
_withoutBack_flag = _arg1.target.get_state();
this.visible = false;
_local2 = root.game.get_avatarBmp(_withoutBack_flag);
this.visible = true;
make_preview(_local2);
}
function on_mouseOver(_arg1:MouseEvent):void{
root.sounds.playSound("over");
}
}
}//package classes.main
Section 19
//Sounds (classes.main.Sounds)
package classes.main {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import classes.*;
import flash.net.*;
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("authors", "sound05");
setVolume(Options.SOUND_VOLUME, "sound");
addSound("music", "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 req:URLRequest;
var soundName = _arg1;
var iSoundclassName = _arg2;
try {
ClassReference = (getDefinitionByName(iSoundclassName) as Class);
sounds[soundName] = new (ClassReference);
} catch(e:Error) {
req = new URLRequest("sound/sound01.mp3");
sounds[soundName] = new Sound(req);
Usefull.trace_debug(("Sounds::addSound:: added empty sound: " + soundName));
};
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 20
//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 21
//Accessory (classes.objects.Accessory)
package classes.objects {
import classes.common.*;
public class Accessory extends SequenceItem {
}
}//package classes.objects
Section 22
//Dress (classes.objects.Dress)
package classes.objects {
import classes.common.*;
public class Dress extends SequenceItem {
}
}//package classes.objects
Section 23
//Face (classes.objects.Face)
package classes.objects {
import classes.common.*;
public class Face extends OnTimerLabels {
}
}//package classes.objects
Section 24
//Necklace (classes.objects.Necklace)
package classes.objects {
import classes.common.*;
public class Necklace extends SequenceItem {
}
}//package classes.objects
Section 25
//Pants (classes.objects.Pants)
package classes.objects {
import classes.common.*;
public class Pants extends SequenceItem {
}
}//package classes.objects
Section 26
//Shine1 (classes.objects.Shine1)
package classes.objects {
import classes.common.*;
public class Shine1 extends OnTimer {
public function Shine1(){
set_timeRange(5, 10);
}
}
}//package classes.objects
Section 27
//Shine2 (classes.objects.Shine2)
package classes.objects {
import classes.common.*;
public class Shine2 extends OnTimer {
public function Shine2(){
set_timeRange(5, 10);
}
}
}//package classes.objects
Section 28
//Shine3 (classes.objects.Shine3)
package classes.objects {
import classes.common.*;
public class Shine3 extends OnTimer {
public function Shine3(){
set_timeRange(5, 10);
}
}
}//package classes.objects
Section 29
//Shoes (classes.objects.Shoes)
package classes.objects {
import classes.common.*;
public class Shoes extends SequenceItem {
}
}//package classes.objects
Section 30
//Skirt (classes.objects.Skirt)
package classes.objects {
import classes.common.*;
public class Skirt extends SequenceItem {
}
}//package classes.objects
Section 31
//Top (classes.objects.Top)
package classes.objects {
import classes.common.*;
public class Top extends SequenceItem {
}
}//package classes.objects
Section 32
//Wallpaper (classes.objects.Wallpaper)
package classes.objects {
import classes.common.*;
public class Wallpaper extends Sequence {
}
}//package classes.objects
Section 33
//Wigs0 (classes.objects.Wigs0)
package classes.objects {
import classes.common.*;
public class Wigs0 extends Sequence {
}
}//package classes.objects
Section 34
//Options (classes.Options)
package classes {
public class Options {
public static const DEBUG:Boolean = false;
public static var OTHERGAME_GAME_NAME:String = "demon";
public static var OTHERGAME_SCRIPT_LOCATION:String = "http://www.trickster-games.com/scripts_for_games/AngelDemon/script.php";
public static var LOCALE_NUMBER:int = 1;
public static var MUSIC_VOLUME:Number = 0.5;
public static var UNDERSHORTS_TABLE:Object = {skirt:new Array("00", "10"), pants:new Array("04", "05", "06", "07"), dress:new Array("04", "05")};
public static var BRA_TABLE:Object = {top:new Array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09"), dress:new Array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10")};
public static var DRESSUP_TABLE:Object = {top:new Array("dress"), skirt:new Array("dress", "pants"), pants:new Array("dress", "skirt"), dress:new Array("pants", "skirt", "top")};
public static var SUITS_MANDATORY:Array = new Array(new Array("dress", "skirt", "pants"), new Array("top"), new Array("shoes"), new Array("wig"));
public static var SOUND_VOLUME:Number = 1;
public static var OBJECT_NAMES:Array = new Array("dress", "top", "pants", "shoes", "skirt", "necklace", "accessory", "wig", "wallpaper");
public static var GAME_NAME:String = "cute_little_angel_dress_up.html";
public static var SUITS_EXCEPTIONS:Array = new Array("Wallpaper");
}
}//package classes
Section 35
//authors_165 (cute_little_angel_dress_up_girlsgogames_com_fla.authors_165)
package cute_little_angel_dress_up_girlsgogames_com_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
public dynamic class authors_165 extends MovieClip {
public function authors_165(){
addFrameScript(0, frame1, 103, frame104);
}
function frame1(){
stop();
}
function frame104(){
this.y = -1000;
}
}
}//package cute_little_angel_dress_up_girlsgogames_com_fla
Section 36
//branding_aligned_center_127 (cute_little_angel_dress_up_girlsgogames_com_fla.branding_aligned_center_127)
package cute_little_angel_dress_up_girlsgogames_com_fla {
import flash.events.*;
import flash.display.*;
import classes.main.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
public dynamic class branding_aligned_center_127 extends MovieClip {
public function branding_aligned_center_127(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(language.branding_nr);
}
}
}//package cute_little_angel_dress_up_girlsgogames_com_fla
Section 37
//branding_aligned_center_169 (cute_little_angel_dress_up_girlsgogames_com_fla.branding_aligned_center_169)
package cute_little_angel_dress_up_girlsgogames_com_fla {
import flash.events.*;
import flash.display.*;
import classes.main.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
public dynamic class branding_aligned_center_169 extends MovieClip {
public function branding_aligned_center_169(){
addFrameScript(0, frame1);
}
function frame1(){
try {
gotoAndStop(language.branding_nr);
} catch(e:Error) {
};
}
}
}//package cute_little_angel_dress_up_girlsgogames_com_fla
Section 38
//intro_hitarea_1 (cute_little_angel_dress_up_girlsgogames_com_fla.intro_hitarea_1)
package cute_little_angel_dress_up_girlsgogames_com_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
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 cute_little_angel_dress_up_girlsgogames_com_fla
Section 39
//moreGames_text_163 (cute_little_angel_dress_up_girlsgogames_com_fla.moreGames_text_163)
package cute_little_angel_dress_up_girlsgogames_com_fla {
import flash.events.*;
import flash.display.*;
import classes.main.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
public dynamic class moreGames_text_163 extends MovieClip {
public function moreGames_text_163(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(language.language_nr);
}
}
}//package cute_little_angel_dress_up_girlsgogames_com_fla
Section 40
//intro_1 (intro_1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
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 41
//intro_2 (intro_2)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
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 42
//intro_3 (intro_3)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
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 43
//intro_4 (intro_4)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.text.*;
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 44
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 45
//sound01 (sound01)
package {
import flash.media.*;
public dynamic class sound01 extends Sound {
}
}//package
Section 46
//sound02 (sound02)
package {
import flash.media.*;
public dynamic class sound02 extends Sound {
}
}//package
Section 47
//sound05 (sound05)
package {
import flash.media.*;
public dynamic class sound05 extends Sound {
}
}//package