Section 1
//Game (com.elf7.Game)
package com.elf7 {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
public class Game extends MovieClip {
private var replayBtn:SimpleButton;
private var counter:int;// = 0
public var credits_bt:SimpleButton;
public var next_bt:SimpleButton;
public var cursor_mc:MovieClip;
public var cursor_mask:MovieClip;
public var play_bt:SimpleButton;
private var cursor:MovieClip;
private var pos:Array;
public var p:MovieClip;
public var start_bt:SimpleButton;
public var cursorMask:MovieClip;
private var playBtn:SimpleButton;
public var mg:SimpleButton;
public var tiles:Array;
private var level:int;// = 0
private var creditsBtn:SimpleButton;
private var nextBtn:SimpleButton;
public var replay_bt:SimpleButton;
private var gameResult:String;// = "win"
public var mask_mc:MovieClip;
private var blackMask:MovieClip;
public function Game():void{
tiles = new Array();
counter = 0;
level = 0;
gameResult = "win";
pos = [{x:505, y:683}, {x:505, y:683}, {x:454, y:683}, {x:505, y:683}, {x:150, y:629}, {x:150, y:580}, {x:455, y:580}];
super();
addFrameScript(7, frame8, 13, frame14, 18, frame19, 23, frame24, 32, frame33, 37, frame38, 38, frame39);
stop();
addFrameScript(0, frame1);
addFrameScript(1, frame2);
addFrameScript(2, frame3);
addFrameScript(3, frame4);
addFrameScript(4, frame5);
}
public function checkDownloading(e:Event):void{
var preloader:MovieClip;
var preloaderBar:MovieClip;
var label:TextField;
var percent:int;
preloader = (getChildByName("p") as MovieClip);
preloaderBar = (preloader.getChildByName("bar") as MovieClip);
label = (preloader.getChildByName("txt") as TextField);
percent = Math.floor(((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) * 100));
if (percent < 100){
preloaderBar.gotoAndStop((percent + 1));
label.text = (((((("LOADING " + percent) + "% ") + String((Math.floor(((loaderInfo.bytesLoaded / 0x0400) * 10)) / 10))) + "/") + String((Math.floor(((loaderInfo.bytesTotal / 0x0400) * 10)) / 10))) + " KB");
} else {
nextFrame();
removeEventListener(Event.ENTER_FRAME, checkDownloading);
};
}
function frame14(){
stop();
}
private function frame3():void{
(getChildByName("start_bt") as SimpleButton).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
private function endLevel():void{
var i:int;
i = 0;
removeEventListener(Event.ENTER_FRAME, dragCursor);
cursor.x = 1000;
cursorMask.x = 1000;
blackMask.visible = false;
if (gameResult == "win"){
i = 0;
while (i < tiles.length) {
i++;
};
tiles = new Array();
nextBtn.visible = true;
replayBtn.visible = true;
creditsBtn.visible = true;
play();
level++;
};
if (gameResult == "lose"){
newLevel();
};
}
private function frame1():void{
addEventListener(Event.ENTER_FRAME, checkDownloading);
}
public function wait(e:Event):void{
if (counter > (24 * 3)){
counter = 0;
removeEventListener(Event.ENTER_FRAME, wait);
nextFrame();
} else {
counter++;
};
}
private function frame4():void{
playBtn = (getChildByName("play_bt") as SimpleButton);
creditsBtn = (getChildByName("credits_bt") as SimpleButton);
nextBtn = (getChildByName("next_bt") as SimpleButton);
replayBtn = (getChildByName("replay_bt") as SimpleButton);
blackMask = (getChildByName("mask_mc") as MovieClip);
cursorMask = (getChildByName("cursor_mask") as MovieClip);
cursor = (getChildByName("cursor_mc") as MovieClip);
cursor.visible = false;
blackMask.visible = false;
nextBtn.visible = false;
replayBtn.visible = false;
playBtn.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
creditsBtn.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
nextBtn.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
replayBtn.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
private function frame5():void{
newLevel();
}
function frame8(){
stop();
}
private function frame2():void{
addEventListener(Event.ENTER_FRAME, wait);
(getChildByName("mg") as SimpleButton).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
function frame24(){
stop();
}
function frame38(){
stop();
}
function frame19(){
stop();
}
function frame39(){
stop();
(getChildByName("next_bt") as SimpleButton).visible = false;
}
public function dragCursor(e:Event):void{
var i:int;
var dx:Number;
var dy:Number;
i = 0;
dx = ((stage.mouseX - cursor.x) / 1.5);
dy = ((stage.mouseY - cursor.y) / 1.5);
cursor.x = (cursor.x + dx);
cursor.y = (cursor.y + dy);
cursorMask.x = cursor.x;
cursorMask.y = cursor.y;
i = 0;
while (i < tiles.length) {
if (tiles[i].type == "Tile3"){
if (tiles[i].link.hitTestPoint(cursor.x, cursor.y, true)){
gameResult = "win";
endLevel();
return;
};
};
if (tiles[i].type == "Tile1"){
if (tiles[i].link.hitTestPoint(cursor.x, cursor.y, true)){
gameResult = "lose";
endLevel();
return;
};
};
i++;
};
}
function frame33(){
stop();
}
private function newLevel():void{
var i:int;
nextBtn.visible = false;
replayBtn.visible = false;
creditsBtn.visible = false;
playBtn.visible = false;
blackMask.visible = true;
cursor.visible = true;
cursorMask.visible = true;
cursor.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
cursor.x = pos[level].x;
cursor.y = pos[level].y;
cursorMask.x = cursor.x;
cursorMask.y = cursor.y;
i = 0;
while (i < numChildren) {
if (getQualifiedClassName(getChildAt(i)).indexOf("Tile") > -1){
(getChildAt(i) as Tile).init();
};
i++;
};
}
public function onClick(e:MouseEvent):void{
if (e.target.name == "start_bt"){
nextFrame();
};
if (e.target.name == "play_bt"){
nextFrame();
};
if (e.target.name == "replay_bt"){
gotoAndStop(5);
level = 0;
};
if (e.target.name == "next_bt"){
newLevel();
};
if (e.target.name == "cursor_mc"){
cursor.removeEventListener(MouseEvent.CLICK, onClick);
addEventListener(Event.ENTER_FRAME, dragCursor);
};
if (e.target.name == "mg"){
navigateToURL(new URLRequest("http://www.7thelf.com/"), "_blank");
};
}
}
}//package com.elf7
Section 2
//Tile (com.elf7.Tile)
package com.elf7 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tile extends MovieClip {
public function Tile(){
super();
}
public function init():void{
mouseChildren = false;
(parent as Game).tiles.push({link:this, type:getQualifiedClassName(this)});
}
public function onAdded(e:Event):void{
mouseChildren = false;
(parent as Game).tiles.push({link:this, type:getQualifiedClassName(this)});
}
}
}//package com.elf7
Section 3
//Preloader_1 (WH40000_DRESSUP_BY_7THELF_DOT_COM_fla.Preloader_1)
package WH40000_DRESSUP_BY_7THELF_DOT_COM_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Preloader_1 extends MovieClip {
public var txt:TextField;
public var preloaderBar:MovieClip;
public function Preloader_1(){
super();
}
}
}//package WH40000_DRESSUP_BY_7THELF_DOT_COM_fla
Section 4
//PreloaderBar_2 (WH40000_DRESSUP_BY_7THELF_DOT_COM_fla.PreloaderBar_2)
package WH40000_DRESSUP_BY_7THELF_DOT_COM_fla {
import flash.display.*;
public dynamic class PreloaderBar_2 extends MovieClip {
public function PreloaderBar_2(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WH40000_DRESSUP_BY_7THELF_DOT_COM_fla
Section 5
//Tile1 (Tile1)
package {
import com.elf7.*;
public dynamic class Tile1 extends Tile {
public function Tile1(){
super();
}
}
}//package
Section 6
//Tile2 (Tile2)
package {
import com.elf7.*;
public dynamic class Tile2 extends Tile {
public function Tile2(){
super();
}
}
}//package
Section 7
//Tile3 (Tile3)
package {
import com.elf7.*;
public dynamic class Tile3 extends Tile {
public function Tile3(){
super();
}
}
}//package