Frame 1
stage.showMenu = false;
Frame 2
MovieClip.prototype.dynTween = function (tween_objects) {
var te = this.createEmptyMovieClip("tweenEngine", 20002);
var h = ((te.holder = new TweensHolder()));
var _local1 = arguments.length;
var _local2 = h.tweens;
var _local3 = Tween;
while (_local1) {
_local1--;
_local2.unshift(new _local3[undefined](this, arguments[_local1]));
}
h.begin();
};
MovieClip.prototype.reset = function (initObj) {
var _local1 = initObj;
var _local2 = this;
delete eval (_local2.tweenEngine.removeMovieClip());
if (_local1) {
for (var _local3 in _local1) {
_local2[_local3] = _local1[_local3];
}
}
};
ASSetPropFlags(MovieClip.prototype, ["dynTween", "reset"], 1);
_global.TweensHolder = function () {
this.tweens = [];
};
TweensHolder.prototype.begin = function () {
var t = this.tweens.shift();
var _local2 = t.props;
for (var _local3 in _local2) {
if (_local3.substr(0, 6) == "method") {
var _local1 = _local2[_local3];
_local1.end.apply(_local1.strength, _local1.ease);
}
}
t.setUp();
this.cnt = 0;
this.startTime = getTimer();
t.run(this);
};
_global.Tween = function (mc, tObj) {
this.init(mc, tObj);
};
Tween.prototype.init = function (mc, tObj) {
this.mc = mc;
(this.dur = tObj.dur);
delete tObj.dur;
if (tObj.callback != null) {
this.callback = tObj.callback;
delete tObj.callback;
}
if (tObj.cbArgs != null) {
this.cbArgs = tObj.cbArgs;
delete tObj.cbArgs;
}
this.props = {};
for (var i in tObj) {
var _local1 = tObj[i];
var _local2 = (this.props[i] = {});
if (typeof(_local1) == "number") {
_local2.end = _local1;
_local2.ease = "none";
} else {
_local2.end = _local1[0];
if (_local1[1] == null) {
_local2.ease = "none";
} else {
_local2.ease = _local1[1];
var _local3 = Tween.MAX_EASING;
if (typeof(_local1[2]) == "movieclip") {
_local2.strength = _local1[2];
} else {
_local2.strength = (_local1[2] ? ((((_local3 - 1) * _local1[2]) / 100) + 1) : (_local3 / 2));
}
}
}
}
};
Tween.prototype.setUp = function () {
var _local2 = this.props;
var _local3 = this.mc;
for (var i in _local2) {
var _local1 = _local2[i];
_local1.val = _local1.end - ((_local1.bgn = _local3[i]));
}
};
Tween.prototype.run = function (holder) {
var o = this;
var mc = o.mc;
var d = o.dur;
var props = o.props;
mc.tweenEngine.onEnterFrame = function () {
var c = (getTimer() - holder.startTime);
if (c <= d) {
for (var i in props) {
var p = props[i];
mc[i] = o[p.ease](c, p.bgn, p.val, d, p.strength);
}
} else {
for (var i in props) {
var p = props[i];
mc[i] = p.end;
}
if (holder.tweens.length) {
holder.begin();
} else {
mc.reset();
}
eval (o.callback)(o.cbArgs);
}
};
};
Tween.MAX_EASING = 8;
Tween.prototype.none = function (c, b, v, d) {
return(b + ((v * c) / d));
};
Tween.prototype.in = function (c, b, v, d, s) {
return(b + (v * Math.pow(c / d, s)));
};
Tween.prototype.out = function (c, b, v, d, s) {
return(b + (v * (1 - Math.pow(1 - (c / d), s))));
};
Tween.prototype.inOut = function (c, b, v, d, s) {
var _local1 = v;
var _local2 = d;
var _local3 = c;
_local2 = _local2 / 2;
if (_local3 <= _local2) {
return(b + ((_local1 / 2) * Math.pow(_local3 / _local2, s)));
}
return((b + _local1) - ((_local1 / 2) * Math.pow(2 - (_local3 / _local2), s)));
};
Tween.prototype.outIn = function (c, b, v, d, s) {
var _local1 = d;
var _local2 = c;
_local1 = _local1 / 2;
if (_local2 <= _local1) {
return(b + ((v / 2) * (1 - Math.pow(1 - (_local2 / _local1), s))));
}
return(b + ((v / 2) * (1 + Math.pow((_local2 / _local1) - 1, s))));
};
Tween.prototype.easeInBack = function (t, b, c, d, s) {
var _local1 = s;
var _local2 = t;
if (_local1 == undefined) {
_local1 = 1.70158;
}
_local2 = _local2 / d;
return((((c * _local2) * _local2) * (((_local1 + 1) * _local2) - _local1)) + b);
};
Tween.prototype.easeOutBounce = function (t, b, c, d) {
var _local1 = t;
var _local2 = c;
var _local3 = b;
_local1 = _local1 / d;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
};
function local2global(trg) {
var _local1 = trg;
point = new Object();
point.x = _local1._x;
point.y = _local1._y;
_local1._parent.localToGlobal(point);
return([point.x, point.y]);
}
var promo = 2;
var officialLink = "http://video.movies.go.com/mulan2/";
var officialLinkWindow = "_blank";
var aimLink = "aim:goim?message=Check+Out+The+Fire+Away+Game+For+Mulan+2+http://www.mulan2.com";
var aimLinkWindow = "";
var arrows2start = 3;
var addArrowEvery = 50;
var advanceEvery = 500;
var gPower = 0;
var gRound = 0;
var gArrows = 0;
var gScore = 0;
var gAngle = 0;
var gRotBy = 0;
var rad = 0.0174603174603175;
var gameControls = new Object();
gameControls.onKeyDown = function () {
if (Key.isDown(39)) {
setPower(1);
} else if (Key.isDown(37)) {
setPower(-1);
} else if (Key.isDown(38)) {
setMulan(1);
} else if (Key.isDown(40)) {
setMulan(-1);
} else if (Key.isDown(32)) {
fireAway();
}
};
gameControls.onKeyUp = function () {
gRotBy = 0;
};
function initGame(wait) {
var _local3 = this;
trace("init");
gStarted = true;
gScore = 0;
gArrows = arrows2start;
if (wait) {
gRound = 0;
gotoAndStop ("initGame");
var _local2 = [overlay.rnd, overlay.top2, overlay.top1, overlay.m2];
for (var it in _local2) {
_local2[it].y = _local2[it]._y;
_local2[it]._y = _local2[it]._y - 75;
}
var _local1 = [overlay.powerMC, overlay.arrowsMC, overlay.scoreMC, overlay.bot2, overlay.bot3, overlay.m1];
for (var it in _local1) {
_local1[it].y = _local1[it]._y;
_local1[it]._y = _local1[it]._y + 75;
}
overlay.m1.x = overlay.m1._x;
overlay.m2.x = overlay.m2._x;
overlay.m1._y = overlay.m1._y + 100;
overlay.m2._y = overlay.m2._y - 100;
overlay.m0.y = overlay.m0._y;
overlay.m0.x = overlay.m0._x;
overlay.m3.x = overlay.m3._x;
overlay.m3.y = overlay.m3._y;
overlay.m3._x = overlay.m3._x + 175;
overlay.m0._x = overlay.m0._x - 175;
sunRayMC._alpha = 0;
overlay.top2.gotoAndStop(promo);
overlay.bot2.gotoAndStop(promo);
overlay.bot2.dynTween({dur:500}, {dur:500, _y:[overlay.bot2.y, "easeOutBounce"]});
overlay.bot3.onRollOver = (overlay.bot3.onDragOver = function () {
var _local1 = this;
if (_local1._y == _local1.y) {
_local1.dynTween({dur:300, _xscale:[110, "out"], _yscale:[110, "out"]});
}
});
overlay.bot3.onRollOut = (overlay.bot3.onDragOut = function () {
var _local1 = this;
if (_local1._y == _local1.y) {
_local1.dynTween({dur:300, _xscale:[100, "out"], _yscale:[100, "out"]});
}
});
overlay.bot3.onPress = function () {
};
overlay.bot3.onRelease = function () {
_root.hbcode.gotoAndPlay(2);
};
bBg.playNowMC.onRollOver = (bBg.playNowMC.onDragOver = function () {
this.gotoAndPlay("over");
});
bBg.playNowMC.onRollOut = (bBg.playNowMC.onDragOut = function () {
this.gotoAndPlay("out");
});
bBg.playNowMC.onRelease = function () {
this.onRelease = null;
play();
};
} else {
gotoAndPlay ("initGame");
}
}
function startGame() {
var all = gStarted;
if (gStarted) {
gStarted = false;
overlay.scoreMC.txtMC.txt.text = gScore;
}
gRound++;
gScoreThisRound = 0;
for (var it in bgs) {
bgs[it]._visible = 0;
}
var bg = bgs["bg" + gRound];
bg._visible = 1;
bgs._alpha = 0;
bgs.dynTween({dur:1500, _alpha:[100, "out"]});
bg.bg.dynTween({dur:200}, {dur:1000, _y:[bg.bg._y, "out"]});
bg.bg._y = bg.bg._y + 50;
bg.fg.dynTween({dur:200}, {dur:1000, _y:[bg.fg._y, "out"]});
bg.fg._y = bg.fg._y + 100;
if (gRound == 2) {
bg.bg.gotoAndStop(2);
sunRayMC.dynTween({dur:200}, {dur:1000, _alpha:[100, "out"]});
}
overlay.powerMC.bar._xscale = 1;
overlay.rnd.gotoAndStop(gRound);
overlay.arrowsMC.txtMC.txt.text = gArrows;
var delay = 100;
var _local1 = 1000;
var offset = 75;
overlay.bot2.dynTween({dur:500, _y:[overlay.bot2.y + offset, "out"]});
overlay.bot3.reset();
overlay.bot3.dynTween({dur:500, _y:[overlay.bot3.y + offset, "out"]});
var _local3 = (all ? ([overlay.rnd, overlay.top2, overlay.top1]) : ([overlay.rnd]));
for (var it in _local3) {
_local3[it].dynTween({dur:_local1}, {dur:500, _y:[_local3[it].y, "easeOutBounce"]});
_local1 = _local1 + delay;
}
var _local2 = [overlay.powerMC, overlay.arrowsMC, overlay.scoreMC];
for (var it in _local2) {
_local2[it].dynTween({dur:_local1}, {dur:500, _y:[_local2[it].y, "easeOutBounce"]});
_local1 = _local1 + delay;
}
_local1 = _local1 + delay;
mulanComp.dynTween({dur:_local1}, {dur:500, _x:[20, "out"]});
mulanComp._x = -mulanComp._width;
if (gRound == 3) {
bg.trg._y = -60;
bg.dynTween({dur:_local1}, {dur:0, method1:[startMoveTarget, [bg.trg], this]});
} else {
bg.trg._y = random(135) + 110;
trace(bg.trg._y);
bg.trg.dynTween({dur:_local1}, {dur:500, _x:[bg.trg._x, "out"]});
bg.trg._x = bg.trg._x + 140;
}
this.dynTween({dur:_local1 + 500}, {dur:0, method1:[startAction, "", this]});
}
function startMoveTarget(trg) {
trace("restart the interval");
if (intervalID != null) {
clearInterval(intervalID);
intervalID = null;
}
intervalID = setInterval(moveTarget, 1000, trg);
moveTarget(trg);
}
function moveTarget(trg) {
trg.dynTween({dur:800, _y:[random(135) + 110, "inOut"]});
}
function upScore(n, pos) {
var _local2 = n;
trace("add to score:" + _local2);
var _local1 = this.attachMovie("score2MC", "score2MC", 1);
_local1.txt = _local2;
_local1._x = pos._x;
_local1._y = pos._y;
deltaAdd = deltaAdd + _local2;
while (deltaAdd >= addArrowEvery) {
deltaAdd = deltaAdd - addArrowEvery;
gArrows++;
}
overlay.arrowsMC.txtMC.txt.text = gArrows;
gScore = gScore + _local2;
overlay.scoreMC.txtMC.txt.text = gScore;
gScoreThisRound = gScoreThisRound + _local2;
var _local3 = false;
if ((gScoreThisRound >= advanceEvery) && (gRound < 3)) {
this.dynTween({dur:1000}, {dur:0, method1:[advanceGame, [], this]});
_local3 = true;
}
return(_local3);
}
function advanceGame() {
bBg.gotoAndStop(2);
animateOutHandle(setupCont);
bBg.contMC._visible = 0;
}
function finishGame() {
if (gRound >= 2) {
(bBg.gotoAndStop(4));// not popped
} else {
(bBg.gotoAndStop(3));// not popped
}
animateOutHandle(setupPA);
bBg.replayRound._visible = (bBg.playAgain._visible = 0);
bBg.txt.text = gScore;
}
function setupPA() {
var _local1 = this;
bBg.playAgain._visible = 1;
bBg.playAgain.gotoAndPlay(1);
bBg.playAgain.mc.gotoAndStop(2);
bBg.playAgain.onRollOver = (bBg.playAgain.onDragOver = function () {
this.gotoAndPlay("over");
});
bBg.playAgain.onRollOut = (bBg.playAgain.onDragOut = function () {
this.gotoAndPlay("out");
});
bBg.playAgain.onRelease = function () {
this.onRelease = null;
gRound = 0;
initGame();
};
bBg.replayRound._visible = 1;
bBg.replayRound.gotoAndPlay(1);
bBg.replayRound.mc.gotoAndStop(4);
bBg.replayRound.onRollOver = (bBg.replayRound.onDragOver = function () {
this.gotoAndPlay("over");
});
bBg.replayRound.onRollOut = (bBg.replayRound.onDragOut = function () {
this.gotoAndPlay("out");
});
bBg.replayRound.onRelease = function () {
this.onRelease = null;
gRound--;
initGame();
};
}
function setupCont() {
var _local1 = this;
bBg.contMC._visible = 1;
bBg.contMC.gotoAndPlay(1);
bBg.contMC.mc.gotoAndStop(3);
bBg.contMC.onRollOver = (bBg.contMC.onDragOver = function () {
this.gotoAndPlay("over");
});
bBg.contMC.onRollOut = (bBg.contMC.onDragOut = function () {
this.gotoAndPlay("out");
});
bBg.contMC.onRelease = function () {
this.onRelease = null;
startGame();
};
}
function animateOutHandle(f) {
if (intervalID != null) {
clearInterval(intervalID);
intervalID = null;
}
if (arrowGrp.arrowGr._name != null) {
arrowGrp.arrowGr.removeMovieClip();
}
var delay = 100;
var _local1 = 500;
var offset = 75;
mulanComp.dynTween({dur:_local1}, {dur:500, _x:[-(mulanComp._width + 40), "out"]});
bgs["bg" + gRound].trg.dynTween({dur:_local1}, {dur:500, _x:[bgs["bg" + gRound].trg._x + 140, "out"]});
sunRayMC.dynTween({dur:_local1}, {dur:500, _alpha:[0, "out"]});
_local1 = _local1 + 1000;
var _local3 = [overlay.rnd];
for (var it in _local3) {
_local3[it].dynTween({dur:_local1}, {dur:500, _y:[_local3[it]._y - offset, "out"]});
_local1 = _local1 + delay;
}
var _local2 = [overlay.powerMC, overlay.arrowsMC, overlay.scoreMC];
for (var it in _local2) {
_local2[it].dynTween({dur:_local1}, {dur:500, _y:[_local2[it]._y + offset, "out"]});
_local1 = _local1 + delay;
}
overlay.bot3.dynTween({dur:_local1}, {dur:500, _y:[overlay.bot3.y, "easeOutBounce"]});
bgs.dynTween({dur:_local1}, {dur:1500, _alpha:[0, "out"]});
bBg.dynTween({dur:_local1 + 500}, {dur:0, method1:[f, [], this]});
}
stop();
this.onEnterFrame = function () {
var _local3 = _root.getBytesLoaded();
var _local1 = _root.getBytesTotal();
var _local2 = Math.ceil((_local3 / _local1) * 100);
if (_local3 == _local1) {
loaderMC._visible = 0;
this.onEnterFrame = undefined;
initGame(true);
} else {
loaderMC.txt = _local2 + "%";
loaderMC.gotoAndStop(_local2);
}
};
function startAction(moveTrg) {
if (arrowGrp.arrowGr._name != null) {
arrowGrp.arrowGr.removeMovieClip();
}
Key.addListener(gameControls);
gPower = 2;
overlay.powerMC.bar.dynTween({dur:500, _xscale:[gPower * 25, "out"]});
mulanComp.top.power.gotoAndStop(gPower);
if (moveTrg) {
if (gRound == 3) {
startMoveTarget(bgs["bg" + gRound].trg);
} else {
bgs["bg" + gRound].trg.dynTween({dur:500, _y:[random(135) + 110, "out"]});
}
}
gAngle = 0;
}
function setPower(n) {
var _local1 = n;
if (((gPower + _local1) > 0) && ((gPower + _local1) < 5)) {
gPower = gPower + _local1;
overlay.powerMC.bar.dynTween({dur:500, _xscale:[gPower * 25, "out"]});
mulanComp.top.power.gotoAndStop(gPower);
}
}
function setMulan(n) {
if ((gRotBy < 4) && (gRotBy > -4)) {
gRotBy = gRotBy + n;
}
if (((gAngle + gRotBy) >= 0) && ((gAngle + gRotBy) <= 45)) {
gAngle = gAngle + gRotBy;
mulanComp.top.dynTween({dur:300, _rotation:[-gAngle, "out"]});
}
}
function fireAway() {
var _local1 = this;
Key.removeListener(gameControls);
releaseSnd.releaseSnd.start(0.5);
var _local3 = local2global(mulanComp.top.power.arrow);
var _local2 = arrowGrp.attachMovie("arrowGr", "arrowGr", 0);
_local2._xscale = (_local2._yscale = 50);
_local2._rotation = -gAngle;
_local2._x = _local3[0];
_local2._y = _local3[1];
_local2.dist = 10 + (gPower * 10);
_local2.trg = bgs["bg" + gRound].trg;
_local2.hitSomething = 0;
_local2.hitNothing = false;
_local2.onEnterFrame = function () {
var _local1 = this;
_local1.dist = _local1.dist - 0.2;
_local1._rotation = _local1._rotation + 2;
var _local3 = Math.cos((-_local1._rotation) * rad);
var _local2 = Math.sin((-_local1._rotation) * rad);
_local1._x = _local1._x + (_local1.dist * _local3);
_local1._y = _local1._y - (_local1.dist * _local2);
if (bgs["bg" + gRound].bg.collisionMC.hitTest(_local1._x, _local1._y, true)) {
_local1.hitSomething = 2;
} else if (((((_local1._x + 30) > _local1.trg._x) && (_local1._y > (_local1.trg._y - 65))) && (_local1._y < (_local1.trg._y + 65))) && (!_local1.hitNothing)) {
_local1.hitSomething = 1;
_local1._x = _local1.trg._x - 30;
} else if ((_local1._x + 30) > _local1.trg._x) {
_local1.hitNothing = true;
}
if (((_local1.hitSomething > 0) || (_local1._x > 850)) || (_local1._y > 400)) {
if (intervalID != null) {
clearInterval(intervalID);
intervalID = null;
bgs["bg" + gRound].trg.reset();
}
_local1.play();
_local1.onEnterFrame = null;
assignPoints(_local1.hitSomething == 1, Math.abs(_local1._y - _local1.trg._y), _local1);
}
};
overlay.powerMC.bar.dynTween({dur:500, _xscale:[0, "out"]});
mulanComp.top.power.gotoAndStop(5);
}
function assignPoints(hit, d, pos) {
var _local3 = d;
var _local1 = false;
if (hit) {
if (_local3 < 10) {
_local1 = upScore(100, pos);
} else if (_local3 < 22) {
_local1 = upScore(75, pos);
} else if (_local3 < 40) {
_local1 = upScore(50, pos);
} else if (_local3 < 60) {
_local1 = upScore(25, pos);
}
hitSnd.hitSnd.start(0.1);
} else {
missSnd.missSnd.start();
var _local2 = random(4);
overlay["m" + _local2].dynTween({dur:300, _y:[overlay["m" + _local2].y, "easeOutBounce"], _x:[overlay["m" + _local2].x, "easeOutBounce"]}, {dur:1000}, {dur:300, _x:[overlay["m" + _local2]._x, "out"], _y:[overlay["m" + _local2]._y, "out"]});
}
mulanComp.top.dynTween({dur:1000}, {dur:300, _rotation:[30, "out"]}, {dur:1000, method1:[loadArrow, [_local1], this], _rotation:[0, "out"]});
}
function loadArrow(wt) {
if ((--gArrows) >= 0) {
overlay.arrowsMC.txtMC.txt.text = gArrows;
mulanComp.top.power.gotoAndStop(1);
if (!wt) {
startAction(true);
}
} else {
finishGame();
}
}
Frame 3
stop();
Instance of Symbol 162 MovieClip "hitSnd" in Frame 4
onClipEvent (load) {
hitSnd = new Sound(this);
hitSnd.attachSound("hitSnd");
}
Instance of Symbol 162 MovieClip "releaseSnd" in Frame 4
onClipEvent (load) {
releaseSnd = new Sound(this);
releaseSnd.attachSound("releaseSnd");
}
Instance of Symbol 162 MovieClip "missSnd" in Frame 4
onClipEvent (load) {
missSnd = new Sound(this);
missSnd.attachSound("missSnd");
missSnd.setVolume(20);
}
Frame 5
startGame();
Frame 12
prevFrame();
Symbol 7 MovieClip [score2MC] Frame 25
this.removeMovieClip();
Symbol 16 MovieClip [loader] Frame 1
stop();
Symbol 24 Button
on (release) {
getURL ("javascript:self.close();");
}
Symbol 28 Button
on (release) {
getURL ("javascript:self.close();");
}
Symbol 30 MovieClip Frame 1
this._visible = 0;
stop();
Symbol 30 MovieClip Frame 2
getURL ("javascript:_hbPageView (\"friend+pop2\", \"/mulan+2/generate+awareness/information/misc;/generate+awareness/information/dvp/mulan+2/misc\")");
Symbol 30 MovieClip Frame 10
getURL (_root.aimLink, _root.aimLinkWindow);
this._visible = 0;
stop();
Symbol 35 MovieClip [arrowGr] Frame 1
stop();
Symbol 35 MovieClip [arrowGr] Frame 15
stop();
Symbol 60 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 1
stop();
Symbol 145 MovieClip [playNowAnim] Frame 19
stop();
Symbol 145 MovieClip [playNowAnim] Frame 24
stop();
Symbol 145 MovieClip [playNowAnim] Frame 30
stop();
Symbol 158 MovieClip Frame 1
stop();
Instance of Symbol 145 MovieClip [playNowAnim] "playNowMC" in Symbol 158 MovieClip Frame 1
onClipEvent (load) {
trace(":" + this);
}