Section 1
//Camera3d (_3d.Camera3d)
package _3d {
public class Camera3d extends System3d {
public var zoomHei2:Number;
public var zoomWid2:Number;
public var d:Number;
private var tp:Vector;
private var tv:Vector;
public function Camera3d(_arg1:Number=1000, _arg2:Number=600){
o = new Vector();
d = 1500;
zoomWid2 = (_arg1 / 2);
zoomHei2 = (_arg2 / 2);
tv = new Vector();
tp = new Vector();
}
public function follow(_arg1:System3d, _arg2:Vector, _arg3:Vector, _arg4:Vector):void{
_arg1.thisToRoot(_arg2, o);
_arg1.vThisToRoot(_arg3, vx);
_arg1.vThisToRoot(_arg4, vy);
vx.normalize();
vy.normalize();
vz = vx.cross(vy);
updateInM();
}
public function follow2(_arg1:System3d, _arg2:Vector, _arg3:Vector, _arg4):void{
_arg1.thisToRoot(_arg2, o);
tp.x = (_arg3.x - _arg2.x);
tp.y = (_arg3.y - _arg2.y);
_arg1.vThisToRoot(tp, vx);
_arg1.vThisToRoot(_arg4, vy);
vx.normalize();
vy.normalize();
vz = vx.cross(vy);
updateInM();
}
}
}//package _3d
Section 2
//Matrix (_3d.Matrix)
package _3d {
public class Matrix {
public var _12:Number;
public var _11:Number;
public var _13:Number;
public var _14:Number;
public var _32:Number;
public var _41:Number;
public var _42:Number;
public var _21:Number;
public var _22:Number;
public var _23:Number;
public var _24:Number;
public var _43:Number;
public var _44:Number;
public var _34:Number;
public var _31:Number;
public var _33:Number;
public static var initObj:Object = firstInit();
public function Matrix(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0, _arg13:Number=0, _arg14:Number=0, _arg15:Number=0, _arg16:Number=1){
_11 = _arg1;
_12 = _arg2;
_13 = _arg3;
_14 = _arg4;
_21 = _arg5;
_22 = _arg6;
_23 = _arg7;
_24 = _arg8;
_31 = _arg9;
_32 = _arg10;
_33 = _arg11;
_34 = _arg12;
_41 = _arg13;
_42 = _arg14;
_43 = _arg15;
_44 = _arg16;
}
public function transformTo(_arg1:Vector, _arg2:Vector):void{
_arg2.setValues(((((_arg1.x * _11) + (_arg1.y * _21)) + (_arg1.z * _31)) + _41), ((((_arg1.x * _12) + (_arg1.y * _22)) + (_arg1.z * _32)) + _42), ((((_arg1.x * _13) + (_arg1.y * _23)) + (_arg1.z * _33)) + _43));
}
public function setValues(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0, _arg13:Number=0, _arg14:Number=0, _arg15:Number=0, _arg16:Number=1){
_11 = _arg1;
_12 = _arg2;
_13 = _arg3;
_14 = _arg4;
_21 = _arg5;
_22 = _arg6;
_23 = _arg7;
_24 = _arg8;
_31 = _arg9;
_32 = _arg10;
_33 = _arg11;
_34 = _arg12;
_41 = _arg13;
_42 = _arg14;
_43 = _arg15;
_44 = _arg16;
}
public function transform(_arg1:Vector):void{
_arg1.setValues(((((_arg1.x * _11) + (_arg1.y * _21)) + (_arg1.z * _31)) + _41), ((((_arg1.x * _12) + (_arg1.y * _22)) + (_arg1.z * _32)) + _42), ((((_arg1.x * _13) + (_arg1.y * _23)) + (_arg1.z * _33)) + _43));
}
public function toString():String{
return (((((((((((((((((((((((((((((((((((("(" + _11) + ",") + _12) + ",") + _13) + ",") + _14) + "),\r") + "(") + _21) + ",") + _22) + ",") + _23) + ",") + _24) + "),\r") + "(") + _31) + ",") + _32) + ",") + _33) + ",") + _34) + "),\r") + "(") + _41) + ",") + _42) + ",") + _43) + ",") + _44) + ")\r"));
}
public static function firstInit():Object{
return (null);
}
public static function product(_arg1:Matrix, _arg2:Matrix):Matrix{
return (new Matrix(((((_arg1._11 * _arg2._11) + (_arg1._12 * _arg2._21)) + (_arg1._13 * _arg2._31)) + (_arg1._14 * _arg2._41)), ((((_arg1._11 * _arg2._12) + (_arg1._12 * _arg2._22)) + (_arg1._13 * _arg2._32)) + (_arg1._14 * _arg2._42)), ((((_arg1._11 * _arg2._13) + (_arg1._12 * _arg2._23)) + (_arg1._13 * _arg2._33)) + (_arg1._14 * _arg2._43)), ((((_arg1._11 * _arg2._14) + (_arg1._12 * _arg2._24)) + (_arg1._13 * _arg2._34)) + (_arg1._14 * _arg2._44)), ((((_arg1._21 * _arg2._11) + (_arg1._22 * _arg2._21)) + (_arg1._23 * _arg2._31)) + (_arg1._24 * _arg2._41)), ((((_arg1._21 * _arg2._12) + (_arg1._22 * _arg2._22)) + (_arg1._23 * _arg2._32)) + (_arg1._24 * _arg2._42)), ((((_arg1._21 * _arg2._13) + (_arg1._22 * _arg2._23)) + (_arg1._23 * _arg2._33)) + (_arg1._24 * _arg2._43)), ((((_arg1._21 * _arg2._14) + (_arg1._22 * _arg2._24)) + (_arg1._23 * _arg2._34)) + (_arg1._24 * _arg2._44)), ((((_arg1._31 * _arg2._11) + (_arg1._32 * _arg2._21)) + (_arg1._33 * _arg2._31)) + (_arg1._34 * _arg2._41)), ((((_arg1._31 * _arg2._12) + (_arg1._32 * _arg2._22)) + (_arg1._33 * _arg2._32)) + (_arg1._34 * _arg2._42)), ((((_arg1._31 * _arg2._13) + (_arg1._32 * _arg2._23)) + (_arg1._33 * _arg2._33)) + (_arg1._34 * _arg2._43)), ((((_arg1._31 * _arg2._14) + (_arg1._32 * _arg2._24)) + (_arg1._33 * _arg2._34)) + (_arg1._34 * _arg2._44)), ((((_arg1._41 * _arg2._11) + (_arg1._42 * _arg2._21)) + (_arg1._43 * _arg2._31)) + (_arg1._44 * _arg2._41)), ((((_arg1._41 * _arg2._12) + (_arg1._42 * _arg2._22)) + (_arg1._43 * _arg2._32)) + (_arg1._44 * _arg2._42)), ((((_arg1._41 * _arg2._13) + (_arg1._42 * _arg2._23)) + (_arg1._43 * _arg2._33)) + (_arg1._44 * _arg2._43)), ((((_arg1._41 * _arg2._14) + (_arg1._42 * _arg2._24)) + (_arg1._43 * _arg2._34)) + (_arg1._44 * _arg2._44))));
}
public static function productSet(_arg1:Matrix, _arg2:Matrix, _arg3:Matrix):void{
_arg3.setValues(((((_arg1._11 * _arg2._11) + (_arg1._12 * _arg2._21)) + (_arg1._13 * _arg2._31)) + (_arg1._14 * _arg2._41)), ((((_arg1._11 * _arg2._12) + (_arg1._12 * _arg2._22)) + (_arg1._13 * _arg2._32)) + (_arg1._14 * _arg2._42)), ((((_arg1._11 * _arg2._13) + (_arg1._12 * _arg2._23)) + (_arg1._13 * _arg2._33)) + (_arg1._14 * _arg2._43)), ((((_arg1._11 * _arg2._14) + (_arg1._12 * _arg2._24)) + (_arg1._13 * _arg2._34)) + (_arg1._14 * _arg2._44)), ((((_arg1._21 * _arg2._11) + (_arg1._22 * _arg2._21)) + (_arg1._23 * _arg2._31)) + (_arg1._24 * _arg2._41)), ((((_arg1._21 * _arg2._12) + (_arg1._22 * _arg2._22)) + (_arg1._23 * _arg2._32)) + (_arg1._24 * _arg2._42)), ((((_arg1._21 * _arg2._13) + (_arg1._22 * _arg2._23)) + (_arg1._23 * _arg2._33)) + (_arg1._24 * _arg2._43)), ((((_arg1._21 * _arg2._14) + (_arg1._22 * _arg2._24)) + (_arg1._23 * _arg2._34)) + (_arg1._24 * _arg2._44)), ((((_arg1._31 * _arg2._11) + (_arg1._32 * _arg2._21)) + (_arg1._33 * _arg2._31)) + (_arg1._34 * _arg2._41)), ((((_arg1._31 * _arg2._12) + (_arg1._32 * _arg2._22)) + (_arg1._33 * _arg2._32)) + (_arg1._34 * _arg2._42)), ((((_arg1._31 * _arg2._13) + (_arg1._32 * _arg2._23)) + (_arg1._33 * _arg2._33)) + (_arg1._34 * _arg2._43)), ((((_arg1._31 * _arg2._14) + (_arg1._32 * _arg2._24)) + (_arg1._33 * _arg2._34)) + (_arg1._34 * _arg2._44)), ((((_arg1._41 * _arg2._11) + (_arg1._42 * _arg2._21)) + (_arg1._43 * _arg2._31)) + (_arg1._44 * _arg2._41)), ((((_arg1._41 * _arg2._12) + (_arg1._42 * _arg2._22)) + (_arg1._43 * _arg2._32)) + (_arg1._44 * _arg2._42)), ((((_arg1._41 * _arg2._13) + (_arg1._42 * _arg2._23)) + (_arg1._43 * _arg2._33)) + (_arg1._44 * _arg2._43)), ((((_arg1._41 * _arg2._14) + (_arg1._42 * _arg2._24)) + (_arg1._43 * _arg2._34)) + (_arg1._44 * _arg2._44)));
}
}
}//package _3d
Section 3
//RootSystem (_3d.RootSystem)
package _3d {
public class RootSystem extends System3d {
public var camera:Camera3d;
public function RootSystem(){
rootSystem = this;
camera = new Camera3d();
}
override public function toString():String{
return ("根系统");
}
override public function update():void{
var _local1:*;
for each (_local1 in sysArr) {
_local1.update();
};
}
}
}//package _3d
Section 4
//Sp3d (_3d.Sp3d)
package _3d {
import flash.display.*;
public class Sp3d extends System3d {
private var __scale:Number;
private var tp:Vector;
public var body:MovieClip;
public function Sp3d(_arg1:Vector=null){
super(_arg1);
tp = new Vector();
if (this.numChildren == 1){
body = MovieClip(this.getChildAt(0));
};
}
public function redraw(_arg1:Camera3d):void{
thisToScreen(P0, tp, _arg1);
body.x = tp.y;
body.y = tp.z;
scale = (_arg1.d / tp.x);
}
public function removeDelay(_arg1:int=0):void{
if (_arg1 > 0){
} else {
_arg1 = body.totalFrames;
};
Global.addRun("Sp3d removeDelay()", _removeDelay, _arg1, 1);
}
public function get scale():Number{
return (__scale);
}
public function _removeDelay(_arg1:int):void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function set scale(_arg1:Number):void{
body.scaleX = (body.scaleY = (__scale = _arg1));
}
}
}//package _3d
Section 5
//System3d (_3d.System3d)
package _3d {
import flash.display.*;
public class System3d extends Sprite {
public var vConcatenatedMatrix:Matrix;
public var sysArr:Array;
public var o:Vector;
public var oCamera:Vector;
private var tp:Vector;
public var inMatrix:Matrix;
public var dCamera:Number;
public var outMatrix:Matrix;
public var vx:Vector;
public var vy:Vector;
public var parentSys;
public var vz:Vector;
public var vOutMatrix:Matrix;
public var vInMatrix:Matrix;
public var concatenatedMatrix:Matrix;
public static const P0:Vector = new Vector();
public static const SQRT3:Number = Math.sqrt(3);
public static const SQRT1_3:Number = Math.sqrt((1 / 3));
public static var rootSystem:RootSystem;
public function System3d(_arg1:Vector=null){
oCamera = new Vector();
if (_arg1 == null){
o = new Vector();
} else {
o = _arg1.clone();
};
vx = new Vector(1, 0, 0);
vy = new Vector(0, 1, 0);
vz = new Vector(0, 0, 1);
sysArr = new Array();
concatenatedMatrix = new Matrix();
vConcatenatedMatrix = new Matrix();
outMatrix = new Matrix();
vOutMatrix = new Matrix();
inMatrix = new Matrix();
vInMatrix = new Matrix();
tp = new Vector();
}
public function drawAxis(_arg1:Number=400):void{
var _local2:Vector;
var _local3:Vector;
var _local4:Vector;
var _local5:Vector;
_local2 = new Vector();
_local3 = new Vector();
_local4 = new Vector();
_local5 = new Vector();
thisToScreen(P0, _local2, rootSystem.camera);
thisToScreen(new Vector(_arg1, 0, 0), _local3, rootSystem.camera);
thisToScreen(new Vector(0, _arg1, 0), _local4, rootSystem.camera);
thisToScreen(new Vector(0, 0, _arg1), _local5, rootSystem.camera);
this.graphics.lineStyle(1, 0xFF0000);
this.graphics.moveTo(_local2.y, _local2.z);
this.graphics.lineTo(_local3.y, _local3.z);
this.graphics.lineStyle(1, 0xFF00);
this.graphics.moveTo(_local2.y, _local2.z);
this.graphics.lineTo(_local4.y, _local4.z);
this.graphics.lineStyle(1, 0xFF);
this.graphics.moveTo(_local2.y, _local2.z);
this.graphics.lineTo(_local5.y, _local5.z);
}
public function addSystem(_arg1:System3d):void{
this.addChild(_arg1);
_arg1.parentSys = this;
sysArr.push(_arg1);
}
public function thisToRoot(_arg1:Vector, _arg2:Vector):void{
concatenatedMatrix.transformTo(_arg1, _arg2);
}
public function thisToCamera(_arg1:Vector, _arg2:Vector, _arg3:Camera3d):void{
concatenatedMatrix.transformTo(_arg1, tp);
_arg3.inMatrix.transformTo(tp, _arg2);
}
public function updateInM():void{
inMatrix.setValues(vx.x, vy.x, vz.x, 0, vx.y, vy.y, vz.y, 0, vx.z, vy.z, vz.z, 0, -(vx.dot(o)), -(vy.dot(o)), -(vz.dot(o)), 1);
vInMatrix.setValues(vx.x, vy.x, vz.x, 0, vx.y, vy.y, vz.y, 0, vx.z, vy.z, vz.z, 0, 0, 0, 0, 1);
}
public function revolutiony(_arg1:Number):void{
o.revolutiony(_arg1);
vx.revolutiony(_arg1);
vy.revolutiony(_arg1);
vz.revolutiony(_arg1);
}
public function revolutionx(_arg1:Number):void{
o.revolutionx(_arg1);
vx.revolutionx(_arg1);
vy.revolutionx(_arg1);
vz.revolutionx(_arg1);
}
public function revolutionz(_arg1:Number):void{
o.revolutionz(_arg1);
vx.revolutionz(_arg1);
vy.revolutionz(_arg1);
vz.revolutionz(_arg1);
}
public function updateOutM():void{
outMatrix.setValues(vx.x, vx.y, vx.z, 0, vy.x, vy.y, vy.z, 0, vz.x, vz.y, vz.z, 0, o.x, o.y, o.z, 1);
vOutMatrix.setValues(vx.x, vx.y, vx.z, 0, vy.x, vy.y, vy.z, 0, vz.x, vz.y, vz.z, 0, 0, 0, 0, 1);
}
public function vThisToRoot(_arg1:Vector, _arg2:Vector):void{
vConcatenatedMatrix.transformTo(_arg1, _arg2);
}
public function rotatey(_arg1:Number):void{
vx.revolutionv(vy, _arg1);
vz.revolutionv(vy, _arg1);
}
public function thisToScreen(_arg1:Vector, _arg2:Vector, _arg3:Camera3d):void{
concatenatedMatrix.transformTo(_arg1, tp);
_arg3.inMatrix.transformTo(tp, _arg2);
cameraToScreen(_arg2, _arg2, _arg3);
}
public function rotatex(_arg1:Number):void{
vy.revolutionv(vx, _arg1);
vz.revolutionv(vx, _arg1);
}
public function rotatez(_arg1:Number):void{
vx.revolutionv(vz, _arg1);
vy.revolutionv(vz, _arg1);
}
public function revolutionv(_arg1:Vector, _arg2:Number):void{
o.revolutionv(_arg1, _arg2);
vx.revolutionv(_arg1, _arg2);
vy.revolutionv(_arg1, _arg2);
vz.revolutionv(_arg1, _arg2);
}
public function update():void{
var _local1:System3d;
updateOutM();
Matrix.productSet(outMatrix, parentSys.concatenatedMatrix, concatenatedMatrix);
Matrix.productSet(vOutMatrix, parentSys.vConcatenatedMatrix, vConcatenatedMatrix);
Common.dumpArr(sysArr);
for each (_local1 in sysArr) {
_local1.update();
};
}
public function removeSystem(_arg1:System3d):void{
this.removeChild(_arg1);
sysArr[sysArr.indexOf(_arg1)] = null;
}
public static function rootToScreen(_arg1:Vector, _arg2:Vector, _arg3:Camera3d):void{
_arg3.inMatrix.transformTo(_arg1, _arg2);
cameraToScreen(_arg2, _arg2, _arg3);
}
public static function cameraToScreen(_arg1:Vector, _arg2:Vector, _arg3:Camera3d):void{
_arg2.setValues(_arg1.x, (-(Math.atan2(_arg1.y, _arg1.x)) * _arg3.d), (-(Math.atan2(_arg1.z, _arg1.x)) * _arg3.d));
}
}
}//package _3d
Section 6
//Vector (_3d.Vector)
package _3d {
public class Vector {
public var x:Number;
public var y:Number;
public var z:Number;
public static var initObj:Object = firstInit();
public static var tm:Matrix;
public function Vector(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = _arg1;
y = _arg2;
z = _arg3;
}
public function cross(_arg1:Vector):Vector{
return (new Vector(((y * _arg1.z) - (z * _arg1.y)), ((z * _arg1.x) - (x * _arg1.z)), ((x * _arg1.y) - (y * _arg1.x))));
}
public function copyFrom(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function dot(_arg1:Vector):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function simple(_arg1:Number):void{
x = (Math.round((x / _arg1)) * _arg1);
y = (Math.round((y / _arg1)) * _arg1);
z = (Math.round((z / _arg1)) * _arg1);
}
public function revolutionv(_arg1:Vector, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local3 = Math.cos(-(_arg2));
_local4 = Math.sin(-(_arg2));
_local5 = (_arg1.x * _local4);
_local6 = (_arg1.y * _local4);
_local7 = (_arg1.z * _local4);
_local8 = (((1 - _local3) * _arg1.x) * _arg1.x);
_local9 = (((1 - _local3) * _arg1.x) * _arg1.y);
_local10 = (((1 - _local3) * _arg1.x) * _arg1.z);
_local11 = (((1 - _local3) * _arg1.y) * _arg1.y);
_local12 = (((1 - _local3) * _arg1.y) * _arg1.z);
_local13 = (((1 - _local3) * _arg1.z) * _arg1.z);
tm.setValues((_local3 + _local8), (_local9 - _local7), (_local10 + _local6), 0, (_local9 + _local7), (_local3 + _local11), (_local12 - _local5), 0, (_local10 - _local6), (_local12 + _local5), (_local3 + _local13), 0, 0, 0, 0, 1);
tm.transform(this);
}
public function revolutiony(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = z;
_local5 = x;
z = ((_local4 * _local2) - (_local5 * _local3));
x = ((_local4 * _local3) + (_local5 * _local2));
}
public function revolutionz(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = x;
_local5 = y;
x = ((_local4 * _local2) - (_local5 * _local3));
y = ((_local4 * _local3) + (_local5 * _local2));
}
public function offset(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = (x + _arg1);
y = (y + _arg2);
z = (z + _arg3);
}
public function subtract(_arg1:Vector):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function revolutionx(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = y;
_local5 = z;
y = ((_local4 * _local2) - (_local5 * _local3));
z = ((_local4 * _local3) + (_local5 * _local2));
}
public function normalize(_arg1:Number=1):void{
var _local2:Number;
var _local3:Number;
_local2 = (((x * x) + (y * y)) + (z * z));
if (_local2 == 0){
return;
};
_local3 = (_arg1 / Math.sqrt(_local2));
x = (x * _local3);
y = (y * _local3);
z = (z * _local3);
}
public function clone():Vector{
return (new Vector(x, y, z));
}
public function add(_arg1:Vector):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function setValues(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function get length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function toString():String{
return ((((((("(" + x) + ",") + y) + ",") + z) + ")"));
}
public function mult(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function equals(_arg1:Object):Boolean{
return ((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z))));
}
public static function firstInit():Object{
tm = new Matrix();
return (null);
}
public static function normalize_(_arg1:Vector, _arg2:Number=1):Vector{
_arg1 = _arg1.clone();
_arg1.normalize(_arg2);
return (_arg1);
}
public static function crossSet(_arg1:Vector, _arg2:Vector, _arg3:Vector):void{
_arg3.setValues(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function subtract_(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function getVByK(_arg1:Vector, _arg2:Vector, _arg3:Number, _arg4:Vector):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (_arg3 == 0){
_arg4.copyFrom(_arg1);
} else {
if (_arg3 == 1){
_arg4.copyFrom(_arg2);
} else {
if ((((_arg3 > 0)) && ((_arg3 < 1)))){
_local5 = Math.tan((toAngle(_arg1, _arg2) * _arg3));
trace(("t=" + _local5));
_local6 = _arg1.x;
_local7 = _arg1.y;
_local8 = _arg1.z;
_local9 = _arg2.x;
_local10 = _arg2.y;
_local11 = _arg2.z;
_local12 = (((((((_local6 * _local10) - (_local7 * _local9)) + (_local7 * _local11)) - (_local8 * _local10)) + (_local8 * _local9)) - (_local6 * _local11)) / _local5);
_arg4.x = ((_local6 * _local12) - ((_local7 * ((_local6 * _local10) - (_local9 * _local7))) + (_local8 * ((_local6 * _local11) - (_local8 * _local9)))));
_arg4.y = ((_local7 * _local12) - ((_local8 * ((_local7 * _local11) - (_local10 * _local8))) + (_local6 * ((_local7 * _local9) - (_local6 * _local10)))));
_arg4.z = ((_local8 * _local12) - ((_local6 * ((_local8 * _local9) - (_local11 * _local6))) + (_local7 * ((_local8 * _local10) - (_local7 * _local11)))));
_arg4.normalize();
} else {
trace("k不正常");
};
};
};
}
public static function distance(_arg1:Vector, _arg2:Vector):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
_local5 = (_arg1.z - _arg2.z);
return (Math.sqrt((((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5))));
}
public static function dot_(_arg1:Vector, _arg2:Vector):Number{
return (_arg1.dot(_arg2));
}
public static function toAngle(_arg1:Vector, _arg2:Vector):Number{
return (Math.atan2(((((((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)) + (_arg1.y * _arg2.z)) - (_arg1.z * _arg2.y)) + (_arg1.z * _arg2.x)) - (_arg1.x * _arg2.z)), _arg1.dot(_arg2)));
}
public static function add_(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function cross_(_arg1:Vector, _arg2:Vector):Vector{
return (_arg1.cross(_arg2));
}
}
}//package _3d
Section 7
//Mc (basic.Mc)
package basic {
import flash.display.*;
import flash.events.*;
public class Mc extends MovieClip {
public function Mc(){
this.addEventListener(Event.REMOVED_FROM_STAGE, _removed, false, 0, true);
}
public function _removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, _removed);
removed();
}
public function removed():void{
}
}
}//package basic
Section 8
//Sp (basic.Sp)
package basic {
import flash.display.*;
import flash.events.*;
public class Sp extends Sprite {
public function Sp(){
this.addEventListener(Event.REMOVED_FROM_STAGE, _removed, false, 0, true);
}
public function _removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, _removed);
removed();
}
public function removed():void{
}
}
}//package basic
Section 9
//ColorTween (effect.ColorTween)
package effect {
import flash.display.*;
public class ColorTween {
public var onTween:Function;
private var gT:int;
private var colorT:Color;
private var color:Color;
private var rT:int;
private var bT:int;
public var onMov:Function;
private var dspObj:DisplayObject;
private var minD:Number;
private var u:Number;
public function ColorTween(_arg1, _arg2:Number=0.2, _arg3:Number=1){
var _dspObj = _arg1;
var _u = _arg2;
var _minD = _arg3;
super();
dspObj = _dspObj;
u = _u;
minD = _minD;
onMov = function (){
};
onTween = function (){
};
color = new Color();
colorT = new Color(Common.getRGB(dspObj));
}
public function stop():void{
Global.delRun(run);
}
public function run(_arg1:int):void{
var _local2:int;
if (dspObj.root == null){
stop();
return;
};
_local2 = Common.getRGB(dspObj);
color.color = colorT.color;
color.subtract(_local2);
color.mult(u);
if ((((((Math.abs(color.r) <= minD)) && ((Math.abs(color.g) <= minD)))) && ((Math.abs(color.b) <= minD)))){
stop();
Common.setRGB(dspObj, colorT.color);
onMov(dspObj);
onTween(dspObj);
} else {
color.add(_local2);
Common.setRGB(dspObj, color.color);
onMov(dspObj);
};
}
public function movTo(_arg1:int):void{
colorT.color = _arg1;
Global.addRun("ColorteTween run()", run);
}
}
}//package effect
class Color {
public var b:int;
private var __color:int;
public var r:int;
public var g:int;
private function Color(_arg1:int=0){
color = _arg1;
}
public function add(_arg1:int):void{
r = (r + ((_arg1 & 0xFF0000) >> 16));
g = (g + ((_arg1 & 0xFF00) >> 8));
b = (b + (_arg1 & 0xFF));
__color = (((r << 16) + (g << 8)) + b);
}
public function get color():int{
return (__color);
}
public function set color(_arg1:int):void{
__color = _arg1;
r = ((__color & 0xFF0000) >> 16);
g = ((__color & 0xFF00) >> 8);
b = (__color & 0xFF);
}
public function mult(_arg1:Number):void{
r = (r * _arg1);
g = (g * _arg1);
b = (b * _arg1);
}
public function subtract(_arg1:int):void{
r = (r - ((_arg1 & 0xFF0000) >> 16));
g = (g - ((_arg1 & 0xFF00) >> 8));
b = (b - (_arg1 & 0xFF));
__color = 0;
}
}
Section 10
//RotateTween (effect.RotateTween)
package effect {
import flash.display.*;
public class RotateTween {
private var u:Number;
private var rotaT:Number;
private var dRota:Number;
private var minD:Number;
public var onTween:Function;
public var onMov:Function;
private var dspObj:DisplayObject;
public function RotateTween(_arg1, _arg2:Number=0.5, _arg3:Number=1){
var _dspObj = _arg1;
var _u = _arg2;
var _minD = _arg3;
super();
dspObj = _dspObj;
u = _u;
minD = _minD;
onMov = function (){
};
onTween = function (){
};
}
public function stop():void{
Global.delRun(run);
}
public function run(_arg1:int):void{
if (dspObj.root == null){
stop();
return;
};
if (Math.abs(dRota) < minD){
stop();
dspObj.rotation = rotaT;
onMov(dspObj);
onTween(dspObj);
} else {
dspObj.rotation = (dspObj.rotation + (dRota * u));
dRota = (dRota * (1 - u));
onMov(dspObj);
};
}
public function movTo(_arg1:Number):void{
rotaT = _arg1;
dRota = (rotaT - dspObj.rotation);
while (dRota < -180) {
dRota = (dRota + 360);
};
while (dRota > 180) {
dRota = (dRota - 360);
};
Global.addRun("RotateTween run()", run);
}
}
}//package effect
Section 11
//ScaleTween (effect.ScaleTween)
package effect {
import flash.display.*;
public class ScaleTween {
private var scaleT:Number;
private var minD:Number;
public var onTween:Function;
public var onMov:Function;
private var dspObj:DisplayObject;
private var u:Number;
public function ScaleTween(_arg1, _arg2:Number=0.5, _arg3:Number=0.05){
var _dspObj = _arg1;
var _u = _arg2;
var _minD = _arg3;
super();
dspObj = _dspObj;
u = _u;
minD = _minD;
onMov = function (){
};
onTween = function (){
};
}
public function stop():void{
Global.delRun(run);
}
public function run(_arg1:int):void{
var _local2:Number;
if (dspObj.root == null){
stop();
return;
};
_local2 = (scaleT - dspObj.scaleX);
if (Math.abs(_local2) < minD){
stop();
dspObj.scaleX = (dspObj.scaleY = scaleT);
onMov(dspObj);
onTween(dspObj);
} else {
dspObj.scaleX = (dspObj.scaleY = (dspObj.scaleY + (_local2 * u)));
onMov(dspObj);
};
}
public function movTo(_arg1:Number):void{
scaleT = _arg1;
Global.addRun("ScaleteTween run()", run);
}
}
}//package effect
Section 12
//ScreenShake (effect.ScreenShake)
package effect {
import flash.display.*;
public class ScreenShake {
private var yShake:Number;
private var xShake:Number;
private var dspObjY0:Number;
private var dspObjX0:Number;
private var dspObj:MovieClip;
public function ScreenShake(_arg1){
dspObj = _arg1;
dspObjX0 = dspObj.x;
dspObjY0 = dspObj.y;
trace(("dspObj=" + dspObj));
}
public function shake(_arg1:Number=NaN, _arg2:Number=NaN):void{
var _local3:Number;
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
_local3 = (Math.random() * (Math.PI * 2));
_arg1 = (Math.cos(_local3) * 20);
_arg2 = (Math.sin(_local3) * 20);
};
xShake = _arg1;
yShake = _arg2;
Global.addRun("ScreenShake run()", run);
}
private function run(_arg1:int):void{
if (dspObj.root == null){
Global.delRun(run);
return;
};
if (Global.pause){
return;
};
xShake = (xShake - (xShake * 1.8));
yShake = (yShake - (yShake * 1.8));
dspObj.x = (dspObjX0 + xShake);
dspObj.y = (dspObjY0 + yShake);
if (((xShake * xShake) + (yShake * yShake)) < 5){
xShake = (yShake = 0);
dspObj.x = dspObjX0;
dspObj.y = dspObjY0;
Global.delRun(run);
};
}
}
}//package effect
Section 13
//TweenMenu (effect.TweenMenu)
package effect {
import flash.display.*;
import flash.geom.*;
public class TweenMenu {
private var stArr:Array;
private var right:Number;
private var wid0:Number;
private var maxScale:Number;
private var menus_sp:Sprite;
private var itemArr:Array;
private var left:Number;
private var totalItem:int;
public function TweenMenu(_arg1:Sprite, _arg2:Number=1.2){
var _local3:Rectangle;
var _local4:int;
super();
menus_sp = _arg1;
totalItem = menus_sp.numChildren;
itemArr = new Array(totalItem);
stArr = new Array(totalItem);
maxScale = _arg2;
_local3 = menus_sp.getBounds(menus_sp);
left = _local3.x;
right = (_local3.x + _local3.width);
wid0 = (right - left);
_local4 = 0;
while (_local4 < totalItem) {
stArr[_local4] = new ScaleTween((itemArr[_local4] = menus_sp.getChildAt(_local4)));
_local4++;
};
Global.addRun("TweenMenu run()", run);
}
private function adjust():void{
var _local1:Number;
var _local2:Sprite;
var _local3:Number;
var _local4:int;
var _local5:Sprite;
var _local6:Sprite;
var _local7:Rectangle;
_local1 = 0;
for each (_local2 in itemArr) {
_local1 = (_local1 + _local2.width);
};
_local3 = ((wid0 - _local1) / (totalItem - 1));
adjustItemToX(itemArr[0], left);
_local4 = 1;
while (_local4 < totalItem) {
_local5 = itemArr[_local4];
_local6 = itemArr[(_local4 - 1)];
_local7 = _local6.getBounds(menus_sp);
adjustItemToX(_local5, ((_local7.x + _local7.width) + _local3));
_local4++;
};
}
public function makeSmall(_arg1:Sprite):void{
stArr[itemArr.indexOf(_arg1)].movTo(1);
}
public function run(_arg1:int):void{
if (menus_sp.root == null){
Global.delRun(run);
return;
};
adjust();
}
public function makeBig(_arg1:Sprite):void{
var _local2:int;
_local2 = itemArr.indexOf(_arg1);
stArr[_local2].movTo(maxScale);
}
private function adjustItemToX(_arg1:Sprite, _arg2:Number):void{
_arg1.x = (_arg1.x + (_arg2 - _arg1.getBounds(menus_sp).x));
}
}
}//package effect
Section 14
//_4Btn (FWG._4Btn)
package FWG {
import flash.display.*;
import ui.*;
public class _4Btn extends Sprite {
public var btnM:BtnM;
public var btnP:BtnPause;
public var btnQ:BtnQ;
public var btnS:BtnS;
public function _4Btn(){
super();
btnQ.altInfo = "Quality";
btnQ._release = QualitySetting.show;
if (GameI.main){
if (GameI.main.musicOn){
btnM.altInfo = "Music Off";
} else {
btnM.altInfo = "Music On";
};
btnM._release = function ():void{
if (GameI.main.musicOn){
this.altInfo = "Music On";
GameI.main.musicOn = false;
this.gotoAndStop(2);
} else {
this.altInfo = "Music Off";
GameI.main.musicOn = true;
this.gotoAndStop(1);
};
};
if (GameI.main.musicOn){
btnM.gotoAndStop(1);
} else {
btnM.gotoAndStop(2);
};
if (GameI.main.soundOn){
btnS.altInfo = "Sound Off";
} else {
btnS.altInfo = "Sound On";
};
btnS._release = function ():void{
if (GameI.main.soundOn){
this.altInfo = "Sound On";
GameI.main.soundOn = false;
this.gotoAndStop(2);
} else {
this.altInfo = "Sound Off";
GameI.main.soundOn = true;
this.gotoAndStop(1);
};
};
if (GameI.main.soundOn){
btnS.gotoAndStop(1);
} else {
btnS.gotoAndStop(2);
};
btnP.altInfo = "Pause.";
btnP._release = GameI.main.pauseGame;
};
}
}
}//package FWG
Section 15
//BasicGame (FWG.BasicGame)
package FWG {
import flash.display.*;
import flash.geom.*;
import basic.*;
public class BasicGame extends Sp {
public var onStageClear:Function;
public var onWin:Function;
public var onLose:Function;
private var effectArea:Sprite;
public function BasicGame(){
GameI["game"] = this;
}
public function lose():void{
GameI.main.lose();
}
public function timeUp():void{
}
override public function removed():void{
super.removed();
onStageClear = null;
onWin = null;
onLose = null;
effectArea = null;
}
public function addScore(_arg1:int, _arg2, _arg3):void{
GameI.main.addScore(_arg1);
}
public function win():void{
GameI.main.win();
}
public function stageClear():void{
GameI.main.stageClear();
}
}
}//package FWG
Section 16
//BasicMain (FWG.BasicMain)
package FWG {
import flash.display.*;
import flash.media.*;
import ui.*;
import flash.utils.*;
public class BasicMain extends Sprite {
private var __musicOn:Boolean;
public var pageId:String;
public var totalStage:int;
public var playerInfo:PlayerInfo;
public var gamePad:GamePad;
public var isWin:Boolean;
public var _keyUp:Function;
public var soundOn:Boolean;
public var submitScore:SubmitScore;
public var _keyDown:Function;
private var sndBgChannel:SoundChannel;
public var fadeMask:FadeMask;
public var gameName:String;
private var __currScore:int;
public var stageNum:int;
public var stageSave:StageSave;
public var musicCredits:MusicCredits;
private var __score:int;
public var pausePad:PausePad;
public var mainContainer:Sprite;
public var btnSs:BtnSs;
public var keySetting:KeySetting;
public var isFirstPlay:Boolean;
public function BasicMain(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false){
var i:int;
var child:*;
var _gameName = _arg1;
var _stageWid = _arg2;
var _stageHei = _arg3;
var _totalStage = _arg4;
var hasKeySetting = _arg5;
super();
GameI["main"] = this;
MovieClip(stage.getChildAt(0)).stop();
i = this.numChildren;
while ((i = (i - 1)), (i - 1) >= 0) {
child = this.getChildAt(i);
if ((child is FadeMask)){
fadeMask = child;
};
};
mainContainer = new Sprite();
this.addChildAt(mainContainer, 0);
gameName = _gameName;
Global.stageWid = _stageWid;
Global.stageHei = _stageHei;
totalStage = _totalStage;
currScore = 0;
score = 0;
stageNum = 1;
musicOn = true;
soundOn = true;
playerInfo = new PlayerInfo();
if (hasKeySetting){
keySetting = new KeySetting();
};
isFirstPlay = true;
Global.addRun("BasicMain gotoMenu()", gotoMenu, 2, 1);
Global.addKeyCtrl(this);
_keyDown = function (){
};
_keyUp = function (){
};
}
public function set currScore(_arg1:int):void{
__currScore = _arg1;
if (gamePad){
gamePad.currScore = __currScore;
};
}
public function get musicOn():Boolean{
return (__musicOn);
}
public function win():void{
isWin = true;
fadeTo("FWG.PageGameOver");
}
public function gotoGame(_arg1:int=0):void{
fadeTo("FWG.PageGame");
}
public function fadeTo(_arg1, _arg2:Function=null):void{
var _pageId = _arg1;
var onFadeShow = _arg2;
Global.pause = true;
Global.clearAllRun();
pageId = _pageId;
fadeMask.fadeHide();
if (onFadeShow == null){
onFadeShow = function (){
};
} else {
fadeMask.onShow = onFadeShow;
};
if (GameI.main.pageId == "FWG.PageGame"){
} else {
trace("其它界面设置质量为高");
stage.quality = StageQuality.HIGH;
};
fadeMask.onHide = function ():void{
if (GameI.main.pageId == "FWG.PageGame"){
trace("游戏界面设置质量为中");
stage.quality = StageQuality.MEDIUM;
};
Global.pause = false;
GameI.main.putInPage(GameI.main.pageId);
GameI.main.fadeMask.fadeShow();
GameI.main.fadeMask.onHide = null;
};
}
public function lose():void{
isWin = false;
fadeTo("FWG.PageGameOver");
}
public function pauseGame():void{
if (GameI.game){
Global.pause = true;
pausePad.fadeShow();
};
}
public function set score(_arg1:int):void{
__score = _arg1;
if (gamePad){
gamePad.score = __score;
};
}
public function initBtn(_arg1:Btn):void{
var btn = _arg1;
switch (btn.label){
case "Play Game":
case "Play":
case "Skip":
btn._release = instPlay;
break;
case "Replay":
btn._release = replay;
break;
case "Retry":
btn._release = retry;
break;
case "Instructions":
btn._release = gotoInst;
break;
case "Key Settings":
btn._release = gotoKeySetting;
break;
case "View Highscores":
btn._release = function ():void{
Net.getURL(("http://www.freeworldgroup.com/score/index.asp?game=" + GameI.main.gameName));
};
break;
case "Credits":
btn._release = function ():void{
GameI.main.musicCredits.fadeShow();
};
break;
case "Menu":
btn._release = gotoMenu;
break;
case "Submit Score":
btnSs = BtnSs(btn);
btn._release = function ():void{
if (GameI.main.score <= 0){
Alt.show("Your score is 0 !");
Alt.hideDelay(30);
} else {
GameI.main.submitScore.show();
};
};
break;
};
}
public function playSound(_arg1:String, _arg2:Boolean=false):SoundChannel{
var snd:*;
var soundName = _arg1;
var loop = _arg2;
if (soundOn){
try {
snd = getDefinitionByName(soundName);
} catch(e) {
snd = null;
};
if (snd){
return (new (snd).play(0, (loop) ? 10000 : 1));
};
};
return (null);
}
public function _onKeyDown(_arg1:int):void{
_keyDown(_arg1);
}
public function gotoInst(_arg1:int=0):void{
fadeTo("FWG.PageInst");
}
public function selectPlay(_arg1:int):void{
var _local2:*;
stageNum = _arg1;
currScore = 0;
_local2 = stageSave.getScore((stageNum - 1));
if (((isNaN(_local2)) || ((_local2 < 0)))){
_local2 = 0;
};
score = 0;
trace(("选关,分数置0 stageNum=" + stageNum));
gotoGame();
}
public function putInPage(_arg1:String):void{
pageId = _arg1;
while (mainContainer.numChildren > 0) {
mainContainer.removeChildAt(0);
};
mainContainer.addChild(new (getDefinitionByName(pageId)));
}
public function _onKeyUp(_arg1:int):void{
switch (_arg1){
case 80:
trace("P键暂停");
pauseGame();
break;
default:
_keyUp(_arg1);
break;
};
}
public function gotoMenu(_arg1:int=0):void{
Alert.show("Back To Main Menu?", gotoMenuHandler);
}
public function get currScore():int{
return (__currScore);
}
public function get score():int{
return (__score);
}
public function instPlay():void{
if (isFirstPlay){
gotoInst();
} else {
gotoOptions();
};
}
public function retry():void{
trace(((("retry score=" + score) + ",currScore=") + currScore));
score = ((score - currScore) * (2 / 3));
currScore = 0;
gotoGame();
}
public function addScore(_arg1:int):void{
currScore = (currScore + _arg1);
score = (score + _arg1);
}
public function saveStage():void{
var prevCurrrentScore:int;
try {
prevCurrrentScore = stageSave.getcurrScore(stageNum);
if (prevCurrrentScore <= currScore){
stageSave.setScore(stageNum, currScore);
};
} catch(e) {
trace("这鸟游戏不用保存每关数据");
};
}
public function gotoMenuHandler(_arg1:Boolean):void{
if (_arg1){
GameI.main.fadeTo("FWG.PageMenu");
} else {
Global.pause = false;
};
}
public function gotoOptions(_arg1:int=0):void{
fadeTo("FWG.PageOptions");
}
public function gotoKeySetting():void{
fadeTo("FWG.PageKeySetting");
}
public function MainContainer(){
GameI.main.mainContainer = this;
}
public function set musicOn(_arg1:Boolean){
var sndBg:*;
var _musicOn = _arg1;
__musicOn = _musicOn;
try {
sndBg = getDefinitionByName("SndBg");
} catch(e) {
trace("未放入背景音乐");
sndBg = null;
};
if (sndBg){
if (__musicOn){
sndBgChannel = new (sndBg).play(0, 10000);
} else {
sndBgChannel.stop();
};
};
}
public function nextStage():void{
stageNum++;
currScore = 0;
gotoGame();
}
public function replay():void{
stageNum = 1;
currScore = 0;
score = 0;
gotoOptions();
}
public function stageClear():void{
saveStage();
if (stageNum >= totalStage){
win();
} else {
fadeTo("FWG.PageStageClear");
};
}
}
}//package FWG
Section 17
//Btn (FWG.Btn)
package FWG {
import ui.*;
public class Btn extends SBtn {
public var altInfo:String;
private var __label:String;
public var id:int;
public function Btn(){
altInfo = "";
stop();
}
public function get label():String{
return (__label);
}
override public function press():void{
if (GameI.main){
GameI.main.playSound("SndPress");
};
Alt.hide();
}
override public function rollOut():void{
Alt.hide();
}
public function set label(_arg1:String):void{
__label = _arg1;
if (GameI.main){
GameI.main.initBtn(this);
};
}
override public function rollOver():void{
if (GameI.main){
GameI.main.playSound("SndRollOver");
};
if (altInfo.length > 0){
Alt.show(altInfo);
};
}
}
}//package FWG
Section 18
//Btn1 (FWG.Btn1)
package FWG {
public dynamic class Btn1 extends Btn {
}
}//package FWG
Section 19
//Btn2 (FWG.Btn2)
package FWG {
public dynamic class Btn2 extends Btn {
}
}//package FWG
Section 20
//BtnAgtys (FWG.BtnAgtys)
package FWG {
public class BtnAgtys extends Btn {
public function BtnAgtys(){
super();
_release = function ():void{
Net.getURL("http://www.freeworldgroup.com/koalafiles.htm");
};
}
}
}//package FWG
Section 21
//BtnBack (FWG.BtnBack)
package FWG {
public dynamic class BtnBack extends Btn {
}
}//package FWG
Section 22
//BtnBeat (FWG.BtnBeat)
package FWG {
public dynamic class BtnBeat extends Btn {
}
}//package FWG
Section 23
//BtnCopyright (FWG.BtnCopyright)
package FWG {
public class BtnCopyright extends Btn {
public function BtnCopyright(){
super();
_release = function ():void{
Net.getURL("http://www.freeworldgroup.com");
};
}
}
}//package FWG
Section 24
//BtnCredits (FWG.BtnCredits)
package FWG {
public class BtnCredits extends Btn {
public function BtnCredits(){
label = "Credits";
}
}
}//package FWG
Section 25
//BtnDg (FWG.BtnDg)
package FWG {
public class BtnDg extends Btn {
public function BtnDg(){
super();
_release = function ():void{
Net.getURL("http://www.ifungames.com");
};
}
}
}//package FWG
Section 26
//BtnInstructions (FWG.BtnInstructions)
package FWG {
public class BtnInstructions extends Btn {
public function BtnInstructions(){
label = "Instructions";
}
}
}//package FWG
Section 27
//BtnLevel (FWG.BtnLevel)
package FWG {
import super_race.*;
import ui.*;
public class BtnLevel extends Btn {
public var levelTxt:Label4;
public var levelImg:TrackMap2;
private var __levelId:int;
public function set score(_arg1:int):void{
var _score = _arg1;
if (_score < 0){
_score = 0;
errorPress = function ():void{
Alt.show("Can't play yet!");
};
selectAble = false;
};
}
public function set levelId(_arg1:int):void{
__levelId = _arg1;
levelTxt.text = __levelId;
levelImg.gotoAndStop(_arg1);
}
public function get levelId():int{
return (__levelId);
}
}
}//package FWG
Section 28
//BtnM (FWG.BtnM)
package FWG {
public dynamic class BtnM extends Btn {
}
}//package FWG
Section 29
//BtnMenu (FWG.BtnMenu)
package FWG {
public class BtnMenu extends Btn {
public function BtnMenu(){
label = "Menu";
}
}
}//package FWG
Section 30
//BtnMenu2 (FWG.BtnMenu2)
package FWG {
public dynamic class BtnMenu2 extends BtnMenu {
}
}//package FWG
Section 31
//BtnMog (FWG.BtnMog)
package FWG {
public class BtnMog extends Btn {
public function BtnMog(){
super();
_release = function ():void{
Net.getURL("http://www.freeworldgroup.com");
};
}
}
}//package FWG
Section 32
//BtnNext (FWG.BtnNext)
package FWG {
public dynamic class BtnNext extends Btn {
}
}//package FWG
Section 33
//BtnNo (FWG.BtnNo)
package FWG {
public dynamic class BtnNo extends Btn {
}
}//package FWG
Section 34
//BtnNs (FWG.BtnNs)
package FWG {
public class BtnNs extends Btn {
public function BtnNs(){
if (GameI.main){
_release = GameI.main.nextStage;
};
}
private function initDelay(_arg1:int=0):void{
Global.addKeyCtrl(this);
}
public function _onKeyUp(_arg1:int):void{
_release();
}
}
}//package FWG
Section 35
//BtnOK (FWG.BtnOK)
package FWG {
public dynamic class BtnOK extends Btn {
}
}//package FWG
Section 36
//BtnPause (FWG.BtnPause)
package FWG {
public dynamic class BtnPause extends Btn {
}
}//package FWG
Section 37
//BtnPg (FWG.BtnPg)
package FWG {
public class BtnPg extends Btn {
public function BtnPg(){
label = "Play Game";
}
}
}//package FWG
Section 38
//BtnPlay (FWG.BtnPlay)
package FWG {
public class BtnPlay extends Btn {
public function BtnPlay(){
label = "Play";
}
}
}//package FWG
Section 39
//BtnQ (FWG.BtnQ)
package FWG {
public dynamic class BtnQ extends Btn {
}
}//package FWG
Section 40
//BtnQ0 (FWG.BtnQ0)
package FWG {
import flash.display.*;
public class BtnQ0 extends Btn {
public function BtnQ0(){
label = StageQuality.LOW;
}
}
}//package FWG
Section 41
//BtnQ1 (FWG.BtnQ1)
package FWG {
import flash.display.*;
public class BtnQ1 extends Btn {
public function BtnQ1(){
label = StageQuality.MEDIUM;
}
}
}//package FWG
Section 42
//BtnQ2 (FWG.BtnQ2)
package FWG {
import flash.display.*;
public class BtnQ2 extends Btn {
public function BtnQ2(){
label = StageQuality.HIGH;
}
}
}//package FWG
Section 43
//BtnQ3 (FWG.BtnQ3)
package FWG {
import flash.display.*;
public class BtnQ3 extends Btn {
public function BtnQ3(){
label = StageQuality.BEST;
}
}
}//package FWG
Section 44
//BtnReplay (FWG.BtnReplay)
package FWG {
public class BtnReplay extends Btn {
public function BtnReplay(){
label = "Replay";
}
}
}//package FWG
Section 45
//BtnReset (FWG.BtnReset)
package FWG {
public dynamic class BtnReset extends Btn {
}
}//package FWG
Section 46
//BtnResume (FWG.BtnResume)
package FWG {
public dynamic class BtnResume extends Btn {
}
}//package FWG
Section 47
//BtnRetry (FWG.BtnRetry)
package FWG {
public class BtnRetry extends Btn {
public function BtnRetry(){
label = "Retry";
}
}
}//package FWG
Section 48
//BtnS (FWG.BtnS)
package FWG {
public dynamic class BtnS extends Btn {
}
}//package FWG
Section 49
//BtnSkip (FWG.BtnSkip)
package FWG {
public class BtnSkip extends Btn {
public function BtnSkip(){
label = "Skip";
}
}
}//package FWG
Section 50
//BtnSs (FWG.BtnSs)
package FWG {
public class BtnSs extends Btn {
public function BtnSs(){
label = "Submit Score";
}
}
}//package FWG
Section 51
//BtnSubmit (FWG.BtnSubmit)
package FWG {
public dynamic class BtnSubmit extends Btn {
}
}//package FWG
Section 52
//BtnVh (FWG.BtnVh)
package FWG {
public class BtnVh extends Btn {
public function BtnVh(){
label = "View Highscores";
}
}
}//package FWG
Section 53
//BtnX (FWG.BtnX)
package FWG {
public dynamic class BtnX extends Btn {
}
}//package FWG
Section 54
//BtnYes (FWG.BtnYes)
package FWG {
public dynamic class BtnYes extends Btn {
}
}//package FWG
Section 55
//GameInfo (FWG.GameInfo)
package FWG {
import super_race.*;
public class GameInfo extends LocalSetting {
public var carDataArr:Array;
public var heroId:int;// = 1
public function GameInfo(){
heroId = 1;
carDataArr = Common.cloneObj(Car.carDataArr);
super((GameI.main.gameName + "GameInfo"));
}
}
}//package FWG
Section 56
//GamePad (FWG.GamePad)
package FWG {
import flash.display.*;
import super_race.*;
import ui.*;
public class GamePad extends Sprite {
public var txt_Score:MovieClip;
public var numClock:NumClock;
public var speedBar:ValueBarSpeed;
public var scoreTxt:Label2;
public var stageNumTxt:Label2;
public var currScoreTxt:Label2;
public var lapTxt:Label2;
public var hpBar:ValueBarHp;
public var txt_Level:MovieClip;
public function GamePad(){
GameI.main.gamePad = this;
lap = 1;
stageNum = GameI.main.stageNum;
currScore = GameI.main.currScore;
score = GameI.main.score;
hpBar.uStr = ("/" + GameI.game.hero.hp);
hpBar.value = (hpBar.maxValue = GameI.game.hero.hp);
speedBar.uStr = "km/h";
speedBar.maxValue = GameI.game.hero.maxV_x;
switch (GameI.playMode){
case GameI.playMode_tournament:
numClock.y = -100;
break;
case GameI.playMode_singleRace:
txt_Level.y = -100;
stageNumTxt.y = -100;
numClock.y = -100;
break;
case GameI.playMode_timeTrial:
txt_Level.y = -100;
stageNumTxt.y = -100;
txt_Score.y = -100;
scoreTxt.y = -100;
lapTxt.y = -100;
GameI.game.carOrderPad.y = -100;
break;
};
}
public function set currScore(_arg1:int):void{
currScoreTxt.text = _arg1;
}
public function set hp(_arg1:int):void{
hpBar.value = _arg1;
}
public function set score(_arg1:int):void{
scoreTxt.text = _arg1;
}
public function set lap(_arg1:int):void{
if (_arg1 > GameI.totalLap){
_arg1 = GameI.totalLap;
};
lapTxt.text = (_arg1 + (("/" + GameI.totalLap) + " LAP"));
}
public function set stageNum(_arg1:int):void{
stageNumTxt.text = _arg1;
}
public function set speed(_arg1:int):void{
speedBar.value = _arg1;
}
}
}//package FWG
Section 57
//Instructions (FWG.Instructions)
package FWG {
import flash.display.*;
import basic.*;
public class Instructions extends Mc {
private var btnBack:BtnBack;
private var btnNext:BtnNext;
private var btnSkip:BtnSkip;
private var btnPlay:BtnPlay;
public function Instructions(){
var _local1:int;
var _local2:*;
super();
GameI.isInst = true;
stop();
if (GameI.main){
GameI.main.isFirstPlay = false;
};
_local1 = this.numChildren;
while (--_local1 >= 0) {
_local2 = this.getChildAt(_local1);
if ((_local2 is BtnNext)){
btnNext = _local2;
} else {
if ((_local2 is BtnBack)){
btnBack = _local2;
} else {
if ((_local2 is BtnPlay)){
btnPlay = _local2;
} else {
if ((_local2 is BtnSkip)){
btnSkip = _local2;
};
};
};
};
};
btnNext._release = goNext;
btnBack._release = goPrev;
adjustBtns();
}
private function goNext():void{
this.nextFrame();
adjustBtns();
}
private function goPrev():void{
this.prevFrame();
adjustBtns();
}
override public function removed():void{
GameI.isInst = false;
}
private function adjustBtns():void{
btnPlay.visible = (this.currentFrame == this.totalFrames);
btnSkip.visible = (btnNext.visible = !((this.currentFrame == this.totalFrames)));
btnBack.visible = (this.currentFrame > 1);
}
}
}//package FWG
Section 58
//KeySetting (FWG.KeySetting)
package FWG {
public class KeySetting extends LocalSetting {
public var keyCodeArr:Array;
public function KeySetting(){
keyCodeArr = [65, 87, 68, 83, 74, 73, 76, 75, 86, 66, 32];
super((GameI.main.gameName + "KeySetting"));
}
public function getCode(_arg1:int):int{
return (keyCodeArr[_arg1]);
}
public function saveCode(_arg1:int, _arg2:int):void{
keyCodeArr[_arg1] = _arg2;
}
public function isDefault():Boolean{
var _local1:Object;
var _local2:String;
_local1 = getDefault().dataObj;
for (_local2 in _local1) {
if (keyCodeArr[_local2] == _local1[_local2]){
return (false);
};
};
return (true);
}
}
}//package FWG
Section 59
//LocalSetting (FWG.LocalSetting)
package FWG {
import flash.net.*;
public class LocalSetting {
private var lso:SharedObject;
public var version:int;
public function LocalSetting(_arg1:String, _arg2:int=1){
var varName:String;
var str = _arg1;
var _version = _arg2;
super();
str = (str + "_as3");
version = _version;
try {
lso = SharedObject.getLocal(str, "/");
} catch(e:Error) {
trace((("和as2共享名称的" + str) + "存储文件时发生错误"));
lso = SharedObject.getLocal(str, "/");
};
if (Common.isEmpty(lso.data)){
trace((str + " 第一次设定"));
lso.data.defaultDataObj = Common.cloneObj(this);
} else {
if (version != lso.data.dataObj.version){
trace((str + "版本改变,重置"));
lso.data.defaultDataObj = Common.cloneObj(this);
} else {
for (varName in lso.data.dataObj) {
this[varName] = lso.data.dataObj[varName];
};
};
};
lso.data.dataObj = this;
}
public function getDefault():Object{
return (lso.data.defaultDataObj);
}
public function setDefault():void{
var _local1:String;
for (_local1 in lso.data.defaultDataObj) {
this[_local1] = Common.cloneObj(lso.data.defaultDataObj[_local1]);
};
}
}
}//package FWG
Section 60
//Logo (FWG.Logo)
package FWG {
import flash.display.*;
import ui.*;
public class Logo extends SBtn {
public function Logo(){
super();
_release = function ():void{
Net.getURL("http://www.freeworldgroup.com/");
};
}
}
}//package FWG
Section 61
//Main (FWG.Main)
package FWG {
import super_race.*;
public class Main extends BasicMain {
public var gameInfo:GameInfo;
public function Main(){
super("super_race", 550, 400, 6);
stageNum = 1;
trace(("stageNum=" + stageNum));
Game.firstInit();
gameInfo = new GameInfo();
}
}
}//package FWG
Section 62
//MusicCredits (FWG.MusicCredits)
package FWG {
import ui.*;
public class MusicCredits extends BasicWindow {
public function MusicCredits(){
GameI.main.musicCredits = this;
windowBody.btnBack._release = fadeHide;
}
}
}//package FWG
Section 63
//MusicCreditsBg (FWG.MusicCreditsBg)
package FWG {
import ui.*;
public dynamic class MusicCreditsBg extends WindowBg {
}
}//package FWG
Section 64
//PageGame (FWG.PageGame)
package FWG {
import flash.display.*;
public dynamic class PageGame extends MovieClip {
}
}//package FWG
Section 65
//PageGameOver (FWG.PageGameOver)
package FWG {
import flash.display.*;
import ui.*;
public class PageGameOver extends MovieClip {
public var txt_currTime:Label2;
public var btnBeat:BtnBeat;
public var txt_bestTime:Label2;
public function PageGameOver(){
addFrameScript(2, frame3);
if (GameI.playMode_timeTrial == GameI.playMode){
gotoAndStop(3);
} else {
if (GameI.main.isWin){
gotoAndStop(1);
} else {
gotoAndStop(2);
};
};
}
function frame3(){
txt_currTime.text = NumClock.numToTime(GameI.currTime);
txt_bestTime.text = NumClock.numToTime(GameI.bestTime);
btnBeat._release = function ():void{
GameI.main.gotoGame();
};
}
}
}//package FWG
Section 66
//PageInst (FWG.PageInst)
package FWG {
import flash.display.*;
public dynamic class PageInst extends MovieClip {
}
}//package FWG
Section 67
//PageMenu (FWG.PageMenu)
package FWG {
import flash.display.*;
public dynamic class PageMenu extends MovieClip {
}
}//package FWG
Section 68
//PageOptions (FWG.PageOptions)
package FWG {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class PageOptions extends MovieClip {
public var diffArr:Array;
public var btn3:Btn1;
public var btn0:Btn1;
public var btn2:Btn1;
public var btnBack:Btn1;
public var i:int;
public var btn;
public var btn1:Btn1;
public function PageOptions(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
if (GameI.playMode == GameI.playMode_timeTrial){
btnBack._release = function ():void{
gotoAndStop("selectMode");
};
} else {
btnBack._release = function ():void{
gotoAndStop("selectDiff");
};
};
}
function frame4(){
if (GameI.playMode == GameI.playMode_tournament){
btnBack._release = function ():void{
gotoAndStop("selectMode");
};
} else {
btnBack._release = function ():void{
gotoAndStop("selectTrack");
};
};
}
function frame1(){
stop();
btn1._release = function ():void{
GameI.playMode = GameI.playMode_tournament;
GameI.gameDiff = "";
GameI.main.stageNum = 1;
gotoAndStop("selectCar");
};
btn2._release = function ():void{
GameI.playMode = GameI.playMode_singleRace;
gotoAndStop("selectDiff");
};
btn3._release = function ():void{
GameI.playMode = GameI.playMode_timeTrial;
GameI.gameDiff = "";
gotoAndStop("selectTrack");
};
if (GameI.main.stageSave == null){
GameI.main.stageSave = new StageSave();
};
}
function frame2(){
btnBack._release = function ():void{
gotoAndStop("selectMode");
};
diffArr = [GameI.diff_easy, GameI.diff_normal, GameI.diff_hard, GameI.diff_crazy];
i = 0;
while (i < 4) {
btn = this[("btn" + i)];
btn.id = i;
btn._release = function ():void{
GameI.gameDiff = diffArr[this.id];
gotoAndStop("selectTrack");
};
i++;
};
}
public function selectLevel(_arg1:int):void{
GameI.selectedStageNum = _arg1;
nextFrame();
}
}
}//package FWG
Section 69
//PageStageClear (FWG.PageStageClear)
package FWG {
import flash.display.*;
public class PageStageClear extends Sprite {
}
}//package FWG
Section 70
//PausePad (FWG.PausePad)
package FWG {
import ui.*;
public class PausePad extends BasicWindow {
public function PausePad(){
super();
GameI.main.pausePad = this;
onHide = function ():void{
Global.pause = false;
};
windowBody.btnResume._release = fadeHide;
}
override public function _onKeyUp(_arg1:int):void{
fadeHide();
}
}
}//package FWG
Section 71
//PlayerInfo (FWG.PlayerInfo)
package FWG {
public class PlayerInfo extends LocalSetting {
public var playerName:String;// = "MrNoName"
public function PlayerInfo(){
playerName = "MrNoName";
super("FWGPlayerInfo");
}
public static function isIllegalName(_arg1:String):Boolean{
return ((((_arg1 == "")) || ((_arg1 == "MrNoName"))));
}
}
}//package FWG
Section 72
//ScorePad (FWG.ScorePad)
package FWG {
import flash.display.*;
import ui.*;
public class ScorePad extends Sprite {
public var scoreTxt:Label2;
public function ScorePad(){
scoreTxt.text = GameI.main.score;
}
}
}//package FWG
Section 73
//SelectCar (FWG.SelectCar)
package FWG {
import flash.display.*;
import flash.events.*;
import super_race.*;
import effect.*;
import ui.*;
import basic.*;
public class SelectCar extends Sp {
public var adjustBar:CarValueBar;
private var defaultObj:Object;
public var skillBar:CarValueBar;
public var btnRight:Btn2;
private var ctArr:Array;
public var btnOk:Btn1;
public var selectPad_cars:MovieClip;
public var selectPad_carCircle:MovieClip;
public var dragToAdjustValue_mc:MovieClip;
public var btnLeft:Btn2;
public var currBar:CarValueBar;
private var valueObj:Object;
public var maxSpeedBar:CarValueBar;
public var accBar:CarValueBar;
private var rotateTween:RotateTween;
public var hpBar:CarValueBar;
public var restValue:Number;
public function SelectCar(){
this.addEventListener(MouseEvent.MOUSE_UP, stopAdjust, false, 0, true);
selectPad_cars.nameTxt.txt.type = "input";
selectPad_cars.nameTxt.txt.selectable = true;
selectPad_cars.nameTxt.txt.maxChars = 10;
btnOk._release = selectPlay;
btnLeft._release = goPrev;
btnRight._release = goNext;
valueObj = GameI.main.gameInfo.carDataArr[(GameI.main.gameInfo.heroId - 1)];
selectPad_carCircle.rotation = ((heroId - 1) * 90);
rotateTween = new RotateTween(selectPad_carCircle);
Common.setRGB(accBar.bar2, valueObj.color);
Common.setRGB(skillBar.bar2, valueObj.color);
Common.setRGB(maxSpeedBar.bar2, valueObj.color);
Common.setRGB(hpBar.bar2, valueObj.color);
ctArr = [new ColorTween(accBar.bar2), new ColorTween(skillBar.bar2), new ColorTween(maxSpeedBar.bar2), new ColorTween(hpBar.bar2)];
heroId = GameI.main.gameInfo.heroId;
selectPad_cars.card.gotoAndStop(heroId);
selectPad_cars.nameTxt.text = valueObj.name;
selectPad_cars.nameBg.stop();
Global.addRun("SelectCar adjustRest()", adjustRest);
Global.addRun("SelectCar dragToAdjustValue_mc_delayPlay()", dragToAdjustValue_mc_delayPlay, 60, 1);
}
public function adjustRest(_arg1:int=0):void{
adjustBar.value = (Car.totalValue - (((accBar.value + skillBar.value) + maxSpeedBar.value) + hpBar.value));
}
public function flipShow(_arg1:int):void{
selectPad_cars.alpha = ((5 - _arg1) * 0.2);
}
public function stopAdjust(_arg1:MouseEvent):void{
if (currBar){
currBar.stopAdjust();
};
}
public function goNext():void{
save();
if (heroId == 4){
flip(1);
} else {
flip((heroId + 1));
};
}
public function goPrev():void{
save();
if (heroId == 1){
flip(4);
} else {
flip((heroId - 1));
};
}
public function selectPlay():void{
if (((PlayerInfo.isIllegalName(selectPad_cars.nameTxt.text)) || ((GameI.main.gameInfo.getDefault().carDataArr[(heroId - 1)].name == selectPad_cars.nameTxt.text)))){
Alt.show("You must enter your name!", selectPad_cars.nameTxt);
return;
};
GameI.main.gameInfo.heroId = heroId;
save();
if (GameI.playMode == GameI.playMode_tournament){
GameI.main.gotoGame();
} else {
trace(("GameI.selectedStageNum=" + GameI.selectedStageNum));
GameI.main.selectPlay(GameI.selectedStageNum);
};
}
override public function removed():void{
var _local1:ColorTween;
super.removed();
currBar = null;
valueObj = null;
defaultObj = null;
this.removeEventListener(MouseEvent.MOUSE_UP, stopAdjust);
rotateTween.stop();
rotateTween = null;
for each (_local1 in ctArr) {
_local1.stop();
};
ctArr = null;
Global.delRun(adjustRest);
stopTips();
}
public function stopTips():void{
Global.delRun(dragToAdjustValue_mc_delayPlay);
}
public function set heroId(_arg1):void{
var _local2:ColorTween;
GameI.main.gameInfo.heroId = _arg1;
valueObj = GameI.main.gameInfo.carDataArr[(_arg1 - 1)];
defaultObj = GameI.main.gameInfo.getDefault().carDataArr[(_arg1 - 1)];
accBar.defaultValue = defaultObj.accValue;
accBar.value = valueObj.accValue;
skillBar.defaultValue = defaultObj.skillValue;
skillBar.value = valueObj.skillValue;
maxSpeedBar.defaultValue = defaultObj.maxSpeedValue;
maxSpeedBar.value = valueObj.maxSpeedValue;
hpBar.defaultValue = defaultObj.hpValue;
hpBar.value = valueObj.hpValue;
adjustBar.defaultValue = 0;
adjustRest();
rotateTween.movTo(((heroId - 1) * 90));
for each (_local2 in ctArr) {
_local2.movTo(valueObj.color);
};
}
public function flipHide(_arg1:int):void{
selectPad_cars.alpha = (_arg1 * 0.2);
if (_arg1 == 0){
selectPad_cars.card.gotoAndStop(heroId);
selectPad_cars.nameTxt.text = valueObj.name;
Global.addRun("SelectCar flipShow()", flipShow, 1, 5);
};
}
public function flip(_arg1:int):void{
Global.delRun(flipShow);
heroId = _arg1;
Global.addRun("SelectCar flipHide()", flipHide, 1, 5);
}
public function save():void{
valueObj.accValue = accBar.value;
valueObj.skillValue = skillBar.value;
valueObj.maxSpeedValue = maxSpeedBar.value;
valueObj.hpValue = hpBar.value;
GameI.main.playerInfo.playerName = (valueObj.name = selectPad_cars.nameTxt.txt.text);
}
public function get heroId():int{
return (GameI.main.gameInfo.heroId);
}
public function dragToAdjustValue_mc_delayPlay(_arg1:int):void{
dragToAdjustValue_mc.gotoAndPlay(2);
}
}
}//package FWG
Section 74
//StageSave (FWG.StageSave)
package FWG {
public class StageSave extends LocalSetting {
public var dataArr:Array;
public function StageSave(){
var _local1:int;
dataArr = new Array((GameI.main.totalStage + 1));
_local1 = dataArr.length;
while (--_local1 >= 0) {
setScore(_local1, -1);
};
super((GameI.main.gameName + "StageSave"));
}
public function setScore(_arg1:int, _arg2:int):void{
dataArr[_arg1] = {currScore:_arg2};
}
public function getcurrScore(_arg1:int):int{
var _local2:int;
_local2 = dataArr[_arg1].currScore;
if (isNaN(_local2)){
return (-1);
};
return (_local2);
}
public function getScore(_arg1:int):int{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = 1;
while (_local3 <= _arg1) {
_local2 = (_local2 + dataArr[_local3].currScore);
_local3++;
};
return (_local2);
}
}
}//package FWG
Section 75
//StageSelecter (FWG.StageSelecter)
package FWG {
import flash.display.*;
public class StageSelecter extends Sprite {
public var btn3:BtnLevel;
public var btn2:BtnLevel;
public var btn4:BtnLevel;
public var btn6:BtnLevel;
public var btn5:BtnLevel;
public var btn1:BtnLevel;
public var btnAction:Function;
public function StageSelecter(){
var setCurrentBtn:Boolean;
var btn:BtnLevel;
var score:int;
var i:int;
super();
if (GameI.main.stageSave == null){
GameI.main.stageSave = new StageSave();
};
i = 1;
while (i <= GameI.main.totalStage) {
score = GameI.main.stageSave.getcurrScore(i);
btn = this[("btn" + i)];
btn.levelId = i;
if ((((score < 0)) && (!(setCurrentBtn)))){
setCurrentBtn = true;
btn.score = 0;
} else {
btn.score = score;
};
btnAction = GameI.main.selectPlay;
btn._release = function ():void{
StageSelecter(this.parent).btnAction(this.levelId);
};
i = (i + 1);
};
}
}
}//package FWG
Section 76
//SubmitScore (FWG.SubmitScore)
package FWG {
import flash.net.*;
import flash.events.*;
import ui.*;
public class SubmitScore extends BasicWindow {
public function SubmitScore(){
GameI.main.submitScore = this;
windowBody.stop();
windowBody.btnSubmit._release = checkSubmit;
windowBody.btnX._release = fadeHide;
windowBody.nameTxt.txt.maxChars = 10;
windowBody.nameTxt.text = GameI.main.playerInfo.playerName;
windowBody.scoreTxt.text = String(GameI.main.score);
trace(((("playerName=" + windowBody.nameTxt.text) + ",score=") + windowBody.scoreTxt.text));
}
private function errorHandler(_arg1:IOErrorEvent):void{
trace(("error: " + _arg1));
}
private function submit():void{
var _local1:String;
var _local2:URLVariables;
_local1 = windowBody.nameTxt.text;
if (_local1 == ""){
_local1 = ("guest" + Common.random(1000));
};
GameI.main.playerInfo.playerName = _local1;
_local2 = new URLVariables();
_local2.game = GameI.main.gameName;
_local2.score = windowBody.scoreTxt.text;
_local2.name = _local1;
Net.sendData(_local2, "http://www.freeworldgroup.com/score/score.asp", completeHandler, errorHandler);
windowBody.gotoAndStop(2);
GameI.main.btnSs.visible = false;
}
public function checkSubmit():void{
if (PlayerInfo.isIllegalName(windowBody.nameTxt.text)){
Alt.show("You must enter your name!", windowBody.nameTxt);
return;
};
submit();
}
override public function fadeShow():void{
super.fadeShow();
Common.selectTxt(windowBody.nameTxt.txt);
}
private function completeHandler(_arg1:Event):void{
windowBody.gotoAndStop(3);
}
}
}//package FWG
Section 77
//Vector2 (math.Vector2)
package math {
public class Vector2 {
public var x:Number;
public var y:Number;
private static var tp1:Vector2 = new (Vector2);
;
private static var tp2:Vector2 = new (Vector2);
;
private static var tp3:Vector2 = new (Vector2);
;
private static var tp4:Vector2 = new (Vector2);
;
public function Vector2(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function cross(_arg1:Vector2):Number{
return (((x * _arg1.y) - (y * _arg1.x)));
}
public function get _radian():Number{
return (Math.atan2(y, x));
}
public function get length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function add(_arg1:Vector2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function dot(_arg1:Vector2):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function simple(_arg1:Number):void{
x = (Math.round((x / _arg1)) * _arg1);
y = (Math.round((y / _arg1)) * _arg1);
}
public function getMpSet(_arg1:Vector2, _arg2:Number):void{
_arg1.x = y;
_arg1.y = -(x);
_arg1.normalize(_arg2);
}
public function toString():String{
return ((((("Vector2(" + x) + ",") + y) + ")"));
}
public function normalize(_arg1:Number=1):void{
var _local2:Number;
var _local3:Number;
_local2 = ((x * x) + (y * y));
if (_local2 == 0){
return;
};
_local3 = (_arg1 / Math.sqrt(_local2));
x = (x * _local3);
y = (y * _local3);
}
public function getMp(_arg1:Number=1):Vector2{
var _local2:Vector2;
_local2 = new Vector2(y, -(x));
_local2.normalize(_arg1);
return (_local2);
}
public function subtract(_arg1:Vector2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function isInside(_arg1:Array):Boolean{
var _local2:int;
var _local3:int;
var _local4:Vector2;
var _local5:Vector2;
_local2 = 0;
_local3 = _arg1.length;
for each (_local4 in _arg1) {
++_local2;
if (_local2 >= _local3){
_local3 = 0;
};
_local5 = _arg1[_local2];
tp1.x = (this.x - _local4.x);
tp1.y = (this.y - _local4.y);
tp2.x = (_local5.x - _local4.x);
tp2.y = (_local5.y - _local4.y);
if (tp2.isRight(tp1)){
return (false);
};
_local2++;
};
return (true);
}
public function mult(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function rotate(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = x;
_local5 = y;
x = ((_local4 * _local2) - (_local5 * _local3));
y = ((_local4 * _local3) + (_local5 * _local2));
}
public function clone():Vector2{
return (new Vector2(x, y));
}
public function get rotation():Number{
return ((Math.atan2(y, x) * (180 / Math.PI)));
}
public function isRight(_arg1):Boolean{
return ((cross_(this, _arg1) < 0));
}
public static function distance(_arg1:Vector2, _arg2:Vector2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function polar(_arg1:Number, _arg2:Number):Vector2{
return (new Vector2((_arg1 * Math.cos(_arg2)), (_arg1 * Math.sin(_arg2))));
}
public static function toAngle(_arg1:Vector2, _arg2:Vector2):Number{
return (Math.atan2(_arg1.cross(_arg2), _arg1.dot(_arg2)));
}
public static function intersection(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2, _arg4:Vector2):Vector2{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = cross_(_arg1, _arg3);
_local6 = cross_(_arg2, _arg4);
_local7 = cross_(_arg3, _arg2);
_local8 = cross_(_arg4, _arg1);
_local9 = cross_(_arg3, _arg4);
_local10 = (((_local5 + _local9) + _local8) / (((_local5 + _local6) + _local7) + _local8));
return (new Vector2((_arg1.x + ((_arg2.x - _arg1.x) * _local10)), (_arg1.y + ((_arg2.y - _arg1.y) * _local10))));
}
public static function subtract_(_arg1:Vector2, _arg2:Vector2):Vector2{
return (new Vector2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
public static function mult_(_arg1:Vector2, _arg2:Number):Vector2{
return (new Vector2((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function normalize_(_arg1:Vector2, _arg2:Number):Vector2{
_arg1 = _arg1.clone();
_arg1.normalize(_arg2);
return (_arg1);
}
public static function getVertical(_arg1:Vector2, _arg2:Vector2):Vector2{
var _local3:Number;
_local3 = ((_arg2.x * _arg2.x) + (_arg2.y * _arg2.y));
return (new Vector2(((_arg2.y * cross_(_arg1, _arg2)) / _local3), ((_arg2.x * cross_(_arg2, _arg1)) / _local3)));
}
public static function intersects(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2, _arg4:Vector2):Boolean{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
tp1.x = (_arg3.x - _arg1.x);
tp1.y = (_arg3.y - _arg1.y);
tp2.x = (_arg2.x - _arg3.x);
tp2.y = (_arg2.y - _arg3.y);
_local5 = cross_(tp1, tp2);
tp3.x = (_arg4.x - _arg2.x);
tp3.y = (_arg4.y - _arg2.y);
_local6 = cross_(tp2, tp3);
if ((_local5 * _local6) < 0){
return (false);
};
tp4.x = (_arg1.x - _arg4.x);
tp4.y = (_arg1.y - _arg4.y);
_local7 = cross_(tp3, tp4);
if ((_local6 * _local7) < 0){
return (false);
};
_local8 = cross_(tp4, tp1);
if ((_local7 * _local8) < 0){
return (false);
};
return (true);
}
public static function getHorizontal(_arg1:Vector2, _arg2:Vector2):Vector2{
var _local3:Number;
_local3 = (dot_(_arg1, _arg2) / ((_arg2.x * _arg2.x) + (_arg2.y * _arg2.y)));
return (new Vector2((_arg2.x * _local3), (_arg2.y * _local3)));
}
public static function getVByK(_arg1:Vector2, _arg2:Vector2, _arg3:Number, _arg4:Vector2):void{
var _local5:Number;
if (_arg3 == 0){
_arg4.x = _arg1.x;
_arg4.y = _arg1.y;
} else {
if (_arg3 == 1){
_arg4.x = _arg2.x;
_arg4.y = _arg2.y;
} else {
_local5 = Math.tan((toAngle(_arg1, _arg2) * _arg3));
_arg4.x = (_arg1.x - (_local5 * _arg1.y));
_arg4.y = ((_local5 * _arg1.x) + _arg1.y);
};
};
}
public static function getK(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Number{
return ((cross_(_arg1, _arg3) / cross_(_arg2, _arg3)));
}
public static function dot_(_arg1:Vector2, _arg2:Vector2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function add_(_arg1:Vector2, _arg2:Vector2):Vector2{
return (new Vector2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)));
}
public static function cross_(_arg1:Vector2, _arg2:Vector2):Number{
return (((_arg1.x * _arg2.y) - (_arg2.x * _arg1.y)));
}
}
}//package math
Section 78
//all_mc_12 (sr_0704_fla.all_mc_12)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class all_mc_12 extends MovieClip {
public function all_mc_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sr_0704_fla
Section 79
//dragToAdjustValue_mc_166 (sr_0704_fla.dragToAdjustValue_mc_166)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class dragToAdjustValue_mc_166 extends MovieClip {
public function dragToAdjustValue_mc_166(){
addFrameScript(0, frame1, 1, frame2, 52, frame53);
}
function frame1(){
stop();
}
function frame2(){
this.mouseChildren = false;
this.mouseEnabled = false;
}
function frame53(){
stop();
}
}
}//package sr_0704_fla
Section 80
//FWG_109 (sr_0704_fla.FWG_109)
package sr_0704_fla {
import flash.display.*;
import FWG.*;
import ui.*;
public dynamic class FWG_109 extends MovieClip {
public var btnX:BtnX;
public var btnSubmit:BtnSubmit;
public var scoreTxt:Label2;
public var nameTxt:Label2;
}
}//package sr_0704_fla
Section 81
//FWG_122 (sr_0704_fla.FWG_122)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class FWG_122 extends MovieClip {
public function FWG_122(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package sr_0704_fla
Section 82
//FWG_217 (sr_0704_fla.FWG_217)
package sr_0704_fla {
import flash.display.*;
import FWG.*;
public dynamic class FWG_217 extends MovieClip {
public var btnBack:BtnBack;
}
}//package sr_0704_fla
Section 83
//FWG_68 (sr_0704_fla.FWG_68)
package sr_0704_fla {
import flash.display.*;
import FWG.*;
public dynamic class FWG_68 extends MovieClip {
public var btnResume:BtnResume;
}
}//package sr_0704_fla
Section 84
//FWG_84 (sr_0704_fla.FWG_84)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class FWG_84 extends MovieClip {
public function FWG_84(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package sr_0704_fla
Section 85
//FWG_89 (sr_0704_fla.FWG_89)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import super_race.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class FWG_89 extends MovieClip {
public var allScore:AllScore;
public function FWG_89(){
addFrameScript(0, frame1);
}
function frame1(){
if (GameI.playMode != GameI.playMode_singleRace){
this.removeChild(allScore);
};
}
}
}//package sr_0704_fla
Section 86
//gameover_btns_117 (sr_0704_fla.gameover_btns_117)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class gameover_btns_117 extends MovieClip {
public function gameover_btns_117(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(GameI.main.gameInfo.heroId);
}
}
}//package sr_0704_fla
Section 87
//GAMEOVER01_121 (sr_0704_fla.GAMEOVER01_121)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import effect.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class GAMEOVER01_121 extends MovieClip {
public var ss:ScreenShake;
public function GAMEOVER01_121(){
addFrameScript(10, frame11, 49, frame50);
}
function frame11(){
ss = new ScreenShake(this);
ss.shake();
}
function frame50(){
stop();
}
}
}//package sr_0704_fla
Section 88
//GAMEOVER2_118 (sr_0704_fla.GAMEOVER2_118)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import effect.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class GAMEOVER2_118 extends MovieClip {
public var ss:ScreenShake;
public function GAMEOVER2_118(){
addFrameScript(10, frame11, 49, frame50);
}
function frame11(){
ss = new ScreenShake(this);
ss.shake();
}
function frame50(){
stop();
}
}
}//package sr_0704_fla
Section 89
//GAMEOVER3_119 (sr_0704_fla.GAMEOVER3_119)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import effect.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class GAMEOVER3_119 extends MovieClip {
public var ss:ScreenShake;
public function GAMEOVER3_119(){
addFrameScript(10, frame11, 49, frame50);
}
function frame11(){
ss = new ScreenShake(this);
ss.shake();
}
function frame50(){
stop();
}
}
}//package sr_0704_fla
Section 90
//GAMEOVER4_120 (sr_0704_fla.GAMEOVER4_120)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import effect.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class GAMEOVER4_120 extends MovieClip {
public var ss:ScreenShake;
public function GAMEOVER4_120(){
addFrameScript(10, frame11, 49, frame50);
}
function frame11(){
ss = new ScreenShake(this);
ss.shake();
}
function frame50(){
stop();
}
}
}//package sr_0704_fla
Section 91
//HellBoy_194 (sr_0704_fla.HellBoy_194)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class HellBoy_194 extends MovieClip {
public function HellBoy_194(){
addFrameScript(0, frame1, 199, frame200);
}
function frame200(){
stop();
}
function frame1(){
if (GameI.notIsFirstPlay){
this.gotoAndStop(this.totalFrames);
} else {
GameI.notIsFirstPlay = true;
};
}
}
}//package sr_0704_fla
Section 92
//hero_upset_378 (sr_0704_fla.hero_upset_378)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class hero_upset_378 extends MovieClip {
public function hero_upset_378(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(GameI.main.gameInfo.heroId);
}
}
}//package sr_0704_fla
Section 93
//inst_movie_171 (sr_0704_fla.inst_movie_171)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class inst_movie_171 extends MovieClip {
public var leftKey:MovieClip;
public var zoomOutKey:MovieClip;
public var id:int;
public var downKey:MovieClip;
public var keyNameArr:Array;
public var keyName:String;
public var spaceKey:MovieClip;
public var rightKey:MovieClip;
public var upKey:MovieClip;
public var zoomInKey:MovieClip;
public var currKeyName:String;
public function inst_movie_171(){
addFrameScript(0, frame1, 1, frame2);
}
public function setKeyUp():void{
this[(currKeyName + "Key")].prevFrame();
GameI[(currKeyName + "KeyDown")] = false;
currKeyName = "";
}
function frame1(){
GameI.resetKeyDowns();
id = 0;
keyNameArr = ["left", "right", "up", "down", "space", "zoomOut", "zoomIn"];
for each (keyName in keyNameArr) {
this[(keyName + "Key")].gotoAndStop(1);
};
Global.addRun("inst_movie run()", run, 30);
}
function frame2(){
stop();
}
public function run(_arg1:int):void{
trace(("times=" + _arg1));
if ((_arg1 % 2) == 0){
setKeyDown(keyNameArr[id]);
if (++id >= 7){
id = 0;
};
} else {
setKeyUp();
};
}
public function setKeyDown(_arg1:String):void{
currKeyName = _arg1;
this[(_arg1 + "Key")].nextFrame();
GameI[(_arg1 + "KeyDown")] = true;
}
}
}//package sr_0704_fla
Section 94
//loading_9 (sr_0704_fla.loading_9)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class loading_9 extends MovieClip {
public function loading_9(){
addFrameScript(0, frame1, 145, frame146);
}
function frame1(){
}
function frame146(){
stop();
MovieClip(parent).play();
}
}
}//package sr_0704_fla
Section 95
//loading_logo_loading_2 (sr_0704_fla.loading_logo_loading_2)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class loading_logo_loading_2 extends MovieClip {
public function loading_logo_loading_2(){
addFrameScript(38, frame39);
}
function frame39(){
stop();
}
}
}//package sr_0704_fla
Section 96
//loading_num_6 (sr_0704_fla.loading_num_6)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class loading_num_6 extends MovieClip {
public var num_txt:TextField;
public var li:LoaderInfo;
public var _root;
public function loading_num_6(){
addFrameScript(0, frame1);
}
public function loading(_arg1:Event):void{
var _local2:int;
_local2 = int(((li.bytesLoaded / li.bytesTotal) * 100));
num_txt.text = (_local2 + "%");
if (_local2 >= 100){
removeEventListener(Event.ENTER_FRAME, loading);
if (!(_root._mochiad is MovieClip)){
_root.play();
};
};
}
function frame1(){
_root = stage.getChildAt(0);
li = _root.loaderInfo;
this.addEventListener(Event.ENTER_FRAME, loading);
}
}
}//package sr_0704_fla
Section 97
//loading_protect_text_8 (sr_0704_fla.loading_protect_text_8)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class loading_protect_text_8 extends MovieClip {
public var main;
public function loading_protect_text_8(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package sr_0704_fla
Section 98
//MainTimeline (sr_0704_fla.MainTimeline)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 4, frame5);
}
function frame3(){
if (this.loaderInfo.bytesLoaded < this.loaderInfo.bytesTotal){
gotoAndStop("loading");
};
}
function frame1(){
stage.showDefaultContextMenu = false;
MochiAd.showPreGameAd({clip:this, id:"1d4cee0b86ec9126", res:"550x400", background:6845841, color:788068, outline:12695210, no_bg:false});
}
function frame5(){
stop();
}
}
}//package sr_0704_fla
Section 99
//ready_mc_271 (sr_0704_fla.ready_mc_271)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class ready_mc_271 extends MovieClip {
public function ready_mc_271(){
addFrameScript(0, frame1, 96, frame97, 119, frame120);
}
function frame97(){
if (GameI.game){
GameI.game.start();
MovieClip(this.parent).nextFrame();
};
}
function frame1(){
MovieClip(this.parent).stop();
}
function frame120(){
stop();
this.parent.removeChild(this);
}
}
}//package sr_0704_fla
Section 100
//selectPad_cars_149 (sr_0704_fla.selectPad_cars_149)
package sr_0704_fla {
import flash.display.*;
import ui.*;
public dynamic class selectPad_cars_149 extends MovieClip {
public var card:MovieClip;
public var nameBg:MovieClip;
public var nameTxt:Label1;
}
}//package sr_0704_fla
Section 101
//super_race_139 (sr_0704_fla.super_race_139)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import FWG.*;
import flash.media.*;
import effect.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class super_race_139 extends MovieClip {
public var track_bigImg:MovieClip;
public var btn:BtnLevel;
public var i:int;
public var tm:TweenMenu;
public var stageSelecter:StageSelecter;
public function super_race_139(){
addFrameScript(0, frame1);
}
function frame1(){
track_bigImg.gotoAndStop(GameI.defaultTrack);
stageSelecter.btnAction = MovieClip(this.parent).selectLevel;
tm = new TweenMenu(stageSelecter);
i = stageSelecter.numChildren;
while (--i >= 0) {
btn = BtnLevel(stageSelecter.getChildAt(i));
btn._rollOver = function ():void{
tm.makeBig(this);
GameI.defaultTrack = this.levelId;
track_bigImg.gotoAndStop(this.levelId);
};
btn._rollOut = function ():void{
tm.makeSmall(this);
};
};
track_bigImg.gotoAndStop("blank");
}
}
}//package sr_0704_fla
Section 102
//super_race_226 (sr_0704_fla.super_race_226)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class super_race_226 extends MovieClip {
public function super_race_226(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package sr_0704_fla
Section 103
//super_race_235 (sr_0704_fla.super_race_235)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class super_race_235 extends MovieClip {
public function super_race_235(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop((Common.random(4) + 1));
}
}
}//package sr_0704_fla
Section 104
//super_race_237 (sr_0704_fla.super_race_237)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import ui.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class super_race_237 extends MovieClip {
public var txt:Label1;
public function super_race_237(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package sr_0704_fla
Section 105
//ui_49 (sr_0704_fla.ui_49)
package sr_0704_fla {
import flash.display.*;
import FWG.*;
public dynamic class ui_49 extends MovieClip {
public var btn3:BtnQ3;
public var btn0:BtnQ0;
public var btn2:BtnQ2;
public var btnOk:BtnOK;
public var btn1:BtnQ1;
}
}//package sr_0704_fla
Section 106
//ui_62 (sr_0704_fla.ui_62)
package sr_0704_fla {
import flash.display.*;
import FWG.*;
import ui.*;
public dynamic class ui_62 extends MovieClip {
public var btnYes:BtnYes;
public var msgTxt:Label1;
public var btnNo:BtnNo;
}
}//package sr_0704_fla
Section 107
//win_titles_86 (sr_0704_fla.win_titles_86)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class win_titles_86 extends MovieClip {
public function win_titles_86(){
addFrameScript(0, frame1);
}
function frame1(){
if (GameI.playMode == GameI.playMode_tournament){
stop();
} else {
nextFrame();
};
}
}
}//package sr_0704_fla
Section 108
//YOUWIN_1_76 (sr_0704_fla.YOUWIN_1_76)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class YOUWIN_1_76 extends MovieClip {
public function YOUWIN_1_76(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package sr_0704_fla
Section 109
//YOUWIN_2_78 (sr_0704_fla.YOUWIN_2_78)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class YOUWIN_2_78 extends MovieClip {
public function YOUWIN_2_78(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package sr_0704_fla
Section 110
//YOUWIN_3_80 (sr_0704_fla.YOUWIN_3_80)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class YOUWIN_3_80 extends MovieClip {
public function YOUWIN_3_80(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package sr_0704_fla
Section 111
//YOUWIN_4_82 (sr_0704_fla.YOUWIN_4_82)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class YOUWIN_4_82 extends MovieClip {
public function YOUWIN_4_82(){
addFrameScript(60, frame61);
}
function frame61(){
stop();
}
}
}//package sr_0704_fla
Section 112
//YOUWIN_75 (sr_0704_fla.YOUWIN_75)
package sr_0704_fla {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class YOUWIN_75 extends MovieClip {
public function YOUWIN_75(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(GameI.main.gameInfo.heroId);
}
}
}//package sr_0704_fla
Section 113
//AllScore (super_race.AllScore)
package super_race {
import flash.display.*;
import ui.*;
public class AllScore extends Sprite {
public var coinTxt4:Label2;
public var coinTxt3:Label2;
public var scoreTxt:Label2;
public var currScoreTxt:Label2;
public var bonusTxt:Label2;
public var coinTxt1:Label2;
public var coinTxt2:Label2;
public function AllScore(){
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
super();
_local1 = [0, 0, 0, 0, 0];
for each (_local2 in GameI.heroCoinArr) {
var _local8 = _local1;
var _local9 = _local2;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
_local3 = 1;
while (_local3 <= 4) {
_local4 = _local1[_local3];
_local5 = ((_local3 == GameI.main.gameInfo.heroId)) ? GameI.matchScore : GameI.notMatchScore;
this[("coinTxt" + _local3)].text = ((((_local4 + " x ") + _local5) + " = ") + (_local4 * _local5));
_local3++;
};
bonusTxt.text = GameI.levelBonus;
currScoreTxt.text = GameI.main.currScore;
scoreTxt.text = GameI.main.score;
}
}
}//package super_race
Section 114
//bg1 (super_race.bg1)
package super_race {
import flash.display.*;
public dynamic class bg1 extends Sprite {
}
}//package super_race
Section 115
//bg2 (super_race.bg2)
package super_race {
import flash.display.*;
public dynamic class bg2 extends Sprite {
}
}//package super_race
Section 116
//bg3 (super_race.bg3)
package super_race {
import flash.display.*;
public dynamic class bg3 extends Sprite {
}
}//package super_race
Section 117
//bg4 (super_race.bg4)
package super_race {
import flash.display.*;
public dynamic class bg4 extends Sprite {
}
}//package super_race
Section 118
//bg5 (super_race.bg5)
package super_race {
import flash.display.*;
public dynamic class bg5 extends Sprite {
}
}//package super_race
Section 119
//bg6 (super_race.bg6)
package super_race {
import flash.display.*;
public dynamic class bg6 extends Sprite {
}
}//package super_race
Section 120
//Car (super_race.Car)
package super_race {
import _3d.*;
import flash.display.*;
import flash.utils.*;
public class Car extends HitObj {
public var carId:int;
public var coinArr:Array;
private var __currHouse:House;
public var ax:Number;
public var u:Number;
public var v:Vector;
private var tp:Vector;
private var invincibleValue:int;
public var score:int;
public var isDead:Boolean;
private var __hp:int;
public var maxV_x:Number;
public var maxV_z:Number;
public var maxV_y:Number;
private var speedUpTime:int;
public var checkDot:CheckDot;
public var ayz:Number;
public var hpValue:Number;
public var order:int;
public var accValue:Number;
private var shieldValue:int;
public var maxHp:int;
public var skillValue:Number;
private var __lap:int;
public var maxSpeedValue:Number;
public static const carDataArr:Array = [{name:"PIGZILLA", color:0, accValue:60, maxSpeedValue:60, skillValue:60, hpValue:60}, {name:"CHIMPBOARDER", color:0, accValue:75, maxSpeedValue:50, skillValue:65, hpValue:50}, {name:"HOONEY BOONEY", color:0, accValue:65, maxSpeedValue:75, skillValue:50, hpValue:50}, {name:"GOATERAID", color:0, accValue:50, maxSpeedValue:50, skillValue:50, hpValue:90}];
public static const speedUpSpeed:Number = 1000;
public static const minV_x:Number = 100;
public static const totalValue:int = 250;
public static var shieldFilters:Array;
public function Car(_arg1:Vector, _arg2:int){
var _local3:Object;
super(_arg1);
lap = 0;
carId = _arg2;
body = new (getDefinitionByName(("super_race.CarBody" + carId)));
this.addChild(body);
body.gotoAndStop("front1");
v = new Vector();
_local3 = GameI.main.gameInfo.carDataArr[(GameI.main.gameInfo.heroId - 1)];
ax = (_local3.accValue * 0.03);
ayz = (_local3.accValue * 0.1);
u = 0.9;
maxV_x = (400 + ((_local3.maxSpeedValue - 50) * 4));
maxV_y = (maxV_z = (_local3.skillValue * 0.8));
hp = (maxHp = (_local3.hpValue * 1.2));
tp = new Vector();
if (!GameI.isInst){
currHouse = GameI.game.track.getHouseById(trackId);
};
coinArr = new Array();
trace(((((((((((((this + ",carId=") + carId) + ",ax=") + ax) + ",ayz=") + ayz) + ",maxV_x=") + maxV_x) + ",maxV_y和maxV_z=") + maxV_y) + ",hp=") + hp));
}
public function mov_x(_arg1:int):void{
if (_arg1 == 0){
v.x = (v.x * 0.99);
} else {
v.x = (v.x + (((_arg1 > 0)) ? 1 : -1 * ax));
};
}
public function get currHouse():House{
return (__currHouse);
}
public function mov_z(_arg1:int):void{
if (_arg1 == 0){
v.z = (v.z * u);
} else {
v.z = (v.z + (((_arg1 > 0)) ? 1 : -1 * ayz));
};
}
public function set hp(_arg1:int):void{
__hp = _arg1;
}
public function set currHouse(_arg1:House):void{
__currHouse = _arg1;
}
public function mov_y(_arg1:int):void{
if (_arg1 == 0){
v.y = (v.y * u);
} else {
v.y = (v.y + (((_arg1 > 0)) ? 1 : -1 * ayz));
};
rotate(_arg1);
}
public function hurt(_arg1:int=5):void{
if ((((((speedUpTime > 0)) || ((invincibleValue > 0)))) || ((shieldValue > 0)))){
} else {
if (GameI.playMode == GameI.playMode_timeTrial){
} else {
if ((this is Hero)){
hp = (hp - _arg1);
};
};
if ((this is Hero)){
GameI.main.playSound("SndHit");
};
if ((((this is Enemy)) && ((Math.random() < 0.3)))){
v.x = (v.x * 0.75);
} else {
v.x = (v.x * 0.75);
};
if (hp <= 0){
die();
} else {
invincibleValue = 100;
};
};
}
public function addScore(_arg1:int):void{
score = (score + _arg1);
}
public function die():void{
hp = 0;
isDead = true;
GameI.game.carOrderPad.setDie(this);
Common.setGrey(checkDot);
Common.arrDel(GameI.game.carArr, this);
Global.addRun("Car dieRun()", dieRun, 1, 60, false);
}
public function checkHitPowerUp():void{
var _local1:PowerUp;
var _local2:int;
_local1 = currHouse.hitPowerUp(trackO);
if (_local1){
switch (_local1.type){
case PowerUp.type_gold:
if ((this is Hero)){
GameI.main.playSound("SndCoin");
GameI.game.track.addHitObj(new TxtPopUp(trackO, "+10"));
};
_local2 = MovieClip(_local1.getChildAt(0)).currentFrame;
coinArr.push(_local2);
if (_local2 == carId){
addScore(GameI.matchScore);
} else {
addScore(GameI.notMatchScore);
};
break;
case PowerUp.type_missile:
GameI.game.track.addHitObj(new Missile(this));
break;
case PowerUp.type_shield:
if ((this is Hero)){
GameI.main.playSound("SndShield");
};
addShield();
break;
case PowerUp.type_hp:
if ((this is Hero)){
GameI.main.playSound("SndHp");
};
addHp();
break;
};
};
}
public function run():void{
}
public function mov():void{
var _local1:Number;
var _local2:int;
var _local3:int;
if (v.x < minV_x){
v.x = minV_x;
};
if (v.x > maxV_x){
v.x = maxV_x;
};
if (v.y > maxV_y){
v.y = maxV_y;
} else {
if (v.y < -(maxV_y)){
v.y = -(maxV_y);
};
};
if (v.z > maxV_z){
v.z = maxV_z;
} else {
if (v.z < -(maxV_z)){
v.z = -(maxV_z);
};
};
_local1 = (1 - (0.5 * Math.abs((rotaObj.rotation / 20))));
v.x = (v.x * _local1);
trackO.add(v);
v.x = (v.x / _local1);
trackO.y = (trackO.y + ((rotaObj.rotation * v.x) * 0.005));
if (trackO.y > Track.right){
trackO.y = Track.right;
} else {
if (trackO.y < Track.left){
trackO.y = Track.left;
};
};
if (invincibleValue > 0){
invincibleValue--;
body.alpha = (((invincibleValue % 5) < 2)) ? 1 : 0.2;
};
if (shieldValue > 0){
shieldValue--;
if (shieldValue < 60){
body.filters = (((shieldValue % 6) <= 2)) ? null : shieldFilters;
};
};
if (speedUpTime > 0){
v.z = 0;
speedUpTime--;
if (speedUpTime < 100){
v.x = (v.x + ((maxV_x - v.x) * 0.02));
trackO.z = (trackO.z + ((((Track.top + Track.bottom) / 2) - trackO.z) * 0.02));
} else {
v.x = (v.x + ((speedUpSpeed - v.x) * 0.1));
trackO.z = (trackO.z + (((Track.top + 1800) - trackO.z) * 0.02));
};
} else {
if (trackO.z > Track.top){
trackO.z = Track.top;
} else {
if (trackO.z < Track.bottom){
trackO.z = Track.bottom;
};
};
};
_local2 = trackId;
updatePos();
if ((((trackId > Track.startTrackId)) && ((_local2 <= Track.startTrackId)))){
lap++;
trace(("lap=" + lap));
};
if (!GameI.isInst){
_local3 = GameI.game.track.getHousePos((trackId + 2), currHouse);
if (_local3 < 0){
checkHit();
currHouse = GameI.game.track.getHouseByPrevHouse(currHouse, (trackId + 2));
};
};
}
public function get hp():int{
return (__hp);
}
public function set lap(_arg1:int):void{
__lap = _arg1;
if (__lap > GameI.totalLap){
GameI.game.carOrderPad.setWin(this);
Common.arrDel(GameI.game.carArr, this);
};
}
public function speedUp():void{
speedUpTime = (30 * 10);
}
public function rotate(_arg1:int):void{
if (Math.abs(_arg1) < 1){
body.rotation = (body.rotation * u);
} else {
body.rotation = (body.rotation + (((((_arg1 > 0)) ? -1 : 1 * 30) - body.rotation) * 0.2));
};
}
public function addShield():void{
shieldValue = 300;
body.filters = shieldFilters;
}
public function checkHit():void{
if ((((((speedUpTime > 0)) || ((invincibleValue > 0)))) || ((shieldValue > 0)))){
checkHitPowerUp();
return;
};
if (currHouse.checkHitWall(trackO)){
trackO.x = (trackO.x - 500);
hurt();
} else {
checkHitPowerUp();
};
}
public function addHp():void{
if ((hp = (hp + 10)) > maxHp){
hp = maxHp;
};
}
public function get lap():int{
return (__lap);
}
public function dieRun(_arg1:int):void{
body.rotation = (_arg1 * 10);
this.y = (this.y + 10);
}
public static function firstInit():void{
var _local1:CarColorRect;
var _local2:int;
var _local3:Object;
shieldFilters = MovieClip(new ShieldLight().getChildAt(0)).filters;
_local1 = new CarColorRect();
_local2 = 0;
for each (_local3 in carDataArr) {
_local3.color = Common.getRGB(_local1.getChildAt(_local2));
_local2++;
};
}
}
}//package super_race
Section 121
//CarBody (super_race.CarBody)
package super_race {
import flash.display.*;
public class CarBody extends MovieClip {
}
}//package super_race
Section 122
//CarBody1 (super_race.CarBody1)
package super_race {
public dynamic class CarBody1 extends CarBody {
}
}//package super_race
Section 123
//CarBody2 (super_race.CarBody2)
package super_race {
public dynamic class CarBody2 extends CarBody {
}
}//package super_race
Section 124
//CarBody3 (super_race.CarBody3)
package super_race {
public dynamic class CarBody3 extends CarBody {
}
}//package super_race
Section 125
//CarBody4 (super_race.CarBody4)
package super_race {
public dynamic class CarBody4 extends CarBody {
}
}//package super_race
Section 126
//CarColorRect (super_race.CarColorRect)
package super_race {
import flash.display.*;
public dynamic class CarColorRect extends Sprite {
}
}//package super_race
Section 127
//CarFace (super_race.CarFace)
package super_race {
import flash.display.*;
public dynamic class CarFace extends MovieClip {
public var p:MovieClip;
public var flag:MovieClip;
public var icon:MovieClip;
}
}//package super_race
Section 128
//CarOrderPad (super_race.CarOrderPad)
package super_race {
import flash.display.*;
public class CarOrderPad extends Sprite {
private var topId:int;
public var face1:CarFace;
public var face2:CarFace;
public var face3:CarFace;
public var face4:CarFace;
private var bottomId:int;
public function CarOrderPad(){
var _local1:int;
var _local2:Car;
var _local3:*;
super();
GameI.game.carOrderPad = this;
_local1 = 1;
for each (_local2 in GameI.game.carArr) {
_local3 = this[("face" + _local1)];
_local3.flag.visible = false;
setFace(_local3, _local2);
_local1++;
};
_local1 = (GameI.game.carArr.length + 1);
topId = 1;
bottomId = GameI.game.carArr.length;
while (_local1 <= 4) {
this.removeChild(this[("face" + _local1)]);
_local1++;
};
}
public function setWin(_arg1:Car):void{
var _local2:*;
_local2 = this[("face" + topId)];
_local2.flag.visible = true;
setFace(_local2, _arg1);
_arg1.order = topId;
topId++;
}
public function setDie(_arg1:Car):void{
var _local2:*;
_local2 = this[("face" + bottomId)];
Common.setGrey(_local2);
setFace(_local2, _arg1);
_arg1.order = bottomId;
bottomId--;
}
public function update():void{
var _local1:int;
var _local2:Car;
_local1 = topId;
for each (_local2 in GameI.game.carArr) {
setFace(this[("face" + _local1)], _local2);
_local1++;
};
}
private function setFace(_arg1, _arg2:Car):void{
_arg1.icon.gotoAndStop(_arg2.carId);
if ((_arg2 is Hero)){
if (_arg1.p.root == null){
_arg1.addChild(_arg1.p);
};
} else {
if (_arg1.p.root){
_arg1.removeChild(_arg1.p);
};
};
}
}
}//package super_race
Section 129
//CarValueBar (super_race.CarValueBar)
package super_race {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import FWG.*;
import basic.*;
public class CarValueBar extends Sp {
public var bar:MovieClip;
private var dragRect:Rectangle;
public var bar2:MovieClip;
private var __defaultValue:Number;
private var __value:Number;
public var wid0:int;
public var delta:MovieClip;
public static const maxValue:int = 100;
public function CarValueBar(){
wid0 = bar.width;
bar.width = 1;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, stopTips, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, startAdjust, false, 0, true);
Global.addRun("CarValueBar barMovRun()", barMovRun);
}
public function stopAdjust():void{
stopDrag();
Global.delRun(dragRun);
}
override public function removed():void{
super.removed();
this.removeEventListener(MouseEvent.MOUSE_DOWN, startAdjust);
this.removeEventListener(MouseEvent.MOUSE_DOWN, stopTips);
dragRect = null;
Global.delRun(barMovRun);
Global.delRun(dragRun);
}
public function stopTips(_arg1:MouseEvent):void{
SelectCar(parent).stopTips();
}
public function set defaultValue(_arg1:Number):void{
__defaultValue = _arg1;
bar2.width = ((__defaultValue / maxValue) * wid0);
}
public function get value():Number{
return (__value);
}
public function startAdjust(_arg1:MouseEvent):void{
SelectCar(parent).currBar = this;
delta.startDrag(true, new Rectangle(((__defaultValue / maxValue) * wid0), 0, ((((value + SelectCar(parent).adjustBar.value) - __defaultValue) / maxValue) * wid0), 0));
Global.addRun("CarValueBar dragRun()", dragRun);
}
public function get defaultValue():Number{
return (__defaultValue);
}
public function dragRun(_arg1:int):void{
value = ((delta.x * maxValue) / wid0);
}
public function barMovRun(_arg1:int):void{
bar.width = (bar.width + ((delta.x - bar.width) * 0.5));
}
public function set value(_arg1:Number):void{
__value = _arg1;
if (__value < __defaultValue){
__value = __defaultValue;
};
delta.x = ((__value / maxValue) * wid0);
}
}
}//package super_race
Section 130
//CheckDot (super_race.CheckDot)
package super_race {
import flash.display.*;
public class CheckDot extends MovieClip {
public var obj;
public function CheckDot(_arg1){
obj = _arg1;
if ((obj is Car)){
obj.checkDot = this;
this.gotoAndStop(1);
if ((obj is ShadowCar)){
Common.setRGB(this.getChildAt(0), 0x999999);
} else {
Common.setRGB(this.getChildAt(0), GameI.main.gameInfo.carDataArr[(obj.carId - 1)].color);
if ((obj is Hero)){
this.scaleX = (this.scaleY = 1.5);
};
};
} else {
if ((obj is Missile)){
this.gotoAndStop(2);
};
};
}
public function update(_arg1:Number):void{
if (obj.root){
this.x = (obj.o.x * _arg1);
this.y = (-(obj.o.y) * _arg1);
} else {
GameI.game.trackMap.removeCheck(obj);
obj = null;
};
}
}
}//package super_race
Section 131
//colorRect1_0 (super_race.colorRect1_0)
package super_race {
import flash.display.*;
public dynamic class colorRect1_0 extends Sprite {
}
}//package super_race
Section 132
//colorRect1_1 (super_race.colorRect1_1)
package super_race {
import flash.display.*;
public dynamic class colorRect1_1 extends Sprite {
}
}//package super_race
Section 133
//colorRect2_0 (super_race.colorRect2_0)
package super_race {
import flash.display.*;
public dynamic class colorRect2_0 extends Sprite {
}
}//package super_race
Section 134
//colorRect2_1 (super_race.colorRect2_1)
package super_race {
import flash.display.*;
public dynamic class colorRect2_1 extends Sprite {
}
}//package super_race
Section 135
//colorRect3_0 (super_race.colorRect3_0)
package super_race {
import flash.display.*;
public dynamic class colorRect3_0 extends Sprite {
}
}//package super_race
Section 136
//colorRect3_1 (super_race.colorRect3_1)
package super_race {
import flash.display.*;
public dynamic class colorRect3_1 extends Sprite {
}
}//package super_race
Section 137
//colorRect4_0 (super_race.colorRect4_0)
package super_race {
import flash.display.*;
public dynamic class colorRect4_0 extends Sprite {
}
}//package super_race
Section 138
//colorRect4_1 (super_race.colorRect4_1)
package super_race {
import flash.display.*;
public dynamic class colorRect4_1 extends Sprite {
}
}//package super_race
Section 139
//colorRect6_0 (super_race.colorRect6_0)
package super_race {
import flash.display.*;
public dynamic class colorRect6_0 extends Sprite {
}
}//package super_race
Section 140
//colorRect6_1 (super_race.colorRect6_1)
package super_race {
import flash.display.*;
public dynamic class colorRect6_1 extends Sprite {
}
}//package super_race
Section 141
//Enemy (super_race.Enemy)
package super_race {
import _3d.*;
import ui.*;
public class Enemy extends Car {
private var yValue:int;
private var delayTime:int;
private var accRate:Number;
private var zValue:int;
private var targetPup:PowerUpPos;
public function Enemy(_arg1:Vector, _arg2:int){
super(_arg1, _arg2);
delayTime = 0;
yValue = 0;
zValue = 0;
switch (GameI.gameDiff){
case GameI.diff_easy:
accRate = 0.85;
break;
case GameI.diff_normal:
accRate = 0.9;
break;
case GameI.diff_hard:
accRate = 0.95;
break;
case GameI.diff_crazy:
accRate = 1;
break;
default:
accRate = (0.85 + (0.15 * (GameI.main.stageNum / GameI.main.totalStage)));
break;
};
trace(("accRate=" + accRate));
}
override public function set currHouse(_arg1:House):void{
super.currHouse = _arg1;
targetPup = currHouse.getPup();
}
override public function run():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (Math.random() < accRate){
mov_x(1);
} else {
mov_x(0);
};
_local1 = GameI.game.track.getDistance(this, currHouse);
_local2 = ((currHouse.trackO.y + targetPup.trackO.y) - trackO.y);
_local3 = ((currHouse.trackO.z + targetPup.trackO.z) - trackO.z);
if (_local1 < 12000){
if (Math.abs(_local2) < maxV_y){
v.y = 0;
trackO.y = (trackO.y + (_local2 * 0.1));
rotate(0);
} else {
mov_y(_local2);
};
if (Math.abs(_local3) < maxV_z){
v.z = 0;
trackO.z = (trackO.z + (_local3 * 0.1));
rotate(0);
} else {
mov_z(_local3);
};
} else {
mov_y(0);
mov_z(0);
};
mov();
}
override public function set lap(_arg1:int):void{
super.lap = _arg1;
if (lap > GameI.totalLap){
if (order >= GameI.winOrder){
Global.pause = true;
GameI.game.parent.addChild(new gameover_upset());
GameI.game.hero.x = -10000;
if (Alert.alert){
Alert.alert.parent.removeChild(Alert.alert);
};
};
};
}
}
}//package super_race
Section 142
//Game (super_race.Game)
package super_race {
import _3d.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import FWG.*;
import flash.utils.*;
public class Game extends BasicGame {
public var hero:Hero;
public var trackMap:TrackMap;
public var track:Track;
public var isStart:Boolean;
public var carOrderPad:CarOrderPad;
private var ground;
public var gameArea:Sprite;
private var rootSystem:RootSystem;
public var carArr:Array;
public function Game(){
var _local1:*;
var _local2:*;
var _local3:int;
var _local4:int;
var _local5:*;
super();
_local1 = new (getDefinitionByName(("super_race.bg" + GameI.main.stageNum)));
_local1.cacheAsBitmap = true;
this.addChild(_local1);
gameArea = new Sprite();
this.addChild(gameArea);
ground = new (getDefinitionByName(("super_race.Ground" + GameI.main.stageNum)));
gameArea.addChild(ground);
rootSystem = new RootSystem();
gameArea.addChild(rootSystem);
if (GameI.isInst){
isStart = true;
} else {
isStart = false;
};
GameI.game = this;
track = new Track();
track.initTrack();
rootSystem.addSystem(track);
carArr = new Array();
if (GameI.isInst){
hero = new Hero(new Vector(600, 150), GameI.main.gameInfo.heroId);
carArr.unshift(hero);
track.addHitObj(hero);
} else {
if (GameI.playMode == GameI.playMode_timeTrial){
hero = new Hero(new Vector(600, 150), GameI.main.gameInfo.heroId);
carArr.unshift(hero);
track.addHitObj(hero);
if (GameI.recordDataArr){
ShadowCar.shadowCar = new ShadowCar(GameI.recordDataArr[0], GameI.main.gameInfo.heroId);
carArr.unshift(ShadowCar.shadowCar);
track.addHitObj(ShadowCar.shadowCar);
};
} else {
_local3 = 1;
_local4 = -3;
for each (_local5 in GameI.main.gameInfo.carDataArr) {
if (_local3 == GameI.main.gameInfo.heroId){
_local2 = new Hero(new Vector((600 + _local3), (1 * 150)), _local3);
hero = _local2;
} else {
_local2 = new Enemy(new Vector((600 + _local3), (_local4 * 150)), _local3);
_local4 = (_local4 + 2);
if (_local4 == 1){
_local4 = (_local4 + 2);
};
};
carArr.unshift(_local2);
track.addHitObj(_local2);
_local3++;
};
};
};
rootSystem.update();
for each (_local2 in carArr) {
_local2.run();
};
hero.closeTo();
Global.addRun("Game run()", run);
}
private function sortCarByOrder(_arg1:Car, _arg2:Car):int{
return (((_arg1.trackO.x > _arg2.trackO.x)) ? -1 : 1);
}
public function initTrackMap(_arg1:TrackMap):void{
var _local2:Car;
trackMap = _arg1;
trackMap.drawPath(track);
for each (_local2 in carArr) {
trackMap.addCheck(_local2);
};
}
override public function removed():void{
super.removed();
trackMap = null;
carOrderPad = null;
hero = null;
track = null;
carArr = null;
Global.delRun(run);
GameI.game = null;
}
public function start():void{
isStart = true;
if (GameI.playMode == GameI.playMode_timeTrial){
GameI.main.gamePad.numClock.count();
};
}
public function run(_arg1:int):void{
var _local2:Car;
if (isStart){
for each (_local2 in carArr) {
_local2.run();
};
};
carArr.sort(sortCarByOrder);
rootSystem.update();
track.redraw(rootSystem.camera);
for each (_local2 in carArr) {
_local2.redraw(rootSystem.camera);
};
ground.redraw(rootSystem.camera);
if (!GameI.isInst){
trackMap.update();
carOrderPad.update();
};
}
public static function firstInit():Boolean{
House.firstInit();
Car.firstInit();
return (true);
}
}
}//package super_race
Section 143
//GetTrack (super_race.GetTrack)
package super_race {
import flash.display.*;
import math.*;
import flash.geom.*;
public class GetTrack extends MovieClip {
public var dot:MovieClip;
public var pArr:Array;
public static const uTotal:int = 60;
public function GetTrack(){
var _local1:int;
var _local2:int;
var _local3:Vector2;
var _local4:Vector2;
super();
pArr = new Array();
_local1 = this.totalFrames;
_local2 = 0;
while (_local2 < _local1) {
this.gotoAndStop((_local2 + 1));
pArr.push(new Vector2(dot.x, -(dot.y)));
_local2++;
};
_local3 = pArr[0];
_local4 = pArr[(_local1 - 1)];
_local3.x = ((_local3.x + _local4.x) / 2);
_local3.y = ((_local3.y + _local4.y) / 2);
pArr.pop();
}
}
}//package super_race
Section 144
//GetTrack1 (super_race.GetTrack1)
package super_race {
public dynamic class GetTrack1 extends GetTrack {
}
}//package super_race
Section 145
//GetTrack2 (super_race.GetTrack2)
package super_race {
public dynamic class GetTrack2 extends GetTrack {
}
}//package super_race
Section 146
//GetTrack3 (super_race.GetTrack3)
package super_race {
public dynamic class GetTrack3 extends GetTrack {
}
}//package super_race
Section 147
//GetTrack4 (super_race.GetTrack4)
package super_race {
public dynamic class GetTrack4 extends GetTrack {
}
}//package super_race
Section 148
//GetTrack5 (super_race.GetTrack5)
package super_race {
public dynamic class GetTrack5 extends GetTrack {
}
}//package super_race
Section 149
//GetTrack6 (super_race.GetTrack6)
package super_race {
public dynamic class GetTrack6 extends GetTrack {
}
}//package super_race
Section 150
//Ground (super_race.Ground)
package super_race {
import _3d.*;
import flash.display.*;
public class Ground extends Sprite {
public var kr:Number;
public function Ground(){
kr = (((this.width / 2) / Math.PI) / 2);
}
public function redraw(_arg1:Camera3d):void{
this.x = (Math.atan2(_arg1.vx.y, _arg1.vx.x) * kr);
this.y = (_arg1.o.z * 0.02);
}
}
}//package super_race
Section 151
//Ground1 (super_race.Ground1)
package super_race {
public dynamic class Ground1 extends Ground {
}
}//package super_race
Section 152
//Ground2 (super_race.Ground2)
package super_race {
public dynamic class Ground2 extends Ground {
}
}//package super_race
Section 153
//Ground3 (super_race.Ground3)
package super_race {
public dynamic class Ground3 extends Ground {
}
}//package super_race
Section 154
//Ground4 (super_race.Ground4)
package super_race {
public dynamic class Ground4 extends Ground {
}
}//package super_race
Section 155
//Ground5 (super_race.Ground5)
package super_race {
public dynamic class Ground5 extends Ground {
}
}//package super_race
Section 156
//Ground6 (super_race.Ground6)
package super_race {
public dynamic class Ground6 extends Ground {
}
}//package super_race
Section 157
//Hero (super_race.Hero)
package super_race {
import _3d.*;
import flash.display.*;
public class Hero extends Car {
private var maxO0x:Number;// = -1000
private var minO0x:Number;
private var o0:Vector;
private var o1:Vector;
private static const vy0:Vector = new Vector(0, 1, 0);
private static const target0:Vector = new Vector(100000, 0, 0);
private static var headIdOffset:int;
public function Hero(_arg1:Vector, _arg2:int){
maxO0x = -1000;
super(_arg1, _arg2);
o0 = new Vector(maxO0x, 0, 50);
}
override public function set hp(_arg1:int):void{
var _hp = _arg1;
super.hp = _hp;
try {
GameI.main.gamePad.hpBar.value = hp;
} catch(e) {
trace("gamepad未初始化");
};
}
override public function addScore(_arg1:int):void{
super.addScore(_arg1);
GameI.main.addScore(_arg1);
}
override public function die():void{
super.die();
trace("die");
Global.pause = true;
Global.addRun("Hero loseDelay()", loseDelay, 60, 1, false);
}
public function closeTo():void{
o1 = o0.clone();
o1.x = (o1.x - 5000);
rootSystem.camera.follow2(this, o1, target0, vy0);
Global.addRun("Hero closeToRun()", closeToRun);
}
override public function run():void{
headIdOffset = (-9 - (maxO0x / 100));
minO0x = (maxO0x - 500);
if (GameI.isInst){
if (GameI.zoomInKeyDown){
if ((maxO0x = (maxO0x + 100)) > -1300){
maxO0x = -1300;
};
} else {
if (GameI.zoomOutKeyDown){
if ((maxO0x = (maxO0x - 100)) < -3000){
maxO0x = -3000;
};
};
};
if (GameI.leftKeyDown){
mov_y(1);
} else {
if (GameI.rightKeyDown){
mov_y(-1);
} else {
mov_y(0);
};
};
if (GameI.spaceKeyDown){
o0.x = (o0.x + ((minO0x - o0.x) * 0.1));
mov_x(1);
} else {
o0.x = (o0.x + ((maxO0x - o0.x) * 0.1));
mov_x(0);
};
if (GameI.upKeyDown){
mov_z(1);
} else {
if (GameI.downKeyDown){
mov_z(-1);
} else {
mov_z(0);
};
};
} else {
if (Global.keyIsDown(37)){
mov_y(1);
} else {
if (Global.keyIsDown(39)){
mov_y(-1);
} else {
mov_y(0);
};
};
if (Global.keyIsDown(32)){
o0.x = (o0.x + ((minO0x - o0.x) * 0.1));
mov_x(1);
} else {
o0.x = (o0.x + ((maxO0x - o0.x) * 0.1));
mov_x(0);
};
if (Global.keyIsDown(38)){
mov_z(1);
} else {
if (Global.keyIsDown(40)){
mov_z(-1);
} else {
mov_z(0);
};
};
};
mov();
GameI.game.gameArea.rotation = rotaObj.rotation;
if (GameI.main.gamePad){
GameI.main.gamePad.speed = v.x;
};
}
public function closeToRun(_arg1:int):void{
var _local2:Number;
_local2 = (o0.x - o1.x);
o1.x = (o1.x + (_local2 * 0.065));
rootSystem.camera.follow2(this, o1, target0, vy0);
if ((_local2 * _local2) < 100){
Global.delRun(closeToRun);
rootSystem.camera.follow2(this, o0, target0, vy0);
};
}
override public function mov():void{
super.mov();
GameI.game.track.headId = (((trackId - headIdOffset) + GameI.game.track.totalPiece) % GameI.game.track.totalPiece);
this.rotatez((-(rotaObj.rotation) * 0.01));
update();
rootSystem.camera.follow2(this, o0, target0, vy0);
}
override public function set lap(_arg1:int):void{
super.lap = _arg1;
if (GameI.main.gamePad){
GameI.main.gamePad.lap = _arg1;
};
if (lap == 0){
} else {
if (GameI.playMode == GameI.playMode_timeTrial){
if (GameI.game.track.startGate){
GameI.game.track.startGate.body.gotoAndStop(5);
};
if (lap == 1){
ShadowCar.beginRecord();
if (GameI.shadowFlag){
ShadowCar.shadowCar.replay(GameI.recordDataArr);
ShadowCar.shadowCar = null;
GameI.shadowFlag = false;
};
} else {
GameI.currTime = GameI.main.gamePad.numClock.time;
GameI.shadowFlag = true;
if (GameI.bestTime > GameI.currTime){
GameI.recordDataArr = ShadowCar.dataArr.slice();
GameI.bestTime = GameI.currTime;
};
GameI.main.saveStage();
GameI.main.win();
};
} else {
if (GameI.game.track.startGate){
if (lap >= GameI.totalLap){
GameI.game.track.startGate.body.gotoAndStop(5);
} else {
GameI.game.track.startGate.body.gotoAndStop((lap + 2));
};
};
if (lap == 1){
} else {
if (lap > GameI.totalLap){
GameI.heroCoinArr = coinArr;
GameI.heroOrder = this.order;
addScore(GameI.levelBonus);
if (GameI.playMode == GameI.playMode_tournament){
GameI.game.stageClear();
} else {
GameI.main.saveStage();
GameI.main.win();
};
};
};
};
};
}
public function loseDelay(_arg1:int):void{
GameI.game.lose();
}
}
}//package super_race
Section 158
//HitObj (super_race.HitObj)
package super_race {
import _3d.*;
public class HitObj extends Sp3d {
public var rotaObj:Object;
public var trackO:Vector;
public var toInt:Boolean;
public var trackId:int;
public function HitObj(_arg1:Vector, _arg2:Boolean=false){
toInt = _arg2;
trackO = new Vector();
rotaObj = {rotation:0};
if (_arg1){
setTrackO(_arg1.x, _arg1.y, _arg1.z);
};
}
public function setTrackO(_arg1:Number, _arg2:Number, _arg3:Number){
trackO.x = _arg1;
trackO.y = _arg2;
trackO.z = _arg3;
updatePos();
}
public function updatePos():void{
trackId = GameI.game.track.getPos(trackO, o, vx, rotaObj);
vx.normalize();
vy = vz.cross(vx);
}
override public function set visible(_arg1:Boolean):void{
if (_arg1){
if (super.visible){
return;
};
super.visible = true;
this.addChild(body);
} else {
if (!super.visible){
return;
};
super.visible = false;
this.removeChild(body);
};
}
}
}//package super_race
Section 159
//House (super_race.House)
package super_race {
import _3d.*;
import flash.display.*;
import math.*;
import flash.geom.*;
import flash.utils.*;
public class House extends HitObj {
private var bmd_o:Vector2;
public var pupArr:Array;
public var wid0:Number;
private var hitBmd:BitmapData;
public var nextHouse:House;
public static const bmdScale:Number = 0.1;
public static var hitBmdArr:Array;
public function House(_arg1:Vector, _arg2:int){
var _local3:int;
var _local4:PowerUpPos;
var _local5:*;
body = getBody(GameI.main.stageNum, _arg2);
this.addChild(body);
wid0 = body.width;
if (wid0 >= (2 * Track.trackWid2)){
_arg1.y = 0;
} else {
_arg1.y = (((wid0 / 2) - Track.trackWid2) + (((2 * Track.trackWid2) - wid0) * Math.random()));
};
super(_arg1, true);
visible = false;
_local3 = body.numChildren;
pupArr = new Array();
while (--_local3 >= 0) {
_local5 = body.getChildAt(_local3);
if ((_local5 is PowerUpPos)){
_local5.init(new Vector(trackO.x, -(_local5.x), -(_local5.y)));
pupArr.push(_local5);
body.removeChild(_local5);
};
};
if (pupArr.length == 0){
_local4 = new PowerUpPos();
_local4.init(new Vector(trackO.x, trackO.y, (trackO.z + 500)));
pupArr.push(_local4);
};
for each (_local4 in pupArr) {
body.addChild(new PowerUp(_local4));
};
hitBmd = hitBmdArr[GameI.main.stageNum][_arg2];
if (hitBmd){
bmd_o = new Vector2((hitBmd.width / 2), hitBmd.height);
};
}
public function getPup(_arg1:int=-1):PowerUpPos{
var _local2:PowerUpPos;
var _local3:int;
var _local4:Array;
if (_arg1 >= 0){
return (pupArr[_arg1]);
};
_local3 = 0;
_local4 = new Array();
for each (_local2 in pupArr) {
if (_local2.powerUp){
_local4.push(_local3);
};
_local3++;
};
if (_local4.length > 0){
return (pupArr[_local4[Common.random(_local4.length)]]);
};
return (pupArr[Common.random(pupArr.length)]);
}
public function hitPowerUp(_arg1:Vector):PowerUp{
var _local2:PowerUpPos;
var _local3:Number;
var _local4:Number;
var _local5:PowerUp;
for each (_local2 in pupArr) {
if (_local2.powerUp){
_local3 = ((_local2.trackO.y + trackO.y) - _arg1.y);
_local4 = ((_local2.trackO.z + trackO.z) - _arg1.z);
if (((_local3 * _local3) + (_local4 * _local4)) < 10000){
_local5 = _local2.powerUp;
_local2.removePowerUp();
return (_local5);
};
};
};
return (null);
}
public function checkHitWall(_arg1:Vector):Boolean{
return (!((hitBmd.getPixel32((bmd_o.x + ((trackO.y - _arg1.y) * bmdScale)), (bmd_o.y + ((trackO.z - _arg1.z) * bmdScale))) == 0)));
}
public static function firstInit():void{
var _local1:int;
var _local2:Array;
var _local3:int;
var _local4:*;
var _local5:Rectangle;
var _local6:BitmapData;
_local1 = GameI.main.totalStage;
hitBmdArr = new Array((GameI.main.totalStage + 1));
while (_local1 >= 1) {
_local2 = (hitBmdArr[_local1] = new Array());
_local3 = 0;
while ((_local4 = getBody(_local1, _local3++))) {
_local5 = _local4.getBounds(_local4);
_local6 = new BitmapData((_local4.width * bmdScale), (-(_local5.y) * bmdScale), true, 0);
_local2.push(_local6);
_local6.draw(_local4, new Matrix(bmdScale, 0, 0, bmdScale, (-(_local5.x) * bmdScale), (-(_local5.y) * bmdScale)));
};
_local1--;
};
}
public static function getBody(_arg1:int, _arg2:int){
var bodyClass:*;
var stageNum = _arg1;
var id = _arg2;
try {
bodyClass = getDefinitionByName(((("super_race.house_body" + stageNum) + "_") + id));
} catch(e) {
return (null);
};
return (new (bodyClass));
}
}
}//package super_race
Section 160
//house_body1_0 (super_race.house_body1_0)
package super_race {
import flash.display.*;
public dynamic class house_body1_0 extends MovieClip {
}
}//package super_race
Section 161
//house_body1_1 (super_race.house_body1_1)
package super_race {
import flash.display.*;
public dynamic class house_body1_1 extends MovieClip {
}
}//package super_race
Section 162
//house_body1_2 (super_race.house_body1_2)
package super_race {
import flash.display.*;
public dynamic class house_body1_2 extends MovieClip {
}
}//package super_race
Section 163
//house_body1_3 (super_race.house_body1_3)
package super_race {
import flash.display.*;
public dynamic class house_body1_3 extends MovieClip {
}
}//package super_race
Section 164
//house_body1_4 (super_race.house_body1_4)
package super_race {
import flash.display.*;
public dynamic class house_body1_4 extends MovieClip {
}
}//package super_race
Section 165
//house_body1_5 (super_race.house_body1_5)
package super_race {
import flash.display.*;
public dynamic class house_body1_5 extends MovieClip {
}
}//package super_race
Section 166
//house_body1_6 (super_race.house_body1_6)
package super_race {
import flash.display.*;
public dynamic class house_body1_6 extends MovieClip {
}
}//package super_race
Section 167
//house_body1_7 (super_race.house_body1_7)
package super_race {
import flash.display.*;
public dynamic class house_body1_7 extends MovieClip {
}
}//package super_race
Section 168
//house_body2_0 (super_race.house_body2_0)
package super_race {
import flash.display.*;
public dynamic class house_body2_0 extends MovieClip {
}
}//package super_race
Section 169
//house_body2_1 (super_race.house_body2_1)
package super_race {
import flash.display.*;
public dynamic class house_body2_1 extends MovieClip {
}
}//package super_race
Section 170
//house_body2_2 (super_race.house_body2_2)
package super_race {
import flash.display.*;
public dynamic class house_body2_2 extends MovieClip {
}
}//package super_race
Section 171
//house_body2_3 (super_race.house_body2_3)
package super_race {
import flash.display.*;
public dynamic class house_body2_3 extends MovieClip {
}
}//package super_race
Section 172
//house_body2_4 (super_race.house_body2_4)
package super_race {
import flash.display.*;
public dynamic class house_body2_4 extends MovieClip {
}
}//package super_race
Section 173
//house_body2_5 (super_race.house_body2_5)
package super_race {
import flash.display.*;
public dynamic class house_body2_5 extends MovieClip {
}
}//package super_race
Section 174
//house_body2_6 (super_race.house_body2_6)
package super_race {
import flash.display.*;
public dynamic class house_body2_6 extends MovieClip {
}
}//package super_race
Section 175
//house_body2_7 (super_race.house_body2_7)
package super_race {
import flash.display.*;
public dynamic class house_body2_7 extends MovieClip {
}
}//package super_race
Section 176
//house_body3_0 (super_race.house_body3_0)
package super_race {
import flash.display.*;
public dynamic class house_body3_0 extends MovieClip {
}
}//package super_race
Section 177
//house_body3_1 (super_race.house_body3_1)
package super_race {
import flash.display.*;
public dynamic class house_body3_1 extends MovieClip {
}
}//package super_race
Section 178
//house_body3_2 (super_race.house_body3_2)
package super_race {
import flash.display.*;
public dynamic class house_body3_2 extends MovieClip {
}
}//package super_race
Section 179
//house_body3_3 (super_race.house_body3_3)
package super_race {
import flash.display.*;
public dynamic class house_body3_3 extends MovieClip {
}
}//package super_race
Section 180
//house_body3_4 (super_race.house_body3_4)
package super_race {
import flash.display.*;
public dynamic class house_body3_4 extends MovieClip {
}
}//package super_race
Section 181
//house_body3_5 (super_race.house_body3_5)
package super_race {
import flash.display.*;
public dynamic class house_body3_5 extends MovieClip {
}
}//package super_race
Section 182
//house_body3_6 (super_race.house_body3_6)
package super_race {
import flash.display.*;
public dynamic class house_body3_6 extends MovieClip {
}
}//package super_race
Section 183
//house_body4_0 (super_race.house_body4_0)
package super_race {
import flash.display.*;
public dynamic class house_body4_0 extends MovieClip {
}
}//package super_race
Section 184
//house_body4_1 (super_race.house_body4_1)
package super_race {
import flash.display.*;
public dynamic class house_body4_1 extends MovieClip {
}
}//package super_race
Section 185
//house_body4_2 (super_race.house_body4_2)
package super_race {
import flash.display.*;
public dynamic class house_body4_2 extends MovieClip {
}
}//package super_race
Section 186
//house_body4_3 (super_race.house_body4_3)
package super_race {
import flash.display.*;
public dynamic class house_body4_3 extends MovieClip {
}
}//package super_race
Section 187
//house_body4_4 (super_race.house_body4_4)
package super_race {
import flash.display.*;
public dynamic class house_body4_4 extends MovieClip {
}
}//package super_race
Section 188
//house_body4_5 (super_race.house_body4_5)
package super_race {
import flash.display.*;
public dynamic class house_body4_5 extends MovieClip {
}
}//package super_race
Section 189
//house_body4_6 (super_race.house_body4_6)
package super_race {
import flash.display.*;
public dynamic class house_body4_6 extends MovieClip {
}
}//package super_race
Section 190
//house_body4_7 (super_race.house_body4_7)
package super_race {
import flash.display.*;
public dynamic class house_body4_7 extends MovieClip {
}
}//package super_race
Section 191
//house_body4_8 (super_race.house_body4_8)
package super_race {
import flash.display.*;
public dynamic class house_body4_8 extends MovieClip {
}
}//package super_race
Section 192
//house_body5_0 (super_race.house_body5_0)
package super_race {
import flash.display.*;
public dynamic class house_body5_0 extends MovieClip {
}
}//package super_race
Section 193
//house_body5_1 (super_race.house_body5_1)
package super_race {
import flash.display.*;
public dynamic class house_body5_1 extends MovieClip {
}
}//package super_race
Section 194
//house_body5_10 (super_race.house_body5_10)
package super_race {
import flash.display.*;
public dynamic class house_body5_10 extends MovieClip {
}
}//package super_race
Section 195
//house_body5_11 (super_race.house_body5_11)
package super_race {
import flash.display.*;
public dynamic class house_body5_11 extends MovieClip {
}
}//package super_race
Section 196
//house_body5_12 (super_race.house_body5_12)
package super_race {
import flash.display.*;
public dynamic class house_body5_12 extends MovieClip {
}
}//package super_race
Section 197
//house_body5_13 (super_race.house_body5_13)
package super_race {
import flash.display.*;
public dynamic class house_body5_13 extends MovieClip {
}
}//package super_race
Section 198
//house_body5_2 (super_race.house_body5_2)
package super_race {
import flash.display.*;
public dynamic class house_body5_2 extends MovieClip {
}
}//package super_race
Section 199
//house_body5_3 (super_race.house_body5_3)
package super_race {
import flash.display.*;
public dynamic class house_body5_3 extends MovieClip {
}
}//package super_race
Section 200
//house_body5_4 (super_race.house_body5_4)
package super_race {
import flash.display.*;
public dynamic class house_body5_4 extends MovieClip {
}
}//package super_race
Section 201
//house_body5_5 (super_race.house_body5_5)
package super_race {
import flash.display.*;
public dynamic class house_body5_5 extends MovieClip {
}
}//package super_race
Section 202
//house_body5_6 (super_race.house_body5_6)
package super_race {
import flash.display.*;
public dynamic class house_body5_6 extends MovieClip {
}
}//package super_race
Section 203
//house_body5_7 (super_race.house_body5_7)
package super_race {
import flash.display.*;
public dynamic class house_body5_7 extends MovieClip {
}
}//package super_race
Section 204
//house_body5_8 (super_race.house_body5_8)
package super_race {
import flash.display.*;
public dynamic class house_body5_8 extends MovieClip {
}
}//package super_race
Section 205
//house_body5_9 (super_race.house_body5_9)
package super_race {
import flash.display.*;
public dynamic class house_body5_9 extends MovieClip {
}
}//package super_race
Section 206
//house_body6_0 (super_race.house_body6_0)
package super_race {
import flash.display.*;
public dynamic class house_body6_0 extends MovieClip {
}
}//package super_race
Section 207
//house_body6_1 (super_race.house_body6_1)
package super_race {
import flash.display.*;
public dynamic class house_body6_1 extends MovieClip {
}
}//package super_race
Section 208
//house_body6_2 (super_race.house_body6_2)
package super_race {
import flash.display.*;
public dynamic class house_body6_2 extends MovieClip {
}
}//package super_race
Section 209
//house_body6_3 (super_race.house_body6_3)
package super_race {
import flash.display.*;
public dynamic class house_body6_3 extends MovieClip {
}
}//package super_race
Section 210
//Missile (super_race.Missile)
package super_race {
import _3d.*;
public class Missile extends HitObj {
private var ownerCar:Car;
private var prevD:Number;
private var target:Car;
private var v:Number;
public function Missile(_arg1:Car){
ownerCar = _arg1;
trace((ownerCar + "发射导弹."));
super(ownerCar.trackO);
v = (Car.speedUpSpeed * 1.1);
GameI.game.trackMap.addCheck(this);
}
override public function update():void{
var _local1:Number;
var _local2:Number;
var _local3:Car;
_local1 = Infinity;
target = null;
for each (_local3 in GameI.game.carArr) {
if ((((_local3 == ownerCar)) || (_local3.isDead))){
} else {
_local2 = GameI.game.track.getDistance(ownerCar, _local3);
if (_local2 < _local1){
_local1 = _local2;
target = _local3;
};
};
};
if (target == null){
GameI.game.track.delHitObj(this);
if (this.parent){
this.parent.removeChild(this);
} else {
trace("Missile未处理");
};
return;
};
prevD = _local1;
body.rotation = (body.rotation + 30);
trackO.x = (trackO.x + v);
trackO.y = (trackO.y + ((target.trackO.y - trackO.y) * 0.2));
trackO.z = (trackO.z + ((target.trackO.z - trackO.z) * 0.2));
updatePos();
if (this.visible){
GameI.game.track.addHitObj(new MissileSmoke(this));
};
super.update();
_local2 = GameI.game.track.getDistance(this, target);
if (prevD < _local2){
trace("命中");
target.hurt(10);
ownerCar.addScore(100);
GameI.game.track.delHitObj(this);
} else {
prevD = _local2;
};
}
}
}//package super_race
Section 211
//MissileSmoke (super_race.MissileSmoke)
package super_race {
import _3d.*;
public class MissileSmoke extends HitObj {
public function MissileSmoke(_arg1:Missile){
super(_arg1.trackO);
body.rotation = _arg1.body.rotation;
removeDelay();
}
}
}//package super_race
Section 212
//PowerUp (super_race.PowerUp)
package super_race {
import _3d.*;
import flash.display.*;
public class PowerUp extends MovieClip {
public var trackO:Vector;
public var type:int;
public static const type_missile:int = 1;
public static const type_gold:int = 0;
public static const type_hp:int = 3;
public static const type_shield:int = 2;
public function PowerUp(_arg1:PowerUpPos, _arg2:int=-1){
var _local3:Number;
super();
_arg1.powerUp = this;
if (_arg2 >= 0){
type = _arg2;
} else {
if (GameI.playMode == GameI.playMode_timeTrial){
type = type_gold;
} else {
_local3 = Math.random();
if (_local3 < 0.92){
type = type_gold;
} else {
if (_local3 < 0.96){
type = type_hp;
} else {
type = type_shield;
};
};
};
};
this.gotoAndStop((type + 1));
trackO = _arg1.trackO.clone();
this.x = -(trackO.y);
this.y = -(trackO.z);
}
}
}//package super_race
Section 213
//PowerUpPos (super_race.PowerUpPos)
package super_race {
import _3d.*;
import flash.display.*;
public class PowerUpPos extends Sprite {
public var trackO:Vector;
public var powerUp:PowerUp;
public function init(_arg1:Vector):void{
trackO = _arg1.clone();
}
public function removePowerUp(){
powerUp.parent.removeChild(powerUp);
powerUp = null;
}
}
}//package super_race
Section 214
//ShadowCar (super_race.ShadowCar)
package super_race {
import _3d.*;
public class ShadowCar extends Car {
private var replayDataArr:Array;
public static var shadowCar:ShadowCar;
public static var dataArr:Array;
public function ShadowCar(_arg1:Vector, _arg2:int){
super(_arg1, _arg2);
Common.setGrey(this);
this.alpha = 0.5;
}
public function replayRun(_arg1:int):void{
if (this.root == null){
Global.delRun(replayRun);
return;
};
if (replayDataArr.length > 0){
trackO = replayDataArr.shift();
updatePos();
} else {
GameI.game.track.delHitObj(this);
Global.delRun(replayRun);
shadowCar = null;
};
}
public function replay(_arg1:Array):void{
trace("replay");
replayDataArr = _arg1.slice();
Global.addRun("shadowCar replayRun()", replayRun);
}
public static function recordRun(_arg1:int):void{
dataArr.push(GameI.game.hero.trackO.clone());
}
public static function beginRecord():void{
dataArr = new Array();
Global.addRun("ShadowCar recordRun()", recordRun);
}
}
}//package super_race
Section 215
//ShieldLight (super_race.ShieldLight)
package super_race {
import flash.display.*;
public dynamic class ShieldLight extends Sprite {
}
}//package super_race
Section 216
//StartGate (super_race.StartGate)
package super_race {
public class StartGate extends HitObj {
public function StartGate(){
super(null);
}
}
}//package super_race
Section 217
//StartGate1 (super_race.StartGate1)
package super_race {
public dynamic class StartGate1 extends StartGate {
}
}//package super_race
Section 218
//StartGate2 (super_race.StartGate2)
package super_race {
public dynamic class StartGate2 extends StartGate {
}
}//package super_race
Section 219
//StartGate3 (super_race.StartGate3)
package super_race {
public dynamic class StartGate3 extends StartGate {
}
}//package super_race
Section 220
//StartGate4 (super_race.StartGate4)
package super_race {
public dynamic class StartGate4 extends StartGate {
}
}//package super_race
Section 221
//StartGate5 (super_race.StartGate5)
package super_race {
public dynamic class StartGate5 extends StartGate {
}
}//package super_race
Section 222
//StartGate6 (super_race.StartGate6)
package super_race {
public dynamic class StartGate6 extends StartGate {
}
}//package super_race
Section 223
//Track (super_race.Track)
package super_race {
import _3d.*;
import flash.display.*;
import math.*;
import flash.utils.*;
import flash.errors.*;
public class Track extends System3d {
public var vertexIdArr:Array;
public var svArr:Array;
private var treeArr:Array;
public var house0;
public var totalPiece:int;
private var graphics1:Graphics;
public var screenVertexArr:Array;
public var vertexArr:Array;
private var graphics0:Graphics;
public var headId:int;
public var hitObjArr:Array;
private var tp:Vector;
private var tv:Vector2;
public var onInitProgress:Function;
public var rotaArr:Array;
public var startGate;
public var onInitComplete:Function;
public var mvArr:Array;
public static const uLen:Number = 600;
public static const bottom:Number = 100;
public static const startTrackId:int = 15;
public static const totalShowPiece:int = 100;
public static const left:Number = (-(trackWid2) + 100);
public static const trackWid2:Number = 1200;
public static const top:Number = 450;
public static const right:Number = 1100;
public static var totalTree:int;
public static var dTree:int;
public function Track(){
var hasColor:Boolean;
var color0:int;
var color1:int;
var pArr:Array;
var len:Number;
var p:Vector2;
var i:int;
var pArr0:Array;
var pArr1:Array;
var pArr2:Array;
var idArrs:Array;
var trackFace0:Shape;
var trackFace1:Shape;
var j:int;
var idArr:Array;
var p1:Vector2;
var sv:Vector2;
var mv:Vector2;
super();
Global.addCheck(this, "vertexArr");
Global.addCheck(this, "screenVertexArr");
Global.addCheck(this, "vertexIdArr");
Global.addCheck(this, "svArr");
Global.addCheck(this, "mvArr");
Global.addCheck(this, "rotaArr");
Global.addCheck(this, "hitObjArr");
if (GameI.main.stageNum == 5){
dTree = 2;
} else {
dTree = 5;
};
totalTree = (totalShowPiece / dTree);
hasColor = true;
try {
color0 = Common.getRGB(new (getDefinitionByName((("super_race.colorRect" + GameI.main.stageNum) + "_0"))).getChildAt(0));
color1 = Common.getRGB(new (getDefinitionByName((("super_race.colorRect" + GameI.main.stageNum) + "_1"))).getChildAt(0));
} catch(e) {
hasColor = false;
};
if (hasColor){
trackFace0 = new Shape();
trackFace1 = new Shape();
this.addChild(trackFace0);
this.addChild(trackFace1);
graphics0 = trackFace0.graphics;
graphics1 = trackFace1.graphics;
Common.setRGB(trackFace0, color0);
Common.setRGB(trackFace1, color1);
};
tv = new Vector2();
tp = new Vector();
pArr = new (getDefinitionByName(("super_race.GetTrack" + GameI.main.stageNum))).pArr;
len = (uLen / Vector2.distance(pArr[1], pArr[2]));
for each (p in pArr) {
p.x = (p.x * len);
p.y = (p.y * len);
};
totalPiece = pArr.length;
pArr0 = new Array(totalPiece);
pArr1 = new Array(totalPiece);
pArr2 = new Array(totalPiece);
idArrs = new Array(totalPiece);
mvArr = new Array(totalPiece);
svArr = new Array(totalPiece);
i = 0;
while (i < totalPiece) {
j = ((i + 1) % totalPiece);
idArr = new Array();
p1 = pArr[i];
sv = Vector2.subtract_(p1, pArr[j]);
mv = sv.getMp(trackWid2);
pArr0[i] = [p1.x, p1.y, 0];
pArr1[i] = [(p1.x + mv.x), (p1.y + mv.y), 0];
pArr2[i] = [(p1.x - mv.x), (p1.y - mv.y), 0];
mv.normalize();
mvArr[i] = mv;
sv.normalize(-1);
svArr[i] = sv;
idArrs[i] = [(totalPiece + i), (totalPiece + j), ((totalPiece * 2) + j), ((totalPiece * 2) + i)];
i = (i + 1);
};
init(pArr0.concat(pArr1).concat(pArr2), idArrs);
trace(("路单位长=" + Vector.distance(vertexArr[1], vertexArr[2])));
trace(("路单位宽=" + Vector.distance(vertexArr[(totalPiece + 1)], vertexArr[((totalPiece * 2) + 2)])));
}
public function getPos(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Object, _arg5:Boolean=false):int{
var _local6:Number;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:Vector;
var _local11:Vector2;
var _local12:Vector;
var _local13:Vector2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local6 = (_arg1.x / uLen);
while (_local6 >= totalPiece) {
_local6 = (_local6 - totalPiece);
};
_local7 = _local6;
_local8 = (_local6 - _local7);
if (_arg5){
_local6 = _local7;
_local8 = 0;
_arg1.x = (_local7 * uLen);
};
_local9 = ((_local7 + 1) % totalPiece);
_local10 = vertexArr[_local7];
_local11 = mvArr[_local7];
_local12 = vertexArr[_local9];
_local13 = mvArr[_local9];
_local14 = (_local10.x + (_local11.x * _arg1.y));
_local15 = (_local10.y + (_local11.y * _arg1.y));
_local16 = (_local12.x + (_local13.x * _arg1.y));
_local17 = (_local12.y + (_local13.y * _arg1.y));
_local18 = (_local16 - _local14);
_local19 = (_local17 - _local15);
_arg2.setValues((_local14 + (_local18 * _local8)), (_local15 + (_local19 * _local8)), _arg1.z);
_arg4.rotation = (((1 - _local8) * rotaArr[_local7]) + (rotaArr[_local9] * _local8));
Vector2.getVByK(svArr[_local7], svArr[_local9], _local8, tv);
_arg3.setValues(tv.x, tv.y, 0);
return (_local7);
}
public function initTrack(){
var _local1:*;
var _local2:int;
var _local3:Tree;
var _local4:int;
var _local5:Number;
var _local6:*;
var _local7:int;
_local1 = getTimer();
hitObjArr = new Array();
rotaArr = new Array(totalPiece);
_local2 = 0;
while (_local2 < totalPiece) {
_local5 = (Vector2.toAngle(svArr[((_local2 + 1) % totalPiece)], svArr[_local2]) * 500);
if (_local5 > 20){
_local5 = 20;
} else {
if (_local5 < -20){
_local5 = -20;
};
};
rotaArr[_local2] = _local5;
_local2++;
};
if (!GameI.isInst){
startGate = new (getDefinitionByName(("super_race.StartGate" + GameI.main.stageNum)));
startGate.toInt = true;
startGate.setTrackO((startTrackId * uLen), 0, 0);
addHitObj(startGate);
};
Common.smoothArr(svArr, 10, 3, ["x", "y"]);
treeArr = new Array();
_local4 = Tree.getTotalTreeType(GameI.main.stageNum);
_local2 = 0;
while (_local2 < totalTree) {
_local3 = new Tree(new Vector((_local2 * (dTree * uLen)), (trackWid2 * 1.2)), (_local2 % _local4));
treeArr.push(_local3);
addHitObj(_local3);
_local3 = new Tree(new Vector((_local2 * (dTree * uLen)), (-(trackWid2) * 1.2)), (_local2 % _local4));
addHitObj(_local3);
treeArr.push(_local3);
_local2++;
};
if (!GameI.isInst){
house0 = new Object();
_local6 = house0;
_local7 = House.hitBmdArr[GameI.main.stageNum].length;
_local2 = 20;
while (_local2 < (totalPiece - 10)) {
if ((((Math.abs(rotaArr[_local2]) > 5)) && (((_local2 % 30) > 10)))){
} else {
_local6.nextHouse = new House(new Vector((_local2 * uLen)), Common.random(_local7));
_local6 = _local6.nextHouse;
addHitObj(_local6);
};
_local2 = (_local2 + 10);
};
house0 = house0.nextHouse;
_local6.nextHouse = house0;
};
Common.smoothArr(rotaArr, 5, 5);
trace((("耗时" + (getTimer() - _local1)) + "毫秒."));
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:Array;
vertexArr = new Array();
screenVertexArr = new Array();
for each (_local3 in _arg1) {
vertexArr.push(new Vector(_local3[0], _local3[1], _local3[2]));
screenVertexArr.push(new Vector());
};
vertexIdArr = _arg2;
}
public function getHouseByPrevHouse(_arg1:House, _arg2:int):House{
var _local3:int;
var _local4:int;
while (true) {
_local3 = getHousePos(_arg2, _arg1);
_local4 = getHousePos(_arg2, _arg1.nextHouse);
if (_local3 == 0){
return (_arg1);
};
if (_local4 == 0){
return (_arg1.nextHouse);
};
if ((((_local3 < 0)) && ((_local4 > 0)))){
return (_arg1.nextHouse);
};
_arg1 = _arg1.nextHouse;
};
return (null);
}
public function getHouseById(_arg1:int):House{
return (getHouseByPrevHouse(house0, _arg1));
}
public function redraw(_arg1:Camera3d):void{
var _local2:int;
var _local3:int;
var _local4:Tree;
var _local5:HitObj;
var _local6:Graphics;
var _local7:Array;
var _local8:Vector;
var _local9:int;
_local2 = 0;
while (_local2 <= totalShowPiece) {
_local3 = ((_local2 + headId) % totalPiece);
thisToScreen(vertexArr[_local3], screenVertexArr[_local3], _arg1);
thisToScreen(vertexArr[(_local3 + totalPiece)], screenVertexArr[(_local3 + totalPiece)], _arg1);
thisToScreen(vertexArr[(_local3 + (2 * totalPiece))], screenVertexArr[(_local3 + (2 * totalPiece))], _arg1);
_local2++;
};
if (graphics0){
graphics0.clear();
graphics1.clear();
_local2 = 0;
while (_local2 < totalShowPiece) {
_local3 = ((_local2 + headId) % totalPiece);
_local6 = this[("graphics" + (_local3 % 2))];
_local7 = vertexIdArr[_local3];
_local8 = screenVertexArr[_local7[(_local7.length - 1)]];
_local6.moveTo(_local8.y, _local8.z);
_local6.beginFill(0xFFFFFF);
for each (_local9 in _local7) {
_local8 = screenVertexArr[_local9];
_local6.lineTo(_local8.y, _local8.z);
};
_local6.endFill();
_local2++;
};
};
for each (_local4 in treeArr) {
if (_local4.trackO.x < GameI.game.hero.trackO.x){
_local4.trackO.x = (_local4.trackO.x + ((dTree * totalTree) * uLen));
_local4.updatePos();
};
};
_local2 = 0;
for each (_local5 in hitObjArr) {
if (((_local5) && (_local5.root))){
} else {
hitObjArr[_local2] = null;
};
_local2++;
};
Common.dumpArr(hitObjArr);
for each (_local5 in hitObjArr) {
_local5.redraw(_arg1);
};
hitObjArr.sortOn("scale", Array.NUMERIC);
_local2 = 2;
for each (_local5 in hitObjArr) {
if ((((_local5.scale < 2)) && (((((_local5.trackId + totalPiece) - headId) % totalPiece) < totalShowPiece)))){
var _temp1 = _local2;
_local2 = (_local2 + 1);
this.setChildIndex(_local5, _temp1);
_local5.visible = true;
} else {
_local5.visible = false;
};
};
}
public function getDistance(_arg1:HitObj, _arg2:HitObj):Number{
var _local3:Number;
_local3 = (_arg2.trackO.x - _arg1.trackO.x);
_local3 = (_local3 / uLen);
while (_local3 > totalPiece) {
_local3 = (_local3 - totalPiece);
};
while (_local3 < 0) {
_local3 = (_local3 + totalPiece);
};
return ((_local3 * uLen));
}
public function delHitObj(_arg1:HitObj):void{
removeSystem(_arg1);
hitObjArr[hitObjArr.indexOf(_arg1)] = null;
}
public function getHousePos(_arg1:int, _arg2:House):int{
var _local3:int;
var _local4:int;
_local3 = (((_arg2.trackId - _arg1) + totalPiece) % totalPiece);
_local4 = (((_arg1 - _arg2.trackId) + totalPiece) % totalPiece);
if (_local3 < _local4){
return (_local3);
};
return (-(_local4));
}
public function addHitObj(_arg1:HitObj):void{
addSystem(_arg1);
hitObjArr.push(_arg1);
}
}
}//package super_race
Section 224
//TrackMap (super_race.TrackMap)
package super_race {
import _3d.*;
import flash.display.*;
public class TrackMap extends Sprite {
public var map_sp:empty;
private var checkArr:Array;
public var scale:Number;
public var checkArea:empty;
public function TrackMap(){
checkArr = new Array();
GameI.game.initTrackMap(this);
}
public function drawPath(_arg1:Track):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Vector;
var _local6:*;
_local2 = Infinity;
_local3 = -(Infinity);
_local4 = 0;
_local4 = 0;
while (_local4 < _arg1.totalPiece) {
_local5 = _arg1.vertexArr[_local4];
_local3 = Math.max(_local5.x, _local3);
_local2 = Math.min(_local5.x, _local2);
_local4++;
};
scale = ((this.width - 60) / (_local3 - _local2));
trace(("scale=" + scale));
map_sp.graphics.clear();
map_sp.graphics.lineStyle(2, 0);
_local5 = _arg1.vertexArr[(_arg1.totalPiece - 1)];
_local6 = new start_line();
map_sp.addChild(_local6);
_local6.x = (_local5.x * scale);
_local6.y = (-(_local5.y) * scale);
map_sp.graphics.moveTo((_local5.x * scale), (-(_local5.y) * scale));
_local4 = 0;
while (_local4 < _arg1.totalPiece) {
_local5 = _arg1.vertexArr[_local4];
map_sp.graphics.lineTo((_local5.x * scale), (-(_local5.y) * scale));
_local4++;
};
}
public function update():void{
var _local1:CheckDot;
Common.dumpArr(checkArr);
for each (_local1 in checkArr) {
_local1.update(scale);
};
}
public function removeCheck(_arg1:HitObj):void{
var _local2:int;
var _local3:CheckDot;
_local2 = 0;
for each (_local3 in checkArr) {
if (((_local3) && ((_local3.obj == _arg1)))){
checkArr[_local2] = null;
checkArea.removeChild(_local3);
return;
};
_local2++;
};
}
public function addCheck(_arg1:HitObj):void{
var _local2:CheckDot;
_local2 = new CheckDot(_arg1);
checkArea.addChild(_local2);
checkArr.push(_local2);
}
}
}//package super_race
Section 225
//TrackMap2 (super_race.TrackMap2)
package super_race {
import flash.display.*;
public dynamic class TrackMap2 extends MovieClip {
}
}//package super_race
Section 226
//Tree (super_race.Tree)
package super_race {
import _3d.*;
import flash.utils.*;
public class Tree extends HitObj {
public function Tree(_arg1:Vector, _arg2:int){
super(_arg1, true);
body = getBody(GameI.main.stageNum, _arg2);
this.addChild(body);
visible = false;
}
public static function getBody(_arg1:int, _arg2:int){
return (new (getDefinitionByName(((("super_race.tree_body" + _arg1) + "_") + _arg2))));
}
public static function getTotalTreeType(_arg1:int):int{
var totalTreeType:int;
var stageNum = _arg1;
totalTreeType = 0;
while (true) {
try {
getDefinitionByName(((("super_race.tree_body" + stageNum) + "_") + totalTreeType));
} catch(e) {
return (totalTreeType);
};
totalTreeType = (totalTreeType + 1);
};
return (totalTreeType);
}
}
}//package super_race
Section 227
//tree_body1_0 (super_race.tree_body1_0)
package super_race {
import flash.display.*;
public dynamic class tree_body1_0 extends MovieClip {
}
}//package super_race
Section 228
//tree_body1_1 (super_race.tree_body1_1)
package super_race {
import flash.display.*;
public dynamic class tree_body1_1 extends MovieClip {
}
}//package super_race
Section 229
//tree_body2_0 (super_race.tree_body2_0)
package super_race {
import flash.display.*;
public dynamic class tree_body2_0 extends MovieClip {
}
}//package super_race
Section 230
//tree_body2_1 (super_race.tree_body2_1)
package super_race {
import flash.display.*;
public dynamic class tree_body2_1 extends MovieClip {
}
}//package super_race
Section 231
//tree_body2_2 (super_race.tree_body2_2)
package super_race {
import flash.display.*;
public dynamic class tree_body2_2 extends MovieClip {
}
}//package super_race
Section 232
//tree_body2_3 (super_race.tree_body2_3)
package super_race {
import flash.display.*;
public dynamic class tree_body2_3 extends MovieClip {
}
}//package super_race
Section 233
//tree_body2_4 (super_race.tree_body2_4)
package super_race {
import flash.display.*;
public dynamic class tree_body2_4 extends MovieClip {
}
}//package super_race
Section 234
//tree_body3_0 (super_race.tree_body3_0)
package super_race {
import flash.display.*;
public dynamic class tree_body3_0 extends MovieClip {
}
}//package super_race
Section 235
//tree_body3_1 (super_race.tree_body3_1)
package super_race {
import flash.display.*;
public dynamic class tree_body3_1 extends MovieClip {
}
}//package super_race
Section 236
//tree_body3_2 (super_race.tree_body3_2)
package super_race {
import flash.display.*;
public dynamic class tree_body3_2 extends MovieClip {
}
}//package super_race
Section 237
//tree_body3_3 (super_race.tree_body3_3)
package super_race {
import flash.display.*;
public dynamic class tree_body3_3 extends MovieClip {
}
}//package super_race
Section 238
//tree_body3_4 (super_race.tree_body3_4)
package super_race {
import flash.display.*;
public dynamic class tree_body3_4 extends MovieClip {
}
}//package super_race
Section 239
//tree_body4_0 (super_race.tree_body4_0)
package super_race {
import flash.display.*;
public dynamic class tree_body4_0 extends MovieClip {
}
}//package super_race
Section 240
//tree_body5_0 (super_race.tree_body5_0)
package super_race {
import flash.display.*;
public dynamic class tree_body5_0 extends MovieClip {
}
}//package super_race
Section 241
//tree_body5_1 (super_race.tree_body5_1)
package super_race {
import flash.display.*;
public dynamic class tree_body5_1 extends MovieClip {
}
}//package super_race
Section 242
//tree_body6_0 (super_race.tree_body6_0)
package super_race {
import flash.display.*;
public dynamic class tree_body6_0 extends MovieClip {
}
}//package super_race
Section 243
//tree_body6_1 (super_race.tree_body6_1)
package super_race {
import flash.display.*;
public dynamic class tree_body6_1 extends MovieClip {
}
}//package super_race
Section 244
//TxtPopUp (super_race.TxtPopUp)
package super_race {
import _3d.*;
public class TxtPopUp extends HitObj {
public function TxtPopUp(_arg1:Vector, _arg2:String){
super(_arg1);
body.txt.text = _arg2;
removeDelay();
}
}
}//package super_race
Section 245
//Alert (ui.Alert)
package ui {
import flash.events.*;
public class Alert extends BasicWindow {
private var flag:Boolean;
public var onCallBack:Function;
public static var alert:Alert;
public function Alert(){
super();
alert = this;
windowBody.btnYes._release = function ():void{
_slot1.callBack(true);
};
windowBody.btnNo._release = function ():void{
_slot1.callBack(false);
};
this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
}
public function set msg(_arg1:String):void{
windowBody.msgTxt.text = _arg1;
}
public function removed(_arg1:Event):void{
alert = null;
trace("removed alert");
}
public function get msg():String{
return (windowBody.msgTxt.text);
}
public static function callBack(_arg1:Boolean):void{
var _flag = _arg1;
alert.flag = _flag;
alert.fadeHide();
alert.onHide = function ():void{
this.onCallBack(this.flag);
};
}
public static function show(_arg1:String, _arg2:Function):void{
if (showAlert){
Global.pause = true;
alert.onCallBack = _arg2;
alert.fadeShow();
alert.msg = _arg1;
} else {
_arg2(true);
};
}
public static function get showAlert():Boolean{
return (!((alert == null)));
}
}
}//package ui
Section 246
//Alt (ui.Alt)
package ui {
import flash.display.*;
import flash.geom.*;
import FWG.*;
public class Alt extends Sprite {
public var msgTxt:Label1;
public var bg:MovieClip;
public static var alt:Alt;
public function Alt(){
alt = this;
this.visible = false;
}
public function set msg(_arg1:String):void{
msgTxt.text = _arg1;
}
private function hide(_arg1:int=0):void{
this.visible = false;
}
public function get msg():String{
return (msgTxt.text);
}
private function show(_arg1:String, _arg2:DisplayObject):void{
var _local3:Rectangle;
var _local4:Point;
this.visible = true;
msg = _arg1;
msgTxt.autoSize = "center";
bg.width = (msgTxt.width + 10);
if (_arg2){
_local4 = this.parent.globalToLocal(_arg2.localToGlobal(new Point()));
this.x = _local4.x;
this.y = _local4.y;
} else {
this.x = this.parent.mouseX;
this.y = this.parent.mouseY;
};
_local3 = bg.getBounds(root);
if (_local3.x < 0){
this.x = (this.x + (10 - _local3.x));
} else {
if ((_local3.x + _local3.width) > Global.stageWid){
this.x = (this.x - (((10 + _local3.x) + _local3.width) - Global.stageWid));
};
};
if (_local3.y < 0){
this.y = (this.y + (10 - _local3.y));
} else {
if ((_local3.y + _local3.height) > Global.stageHei){
this.y = (this.y - (((10 + _local3.y) + _local3.height) - Global.stageHei));
};
};
this.x = Math.round(this.x);
this.y = Math.round(this.y);
}
public static function hideDelay(_arg1:int=30):void{
Global.addRun("alt hide()", alt.hide, _arg1, 1, false);
}
public static function show(_arg1:String, _arg2:DisplayObject=null):void{
alt.show(_arg1, _arg2);
}
public static function hide():void{
alt.hide();
}
}
}//package ui
Section 247
//BasicWindow (ui.BasicWindow)
package ui {
import flash.display.*;
public class BasicWindow extends Sprite {
public var windowBg:WindowBg;
public var onShow:Function;
public var windowBody:MovieClip;
public var onHide:Function;
public function BasicWindow(){
super();
windowBody = MovieClip(this.getChildAt(1));
windowBg = WindowBg(this.getChildAt(0));
this.removeChild(windowBody);
this.removeChild(windowBg);
onShow = function (){
};
onHide = function (){
};
}
public function hide():void{
Global.delKeyCtrl();
this.removeChild(windowBody);
this.removeChild(windowBg);
}
private function showRun(_arg1:int):void{
this.alpha = ((5 - _arg1) * 0.2);
if (_arg1 == 0){
onShow();
};
}
public function _onKeyUp(_arg1:int):void{
trace(((("按键焦点被转移到:" + this) + "\rkeyCode=") + _arg1));
}
public function fadeShow():void{
show();
this.alpha = 0;
Global.addRun("BasicWindow showRun()", showRun, 1, 5, false);
}
public function fadeHide():void{
Global.addRun("BasicWindow hideRun()", hideRun, 1, 5, false);
}
private function hideRun(_arg1:int):void{
this.alpha = (_arg1 * 0.2);
if (_arg1 == 0){
hide();
onHide();
};
}
public function show():void{
Global.addKeyCtrl(this);
this.addChild(windowBg);
this.addChild(windowBody);
}
}
}//package ui
Section 248
//FadeMask (ui.FadeMask)
package ui {
import flash.display.*;
public class FadeMask extends MovieClip {
public var onShow:Function;
public var onHide:Function;
public function FadeMask(){
super();
addFrameScript(0, frame1, 11, frame12, 19, frame20);
onShow = function (){
};
onHide = function (){
};
}
function frame12(){
onHide();
}
function frame1(){
stop();
}
public function hide():void{
gotoAndStop("hide");
}
function frame20(){
onShow();
}
public function fadeShow():void{
gotoAndPlay("fadeShow");
}
public function fadeHide():void{
gotoAndPlay("fadeHide");
}
public function show():void{
gotoAndStop("show");
}
}
}//package ui
Section 249
//HitRec (ui.HitRec)
package ui {
import flash.display.*;
public class HitRec extends Sprite {
}
}//package ui
Section 250
//Label (ui.Label)
package ui {
import flash.display.*;
import flash.text.*;
public class Label extends Sprite {
private var __text:String;
public var txt:TextField;
public function Label(){
__text = "";
}
public function get text(){
if (txt.selectable){
__text = txt.text;
};
return (__text);
}
public function get autoSize():String{
return (txt.autoSize);
}
public function set text(_arg1):void{
txt.text = (__text = _arg1);
}
public function set autoSize(_arg1:String):void{
txt.autoSize = _arg1;
}
}
}//package ui
Section 251
//Label1 (ui.Label1)
package ui {
public dynamic class Label1 extends Label {
}
}//package ui
Section 252
//Label2 (ui.Label2)
package ui {
public dynamic class Label2 extends Label {
}
}//package ui
Section 253
//Label3 (ui.Label3)
package ui {
public dynamic class Label3 extends Label {
}
}//package ui
Section 254
//Label4 (ui.Label4)
package ui {
public dynamic class Label4 extends Label {
}
}//package ui
Section 255
//NumClock (ui.NumClock)
package ui {
import flash.display.*;
public class NumClock extends Sprite {
public var onTimeUp:Function;
private var __totalTime:int;
public var txt:Label2;
private var __time:Number;
public function NumClock(){
txt.text = "";
}
public function stop():void{
Global.delRun(run);
}
public function countRun(_arg1:int):void{
time = (time + (1 / 30));
}
public function count():void{
time = 0;
Global.addRun("NumClock countRun()", countRun);
}
public function stopCount():void{
Global.delRun(countRun);
}
public function get totalTime():int{
return (__totalTime);
}
private function timeUp():void{
stop();
onTimeUp();
}
public function start():void{
Global.addRun("NumClock run()", run, 30, __totalTime);
}
public function set totalTime(_arg1:int):void{
time = (__totalTime = _arg1);
}
public function run(_arg1:int):void{
time = _arg1;
if (time <= 0){
timeUp();
};
}
public function set time(_arg1:Number):void{
txt.text = numToTime((__time = _arg1));
}
public function get time():Number{
return (__time);
}
public static function numToTime(_arg1:Number):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
_local2 = ((int((_arg1 * 100)) % 100) * 0.6);
_arg1 = int(_arg1);
_local3 = (_arg1 % 60);
_local4 = ((_arg1 - _local3) / 60);
_local5 = "";
if (_local4 < 10){
_local5 = (_local5 + "0");
};
_local5 = (_local5 + (_local4 + ":"));
if (_local3 < 10){
_local5 = (_local5 + "0");
};
_local5 = (_local5 + (_local3 + ":"));
if (_local2 < 10){
_local5 = (_local5 + "0");
};
_local5 = (_local5 + _local2);
return (_local5);
}
}
}//package ui
Section 256
//QualitySetting (ui.QualitySetting)
package ui {
public class QualitySetting extends BasicWindow {
public static var qualitySetting:QualitySetting;
public function QualitySetting(){
var i:int;
super();
qualitySetting = this;
onHide = function (){
Global.pause = false;
};
windowBody.btnOk._release = fadeHide;
i = 0;
while (i < 4) {
windowBody[("btn" + i)]._release = function ():void{
_slot1.qualitySetting.quality = this.label;
};
i = (i + 1);
};
}
public function set quality(_arg1:String):void{
var _local2:int;
var _local3:*;
stage.quality = _arg1;
_local2 = 0;
while (_local2 < 4) {
_local3 = windowBody[("btn" + _local2)];
if (_local3.label.toUpperCase() == _arg1){
_local3.selected = true;
} else {
_local3.selected = false;
};
_local2++;
};
}
override public function fadeShow():void{
super.fadeShow();
quality = stage.quality;
}
public static function show():void{
Global.pause = true;
qualitySetting.fadeShow();
qualitySetting.quality = qualitySetting.stage.quality;
}
}
}//package ui
Section 257
//SBtn (ui.SBtn)
package ui {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
public class SBtn extends MovieClip {
public var errorPress:Function;
public var _press:Function;
public var _rollOver:Function;
private var __selectAble:Boolean;
public var btn;
public var _rollOut:Function;
private var __selected:Boolean;
private var filters0:Array;
public var _release:Function;
public function SBtn(){
var i:int;
var child:*;
super();
filters0 = this.filters.slice();
__selectAble = true;
btn = this.getChildAt(0);
_rollOver = function (){
};
_rollOut = function (){
};
_press = function (){
};
_release = function (){
};
if ((btn is MovieClip)){
btn.buttonMode = true;
btn.gotoAndStop(1);
};
btn.addEventListener(MouseEvent.MOUSE_OVER, _onRollOver, false, 0, true);
btn.addEventListener(MouseEvent.MOUSE_OUT, _onRollOut, false, 0, true);
btn.addEventListener(MouseEvent.MOUSE_DOWN, _onPress, false, 0, true);
btn.addEventListener(MouseEvent.MOUSE_UP, _onRelease, false, 0, true);
i = this.numChildren;
while ((i = (i - 1)), (i - 1) >= 0) {
child = this.getChildAt(i);
if ((child is InteractiveObject)){
child.mouseEnabled = false;
if ((child is DisplayObjectContainer)){
child.mouseChildren = false;
};
};
};
btn.mouseEnabled = true;
}
public function set selectAble(_arg1:Boolean):void{
__selectAble = _arg1;
if (__selectAble){
this.removeEventListener(MouseEvent.MOUSE_UP, errorPress);
this.mouseChildren = true;
this.filters = filters0;
if ((btn is MovieClip)){
btn.buttonMode = true;
btn.gotoAndStop(1);
};
} else {
this.addEventListener(MouseEvent.MOUSE_UP, errorPress, false, 0, true);
this.mouseChildren = false;
Common.setGrey(this);
if ((btn is MovieClip)){
btn.buttonMode = false;
btn.gotoAndStop(1);
};
};
}
public function release():void{
}
public function press():void{
}
public function set selected(_arg1:Boolean):void{
__selected = _arg1;
if (__selected){
this.mouseChildren = false;
this.gotoAndStop(2);
} else {
this.mouseChildren = true;
this.gotoAndStop(1);
};
if ((btn is MovieClip)){
btn.gotoAndStop(1);
};
}
public function get selectAble():Boolean{
return (__selectAble);
}
public function _onRollOut(_arg1:MouseEvent):void{
if (selectAble){
if ((btn is MovieClip)){
btn.gotoAndStop(1);
};
rollOut();
_rollOut();
};
}
public function rollOut():void{
}
public function _onRelease(_arg1:MouseEvent):void{
if (selectAble){
release();
_release();
};
}
public function _onRollOver(_arg1:MouseEvent):void{
if (selectAble){
if ((btn is MovieClip)){
btn.gotoAndStop(2);
};
rollOver();
_rollOver();
};
}
public function _onPress(_arg1:MouseEvent):void{
if (selectAble){
if ((btn is MovieClip)){
btn.gotoAndStop(1);
};
press();
_press();
};
}
public function get selected():Boolean{
return (__selected);
}
public function rollOver():void{
}
}
}//package ui
Section 258
//ValueBar2 (ui.ValueBar2)
package ui {
import flash.display.*;
public class ValueBar2 extends MovieClip {
public var maxValue:Number;
public var txt:Label1;
public var uStr:String;
private var __value:Number;
public function ValueBar2(_arg1:Number=0, _arg2:Number=100, _arg3=""){
value = _arg1;
maxValue = _arg2;
uStr = _arg3;
}
public function get value():Number{
return (__value);
}
public function set value(_arg1:Number):void{
__value = _arg1;
this.gotoAndStop((Math.round(((__value / maxValue) * (this.totalFrames - 1))) + 1));
txt.text = (_arg1 + uStr);
}
}
}//package ui
Section 259
//ValueBarHp (ui.ValueBarHp)
package ui {
public dynamic class ValueBarHp extends ValueBar2 {
}
}//package ui
Section 260
//ValueBarSpeed (ui.ValueBarSpeed)
package ui {
public dynamic class ValueBarSpeed extends ValueBar2 {
}
}//package ui
Section 261
//WindowBg (ui.WindowBg)
package ui {
import flash.display.*;
public class WindowBg extends Sprite {
public function WindowBg(){
BasicWindow(this.parent).windowBg = this;
}
}
}//package ui
Section 262
//Common (Common)
package {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class Common {
public static const dirArr:Array = [[-1, 0], [0, -1], [1, 0], [0, 1]];
public static const greyFilter:ColorMatrixFilter = new ColorMatrixFilter([0.15, 0.295, 0.055, 0, 0, 0.15, 0.295, 0.055, 0, 0, 0.15, 0.295, 0.055, 0, 0, 0, 0, 0, 1, 0]);
public static const dirArr2:Array = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
public static function cloneObj(_arg1:Object){
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function random(_arg1:int):int{
return (int((Math.random() * _arg1)));
}
public static function localToLocal(_arg1:Point, _arg2:DisplayObject, _arg3:DisplayObject):Point{
return (_arg3.globalToLocal(_arg2.localToGlobal(_arg1)));
}
public static function getRGB(_arg1):int{
return (_arg1.transform.colorTransform.color);
}
public static function dumpArrByF(_arg1:Array, _arg2:Function):void{
var _local3:int;
_local3 = _arg1.length;
while (--_local3 >= 0) {
if (_arg2(_arg1[_local3])){
_arg1.splice(_local3, 1);
};
};
}
public static function arrDel(_arg1:Array, _arg2):void{
_arg1.splice(_arg1.indexOf(_arg2), 1);
}
public static function setRGB(_arg1, _arg2:int):void{
var _local3:*;
_local3 = _arg1.transform.colorTransform;
_local3.color = _arg2;
_arg1.transform.colorTransform = _local3;
}
public static function dumpArrOn(_arg1:Array, _arg2:String):void{
var _local3:int;
_local3 = _arg1.length;
while (--_local3 >= 0) {
if (_arg1[_local3][_arg2] == undefined){
_arg1.splice(_local3, 1);
};
};
}
public static function dumpArr(_arg1:Array):void{
var _local2:int;
_local2 = _arg1.length;
while (--_local2 >= 0) {
if (_arg1[_local2] == undefined){
_arg1.splice(_local2, 1);
};
};
}
public static function getArrByValue(_arg1:int, _arg2):Array{
var _local3:Array;
_local3 = new Array(_arg1);
while (--_arg1 >= 0) {
_local3[_arg1] = _arg2;
};
return (_local3);
}
private static function simpleCopyObj(_arg1:Object, _arg2:Array):Object{
var _local3:Object;
var _local4:String;
_local3 = new Object();
for each (_local4 in _arg2) {
_local3[_local4] = _arg1[_local4];
};
return (_local3);
}
public static function isEmpty(_arg1:Object):Boolean{
var _local2:String;
if (_arg1 == null){
return (true);
};
_local2 = "";
for (_local2 in _arg1) {
break;
};
return ((_local2 == ""));
}
public static function smoothArr(_arg1:Array, _arg2:int, _arg3:int, _arg4:Array=null):void{
var _local5:Array;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:Object;
var _local11:String;
var _local12:*;
_local9 = _arg1.length;
if (_arg4){
_local5 = new Array(_local9);
_local6 = 0;
while (_local6 < _local9) {
_local5[_local6] = simpleCopyObj(_arg1[_local6], _arg4);
_local6++;
};
_local10 = simpleCopyObj(_arg1[0], _arg4);
while (--_arg3 >= 0) {
_local6 = 0;
while (_local6 < _local9) {
for each (_local11 in _arg4) {
_local10[_local11] = 0;
};
_local7 = -(_arg2);
while (_local7 <= _arg2) {
_local12 = _local5[(((_local6 + _local7) + _local9) % _local9)];
for each (_local11 in _arg4) {
_local10[_local11] = (_local10[_local11] + _local12[_local11]);
};
_local7++;
};
for each (_local11 in _arg4) {
_arg1[_local6][_local11] = (_local10[_local11] / ((2 * _arg2) + 1));
};
_local6++;
};
_local6 = 0;
while (_local6 < _local9) {
_local5[_local6] = _arg1[_local6];
_local6++;
};
};
} else {
_local5 = _arg1.slice();
while (--_arg3 >= 0) {
_local6 = 0;
while (_local6 < _local9) {
_local8 = 0;
_local7 = -(_arg2);
while (_local7 <= _arg2) {
_local8 = (_local8 + _local5[(((_local6 + _local7) + _local9) % _local9)]);
_local7++;
};
_arg1[_local6] = (_local8 / ((2 * _arg2) + 1));
_local6++;
};
_local6 = 0;
while (_local6 < _local9) {
_local5[_local6] = _arg1[_local6];
_local6++;
};
};
};
}
public static function setGrey(_arg1:DisplayObject):void{
_arg1.filters = _arg1.filters.concat(greyFilter);
}
public static function removeDspObj(_arg1){
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
if ((_arg1 is MovieClip)){
_arg1.stop();
};
};
}
public static function selectTxt(_arg1:TextField):void{
_arg1.stage.focus = _arg1;
_arg1.setSelection(0, _arg1.text.length);
}
}
}//package
Section 263
//empty (empty)
package {
import flash.display.*;
public dynamic class empty extends Sprite {
}
}//package
Section 264
//GameI (GameI)
package {
import super_race.*;
import FWG.*;
public class GameI {
public static const notMatchScore:int = 10;
public static const playMode_singleRace:String = "single race";
public static const playMode_timeTrial:String = "time trial";
public static const playMode_tournament:String = "tournament";
public static const matchScore:int = 50;
public static const totalLap:int = 2;
public static const diff_crazy:String = "crazy";
public static const winOrder:int = 1;
public static const diff_normal:String = "normal";
public static const diff_hard:String = "hard";
public static const levelBonus:int = 1000;
public static const diff_easy:String = "easy";
public static var upKeyDown:Boolean;
public static var defaultTrack:int = 1;
public static var isInst:Boolean;
public static var gameDiff:String;
public static var downKeyDown:Boolean;
public static var leftKeyDown:Boolean;
public static var zoomOutKeyDown:Boolean;
public static var notIsFirstPlay:Boolean;
public static var zoomInKeyDown:Boolean;
public static var shadowFlag:Boolean;
public static var heroCoinArr:Array;
public static var currTime:int;
public static var main:Main;
public static var spaceKeyDown:Boolean;
public static var recordDataArr:Array;
public static var bestTime:int = 2147483647;
public static var selectedStageNum:int;
public static var rightKeyDown:Boolean;
public static var heroOrder:int;
public static var playMode:String;
public static var game:Game;
public static function resetKeyDowns():void{
leftKeyDown = false;
rightKeyDown = false;
upKeyDown = false;
downKeyDown = false;
spaceKeyDown = false;
zoomOutKeyDown = false;
zoomInKeyDown = false;
}
}
}//package
Section 265
//gameover_upset (gameover_upset)
package {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class gameover_upset extends MovieClip {
public function gameover_upset(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package
Section 266
//Global (Global)
package {
import flash.display.*;
import flash.events.*;
public class Global extends Sprite {
private static var delRunArr:Array;
public static var keyCtrlObjArr:Array;
public static var mainPause:Boolean;
public static var onKeyUp:Function;
public static var prevKeyFlagArr:Array;
public static var onKeyDown:Function;
private static var runArr:Array;
private static var addRunArr:Array;
public static var testBar;
public static var global:Global;
public static var stageHei:int;
public static var stageWid:int;
public static var keyFlagArr:Array;
public static var checkArr:Array;
public static var pause:Boolean;
public function Global(){
global = this;
init();
this.addEventListener(Event.ENTER_FRAME, runAll, false, 0, true);
this.addEventListener(KeyboardEvent.KEY_DOWN, keyDown, false, 0, true);
this.addEventListener(KeyboardEvent.KEY_UP, keyUp, false, 0, true);
this.addEventListener(FocusEvent.FOCUS_OUT, focusOut, false, 0, true);
}
public static function delRun(_arg1:Function):void{
delRunArr.push(_arg1);
}
public static function delCheck(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:CheckObj;
_local3 = 0;
for each (_local4 in checkArr) {
if ((((_local4.obj == _arg1)) && ((_local4.valName == _arg2)))){
checkArr[_local3] = null;
return (true);
};
_local3++;
};
return (false);
}
public static function clearAllKeyCtrl():void{
keyCtrlObjArr = new Array();
}
public static function addKeyCtrl(_arg1):void{
keyCtrlObjArr.unshift(_arg1);
}
public static function debug():void{
trace("在调试面板中展开变量分析.");
}
private static function dumpCOAF(_arg1:CheckObj):Boolean{
if ((_arg1.obj is DisplayObject)){
return ((_arg1.obj.root == null));
};
return ((_arg1.obj == undefined));
}
private static function updateTestBar():void{
var _local1:int;
var _local2:*;
var _local3:String;
var _local4:RunObj;
var _local5:CheckObj;
var _local6:*;
if (testBar == null){
return;
};
_local3 = "";
_local3 = (_local3 + (("pause=" + pause) + "\n"));
_local3 = (_local3 + (("runArr.length=" + runArr.length) + "\n"));
for each (_local4 in runArr) {
_local3 = (_local3 + (_local4.info + "\n"));
};
_local3 = (_local3 + "--------------------\n");
Common.dumpArrByF(checkArr, dumpCOAF);
for each (_local5 in checkArr) {
_local6 = _local5.obj[_local5.valName];
if ((_local6 is Array)){
_local6 = _local6.length;
};
_local3 = (_local3 + (((((_local5.obj + ",") + _local5.valName) + ",") + _local6) + "\n"));
};
_local3 = (_local3 + "----\n");
_local3 = (_local3 + ((("totalKeyCtrl:" + keyCtrlObjArr.length) + "\r") + keyCtrlObjArr));
testBar.showMsg(_local3);
}
public static function keyUp(_arg1:KeyboardEvent):void{
keyFlagArr[_arg1.keyCode] = false;
}
public static function focusOut(_arg1:FocusEvent):void{
global.stage.focus = global;
}
public static function clearAllRun():void{
delRunArr = new Array();
addRunArr = new Array();
runArr = new Array();
}
public static function init():void{
global.stage.focus = global;
runArr = new Array();
delRunArr = new Array();
addRunArr = new Array();
checkArr = new Array();
prevKeyFlagArr = Common.getArrByValue(0x0100, false);
keyFlagArr = Common.getArrByValue(0x0100, false);
keyCtrlObjArr = new Array();
onKeyDown = function (_arg1:int){
};
onKeyUp = function (_arg1:int){
};
addCheck(_slot1, "keyCtrlObjArr");
addCheck(_slot1, "checkArr");
addCheck(_slot1, "runArr");
}
public static function runAll(_arg1:Event):void{
var _local2:Function;
var _local3:RunObj;
var _local4:int;
var _local5:Boolean;
var _local6:Boolean;
_local4 = 0;
for each (_local3 in runArr) {
if (delRunArr.indexOf(_local3.runF) >= 0){
runArr[_local4] = null;
};
_local4++;
};
runArr = runArr.concat(addRunArr);
delRunArr = new Array();
addRunArr = new Array();
if (mainPause){
updateTestBar();
return;
};
_local4 = 0;
for each (_local5 in keyFlagArr) {
_local6 = prevKeyFlagArr[_local4];
if (((!(_local6)) && (_local5))){
onKeyDown(_local4);
runKeyCtrl("_onKeyDown", _local4);
} else {
if (((_local6) && (!(_local5)))){
onKeyUp(_local4);
runKeyCtrl("_onKeyUp", _local4);
};
};
prevKeyFlagArr[_local4] = _local5;
_local4++;
};
Common.dumpArrByF(runArr, dumpRunArrF);
for each (_local3 in runArr) {
_local3.run();
};
updateTestBar();
}
public static function delKeyCtrl():void{
keyCtrlObjArr.shift();
}
public static function addCheck(_arg1, _arg2:String):void{
checkArr.push(new CheckObj(_arg1, _arg2));
}
public static function addRun(_arg1:String, _arg2:Function, _arg3:int=1, _arg4:int=2147483647, _arg5:Boolean=true):void{
delRun(_arg2);
if (_arg3 >= 1){
} else {
_arg3 = 1;
};
if (_arg4 >= 1){
} else {
_arg4 = int.MAX_VALUE;
};
addRunArr.push(new RunObj(_arg1, _arg2, _arg3, _arg4, _arg5));
}
public static function keyIsDown(_arg1:int):Boolean{
return (keyFlagArr[_arg1]);
}
public static function keyDown(_arg1:KeyboardEvent):void{
keyFlagArr[_arg1.keyCode] = true;
}
private static function runKeyCtrl(_arg1:String, _arg2:int):void{
var obj:*;
var keyFName = _arg1;
var keyCode = _arg2;
for each (obj in keyCtrlObjArr) {
if (obj.root){
try {
var _local6 = obj;
_local6[keyFName](keyCode);
} catch(e) {
};
return;
};
trace(("移除含按键控制的obj:" + obj));
keyCtrlObjArr.shift();
};
}
public static function dumpRunArrF(_arg1:RunObj):Boolean{
return ((((_arg1 == null)) || ((_arg1.times <= 0))));
}
}
}//package
class RunObj {
private var intervalNum:int;
private var interval:int;
public var times:int;
public var info:String;
private var pauseAble:Boolean;
public var runF:Function;
private function RunObj(_arg1:String, _arg2:Function, _arg3:int, _arg4:int, _arg5:Boolean):void{
intervalNum = 0;
info = _arg1;
runF = _arg2;
interval = _arg3;
times = _arg4;
pauseAble = _arg5;
}
public function run():void{
if (((_slot1.pause) && (pauseAble))){
return;
};
if (++intervalNum >= interval){
intervalNum = 0;
runF(--times);
};
}
}
class CheckObj {
public var obj;
public var valName:String;
private function CheckObj(_arg1, _arg2:String){
obj = _arg1;
valName = _arg2;
}
}
Section 267
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
_slot1.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _slot1._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = _slot1.getVersion();
clip = options.clip;
if (!_slot1._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = _slot1._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
_slot1.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = _slot1._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = _slot1._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
_slot1._cleanup(mc);
options.ad_finished();
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
_slot1.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local3 = true;
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _slot1._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = _slot1.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!_slot1._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
_slot1._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = _slot1._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
_slot1._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
_slot1.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
_slot1.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local4 = true;
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
_slot1.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = _slot1._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 268
//Net (Net)
package {
import flash.net.*;
import flash.events.*;
public class Net {
private static var loader:URLLoader;
private static var request:URLRequest;
public static function sendData(_arg1:URLVariables, _arg2:String, _arg3:Function, _arg4:Function):void{
request = new URLRequest(_arg2);
request.data = _arg1;
request.method = URLRequestMethod.POST;
trace(((("sendToURL: " + request.url) + "?") + request.data));
sendToURL(request);
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, _arg3, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, _arg4, false, 0, true);
loader.load(request);
}
public static function getURL(_arg1:String):void{
var url = _arg1;
try {
navigateToURL(new URLRequest(url), "_blank");
} catch(e) {
trace(("Net.getURL:e=" + e));
};
}
}
}//package
Section 269
//SndBg (SndBg)
package {
import flash.media.*;
public dynamic class SndBg extends Sound {
}
}//package
Section 270
//SndCoin (SndCoin)
package {
import flash.media.*;
public dynamic class SndCoin extends Sound {
}
}//package
Section 271
//SndHit (SndHit)
package {
import flash.media.*;
public dynamic class SndHit extends Sound {
}
}//package
Section 272
//SndHp (SndHp)
package {
import flash.media.*;
public dynamic class SndHp extends Sound {
}
}//package
Section 273
//SndPress (SndPress)
package {
import flash.media.*;
public dynamic class SndPress extends Sound {
}
}//package
Section 274
//SndShield (SndShield)
package {
import flash.media.*;
public dynamic class SndShield extends Sound {
}
}//package
Section 275
//start_line (start_line)
package {
import flash.display.*;
public dynamic class start_line extends MovieClip {
}
}//package