Section 1
//black_hearts_45 (happyland4_fla.black_hearts_45)
package happyland4_fla {
import flash.display.*;
public dynamic class black_hearts_45 extends MovieClip {
public function black_hearts_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 2
//boss_49 (happyland4_fla.boss_49)
package happyland4_fla {
import flash.display.*;
public dynamic class boss_49 extends MovieClip {
public var meter:MovieClip;
public var hearts:MovieClip;
}
}//package happyland4_fla
Section 3
//boss_hearts_50 (happyland4_fla.boss_hearts_50)
package happyland4_fla {
import flash.display.*;
public dynamic class boss_hearts_50 extends MovieClip {
public function boss_hearts_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 4
//buttonBack_52 (happyland4_fla.buttonBack_52)
package happyland4_fla {
import flash.display.*;
public dynamic class buttonBack_52 extends MovieClip {
public var crossLine:MovieClip;
}
}//package happyland4_fla
Section 5
//chromeshark_logo_71 (happyland4_fla.chromeshark_logo_71)
package happyland4_fla {
import flash.display.*;
public dynamic class chromeshark_logo_71 extends MovieClip {
public var sharkSound:fxShark;
public function chromeshark_logo_71(){
addFrameScript(9, frame10);
}
function frame10(){
sharkSound = new fxShark();
sharkSound.play();
}
}
}//package happyland4_fla
Section 6
//elf_heart_40 (happyland4_fla.elf_heart_40)
package happyland4_fla {
import flash.display.*;
public dynamic class elf_heart_40 extends MovieClip {
public function elf_heart_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 7
//enemy_face_34 (happyland4_fla.enemy_face_34)
package happyland4_fla {
import flash.display.*;
public dynamic class enemy_face_34 extends MovieClip {
public function enemy_face_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 8
//enemy_inner_64 (happyland4_fla.enemy_inner_64)
package happyland4_fla {
import flash.display.*;
public dynamic class enemy_inner_64 extends MovieClip {
public var face:MovieClip;
}
}//package happyland4_fla
Section 9
//enemy_move_63 (happyland4_fla.enemy_move_63)
package happyland4_fla {
import flash.display.*;
public dynamic class enemy_move_63 extends MovieClip {
public var enemy:MovieClip;
}
}//package happyland4_fla
Section 10
//happy_heart_27 (happyland4_fla.happy_heart_27)
package happyland4_fla {
import flash.display.*;
public dynamic class happy_heart_27 extends MovieClip {
public var heart:MovieClip;
}
}//package happyland4_fla
Section 11
//happybot_face_60 (happyland4_fla.happybot_face_60)
package happyland4_fla {
import flash.display.*;
public dynamic class happybot_face_60 extends MovieClip {
public function happybot_face_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 12
//heart_eyes_30 (happyland4_fla.heart_eyes_30)
package happyland4_fla {
import flash.display.*;
public dynamic class heart_eyes_30 extends MovieClip {
public function heart_eyes_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 13
//heart_face_28 (happyland4_fla.heart_face_28)
package happyland4_fla {
import flash.display.*;
public dynamic class heart_face_28 extends MovieClip {
public var eyes:MovieClip;
}
}//package happyland4_fla
Section 14
//loading_bar_14 (happyland4_fla.loading_bar_14)
package happyland4_fla {
import flash.display.*;
public dynamic class loading_bar_14 extends MovieClip {
public var lbar:MovieClip;
}
}//package happyland4_fla
Section 15
//MainTimeline (happyland4_fla.MainTimeline)
package happyland4_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var startBox:MovieClip;
public var fuzzy:happybot;
public var cloudTimer:int;
public var starTimer:int;
public var keySpace:Boolean;
public var toggleSound:int;
public var accelRight:Number;
public var shade:happy_shade;
public var ranCreate:int;
public var moreBox:MovieClip;
public var introLogo:MovieClip;
public var tutState:Array;
public var sun:happy_sun;
public var playerNameText:TextField;
public var i:int;
public var myContextMenu:ContextMenu;
public var preloader:MovieClip;
public var enemyCount:Number;
public var enemy_container:MovieClip;
public var mountain:mountainBack;
public var score:TextField;
public var enemyTimer:int;
public var gameQuality:String;
public var currentScore:int;
public var keyLeftArrow:Boolean;
public var cloudLimit:int;
public var explode_container:MovieClip;
public var keyUpArrow:Boolean;
public var creditsBox:MovieClip;
public var star_container:MovieClip;
public var heartDelay:int;
public var happy:happybot;
public var elf_container:MovieClip;
public var keyDownArrow:Boolean;
public var sponsorButton:MovieClip;
public var cloud_container:MovieClip;
public var buttonNewgrounds:MovieClip;
public var soundVolume:SoundTransform;
public var playerName:String;
public var buttonChromeshark:MovieClip;
public var buttonHighscore:MovieClip;
public var musicChannel:SoundChannel;
public var toggleMusic:int;
public var heartActive:int;
public var keyRightArrow:Boolean;
public var accelLeft:Number;
public var dreamlandSound:mxDreamland;
public var maxSpeed:Number;
public var gameComplete:Boolean;
public var heartLeft:Boolean;
public var stageWidth:Number;
public var tut_container:MovieClip;
public var item2:ContextMenuItem;
public var item4:ContextMenuItem;
public var item5:ContextMenuItem;
public var item1:ContextMenuItem;
public var item3:ContextMenuItem;
public var buttonPrankard:MovieClip;
public var currentLevel:int;
public var keyLetterS:Boolean;
public var keyLetterW:Boolean;
public var trail_container:MovieClip;
public var keyLetterX:Boolean;
public var musicVolume:SoundTransform;
public var stageStartTimer:Number;
public var continueBox:MovieClip;
public var stageTitleContainer:MovieClip;
public var bossSound:mxBoss;
public var accelUp:Number;
public var accelDown:Number;
public var happyState:String;
public var currentHappiness:Number;
public var grass:grass_animate;
public var stageStarted:Array;
public var stageHeight:Number;
public var heart_container:MovieClip;
public var happy_enemies:int;
public var scoreBox:MovieClip;
public var happy_container:MovieClip;
public var baseBar:base_bar;
public var stageSpeed:Number;
public var menuBox:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30, 39, frame40, 49, frame50, 59, frame60, 69, frame70);
}
public function kingMove(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_arg1.target.shootTimer = (_arg1.target.shootTimer + 1);
if (_arg1.target.shootTimer > 20){
_arg1.target.shootTimer = 0;
if (Math.random() > 0.5){
heartCreate((_arg1.target.x - 80), (_arg1.target.y + 20), -1, 3, "sad");
_arg1.target.happyHit = false;
} else {
heartCreate((_arg1.target.x - 80), (_arg1.target.y - 10), 1, 3, "sad");
_arg1.target.happyHit = false;
};
};
if (_arg1.target.happiness >= 20){
_arg1.target.heartState = "happy";
} else {
if (_arg1.target.happiness > 10){
_arg1.target.heartState = "solemn";
} else {
_arg1.target.heartState = "sad";
};
};
baseBar.boss.meter.scaleX = (_arg1.target.happiness / 33);
_local2 = (Math.random() * 100);
if (_local2 > 50){
trailCreate(_arg1.target, _arg1.target.heartState, 1);
};
_arg1.target.x = (_arg1.target.x + (_arg1.target.xDir * (3 + (_arg1.target.happiness / 5))));
_arg1.target.y = (_arg1.target.y + (_arg1.target.yDir * 2));
if (_arg1.target.happiness < 20){
_local3 = (Math.random() * 100);
if (_local3 > 98){
if (_arg1.target.x < 300){
_arg1.target.xDir = (_arg1.target.xDir + 1);
} else {
_arg1.target.xDir = (_arg1.target.xDir - 1);
};
};
_local4 = (Math.random() * 100);
if (_local4 > 99){
if (_arg1.target.y < 200){
_arg1.target.yDir = (_arg1.target.yDir + 1);
} else {
_arg1.target.yDir = (_arg1.target.yDir - 1);
};
};
if (_arg1.target.x < 50){
_arg1.target.xDir = 1;
};
if (_arg1.target.x > 550){
_arg1.target.xDir = -1;
};
if (_arg1.target.y < 50){
_arg1.target.yDir = 1;
};
if (_arg1.target.y > 300){
_arg1.target.yDir = -1;
};
baseBar.boss.alpha = 1;
} else {
stageStartTimer = 200;
_arg1.target.xDir = (_arg1.target.xDir + 1);
baseBar.boss.hearts.play();
if (baseBar.boss.alpha > 0){
baseBar.boss.alpha = (baseBar.boss.alpha - 0.1);
};
if (_arg1.target.x > 700){
gameComplete = true;
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, kingMove);
};
};
if (_arg1.target.box.hitTestObject(happy)){
enemyHitTest(_arg1);
};
}
public function starHitTest(_arg1:Event):void{
var _local2:fxMagic;
_local2 = new fxMagic();
_local2.play(0, 0, soundVolume);
if (currentHappiness > 0){
currentHappiness = (currentHappiness + 100);
};
if (currentHappiness > 1000){
currentHappiness = 1000;
};
i = 0;
while (i < 30) {
explodeCreate((_arg1.target.x - 5), _arg1.target.y, 0, 0, 1, 1, "star");
i++;
};
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, starMove);
}
public function scoreClick(_arg1:MouseEvent):void{
linkHighScore();
}
public function enemyHitTest(_arg1:Event):void{
var _local2:fxTingly;
if (_arg1.target.happyHit == false){
_arg1.target.happyHit = true;
_local2 = new fxTingly();
_local2.play(0, 0, soundVolume);
};
explodeCreate((happy.x + (_arg1.target.width / 2)), (_arg1.target.y + (_arg1.target.height / 2)), _arg1.target.xMove, _arg1.target.yMove, _arg1.target.xDir, _arg1.target.yDir, "sad");
baseBar.black.play();
happy.play();
currentHappiness = (currentHappiness - 5);
if (currentHappiness < 0){
currentHappiness = 0;
};
}
public function startClick(_arg1:MouseEvent):void{
musicChannel = dreamlandSound.play(0, 99, musicVolume);
gotoAndStop("game");
}
public function getURL(_arg1:String, _arg2:String){
var web:String;
var request:URLRequest;
var url = _arg1;
var method = _arg2;
web = url;
request = new URLRequest(web);
try {
navigateToURL(request, method);
} catch(e:Error) {
};
}
public function buttonRollOver(_arg1:MouseEvent):void{
_arg1.target.scaleX = 1.1;
_arg1.target.scaleY = 1.1;
}
public function linkPrankard():void{
var _local1:URLRequest;
_local1 = new URLRequest("http://www.prankard.com");
navigateToURL(_local1, "_blank");
}
function frame10(){
stop();
this.addEventListener(Event.ENTER_FRAME, enterFrameIntro);
}
public function clickSound(_arg1:MouseEvent):void{
if (toggleSound == 1){
toggleSound = 0;
} else {
toggleSound = 1;
};
}
public function highscoreSubmit(_arg1:MouseEvent):void{
var _local2:fxZing;
linkHighScoreSubmit();
_local2 = new fxZing();
_local2.play(0, 0, soundVolume);
gotoAndStop("menu");
}
function frame1(){
stop();
dreamlandSound = new mxDreamland();
bossSound = new mxBoss();
toggleMusic = 1;
toggleSound = 1;
musicVolume = new SoundTransform(0.5, 0);
soundVolume = new SoundTransform(1, 0);
gameQuality = "medium";
playerName = "Fuzzy Elf";
currentLevel = 0;
i = 0;
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
this.addEventListener("enterFrame", load_bar);
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
item1 = new ContextMenuItem("Chrome Shark Media");
myContextMenu.customItems.push(item1);
item1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler);
item2 = new ContextMenuItem("MoFunZone.com");
myContextMenu.customItems.push(item2);
item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler2);
item3 = new ContextMenuItem("Game Quality: Low");
myContextMenu.customItems.push(item3);
item3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler3);
item4 = new ContextMenuItem("Game Quality: Medium");
myContextMenu.customItems.push(item4);
item4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler4);
item5 = new ContextMenuItem("Game Quality: High");
myContextMenu.customItems.push(item5);
item5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler5);
this.contextMenu = myContextMenu;
}
public function elfCreate():void{
var _local1:misery_elf;
var _local2:Number;
_local1 = new misery_elf();
if (Math.random() > 0.5){
_local1.yDir = 1;
} else {
_local1.yDir = -1;
};
if ((((Math.random() > 0.5)) && ((currentLevel >= 4)))){
_local1.xDir = 1;
} else {
_local1.xDir = -1;
};
_local1.scaleY = (_local1.scaleY / 3.5);
_local1.scaleX = (_local1.scaleY * -(_local1.xDir));
if (_local1.xDir == 1){
_local1.x = -50;
} else {
_local1.x = 650;
};
_local1.y = (50 + (Math.random() * 250));
_local2 = Math.random();
stageSpeed = currentLevel;
if (currentLevel >= 4){
stageSpeed = (currentLevel - 10);
};
_local1.xMove = ((((currentLevel + 10) + stageSpeed) + (2 * _local2)) - _local1.xDir);
_local1.yMove = ((_local2 * (currentLevel + 4)) / 2);
_local1.heartState = "sad";
_local1.elfType = "elf";
_local1.elfTurn = false;
_local1.happyHit = false;
elf_container.addChild(_local1);
_local1.addEventListener(Event.ENTER_FRAME, elfMove);
}
public function menuSelectHandler2(_arg1:ContextMenuEvent):void{
getURL("http://www.mofunzone.com/", "_blank");
}
public function menuSelectHandler3(_arg1:ContextMenuEvent):void{
gameQuality = "low";
}
public function menuSelectHandler5(_arg1:ContextMenuEvent):void{
gameQuality = "high";
}
public function menuSelectHandler4(_arg1:ContextMenuEvent):void{
gameQuality = "medium";
}
public function loadVariablesNum(_arg1:String){
var _local2:*;
var _local3:*;
_local2 = new URLRequest(_arg1);
_local3 = new URLLoader();
_local3.load(_local2);
}
public function removeChildren():void{
musicChannel.stop();
stage.quality = "high";
while (heart_container.numChildren > 0) {
heart_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, heartMove);
heart_container.removeChildAt(0);
};
while (elf_container.numChildren > 0) {
elf_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, elfMove);
elf_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, kingMove);
elf_container.removeChildAt(0);
};
while (enemy_container.numChildren > 0) {
enemy_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, enemyMove);
enemy_container.removeChildAt(0);
};
while (cloud_container.numChildren > 0) {
cloud_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, cloudMove);
cloud_container.removeChildAt(0);
};
while (star_container.numChildren > 0) {
star_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, starMove);
star_container.removeChildAt(0);
};
while (trail_container.numChildren > 0) {
trail_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, happyTrail);
trail_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, explodeShow);
trail_container.removeChildAt(0);
};
while (tut_container.numChildren > 0) {
tut_container.getChildAt(0).removeEventListener(Event.ENTER_FRAME, tutMove);
tut_container.removeChildAt(0);
};
removeChild(sun);
removeChild(shade);
removeChild(grass);
removeChild(mountain);
removeChild(cloud_container);
removeChild(stageTitleContainer);
removeChild(happy_container);
removeChild(heart_container);
removeChild(enemy_container);
removeChild(trail_container);
removeChild(elf_container);
removeChild(tut_container);
removeChild(star_container);
removeChild(baseBar);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
stage.removeEventListener(Event.ENTER_FRAME, gameEnterFrame);
stage.removeEventListener(Event.ENTER_FRAME, stageTitleMove);
}
public function enemyCreate():void{
var _local1:sad_enemy;
var _local2:Number;
var _local3:int;
_local1 = new sad_enemy();
_local1.enemyState = "sad";
_local1.happyHit = false;
if (Math.random() > 0.5){
_local1.yDir = 1;
} else {
_local1.yDir = -1;
};
if ((((Math.random() > 0.5)) && ((currentLevel >= 4)))){
_local1.xDir = 1;
} else {
_local1.xDir = -1;
};
_local1.scaleY = (_local1.scaleY / 3.5);
_local1.scaleX = (_local1.scaleY * -(_local1.xDir));
if (_local1.xDir == 1){
_local1.x = -50;
} else {
_local1.x = 650;
};
_local1.y = (50 + (Math.random() * 250));
_local2 = Math.random();
stageSpeed = currentLevel;
if (currentLevel >= 4){
stageSpeed = (currentLevel - 10);
};
_local1.xMove = ((((currentLevel + 10) + stageSpeed) + (2 * _local2)) - _local1.xDir);
_local1.yMove = ((_local2 * (currentLevel + 4)) / 2);
enemy_container.addChild(_local1);
_local3 = Math.ceil((Math.random() * _local1.enemy.enemy.totalFrames));
_local1.enemy.enemy.gotoAndStop(_local3);
_local1.addEventListener(Event.ENTER_FRAME, enemyMove);
}
public function tutMove(_arg1:Event):void{
var _local2:Number;
var _local3:fxSwish;
if (tutState[_arg1.target.tutID] == 1){
if (_arg1.target.x > 300){
_arg1.target.x = (_arg1.target.x - 20);
} else {
if (keySpace == true){
_local3 = new fxSwish();
_local3.play(0, 0, soundVolume);
tutState[_arg1.target.tutID] = 2;
};
};
};
if (tutState[_arg1.target.tutID] == 2){
if (_arg1.target.x > -200){
_arg1.target.x = (_arg1.target.x - 20);
} else {
tutState[_arg1.target.tutID] = 3;
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, tutMove);
};
};
if (happy.y > 150){
if (_arg1.target.y > 60){
_arg1.target.y = (_arg1.target.y - 20);
};
} else {
if (_arg1.target.y < 210){
_arg1.target.y = (_arg1.target.y + 20);
};
};
_local2 = (Math.random() * 100);
if (_local2 > 50){
trailCreate(_arg1.target, "happy", -1);
};
}
public function keyDownFunction(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 37){
keyLeftArrow = true;
};
if (_arg1.keyCode == 38){
keyUpArrow = true;
};
if (_arg1.keyCode == 39){
keyRightArrow = true;
};
if (_arg1.keyCode == 40){
keyDownArrow = true;
};
if (_arg1.keyCode == 87){
keyLetterW = true;
};
if (_arg1.keyCode == 83){
keyLetterS = true;
};
if (_arg1.keyCode == 32){
keySpace = true;
};
if (_arg1.keyCode == 75){
keyLetterX = true;
};
}
public function trailCreate(_arg1, _arg2, _arg3):void{
var _local4:heart_track;
_local4 = new heart_track();
new heart_track().scaleX = (_local4.scaleX / 2);
_local4.scaleY = _local4.scaleX;
_local4.gotoAndStop(_arg2);
_local4.trailDirection = _arg3;
_local4.x = (_arg1.x - (_arg3 * 20));
_local4.y = ((_arg1.y - 10) + (Math.random() * 40));
trail_container.addChild(_local4);
_local4.addEventListener(Event.ENTER_FRAME, happyTrail);
}
function frame30(){
stop();
menuBox.addEventListener("click", menuClick);
menuBox.addEventListener("rollOver", buttonRollOver);
menuBox.addEventListener("rollOut", buttonRollOut);
buttonChromeshark.addEventListener("click", clickChromeshark);
buttonPrankard.addEventListener("click", clickPrankard);
buttonNewgrounds.addEventListener("click", clickNewgrounds);
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
public function baseButtonRollOut(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.7;
}
function frame40(){
stop();
removeChildren();
score.text = (currentScore + "");
fuzzy.happyface.gotoAndStop("sad");
fuzzy.wing1.stop();
fuzzy.wing2.stop();
continueBox.addEventListener("click", startClick);
continueBox.addEventListener("rollOver", buttonRollOver);
continueBox.addEventListener("rollOut", buttonRollOut);
menuBox.addEventListener("click", gameOverClick);
menuBox.addEventListener("rollOver", buttonRollOver);
menuBox.addEventListener("rollOut", buttonRollOut);
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
function frame50(){
stop();
fuzzy.happyface.gotoAndStop("sad");
fuzzy.wing1.stop();
fuzzy.wing2.stop();
score.text = (currentScore + "");
playerNameText.text = playerName;
menuBox.addEventListener("click", menuClick);
menuBox.addEventListener("rollOver", buttonRollOver);
menuBox.addEventListener("rollOut", buttonRollOut);
buttonHighscore.addEventListener("mouseUp", highscoreSubmit);
buttonHighscore.addEventListener("rollOver", buttonRollOver);
buttonHighscore.addEventListener("rollOut", buttonRollOut);
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
function frame20(){
stop();
currentLevel = 0;
startBox.addEventListener("click", startClick);
startBox.addEventListener("rollOver", buttonRollOver);
startBox.addEventListener("rollOut", buttonRollOut);
scoreBox.addEventListener("click", scoreClick);
scoreBox.addEventListener("rollOver", buttonRollOver);
scoreBox.addEventListener("rollOut", buttonRollOut);
creditsBox.addEventListener("click", creditsClick);
creditsBox.addEventListener("rollOver", buttonRollOver);
creditsBox.addEventListener("rollOut", buttonRollOut);
moreBox.addEventListener("mouseUp", b_preloadRelease);
moreBox.addEventListener("rollOver", buttonRollOver);
moreBox.addEventListener("rollOut", buttonRollOut);
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
function frame60(){
stop();
removeChildren();
fuzzy.happyface.gotoAndStop("happy");
fuzzy.wing1.stop();
fuzzy.wing2.stop();
score.text = (currentScore + "");
playerNameText.text = playerName;
menuBox.addEventListener("click", menuClick);
menuBox.addEventListener("rollOver", buttonRollOver);
menuBox.addEventListener("rollOut", buttonRollOut);
buttonHighscore.addEventListener("click", highscoreSubmit);
buttonHighscore.addEventListener("rollOver", buttonRollOver);
buttonHighscore.addEventListener("rollOut", buttonRollOut);
sponsorButton.addEventListener("mouseUp", b_preloadRelease);
sponsorButton.addEventListener("rollOver", baseButtonRollOver);
sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
public function heartCreate(_arg1, _arg2, _arg3, _arg4, _arg5):void{
var _local6:heart_shoot;
_local6 = new heart_shoot();
new heart_shoot().scaleX = (_local6.scaleX / _arg4);
_local6.scaleY = _local6.scaleX;
_local6.alpha = 0.25;
_local6.gotoAndStop(_arg5);
_local6.x = _arg1;
_local6.dir = _arg3;
_local6.heartState = _arg5;
_local6.y = _arg2;
heart_container.addChild(_local6);
_local6.addEventListener(Event.ENTER_FRAME, heartMove);
}
public function stageTitleMove(_arg1:Event):void{
if (stageStartTimer > 100){
} else {
if (stageStartTimer > 0){
currentHappiness = (currentHappiness + 10);
if (currentHappiness > 1000){
currentHappiness = 1000;
};
};
};
if (stageStartTimer == 100){
currentScore = (currentScore + (currentHappiness * (currentLevel - 1)));
};
if (stageStartTimer == 0){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, stageTitleMove);
};
if ((((stageStartTimer > 90)) && ((stageStartTimer < 100)))){
_arg1.target.alpha = (_arg1.target.alpha + 0.1);
};
if (stageStartTimer < 10){
_arg1.target.alpha = (_arg1.target.alpha - 0.1);
};
}
public function linkHighScoreSubmit():void{
var _local1:*;
var _local2:*;
var _local3:URLRequest;
playerName = playerNameText.text;
_local1 = new Date();
_local2 = _local1.getTime();
_local3 = new URLRequest((((("http://www.MoFunZone.com/game_scores/happyland/highscore.php?" + playerName) + "/") + _local2) + "/2007"));
navigateToURL(_local3, "_blank");
}
public function tutCreate(_arg1):void{
var _local2:tutorialBox;
_local2 = new tutorialBox();
_local2.x = 900;
_local2.y = 150;
_local2.tutorialText.gotoAndStop(_arg1);
_local2.tutID = _arg1;
tut_container.addChild(_local2);
_local2.addEventListener(Event.ENTER_FRAME, tutMove);
}
public function happyTrail(_arg1:Event):void{
_arg1.target.x = (_arg1.target.x - (5 * _arg1.target.trailDirection));
_arg1.target.alpha = (_arg1.target.alpha - 0.05);
if (_arg1.target.alpha <= 0){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, happyTrail);
};
}
public function creditsClick(_arg1:MouseEvent):void{
var _local2:fxSwoosh;
_local2 = new fxSwoosh();
_local2.play(0, 0, soundVolume);
gotoAndStop("credits");
}
public function elfMove(_arg1:Event):void{
var _local2:Number;
_local2 = (Math.random() * 100);
if (_local2 > 50){
trailCreate(_arg1.target, _arg1.target.heartState, _arg1.target.xDir);
};
_arg1.target.x = (_arg1.target.x + (_arg1.target.xMove * _arg1.target.xDir));
_arg1.target.y = (_arg1.target.y + _arg1.target.yDir);
if ((((((_arg1.target.y <= happy.y)) && ((_arg1.target.y > 0)))) && ((_arg1.target.yDir < 3)))){
_arg1.target.yDir = (_arg1.target.yDir + 1);
};
if ((((((_arg1.target.y >= happy.y)) && ((_arg1.target.y < (350 - _arg1.target.height))))) && ((_arg1.target.yDir > -3)))){
_arg1.target.yDir = (_arg1.target.yDir - 1);
};
if ((((((_arg1.target.x <= -50)) && ((_arg1.target.xDir == -1)))) || ((((_arg1.target.x >= 650)) && ((_arg1.target.xDir == 1)))))){
_arg1.target.removeEventListener(Event.ENTER_FRAME, elfMove);
_arg1.target.parent.removeChild(_arg1.target);
};
if (_arg1.target.heartState == "sad"){
if (_arg1.target.box.hitTestObject(happy)){
enemyHitTest(_arg1);
};
};
}
function frame70(){
stop();
stage.addEventListener(Event.ENTER_FRAME, gameEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
stageWidth = 600;
stageHeight = 400;
accelLeft = 0;
accelUp = 0;
accelRight = 0;
accelDown = 0;
maxSpeed = 12;
keyLeftArrow = false;
keyUpArrow = false;
keyRightArrow = false;
keyDownArrow = false;
keyLetterW = false;
keyLetterS = false;
keyLetterX = false;
keySpace = false;
gameComplete = false;
heartActive = 0;
heartDelay = 2;
heartLeft = true;
cloudLimit = 100;
cloudTimer = 0;
starTimer = 0;
enemyTimer = 0;
ranCreate = 5;
happyState = "happy";
stageStartTimer = 110;
stageStarted = new Array();
tutState = new Array();
i = 1;
while (i < 10) {
if (currentLevel >= i){
stageStarted.push(true);
} else {
stageStarted.push(false);
};
tutState.push(0);
i++;
};
tutState[0] = 3;
happy_enemies = 0;
stageSpeed = 0;
enemyCount = 0;
currentScore = 0;
currentHappiness = 1000;
sun = new happy_sun();
addChild(sun);
sun.x = -30;
sun.y = -10;
mountain = new mountainBack();
addChild(mountain);
mountain.x = 0;
mountain.y = 150;
cloud_container = new MovieClip();
addChild(cloud_container);
grass = new grass_animate();
addChild(grass);
grass.x = 0;
grass.y = 150;
shade = new happy_shade();
addChild(shade);
shade.x = 0;
shade.y = 0;
trail_container = new MovieClip();
addChild(trail_container);
heart_container = new MovieClip();
addChild(heart_container);
happy_container = new MovieClip();
addChild(happy_container);
happy = new happybot();
happy_container.addChild(happy);
happy.x = 250;
happy.y = 50;
happy.scaleX = (happy.scaleX / 1.75);
happy.scaleY = happy.scaleX;
explode_container = new MovieClip();
happy_container.addChild(explode_container);
enemy_container = new MovieClip();
addChild(enemy_container);
star_container = new MovieClip();
addChild(star_container);
elf_container = new MovieClip();
addChild(elf_container);
tut_container = new MovieClip();
addChild(tut_container);
baseBar = new base_bar();
addChild(baseBar);
baseBar.x = 0;
baseBar.y = 350;
stageTitleContainer = new MovieClip();
addChild(stageTitleContainer);
cloudCreate(100);
cloudCreate(300);
cloudCreate(600);
cloudCreate(700);
if (currentLevel > 0){
stageTitleCreate();
};
if (currentLevel == 8){
musicChannel.stop();
musicChannel = bossSound.play(0, 99, musicVolume);
};
baseBar.menuButton.addEventListener("click", baseMenuClick);
baseBar.menuButton.addEventListener("rollOver", baseButtonRollOver);
baseBar.menuButton.addEventListener("rollOut", baseButtonRollOut);
baseBar.buttonSound.addEventListener("click", clickSound);
baseBar.buttonSound.addEventListener("rollOver", baseButtonRollOver);
baseBar.buttonSound.addEventListener("rollOut", baseButtonRollOut);
baseBar.buttonMusic.addEventListener("click", clickMusic);
baseBar.buttonMusic.addEventListener("rollOver", baseButtonRollOver);
baseBar.buttonMusic.addEventListener("rollOut", baseButtonRollOut);
baseBar.sponsorButton.addEventListener("mouseUp", b_preloadRelease);
baseBar.sponsorButton.addEventListener("rollOver", baseButtonRollOver);
baseBar.sponsorButton.addEventListener("rollOut", baseButtonRollOut);
}
public function clickChromeshark(_arg1:MouseEvent):void{
linkChromeshark();
}
public function gameEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:int;
var _local4:fxWet;
var _local5:fxFlame;
stage.quality = gameQuality;
soundVolume = new SoundTransform(toggleSound, 0);
baseBar.buttonSound.crossLine.alpha = (1 - toggleSound);
baseBar.buttonMusic.crossLine.alpha = (1 - toggleMusic);
if (happy.x > (-30 + (happy.width / 2))){
happy.x = (happy.x - accelLeft);
} else {
accelLeft = 0;
};
if (keyLeftArrow == true){
if (accelLeft < maxSpeed){
accelLeft = (accelLeft + 2);
};
} else {
if (accelLeft > 0){
accelLeft = (accelLeft - 2);
};
};
if (happy.y > (0 + (happy.height / 2))){
happy.y = (happy.y - accelUp);
} else {
accelUp = 0;
};
if (keyUpArrow == true){
if (accelUp < maxSpeed){
accelUp = (accelUp + 2);
};
} else {
if (accelUp > 0){
accelUp = (accelUp - 2);
};
};
if (happy.x < (600 - (happy.width / 2))){
happy.x = (happy.x + accelRight);
} else {
accelRight = 0;
};
if (keyRightArrow == true){
if (accelRight < maxSpeed){
accelRight = (accelRight + 2);
};
} else {
if (accelRight > 0){
accelRight = (accelRight - 2);
};
};
if (happy.y < (330 - (happy.height / 2))){
happy.y = (happy.y + accelDown);
} else {
accelDown = 0;
};
if (keyDownArrow == true){
if (accelDown < maxSpeed){
accelDown = (accelDown + 2);
};
} else {
if (accelDown > 0){
accelDown = (accelDown - 2);
};
};
if (heartActive <= 0){
if ((((keyLetterW == true)) && ((keyLetterS == false)))){
heartActive = heartDelay;
heartCreate((happy.x + 20), (happy.y - 10), -1, 3, "happy");
};
if ((((keyLetterS == true)) && ((keyLetterW == false)))){
heartActive = heartDelay;
heartCreate((happy.x + 20), (happy.y + 40), 1, 3, "happy");
};
} else {
heartActive--;
};
trailCreate(happy, happyState, 1);
happy.happyface.gotoAndStop(happyState);
grass.x = (grass.x - (5 + currentLevel));
if (currentHappiness > 0){
grass.y = (230 - (happy.y / 5));
};
if (grass.x <= -1450){
grass.x = -50;
};
mountain.x = (mountain.x - ((5 + currentLevel) / 2));
if (currentHappiness > 0){
mountain.y = (100 - (happy.y / 8));
};
if (mountain.x <= -800){
mountain.x = -50;
};
cloudTimer++;
if (cloudTimer >= cloudLimit){
if (Math.random() > 0.95){
cloudCreate(700);
cloudTimer = 0;
};
};
if (currentLevel > 0){
if (stageStartTimer == 0){
starTimer++;
if (starTimer >= (400 - (currentLevel * 30))){
starTimer = 0;
starCreate();
};
enemyTimer++;
if (currentLevel >= 4){
enemyCount = (50 - (currentLevel * 5));
} else {
enemyCount = (50 - (currentLevel * 10));
};
if (enemyTimer >= enemyCount){
ranCreate = (Math.random() * 100);
enemyTimer = 0;
if (ranCreate > 40){
enemyCreate();
} else {
if (ranCreate > 10){
if (currentLevel < 8){
elfCreate();
};
};
};
};
};
} else {
i = 0;
while (i < 7) {
if ((((tutState[i] == 0)) && ((tutState[(i - 1)] == 3)))){
tutCreate(i);
tutState[i] = 1;
};
if (keyLetterX == true){
tutState[i] = 2;
};
i++;
};
if (tutState[6] == 2){
currentLevel = 1;
stageStarted[0] = true;
stageStartTimer = 110;
stageTitleCreate();
};
};
if ((((stageStartTimer == 1)) && ((currentLevel == 8)))){
kingCreate();
};
_local2 = 0;
_local2 = (10 + (currentLevel * 5));
baseBar.score.text = (currentScore + "");
_local3 = (_local2 - happy_enemies);
if (currentLevel == 8){
baseBar.stageChange.text = ">_<";
} else {
if ((((stageStartTimer > 0)) || ((currentLevel == 0)))){
baseBar.stageChange.text = "^_^";
} else {
baseBar.stageChange.text = (_local3 + "");
};
};
baseBar.happy_meter.scaleX = (currentHappiness / 1000);
if (currentLevel < 8){
baseBar.boss.alpha = 0;
};
if (gameComplete == true){
gotoAndStop("complete");
};
if (currentLevel < 8){
i = 0;
while (i < 9) {
if (stageStarted[i] == false){
if (happy_enemies >= _local2){
_local4 = new fxWet();
_local4.play(0, 0, soundVolume);
stageStartTimer = 200;
happy_enemies = 0;
currentLevel = (i + 1);
if (currentLevel == 8){
musicChannel.stop();
musicChannel = bossSound.play(0, 99, musicVolume);
};
stageStarted[i] = true;
stageTitleCreate();
};
};
i++;
};
};
if (stageStartTimer > 0){
stageStartTimer--;
} else {
if (currentLevel > 0){
if (stageStartTimer == 0){
currentHappiness = (currentHappiness - 0.25);
};
if (currentHappiness <= 0){
currentHappiness = 0;
happy.y = (happy.y + 20);
if (happy.y > 500){
_local5 = new fxFlame();
_local5.play(0, 0, soundVolume);
gotoAndStop("continue");
};
};
};
};
}
public function linkHighScore():void{
var _local1:URLRequest;
_local1 = new URLRequest("http://www.mofunzone.com/game_scores/happyland/highscores.shtml");
navigateToURL(_local1, "_blank");
}
public function load_bar(_arg1:Event):void{
preloader.lbar.scaleX = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal);
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
gotoAndStop("intro");
this.removeEventListener("enterFrame", load_bar);
};
}
public function b_preloadRelease(_arg1:MouseEvent):void{
getURL("http://www.mofunzone.com/", "_blank");
}
public function explodeCreate(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7):void{
var _local8:heart_track;
_local8 = new heart_track();
new heart_track().scaleX = (_local8.scaleX / 2);
_local8.scaleY = _local8.scaleX;
if (_arg5 == 1){
_local8.x = (_arg1 - 40);
} else {
_local8.x = (_arg1 + 20);
};
_local8.y = _arg2;
_local8.xMove = _arg3;
_local8.yMove = _arg4;
_local8.xDir = _arg5;
_local8.yDir = _arg6;
_local8.heartState = _arg7;
_local8.gotoAndStop(_arg7);
_local8.ranDirection = (Math.random() * 360);
explode_container.addChild(_local8);
_local8.addEventListener(Event.ENTER_FRAME, explodeShow);
}
public function gameOverClick(_arg1:MouseEvent):void{
getURL("http://www.mofunzone.com/online_games/happyland.shtml", "_blank");
}
public function starMove(_arg1:Event):void{
var _local2:Number;
_arg1.target.x = (_arg1.target.x - (currentLevel + 10));
_local2 = (Math.random() * 100);
if (_local2 > 50){
trailCreate(_arg1.target, "star", 1);
};
if (_arg1.target.x <= -100){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, starMove);
};
if (_arg1.target.hitTestObject(happy)){
starHitTest(_arg1);
};
}
public function blackHeartHitTest(_arg1:Event):void{
var _local2:fxSharp;
_local2 = new fxSharp();
_local2.play(0, 0, soundVolume);
explodeCreate((_arg1.target.x + (_arg1.target.width / 2)), (_arg1.target.y + (_arg1.target.height / 2)), 1, 1, 1, 1, "sad");
baseBar.black.play();
happy.play();
currentHappiness = (currentHappiness - 10);
if (currentHappiness < 0){
currentHappiness = 0;
};
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, heartMove);
}
public function heartMove(_arg1:Event):void{
var _local2:int;
_arg1.target.gotoAndStop(_arg1.target.heartState);
if (_arg1.target.alpha < 1){
_arg1.target.alpha = (_arg1.target.alpha + 0.25);
};
_local2 = 1;
if (_arg1.target.heartState == "happy"){
_local2 = _arg1.target.dir;
} else {
_local2 = -(_arg1.target.dir);
};
_arg1.target.y = (_arg1.target.y + (_local2 * 20));
i = 0;
while (i < elf_container.numChildren) {
if (_arg1.target.hitTestObject(Object(elf_container.getChildAt(i)).box)){
if (Object(elf_container.getChildAt(i)).heartState == "sad"){
Object(elf_container.getChildAt(i)).gotoAndPlay("cry");
heartReverse(_arg1);
};
};
i++;
};
if (_arg1.target.heartState == "sad"){
if (_arg1.target.hitTestObject(happy)){
blackHeartHitTest(_arg1);
};
};
if ((((((_arg1.target.y < -50)) && ((_local2 == -1)))) || ((((_arg1.target.y > 450)) && ((_local2 == 1)))))){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, heartMove);
};
}
public function keyUpFunction(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 37){
keyLeftArrow = false;
};
if (_arg1.keyCode == 38){
keyUpArrow = false;
};
if (_arg1.keyCode == 39){
keyRightArrow = false;
};
if (_arg1.keyCode == 40){
keyDownArrow = false;
};
if (_arg1.keyCode == 87){
keyLetterW = false;
};
if (_arg1.keyCode == 83){
keyLetterS = false;
};
if (_arg1.keyCode == 32){
keySpace = false;
};
if (_arg1.keyCode == 88){
keyLetterX = false;
};
}
public function linkChromeshark():void{
var _local1:URLRequest;
_local1 = new URLRequest("http://www.chromeshark.com");
navigateToURL(_local1, "_blank");
}
public function menuClick(_arg1:MouseEvent):void{
var _local2:fxZing;
_local2 = new fxZing();
_local2.play(0, 0, soundVolume);
gotoAndStop("menu");
}
public function kingCreate():void{
var _local1:misery_elf;
_local1 = new misery_elf();
_local1.crown.alpha = 1;
_local1.scaleY = (_local1.scaleY / 2);
_local1.scaleX = -(_local1.scaleY);
_local1.x = 650;
_local1.y = 200;
_local1.xDir = -1;
_local1.yDir = -1;
_local1.xMove = 0;
_local1.yMove = 0;
_local1.heartState = "sad";
_local1.elfType = "king";
_local1.elfTurn = false;
_local1.happiness = 0;
_local1.shootTimer = 0;
_local1.happyHit = false;
elf_container.addChild(_local1);
_local1.addEventListener(Event.ENTER_FRAME, kingMove);
}
public function enemyMove(_arg1:Event):void{
var _local2:Number;
_arg1.target.enemy.enemy.face.gotoAndStop(_arg1.target.enemyState);
_local2 = (Math.random() * 100);
if (_local2 > 50){
trailCreate(_arg1.target, _arg1.target.enemyState, _arg1.target.xDir);
};
_arg1.target.x = (_arg1.target.x + (_arg1.target.xMove * _arg1.target.xDir));
_arg1.target.y = (_arg1.target.y + (_arg1.target.yMove * _arg1.target.yDir));
if (_arg1.target.y <= 0){
_arg1.target.yDir = 1;
};
if (_arg1.target.y >= (350 - _arg1.target.height)){
_arg1.target.yDir = -1;
};
if ((((((_arg1.target.x < -50)) && ((_arg1.target.xDir == -1)))) || ((((_arg1.target.x > 650)) && ((_arg1.target.xDir == 1)))))){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, enemyMove);
};
happyState = "happy";
if (_arg1.target.enemyState == "sad"){
if (_arg1.target.enemy.hitTestObject(happy)){
enemyHitTest(_arg1);
};
};
i = 0;
while (i < heart_container.numChildren) {
if (_arg1.target.enemy.hitTestObject(Object(heart_container.getChildAt(i)))){
if (Object(heart_container.getChildAt(i)).heartState == "happy"){
heartHitTest(_arg1);
};
};
i++;
};
}
public function baseButtonRollOver(_arg1:MouseEvent):void{
_arg1.target.alpha = 1;
}
public function clickMusic(_arg1:MouseEvent):void{
if (toggleMusic == 1){
toggleMusic = 0;
musicVolume = new SoundTransform(0, 0);
} else {
toggleMusic = 1;
musicVolume = new SoundTransform(0.5, 0);
};
musicChannel.stop();
if (currentLevel < 8){
musicChannel = dreamlandSound.play(0, 99, musicVolume);
} else {
musicChannel = bossSound.play(0, 99, musicVolume);
};
}
public function menuSelectHandler(_arg1:ContextMenuEvent):void{
linkChromeshark();
}
public function cloudCreate(_arg1):void{
var _local2:happy_cloud;
_local2 = new happy_cloud();
_local2.scaleY = (_local2.scaleY / (2 + (Math.random() * 5)));
_local2.scaleX = _local2.scaleY;
_local2.x = _arg1;
_local2.xMove = ((1 + (Math.random() * 3)) + (currentLevel / 2));
_local2.startY = (50 + (Math.random() * 200));
_local2.alpha = 0.8;
cloud_container.addChild(_local2);
_local2.addEventListener(Event.ENTER_FRAME, cloudMove);
}
public function baseMenuClick(_arg1:MouseEvent):void{
var _local2:fxZing;
removeChildren();
_local2 = new fxZing();
_local2.play(0, 0, soundVolume);
gotoAndStop("menu");
}
public function stageTitleCreate():void{
var _local1:stageSelect;
sun.gotoAndPlay(((currentLevel * 10) - 9));
shade.gotoAndPlay(((currentLevel * 10) - 9));
_local1 = new stageSelect();
stageTitleContainer.addChild(_local1);
_local1.x = 100;
_local1.y = 130;
_local1.alpha = 0;
_local1.stageNum.gotoAndStop(currentLevel);
_local1.addEventListener(Event.ENTER_FRAME, stageTitleMove);
}
public function explodeShow(_arg1:Event):void{
var _local2:fxWet;
_arg1.target.x = (_arg1.target.x + ((Math.sin(_arg1.target.ranDirection) * 5) + (_arg1.target.xMove * _arg1.target.xDir)));
_arg1.target.y = (_arg1.target.y + ((Math.cos(_arg1.target.ranDirection) * 5) + (_arg1.target.yMove * _arg1.target.yDir)));
_arg1.target.alpha = (_arg1.target.alpha - 0.05);
if (_arg1.target.alpha <= 0){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, explodeShow);
};
if (_arg1.target.heartState == "happy"){
i = 0;
while (i < elf_container.numChildren) {
if (_arg1.target.hitTestObject(Object(elf_container.getChildAt(i)).box)){
if (Object(elf_container.getChildAt(i)).heartState != "happy"){
if (Object(elf_container.getChildAt(i)).elfTurn == false){
Object(elf_container.getChildAt(i)).elfTurn = true;
Object(elf_container.getChildAt(i)).happyHeart.play();
baseBar.boss.hearts.play();
currentScore = (currentScore + 400);
if (Object(elf_container.getChildAt(i)).elfType == "king"){
if (Object(elf_container.getChildAt(i)).happiness < 20){
Object(elf_container.getChildAt(i)).gotoAndPlay("love");
Object(elf_container.getChildAt(i)).happiness = (Object(elf_container.getChildAt(i)).happiness + 1);
_local2 = new fxWet();
_local2.play(0, 0, soundVolume);
};
} else {
Object(elf_container.getChildAt(i)).gotoAndStop("happy");
Object(elf_container.getChildAt(i)).heartState = "happy";
};
};
};
};
i++;
};
};
}
public function cloudMove(_arg1:Event):void{
_arg1.target.x = (_arg1.target.x - _arg1.target.xMove);
if (_arg1.target.x <= -100){
_arg1.target.parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, cloudMove);
};
_arg1.target.y = (_arg1.target.startY - (happy.y / 10));
}
public function heartHitTest(_arg1:Event):void{
var _local2:fxSwish;
if (_arg1.target.enemyState == "sad"){
_local2 = new fxSwish();
_local2.play(0, 0, soundVolume);
_arg1.target.gotoAndPlay("love");
_arg1.target.enemyState = "happy";
currentScore = (currentScore + 100);
happy_enemies = (happy_enemies + 1);
i = 0;
while (i < 30) {
explodeCreate((_arg1.target.x + (_arg1.target.width / 2)), (_arg1.target.y + (_arg1.target.height / 2)), _arg1.target.xMove, _arg1.target.yMove, _arg1.target.xDir, _arg1.target.yDir, "happy");
i++;
};
};
}
public function heartReverse(_arg1:Event):void{
var _local2:fxZing;
if (_arg1.target.heartState == "happy"){
_local2 = new fxZing();
_local2.play(0, 0, soundVolume);
_arg1.target.heartState = "sad";
};
}
public function linkNewgrounds():void{
var _local1:URLRequest;
_local1 = new URLRequest("http://chromeshark.newgrounds.com");
navigateToURL(_local1, "_blank");
}
public function clickNewgrounds(_arg1:MouseEvent):void{
linkNewgrounds();
}
public function clickPrankard(_arg1:MouseEvent):void{
linkPrankard();
}
public function starCreate():void{
var _local1:happy_star;
_local1 = new happy_star();
_local1.scaleY = (_local1.scaleY / 2);
_local1.scaleX = _local1.scaleY;
_local1.x = 700;
_local1.y = (50 + (Math.random() * 250));
star_container.addChild(_local1);
_local1.addEventListener(Event.ENTER_FRAME, starMove);
}
public function enterFrameIntro(_arg1:Event):void{
if (introLogo.currentFrame == introLogo.totalFrames){
dreamlandSound = new mxDreamland();
bossSound = new mxBoss();
gotoAndStop("menu");
this.removeEventListener(Event.ENTER_FRAME, enterFrameIntro);
};
}
public function buttonRollOut(_arg1:MouseEvent):void{
_arg1.target.scaleX = 1;
_arg1.target.scaleY = 1;
}
}
}//package happyland4_fla
Section 16
//shark_animate_symbol_73 (happyland4_fla.shark_animate_symbol_73)
package happyland4_fla {
import flash.display.*;
public dynamic class shark_animate_symbol_73 extends MovieClip {
public function shark_animate_symbol_73(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package happyland4_fla
Section 17
//toaster_65 (happyland4_fla.toaster_65)
package happyland4_fla {
import flash.display.*;
public dynamic class toaster_65 extends MovieClip {
public var toaster_switch:MovieClip;
}
}//package happyland4_fla
Section 18
//toaster_switch_move_66 (happyland4_fla.toaster_switch_move_66)
package happyland4_fla {
import flash.display.*;
public dynamic class toaster_switch_move_66 extends MovieClip {
public function toaster_switch_move_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package happyland4_fla
Section 19
//tutorialText_26 (happyland4_fla.tutorialText_26)
package happyland4_fla {
import flash.display.*;
public dynamic class tutorialText_26 extends MovieClip {
public var face:MovieClip;
}
}//package happyland4_fla
Section 20
//base_bar (base_bar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class base_bar extends MovieClip {
public var sponsorButton:MovieClip;
public var buttonMusic:MovieClip;
public var stageChange:TextField;
public var happy_meter:MovieClip;
public var boss:MovieClip;
public var menuButton:MovieClip;
public var score:TextField;
public var buttonSound:MovieClip;
public var black:MovieClip;
}
}//package
Section 21
//fxEvil (fxEvil)
package {
import flash.media.*;
public dynamic class fxEvil extends Sound {
}
}//package
Section 22
//fxFlame (fxFlame)
package {
import flash.media.*;
public dynamic class fxFlame extends Sound {
}
}//package
Section 23
//fxMagic (fxMagic)
package {
import flash.media.*;
public dynamic class fxMagic extends Sound {
}
}//package
Section 24
//fxShark (fxShark)
package {
import flash.media.*;
public dynamic class fxShark extends Sound {
}
}//package
Section 25
//fxSharp (fxSharp)
package {
import flash.media.*;
public dynamic class fxSharp extends Sound {
}
}//package
Section 26
//fxSwish (fxSwish)
package {
import flash.media.*;
public dynamic class fxSwish extends Sound {
}
}//package
Section 27
//fxSwoosh (fxSwoosh)
package {
import flash.media.*;
public dynamic class fxSwoosh extends Sound {
}
}//package
Section 28
//fxTingly (fxTingly)
package {
import flash.media.*;
public dynamic class fxTingly extends Sound {
}
}//package
Section 29
//fxWet (fxWet)
package {
import flash.media.*;
public dynamic class fxWet extends Sound {
}
}//package
Section 30
//fxZing (fxZing)
package {
import flash.media.*;
public dynamic class fxZing extends Sound {
}
}//package
Section 31
//grass_animate (grass_animate)
package {
import flash.display.*;
public dynamic class grass_animate extends MovieClip {
}
}//package
Section 32
//happy_cloud (happy_cloud)
package {
import flash.display.*;
public dynamic class happy_cloud extends MovieClip {
}
}//package
Section 33
//happy_shade (happy_shade)
package {
import flash.display.*;
public dynamic class happy_shade extends MovieClip {
public function happy_shade(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30, 39, frame40, 49, frame50, 59, frame60, 69, frame70, 79, frame80);
}
function frame70(){
stop();
}
function frame80(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
function frame40(){
stop();
}
function frame50(){
stop();
}
function frame60(){
stop();
}
}
}//package
Section 34
//happy_star (happy_star)
package {
import flash.display.*;
public dynamic class happy_star extends MovieClip {
}
}//package
Section 35
//happy_sun (happy_sun)
package {
import flash.display.*;
public dynamic class happy_sun extends MovieClip {
public var body:MovieClip;
public function happy_sun(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30, 39, frame40, 49, frame50, 59, frame60, 69, frame70, 79, frame80);
}
function frame70(){
stop();
}
function frame80(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
function frame40(){
stop();
}
function frame50(){
stop();
}
function frame60(){
stop();
}
}
}//package
Section 36
//happy_toast (happy_toast)
package {
import flash.display.*;
public dynamic class happy_toast extends MovieClip {
}
}//package
Section 37
//happybot (happybot)
package {
import flash.display.*;
public dynamic class happybot extends MovieClip {
public var happyface:MovieClip;
public var wing2:MovieClip;
public var wing1:MovieClip;
public function happybot(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 38
//heart_shoot (heart_shoot)
package {
import flash.display.*;
public dynamic class heart_shoot extends MovieClip {
}
}//package
Section 39
//heart_track (heart_track)
package {
import flash.display.*;
public dynamic class heart_track extends MovieClip {
}
}//package
Section 40
//misery_elf (misery_elf)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class misery_elf extends MovieClip {
public var happyHeart:MovieClip;
public var crown:MovieClip;
public var box:MovieClip;
public function misery_elf(){
addFrameScript(0, frame1, 17, frame18, 26, frame27, 27, frame28, 37, frame38);
}
function frame18(){
gotoAndStop(this.heartState);
}
function frame1(){
stop();
this.elfTurn = false;
}
function frame27(){
gotoAndStop(this.heartState);
}
function frame28(){
stop();
this.elfTurn = false;
}
function frame38(){
stop();
this.elfTurn = false;
}
}
}//package
Section 41
//mountainBack (mountainBack)
package {
import flash.display.*;
public dynamic class mountainBack extends MovieClip {
}
}//package
Section 42
//mxBoss (mxBoss)
package {
import flash.media.*;
public dynamic class mxBoss extends Sound {
}
}//package
Section 43
//mxDreamland (mxDreamland)
package {
import flash.media.*;
public dynamic class mxDreamland extends Sound {
}
}//package
Section 44
//sad_enemy (sad_enemy)
package {
import flash.display.*;
public dynamic class sad_enemy extends MovieClip {
public var enemy:MovieClip;
public function sad_enemy(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 45
//stageSelect (stageSelect)
package {
import flash.display.*;
public dynamic class stageSelect extends MovieClip {
public var stageNum:MovieClip;
}
}//package
Section 46
//tutorialBox (tutorialBox)
package {
import flash.display.*;
public dynamic class tutorialBox extends MovieClip {
public var tutorialText:MovieClip;
}
}//package