Frame 1
function initSoundPlayer() {
soundBaseMC = this.createEmptyMovieClip("sounds", 999999);
soundBaseMC.sounds = [];
soundBaseMC.soundChan = 0;
soundBaseMC.soundLevel = 80;
soundBaseMC.muted = 0;
var _local2 = 0;
while (_local2 < 16) {
tMC = soundBaseMC.createEmptyMovieClip("sound" + _local2, _local2 + 99900);
tMC.soundObj = new Sound(tMC);
soundBaseMC.sounds.push(tMC.soundObj);
_local2++;
}
tMC = soundBaseMC.createEmptyMovieClip("music", 99899);
soundBaseMC.musicChan = new Sound(tMC);
}
function playMusic(aSndName) {
soundBaseMC.musicChan.stop();
soundBaseMC.musicChan.attachSound(aSndName);
if (soundBaseMC.muted) {
return(undefined);
}
soundBaseMC.musicChan.start(0, 60);
soundBaseMC.musicChan.setVolume(40);
}
function stopMusic() {
soundBaseMC.musicChan.stop();
}
function playSnd(aSndName, sndLevel) {
if (soundBaseMC.muted) {
return(undefined);
}
var _local1 = soundBaseMC.sounds[soundBaseMC.soundChan];
_local1.stop();
_local1.attachSound(aSndName);
if (aSndName == "Window") {
windowBrokeSnd = soundBaseMC.soundChan;
}
_local1.setVolume(sndLevel);
_local1.start();
soundBaseMC.soundChan++;
if (soundBaseMC.soundChan >= soundBaseMC.sounds.length) {
soundBaseMC.soundChan = 0;
}
}
function setAllVolume(newLevel) {
var _local1 = 0;
while (_local1 < soundBaseMC.sounds.length) {
soundBaseMC.sounds[_local1].setVolume(newLevel);
_local1++;
}
}
function toggleMute(force) {
if (force != undefined) {
soundBaseMC.muted = force;
} else {
soundBaseMC.muted = 1 - soundBaseMC.muted;
}
if (soundBaseMC.muted) {
stopAllSounds();
soundBaseMC.musicChan.stop();
} else {
soundBaseMC.musicChan.start(0, 16);
}
muteMC.gotoAndStop(1 + soundBaseMC.muted);
}
var HighScoreN = 0;
var windowBrokeSnd = 0;
initSoundPlayer();
Frame 2
stop();
var d = 10;
onEnterFrame = function () {
d--;
if (d) {
return(undefined);
}
LoaderB.gotoAndStop(LoaderB._currentframe + 1);
d = [5, 11, 17, 25][Math.floor(Math.random() * 4)];
if (LoaderB._currentframe == 14) {
LoaderB.gotoAndStop(1);
onEnterFrame = undefined;
delete onEnterFrame;
play();
}
};
Frame 3
stop();
Frame 4
stop();
Frame 5
function RecieveKey(nKeyCode, nKeyASC) {
NARC.text = String(nKeyCode);
if (nKeyCode == 32) {
nLastKey = 32;
ExecuteKey();
}
}
function ExecuteKey() {
nMainFrame = _currentframe;
if ((nMainFrame == 6) && (nInputLock == 0)) {
if (nLastKey == 32) {
if (TimerStarted == 0) {
TimerStarted = getTimer();
}
nInputLock = 1;
SliderStarted = 1;
}
}
}
function ExecuteGame() {
if (GameStarted == 1) {
if (SliderStarted == 1) {
MoveSlider();
MoveArms();
}
} else if (SliderStarted == 2) {
if (Arms._y < 474) {
Arms._y = Arms._y + 16;
} else {
var _local3 = tv_throw._y - tv_throw.destY;
var _local1 = Math.abs(tv_throw._x - tv_throw.destX);
var _local4 = tv_throw._xscale - tv_throw.destScale;
if (slider._x > 320) {
tv_throw._x = tv_throw._x + (_local1 / tv_throw.dividend);
tv_throw._rotation = tv_throw._rotation + 5;
} else {
tv_throw._x = tv_throw._x - (_local1 / tv_throw.dividend);
tv_throw._rotation = tv_throw._rotation - 5;
}
tv_throw._y = tv_throw._y - (_local3 / tv_throw.dividend);
tv_throw._xscale = tv_throw._xscale - (_local4 / tv_throw.dividend);
tv_throw._yscale = tv_throw._xscale;
tv_throw.dividend--;
if (tv_throw.dividend == 1) {
destructable_f.swapDepths(depthNew);
runPOPup(tv_throw.whatHit);
if (tv_throw.whatHit == "painting_L") {
destruct_BG.painting_L.gotoAndStop(2);
}
if (tv_throw.whatHit == "painting_R") {
destruct_BG.painting_R.gotoAndStop(2);
}
if (tv_throw.whatHit == "Lamp") {
if (destructable_f.Lamp._currentframe == 1) {
destructable_f.Lamp.gotoAndPlay(2);
playSnd("Window2", 100);
}
tv_throw.whatHit = "Wall";
depthNew = 10;
tv_throw.gotoAndStop(1);
tv_throw.destScale = 40;
tv_throw.dividend = 10;
tv_throw.destY = 282;
tv_throw.destX = 115;
} else {
if (tv_throw.whatHit == "Window") {
destructable_m.swapDepths(depthNew - 1);
var _local2 = ["Window", "Window3"][Math.floor(Math.random() * 2)];
if (destruct_BG.windowD._currentframe != 2) {
playSnd(_local2, 100);
}
tv_throw.destY = tv_throw._y + 500;
tv_throw.destScale = 0;
destruct_BG.windowD.gotoAndStop(2);
tv_throw.dividend = 40;
} else {
tv_throw.destY = 444;
tv_throw.gotoAndStop(2);
tv_throw.dividend = 20;
}
SliderStarted = 3;
}
}
}
} else {
playHitAnim();
}
if (TimerStarted != 0) {
curTime = timerStart - Math.floor((getTimer() - TimerStarted) * 0.001);
if (curTime >= 0) {
timerUpdate(curTime);
} else if (SliderStarted < 2) {
destructable_f.swapDepths(depthOld);
destructable_m.swapDepths(depthOld2);
GameStarted = 1;
gameEnd();
}
}
}
function MoveSlider() {
slider._x = slider._x + SliderAccel;
if ((SliderAccel > 20) && (slider._x > 346)) {
SliderAccel--;
}
if ((SliderAccel < -20) && (slider._x < 294)) {
SliderAccel++;
}
if ((SliderAccel < 0) && (slider._x > 346)) {
SliderAccel--;
}
if ((SliderAccel > 0) && (slider._x < 294)) {
SliderAccel++;
}
if (slider._x >= (slider_Bar._x + (slider_Bar._width - 2))) {
slider._x = slider_Bar._x + (slider_Bar._width - 2);
SliderAccel = -20;
}
if (slider._x <= (slider_Bar._x + 2)) {
slider._x = slider_Bar._x + 2;
SliderAccel = 20;
}
}
function MoveArms() {
if (SliderAccel > 0) {
Arms._rotation = Arms._rotation + 0.2;
Arms._x = Arms._x + 5;
if (Arms._rotation >= 0) {
Arms._y = Arms._y + 3;
} else {
Arms._y = Arms._y - 3;
}
} else {
Arms._rotation = Arms._rotation - 0.2;
Arms._x = Arms._x - 5;
if (Arms._rotation >= 0) {
Arms._y = Arms._y - 3;
} else {
Arms._y = Arms._y + 3;
}
}
}
function executeThrow() {
ArmsYrestart = Arms._y;
tv_throw._x = Arms._x;
Bill_array[1][0]++;
depthOld = destructable_f.getDepth();
depthOld2 = destructable_m.getDepth();
depthNew = 10;
if ((slider._x >= 285) && (slider._x <= 350)) {
tv_throw.whatHit = "Window";
var _local2 = 0;
i = 0;
while (i < Bill_array.length) {
var _local1 = Bill_array[0][i].substr(0, Bill_array[0][i].indexOf(":"));
if (_local1 == tv_throw.whatHit) {
_local2++;
break;
}
i++;
}
if (_local2 == 0) {
Bill_array[0].push(tv_throw.whatHit + ": ");
Bill_array[1].push(1);
Bill_array[2].push(500);
}
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = tv_throw._x;
tv_throw.destY = 120 + (Math.random() * 100);
}
if ((slider._x >= 215) && (slider._x < 285)) {
depthNew = depthOld;
tv_throw.whatHit = "Lamp";
var _local2 = 0;
i = 0;
while (i < Bill_array.length) {
var _local1 = Bill_array[0][i].substr(0, Bill_array[0][i].indexOf(":"));
if (_local1 == tv_throw.whatHit) {
_local2++;
break;
}
i++;
}
if (_local2 == 0) {
Bill_array[0].push(tv_throw.whatHit + ": ");
Bill_array[1].push(1);
Bill_array[2].push(40);
}
tv_throw.destScale = 80;
tv_throw.dividend = 14;
tv_throw.destX = 170;
tv_throw.destY = 336;
}
if ((slider._x >= 92) && (slider._x <= 121)) {
tv_throw.whatHit = "painting_L";
var _local2 = 0;
i = 0;
while (i < Bill_array.length) {
if (Bill_array[0][i] == "Painting_L: ") {
_local2++;
break;
}
i++;
}
if (_local2 == 0) {
Bill_array[0].push("Painting_L: ");
Bill_array[1].push(1);
Bill_array[2].push(200);
}
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = 32;
tv_throw.destY = 171;
}
if ((slider._x >= 518) && (slider._x <= 547)) {
tv_throw.whatHit = "painting_R";
var _local2 = 0;
i = 0;
while (i < Bill_array.length) {
if (Bill_array[0][i] == "Painting_R: ") {
_local2++;
break;
}
i++;
}
if (_local2 == 0) {
Bill_array[0].push("Painting_R: ");
Bill_array[1].push(1);
Bill_array[2].push(200);
}
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = 596;
tv_throw.destY = 180;
}
if (slider._x < 92) {
tv_throw.whatHit = "Wall";
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = -75;
tv_throw.destY = 258;
}
if (slider._x > 547) {
tv_throw.whatHit = "Wall";
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = 718;
tv_throw.destY = 272;
}
if ((slider._x > 121) && (slider._x < 215)) {
tv_throw.whatHit = "Wall";
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = 147;
tv_throw.destY = 6;
}
if ((slider._x > 350) && (slider._x < 518)) {
tv_throw.whatHit = "Wall";
tv_throw.destScale = 50;
tv_throw.dividend = 20;
tv_throw.destX = 535;
tv_throw.destY = 284;
}
}
function playHitAnim() {
if (SliderStarted == 3) {
if (tv_throw.whatHit != "Window") {
var _local2 = tv_throw._y - tv_throw.destY;
tv_throw._y = tv_throw._y - (_local2 / tv_throw.dividend);
tv_throw.dividend--;
if (tv_throw.dividend == 1) {
SliderStarted = 0;
}
} else {
var _local2 = tv_throw._y - tv_throw.destY;
var _local3 = tv_throw._xscale - tv_throw.destScale;
tv_throw._y = tv_throw._y - (_local2 / tv_throw.dividend);
tv_throw._xscale = tv_throw._xscale - (_local3 / tv_throw.dividend);
tv_throw._yscale = tv_throw._xscale;
tv_throw._alpha = tv_throw._alpha - 0.5;
if (slider._x > 320) {
tv_throw._rotation = tv_throw._rotation + 5;
} else {
tv_throw._rotation = tv_throw._rotation - 5;
}
tv_throw.dividend--;
if (tv_throw.dividend == 1) {
playSnd("car1", 120);
inv_sound = setInterval(PlaySoundTwo, 600);
SliderStarted = 0;
}
}
} else {
Bill_items = "";
i = 0;
while (i < Bill_array[0].length) {
var _local1 = Bill_array[2][i] * Bill_array[1][i];
if (i == 0) {
if (Bill_array[1][i] > 1) {
Bill_items = Bill_items + ((((Bill_array[0][i] + "X") + Bill_array[1][i]) + ":...$") + _local1);
} else {
Bill_items = Bill_items + ((Bill_array[0][i] + ": ...$") + _local1);
}
Bill_items = Bill_items + "<br>";
} else {
Bill_items = Bill_items + ((Bill_array[0][i] + "...$") + _local1);
Bill_items = Bill_items + "<br>";
}
i++;
}
if (Bill_array[1][0] > 0) {
TopBar.hotelBill.Hotel_Bill.htmlText = Bill_items;
}
destructable_f.swapDepths(depthOld);
destructable_m.swapDepths(depthOld2);
GameStarted = 1;
tv_throw._rotation = 0;
tv_throw._xscale = 100;
tv_throw._yscale = tv_throw._xscale;
tv_throw._y = 574;
tv_throw._x = 320;
tv_throw._alpha = 100;
tv_throw.gotoAndStop(1);
if (character_P._currentframe == 1) {
Arms._y = ArmsYrestart;
nInputLock = 0;
}
}
}
function gameEnd() {
onEnterFrame = undefined;
delete onEnterFrame;
Key.removeListener(keyListener);
starHolder.removeMovieClip();
slider_Bar.removeMovieClip();
slider.removeMovieClip();
character_P.removeMovieClip();
play();
}
function runPOPup(hitTYPE) {
if (hitTYPE != "Wall") {
var _local1 = Math.floor(Math.random() * 4) + 2;
character_P.gotoAndStop(1);
character_P.character_F.gotoAndStop(_local1);
character_P.play();
}
}
function PlaySoundTwo() {
clearInterval(inv_sound);
if (_currentframe == 6) {
playSnd("car2", 40);
}
}
var keyListener = new Object();
var nCursorValue = 0;
var nLastKey = -1;
var nInputLock = 0;
var GameStarted = 0;
var SliderStarted = 0;
var SliderAccel = 20;
var TVs = 5;
var HotelBill = [];
var depthOld = destructable_f.getDepth();
var depthOld2 = destructable_m.getDepth();
var depthNew = 0;
var Bill_items = "";
var Bill_array = [["Television"], [0], [500]];
var ArmsYrestart = 250;
var TimerStarted = 0;
var timerStart = 60;
var rotateTalk = Math.floor(Math.random() * 4);
keyListener.onKeyDown = function () {
RecieveKey(Key.getCode(), Key.getAscii());
};
keyListener.onKeyUp = function () {
if ((nLastKey == 32) && (SliderStarted == 1)) {
SliderStarted = 2;
GameStarted = 0;
executeThrow();
nLastKey = -1;
}
};
this.onEnterFrame = function () {
ExecuteGame();
};
Key.addListener(keyListener);
Frame 6
function fireWorks(inX, inY, inAmount) {
var _local3 = 0;
while (_local3 < inAmount) {
var _local5 = {_x:inX, _y:inY};
var _local4 = starHolder.getNextHighestDepth();
var _local8 = Math.floor(Math.random() * 3);
var _local7 = Math.floor(Math.random() * 2);
var _local6 = "sparks";
var _local2 = starHolder.attachMovie(_local6, ("spark" + getTimer()) + _local4, _local4, _local5);
_local2.lifetime = (getTimer() + 1000) + (Math.random() * 500);
_local2.birthtime = getTimer();
_local2._xscale = 100 + (Math.random() * 40);
_local2._yscale = _local2._xscale;
_local2.xinc = 5 - (Math.random() * 10);
_local2.yinc = -15 + (Math.random() * 20);
_local2.onEnterFrame = function () {
if (this.lifetime > 0) {
this._x = this._x + this.xinc;
this._y = this._y + this.yinc;
this.yinc = this.yinc + 1;
this._xscale = this._xscale * 0.98;
this._yscale = this._yscale * 0.98;
this._alpha = (100 * (this.lifetime - getTimer())) / (this.lifetime - this.birthtime);
if (getTimer() > this.lifetime) {
this.lifetime = 0;
this._y = -2000;
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
_local3++;
}
}
function timerUpdate(tVal) {
var _local2 = Math.floor(tVal / 60);
var _local1 = Math.floor(tVal) % 60;
if (_local1 < 10) {
_local1 = "0" + _local1;
}
TopBar.timer.timer = (_local2 + ":") + _local1;
}
stop();
timerUpdate(timerStart);
GameStarted = 1;
starHolder.swapDepths(11);
slider_Bar.swapDepths(13);
slider.swapDepths(14);
character_P.swapDepths(12);
playMusic("back_loop");
Frame 7
stop();
Bill_items = "";
var TempNum = 0;
i = 0;
while (i < Bill_array[0].length) {
var Multi = (Bill_array[2][i] * Bill_array[1][i]);
if (i == 0) {
Bill_items = Bill_items + ((((Bill_array[0][i] + "X") + Bill_array[1][i]) + ": ......................... $") + Multi);
Bill_items = Bill_items + "<br>";
} else {
Bill_items = Bill_items + ((Bill_array[0][i] + "............................ $") + Multi);
Bill_items = Bill_items + "<br>";
}
TempNum = TempNum + Multi;
i++;
}
Bill_Total.text = "Total Bill: ................................ $" + TempNum;
if (TempNum > HighScoreN) {
HighScoreN = TempNum;
}
stopMusic();
var xxx = 0;
while (xxx < 16) {
var aSndChan = soundBaseMC.sounds[xxx];
aSndChan.stop();
xxx++;
}
playSnd("endscreen", 160);
Frame 8
function SendMail(Name, Email, FName, FEmail) {
var _local1 = new LoadVars();
_local1.email = Email;
_local1.friendemail = FEmail;
_local1.subject = "The Rocker: TV toss game";
_local1.message = ((("Your Friend " + Name) + " Scored ") + HighScoreN) + " playing The Rocker. Click the Link to try and beat their score.";
_local1.url = "http://www.rockermovie.com/tv_toss.html";
var _local2 = new LoadVars();
_local2.onData = function (src) {
if (Key.isDown(16)) {
showError(200, ("[" + src) + "]");
}
};
_local1.sendAndLoad("http://www.rockermovie.com/app/form_mail/send2Friend.php", _local2, "POST");
}
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 77 Button
on (release) {
play();
}
Symbol 112 MovieClip Frame 120
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 2
onEnterFrame = function () {
var _local2 = {x:dot2._x, y:dot2._y};
_local2.x = _local2.x + 127;
_local2.y = _local2.y + 263;
_parent._parent.fireWorks(_local2.x, _local2.y, 5);
};
Symbol 161 MovieClip Frame 21
stop();
onEnterFrame = undefined;
delete onEnterFrame;
Symbol 170 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
stop();
_parent.playSnd("TV", 100);
xxx = 0;
while (xxx < 50) {
var xPlace = (this._x + ((Math.random() * 170) - 85));
var yPlace = (this._y + ((Math.random() * 170) - 85));
_parent.fireWorks(xPlace, yPlace, 2);
xxx++;
}
Symbol 202 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 1
stop();
var sndWords = ["1", "2", "3", "4"];
Symbol 222 MovieClip Frame 15
stop();
var dE = 90;
var sndName = sndWords[_parent.rotateTalk];
_parent.playSnd(sndName, 160);
_parent.rotateTalk++;
if (_parent.rotateTalk > 3) {
_parent.rotateTalk = 0;
}
onEnterFrame = function () {
dE--;
if (dE) {
return(undefined);
}
onEnterFrame = undefined;
delete onEnterFrame;
character_F.gotoAndStop(1);
this.gotoAndStop(1);
_parent.Arms._y = _parent.ArmsYrestart;
_parent.nInputLock = 0;
};
Symbol 238 Button
on (release) {
gotoAndPlay (5);
}
Symbol 259 Button
on (release) {
if ((((Name_I.text == "") || (Email_I.text == "")) || (F_Name_I.text == "")) || (F_Email_I.text == "")) {
} else {
playSnd("click");
SendMail(Name_I.text, Email_I.text, F_Name_I.text, F_Email_I.text);
Name_I.text = "";
Email_I.text = "";
F_Name_I.text = "";
F_Email_I.text = "";
MsgBox.play();
}
}
Symbol 260 Button
on (release) {
gotoAndPlay (5);
}
Symbol 263 MovieClip Frame 1
this.useHandCursor = false;
this.onPress = function () {
};
this.onMouseDown = function () {
};
this.onMouseUp = function () {
};
Symbol 270 Button
on (release) {
gotoAndStop (1);
}
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 15
stop();