Frame 1
var paramObj = {X_BOUND:40, Y_BOUND:325, W_BOUND:572, H_BOUND:70, SKATER_SPEED:4, SPEED_OFFSET:10, SPEED_MULTIPLIER:2, DURATION_MAX:60, LEVEL_MAX:3, TIME_BONUS:1, OBSTACLE_LIST:[["bodybuilder", "bikini", "tourist", "performer", "cart", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"], ["starlet", "tourist", "frankenstein", "rocker", "cart", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"], ["richLady", "richMan", "cop", "tourist", "tourist", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"]], TOP_TEN_URL:"http://www.mtv.com/games/arcade/#/games/arcade/game/play.jhtml?arcadeGameId=10058014/topTen.xml", SUBMIT_SCORE_URL:"http://www.mtv.com/games/arcade/#/games/arcade/game/play.jhtml?arcadeGameId=10058014/topTen.php", SUBMIT_FRIEND_URL:"submitFriend.php", PRELEVEL_MESSAGES:["Welcome to Venice\n\nPlaceholder\n\nThis is the countdown", "Welcome to Hollywood\n\nPlaceholder\n\nThis is the countdown", "Welcome to Rodeo\n\nPlaceholder\n\nThis is the countdown"], GAMEOVER_MESSAGES:[{score:-1, message:"Didn't do too well. Big is getting tired of sticking up for you!"}, {score:0, message:"You skate about as good as Meaty! Keep trying."}, {score:10000, message:"Killer dude! Let's see you do it again!!"}]};
var main = (new com.mtv.skateGame2.Main(this, paramObj));
stop();
Symbol 5 MovieClip [rocker] Frame 1
#initclip 59
Object.registerClass("rocker", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 7 MovieClip [richMan] Frame 1
#initclip 35
Object.registerClass("richMan", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 9 MovieClip [richLady] Frame 1
#initclip 36
Object.registerClass("richLady", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 11 MovieClip [pothole] Frame 1
#initclip 37
Object.registerClass("pothole", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
trick = "jump3";
key = 32;
bonus = 250;
registerHitRegion(hitregion);
Symbol 13 MovieClip [performer] Frame 1
#initclip 38
Object.registerClass("performer", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 15 MovieClip [frankenstein] Frame 1
#initclip 39
Object.registerClass("frankenstein", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 18 MovieClip [tourist] Frame 1
#initclip 40
Object.registerClass("tourist", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 20 MovieClip [streetlamp] Frame 1
#initclip 41
Object.registerClass("streetlamp", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 23 MovieClip [starlet] Frame 1
#initclip 42
Object.registerClass("starlet", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 26 MovieClip [cop] Frame 1
#initclip 43
Object.registerClass("cop", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 29 MovieClip [cart] Frame 1
#initclip 44
Object.registerClass("cart", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 31 MovieClip [bodybuilder] Frame 1
#initclip 45
Object.registerClass("bodybuilder", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 33 MovieClip [bikini] Frame 1
#initclip 46
Object.registerClass("bikini", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
registerHitRegion(hitregion);
Symbol 36 MovieClip [score1] Frame 1
#initclip 47
Object.registerClass("score1", com.mtv.skateGame2.characters.clips.ScoreIconClip);
#endinitclip
Symbol 36 MovieClip [score1] Frame 20
complete();
Symbol 38 MovieClip [score2] Frame 1
#initclip 48
Object.registerClass("score2", com.mtv.skateGame2.characters.clips.ScoreIconClip);
#endinitclip
Symbol 38 MovieClip [score2] Frame 20
complete();
Symbol 40 MovieClip [score3] Frame 1
#initclip 49
Object.registerClass("score3", com.mtv.skateGame2.characters.clips.ScoreIconClip);
#endinitclip
Symbol 40 MovieClip [score3] Frame 20
complete();
Symbol 128 MovieClip [topTen] Frame 1
#initclip 50
Object.registerClass("topTen", com.mtv.skateGame2.displays.clips.TopTenClip);
#endinitclip
registerField("message", message);
registerClip("replay", replay);
Symbol 128 MovieClip [topTen] Frame 33
stop();
Symbol 129 MovieClip [meaty] Frame 1
#initclip 51
Object.registerClass("meaty", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
trick = "jump1";
key = 32;
bonus = 500;
registerHitRegion(hitregion);
Instance of Symbol 3 MovieClip "hitregion" in Symbol 129 MovieClip [meaty] Frame 1
/* no clip actions */
Symbol 222 MovieClip [skater] Frame 1
#initclip 52
Object.registerClass("skater", com.mtv.skateGame2.characters.clips.RobClip);
#endinitclip
registerHitRegion(hitRegion);
registerNormals(["ride", "push"]);
registerSuccesses(["jump1", "jump2", "jump3", "rail"]);
registerFailures(["jump1"]);
Symbol 222 MovieClip [skater] Frame 3
stop();
Symbol 222 MovieClip [skater] Frame 14
gotoAndPlay ("normal_ride");
Symbol 222 MovieClip [skater] Frame 15
play();
Symbol 222 MovieClip [skater] Frame 29
gotoAndPlay ("normal_ride");
Symbol 222 MovieClip [skater] Frame 44
gotoAndPlay ("normal_push");
Symbol 222 MovieClip [skater] Frame 45
stop();
Symbol 222 MovieClip [skater] Frame 84
reset();
stop();
Symbol 222 MovieClip [skater] Frame 100
reset();
stop();
Symbol 222 MovieClip [skater] Frame 123
gotoAndPlay ("normal_ride");
Symbol 222 MovieClip [skater] Frame 135
reset();
stop();
Symbol 277 Button
on (release) {
gotoAndPlay (1);
}
Symbol 278 Button
on (release) {
lessonHandler();
}
Symbol 279 Button
on (release) {
submitHandler();
}
Symbol 280 MovieClip [intro] Frame 1
#initclip 53
Object.registerClass("intro", com.mtv.skateGame2.displays.clips.IntroClip);
#endinitclip
Symbol 280 MovieClip [intro] Frame 95
stop();
Symbol 294 MovieClip [premiere] Frame 1
#initclip 54
Object.registerClass("premiere", com.mtv.skateGame2.displays.clips.PremiereClip);
#endinitclip
stop();
Symbol 314 MovieClip [gameOver] Frame 1
#initclip 55
Object.registerClass("gameOver", com.mtv.skateGame2.displays.clips.GameOverClip);
#endinitclip
registerClip("submitScore", submitBtn);
registerClip("replay", replayBtn);
registerField("message", msg);
registerField("score", score);
registerField("user", username);
Symbol 314 MovieClip [gameOver] Frame 33
stop();
Symbol 318 MovieClip [bench] Frame 1
#initclip 56
Object.registerClass("bench", com.mtv.skateGame2.obstacles.clips.ObstacleClip);
#endinitclip
trick = "rail";
key = 32;
bonus = 1000;
registerHitRegion(hitregion);
Symbol 335 MovieClip [lesson] Frame 1
#initclip 57
Object.registerClass("lesson", com.mtv.skateGame2.displays.clips.LessonClip);
#endinitclip
Symbol 338 MovieClip [stats] Frame 1
#initclip 58
Object.registerClass("stats", com.mtv.skateGame2.displays.clips.StatsClip);
#endinitclip
registerField("lives", livesGui);
registerField("score", scoreGui);
Symbol 340 MovieClip [__Packages.com.mtv.skateGame2.model.IModelListener] Frame 0
interface com.mtv.skateGame2.model.IModelListener
{
}
Symbol 341 MovieClip [__Packages.com.mtv.skateGame2.Main] Frame 0
class com.mtv.skateGame2.Main implements com.mtv.skateGame2.model.IModelListener
{
var container, overlay, model, foreground, backdrop, spriteLayer, spriteMask, obstacleManager, player, stats, prompt, playerTimeout;
function Main (mc, paramObj) {
container = mc.createEmptyMovieClip("main", 0);
overlay = mc.createEmptyMovieClip("overlay", 1);
for (var _local3 in paramObj) {
com.mtv.skateGame2.Main[_local3] = paramObj[_local3];
}
init();
}
function init() {
model = new com.mtv.skateGame2.model.Model();
model.addListener(this);
createGameSprites();
createIntroSequence();
}
function createGameSprites() {
foreground = new com.mtv.skateGame2.displays.PremiereBar(overlay);
foreground.setModel(model);
backdrop = new com.mtv.skateGame2.BackDrop(container);
backdrop.setModel(model);
spriteLayer = container.createEmptyMovieClip("spritelayer", container.getNextHighestDepth());
spriteMask = container.attachMovie("spriteMask", "smask", container.getNextHighestDepth(), {_x:40});
spriteLayer.setMask(spriteMask);
obstacleManager = new com.mtv.skateGame2.obstacles.ObstacleManager(spriteLayer);
obstacleManager.setModel(model);
player = new com.mtv.skateGame2.characters.Rob(spriteLayer);
player.setModel(model);
player.setPosition((X_BOUND + W_BOUND) + 50, Y_BOUND + (H_BOUND / 2));
stats = new com.mtv.skateGame2.displays.StatsDisplay(container);
stats.setModel(model);
}
function createIntroSequence() {
prompt = new com.mtv.skateGame2.displays.IntroPrompt(container);
prompt.onBegin = mx.utils.Delegate.create(this, beginGame);
prompt.onLesson = mx.utils.Delegate.create(this, beginLesson);
}
function beginLesson() {
prompt.remove();
prompt = new com.mtv.skateGame2.displays.LessonPrompt(container);
prompt.onComplete = mx.utils.Delegate.create(this, beginGame);
trace("begin lesson " + prompt);
}
function beginGame() {
prompt.remove();
prompt = null;
model.restart();
}
function beginLevel() {
prompt.remove();
prompt = null;
model.resume();
player.setPosition((X_BOUND + W_BOUND) + 50, Y_BOUND + (H_BOUND / 2));
player.tweenToPosition(X_BOUND + (W_BOUND / 2), player.__get__y(), 2);
_global.clearTimeout(playerTimeout);
playerTimeout = _global.setTimeout(this, "playerEnableTimeout", 2000);
}
function displayRank() {
prompt.remove();
prompt = new com.mtv.skateGame2.displays.TopTenPrompt(container);
prompt.onBegin = mx.utils.Delegate.create(this, beginGame);
}
function playerEnableTimeout() {
player.onResume();
}
function levelAdvanceTimeout() {
model.start();
}
function onObstacleHit(args) {
}
function onStart(args) {
model.pause();
prompt = new com.mtv.skateGame2.displays.PreLevelPrompt(container);
prompt.setModel(model);
prompt.onTimeout = mx.utils.Delegate.create(this, beginLevel);
}
function onFinish(args) {
player.tweenToPosition(-100, player.__get__y(), 2);
backdrop.playBigRed();
_global.clearTimeout(playerTimeout);
playerTimeout = _global.setTimeout(this, "levelAdvanceTimeout", 6000);
}
function onPause(args) {
}
function onResume(args) {
}
function onGameOver(args) {
prompt = new com.mtv.skateGame2.displays.GameOverPrompt(container);
prompt.setModel(model);
prompt.onBegin = mx.utils.Delegate.create(this, beginGame);
prompt.onSubmit = mx.utils.Delegate.create(this, displayRank);
player.setPosition((X_BOUND + W_BOUND) + 50, Y_BOUND + (H_BOUND / 2));
}
static var X_BOUND = 40;
static var Y_BOUND = 325;
static var W_BOUND = 572;
static var H_BOUND = 70;
static var SPEED_OFFSET = 10;
static var SPEED_MULTIPLIER = 5;
static var DURATION_MAX = 20;
static var LEVEL_MAX = 3;
static var TIME_BONUS = 1;
static var TRICK_BONUS = 200;
static var SKATER_SPEED = 2;
static var OBSTACLE_LIST = [["bodybuilder", "bikini", "tourist", "performer", "vendor", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"], ["starlet", "tourist", "frankenstein", "rocker", "cart", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"], ["richLady", "richMan", "cop", "tourist", "guy", "streetlamp", "streetlamp", "streetlamp", "meaty", "bench", "bench", "pothole", "pothole"]];
static var TOP_TEN_URL = "topTen.xml";
static var SUBMIT_SCORE_URL = "submitScore.php";
static var SUBMIT_FRIEND_URL = "submitFriend.php";
static var PRELEVEL_MESSAGES = ["Welcome to Venice\n\nPlaceholder\n\nThis is the countdown", "Welcome to Hollywood\n\nPlaceholder\n\nThis is the countdown", "Welcome to Rodeo\n\nPlaceholder\n\nThis is the countdown"];
static var GAMEOVER_MESSAGES = [{score:-1, message:"Didn't do too well. Big is getting tired of sticking up for you!"}, {score:0, message:"Didn't do too well. Big is getting tired of sticking up for you!"}, {score:3000, message:"Way to be. Big and Meaty are proud of you!"}];
}
Symbol 342 MovieClip [__Packages.com.mtv.skateGame2.model.Model] Frame 0
class com.mtv.skateGame2.model.Model
{
var __lives, __level, __speed, __duration, listeners, score, playerClip, durInterval, accelInterval;
function Model () {
init();
}
function get lives() {
return(__lives);
}
function get level() {
return(__level);
}
function get speed() {
return(__speed);
}
function get duration() {
return(__duration);
}
function init() {
listeners = new com.schelterstudios.data.UniqueArray();
}
function restart() {
trace("model is restarting");
__level = 0;
__lives = 2;
__speed = 0;
__duration = 0;
score = 0;
start();
}
function start() {
__duration = 0;
__level++;
if (com.mtv.skateGame2.Main.LEVEL_MAX < __level) {
endGame(true);
return(undefined);
}
__lives++;
beginMovement();
dispatchEvent("onStart");
}
function finish() {
haltMovement();
dispatchEvent("onFinish");
}
function resume() {
if (__lives < 0) {
return(undefined);
}
beginMovement();
dispatchEvent("onResume");
}
function pause() {
trace("MODEL PAUSE HIT");
haltMovement();
dispatchEvent("onPause");
}
function endGame(success) {
trace("ENDGAME EVENT");
haltMovement();
dispatchEvent("onGameOver", {success:success});
}
function setPlayerSprite(clip) {
playerClip = clip;
}
function loseLife() {
trace("lose life");
__lives--;
if (__lives < 0) {
endGame(false);
}
}
function testCollision(clip) {
if (clip.hitArea.hitTest(playerClip.hitArea)) {
dispatchEvent("onObstacleHit", {trick:clip.trick, key:clip.key, bonus:clip.bonus});
return(true);
}
return(false);
}
function addListener(obj) {
listeners.push(obj);
}
function removeListener(obj) {
var _local2 = 0;
while (_local2 < listeners.length) {
if (obj == listeners[_local2]) {
listeners.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function dispatchEvent(event, args) {
var _local2 = 0;
while (_local2 < listeners.length) {
listeners[_local2][event](args);
_local2++;
}
}
function haltMovement() {
clearInterval(durInterval);
clearInterval(accelInterval);
__speed = 0;
}
function beginMovement() {
clearInterval(durInterval);
durInterval = setInterval(this, "durCounter", DUR_RATE);
clearInterval(accelInterval);
accelInterval = setInterval(this, "accel", ACCEL_RATE);
accel();
}
function durCounter() {
__duration++;
score = score + Math.ceil(com.mtv.skateGame2.Main.TIME_BONUS * __speed);
if (__duration >= com.mtv.skateGame2.Main.DURATION_MAX) {
finish();
}
}
function accel() {
var _local2 = (level * com.mtv.skateGame2.Main.SPEED_MULTIPLIER) + com.mtv.skateGame2.Main.SPEED_OFFSET;
if ((__speed - _local2) >= 0) {
__speed = _local2;
clearInterval(accelInterval);
}
__speed = __speed + (_local2 * 0.1);
}
static var ACCEL_RATE = 30;
static var DUR_RATE = 1000;
}
Symbol 343 MovieClip [__Packages.com.schelterstudios.data.UniqueArray] Frame 0
class com.schelterstudios.data.UniqueArray extends Array
{
var length;
function UniqueArray () {
super();
if (arguments.length > 0) {
appendArray(arguments);
}
}
static function getUnique(oldArray) {
var _local1 = new com.schelterstudios.data.UniqueArray();
_local1.concat(oldArray);
return(_local1);
}
function push(element) {
if (isUnique(element)) {
super.push(element);
return(true);
}
return(false);
}
function unshift(element) {
if (isUnique(element)) {
super.unshift(element);
return(true);
}
return(false);
}
function concat() {
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] instanceof Array) {
appendArray(arguments[_local3]);
} else {
push(arguments[_local3]);
}
_local3++;
}
}
function splice(index, remove) {
return(super.splice.apply(this, [index, remove].concat(getUnique(arguments.slice(2)))));
}
function isUnique(element) {
var _local2 = 0;
while (_local2 < length) {
if (this[_local2] == element) {
return(false);
}
_local2++;
}
return(true);
}
function appendArray(elementlist) {
var _local2 = 0;
while (_local2 < elementlist.length) {
push(elementlist[_local2]);
_local2++;
}
}
}
Symbol 344 MovieClip [__Packages.com.mtv.skateGame2.characters.Rob] Frame 0
class com.mtv.skateGame2.characters.Rob implements com.mtv.skateGame2.model.IModelListener
{
var container, xSpeed, ySpeed, isTricking, clip, model, xTween, yTween, trickTimeout;
function Rob (mc) {
container = mc;
init();
}
function init() {
xSpeed = 0;
ySpeed = 0;
isTricking = null;
clip = com.mtv.skateGame2.characters.clips.RobClip.create(container, CLIP_LINKAGE, 0);
clip.onReset = mx.utils.Delegate.create(this, clipResetHandler);
com.mtv.skateGame2.utils.KeyManager.addListener(this);
}
function setModel(model) {
this.model = model;
this.model.addListener(this);
this.model.setPlayerSprite(clip);
}
function setPosition(x, y) {
clip._x = x;
clip._y = y;
clip.swapDepths(Math.round(clip._y) * 10);
clip._xscale = (clip._yscale = com.mtv.skateGame2.utils.ZTools.getScale(clip._y));
}
function tweenToPosition(x, y, d) {
xTween = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Regular.easeOut, clip._x, x, d, true);
yTween = new mx.transitions.Tween(clip, "_y", mx.transitions.easing.Regular.easeOut, clip._y, y, d, true);
}
function set x(n) {
clip._x = ((com.mtv.skateGame2.Main.X_BOUND > n) ? (com.mtv.skateGame2.Main.X_BOUND) : (((((com.mtv.skateGame2.Main.X_BOUND + com.mtv.skateGame2.Main.W_BOUND) - clip.hitArea._width) < n) ? ((com.mtv.skateGame2.Main.X_BOUND + com.mtv.skateGame2.Main.W_BOUND) - clip.hitArea._width) : (n))));
//return(x);
}
function get x() {
return(clip._x);
}
function set y(n) {
clip._y = ((com.mtv.skateGame2.Main.Y_BOUND > n) ? (com.mtv.skateGame2.Main.Y_BOUND) : ((((com.mtv.skateGame2.Main.Y_BOUND + com.mtv.skateGame2.Main.H_BOUND) < n) ? (com.mtv.skateGame2.Main.Y_BOUND + com.mtv.skateGame2.Main.H_BOUND) : (n))));
clip._xscale = (clip._yscale = com.mtv.skateGame2.utils.ZTools.getScale(clip._y));
clip.swapDepths(Math.round(clip._y) * 10);
//return(y);
}
function get y() {
return(clip._y);
}
function enableTrick(key) {
if (isTricking != null) {
return(undefined);
}
isTricking = key;
_global.clearTimeout(trickTimeout);
trickTimeout = _global.setTimeout(this, "disableTrick", TRICK_DURATION);
}
function disableTrick() {
_global.clearTimeout(trickTimeout);
isTricking = null;
}
function clipResetHandler() {
clip.setNormal("push");
}
function onObstacleHit(args) {
if (isTricking == args.key) {
clip.setSuccess(args.trick);
model.score = model.score + args.bonus;
var _local3 = new com.mtv.skateGame2.characters.ScoreIcon(clip, args.key);
} else {
clip.setFailure(args.trick);
model.loseLife();
}
disableTrick();
}
function onStart(args) {
}
function onFinish(args) {
disableFrameHandler();
}
function onPause(args) {
disableFrameHandler();
}
function onResume(args) {
enableFrameHandler();
}
function onGameOver(args) {
disableFrameHandler();
}
function enableFrameHandler() {
clip.onEnterFrame = mx.utils.Delegate.create(this, enterFrameHandler);
}
function disableFrameHandler() {
clip.onEnterFrame = null;
}
function enterFrameHandler() {
var _local4 = com.mtv.skateGame2.utils.ZTools.getSpeed(y);
var _local3 = 0;
if (Key.isDown(37)) {
_local3--;
}
if (Key.isDown(39)) {
_local3++;
}
_local3 = _local3 * (com.mtv.skateGame2.Main.SKATER_SPEED * _local4);
var _local2 = 0;
if (Key.isDown(38)) {
_local2--;
}
if (Key.isDown(40)) {
_local2++;
}
_local2 = _local2 * (com.mtv.skateGame2.Main.SKATER_SPEED * _local4);
if (_local3 != 0) {
x = x + _local3;
}
if (_local2 != 0) {
y = y + _local2;
}
}
function onKeyPressed(args) {
switch (args.key) {
case 38 :
case 40 :
case 37 :
case 39 :
break;
default :
enableTrick(args.key);
}
}
static var CLIP_LINKAGE = "skater";
static var TRICK_DURATION = 300;
}
Symbol 345 MovieClip [__Packages.com.mtv.skateGame2.characters.clips.RobClip] Frame 0
class com.mtv.skateGame2.characters.clips.RobClip extends MovieClip
{
var cacheAsBitmap, hitArea, normallist, gotoAndStop, _currentframe, successlist, failurelist, onReset, stop, gotoAndPlay;
function RobClip () {
super();
}
static function get FRAME_NORMAL() {
return("normal_");
}
static function get FRAME_FAIL() {
return("fail_");
}
static function get FRAME_SUCCESS() {
return("success_");
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.characters.clips.RobClip(mc.attachMovie(link, "robclip" + depth, depth, obj));
return(_local1);
}
function onLoad() {
cacheAsBitmap = true;
}
function registerHitRegion(clip) {
if (typeof(clip) != "movieclip") {
throw new Error("ERROR: invalid hit region for rob movieclip");
}
hitArea = clip;
}
function registerNormals(suffixes) {
normallist = new Object();
var _local4 = -1;
var _local2 = 0;
while (_local2 < suffixes.length) {
var _local3 = suffixes[_local2];
(gotoAndStop(FRAME_NORMAL + _local3));// not popped
if (_currentframe != _local4) {
_local4 = _currentframe;
normallist[_local3] = _local4;
} else {
throw new Error((("ERROR: " + FRAME_NORMAL) + _local3) + " frame is missing from rob movieclip");
}
_local2++;
}
}
function registerSuccesses(suffixes) {
successlist = new Object();
var _local4 = -1;
var _local2 = 0;
while (_local2 < suffixes.length) {
var _local3 = suffixes[_local2];
(gotoAndStop(FRAME_SUCCESS + _local3));// not popped
if (_currentframe != _local4) {
_local4 = _currentframe;
successlist[_local3] = _local4;
} else {
throw new Error((("ERROR: " + FRAME_SUCCESS) + _local3) + " frame is missing from rob movieclip");
}
_local2++;
}
setNormal();
}
function registerFailures(suffixes) {
failurelist = new Object();
var _local4 = -1;
var _local2 = 0;
while (_local2 < suffixes.length) {
var _local3 = suffixes[_local2];
(gotoAndStop(FRAME_FAIL + _local3));// not popped
if (_currentframe != _local4) {
_local4 = _currentframe;
failurelist[_local3] = _local4;
} else {
throw new Error((("ERROR: " + FRAME_FAIL) + _local3) + " frame is missing from rob movieclip");
}
_local2++;
}
setNormal();
}
function reset() {
onReset();
}
function setNormal(suffix) {
if (normallist[suffix] == undefined) {
for (suffix in normallist) {
break;
}
}
trace("normal frame " + normallist[suffix]);
stop();
gotoAndPlay(normallist[suffix]);
}
function setSuccess(suffix) {
if (successlist[suffix] == undefined) {
for (suffix in successlist) {
break;
}
}
trace("success frame " + successlist[suffix]);
stop();
gotoAndPlay(successlist[suffix]);
}
function setFailure(suffix) {
if (falurelist[suffix] == undefined) {
for (suffix in failurelist) {
break;
}
}
trace("fail frame " + failurelist[suffix]);
stop();
gotoAndPlay(failurelist[suffix]);
}
}
Symbol 346 MovieClip [__Packages.com.mtv.skateGame2.DisplayObject] Frame 0
class com.mtv.skateGame2.DisplayObject
{
var container, model;
function DisplayObject (mc) {
var _local2 = mc.getNextHighestDepth();
container = mc.createEmptyMovieClip("dispObj" + _local2, _local2);
}
function remove() {
throw new Error("ERROR: DisplayObject.remove() is abstract");
}
function setModel(model) {
this.model = model;
}
}
Symbol 347 MovieClip [__Packages.com.mtv.skateGame2.characters.ScoreIcon] Frame 0
class com.mtv.skateGame2.characters.ScoreIcon extends com.mtv.skateGame2.DisplayObject
{
var clip, container;
function ScoreIcon (mc, num) {
super(mc);
init(num);
}
function init(num) {
var _local2;
switch (num) {
case 32 :
_local2 = 1;
break;
case 17 :
_local2 = 2;
break;
default :
_local2 = 0;
}
clip = com.mtv.skateGame2.characters.clips.ScoreIconClip.create(container, CLIP_LINKAGES[_local2], 0);
clip.onComplete = mx.utils.Delegate.create(this, clipCompleteHandler);
clip._x = X_POS;
clip._y = Y_POS;
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function clipCompleteHandler() {
remove();
}
static var CLIP_LINKAGES = ["score1", "score2", "score3"];
static var X_POS = 50;
static var Y_POS = -400;
}
Symbol 348 MovieClip [__Packages.com.mtv.skateGame2.characters.clips.ScoreIconClip] Frame 0
class com.mtv.skateGame2.characters.clips.ScoreIconClip extends MovieClip
{
var onComplete;
function ScoreIconClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.characters.clips.ScoreIconClip(mc.attachMovie(link, "ScoreIconClip" + depth, depth, obj));
return(_local1);
}
function complete() {
onComplete();
}
}
Symbol 349 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 350 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 351 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 352 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 353 MovieClip [__Packages.com.mtv.skateGame2.utils.KeyManager] Frame 0
class com.mtv.skateGame2.utils.KeyManager
{
static var instance, listeners;
var keylist;
function KeyManager () {
keylist = new com.schelterstudios.data.UniqueArray();
Key.addListener(this);
}
function onKeyDown() {
var _local2 = Key.getCode();
if (keylist.isUnique(_local2)) {
keylist.push(_local2);
dispatchEvent("onKeyPressed", {key:_local2});
}
}
function onKeyUp() {
var _local2 = 0;
while (_local2 < keylist.length) {
while ((_local2 < keylist.length) && (!Key.isDown(keylist[_local2]))) {
var _local3 = keylist.splice(_local2, 1)[0];
dispatchEvent("onKeyReleased", {key:_local3});
}
_local2++;
}
}
static function addListener(obj) {
if (instance == undefined) {
instance = new com.mtv.skateGame2.utils.KeyManager();
}
if (listeners == undefined) {
listeners = new com.schelterstudios.data.UniqueArray();
}
listeners.push(obj);
}
static function removeListener(obj) {
var _local1 = 0;
while (_local1 < listeners.length) {
if (obj == listeners[_local1]) {
listeners.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
function dispatchEvent(event, args) {
var _local1 = 0;
while (_local1 < listeners.length) {
listeners[_local1][event](args);
_local1++;
}
}
}
Symbol 354 MovieClip [__Packages.com.mtv.skateGame2.utils.ZTools] Frame 0
class com.mtv.skateGame2.utils.ZTools
{
function ZTools () {
}
static function getScale(y) {
y = y - com.mtv.skateGame2.Main.Y_BOUND;
return((mScale * y) + SCALE_MIN);
}
static function getSpeed(y) {
y = y - com.mtv.skateGame2.Main.Y_BOUND;
return((mSpeed * y) + (SCALE_MIN / 100));
}
static var SCALE_MIN = 80;
static var mScale = (100 - SCALE_MIN) / com.mtv.skateGame2.Main.H_BOUND;
static var mSpeed = (1 - (SCALE_MIN / 100)) / com.mtv.skateGame2.Main.H_BOUND;
}
Symbol 355 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";
}
Symbol 356 MovieClip [__Packages.com.mtv.skateGame2.obstacles.ObstacleManager] Frame 0
class com.mtv.skateGame2.obstacles.ObstacleManager implements com.mtv.skateGame2.model.IModelListener
{
var container, obstaclelist, model, createInterval;
function ObstacleManager (mc) {
container = mc;
init();
}
function init() {
obstaclelist = new Array();
}
function setModel(model) {
this.model = model;
this.model.addListener(this);
}
function clear() {
while (obstaclelist.length > 0) {
obstaclelist.pop().remove();
}
}
function startGeneration() {
clearInterval(createInterval);
createInterval = setInterval(this, "createObstacle", CREATE_RATE);
}
function stopGeneration() {
clearInterval(createInterval);
}
function onObstacleHit(args) {
}
function onStart(args) {
clear();
}
function onFinish(args) {
stopGeneration();
}
function onPause(args) {
stopGeneration();
}
function onResume(args) {
startGeneration();
}
function onGameOver(args) {
stopGeneration();
}
function createObstacle() {
var _local2 = new com.mtv.skateGame2.obstacles.Obstacle(container);
var _local3 = Math.round((Math.random() * com.mtv.skateGame2.Main.H_BOUND) + com.mtv.skateGame2.Main.Y_BOUND);
_local2.onExitStage = mx.utils.Delegate.create(this, exitStageHandler);
_local2.setModel(model);
var _local4 = com.mtv.skateGame2.Main.X_BOUND - _local2.__get__width();
_local2.setPosition(_local4, _local3);
obstaclelist.push(_local2);
}
function exitStageHandler(obstacle) {
var _local2 = 0;
while (_local2 < obstaclelist.length) {
if (obstaclelist[_local2] == obstacle) {
obstaclelist.splice(_local2, 1);
break;
}
_local2++;
}
obstacle.remove();
}
static var CREATE_RATE = 2500;
}
Symbol 357 MovieClip [__Packages.com.mtv.skateGame2.obstacles.Obstacle] Frame 0
class com.mtv.skateGame2.obstacles.Obstacle implements com.mtv.skateGame2.model.IModelListener
{
var parent, clip, wasTricked, model, spMultiplier, onExitStage;
function Obstacle (mc) {
parent = mc;
init();
}
function get width() {
return(clip._width);
}
function get height() {
return(clip._height);
}
function init() {
wasTricked = false;
}
function remove() {
clip.removeMovieClip();
model.removeListener(this);
}
function setModel(model) {
this.model = model;
model.addListener(this);
var _local2 = com.mtv.skateGame2.Main.OBSTACLE_LIST[model.__get__level() - 1];
var _local5 = _local2[random(_local2.length)];
var _local4 = parent.getNextHighestDepth();
clip = com.mtv.skateGame2.obstacles.clips.ObstacleClip.create(parent, _local5, _local4, {_visible:false});
if (model.__get__speed() > 0) {
enableFrameHandler();
}
}
function setPosition(x, y) {
clip._x = x;
clip._y = y;
clip._xscale = (clip._yscale = com.mtv.skateGame2.utils.ZTools.getScale(y));
spMultiplier = com.mtv.skateGame2.utils.ZTools.getSpeed(y);
var _local2 = (Math.round(y) * 10) + 1;
while (parent.getInstanceAtDepth(_local2) != undefined) {
_local2++;
}
clip.swapDepths(_local2);
clip._visible = true;
}
function onObstacleHit(args) {
}
function onStart(args) {
enableFrameHandler();
}
function onFinish(args) {
disableFrameHandler();
}
function onPause(args) {
disableFrameHandler();
}
function onResume(args) {
enableFrameHandler();
}
function onGameOver(args) {
disableFrameHandler();
}
function enableFrameHandler() {
clip.onEnterFrame = mx.utils.Delegate.create(this, enterFrameHandler);
}
function disableFrameHandler() {
clip.onEnterFrame = null;
}
function enterFrameHandler() {
clip._x = clip._x + (model.__get__speed() * spMultiplier);
if (!wasTricked) {
wasTricked = model.testCollision(clip);
}
if (clip._x > (com.mtv.skateGame2.Main.X_BOUND + com.mtv.skateGame2.Main.W_BOUND)) {
disableFrameHandler();
onExitStage(this);
}
}
}
Symbol 358 MovieClip [__Packages.com.mtv.skateGame2.obstacles.clips.ObstacleClip] Frame 0
class com.mtv.skateGame2.obstacles.clips.ObstacleClip extends MovieClip
{
var cacheAsBitmap, hitArea;
function ObstacleClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.obstacles.clips.ObstacleClip(mc.attachMovie(link, "obstacle" + depth, depth, obj));
return(_local1);
}
function onLoad() {
cacheAsBitmap = true;
}
function registerHitRegion(clip) {
if (typeof(clip) != "movieclip") {
throw new Error("ERROR: invalid hit region for rob movieclip");
}
hitArea = clip;
}
var key = -1;
var trick = "";
var bonus = 0;
}
Symbol 359 MovieClip [__Packages.com.mtv.skateGame2.BackDrop] Frame 0
class com.mtv.skateGame2.BackDrop extends com.mtv.skateGame2.DisplayObject implements com.mtv.skateGame2.model.IModelListener
{
var fWidth, fHeight, clip, container, model, tackle;
function BackDrop (mc) {
super(mc);
init();
}
function init() {
fWidth = Stage.width;
fHeight = Stage.height;
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function setModel(model) {
super.setModel(model);
this.model.addListener(this);
}
function loadLevel() {
tackle.removeMovieClip();
clip = container.attachMovie(CLIP_PREFIX + model.__get__level(), "lvl", 0);
clip.stop();
clip._x = X_POS;
clip._y = Y_POS;
clip._xscale = (clip._yscale = SCALE);
}
function playClip() {
clip.play();
}
function stopClip() {
clip.stop();
}
function playBigRed() {
tackle = container.attachMovie(TACKLE_LINK, "tackle", 1);
tackle._x = X_POS;
tackle._y = Y_POS;
tackle._xscale = (tackle._yscale = SCALE);
}
function onObstacleHit(args) {
}
function onStart(args) {
loadLevel();
playClip();
}
function onFinish(args) {
stopClip();
}
function onPause(args) {
stopClip();
}
function onResume(args) {
playClip();
}
function onGameOver(args) {
stopClip();
}
static var CLIP_PREFIX = "level";
static var TACKLE_LINK = "tackle";
static var SCALE = 181.1;
static var X_POS = 40;
static var Y_POS = 0;
}
Symbol 360 MovieClip [__Packages.com.mtv.skateGame2.displays.StatsDisplay] Frame 0
class com.mtv.skateGame2.displays.StatsDisplay extends com.mtv.skateGame2.DisplayObject
{
var clip, container, lifeclips, model;
function StatsDisplay (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.StatsClip.create(container, CLIP_LINKAGE, 0);
clip._x = CLIP_X_POS;
clip._y = CLIP_Y_POS;
lifeclips = [];
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function setModel(model) {
super.setModel(model);
clip.onEnterFrame = mx.utils.Delegate.create(this, updateHandler);
}
function updateHandler() {
clip.__set__score(model.score.toString());
while (model.__get__lives() > lifeclips.length) {
var _local2 = lifeclips.length + 1;
var _local3 = container.attachMovie(LIFE_LINKAGE, "life" + _local2, _local2, {_x:LIFE_X_POS + ((_local2 - 1) * LIFE_SPAN), _y:LIFE_Y_POS});
lifeclips.push(_local3);
}
while ((model.__get__lives() < lifeclips.length) && (lifeclips.length > 0)) {
lifeclips.pop().removeMovieClip();
}
}
static var CLIP_LINKAGE = "stats";
static var CLIP_X_POS = 520;
static var CLIP_Y_POS = 10;
static var LIFE_LINKAGE = "life";
static var LIFE_X_POS = 70;
static var LIFE_Y_POS = 30;
static var LIFE_SPAN = 70;
}
Symbol 361 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.StatsClip] Frame 0
class com.mtv.skateGame2.displays.clips.StatsClip extends MovieClip
{
var livesField, __get__lives, scoreField, __get__score;
function StatsClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.StatsClip(mc.attachMovie(link, "StatsClip" + depth, depth, obj));
return(_local1);
}
function set lives(s) {
_lives = s;
livesField.text = s;
//return(__get__lives());
}
function set score(s) {
_score = s;
scoreField.text = s;
//return(__get__score());
}
function registerField(type, field) {
switch (type) {
case "lives" :
livesField = field;
livesField.text = _lives;
break;
case "score" :
scoreField = field;
scoreField.text = _score;
break;
default :
trace(("WARNING: " + type) + " is not a valid textfield");
}
}
var _lives = "0";
var _score = "0";
}
Symbol 362 MovieClip [__Packages.com.mtv.skateGame2.displays.PremiereBar] Frame 0
class com.mtv.skateGame2.displays.PremiereBar extends com.mtv.skateGame2.DisplayObject
{
var clip, container;
function PremiereBar (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.PremiereClip.create(container, CLIP_LINKAGE, 0);
clip.onSubmit = mx.utils.Delegate.create(this, clipSubmitHandler);
clip._x = X_POS;
clip._y = Y_POS;
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function clipSubmitHandler(name, email, friend) {
trace("PERFORM SUBMIT EVENT");
}
static var CLIP_LINKAGE = "premiere";
static var X_POS = -131;
static var Y_POS = 403;
}
Symbol 363 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.PremiereClip] Frame 0
class com.mtv.skateGame2.displays.clips.PremiereClip extends MovieClip
{
var __get__msg, __get__score, nameField, friendField, onSubmit, emailField;
function PremiereClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.PremiereClip(mc.attachMovie(link, "PremiereClip" + depth, depth, obj));
return(_local1);
}
function set msg(s) {
_msg = s;
msgField.text = s;
//return(__get__msg());
}
function set score(s) {
_score = s;
scoreField.text = s;
//return(__get__score());
}
function registerClip(type, clip) {
switch (type) {
case "submit" :
clip.onRelease = mx.utils.Delegate.create(this, submitHandler);
break;
default :
trace(("WARNING: " + type) + " is not a valid movieclip");
}
}
function registerField(type, field) {
switch (type) {
case "name" :
nameField = field;
break;
case "email" :
scoreField = field;
break;
case "friend" :
friendField = field;
break;
default :
trace(("WARNING: " + type) + " is not a valid textfield");
}
}
function submitHandler() {
onSubmit(nameField.text, emailField.text, friendField.text);
}
}
Symbol 364 MovieClip [__Packages.com.mtv.skateGame2.displays.IntroPrompt] Frame 0
class com.mtv.skateGame2.displays.IntroPrompt extends com.mtv.skateGame2.DisplayObject
{
var clip, container, onBegin, onLesson;
function IntroPrompt (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.IntroClip.create(container, CLIP_LINKAGE, 0);
clip.onBegin = mx.utils.Delegate.create(this, clipBeginHandler);
clip.onLesson = mx.utils.Delegate.create(this, clipLessonHandler);
clip._x = X_POS;
clip._y = Y_POS;
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function clipBeginHandler() {
onBegin();
}
function clipLessonHandler() {
onLesson();
}
static var CLIP_LINKAGE = "intro";
static var X_POS = -80;
static var Y_POS = 0;
}
Symbol 365 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.IntroClip] Frame 0
class com.mtv.skateGame2.displays.clips.IntroClip extends MovieClip
{
var onBegin, onLesson;
function IntroClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.IntroClip(mc.attachMovie(link, "IntroClip" + depth, depth, obj));
return(_local1);
}
function registerClip(type, clip) {
switch (type) {
case "begin" :
clip.onRelease = mx.utils.Delegate.create(this, beginHandler);
break;
case "lesson" :
clip.onRelease = mx.utils.Delegate.create(this, lessonHandler);
break;
default :
trace(("WARNING: " + type) + " is not a valid movieclip");
}
}
function submitHandler() {
onBegin();
}
function lessonHandler() {
onLesson();
}
}
Symbol 366 MovieClip [__Packages.com.mtv.skateGame2.displays.LessonPrompt] Frame 0
class com.mtv.skateGame2.displays.LessonPrompt extends com.mtv.skateGame2.DisplayObject
{
var clip, container, onComplete;
function LessonPrompt (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.LessonClip.create(container, CLIP_LINKAGE, 0);
clip.onComplete = mx.utils.Delegate.create(this, clipCompleteHandler);
clip._x = X_POS;
clip._y = Y_POS;
com.mtv.skateGame2.utils.KeyManager.addListener(this);
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
com.mtv.skateGame2.utils.KeyManager.removeListener(this);
}
function clipCompleteHandler() {
onComplete();
}
static var CLIP_LINKAGE = "lesson";
static var X_POS = 0;
static var Y_POS = 0;
}
Symbol 367 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.LessonClip] Frame 0
class com.mtv.skateGame2.displays.clips.LessonClip extends MovieClip
{
var onComplete;
function LessonClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.LessonClip(mc.attachMovie(link, "LessonClip" + depth, depth, obj));
return(_local1);
}
function onRelease() {
complete();
}
function complete() {
onComplete();
}
}
Symbol 368 MovieClip [__Packages.com.mtv.skateGame2.displays.TopTenPrompt] Frame 0
class com.mtv.skateGame2.displays.TopTenPrompt extends com.mtv.skateGame2.DisplayObject
{
var clip, container, rawXML, onBegin;
function TopTenPrompt (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.TopTenClip.create(container, CLIP_LINKAGE, 0);
clip.onReplay = mx.utils.Delegate.create(this, clipReplayHandler);
clip._x = X_POS;
clip._y = Y_POS;
rawXML = new XML();
rawXML.ignoreWhite = true;
rawXML.onLoad = mx.utils.Delegate.create(this, updateDisplay);
rawXML.load(com.mtv.skateGame2.Main.TOP_TEN_URL);
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function clipReplayHandler() {
onBegin();
}
function updateDisplay(success) {
if (!success) {
clip.__set__msg("FAILED TO LOAD TOP TEN");
return(undefined);
}
var _local3 = com.schelterstudios.utils.XMLObject.XMLToObject(rawXML).topTen[0].rank;
var _local4 = "";
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local2 != 0) {
_local4 = _local4 + newline;
}
_local4 = _local4 + (((((_local2 + 1) + ". ") + _local3[_local2].name) + " - ") + _local3[_local2].score);
_local2++;
}
clip.__set__msg(_local4);
}
static var CLIP_LINKAGE = "topTen";
static var X_POS = 320;
static var Y_POS = 255;
}
Symbol 369 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.TopTenClip] Frame 0
class com.mtv.skateGame2.displays.clips.TopTenClip extends MovieClip
{
var msgField, __get__msg, onReplay;
function TopTenClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.TopTenClip(mc.attachMovie(link, "TopTenClip" + depth, depth, obj));
return(_local1);
}
function set msg(s) {
_msg = s;
msgField.text = s;
//return(__get__msg());
}
function registerClip(type, clip) {
switch (type) {
case "replay" :
clip.onRelease = mx.utils.Delegate.create(this, replayHandler);
break;
default :
trace(("WARNING: " + type) + " is not a valid movieclip");
}
}
function registerField(type, field) {
switch (type) {
case "message" :
msgField = field;
msgField.text = _msg;
break;
default :
trace(("WARNING: " + type) + " is not a valid textfield");
}
}
function replayHandler() {
onReplay();
}
var _msg = "";
}
Symbol 370 MovieClip [__Packages.com.schelterstudios.utils.XMLObject] Frame 0
class com.schelterstudios.utils.XMLObject
{
function XMLObject () {
}
static function XMLToObject(src) {
return(XMLToObjectRecursion(src));
}
static function objectToXML(obj) {
var _local1 = new XML();
objectToXMLRecursion(obj, _local1, _local1);
return(_local1);
}
static function XMLToObjectRecursion(nodeData) {
var _local3 = new Object();
for (var _local1 in nodeData.attributes) {
_local3[_local1] = nodeData.attributes[_local1];
}
var _local4 = nodeData.childNodes;
if (_local4[0].nodeValue == null) {
var _local1 = 0;
while (_local1 < _local4.length) {
var _local2 = _local4[_local1].nodeName;
if (_local3[_local2] == undefined) {
_local3[_local2] = new Array();
}
_local3[_local2].push(XMLToObjectRecursion(_local4[_local1]));
_local1++;
}
return(_local3);
}
return(_local4[0].nodeValue);
}
static function objectToXMLRecursion(subObj, node, root) {
switch (typeof(subObj)) {
case "string" :
case "number" :
case "boolean" :
var _local2 = root.createTextNode(subObj.toString());
node.appendChild(_local2);
break;
default :
for (var _local6 in subObj) {
if (subObj[_local6] instanceof Array) {
var _local1 = 0;
while (_local1 < subObj[_local6].length) {
_local2 = root.createElement(_local6);
node.appendChild(_local2);
objectToXMLRecursion(subObj[_local6][_local1], _local2, root);
_local1++;
}
} else {
node.attributes[_local6] = subObj[_local6];
}
}
}
}
}
Symbol 371 MovieClip [__Packages.com.mtv.skateGame2.displays.PreLevelPrompt] Frame 0
class com.mtv.skateGame2.displays.PreLevelPrompt extends com.mtv.skateGame2.DisplayObject
{
var clip, container, model, timeout, onTimeout;
function PreLevelPrompt (mc) {
super(mc);
}
function setModel(model) {
super.setModel(model);
init();
}
function init() {
clip = container.attachMovie(CLIP_PREFIX + model.__get__level(), "prelevel", 0);
clip.onPress = mx.utils.Delegate.create(this, playLevel);
clip._x = X_POS;
clip._y = Y_POS;
clip._xscale = (clip._yscale = SCALE);
com.mtv.skateGame2.utils.KeyManager.addListener(this);
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
com.mtv.skateGame2.utils.KeyManager.removeListener(this);
}
function playLevel() {
_global.clearTimeout(timeout);
onTimeout();
}
function onKeyPressed(args) {
if (!(args.key === 32)) {
} else {
playLevel();
}
}
static var CLIP_PREFIX = "prelevel";
static var X_POS = 43;
static var Y_POS = -4;
static var SCALE = 150;
static var DELAY = 6000;
}
Symbol 372 MovieClip [__Packages.com.mtv.skateGame2.displays.GameOverPrompt] Frame 0
class com.mtv.skateGame2.displays.GameOverPrompt extends com.mtv.skateGame2.DisplayObject
{
var clip, container, loadvars, onSubmit, onBegin;
function GameOverPrompt (mc) {
super(mc);
init();
}
function init() {
clip = com.mtv.skateGame2.displays.clips.GameOverClip.create(container, CLIP_LINKAGE, 0);
clip.onSubmit = mx.utils.Delegate.create(this, clipSubmitHandler);
clip.onReplay = mx.utils.Delegate.create(this, clipReplayHandler);
clip._x = X_POS;
clip._y = Y_POS;
loadvars = new LoadVars();
loadvars.onLoad = mx.utils.Delegate.create(this, loadHandler);
}
function remove() {
clip.removeMovieClip();
container.removeMovieClip();
}
function setModel(model) {
super.setModel(model);
loadvars.score = model.score;
clip.__set__score(loadvars.score.toString());
var _local4 = com.mtv.skateGame2.Main.GAMEOVER_MESSAGES;
if (model.__get__lives() < 0) {
clip.__set__msg(_local4[0].message);
} else {
var _local3 = _local4.length - 1;
while (_local3 > 0) {
if (_local4[_local3].score <= model.score) {
clip.__set__msg(_local4[_local3].message);
break;
}
_local3--;
}
}
}
function clipSubmitHandler() {
trace("PERFORM SUBMIT EVENT");
loadvars.user = clip.user;
loadvars.sendAndLoad(com.mtv.skateGame2.Main.SUBMIT_SCORE_URL, loadvars);
}
function loadHandler() {
onSubmit();
}
function clipReplayHandler() {
onBegin();
}
static var CLIP_LINKAGE = "gameOver";
static var X_POS = 0;
static var Y_POS = 10;
}
Symbol 373 MovieClip [__Packages.com.mtv.skateGame2.displays.clips.GameOverClip] Frame 0
class com.mtv.skateGame2.displays.clips.GameOverClip extends MovieClip
{
var msgField, __get__msg, scoreField, __get__score, userField, onSubmit, onReplay;
function GameOverClip () {
super();
}
static function create(mc, link, depth, obj) {
var _local1 = com.mtv.skateGame2.displays.clips.GameOverClip(mc.attachMovie(link, "GameOverClip" + depth, depth, obj));
trace("game over " + _local1);
return(_local1);
}
function set msg(s) {
_msg = s;
msgField.text = s;
//return(__get__msg());
}
function set score(s) {
_score = s;
scoreField.text = s;
//return(__get__score());
}
function get user() {
return(userField.text);
}
function registerClip(type, clip) {
switch (type) {
case "submitScore" :
clip.onRelease = mx.utils.Delegate.create(this, submitHandler);
break;
case "replay" :
clip.onRelease = mx.utils.Delegate.create(this, replayHandler);
break;
default :
trace(("WARNING: " + type) + " is not a valid movieclip");
}
}
function registerField(type, field) {
switch (type) {
case "message" :
msgField = field;
msgField.text = _msg;
break;
case "score" :
scoreField = field;
scoreField.text = _score;
break;
case "user" :
userField = field;
break;
default :
trace(("WARNING: " + type) + " is not a valid textfield");
}
}
function submitHandler() {
onSubmit();
}
function replayHandler() {
onReplay();
}
var _msg = "";
var _score = "";
}