Section 1
//McBackground (assets.scene.McBackground)
package assets.scene {
import flash.display.*;
public dynamic class McBackground extends MovieClip {
}
}//package assets.scene
Section 2
//McModel (assets.scene.McModel)
package assets.scene {
import flash.display.*;
public dynamic class McModel extends MovieClip {
public var mcPart1:MovieClip;
public var mcPart2:MovieClip;
public var mcPart5:MovieClip;
public var mcPart8:MovieClip;
public var mcPart3:MovieClip;
public var mcPart7:MovieClip;
public var mcPart4:MovieClip;
}
}//package assets.scene
Section 3
//McScene (assets.scene.McScene)
package assets.scene {
import flash.display.*;
public dynamic class McScene extends MovieClip {
public var mcCatButtons:MovieClip;
public var mcModel:McModel;
public var mcControlPanel:McControlPanel;
public var mcBackground:McBackground;
public var mcCatPanels:MovieClip;
public var mcBgButtons:MovieClip;
}
}//package assets.scene
Section 4
//McIntro (assets.McIntro)
package assets {
import flash.display.*;
public dynamic class McIntro extends MovieClip {
}
}//package assets
Section 5
//Conveyor (common.commands.Conveyor)
package common.commands {
public class Conveyor {
private var _items:Array;
private var _active:Boolean;// = true
private var _currentItem:Object;
public function Conveyor(){
_items = [];
super();
}
public function get active():Boolean{
return (_active);
}
private function executeNext():void{
while (((_active) && ((_items.length > 0)))) {
_currentItem = _items.shift();
if ((_currentItem is IAsincCommand)){
IAsincCommand(_currentItem).completeEvent.addListener(onComplete);
IAsincCommand(_currentItem).execute();
break;
} else {
if ((_currentItem is Function)){
_currentItem();
_currentItem = null;
} else {
if ((_currentItem is ICommand)){
ICommand(_currentItem).execute();
_currentItem = null;
};
};
};
};
}
public function set active(value:Boolean):void{
if (_active != value){
_active = value;
};
}
public function pushAction(action:Object):void{
if ((((action is Function)) || ((action is ICommand)))){
_items.push(action);
} else {
throw (new ArgumentError());
};
checkForExecute();
}
private function checkForExecute():void{
if (((_active) && (!(_currentItem)))){
executeNext();
};
}
private function onComplete():void{
resetCurrentItem();
executeNext();
}
private function resetCurrentItem():void{
IAsincCommand(_currentItem).completeEvent.removeListener(onComplete);
_currentItem = null;
}
public function dispose():void{
if ((_currentItem is ICancelableCommand)){
ICancelableCommand(_currentItem).cancel();
};
if ((_currentItem is IAsincCommand)){
resetCurrentItem();
};
_items = null;
}
}
}//package common.commands
Section 6
//IAsincCommand (common.commands.IAsincCommand)
package common.commands {
import common.events.*;
public interface IAsincCommand extends ICommand {
function get completeEvent():EventSender;
}
}//package common.commands
Section 7
//ICancelableCommand (common.commands.ICancelableCommand)
package common.commands {
public interface ICancelableCommand extends IAsincCommand {
function cancel():void;
}
}//package common.commands
Section 8
//ICommand (common.commands.ICommand)
package common.commands {
public interface ICommand {
function execute():void;
}
}//package common.commands
Section 9
//IRequirement (common.comparing.IRequirement)
package common.comparing {
public interface IRequirement {
function accept(:Object):Boolean;
}
}//package common.comparing
Section 10
//MultipleFramesRequirement (common.comparing.MultipleFramesRequirement)
package common.comparing {
import flash.display.*;
public class MultipleFramesRequirement implements IRequirement {
public function MultipleFramesRequirement(){
super();
}
public function accept(object:Object):Boolean{
return ((((object is MovieClip)) && ((MovieClip(object).totalFrames > 1))));
}
}
}//package common.comparing
Section 11
//NameRequirement (common.comparing.NameRequirement)
package common.comparing {
public class NameRequirement implements IRequirement {
private var _value:String;
private var _property:String;
private var _isPrefix:Boolean;
public function NameRequirement(name:String, isPrefix:Boolean=false){
super();
_property = "name";
_value = name;
_isPrefix = isPrefix;
}
public function accept(object:Object):Boolean{
if (_isPrefix){
return (((((object) && (object.hasOwnProperty(_property)))) && ((String(object[_property]).indexOf(_value) == 0))));
};
return (((((object) && (object.hasOwnProperty(_property)))) && ((object[_property] == _value))));
}
}
}//package common.comparing
Section 12
//PropertyRequirement (common.comparing.PropertyRequirement)
package common.comparing {
public class PropertyRequirement implements IRequirement {
private var _value:Object;
private var _path:Array;
public function PropertyRequirement(property:String, value:Object){
super();
_path = property.split(".");
_value = value;
}
public function accept(object:Object):Boolean{
var property:String;
if (!object){
return (false);
};
var item:Object = object;
for each (property in _path) {
if (((item) && (item.hasOwnProperty(property)))){
item = item[property];
} else {
return (false);
};
};
return ((item == _value));
}
}
}//package common.comparing
Section 13
//TypeRequirement (common.comparing.TypeRequirement)
package common.comparing {
public class TypeRequirement implements IRequirement {
private var _type:Class;
public function TypeRequirement(type:Class){
super();
_type = type;
}
public function accept(object:Object):Boolean{
return ((object is _type));
}
}
}//package common.comparing
Section 14
//ConstructorConverter (common.converting.ConstructorConverter)
package common.converting {
public class ConstructorConverter implements IConverter {
private var _constructor:Class;
public function ConstructorConverter(constructor:Class){
super();
_constructor = constructor;
}
public function convert(value:Object):Object{
return (new _constructor(value));
}
}
}//package common.converting
Section 15
//IConverter (common.converting.IConverter)
package common.converting {
public interface IConverter {
function convert(:Object):Object;
}
}//package common.converting
Section 16
//EventManager (common.events.EventManager)
package common.events {
import flash.events.*;
public class EventManager {
private var _listeners:Array;
private var _nativeListeners:Array;
public function EventManager(){
_listeners = [];
_nativeListeners = [];
super();
}
private function getEventIndex(event:EventSender, handler:Function):int{
var info:EventData;
var i:int;
while (i < _listeners.length) {
info = _listeners[i];
if ((((info.event == event)) && ((info.handler == handler)))){
return (i);
};
i++;
};
return (-1);
}
public function unregisterNativeEvent(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean=false):void{
var index:int = getNativeEventIndex(object, type, listener, useCapture);
if (index == -1){
throw (new Error("Event is not registered"));
};
object.removeEventListener(type, listener, useCapture);
_nativeListeners.splice(index, 1);
}
public function registerEvent(event:EventSender, handler:Function):void{
var index:int = getEventIndex(event, handler);
if (index >= 0){
throw (new Error("Event is already registered."));
};
event.addListener(handler);
_listeners.push(new EventData(event, handler));
}
public function registerNativeEvent(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean=false):void{
var index:int = getNativeEventIndex(object, type, listener, useCapture);
if (index >= 0){
throw (new Error("Event is already registered"));
};
object.addEventListener(type, listener, useCapture);
_nativeListeners.push(new NativeEventData(object, type, listener, useCapture));
}
private function getNativeEventIndex(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean):int{
var o:NativeEventData;
var i:int;
while (i < _nativeListeners.length) {
o = _nativeListeners[i];
if ((((((((o.object == object)) && ((o.type == type)))) && ((o.listener == listener)))) && ((o.useCapture == useCapture)))){
return (i);
};
i++;
};
return (-1);
}
public function clearEvents():void{
var eventData:EventData;
var nativeEventData:NativeEventData;
for each (eventData in _listeners) {
eventData.event.removeListener(eventData.handler);
};
_listeners = [];
for each (nativeEventData in _nativeListeners) {
nativeEventData.object.removeEventListener(nativeEventData.type, nativeEventData.listener, nativeEventData.useCapture);
};
_nativeListeners = [];
}
public function unregisterEvent(event:EventSender, handler:Function):void{
var index:int = getEventIndex(event, handler);
if (index == -1){
throw (new Error("Event is not registered"));
};
event.removeListener(handler);
_listeners.splice(index, 1);
}
}
}//package common.events
import flash.events.*;
class EventData {
public var handler:Function;
public var event:EventSender;
private function EventData(event:EventSender, handler:Function):void{
super();
this.event = event;
this.handler = handler;
}
}
class NativeEventData {
public var listener:Function;
public var useCapture:Boolean;
public var type:String;
public var object:EventDispatcher;
private function NativeEventData(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean):void{
super();
this.object = object;
this.type = type;
this.listener = listener;
this.useCapture = useCapture;
}
}
Section 17
//EventSender (common.events.EventSender)
package common.events {
public class EventSender {
private var _listeners:Array;
private var _sender:Object;
public function EventSender(sender:Object){
_listeners = [];
super();
_sender = sender;
}
public function sendEvent(argument=null):void{
var handler:Function;
var handlers:Array = _listeners.slice();
for each (handler in handlers) {
if (handler.length == 0){
handler();
} else {
if (handler.length == 1){
handler(_sender);
} else {
if (handler.length == 2){
handler(_sender, argument);
} else {
throw (new ArgumentError("Incorrect number of arguments in handler"));
};
};
};
};
}
public function addListener(listener:Function):void{
if (hasListener(listener)){
throw (new Error("List already contains such listener"));
};
_listeners.push(listener);
}
public function hasListener(func:Function):Boolean{
return ((_listeners.indexOf(func) >= 0));
}
public function removeListener(listener:Function):void{
if (hasListener(listener)){
_listeners.splice(_listeners.indexOf(listener), 1);
} else {
throw (new Error("List doesn't contain such listener"));
};
}
}
}//package common.events
Section 18
//PlayIntroCommand (common.flash.commands.PlayIntroCommand)
package common.flash.commands {
import flash.display.*;
import common.commands.*;
import flash.events.*;
import common.events.*;
import common.utils.*;
public class PlayIntroCommand implements ICancelableCommand {
private var _completeEvent:EventSender;
public var allowSkip:Boolean;// = false
private var _container:Sprite;
public var clickTag:String;// = null
private var _focus:InteractiveObject;
private var _content:MovieClip;
private static const SKIP_CODE:int = 39;
public function PlayIntroCommand(content:MovieClip, container:Sprite){
_completeEvent = new EventSender(this);
super();
_content = content;
_container = container;
initialize();
}
public function get completeEvent():EventSender{
return (_completeEvent);
}
public function cancel():void{
stop();
}
private function stop():void{
_content.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (_focus){
_focus.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_focus = null;
};
GraphUtil.stopAllChildren(_content);
GraphUtil.detachFromDisplay(_content);
}
private function onKeyDown(e:KeyboardEvent):void{
if (e.keyCode == SKIP_CODE){
stop();
_completeEvent.sendEvent();
};
}
private function initialize():void{
_content.mouseChildren = false;
_content.mouseEnabled = false;
_content.opaqueBackground = 0;
GraphUtil.stopAllChildren(_content);
}
private function onClick(e:MouseEvent):void{
BrowserUtil.navigate(clickTag);
}
private function onEnterFrame(e:Event):void{
if (_content.currentFrame == _content.totalFrames){
stop();
_completeEvent.sendEvent();
};
}
public function execute():void{
_container.addChild(_content);
_content.addEventListener(Event.ENTER_FRAME, onEnterFrame);
if (clickTag){
_content.mouseEnabled = true;
_content.useHandCursor = true;
_content.buttonMode = true;
_content.addEventListener(MouseEvent.CLICK, onClick);
};
if (allowSkip){
_focus = ((_content.stage) || (_content));
_focus.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
};
GraphUtil.playAllChildren(_content);
}
}
}//package common.flash.commands
Section 19
//CheckBox (common.flash.controls.CheckBox)
package common.flash.controls {
import flash.display.*;
import flash.events.*;
import common.events.*;
public class CheckBox {
private var _checked:Boolean;// = false
private var _enabled:Boolean;// = true
private var _clickEvent:EventSender;
private var _content:MovieClip;
public function CheckBox(content:MovieClip){
_clickEvent = new EventSender(this);
super();
_content = content;
initialize();
refresh();
}
public function get enabled():Boolean{
return (_enabled);
}
public function get checked():Boolean{
return (_checked);
}
public function set checked(value:Boolean):void{
if (_checked != value){
_checked = value;
refresh();
};
}
private function onMouseClick(e:MouseEvent):void{
checked = !(checked);
_clickEvent.sendEvent();
}
public function get clickEvent():EventSender{
return (_clickEvent);
}
public function set enabled(value:Boolean):void{
if (_enabled != value){
_enabled = value;
refresh();
};
}
private function initialize():void{
_content.addEventListener(MouseEvent.CLICK, onMouseClick);
}
private function refresh():void{
_content.mouseEnabled = _enabled;
_content.mouseChildren = _enabled;
_content.useHandCursor = _enabled;
_content.buttonMode = _enabled;
if (_checked){
_content.gotoAndStop(2);
} else {
_content.gotoAndStop(1);
};
}
}
}//package common.flash.controls
Section 20
//RadioGroup (common.flash.controls.RadioGroup)
package common.flash.controls {
import common.events.*;
public class RadioGroup {
private var _items:Array;
private var _selectedItem:CheckBox;// = null
private var _clickEvent:EventSender;
public function RadioGroup(buttons:Array){
_items = [];
_clickEvent = new EventSender(this);
super();
_items = buttons;
initialize();
}
public function get buttons():Array{
return (_items);
}
private function setSelection(value:CheckBox):void{
if (_selectedItem){
_selectedItem.checked = false;
_selectedItem.enabled = true;
};
_selectedItem = value;
if (_selectedItem){
_selectedItem.checked = true;
_selectedItem.enabled = false;
};
}
public function get selectedItem():CheckBox{
return (_selectedItem);
}
private function initialize():void{
var item:CheckBox;
for each (item in _items) {
item.clickEvent.addListener(onButtonClick);
};
}
public function get clickEvent():EventSender{
return (_clickEvent);
}
public function set selectedIndex(value:int):void{
selectedItem = _items[value];
}
private function onButtonClick(sender:CheckBox):void{
selectedItem = sender;
_clickEvent.sendEvent();
}
public function set selectedItem(value:CheckBox):void{
if (_selectedItem != value){
setSelection(value);
};
}
public function get selectedIndex():int{
return (_items.indexOf(_selectedItem));
}
}
}//package common.flash.controls
Section 21
//ArrayUtil (common.utils.ArrayUtil)
package common.utils {
import common.converting.*;
import common.comparing.*;
public class ArrayUtil {
public function ArrayUtil(){
super();
}
public static function getFirstRequired(source:Object, requirement:IRequirement):Object{
var item:Object;
var result:Object;
for each (item in source) {
if (requirement.accept(item)){
result = item;
break;
};
};
return (result);
}
public static function getByProperty(source:Object, property:String, value:Object):Array{
return (getRequired(source, new PropertyRequirement(property, value)));
}
public static function convert(source:Object, converter:IConverter):Array{
var item:Object;
var result:Array = [];
for each (item in source) {
result.push(converter.convert(item));
};
return (result);
}
public static function getRequired(source:Object, requirement:IRequirement):Array{
var item:Object;
var result:Array = [];
for each (item in source) {
if (requirement.accept(item)){
result.push(item);
};
};
return (result);
}
public static function getFirstByProperty(source:Object, property:String, value:Object):Object{
return (getFirstRequired(source, new PropertyRequirement(property, value)));
}
public static function removeItem(source:Array, item:Object):void{
var index:int = source.indexOf(item);
if (index >= 0){
source.splice(index, 1);
};
}
public static function hasRequired(source:Object, requirement:IRequirement):Object{
return (Boolean(getFirstRequired(source, requirement)));
}
public static function getRandomItem(source:Array){
return (source[int((Math.random() * source.length))]);
}
public static function findByProperty(source:Object, property:String, value:Object):Object{
return (getFirstRequired(source, new PropertyRequirement(property, value)));
}
public static function getRandomItems(source:Array, count:int):Array{
var index:int;
var result:Array = [];
var selection:Array = [];
var i:int;
while (i < count) {
index = (Math.random() * source.length);
while (selection.indexOf(index) >= 0) {
index++;
if (index == source.length){
index = 0;
};
};
result.push(source[index]);
selection.push(index);
i++;
};
return (result);
}
}
}//package common.utils
Section 22
//BrowserUtil (common.utils.BrowserUtil)
package common.utils {
import flash.external.*;
import flash.net.*;
public class BrowserUtil {
public function BrowserUtil(){
super();
}
public static function navigate(url:String, window:String="_blank"):void{
var browser:String;
var url = url;
var window = window;
if (ExternalInterface.available){
browser = (ExternalInterface.call("function getBrowser(){return navigator.userAgent}") as String);
if (((!((browser.indexOf("Firefox") == -1))) || (!((browser.indexOf("MSIE 7.0") == -1))))){
ExternalInterface.call((((("window.open(\"" + url) + "\",\"") + window) + "\")"));
} else {
navigateToURL(new URLRequest(url), window);
};
//unresolved jump
var _slot1 = e;
navigateToURL(new URLRequest(url), window);
} else {
navigateToURL(new URLRequest(url), window);
};
}
}
}//package common.utils
Section 23
//GraphUtil (common.utils.GraphUtil)
package common.utils {
import flash.display.*;
import flash.geom.*;
import common.comparing.*;
import flash.text.*;
public class GraphUtil {
public function GraphUtil(){
super();
}
public static function alignCenter(object:DisplayObject, bounds:Rectangle):void{
var objectBounds:Rectangle = object.getBounds(object.parent);
object.x = (object.x + (((0.5 * (bounds.left + bounds.right)) - (0.5 * objectBounds.width)) - objectBounds.left));
object.y = (object.y + (((0.5 * (bounds.top + bounds.bottom)) - (0.5 * objectBounds.height)) - objectBounds.top));
}
public static function cacheChildrenAsBitmap(container:DisplayObjectContainer):void{
var child:DisplayObject;
var animations:Array;
var children:Array = getChildren(container);
for each (child in children) {
if ((child is DisplayObjectContainer)){
animations = getAllChildren(container, new MultipleFramesRequirement());
if (animations.length == 0){
child.cacheAsBitmap = true;
} else {
if (((!((child is MovieClip))) || ((MovieClip(child).totalFrames == 1)))){
cacheChildrenAsBitmap((child as DisplayObjectContainer));
};
};
} else {
child.cacheAsBitmap = true;
};
};
}
public static function fromRGB(r:uint, g:uint, b:uint):uint{
return ((((r << 16) | (g << 8)) | b));
}
public static function attachBefore(sprite:DisplayObject, before:DisplayObject):void{
before.parent.addChildAt(sprite, before.parent.getChildIndex(before));
}
public static function setBtnEnabled(button:InteractiveObject, enabled:Boolean, alpha:Number=0.5):void{
button.mouseEnabled = enabled;
if ((button is DisplayObjectContainer)){
DisplayObjectContainer(button).mouseChildren = enabled;
};
button.alpha = (enabled) ? 1 : alpha;
}
public static function setScale(object:DisplayObject, scale:Number):void{
object.scaleX = (object.scaleY = scale);
}
public static function addColor(target:DisplayObject, color:int):void{
var rgb:Object = toRGB(color);
var transform:ColorTransform = target.transform.colorTransform;
transform.redOffset = (transform.redOffset + rgb.r);
transform.greenOffset = (transform.greenOffset + rgb.g);
transform.blueOffset = (transform.blueOffset + rgb.b);
target.transform.colorTransform = transform;
}
public static function getAllChildren(object:DisplayObjectContainer, requirement:IRequirement=null):Array{
var item:DisplayObject;
var children:Array = getChildren(object);
var result:Array = [];
for each (item in children) {
if ((((requirement == null)) || (requirement.accept(item)))){
result.push(item);
};
if ((item is DisplayObjectContainer)){
result = result.concat(getAllChildren(DisplayObjectContainer(item), requirement));
};
};
return (result);
}
public static function getPixel(item:DisplayObject, x:int, y:int):int{
var bitmapData:BitmapData = new BitmapData(4, 4);
var matrix:Matrix = new Matrix();
matrix.tx = -(x);
matrix.ty = -(y);
bitmapData.draw(item, matrix, item.transform.colorTransform, item.blendMode);
return (bitmapData.getPixel(1, 1));
}
public static function claimBounds(object:DisplayObject, bounds:Rectangle):void{
var rect:Rectangle = object.getBounds(object.parent);
if (rect.left < bounds.left){
object.x = (object.x + (bounds.left - rect.left));
} else {
if (rect.right > bounds.right){
object.x = (object.x + (bounds.right - rect.right));
};
};
if (rect.top < bounds.top){
object.y = (object.y + (bounds.top - rect.top));
} else {
if (rect.bottom > bounds.bottom){
object.y = (object.y + (bounds.bottom - rect.bottom));
};
};
}
public static function toRGB(color:uint):Object{
return ({r:(color >> 16), g:((color >> 8) & 0xFF), b:(color & 0xFF)});
}
public static function toPoint(object:Object):Point{
return (new Point(object.x, object.y));
}
public static function attachAfter(sprite:DisplayObject, after:DisplayObject):void{
after.parent.addChildAt(sprite, (after.parent.getChildIndex(after) + 1));
}
public static function findObject(container:DisplayObjectContainer, requirement:IRequirement, recursive:Boolean=true):DisplayObject{
if (recursive){
return (getAllChildren(container, requirement)[0]);
};
return (getChildren(container, requirement)[0]);
}
public static function getChildrenBounds(container:DisplayObjectContainer):Rectangle{
var child:DisplayObject;
var bounds:Rectangle;
var minX:Number = Number.MAX_VALUE;
var maxX:Number = Number.MIN_VALUE;
var minY:Number = Number.MAX_VALUE;
var maxY:Number = Number.MIN_VALUE;
var i:int;
while (i < container.numChildren) {
child = container.getChildAt(i);
bounds = child.getBounds(container);
minX = Math.min(minX, bounds.x);
minY = Math.min(minY, bounds.y);
maxX = Math.max(maxX, bounds.right);
maxY = Math.max(maxY, bounds.bottom);
i++;
};
return (new Rectangle(minX, minY, (maxX - minX), (maxY - minY)));
}
public static function getAllButtonChildren(button:SimpleButton, requirement:IRequirement=null):Array{
var state:DisplayObject;
var states:Array = [button.upState, button.overState, button.downState];
var result:Array = [];
for each (state in states) {
if ((((requirement == null)) || (requirement.accept(state)))){
result.push(state);
};
if ((state is DisplayObjectContainer)){
result = result.concat(getAllChildren(DisplayObjectContainer(state), requirement));
};
};
return (result);
}
public static function stopAllChildren(container:DisplayObjectContainer, frameNum:int=0):void{
var child:MovieClip;
var clips:Array = getAllChildren(container, new TypeRequirement(MovieClip));
if ((container is MovieClip)){
clips.push(container);
};
for each (child in clips) {
if (child.totalFrames > 1){
if (frameNum > 0){
child.gotoAndStop(frameNum);
} else {
child.stop();
};
};
};
}
public static function removeChildren(container:DisplayObjectContainer):void{
while (container.numChildren > 0) {
container.removeChildAt(0);
};
}
public static function adjustBounds(object:DisplayObject, bounds:Rectangle):void{
claimScale(object, bounds.width, bounds.height);
alignCenter(object, bounds);
}
public static function createRectSprite(width:Number, height:Number, color:int=0, alpha:Number=1):Sprite{
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(color, alpha);
sprite.graphics.drawRect(0, 0, width, height);
sprite.graphics.endFill();
return (sprite);
}
public static function setRandomFrame(clip:MovieClip):void{
var frameNum:int = (1 + (Math.random() * clip.totalFrames));
clip.gotoAndStop(frameNum);
}
public static function transformCoords(point:Point, source:DisplayObject, target:DisplayObject):Point{
return (target.globalToLocal(source.localToGlobal(point)));
}
public static function setPosition(object:DisplayObject, position:Object):void{
object.x = position.x;
object.y = position.y;
}
public static function detachFromDisplay(displyObject:DisplayObject):void{
displyObject.parent.removeChild(displyObject);
}
public static function claimScale(object:DisplayObject, maxWidth:Number, maxHeight:Number):void{
var scale:Number = Math.min((maxWidth / object.width), (maxHeight / object.height));
object.height = (object.height * scale);
object.width = (object.width * scale);
}
public static function sendToBack(object:DisplayObject):void{
var parent:DisplayObjectContainer = object.parent;
parent.setChildIndex(object, 0);
}
public static function setFontSize(field:TextField, size:int):void{
var format:TextFormat = field.getTextFormat();
format.size = size;
field.setTextFormat(format);
}
public static function playAllChildren(clip:MovieClip):void{
var child:MovieClip;
clip.play();
var children:Array = getAllChildren(clip, new TypeRequirement(MovieClip));
for each (child in children) {
if (child.totalFrames > 1){
child.play();
};
};
}
public static function getChildren(object:DisplayObjectContainer, requirement:IRequirement=null):Array{
var child:DisplayObject;
var result:Array = [];
var i:int;
while (i < object.numChildren) {
child = object.getChildAt(i);
if ((((requirement == null)) || (requirement.accept(child)))){
result.push(child);
};
i++;
};
return (result);
}
public static function addBoundsRect(object:Sprite, color:int=0, alpha:Number=0):Sprite{
var bounds:Rectangle = object.getBounds(object);
var rect:Sprite = createRectSprite(bounds.width, bounds.height, color, alpha);
object.addChild(rect);
rect.x = bounds.x;
rect.y = bounds.y;
return (rect);
}
public static function bringToFront(object:DisplayObject):void{
var parent:DisplayObjectContainer = object.parent;
parent.setChildIndex(object, (parent.numChildren - 1));
}
}
}//package common.utils
Section 24
//StringUtil (common.utils.StringUtil)
package common.utils {
public class StringUtil {
public static const EMPTY_CHARS:String = (" \t\r\n\f" + String.fromCharCode(160));
public function StringUtil(){
super();
}
public static function trim(str:String):String{
if (str == null){
return ("");
};
var index1:int;
var index2:int = (str.length - 1);
var length:int = str.length;
while ((((index1 < length)) && ((EMPTY_CHARS.indexOf(str.charAt(index1)) >= 0)))) {
index1++;
};
while ((((index2 > 0)) && ((EMPTY_CHARS.indexOf(str.charAt(index2)) >= 0)))) {
index2--;
};
return (((index2)>=index1) ? str.slice(index1, (index2 + 1)) : "");
}
public static function format(str:String, ... _args):String{
var length:int = _args.length;
var i:int;
while (i < length) {
str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), _args[i]);
i++;
};
return (str);
}
public static function replaceChars(source:String, characters:Array, matches:Array):String{
var matchIndex:int;
var result:String = "";
var i:int;
while (i < source.length) {
matchIndex = characters.indexOf(source.charAt(i));
if (matchIndex != -1){
result = (result + matches[matchIndex]);
} else {
result = (result + source.charAt(i));
};
i++;
};
return (result);
}
public static function isBlankString(source:String):Boolean{
var i:int;
while (i <= source.length) {
if (EMPTY_CHARS.indexOf(source.charAt(i)) < 0){
return (false);
};
i++;
};
return (true);
}
public static function extractInt(source:String):int{
return (source.match(/\d+/)[0]);
}
}
}//package common.utils
Section 25
//Sounds (components.Sounds)
package components {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class Sounds {
private static const DEFAULT_VOLUME:Number = 1;
private static var _musicVolume:Number = 1;
private static var _musicClass:Class;
private static var _nowPlaying:Dictionary = new Dictionary();
private static var _musicChannel:SoundChannel;
public function Sounds(){
super();
}
public static function get muted():Boolean{
return ((_musicVolume == 0));
}
private static function setMusicVolume(value:Number):void{
_musicVolume = value;
if (_musicChannel){
_musicChannel.soundTransform = new SoundTransform(_musicVolume);
};
}
public static function playMusic(musicClass:Class):void{
if (_musicChannel){
_musicChannel.stop();
};
_musicClass = musicClass;
var sound:Sound = new (musicClass);
_musicChannel = sound.play(0, 0, new SoundTransform(_musicVolume));
_musicChannel.addEventListener(Event.SOUND_COMPLETE, onMusicComplete);
}
public static function play(soundClass:Class, playSafe:Boolean=false):void{
var sound:Sound;
var channel:SoundChannel;
var soundClass = soundClass;
var playSafe = playSafe;
if (((!(playSafe)) || (!((soundClass in _nowPlaying))))){
sound = new (soundClass);
channel = sound.play(0, 0, new SoundTransform(DEFAULT_VOLUME));
channel.addEventListener(Event.SOUND_COMPLETE, function (e:Event):void{
delete _nowPlaying[soundClass];
});
_nowPlaying[soundClass] = true;
};
}
public static function mute():void{
if (_musicVolume == 0){
setMusicVolume(DEFAULT_VOLUME);
} else {
setMusicVolume(0);
};
}
private static function onMusicComplete(e:Event):void{
playMusic(_musicClass);
}
}
}//package components
Section 26
//Controller (dressup.abstract.Controller)
package dressup.abstract {
import dressup.*;
import flash.events.*;
import common.events.*;
public class Controller {
private var _eventManager:EventManager;
public function Controller(){
super();
}
protected function registerNativeEvent(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean=false):void{
if (!_eventManager){
_eventManager = new EventManager();
};
_eventManager.registerNativeEvent(object, type, listener, useCapture);
}
protected function get app():Application{
return (Application.instance);
}
protected function unregisterNativeEvent(object:EventDispatcher, type:String, listener:Function, useCapture:Boolean=false):void{
if (_eventManager){
_eventManager.unregisterNativeEvent(object, type, listener, useCapture);
};
}
protected function registerEvent(event:EventSender, handler:Function):void{
if (!_eventManager){
_eventManager = new EventManager();
};
_eventManager.registerEvent(event, handler);
}
protected function clearEvents():void{
if (_eventManager){
_eventManager.clearEvents();
};
}
protected function unregisterEvent(event:EventSender, handler:Function):void{
if (_eventManager){
_eventManager.unregisterEvent(event, handler);
};
}
public function dispose():void{
if (_eventManager){
_eventManager.clearEvents();
};
}
}
}//package dressup.abstract
Section 27
//View (dressup.abstract.View)
package dressup.abstract {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import common.converting.*;
import common.comparing.*;
import common.flash.controls.*;
import components.*;
import common.utils.*;
public class View extends Controller {
private var _enabled:Boolean;// = true
private var _content:Sprite;
public static var defaultSound:Class;
public function View(content:Sprite){
super();
_content = content;
}
public function get content():Sprite{
return (_content);
}
public static function setButtonText(button:SimpleButton, fieldName:String, value):void{
var field:TextField;
var fields:Array = GraphUtil.getAllButtonChildren(button, new NameRequirement(fieldName));
for each (field in fields) {
field.text = String(value);
};
}
public static function getCheckBoxes(container:Sprite):Array{
var clips:Array = GraphUtil.getChildren(container, new PropertyRequirement("totalFrames", 2));
var buttons:Array = ArrayUtil.convert(clips, new ConstructorConverter(CheckBox));
return (buttons.reverse());
}
public static function setButtonAction(button:InteractiveObject, handler:Function, soundClass:Class=null, ... _args):void{
var button = button;
var handler = handler;
var soundClass = soundClass;
var rest = _args;
var clickHandler:Function = function (e:MouseEvent):void{
handler.apply(this, rest);
};
var pressHandler:Function = function (e:MouseEvent):void{
if (((soundClass) || (defaultSound))){
Sounds.play(((soundClass) || (defaultSound)));
};
};
button.addEventListener(MouseEvent.MOUSE_DOWN, pressHandler);
button.addEventListener(MouseEvent.CLICK, clickHandler);
}
public static function setButtonEnabled(button:InteractiveObject, enabled:Boolean):void{
GraphUtil.setBtnEnabled(button, enabled);
}
}
}//package dressup.abstract
Section 28
//BackgroundView (dressup.scene.BackgroundView)
package dressup.scene {
import flash.display.*;
import common.events.*;
import assets.scene.*;
import common.flash.controls.*;
import dressup.abstract.*;
import common.utils.*;
public class BackgroundView extends View {
private var _buttons:RadioGroup;
private var _changeEvent:EventSender;
private var _clip:MovieClip;
public function BackgroundView(content:McScene){
_changeEvent = new EventSender(this);
super(content);
initClip(content.mcBackground);
initButtons(content.mcBgButtons);
}
private function initClip(clip:MovieClip):void{
_clip = clip;
_clip.stop();
_clip.mouseEnabled = false;
_clip.mouseChildren = false;
_clip.opaqueBackground = 0;
}
public function get changeEvent():EventSender{
return (_changeEvent);
}
public function set selectedIndex(value:int):void{
GraphUtil.stopAllChildren(_clip);
_clip.gotoAndStop((value + 1));
_buttons.selectedIndex = value;
}
private function initButtons(container:Sprite):void{
var checkboxes:Array = getCheckBoxes(container);
_buttons = new RadioGroup(checkboxes);
_buttons.selectedIndex = 0;
_buttons.clickEvent.addListener(onButtonClick);
}
private function onButtonClick():void{
selectedIndex = _buttons.selectedIndex;
_changeEvent.sendEvent();
}
public function get selectedIndex():int{
return (_buttons.selectedIndex);
}
}
}//package dressup.scene
Section 29
//CategoreisView (dressup.scene.CategoreisView)
package dressup.scene {
import flash.display.*;
import flash.events.*;
import common.events.*;
import common.comparing.*;
import assets.scene.*;
import common.flash.controls.*;
import dressup.abstract.*;
import common.utils.*;
public class CategoreisView extends View {
private var _frameIndex:int;
private var _panelSelector:RadioGroup;
private var _panels:Array;
private var _clickEvent:EventSender;
private var _panelsContainer:Sprite;
private var _selectedPanel:Sprite;
private var _filters:Array;
public function CategoreisView(content:McScene){
_clickEvent = new EventSender(this);
super(content);
initPanels(content.mcCatPanels);
initPanelSelector(content.mcCatButtons);
}
private function initPanelButtons(panel:Sprite):void{
var button:SimpleButton;
var buttons:Array = getButtons(panel);
for each (button in buttons) {
button.addEventListener(MouseEvent.CLICK, onButtonClick);
};
}
private function onCategoryClick():void{
categoryIndex = _panelSelector.selectedIndex;
}
private function onButtonClick(e:MouseEvent):void{
var button:SimpleButton = (e.currentTarget as SimpleButton);
_frameIndex = getButtons(_selectedPanel).indexOf(button);
_filters = button.filters;
_clickEvent.sendEvent();
}
private function initPanelSelector(container:Sprite):void{
var checkboxes:Array = getCheckBoxes(container);
_panelSelector = new RadioGroup(checkboxes);
_panelSelector.clickEvent.addListener(onCategoryClick);
}
private function initPanels(container:Sprite):void{
var panel:Sprite;
_panelsContainer = container;
_panels = GraphUtil.getChildren(_panelsContainer).reverse();
for each (panel in _panels) {
initPanelButtons(panel);
GraphUtil.detachFromDisplay(panel);
};
}
private function getButtons(container:Sprite):Array{
return (GraphUtil.getChildren(container, new TypeRequirement(SimpleButton)).reverse());
}
public function get frameIndex():int{
return (_frameIndex);
}
public function set categoryIndex(value:int):void{
if (_selectedPanel){
GraphUtil.detachFromDisplay(_selectedPanel);
};
_selectedPanel = _panels[value];
_panelSelector.selectedIndex = value;
if (_selectedPanel){
_panelsContainer.addChild(_selectedPanel);
};
}
public function get clickEvent():EventSender{
return (_clickEvent);
}
public function get categoryIndex():int{
return (_panels.indexOf(_selectedPanel));
}
public function get filters():Array{
return (_filters);
}
}
}//package dressup.scene
Section 30
//ControlPanelView (dressup.scene.ControlPanelView)
package dressup.scene {
import flash.display.*;
import gs.*;
import dressup.abstract.*;
import common.utils.*;
public class ControlPanelView extends View {
private var _defaultScale:Number;
private var _content:McControlPanel;
public function ControlPanelView(content:McControlPanel){
super((_content = content));
_defaultScale = _content.btnTopLogo.scaleX;
initialize();
setDefaultState();
}
private function initialize():void{
setButtonAction(_content.btnBack, onBackClick);
setButtonAction(_content.btnPhoto, onPhotoClick);
setButtonAction(_content.btnTopLogo, onLogoClick);
setButtonAction(_content.btnBottomLogo, onLogoClick);
setButtonAction(_content.btnReset, onResetClick);
}
private function onBackClick():void{
app.scene.controlsVisible = true;
setDefaultState();
}
private function onPhotoClick():void{
app.scene.controlsVisible = false;
showButtons(_content.btnTopLogo, _content.btnBack);
}
public function setDefaultState():void{
showButtons(_content.btnPhoto, _content.btnReset);
}
private function showButtons(... _args):void{
var button:SimpleButton;
GraphUtil.removeChildren(_content);
for each (button in _args) {
_content.addChild(button);
if ((((button == _content.btnBottomLogo)) || ((button == _content.btnTopLogo)))){
GraphUtil.setScale(button, (_defaultScale * 0.75));
TweenLite.to(button, 0.1, {scaleX:_defaultScale, scaleY:_defaultScale});
};
};
}
private function onLogoClick():void{
BrowserUtil.navigate("http://www.girlgames.com/");
}
private function onResetClick():void{
app.scene.reset();
showButtons(_content.btnPhoto, _content.btnBottomLogo);
}
}
}//package dressup.scene
Section 31
//ModelView (dressup.scene.ModelView)
package dressup.scene {
import flash.display.*;
import flash.events.*;
import common.comparing.*;
import dressup.abstract.*;
import common.utils.*;
public class ModelView extends View {
private var _items:Array;
private static const PART_NAME:String = "mcPart";
public function ModelView(content:Sprite){
_items = [];
super(content);
initItems();
}
private function initItems():void{
var clip:MovieClip;
var index:int;
var clips:Array = GraphUtil.getChildren(content, new NameRequirement(PART_NAME, true));
for each (clip in clips) {
index = StringUtil.extractInt(clip.name);
initItem(clip, index);
};
}
public function setDefaultItem(itemIndex:int, frameIndex:int):void{
var item:MovieClip = _items[itemIndex];
item.mouseEnabled = false;
showItem(itemIndex, frameIndex);
}
public function hideItem(itemIndex:int):void{
var item:MovieClip = _items[itemIndex];
item.visible = false;
}
public function showItem(itemIndex:int, frameIndex:int):void{
var item:MovieClip = _items[itemIndex];
item.visible = true;
item.gotoAndStop((frameIndex + 1));
}
public function hideAllItems():void{
var i:int;
while (i < _items.length) {
if (_items[i]){
hideItem(i);
};
i++;
};
}
private function onClick(e:MouseEvent):void{
var item:MovieClip = (e.currentTarget as MovieClip);
var index:int = _items.indexOf(item);
hideItem(index);
}
private function initItem(clip:MovieClip, index:int):void{
_items[(index - 1)] = clip;
clip.addEventListener(MouseEvent.CLICK, onClick);
clip.buttonMode = true;
clip.useHandCursor = true;
clip.mouseChildren = false;
clip.visible = false;
clip.stop();
}
public function applyFilters(itemIndex:int, childIndex:int, filters:Array):void{
var item:MovieClip = _items[itemIndex];
var children:Array = GraphUtil.getChildren(item, new TypeRequirement(Sprite)).reverse();
var child:Sprite = (((children[childIndex] as Sprite)) || (item));
child.filters = filters;
}
public function resetDefaultItems():void{
var item:MovieClip;
for each (item in _items) {
if (item){
item.mouseEnabled = true;
};
};
}
}
}//package dressup.scene
Section 32
//SceneScreen (dressup.scene.SceneScreen)
package dressup.scene {
import assets.scene.*;
import dressup.abstract.*;
public class SceneScreen extends View {
private var _categories:CategoreisView;
private var _model:ModelView;
private var _background:BackgroundView;
private var _controls:ControlPanelView;
private var _content:McScene;
public function SceneScreen(){
_content = new McScene();
_controls = new ControlPanelView(_content.mcControlPanel);
_categories = new CategoreisView(_content);
_background = new BackgroundView(_content);
_model = new ModelView(_content.mcModel);
super(_content);
initCategories();
refreshDefaultItems();
_background.changeEvent.addListener(onBackgoundChange);
_categories.clickEvent.addListener(onItemSelect);
}
private function refreshDefaultItems():void{
var bgNum:int;
var defaultItems:XMLList;
var itemData:XML;
var itemIndex:int;
var frameIndex:int;
bgNum = (_background.selectedIndex + 1);
defaultItems = app.config.background.(int(@num) == bgNum).defaultItem;
_model.resetDefaultItems();
for each (itemData in defaultItems) {
itemIndex = (int(itemData.@categoryNum) - 1);
frameIndex = (int(itemData.@frameNum) - 1);
_model.setDefaultItem(itemIndex, frameIndex);
};
}
private function initCategories():void{
var effectData:XML;
var buttonIndex:int;
var categoryIndex:int;
var effects:XMLList = app.config.filterEffect;
for each (effectData in effects) {
buttonIndex = (int(effectData.@buttonNum) - 1);
categoryIndex = (int(effectData.@targetCategoryNum) - 1);
_categories;
};
}
private function onItemSelect(sender:CategoreisView):void{
var buttonNum:int;
var effects:XMLList;
var targetIndex:int;
var childIndex:int;
var sender = sender;
buttonNum = (_categories.categoryIndex + 1);
effects = app.config.filterEffect.(int(@buttonNum) == buttonNum);
_controls.setDefaultState();
if (effects.length() == 0){
_model.showItem(_categories.categoryIndex, _categories.frameIndex);
} else {
targetIndex = (int(effects.@targetCategoryNum) - 1);
childIndex = (int(effects.@childNum) - 1);
_model.applyFilters(targetIndex, childIndex, _categories.filters);
};
}
public function reset():void{
_model.hideAllItems();
refreshDefaultItems();
}
public function set controlsVisible(value:Boolean):void{
_content.mcBgButtons.visible = value;
_content.mcCatPanels.visible = value;
_content.mcCatButtons.visible = value;
}
private function onBackgoundChange():void{
_categories.categoryIndex = -1;
refreshDefaultItems();
}
}
}//package dressup.scene
Section 33
//Application (dressup.Application)
package dressup {
import flash.display.*;
import flash.text.*;
import common.commands.*;
import dressup.scene.*;
import girlgames.*;
import assets.*;
import common.flash.commands.*;
public class Application {
private var _root:Sprite;
private var _appRoot:Sprite;
private var _conveyor:Conveyor;
private var _scene:SceneScreen;
private var _textStyles:StyleSheet;
private var _config:XML;
public static const CONFIG_XML:Class = Application_CONFIG_XML;
private static var _instance:Application;
public function Application(){
_conveyor = new Conveyor();
_appRoot = new Sprite();
super();
}
public function get conveyor():Conveyor{
return (_conveyor);
}
public function get scene():SceneScreen{
return (_scene);
}
public function get textStyles():StyleSheet{
return (_textStyles);
}
public function get config():XML{
return (_config);
}
public function createScene():void{
_scene = new SceneScreen();
_appRoot.addChild(_scene.content);
}
public function initialize(root:Sprite):void{
var command:PlayIntroCommand;
_root = root;
_root.addChild(_appRoot);
_config = new XML(new CONFIG_XML());
showBaner();
command = new PlayIntroCommand(new McIntro(), _appRoot);
command.allowSkip = true;
conveyor.pushAction(command);
conveyor.pushAction(createScene);
}
private function showBaner():void{
var baner:GirlgamesBanner = new GirlgamesBanner();
baner.y = (Main.HEIGHT - baner.height);
_root.addChild(baner);
}
public static function get instance():Application{
if (!_instance){
_instance = new (Application);
};
return (_instance);
}
}
}//package dressup
Section 34
//Application_CONFIG_XML (dressup.Application_CONFIG_XML)
package dressup {
import mx.core.*;
public class Application_CONFIG_XML extends ByteArrayAsset {
}
}//package dressup
Section 35
//bg1_3 (dressup_fla.bg1_3)
package dressup_fla {
import flash.display.*;
public dynamic class bg1_3 extends MovieClip {
public var snow:MovieClip;
}
}//package dressup_fla
Section 36
//GirlgamesBanner (girlgames.GirlgamesBanner)
package girlgames {
import flash.events.*;
import common.utils.*;
public class GirlgamesBanner extends McGirlgamesBaner {
public function GirlgamesBanner(){
super();
initialize();
}
private function initialize():void{
btnLogo.addEventListener(MouseEvent.CLICK, onLogoClick);
btnMoreGames.addEventListener(MouseEvent.CLICK, onMoreGamesClick);
btnFreeGames.addEventListener(MouseEvent.CLICK, onFreeGamesClick);
}
private function onFreeGamesClick(e:MouseEvent):void{
BrowserUtil.navigate("http://www.girlgames.com/free-girl-games/");
}
private function onMoreGamesClick(e:MouseEvent):void{
BrowserUtil.navigate("http://www.girlgames.com/");
}
private function onLogoClick(e:MouseEvent):void{
BrowserUtil.navigate("http://www.girlgames.com/");
}
}
}//package girlgames
Section 37
//GirlgamesPreloader (girlgames.GirlgamesPreloader)
package girlgames {
import flash.events.*;
import flash.display.*;
import common.events.*;
import common.utils.*;
public class GirlgamesPreloader {
private var _root:MovieClip;
private var _clickRect:Sprite;
private var _completeEvent:EventSender;
private var _content:PreloaderMC;
private var _state:Function;
public function GirlgamesPreloader(root:MovieClip){
_completeEvent = new EventSender(this);
super();
_root = root;
_state = playingAnim1;
initContent();
setPercent(0);
}
private function setPercent(value:Number):void{
_content.loader.barMask.scaleX = value;
}
public function get completeEvent():EventSender{
return (_completeEvent);
}
private function initContent():void{
_content = new PreloaderMC();
_content.anim2.stop();
_content.anim2.visible = false;
_content.addEventListener(Event.ENTER_FRAME, onEnterFrame);
_content.mouseChildren = false;
_content.mouseEnabled = false;
_clickRect = GraphUtil.createRectSprite(Main.WIDTH, Main.HEIGHT, 0, 0);
_clickRect.useHandCursor = true;
_clickRect.buttonMode = true;
_clickRect.mouseChildren = false;
_clickRect.addEventListener(MouseEvent.CLICK, onMouseClick);
_root.addChild(_content);
_root.addChild(_clickRect);
_root.opaqueBackground = 0xFFFFFF;
_root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
}
private function playingAnim1():void{
if (_content.anim1.currentFrame == _content.anim1.totalFrames){
_content.anim1.stop();
_state = loading;
};
}
private function onProgress(e:ProgressEvent):void{
setPercent((e.bytesLoaded / e.bytesTotal));
}
private function onMouseClick(e:MouseEvent):void{
BrowserUtil.navigate("http://www.girlgames.com/");
}
private function finishing():void{
if (_content.anim2.currentFrame == _content.anim2.totalFrames){
GraphUtil.stopAllChildren(_content);
GraphUtil.detachFromDisplay(_content);
GraphUtil.detachFromDisplay(_clickRect);
_content.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_root.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);
_completeEvent.sendEvent();
};
}
private function onEnterFrame(e:Event):void{
_state();
}
private function loading():void{
if (_root.loaderInfo.bytesLoaded == _root.loaderInfo.bytesTotal){
_content.loader.visible = false;
_content.anim1.visible = false;
_content.anim2.visible = true;
_content.anim2.play();
_state = finishing;
};
}
}
}//package girlgames
Section 38
//pojava_logo_2 (girlgames_fla.pojava_logo_2)
package girlgames_fla {
import flash.display.*;
public dynamic class pojava_logo_2 extends MovieClip {
public var loader:McBar;
}
}//package girlgames_fla
Section 39
//Symbol12_16 (girlgames_fla.Symbol12_16)
package girlgames_fla {
import flash.display.*;
public dynamic class Symbol12_16 extends MovieClip {
public function Symbol12_16(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package girlgames_fla
Section 40
//Symbol13_17 (girlgames_fla.Symbol13_17)
package girlgames_fla {
import flash.display.*;
public dynamic class Symbol13_17 extends MovieClip {
public var anim2:MovieClip;
}
}//package girlgames_fla
Section 41
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
public class TweenLite {
public var delay:Number;
protected var _initted:Boolean;
protected var _subTweens:Array;
public var startTime:int;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _active:Boolean;
public var tweens:Array;
public var vars:Object;
public var initTime:int;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 6.31;
private static var _sprite:Sprite = new Sprite();
protected static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
protected static var _curTime:uint;
private static var _listening:Boolean;
public function TweenLite($target:Object, $duration:Number, $vars:Object){
super();
if ($target == null){
return;
};
if (((((!(($vars.overwrite == false))) && (!(($target == null))))) || ((_all[$target] == undefined)))){
delete _all[$target];
_all[$target] = new Dictionary();
};
_all[$target][this] = this;
this.vars = $vars;
this.duration = (($duration) || (0.001));
this.delay = (($vars.delay) || (0));
this.target = $target;
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
if ((((this.vars.alpha == 0)) && (!((this.vars.runBackwards == true))))){
this.vars.visible = false;
};
};
this.tweens = [];
_subTweens = [];
_hst = (_initted = false);
_active = ((($duration == 0)) && ((this.delay == 0)));
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_classInitted = true;
};
this.initTime = _curTime;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = _curTime;
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween($proxy:Function, $target:Object, $props:Object, $info:Object=null):void{
var p:String;
var sub:Object = {proxy:$proxy, target:$target, info:$info};
_subTweens.push(sub);
for (p in $props) {
if (typeof($props[p]) == "number"){
this.tweens.push({o:$target, p:p, s:$target[p], c:($props[p] - $target[p]), sub:sub});
} else {
this.tweens.push({o:$target, p:p, s:$target[p], c:Number($props[p]), sub:sub});
};
};
_hst = true;
}
public function initTweenVals($hrp:Boolean=false, $reservedProps:String=""):void{
var p:String;
var i:int;
var endArray:Array;
var clr:ColorTransform;
var endClr:ColorTransform;
var tp:Object;
var isDO = (this.target is DisplayObject);
if ((this.target is Array)){
endArray = ((this.vars.endArray) || ([]));
i = 0;
while (i < endArray.length) {
if (((!((this.target[i] == endArray[i]))) && (!((this.target[i] == undefined))))){
this.tweens.push({o:this.target, p:i.toString(), s:this.target[i], c:(endArray[i] - this.target[i])});
};
i++;
};
} else {
for (p in this.vars) {
if ((((((((((((((((((((((((((((((((((((((p == "ease")) || ((p == "delay")))) || ((p == "overwrite")))) || ((p == "onComplete")))) || ((p == "onCompleteParams")))) || ((p == "onCompleteScope")))) || ((p == "runBackwards")))) || ((p == "visible")))) || ((p == "onUpdate")))) || ((p == "onUpdateParams")))) || ((p == "onUpdateScope")))) || ((p == "autoAlpha")))) || ((p == "onStart")))) || ((p == "onStartParams")))) || ((p == "onStartScope")))) || ((p == "renderOnStart")))) || ((p == "proxiedEase")))) || ((p == "easeParams")))) || ((($hrp) && (!(($reservedProps.indexOf(((" " + p) + " ")) == -1))))))){
} else {
if ((((p == "tint")) && (isDO))){
clr = this.target.transform.colorTransform;
endClr = new ColorTransform();
if (this.vars.alpha != undefined){
endClr.alphaMultiplier = this.vars.alpha;
delete this.vars.alpha;
i = (this.tweens.length - 1);
while (i > -1) {
if (this.tweens[i].p == "alpha"){
this.tweens.splice(i, 1);
break;
};
i--;
};
} else {
endClr.alphaMultiplier = this.target.alpha;
};
if (((((!((this.vars[p] == null))) && (!((this.vars[p] == ""))))) || ((this.vars[p] == 0)))){
endClr.color = this.vars[p];
};
addSubTween(tintProxy, {progress:0}, {progress:1}, {target:this.target, color:clr, endColor:endClr});
} else {
if ((((p == "frame")) && (isDO))){
addSubTween(frameProxy, {frame:this.target.currentFrame}, {frame:this.vars[p]}, {target:this.target});
} else {
if ((((p == "volume")) && (((isDO) || ((this.target is SoundChannel)))))){
addSubTween(volumeProxy, this.target.soundTransform, {volume:this.vars[p]}, {target:this.target});
} else {
if (typeof(this.vars[p]) == "number"){
this.tweens.push({o:this.target, p:p, s:this.target[p], c:(this.vars[p] - this.target[p])});
} else {
this.tweens.push({o:this.target, p:p, s:this.target[p], c:Number(this.vars[p])});
};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
i = (this.tweens.length - 1);
while (i > -1) {
tp = this.tweens[i];
tp.s = (tp.s + tp.c);
tp.c = (tp.c * -1);
i--;
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (!_initted){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(this.vars.onStartScope, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render($t:uint):void{
var factor:Number;
var tp:Object;
var i:int;
var time:Number = (($t - this.startTime) / 1000);
if (time >= this.duration){
time = this.duration;
factor = 1;
} else {
factor = this.vars.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
tp = this.tweens[i];
tp.o[tp.p] = (tp.s + (factor * tp.c));
i--;
};
if (_hst){
i = (_subTweens.length - 1);
while (i > -1) {
_subTweens[i].proxy(_subTweens[i]);
i--;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function complete($skipRender:Boolean=false):void{
if (!$skipRender){
if (!_initted){
initTweenVals();
};
this.startTime = (_curTime - (this.duration * 1000));
render(_curTime);
return;
};
if (this.vars.visible != undefined){
this.target.visible = Boolean(this.vars.visible);
};
removeTween(this);
if (this.vars.onComplete != null){
this.vars.onComplete.apply(this.vars.onCompleteScope, this.vars.onCompleteParams);
};
}
public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{
$t = ($t / $d);
return ((((-($c) * $t) * ($t - 2)) + $b));
}
public static function frameProxy($o:Object):void{
$o.info.target.gotoAndStop(Math.round($o.target.frame));
}
public static function removeTween($t:TweenLite=null):void{
if (((!(($t == null))) && (!((_all[$t.target] == undefined))))){
delete _all[$t.target][$t];
};
}
public static function killTweensOf($tg:Object=null, $complete:Boolean=false):void{
var o:Object;
var tw:*;
if (((!(($tg == null))) && (!((_all[$tg] == undefined))))){
if ($complete){
o = _all[$tg];
for (tw in o) {
o[tw].complete(false);
};
};
delete _all[$tg];
};
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null, $onCompleteScope=null):TweenLite{
return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:false}));
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{
$vars.runBackwards = true;
return (new TweenLite($target, $duration, $vars));
}
public static function executeAll($e:Event=null):void{
var a:Dictionary;
var p:Object;
var tw:Object;
var t:uint = (_curTime = getTimer());
if (_listening){
a = _all;
for each (p in a) {
for (tw in p) {
if (((!((p[tw] == undefined))) && (p[tw].active))){
p[tw].render(t);
};
};
};
};
}
public static function volumeProxy($o:Object):void{
$o.info.target.soundTransform = $o.target;
}
public static function killGarbage($e:TimerEvent):void{
var found:Boolean;
var p:Object;
var twp:Object;
var tw:Object;
var tg_cnt:uint;
for (p in _all) {
found = false;
for (twp in _all[p]) {
found = true;
break;
};
if (!found){
delete _all[p];
} else {
tg_cnt++;
};
};
if (tg_cnt == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy($o:Object):void{
var n:Number = $o.target.progress;
var r:Number = (1 - n);
var sc:Object = $o.info.color;
var ec:Object = $o.info.endColor;
$o.info.target.transform.colorTransform = new ColorTransform(((sc.redMultiplier * r) + (ec.redMultiplier * n)), ((sc.greenMultiplier * r) + (ec.greenMultiplier * n)), ((sc.blueMultiplier * r) + (ec.blueMultiplier * n)), ((sc.alphaMultiplier * r) + (ec.alphaMultiplier * n)), ((sc.redOffset * r) + (ec.redOffset * n)), ((sc.greenOffset * r) + (ec.greenOffset * n)), ((sc.blueOffset * r) + (ec.blueOffset * n)), ((sc.alphaOffset * r) + (ec.alphaOffset * n)));
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{
return (new TweenLite($target, $duration, $vars));
}
}
}//package gs
Section 42
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.3.0.4852";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 43
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 44
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 45
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import girlgames.*;
import flash.utils.*;
public class Main extends MovieClip {
public static const BOUNDS:Rectangle = new Rectangle(0, 0, WIDTH, HEIGHT);
public static const WIDTH:Number = 760;
public static const HEIGHT:Number = 610;
public function Main(){
var preloader:GirlgamesPreloader;
super();
scrollRect = BOUNDS;
opaqueBackground = 0;
preloader = new GirlgamesPreloader(this);
preloader.completeEvent.addListener(startup);
//unresolved jump
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function initializeApp(e:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, initializeApp);
var applicationClass:Class = Class(getDefinitionByName("dressup.Application"));
applicationClass["instance"].initialize(this);
}
private function onEnterFrame(e:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
startup();
};
}
private function startup():void{
stop();
if (stage){
initializeApp();
} else {
addEventListener(Event.ADDED_TO_STAGE, initializeApp);
};
}
}
}//package
Section 46
//McBar (McBar)
package {
import flash.display.*;
public dynamic class McBar extends MovieClip {
public var barMask:MovieClip;
}
}//package
Section 47
//McControlPanel (McControlPanel)
package {
import flash.display.*;
public dynamic class McControlPanel extends MovieClip {
public var btnPhoto:SimpleButton;
public var btnBack:SimpleButton;
public var btnReset:SimpleButton;
public var btnTopLogo:SimpleButton;
public var btnBottomLogo:SimpleButton;
}
}//package
Section 48
//McGirlgamesBaner (McGirlgamesBaner)
package {
import flash.display.*;
public dynamic class McGirlgamesBaner extends MovieClip {
public var btnLogo:SimpleButton;
public var btnMoreGames:SimpleButton;
public var btnFreeGames:SimpleButton;
}
}//package
Section 49
//PreloaderMC (PreloaderMC)
package {
import flash.display.*;
public dynamic class PreloaderMC extends MovieClip {
public var loader:McBar;
public var anim2:MovieClip;
public var anim1:MovieClip;
}
}//package