Frame 1
function dragonTalkRand() {
if (!soundOn) {
return(undefined);
}
if (Math.random() < 0.8) {
if (stopped && (music.getVolume() == 100)) {
var _local1 = Math.round(Math.random() * 2);
if (_local1 == 0) {
sfx.attachSound("catch_me_comeon_stopped");
} else if (_local1 == 1) {
sfx.attachSound("comeon_stopped");
} else {
sfx.attachSound("follow_me_comeon_stopped");
}
} else {
var _local1 = Math.round(Math.random() * 2);
if (_local1 == 0) {
sfx.attachSound("catch_me_moving");
} else if (_local1 == 1) {
sfx.attachSound("catch_me2_moving");
} else {
sfx.attachSound("comeon2_moving");
}
}
sfx.start(0, 1);
}
}
function stopCheck() {
timeSinceMove = getTimer() - lastMoveTime;
if ((timeSinceMove > 5000) && (!restarting)) {
if (!stopped) {
stopped = true;
}
if (!noMusic) {
var _local1 = music.getVolume();
if (_local1 > 0) {
music.setVolume(music.getVolume() - 20);
} else {
noMusic = true;
music.stop();
music.setVolume(100);
}
}
}
}
function moveDragonRand() {
}
function updateTimer() {
lastMoveTime = getTimer();
}
function startMovingAgain() {
noMusic = false;
stopped = false;
music.attachSound("hh_music1");
music.stop();
music.setVolume(100);
music.start(0, 4);
}
function shootUp() {
shots++;
needle_in_mc._alpha = 100;
left_arm_mc._alpha = 0;
right_arm_mc._alpha = 0;
}
function decreaseSmack() {
if (shots == 1) {
new mx.transitions.Tween(smack_mc0, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
new mx.transitions.Tween(smack_mc1, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
} else if (shots == 2) {
new mx.transitions.Tween(smack_mc1, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
new mx.transitions.Tween(smack_mc2, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
} else if (shots == 3) {
new mx.transitions.Tween(smack_mc2, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
new mx.transitions.Tween(smack_mc3, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
} else if (shots == 4) {
new mx.transitions.Tween(smack_mc3, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
new mx.transitions.Tween(smack_mc4, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
} else if (shots == 5) {
new mx.transitions.Tween(smack_mc4, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
new mx.transitions.Tween(smack_mc5, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
}
}
function movePlayer() {
bg_mc_new_width = bg_mc._width * z_scale_change;
bg_mc_new_height = bg_mc._height * z_scale_change;
bg_x_center = (-(bg_mc_new_width - Stage.width)) / 2;
bg_y_center = (-(bg_mc_new_height - Stage.height)) / 2;
var _local2 = ((_xmouse - (Stage.width / 2)) / Stage.width) * 2;
x = x + (((_local2 * 50) * (z_scale_change - 1)) * 10);
bg_mc_new_x = bg_x_center - x;
bg_mc_new_y = bg_y_center;
var _local1 = x / bg_mc_new_width;
if (_local1 > 0.16) {
x = 0.16 * bg_mc_new_width;
bg_mc_new_x = bg_x_center - x;
}
if (_local1 < -0.16) {
x = -0.16 * bg_mc_new_width;
bg_mc_new_x = bg_x_center - x;
}
if (bg_mc_new_x > 0) {
bg_mc_new_x = 0;
}
if ((bg_mc_new_x + bg_mc_new_width) < Stage.width) {
bg_mc_new_x = Stage.width - bg_mc_new_width;
}
xScaleT = new mx.transitions.Tween(bg_mc, "_width", mx.transitions.easing.Regular.easeIn, bg_mc._width, bg_mc_new_width, moveTime, true);
yScaleT = new mx.transitions.Tween(bg_mc, "_height", mx.transitions.easing.Regular.easeIn, bg_mc._height, bg_mc_new_height, moveTime, true);
xPosT = new mx.transitions.Tween(bg_mc, "_x", mx.transitions.easing.Regular.easeIn, bg_mc._x, bg_mc_new_x, moveTime, true);
yPosT = new mx.transitions.Tween(bg_mc, "_y", mx.transitions.easing.Regular.easeIn, bg_mc._y, bg_mc_new_y, moveTime, true);
xScaleT.onMotionFinished = function () {
needle_in_mc._alpha = 0;
left_arm_mc._alpha = 100;
right_arm_mc._alpha = 100;
if (shots > 4) {
shots = 0;
restarting = true;
new mx.transitions.Tween(smack_mc0, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, moveTime, true);
new mx.transitions.Tween(smack_mc5, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, moveTime, true);
bgFadeOut = new mx.transitions.Tween(bg_mc, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, 0.8, true);
bgNewFadeIn = new mx.transitions.Tween(bg_mc_new, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, 0.4, true);
bgFadeOut.onMotionFinished = function () {
bg_mc._x = 0;
bg_mc._y = 0;
bg_mc._width = Stage.width;
bg_mc._height = Stage.height;
bg_mc._alpha = 100;
bg_mc_new._alpha = 0;
updateTimer();
restarting = false;
};
}
};
}
function moveDragon() {
var _local1;
if (Math.random() < 0.5) {
_local1 = 1;
} else {
_local1 = 0.1;
}
var _local3 = (-0.25 + (Math.random() / 2)) * _local1;
dragon_z = dragon_z + _local3;
if (dragon_z < 0.5) {
dragon_z = 0.5;
}
if (dragon_z > 1) {
dragon_z = 1;
}
dragon_mc1_new_width = dragon_max_width * dragon_z;
dragon_mc1_new_height = dragon_max_height * dragon_z;
var _local4 = Stage.width - dragon_mc1._width;
var _local5 = (Stage.height * 0.8) - dragon_mc1._height;
var _local2 = (0.5 + dragon_z) / 1.5;
dragon_mc1_new_x = (((1 - (_local2 * _local1)) * _local4) / 2) + (((Math.random() * _local4) * _local2) * _local1);
dragon_mc1_new_y = (((1 - (_local2 * _local1)) * _local5) / 2) + (((Math.random() * _local5) * _local2) * _local1);
var _local6 = Math.pow((Math.pow(dragon_mc1._x - dragon_mc1_new_x, 2) + Math.pow(dragon_mc1._y - dragon_mc1_new_y, 2)) + Math.pow(_local3 * 300, 2), 0.333333333333333);
moveTimeDragon = (moveTimeDragonBase * (_local6 / 15)) * (1 / (dragon_z + (_local3 / 2)));
new mx.transitions.Tween(dragon_mc1, "_width", mx.transitions.easing.Regular.easeIn, dragon_mc1._width, dragon_mc1_new_width, moveTimeDragon, true);
new mx.transitions.Tween(dragon_mc1, "_height", mx.transitions.easing.Regular.easeIn, dragon_mc1._height, dragon_mc1_new_height, moveTimeDragon, true);
new mx.transitions.Tween(dragon_mc1, "_x", mx.transitions.easing.Regular.easeIn, dragon_mc1._x, dragon_mc1_new_x, moveTimeDragon, true);
new mx.transitions.Tween(dragon_mc1, "_y", mx.transitions.easing.Regular.easeIn, dragon_mc1._y, dragon_mc1_new_y, moveTimeDragon, true);
moveDragonTimer = setTimeout(moveDragon, moveTimeDragon * 1000);
}
var xScaleT;
var yScaleT;
var xPosT;
var yPosT;
var bgFadeOut;
var bgNewFadeIn;
var x = 0;
var y = 0;
var z_scale_change = 1.2;
var restarting = false;
var moveTime = 0.8;
var moveTimeDragonBase = 0.6;
var shots = 0;
var dragon_z = 1;
var dragon_max_width = 360;
var dragon_max_height = 305;
var musicLoopPos = 0;
var music = new Sound(this);
var sfx = new Sound(this);
var stopped = false;
var lastMoveTime = getTimer();
var noMusic = false;
var dragonMoveFactor = 0.5;
var soundOn = true;
var moveDragonTimer;
var aboutOpen = false;
aboutButton1.onPress = function () {
clearTimeout(moveDragonTimer);
music.stop();
sfx.stop();
soundOn = false;
gotoAndStop ("about");
};
music.onSoundComplete = function () {
if (!soundOn) {
return(undefined);
}
musicLoopPos++;
if (musicLoopPos > 2) {
musicLoopPos = 1;
}
if (musicLoopPos == 0) {
music.attachSound("hh_music1");
}
if (musicLoopPos == 1) {
music.attachSound("hh_music2");
} else if (musicLoopPos == 2) {
music.attachSound("hh_music3");
}
music.start(0, 4);
};
music.attachSound("hh_music1");
music.start(0, 4);
if (init == undefined) {
var dragonTalkTimer = setInterval(dragonTalkRand, 2500);
}
init = false;
var stopCheckTimer = setInterval(stopCheck, 500);
moveDragonTimer = setTimeout(moveDragon, moveTimeDragonBase * 1000);
onMouseDown = function () {
if ((((_xmouse >= aboutButton1._x) && (_xmouse <= (aboutButton1._x + aboutButton._width))) && (_ymouse >= aboutButton1._y)) && (_ymouse <= (aboutButton1._y + aboutButton._height))) {
return(undefined);
}
if (restarting) {
return(undefined);
}
if (stopped) {
startMovingAgain();
}
updateTimer();
shootUp();
movePlayer();
decreaseSmack();
};
stop();
Frame 10
var init = false;
backButton1.onPress = function () {
soundOn = true;
gotoAndStop ("start");
};
Symbol 55 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 56 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 57 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 58 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}